@code.store/arcxp-sdk-ts 4.29.0 → 4.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/content/index.d.ts +2 -1
- package/dist/api/content/index.js +5 -0
- package/dist/api/content/index.js.map +1 -1
- package/dist/api/content/types.d.ts +6 -0
- package/dist/api/websked/index.d.ts +5 -2
- package/dist/api/websked/index.js +16 -0
- package/dist/api/websked/index.js.map +1 -1
- package/dist/api/websked/types.d.ts +6 -1
- package/package.json +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { GetStoryParams, SearchParams, SearchResponse } from './types';
|
|
1
|
+
import { GetStoriesByIdsParams, GetStoryParams, SearchParams, SearchResponse } from './types';
|
|
2
2
|
import { ArcAbstractAPI, ArcAPIOptions } from '../abstract-api';
|
|
3
3
|
import { AStory } from '../../types/story';
|
|
4
4
|
export declare class ArcContent extends ArcAbstractAPI {
|
|
5
5
|
constructor(options: ArcAPIOptions);
|
|
6
6
|
getStory(params: GetStoryParams): Promise<AStory>;
|
|
7
7
|
search(params: SearchParams): Promise<SearchResponse>;
|
|
8
|
+
getStoriesByIds(params: GetStoriesByIdsParams): Promise<SearchResponse>;
|
|
8
9
|
}
|
|
@@ -17,6 +17,11 @@ class ArcContent extends abstract_api_1.ArcAbstractAPI {
|
|
|
17
17
|
const { data } = await this.client.get(`/search?${search}`);
|
|
18
18
|
return data;
|
|
19
19
|
}
|
|
20
|
+
async getStoriesByIds(params) {
|
|
21
|
+
const search = (0, querystring_1.stringify)({ ...params, ids: params.ids.join(',') });
|
|
22
|
+
const { data } = await this.client.get(`/ids?${search}`);
|
|
23
|
+
return data;
|
|
24
|
+
}
|
|
20
25
|
}
|
|
21
26
|
exports.ArcContent = ArcContent;
|
|
22
27
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/content/index.ts"],"names":[],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G,IAAA,uBAAS,EAAC,MAAM,CAAC,CAAC;QAEjC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,MAAM,EAAE,CAAC,CAAC;QAC5D,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,MAA6B;QACjD,MAAM,MAAM,GAAG,IAAA,uBAAS,EAAC,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACnE,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,MAAM,EAAE,CAAC,CAAC;QACzD,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAxBD,gCAwBC"}
|
|
@@ -6,6 +6,12 @@ export type GetStoryParams = {
|
|
|
6
6
|
website: string;
|
|
7
7
|
included_fields?: string;
|
|
8
8
|
};
|
|
9
|
+
export type GetStoriesByIdsParams = {
|
|
10
|
+
ids: string[];
|
|
11
|
+
published?: boolean;
|
|
12
|
+
website: string;
|
|
13
|
+
included_fields?: string;
|
|
14
|
+
};
|
|
9
15
|
export type SearchParams = {
|
|
10
16
|
website: string;
|
|
11
17
|
q?: string;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { ArcAbstractAPI, ArcAPIOptions } from '../abstract-api';
|
|
2
|
-
import { CreateTaskPayload, CreateTaskResponse, GetPublicationsResponse, ReportStatusChangePayload,
|
|
2
|
+
import { CreateTaskPayload, CreateTaskResponse, GetEditionTimesResponse, GetPublicationsResponse, ReportStatusChangePayload, SectionEdition, WebskedPublication } from './types';
|
|
3
3
|
export declare class ArcWebsked extends ArcAbstractAPI {
|
|
4
4
|
constructor(options: ArcAPIOptions);
|
|
5
5
|
reportStatusChange(payload: ReportStatusChangePayload): Promise<void>;
|
|
6
6
|
createTask(payload: CreateTaskPayload): Promise<CreateTaskResponse>;
|
|
7
|
-
|
|
7
|
+
getEditionTimes(publicationId: string, startDate: number, endDate: number, numEditions?: number): Promise<GetEditionTimesResponse>;
|
|
8
|
+
getSectionStories(publicationId: string, sectionId: string, timestamp: number, includeStories?: boolean): Promise<SectionEdition>;
|
|
9
|
+
getSectionEditions(publicationId: string, sectionId: string, startDate: number, numEditions?: number): Promise<SectionEdition[]>;
|
|
8
10
|
getPublications(nameRegex: string): Promise<GetPublicationsResponse>;
|
|
11
|
+
getPublicationById(publicationId: string): Promise<WebskedPublication>;
|
|
9
12
|
}
|
|
@@ -14,14 +14,30 @@ class ArcWebsked extends abstract_api_1.ArcAbstractAPI {
|
|
|
14
14
|
const { data } = await this.client.post('/tasks', payload);
|
|
15
15
|
return data;
|
|
16
16
|
}
|
|
17
|
+
async getEditionTimes(publicationId, startDate, endDate, numEditions = 1) {
|
|
18
|
+
const { data } = await this.client.get(`/publications/${publicationId}/editionTimes`, {
|
|
19
|
+
params: { startDate, endDate, numEditions },
|
|
20
|
+
});
|
|
21
|
+
return data;
|
|
22
|
+
}
|
|
17
23
|
async getSectionStories(publicationId, sectionId, timestamp, includeStories = true) {
|
|
18
24
|
const { data } = await this.client.get(`/publications/${publicationId}/sections/${sectionId}/editions/${timestamp}`, { params: { includeStories } });
|
|
19
25
|
return data;
|
|
20
26
|
}
|
|
27
|
+
async getSectionEditions(publicationId, sectionId, startDate, numEditions = 100) {
|
|
28
|
+
const { data } = await this.client.get(`/publications/${publicationId}/sections/${sectionId}/editions`, {
|
|
29
|
+
params: { startDate, numEditions },
|
|
30
|
+
});
|
|
31
|
+
return data;
|
|
32
|
+
}
|
|
21
33
|
async getPublications(nameRegex) {
|
|
22
34
|
const { data } = await this.client.get(`/publications`, { params: { nameRegex } });
|
|
23
35
|
return data;
|
|
24
36
|
}
|
|
37
|
+
async getPublicationById(publicationId) {
|
|
38
|
+
const { data } = await this.client.get(`/publications/${publicationId}`);
|
|
39
|
+
return data;
|
|
40
|
+
}
|
|
25
41
|
}
|
|
26
42
|
exports.ArcWebsked = ArcWebsked;
|
|
27
43
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/websked/index.ts"],"names":[],"mappings":";;;AAAA,kDAAgE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/websked/index.ts"],"names":[],"mappings":";;;AAAA,kDAAgE;AAWhE,MAAa,UAAW,SAAQ,6BAAc;IAC5C,YAAY,OAAsB;QAChC,KAAK,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,OAAkC;QACzD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAO,6BAA6B,EAAE,OAAO,CAAC,CAAC;QACtF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,OAA0B;QACzC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC3D,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,eAAe,CACnB,aAAqB,EACrB,SAAiB,EACjB,OAAe,EACf,WAAW,GAAG,CAAC;QAEf,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,iBAAiB,aAAa,eAAe,EAAE;YACpF,MAAM,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE;SAC5C,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,iBAAiB,CACrB,aAAqB,EACrB,SAAiB,EACjB,SAAiB,EACjB,cAAc,GAAG,IAAI;QAErB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CACpC,iBAAiB,aAAa,aAAa,SAAS,aAAa,SAAS,EAAE,EAC5E,EAAE,MAAM,EAAE,EAAE,cAAc,EAAE,EAAE,CAC/B,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,kBAAkB,CACtB,aAAqB,EACrB,SAAiB,EACjB,SAAiB,EACjB,WAAW,GAAG,GAAG;QAEjB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,iBAAiB,aAAa,aAAa,SAAS,WAAW,EAAE;YACtG,MAAM,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE;SACnC,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,SAAiB;QACrC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,eAAe,EAAE,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC;QACnF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,aAAqB;QAC5C,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,iBAAiB,aAAa,EAAE,CAAC,CAAC;QACzE,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA7DD,gCA6DC"}
|
|
@@ -177,7 +177,7 @@ export interface WebskedStoryImage {
|
|
|
177
177
|
width: number;
|
|
178
178
|
location: (string | null)[];
|
|
179
179
|
}
|
|
180
|
-
export type
|
|
180
|
+
export type SectionEdition = {
|
|
181
181
|
id: string;
|
|
182
182
|
publicationId: string;
|
|
183
183
|
sectionId: string;
|
|
@@ -190,6 +190,7 @@ export type SectionStoriesPayload = {
|
|
|
190
190
|
storyIds: string[];
|
|
191
191
|
stories?: WebskedStory[];
|
|
192
192
|
};
|
|
193
|
+
export type SectionStoriesPayload = SectionEdition;
|
|
193
194
|
export interface WebskedPublication {
|
|
194
195
|
createdDate: number;
|
|
195
196
|
createdBy: string;
|
|
@@ -212,3 +213,7 @@ export type GetPublicationsResponse = {
|
|
|
212
213
|
pageSize: number;
|
|
213
214
|
results: WebskedPublication[];
|
|
214
215
|
};
|
|
216
|
+
export type GetEditionTimesResponse = {
|
|
217
|
+
sections: string[];
|
|
218
|
+
publicationTime: number;
|
|
219
|
+
}[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code.store/arcxp-sdk-ts",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.31.0",
|
|
4
4
|
"description": "A strongly typed set of ArcXP API's and utilities reduce the amount of work required to develop with ArcXP, starting with reducing the boilerplate code you have to write.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./dist/index.js",
|