1 | # next-ft-api-client
|
2 | No caching, no models, no complexity, none of that or any of that.
|
3 |
|
4 | ```
|
5 | npm install --save next-ft-api-client
|
6 | ```
|
7 |
|
8 | ```js
|
9 | var api = require('next-ft-api-client');
|
10 | ```
|
11 |
|
12 | ## `.content(opts)`
|
13 | - `uuid` - uuid (or array of uuids) of wanted content
|
14 |
|
15 | If `uuid` is a string return a Promise that resolves with V3 Elasticsearch content, if `uuid` is an array, returns a Promise that resolves with an array of content.
|
16 |
|
17 | ## `.contentAnnotatedBy(opts)`
|
18 | - `uuid` - uuid of thing wanted to select content by
|
19 | - `count` - number of items of content to return (default 10)
|
20 |
|
21 | Returns with a Promise that resolves with an array of V2 content objects.
|
22 |
|
23 | ## `.lists(opts)`
|
24 | - `uuid` - uuid of wanted list
|
25 |
|
26 | Returns with a Promise that resolves with a list.
|
27 |
|
28 | ## `.organisations(opts)`
|
29 | - `uuid` - uuid of wanted organisation
|
30 |
|
31 | Returns with a Promise that resolves with an organisation.
|
32 |
|
33 | ## `.people(opts)`
|
34 | - `uuid` - uuid of wanted person
|
35 |
|
36 | Returns with a Promise that resolves with a person.
|
37 |
|
38 | ## `.search(opts)`
|
39 | - `filter` - search filter. Either an array of [ fieldname, value ] or an Elasticsearch filter object.
|
40 | - `fields` - an array of source document fields to fetch
|
41 | - `count` - number of documents to return (default 10)
|
42 | - `offset` - number of documents to offset by (default 0)
|
43 |
|
44 | Returns a promise that resolves an array of documents from the V3 Elasticsearch index.
|
45 |
|
46 | ## `.things(opts)`
|
47 | - `identifierValue` - an array of source thing ids you wish to fetch
|
48 | - `identifierType` - property type of indetifier you wish to search on, such as `prefLabel` or `idV1` (default 'idV1')
|
49 | - `authority` - the authority the terms belong too (defaults to FT-TME: http://api.ft.com/system/FT-TME)
|
50 |
|
51 | Returns with a Promise that resolves with an array of things.
|
52 |
|
53 | ## `.mapping(uuid, taxonomy)`
|
54 | - `uuid` - uuid of thing to map
|
55 | - `taxonomy` - taxonomy of thing to map
|
56 |
|
57 | Returns with a Promise that resolves with the mapped concept.
|
58 |
|
59 | ## `.hui(opts)`
|
60 | - `model` - string of the type of model you want returned (default 'content')
|
61 | - `industry` - uuid of an industry
|
62 | - `position` - uuid of a position
|
63 | - `sector` - uuid of a sector
|
64 | - `country` - uuid of a country
|
65 | - `period` - time period to use e.g last-1-day, last-1-week (default last-1-day)
|
66 | - `count` - number of UUIDs to return (default 10)
|
67 |
|
68 | Returns with a Promise that resolves with a list.
|