@code.store/arcxp-sdk-ts 4.32.1 → 4.34.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/ans/doc.d.ts +56 -0
- package/dist/ans/doc.js +132 -0
- package/dist/ans/doc.js.map +1 -0
- package/dist/ans/image.d.ts +5 -0
- package/dist/ans/image.js +12 -0
- package/dist/ans/image.js.map +1 -0
- package/dist/ans/index.d.ts +3 -0
- package/dist/ans/index.js +10 -0
- package/dist/ans/index.js.map +1 -0
- package/dist/ans/story.d.ts +58 -0
- package/dist/ans/story.js +83 -0
- package/dist/ans/story.js.map +1 -0
- package/dist/api/abstract-api.d.ts +1 -1
- package/dist/api/abstract-api.js +1 -1
- package/dist/api/abstract-api.js.map +1 -1
- package/dist/api/author/index.d.ts +2 -2
- package/dist/api/author/index.js +1 -1
- package/dist/api/author/index.js.map +1 -1
- package/dist/api/author/types.d.ts +1 -1
- package/dist/api/content/index.d.ts +3 -3
- package/dist/api/content/index.js +5 -7
- package/dist/api/content/index.js.map +1 -1
- package/dist/api/content/types.d.ts +2 -2
- package/dist/api/content-ops/index.d.ts +2 -2
- package/dist/api/content-ops/index.js +4 -4
- package/dist/api/content-ops/index.js.map +1 -1
- package/dist/api/draft/index.d.ts +2 -2
- package/dist/api/global-settings/index.d.ts +2 -2
- package/dist/api/global-settings/index.js +2 -2
- package/dist/api/global-settings/index.js.map +1 -1
- package/dist/api/identity/index.d.ts +2 -2
- package/dist/api/identity/index.js.map +1 -1
- package/dist/api/ifx/index.d.ts +2 -2
- package/dist/api/ifx/index.js +2 -2
- package/dist/api/ifx/index.js.map +1 -1
- package/dist/api/index.d.ts +7 -6
- package/dist/api/index.js +5 -5
- package/dist/api/index.js.map +1 -1
- package/dist/api/migration-center/index.d.ts +2 -2
- package/dist/api/migration-center/index.js +4 -7
- package/dist/api/migration-center/index.js.map +1 -1
- package/dist/api/migration-center/types.d.ts +8 -6
- package/dist/api/migration-center/types.js.map +1 -1
- package/dist/api/photo-center/index.d.ts +4 -4
- package/dist/api/photo-center/index.js +3 -3
- package/dist/api/photo-center/index.js.map +1 -1
- package/dist/api/photo-center/types.d.ts +2 -2
- package/dist/api/redirect/index.d.ts +2 -2
- package/dist/api/redirect/index.js +1 -1
- package/dist/api/redirect/index.js.map +1 -1
- package/dist/api/retail-events/index.d.ts +1 -1
- package/dist/api/retail-events/index.js.map +1 -1
- package/dist/api/sales/index.d.ts +2 -2
- package/dist/api/sales/index.js +1 -1
- package/dist/api/sales/index.js.map +1 -1
- package/dist/api/signing-service/index.d.ts +2 -2
- package/dist/api/signing-service/index.js.map +1 -1
- package/dist/api/site/index.d.ts +3 -3
- package/dist/api/site/index.js.map +1 -1
- package/dist/api/site/types.d.ts +1 -1
- package/dist/api/tags/index.d.ts +2 -2
- package/dist/api/tags/index.js +4 -4
- package/dist/api/tags/index.js.map +1 -1
- package/dist/api/websked/index.d.ts +2 -2
- package/dist/api/websked/index.js +1 -1
- package/dist/api/websked/index.js.map +1 -1
- package/dist/api/ws.client.d.ts +1 -1
- package/dist/api/ws.client.js +1 -1
- package/dist/api/ws.client.js.map +1 -1
- package/dist/content-elements/index.d.ts +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/scripts/json-schema-to-ts.js +2 -2
- package/dist/scripts/json-schema-to-ts.js.map +1 -1
- package/dist/tests/ans/story.test.d.ts +1 -0
- package/dist/tests/ans/story.test.js +69 -0
- package/dist/tests/ans/story.test.js.map +1 -0
- package/dist/tests/api/utils.test.js +1 -1
- package/dist/tests/api/utils.test.js.map +1 -1
- package/dist/types/author.js +0 -1
- package/dist/types/author.js.map +1 -1
- package/dist/types/gallery.d.ts +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +3 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/story.js +0 -1
- package/dist/types/story.js.map +1 -1
- package/dist/types/utils.d.ts +2 -0
- package/dist/types/utils.js +3 -0
- package/dist/types/utils.js.map +1 -0
- package/dist/types/video.d.ts +1425 -0
- package/dist/types/video.js +8 -0
- package/dist/types/video.js.map +1 -0
- package/dist/utils/arc/ans.d.ts +1 -1
- package/dist/utils/arc/content.d.ts +1 -1
- package/dist/utils/arc/content.js +1 -4
- package/dist/utils/arc/content.js.map +1 -1
- package/dist/utils/arc/index.d.ts +1 -1
- package/dist/utils/arc/index.js +2 -2
- package/dist/utils/arc/index.js.map +1 -1
- package/dist/utils/cache.d.ts +1 -1
- package/dist/utils/cache.js +3 -3
- package/dist/utils/cache.js.map +1 -1
- package/dist/utils/decorator.d.ts +2 -2
- package/dist/utils/decorator.js +1 -1
- package/dist/utils/decorator.js.map +1 -1
- package/package.json +5 -6
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { ANSContent, CirculationReference, PostANSParams, PostANSPayload } from '../api/migration-center/types';
|
|
2
|
+
import type { ArcTypes, ContentElementType } from '..';
|
|
3
|
+
import type { MaybePromise, Optional } from '../types/utils';
|
|
4
|
+
/**
|
|
5
|
+
* Base class for all arc entities, it provides common methods and properties
|
|
6
|
+
* If you want to create a new entity subtype you should extend this class
|
|
7
|
+
*
|
|
8
|
+
* Use case: You want to migrate stories from BBC
|
|
9
|
+
* You define `class BBCStory extends ArcDocument<ArcTypes.Story.AStory>` and implement all abstract methods
|
|
10
|
+
* Then you can override the specific methods to enrich the story with the data from BBC
|
|
11
|
+
*
|
|
12
|
+
* To migrate it call .migrate() method
|
|
13
|
+
*/
|
|
14
|
+
export declare abstract class ArcDocument<ANS extends ANSContent> {
|
|
15
|
+
ans: ANS | null;
|
|
16
|
+
circulations: CirculationReference[];
|
|
17
|
+
init(): Promise<void>;
|
|
18
|
+
abstract get sourceId(): string;
|
|
19
|
+
abstract get sourceType(): string;
|
|
20
|
+
abstract get websiteId(): string;
|
|
21
|
+
abstract get legacyUrl(): string;
|
|
22
|
+
abstract get arcId(): string;
|
|
23
|
+
abstract get type(): string;
|
|
24
|
+
abstract get groupId(): string;
|
|
25
|
+
abstract get version(): ArcTypes.Story.DescribesTheANSVersionOfThisObject;
|
|
26
|
+
abstract getAns(): MaybePromise<ANS>;
|
|
27
|
+
abstract post(params: PostANSParams, payload: PostANSPayload): Promise<void>;
|
|
28
|
+
migrate(): Promise<{
|
|
29
|
+
params: PostANSParams;
|
|
30
|
+
payload: PostANSPayload<ANS>;
|
|
31
|
+
}>;
|
|
32
|
+
private payload;
|
|
33
|
+
private params;
|
|
34
|
+
protected get additionalProperties(): PostANSPayload['arcAdditionalProperties'];
|
|
35
|
+
protected get priority(): 'historical' | 'live';
|
|
36
|
+
protected getDistributor(): MaybePromise<Optional<ArcTypes.Story.Distributor>>;
|
|
37
|
+
protected getLanguage(): string;
|
|
38
|
+
protected getComments(): Optional<ArcTypes.Story.Comments>;
|
|
39
|
+
protected getSource(): Optional<ArcTypes.Story.Source>;
|
|
40
|
+
protected getSubheadlines(): Optional<ArcTypes.Story.SubHeadlines>;
|
|
41
|
+
protected getDescription(): Optional<ArcTypes.Story.Description>;
|
|
42
|
+
protected formatDate(date?: Date): string | undefined;
|
|
43
|
+
protected getDisplayDate(): Optional<Date>;
|
|
44
|
+
protected getContentElements(): Promise<ContentElementType<any>[]>;
|
|
45
|
+
protected getPublicationDate(): Optional<Date>;
|
|
46
|
+
protected getHeadlines(): Optional<ArcTypes.Story.Headlines>;
|
|
47
|
+
protected getTags(): MaybePromise<Optional<ArcTypes.Story.Tag[]>>;
|
|
48
|
+
protected getSubtype(): MaybePromise<Optional<ArcTypes.Story.SubtypeOrTemplate>>;
|
|
49
|
+
protected getLabel(): MaybePromise<Optional<ArcTypes.Story.Label>>;
|
|
50
|
+
protected getRelatedContent(): MaybePromise<Optional<ArcTypes.Story.Related_Content>>;
|
|
51
|
+
protected getPromoItems(): Promise<Optional<ArcTypes.Story.PromoItems>>;
|
|
52
|
+
protected getWebskedStatusCode(): MaybePromise<ArcTypes.Story.WorkflowInformation['status_code']>;
|
|
53
|
+
protected getCreditsBy(): MaybePromise<ArcTypes.Story.By>;
|
|
54
|
+
protected getCirculations(): MaybePromise<CirculationReference[]>;
|
|
55
|
+
protected getEditorNote(): MaybePromise<Optional<ArcTypes.Story.Editor_Note>>;
|
|
56
|
+
}
|
package/dist/ans/doc.js
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArcDocument = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Base class for all arc entities, it provides common methods and properties
|
|
6
|
+
* If you want to create a new entity subtype you should extend this class
|
|
7
|
+
*
|
|
8
|
+
* Use case: You want to migrate stories from BBC
|
|
9
|
+
* You define `class BBCStory extends ArcDocument<ArcTypes.Story.AStory>` and implement all abstract methods
|
|
10
|
+
* Then you can override the specific methods to enrich the story with the data from BBC
|
|
11
|
+
*
|
|
12
|
+
* To migrate it call .migrate() method
|
|
13
|
+
*/
|
|
14
|
+
class ArcDocument {
|
|
15
|
+
constructor() {
|
|
16
|
+
this.ans = null;
|
|
17
|
+
this.circulations = [];
|
|
18
|
+
}
|
|
19
|
+
async init() {
|
|
20
|
+
// fetch necessary data and validate it here
|
|
21
|
+
}
|
|
22
|
+
async migrate() {
|
|
23
|
+
await this.init();
|
|
24
|
+
const payload = await this.payload();
|
|
25
|
+
const params = await this.params();
|
|
26
|
+
await this.post(params, payload);
|
|
27
|
+
return { payload, params };
|
|
28
|
+
}
|
|
29
|
+
async payload() {
|
|
30
|
+
this.ans = await this.getAns();
|
|
31
|
+
this.circulations = await this.getCirculations();
|
|
32
|
+
return {
|
|
33
|
+
sourceId: this.sourceId,
|
|
34
|
+
sourceType: this.sourceType,
|
|
35
|
+
ANS: this.ans,
|
|
36
|
+
circulations: this.circulations,
|
|
37
|
+
arcAdditionalProperties: this.additionalProperties,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
async params() {
|
|
41
|
+
if (!this.websiteId) {
|
|
42
|
+
throw new Error('Website is not initialized! get params() should be called after payload()!');
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
website: this.websiteId,
|
|
46
|
+
groupId: this.groupId,
|
|
47
|
+
priority: this.priority,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
get additionalProperties() {
|
|
51
|
+
return {
|
|
52
|
+
story: {
|
|
53
|
+
publish: false,
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
get priority() {
|
|
58
|
+
return 'historical';
|
|
59
|
+
}
|
|
60
|
+
getDistributor() {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
getLanguage() {
|
|
64
|
+
return 'en-GB';
|
|
65
|
+
}
|
|
66
|
+
getComments() {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
getSource() {
|
|
70
|
+
return {
|
|
71
|
+
name: 'code-store',
|
|
72
|
+
system: 'code-store',
|
|
73
|
+
source_id: this.sourceId,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
getSubheadlines() {
|
|
77
|
+
return {
|
|
78
|
+
basic: '',
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
getDescription() {
|
|
82
|
+
return this.getSubheadlines();
|
|
83
|
+
}
|
|
84
|
+
formatDate(date) {
|
|
85
|
+
if (!date)
|
|
86
|
+
return;
|
|
87
|
+
return date.toISOString();
|
|
88
|
+
}
|
|
89
|
+
getDisplayDate() {
|
|
90
|
+
return new Date();
|
|
91
|
+
}
|
|
92
|
+
async getContentElements() {
|
|
93
|
+
return [];
|
|
94
|
+
}
|
|
95
|
+
getPublicationDate() {
|
|
96
|
+
return new Date();
|
|
97
|
+
}
|
|
98
|
+
getHeadlines() {
|
|
99
|
+
return {
|
|
100
|
+
basic: '',
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
getTags() {
|
|
104
|
+
return [];
|
|
105
|
+
}
|
|
106
|
+
getSubtype() {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
getLabel() {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
getRelatedContent() {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
async getPromoItems() {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
getWebskedStatusCode() {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
getCreditsBy() {
|
|
122
|
+
return [];
|
|
123
|
+
}
|
|
124
|
+
getCirculations() {
|
|
125
|
+
return [];
|
|
126
|
+
}
|
|
127
|
+
getEditorNote() {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
exports.ArcDocument = ArcDocument;
|
|
132
|
+
//# sourceMappingURL=doc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doc.js","sourceRoot":"","sources":["../../src/ans/doc.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArcImage = void 0;
|
|
4
|
+
const doc_1 = require("./doc");
|
|
5
|
+
class ArcImage extends doc_1.ArcDocument {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.type = 'image';
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.ArcImage = ArcImage;
|
|
12
|
+
//# sourceMappingURL=image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.js","sourceRoot":"","sources":["../../src/ans/image.ts"],"names":[],"mappings":";;;AACA,+BAAoC;AAEpC,MAAsB,QAAS,SAAQ,iBAAmC;IAA1E;;QACE,SAAI,GAAG,OAAgB,CAAC;IAC1B,CAAC;CAAA;AAFD,4BAEC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArcImage = exports.ArcStory = exports.ArcDocument = void 0;
|
|
4
|
+
var doc_1 = require("./doc");
|
|
5
|
+
Object.defineProperty(exports, "ArcDocument", { enumerable: true, get: function () { return doc_1.ArcDocument; } });
|
|
6
|
+
var story_1 = require("./story");
|
|
7
|
+
Object.defineProperty(exports, "ArcStory", { enumerable: true, get: function () { return story_1.ArcStory; } });
|
|
8
|
+
var image_1 = require("./image");
|
|
9
|
+
Object.defineProperty(exports, "ArcImage", { enumerable: true, get: function () { return image_1.ArcImage; } });
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ans/index.ts"],"names":[],"mappings":";;;AAAA,6BAAoC;AAA3B,kGAAA,WAAW,OAAA;AACpB,iCAAmC;AAA1B,iGAAA,QAAQ,OAAA;AACjB,iCAAmC;AAA1B,iGAAA,QAAQ,OAAA"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { Story } from '../types';
|
|
2
|
+
import { ArcDocument } from './doc';
|
|
3
|
+
/**
|
|
4
|
+
* Base class for all arc stories, it provides common methods and properties
|
|
5
|
+
* If you want to create a new story subtype you should extend this class
|
|
6
|
+
*
|
|
7
|
+
* Use case: You want to migrate stories from BBC
|
|
8
|
+
* You define `class BBCStory extends ArcStory` and implement all abstract methods
|
|
9
|
+
* Then you need to override the specific methods to enrich the story with the data from BBC
|
|
10
|
+
*
|
|
11
|
+
* For example:
|
|
12
|
+
* To add tag to BBC stories you need to override
|
|
13
|
+
* protected getTags(): MaybePromise<ArcTypes.Story.Tag[]> {
|
|
14
|
+
* return [{
|
|
15
|
+
* slug: 'bbc',
|
|
16
|
+
* text: 'bbc',
|
|
17
|
+
* }];
|
|
18
|
+
* }
|
|
19
|
+
*/
|
|
20
|
+
export declare abstract class ArcStory extends ArcDocument<Story.AStory> {
|
|
21
|
+
type: "story";
|
|
22
|
+
getAns(): Promise<{
|
|
23
|
+
type: "story";
|
|
24
|
+
_id: string;
|
|
25
|
+
version: "0.10.10";
|
|
26
|
+
website: string;
|
|
27
|
+
canonical_website: string;
|
|
28
|
+
language: string;
|
|
29
|
+
subtype: import("../types/utils").Optional<string>;
|
|
30
|
+
label: import("../types/utils").Optional<Story.Label>;
|
|
31
|
+
editor_note: import("../types/utils").Optional<string>;
|
|
32
|
+
credits: {
|
|
33
|
+
by: Story.By;
|
|
34
|
+
};
|
|
35
|
+
headlines: import("../types/utils").Optional<Story.Headlines>;
|
|
36
|
+
subheadlines: import("../types/utils").Optional<Story.SubHeadlines>;
|
|
37
|
+
description: import("../types/utils").Optional<Story.Description>;
|
|
38
|
+
distributor: import("../types/utils").Optional<Story.Distributor>;
|
|
39
|
+
promo_items: import("../types/utils").Optional<Story.PromoItems>;
|
|
40
|
+
related_content: import("../types/utils").Optional<Story.Related_Content>;
|
|
41
|
+
created_date: string | undefined;
|
|
42
|
+
first_publish_date: string | undefined;
|
|
43
|
+
publish_date: string | undefined;
|
|
44
|
+
display_date: string | undefined;
|
|
45
|
+
source: import("../types/utils").Optional<Story.Source>;
|
|
46
|
+
comments: import("../types/utils").Optional<Story.Comments>;
|
|
47
|
+
taxonomy: {
|
|
48
|
+
tags: import("../types/utils").Optional<Story.Tag[]>;
|
|
49
|
+
};
|
|
50
|
+
workflow: {
|
|
51
|
+
status_code: number | undefined;
|
|
52
|
+
};
|
|
53
|
+
content_elements: any[];
|
|
54
|
+
additional_properties: {
|
|
55
|
+
url: string;
|
|
56
|
+
};
|
|
57
|
+
}>;
|
|
58
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArcStory = void 0;
|
|
4
|
+
const doc_1 = require("./doc");
|
|
5
|
+
/**
|
|
6
|
+
* Base class for all arc stories, it provides common methods and properties
|
|
7
|
+
* If you want to create a new story subtype you should extend this class
|
|
8
|
+
*
|
|
9
|
+
* Use case: You want to migrate stories from BBC
|
|
10
|
+
* You define `class BBCStory extends ArcStory` and implement all abstract methods
|
|
11
|
+
* Then you need to override the specific methods to enrich the story with the data from BBC
|
|
12
|
+
*
|
|
13
|
+
* For example:
|
|
14
|
+
* To add tag to BBC stories you need to override
|
|
15
|
+
* protected getTags(): MaybePromise<ArcTypes.Story.Tag[]> {
|
|
16
|
+
* return [{
|
|
17
|
+
* slug: 'bbc',
|
|
18
|
+
* text: 'bbc',
|
|
19
|
+
* }];
|
|
20
|
+
* }
|
|
21
|
+
*/
|
|
22
|
+
class ArcStory extends doc_1.ArcDocument {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
this.type = 'story';
|
|
26
|
+
}
|
|
27
|
+
async getAns() {
|
|
28
|
+
const id = this.arcId;
|
|
29
|
+
const publicationDate = this.getPublicationDate();
|
|
30
|
+
const headlines = this.getHeadlines();
|
|
31
|
+
const subheadlines = this.getSubheadlines();
|
|
32
|
+
const description = this.getDescription();
|
|
33
|
+
const language = this.getLanguage();
|
|
34
|
+
const tags = await this.getTags();
|
|
35
|
+
const subtype = await this.getSubtype();
|
|
36
|
+
const label = await this.getLabel();
|
|
37
|
+
const by = await this.getCreditsBy();
|
|
38
|
+
const relatedContent = await this.getRelatedContent();
|
|
39
|
+
const editorNote = await this.getEditorNote();
|
|
40
|
+
const distributor = await this.getDistributor();
|
|
41
|
+
const promoItems = await this.getPromoItems();
|
|
42
|
+
const contentElements = await this.getContentElements();
|
|
43
|
+
const webskedStatusCode = await this.getWebskedStatusCode();
|
|
44
|
+
return {
|
|
45
|
+
type: this.type,
|
|
46
|
+
_id: id,
|
|
47
|
+
version: this.version,
|
|
48
|
+
website: this.websiteId,
|
|
49
|
+
canonical_website: this.websiteId,
|
|
50
|
+
language,
|
|
51
|
+
subtype,
|
|
52
|
+
label,
|
|
53
|
+
editor_note: editorNote,
|
|
54
|
+
credits: {
|
|
55
|
+
by,
|
|
56
|
+
},
|
|
57
|
+
headlines,
|
|
58
|
+
subheadlines,
|
|
59
|
+
description,
|
|
60
|
+
distributor,
|
|
61
|
+
promo_items: promoItems,
|
|
62
|
+
related_content: relatedContent,
|
|
63
|
+
created_date: this.formatDate(new Date()),
|
|
64
|
+
first_publish_date: this.formatDate(publicationDate),
|
|
65
|
+
publish_date: this.formatDate(publicationDate),
|
|
66
|
+
display_date: this.formatDate(this.getDisplayDate()),
|
|
67
|
+
source: this.getSource(),
|
|
68
|
+
comments: this.getComments(),
|
|
69
|
+
taxonomy: {
|
|
70
|
+
tags,
|
|
71
|
+
},
|
|
72
|
+
workflow: {
|
|
73
|
+
status_code: webskedStatusCode,
|
|
74
|
+
},
|
|
75
|
+
content_elements: contentElements,
|
|
76
|
+
additional_properties: {
|
|
77
|
+
url: this.legacyUrl,
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.ArcStory = ArcStory;
|
|
83
|
+
//# sourceMappingURL=story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"story.js","sourceRoot":"","sources":["../../src/ans/story.ts"],"names":[],"mappings":";;;AACA,+BAAoC;AAEpC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAsB,QAAS,SAAQ,iBAAyB;IAAhE;;QACE,SAAI,GAAG,OAAgB,CAAC;IAyD1B,CAAC;IAvDC,KAAK,CAAC,MAAM;QACV,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QACtB,MAAM,eAAe,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAClD,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QACtC,MAAM,YAAY,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QAC5C,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QAC1C,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QACpC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;QAClC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QACxC,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;QACpC,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;QACrC,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACtD,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;QAC9C,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAChD,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;QAC9C,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACxD,MAAM,iBAAiB,GAAG,MAAM,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAE5D,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,GAAG,EAAE,EAAE;YACP,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,OAAO,EAAE,IAAI,CAAC,SAAS;YACvB,iBAAiB,EAAE,IAAI,CAAC,SAAS;YACjC,QAAQ;YACR,OAAO;YACP,KAAK;YACL,WAAW,EAAE,UAAU;YACvB,OAAO,EAAE;gBACP,EAAE;aACH;YACD,SAAS;YACT,YAAY;YACZ,WAAW;YACX,WAAW;YACX,WAAW,EAAE,UAAU;YACvB,eAAe,EAAE,cAAc;YAC/B,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,IAAI,EAAE,CAAC;YACzC,kBAAkB,EAAE,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC;YACpD,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC;YAC9C,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;YACpD,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE;YACxB,QAAQ,EAAE,IAAI,CAAC,WAAW,EAAE;YAC5B,QAAQ,EAAE;gBACR,IAAI;aACL;YACD,QAAQ,EAAE;gBACR,WAAW,EAAE,iBAAiB;aAC/B;YACD,gBAAgB,EAAE,eAAe;YACjC,qBAAqB,EAAE;gBACrB,GAAG,EAAE,IAAI,CAAC,SAAS;aACpB;SACF,CAAC;IACJ,CAAC;CACF;AA1DD,4BA0DC"}
|
package/dist/api/abstract-api.js
CHANGED
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ArcAbstractAPI = void 0;
|
|
7
7
|
const axios_1 = __importDefault(require("axios"));
|
|
8
|
-
const utils_1 = require("../utils");
|
|
9
8
|
const axios_rate_limit_1 = __importDefault(require("axios-rate-limit"));
|
|
9
|
+
const utils_1 = require("../utils");
|
|
10
10
|
const error_1 = require("./error");
|
|
11
11
|
class ArcAbstractAPI {
|
|
12
12
|
constructor(options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-api.js","sourceRoot":"","sources":["../../src/api/abstract-api.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,oCAAyD;AACzD,
|
|
1
|
+
{"version":3,"file":"abstract-api.js","sourceRoot":"","sources":["../../src/api/abstract-api.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,wEAA4E;AAC5E,oCAAyD;AACzD,mCAAmC;AAUnC,MAAsB,cAAc;IAUlC,YAAY,OAA8B;QAThC,SAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;QAG/B,UAAK,GAAG,EAAE,CAAC;QACX,SAAI,GAAG,EAAE,CAAC;QACV,YAAO,GAAG;YAChB,aAAa,EAAE,EAAE;SAClB,CAAC;QAGA,IAAI,CAAC,IAAI,GAAG,OAAO,OAAO,CAAC,WAAW,CAAC,gBAAgB,oBAAoB,CAAC;QAC5E,IAAI,CAAC,KAAK,GAAG,UAAU,OAAO,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC;QACzD,IAAI,CAAC,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC;QACxC,IAAI,CAAC,MAAM,GAAG,IAAA,0BAAS,EACrB,eAAK,CAAC,MAAM,CAAC;YACX,OAAO,EAAE,WAAW,IAAI,CAAC,IAAI,IAAI,OAAO,CAAC,OAAO,EAAE;YAClD,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAC,EACF,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,EAAE,EAAE,CACjC,CAAC;QAEF,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAA,qCAA6B,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,gBAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7G,CAAC;IAED,SAAS,CAAC,GAAW;QACnB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;CACF;AA5BD,wCA4BC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ListAuthorsParams, ListAuthorsResponse } from './types';
|
|
1
|
+
import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api';
|
|
2
|
+
import type { ListAuthorsParams, ListAuthorsResponse } from './types';
|
|
3
3
|
export declare class ArcAuthor extends ArcAbstractAPI {
|
|
4
4
|
constructor(options: ArcAPIOptions);
|
|
5
5
|
listAuthors(params?: ListAuthorsParams): Promise<ListAuthorsResponse>;
|
package/dist/api/author/index.js
CHANGED
|
@@ -7,7 +7,7 @@ class ArcAuthor extends abstract_api_1.ArcAbstractAPI {
|
|
|
7
7
|
super({ ...options, apiPath: 'author' });
|
|
8
8
|
}
|
|
9
9
|
async listAuthors(params) {
|
|
10
|
-
const { data } = await this.client.get(
|
|
10
|
+
const { data } = await this.client.get('/v2/author-service', { params });
|
|
11
11
|
return data;
|
|
12
12
|
}
|
|
13
13
|
async delete(userId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/author/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/author/index.ts"],"names":[],"mappings":";;;AAAA,kDAAqE;AAGrE,MAAa,SAAU,SAAQ,6BAAc;IAC3C,YAAY,OAAsB;QAChC,KAAK,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC3C,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,MAA0B;QAC1C,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,oBAAoB,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QAEzE,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,MAAc;QACzB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,sBAAsB,MAAM,EAAE,CAAC,CAAC;QAE1E,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAhBD,8BAgBC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { AStory } from '../../types/story';
|
|
2
|
+
import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api';
|
|
3
|
+
import type { GetStoriesByIdsParams, GetStoryParams, SearchParams, SearchResponse } from './types';
|
|
4
4
|
export declare class ArcContent extends ArcAbstractAPI {
|
|
5
5
|
constructor(options: ArcAPIOptions);
|
|
6
6
|
getStory(params: GetStoryParams): Promise<AStory>;
|
|
@@ -2,24 +2,22 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ArcContent = void 0;
|
|
4
4
|
const abstract_api_1 = require("../abstract-api");
|
|
5
|
-
const querystring_1 = require("querystring");
|
|
6
5
|
class ArcContent extends abstract_api_1.ArcAbstractAPI {
|
|
7
6
|
constructor(options) {
|
|
8
7
|
super({ ...options, apiPath: 'content/v4' });
|
|
9
8
|
}
|
|
10
9
|
async getStory(params) {
|
|
11
|
-
const
|
|
12
|
-
const { data } = await this.client.get(`/stories?${search}`);
|
|
10
|
+
const { data } = await this.client.get('/stories', { params });
|
|
13
11
|
return data;
|
|
14
12
|
}
|
|
15
13
|
async search(params) {
|
|
16
|
-
const
|
|
17
|
-
const { data } = await this.client.get(`/search?${search}`);
|
|
14
|
+
const { data } = await this.client.get('/search', { params });
|
|
18
15
|
return data;
|
|
19
16
|
}
|
|
20
17
|
async getStoriesByIds(params) {
|
|
21
|
-
const
|
|
22
|
-
|
|
18
|
+
const { data } = await this.client.get('/ids', {
|
|
19
|
+
params: { ...params, ids: params.ids.join(',') },
|
|
20
|
+
});
|
|
23
21
|
return data;
|
|
24
22
|
}
|
|
25
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/content/index.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/content/index.ts"],"names":[],"mappings":";;;AACA,kDAAqE;AAGrE,MAAa,UAAW,SAAQ,6BAAc;IAC5C,YAAY,OAAsB;QAChC,KAAK,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,MAAsB;QACnC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QAC/D,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,MAAoB;QAC/B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QAC9D,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,MAA6B;QACjD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE;YAC7C,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;SACjD,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AArBD,gCAqBC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AGallery } from '../../types/gallery';
|
|
2
|
-
import { ARedirectObject, AStory } from '../../types/story';
|
|
1
|
+
import type { AGallery } from '../../types/gallery';
|
|
2
|
+
import type { ARedirectObject, AStory } from '../../types/story';
|
|
3
3
|
export type GetStoryParams = {
|
|
4
4
|
_id: string;
|
|
5
5
|
published: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ScheduleOperationPayload, UnscheduleOperationPayload } from './types';
|
|
1
|
+
import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api';
|
|
2
|
+
import type { ScheduleOperationPayload, UnscheduleOperationPayload } from './types';
|
|
3
3
|
export declare class ArcContentOps extends ArcAbstractAPI {
|
|
4
4
|
constructor(options: ArcAPIOptions);
|
|
5
5
|
schedulePublish(payload: ScheduleOperationPayload): Promise<void>;
|
|
@@ -7,19 +7,19 @@ class ArcContentOps extends abstract_api_1.ArcAbstractAPI {
|
|
|
7
7
|
super({ ...options, apiPath: 'contentops/v1' });
|
|
8
8
|
}
|
|
9
9
|
async schedulePublish(payload) {
|
|
10
|
-
const { data } = await this.client.put(
|
|
10
|
+
const { data } = await this.client.put('/publish', payload);
|
|
11
11
|
return data;
|
|
12
12
|
}
|
|
13
13
|
async scheduleUnpublish(payload) {
|
|
14
|
-
const { data } = await this.client.put(
|
|
14
|
+
const { data } = await this.client.put('/unpublish', payload);
|
|
15
15
|
return data;
|
|
16
16
|
}
|
|
17
17
|
async unscheduleUnpublish(payload) {
|
|
18
|
-
const { data } = await this.client.put(
|
|
18
|
+
const { data } = await this.client.put('/unschedule_unpublish', payload);
|
|
19
19
|
return data;
|
|
20
20
|
}
|
|
21
21
|
async unschedulePublish(payload) {
|
|
22
|
-
const { data } = await this.client.put(
|
|
22
|
+
const { data } = await this.client.put('/unschedule_publish', payload);
|
|
23
23
|
return data;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/content-ops/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/content-ops/index.ts"],"names":[],"mappings":";;;AAAA,kDAAqE;AAGrE,MAAa,aAAc,SAAQ,6BAAc;IAC/C,YAAY,OAAsB;QAChC,KAAK,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;IAClD,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,OAAiC;QACrD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAO,UAAU,EAAE,OAAO,CAAC,CAAC;QAElE,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,OAAiC;QACvD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAO,YAAY,EAAE,OAAO,CAAC,CAAC;QAEpE,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,mBAAmB,CAAC,OAAmC;QAC3D,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAO,uBAAuB,EAAE,OAAO,CAAC,CAAC;QAE/E,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,OAAmC;QACzD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAO,qBAAqB,EAAE,OAAO,CAAC,CAAC;QAE7E,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA5BD,sCA4BC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { CreateDocumentRedirectPayload, CreateExternalRedirectPayload, CreateRedirectPayload, DocumentRedirect, ExternalRedirect, Revision,
|
|
1
|
+
import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api';
|
|
2
|
+
import type { CreateDocumentRedirectPayload, CreateExternalRedirectPayload, CreateRedirectPayload, Document, DocumentRedirect, ExternalRedirect, Revision, UpdateDraftRevisionPayload } from './types';
|
|
3
3
|
export declare class ArcDraft extends ArcAbstractAPI {
|
|
4
4
|
constructor(options: ArcAPIOptions);
|
|
5
5
|
generateId(id: string): Promise<string>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Distributor, GetDistributorsParams, GetDistributorsResponse
|
|
1
|
+
import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api';
|
|
2
|
+
import type { CreateDistributorPayload, Distributor, GetDistributorsParams, GetDistributorsResponse } from './types';
|
|
3
3
|
export declare class GlobalSettings extends ArcAbstractAPI {
|
|
4
4
|
constructor(options: ArcAPIOptions);
|
|
5
5
|
getDistributors(params?: GetDistributorsParams): Promise<GetDistributorsResponse>;
|
|
@@ -7,11 +7,11 @@ class GlobalSettings extends abstract_api_1.ArcAbstractAPI {
|
|
|
7
7
|
super({ ...options, apiPath: 'settings/v1' });
|
|
8
8
|
}
|
|
9
9
|
async getDistributors(params) {
|
|
10
|
-
const { data } = await this.client.get(
|
|
10
|
+
const { data } = await this.client.get('/distributor', { params });
|
|
11
11
|
return data;
|
|
12
12
|
}
|
|
13
13
|
async createDistributors(payload) {
|
|
14
|
-
const { data } = await this.client.post(
|
|
14
|
+
const { data } = await this.client.post('/distributor', payload);
|
|
15
15
|
return data;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/global-settings/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/global-settings/index.ts"],"names":[],"mappings":";;;AAAA,kDAAqE;AAGrE,MAAa,cAAe,SAAQ,6BAAc;IAChD,YAAY,OAAsB;QAChC,KAAK,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC,CAAC;IAChD,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,MAA8B;QAClD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAA0B,cAAc,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QAE5F,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,OAAiC;QACxD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;QAEjE,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAhBD,wCAgBC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { GetUserResponse, MigrateBatchUsersPayload, MigrateBatchUsersResponse, UserProfile } from './types';
|
|
1
|
+
import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api';
|
|
2
|
+
import type { GetUserResponse, MigrateBatchUsersPayload, MigrateBatchUsersResponse, UserProfile } from './types';
|
|
3
3
|
export declare class ArcIdentity extends ArcAbstractAPI {
|
|
4
4
|
constructor(options: ArcAPIOptions);
|
|
5
5
|
migrateBatch(payload: MigrateBatchUsersPayload): Promise<MigrateBatchUsersResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/identity/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/identity/index.ts"],"names":[],"mappings":";;;AAAA,kDAAqE;AAGrE,MAAa,WAAY,SAAQ,6BAAc;IAC7C,YAAY,OAAsB;QAChC,KAAK,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,OAAiC;QAClD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAA4B,UAAU,EAAE,OAAO,CAAC,CAAC;QAExF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,EAAU;QACtB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,qBAAqB,EAAE,EAAE,CAAC,CAAC;QAElE,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,KAAa;QAChC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,sBAAsB,KAAK,EAAE,CAAC,CAAC;QAEtE,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,EAAU,EAAE,OAA6B;QAC/D,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;QAEpE,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA5BD,kCA4BC"}
|
package/dist/api/ifx/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AddSecretPayload, Bundle, CreateIntegrationPayload, GenereteDeleteTokenResponse, GetBundlesResponse, GetSubscriptionsResponse, Integration, SubscribePayload, UpdateIntegrationPayload } from './types';
|
|
1
|
+
import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api';
|
|
2
|
+
import type { AddSecretPayload, Bundle, CreateIntegrationPayload, GenereteDeleteTokenResponse, GetBundlesResponse, GetSubscriptionsResponse, Integration, SubscribePayload, UpdateIntegrationPayload } from './types';
|
|
3
3
|
export declare class ArcIFX extends ArcAbstractAPI {
|
|
4
4
|
constructor(options: ArcAPIOptions);
|
|
5
5
|
createIntegration(payload: CreateIntegrationPayload): Promise<void>;
|
package/dist/api/ifx/index.js
CHANGED
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ArcIFX = void 0;
|
|
7
|
+
const node_fs_1 = require("node:fs");
|
|
7
8
|
const form_data_1 = __importDefault(require("form-data"));
|
|
8
|
-
const fs_1 = require("fs");
|
|
9
9
|
const abstract_api_1 = require("../abstract-api");
|
|
10
10
|
class ArcIFX extends abstract_api_1.ArcAbstractAPI {
|
|
11
11
|
constructor(options) {
|
|
@@ -72,7 +72,7 @@ class ArcIFX extends abstract_api_1.ArcAbstractAPI {
|
|
|
72
72
|
return data;
|
|
73
73
|
}
|
|
74
74
|
async uploadBundle(integrationName, name, bundlePath) {
|
|
75
|
-
const bundle = (0,
|
|
75
|
+
const bundle = (0, node_fs_1.createReadStream)(bundlePath);
|
|
76
76
|
const form = new form_data_1.default();
|
|
77
77
|
form.append('bundle', bundle);
|
|
78
78
|
form.append('name', name);
|