@code.store/arcxp-sdk-ts 4.2.1 → 4.4.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 +7 -1
- package/dist/api/content/index.js.map +1 -1
- package/dist/api/content/types.d.ts +21 -0
- package/dist/api/draft/index.d.ts +3 -1
- package/dist/api/draft/index.js +8 -0
- package/dist/api/draft/index.js.map +1 -1
- package/dist/api/draft/types.d.ts +20 -0
- package/dist/api/migration-center/index.js +2 -2
- package/dist/api/migration-center/index.js.map +1 -1
- package/dist/content-elements/index.d.ts +72 -0
- package/dist/content-elements/index.js +90 -3
- package/dist/content-elements/index.js.map +1 -1
- package/dist/scripts/json-schema-to-ts.d.ts +1 -0
- package/dist/scripts/json-schema-to-ts.js +8 -0
- package/dist/scripts/json-schema-to-ts.js.map +1 -0
- package/dist/types/gallery.d.ts +52 -0
- package/dist/types/gallery.js +3 -0
- package/dist/types/gallery.js.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +2 -1
- package/dist/types/index.js.map +1 -1
- package/package.json +3 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { GetStoryParams } from './types';
|
|
1
|
+
import { 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
|
+
search(params: SearchParams): Promise<SearchResponse>;
|
|
7
8
|
}
|
|
@@ -2,15 +2,21 @@
|
|
|
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");
|
|
5
6
|
class ArcContent extends abstract_api_1.ArcAbstractAPI {
|
|
6
7
|
constructor(options) {
|
|
7
8
|
super({ ...options, apiPath: 'content/v4' });
|
|
8
9
|
}
|
|
9
10
|
async getStory(params) {
|
|
10
|
-
const search =
|
|
11
|
+
const search = (0, querystring_1.stringify)(params);
|
|
11
12
|
const { data } = await this.client.get(`/stories?${search}`);
|
|
12
13
|
return data;
|
|
13
14
|
}
|
|
15
|
+
async search(params) {
|
|
16
|
+
const search = (0, querystring_1.stringify)(params);
|
|
17
|
+
const { data } = await this.client.get(`/search?${search}`);
|
|
18
|
+
return data;
|
|
19
|
+
}
|
|
14
20
|
}
|
|
15
21
|
exports.ArcContent = ArcContent;
|
|
16
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/content/index.ts"],"names":[],"mappings":";;;AACA,kDAAgE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/content/index.ts"],"names":[],"mappings":";;;AACA,kDAAgE;AAEhE,6CAAwC;AAExC,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,MAAM,GAAG,IAAA,uBAAS,EAAC,MAAM,CAAC,CAAC;QAEjC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,YAAY,MAAM,EAAE,CAAC,CAAC;QAC7D,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,MAAoB;QAC/B,MAAM,MAAM,GAAG,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;CACF;AAlBD,gCAkBC"}
|
|
@@ -1,5 +1,26 @@
|
|
|
1
|
+
import { AGallery } from '../../types/gallery';
|
|
2
|
+
import { ARedirectObject, AStory } from '../../types/story';
|
|
1
3
|
export type GetStoryParams = {
|
|
2
4
|
_id: string;
|
|
3
5
|
published: boolean;
|
|
4
6
|
website: string;
|
|
5
7
|
};
|
|
8
|
+
export type SearchParams = {
|
|
9
|
+
website: string;
|
|
10
|
+
q?: string;
|
|
11
|
+
body?: string;
|
|
12
|
+
sort?: string;
|
|
13
|
+
from?: number;
|
|
14
|
+
size?: number;
|
|
15
|
+
single?: boolean;
|
|
16
|
+
_sourceInclude?: string;
|
|
17
|
+
_sourceExclude?: string;
|
|
18
|
+
include_distributor_name?: string;
|
|
19
|
+
exclude_distributor_name?: string;
|
|
20
|
+
include_distributor_category?: string;
|
|
21
|
+
exclude_distributor_category?: string;
|
|
22
|
+
};
|
|
23
|
+
export type SearchResponse = {
|
|
24
|
+
type: 'results';
|
|
25
|
+
content_elements: (AStory | AGallery | ARedirectObject)[];
|
|
26
|
+
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { ArcAbstractAPI, ArcAPIOptions } from '../abstract-api';
|
|
2
|
-
import { CreateDocumentRedirectPayload, CreateExternalRedirectPayload, CreateRedirectPayload, DocumentRedirect, ExternalRedirect } from './types';
|
|
2
|
+
import { CreateDocumentRedirectPayload, CreateExternalRedirectPayload, CreateRedirectPayload, DocumentRedirect, ExternalRedirect, Revision, Document } from './types';
|
|
3
3
|
export declare class ArcDraft extends ArcAbstractAPI {
|
|
4
4
|
constructor(options: ArcAPIOptions);
|
|
5
5
|
generateId(id: string): Promise<string>;
|
|
6
|
+
unpublishDocument(id: string, type?: string): Promise<Revision>;
|
|
7
|
+
deleteDocument(id: string, type?: string): Promise<Document>;
|
|
6
8
|
createRedirect<P extends CreateRedirectPayload, R = P extends CreateExternalRedirectPayload ? ExternalRedirect : P extends CreateDocumentRedirectPayload ? DocumentRedirect : never>(website: string, websiteUrl: string, payload: P): Promise<R>;
|
|
7
9
|
}
|
package/dist/api/draft/index.js
CHANGED
|
@@ -10,6 +10,14 @@ class ArcDraft extends abstract_api_1.ArcAbstractAPI {
|
|
|
10
10
|
const { data } = await this.client.get('/arcuuid', { params: { id } });
|
|
11
11
|
return data.id;
|
|
12
12
|
}
|
|
13
|
+
async unpublishDocument(id, type = 'story') {
|
|
14
|
+
const { data } = await this.client.delete(`/${type}/${id}/revision/published`);
|
|
15
|
+
return data;
|
|
16
|
+
}
|
|
17
|
+
async deleteDocument(id, type = 'story') {
|
|
18
|
+
const { data } = await this.client.delete(`/${type}/${id}`);
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
13
21
|
async createRedirect(website, websiteUrl, payload) {
|
|
14
22
|
const { data } = await this.client.post(`/redirect/${website}/${websiteUrl}`, payload);
|
|
15
23
|
return data;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/draft/index.ts"],"names":[],"mappings":";;;AAAA,kDAAgE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/draft/index.ts"],"names":[],"mappings":";;;AAAA,kDAAgE;AAWhE,MAAa,QAAS,SAAQ,6BAAc;IAC1C,YAAY,OAAsB;QAChC,KAAK,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,EAAU;QACzB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAiB,UAAU,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QACvF,OAAO,IAAI,CAAC,EAAE,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,EAAU,EAAE,IAAI,GAAG,OAAO;QAChD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAW,IAAI,IAAI,IAAI,EAAE,qBAAqB,CAAC,CAAC;QACzF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,EAAU,EAAE,IAAI,GAAG,OAAO;QAC7C,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAW,IAAI,IAAI,IAAI,EAAE,EAAE,CAAC,CAAC;QACtE,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,cAAc,CAOlB,OAAe,EAAE,UAAkB,EAAE,OAAU;QAC/C,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAI,aAAa,OAAO,IAAI,UAAU,EAAE,EAAE,OAAO,CAAC,CAAC;QAC1F,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA/BD,4BA+BC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AStory } from '../../types/story';
|
|
1
2
|
export type CreateExternalRedirectPayload = {
|
|
2
3
|
redirect_to: string;
|
|
3
4
|
document_id?: undefined;
|
|
@@ -19,4 +20,23 @@ export type DocumentRedirect = {
|
|
|
19
20
|
export type ExternalRedirect = {
|
|
20
21
|
redirect_to: string;
|
|
21
22
|
} & BaseRedirectData;
|
|
23
|
+
export type Revision = {
|
|
24
|
+
id: string;
|
|
25
|
+
document_id: string;
|
|
26
|
+
created_at: string;
|
|
27
|
+
type: string;
|
|
28
|
+
user_id?: string;
|
|
29
|
+
ans: AStory;
|
|
30
|
+
};
|
|
31
|
+
export type Document = {
|
|
32
|
+
id: string;
|
|
33
|
+
type: 'STORY';
|
|
34
|
+
created_at: string;
|
|
35
|
+
draft_revision_id: string;
|
|
36
|
+
published_revision_id?: string;
|
|
37
|
+
first_published_at?: string;
|
|
38
|
+
last_published_at?: string;
|
|
39
|
+
first_unpublished_at?: string;
|
|
40
|
+
last_unpublished_at?: string;
|
|
41
|
+
};
|
|
22
42
|
export {};
|
|
@@ -20,12 +20,12 @@ class ArcMigrationCenter extends abstract_api_1.ArcAbstractAPI {
|
|
|
20
20
|
return data;
|
|
21
21
|
}
|
|
22
22
|
async postAns(params, payload) {
|
|
23
|
-
const search =
|
|
23
|
+
const search = (0, querystring_1.stringify)(params);
|
|
24
24
|
const { data } = await this.client.post(`/content/ans?${search}`, payload);
|
|
25
25
|
return data;
|
|
26
26
|
}
|
|
27
27
|
async getAns(params) {
|
|
28
|
-
const search =
|
|
28
|
+
const search = (0, querystring_1.stringify)(params);
|
|
29
29
|
const { data } = await this.client.get(`/content/ans?${search}`);
|
|
30
30
|
return data;
|
|
31
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/migration-center/index.ts"],"names":[],"mappings":";;;AAUA,kDAAgE;AAChE,6CAAwC;AAExC,MAAa,kBAAmB,SAAQ,6BAAc;IACpD,YAAY,OAAsB;QAChC,KAAK,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;IAClD,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,MAA6B;QACzC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAU,mBAAmB,IAAA,uBAAS,EAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACxF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,MAA4B;QACzC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAe,kBAAkB,IAAA,uBAAS,EAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC5F,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC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AC,gBAAgB,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;QAC3E,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,MAAoB;QAC/B,MAAM,MAAM,GAAG,IAAA,uBAAS,EAAC,MAAM,CAAC,CAAC;QAEjC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,gBAAgB,MAAM,EAAE,CAAC,CAAC;QACjE,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAjCD,gDAiCC"}
|
|
@@ -134,4 +134,76 @@ export declare const ContentElement: {
|
|
|
134
134
|
subtype: "jw_player";
|
|
135
135
|
type: "custom_embed";
|
|
136
136
|
};
|
|
137
|
+
twitter: (id: string, provider?: string) => {
|
|
138
|
+
referent: {
|
|
139
|
+
id: string;
|
|
140
|
+
provider: string;
|
|
141
|
+
service: "oembed";
|
|
142
|
+
type: "twitter";
|
|
143
|
+
};
|
|
144
|
+
type: "reference";
|
|
145
|
+
};
|
|
146
|
+
youtube: (id: string, provider?: string) => {
|
|
147
|
+
referent: {
|
|
148
|
+
id: string;
|
|
149
|
+
provider: string;
|
|
150
|
+
service: string;
|
|
151
|
+
type: string;
|
|
152
|
+
};
|
|
153
|
+
type: "reference";
|
|
154
|
+
};
|
|
155
|
+
facebook_video: (id: string, provider?: string) => {
|
|
156
|
+
referent: {
|
|
157
|
+
id: string;
|
|
158
|
+
provider: string;
|
|
159
|
+
service: string;
|
|
160
|
+
type: string;
|
|
161
|
+
};
|
|
162
|
+
type: "reference";
|
|
163
|
+
};
|
|
164
|
+
facebook_post: (id: string, provider?: string) => {
|
|
165
|
+
referent: {
|
|
166
|
+
id: string;
|
|
167
|
+
provider: string;
|
|
168
|
+
service: string;
|
|
169
|
+
type: string;
|
|
170
|
+
};
|
|
171
|
+
type: "reference";
|
|
172
|
+
};
|
|
173
|
+
vimeo: (id: string, provider?: string) => {
|
|
174
|
+
referent: {
|
|
175
|
+
id: string;
|
|
176
|
+
provider: string;
|
|
177
|
+
service: string;
|
|
178
|
+
type: string;
|
|
179
|
+
};
|
|
180
|
+
type: "reference";
|
|
181
|
+
};
|
|
182
|
+
instagram: (id: string, provider?: string) => {
|
|
183
|
+
referent: {
|
|
184
|
+
id: string;
|
|
185
|
+
provider: string;
|
|
186
|
+
service: string;
|
|
187
|
+
type: string;
|
|
188
|
+
};
|
|
189
|
+
type: "reference";
|
|
190
|
+
};
|
|
191
|
+
dailymotion: (id: string, provider?: string) => {
|
|
192
|
+
referent: {
|
|
193
|
+
id: string;
|
|
194
|
+
provider: string;
|
|
195
|
+
service: string;
|
|
196
|
+
type: string;
|
|
197
|
+
};
|
|
198
|
+
type: "reference";
|
|
199
|
+
};
|
|
200
|
+
tiktok: (id: string, provider?: string) => {
|
|
201
|
+
referent: {
|
|
202
|
+
id: string;
|
|
203
|
+
provider: string;
|
|
204
|
+
service: string;
|
|
205
|
+
type: string;
|
|
206
|
+
};
|
|
207
|
+
type: "reference";
|
|
208
|
+
};
|
|
137
209
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ContentElement = void 0;
|
|
4
|
-
const refType = 'reference';
|
|
5
4
|
exports.ContentElement = {
|
|
6
5
|
divider: () => {
|
|
7
6
|
return {
|
|
@@ -53,7 +52,7 @@ exports.ContentElement = {
|
|
|
53
52
|
},
|
|
54
53
|
gallery: (id) => {
|
|
55
54
|
return {
|
|
56
|
-
type:
|
|
55
|
+
type: 'reference',
|
|
57
56
|
referent: {
|
|
58
57
|
type: 'gallery',
|
|
59
58
|
id,
|
|
@@ -94,7 +93,7 @@ exports.ContentElement = {
|
|
|
94
93
|
...properties,
|
|
95
94
|
},
|
|
96
95
|
},
|
|
97
|
-
type:
|
|
96
|
+
type: 'reference',
|
|
98
97
|
};
|
|
99
98
|
},
|
|
100
99
|
jwPlayer: (id) => {
|
|
@@ -108,5 +107,93 @@ exports.ContentElement = {
|
|
|
108
107
|
type: 'custom_embed',
|
|
109
108
|
};
|
|
110
109
|
},
|
|
110
|
+
twitter: (id, provider = 'https://publish.twitter.com/oembed?url=') => {
|
|
111
|
+
return {
|
|
112
|
+
referent: {
|
|
113
|
+
id,
|
|
114
|
+
provider,
|
|
115
|
+
service: 'oembed',
|
|
116
|
+
type: 'twitter',
|
|
117
|
+
},
|
|
118
|
+
type: 'reference',
|
|
119
|
+
};
|
|
120
|
+
},
|
|
121
|
+
youtube: (id, provider = 'https://www.youtube.com/oembed?url=') => {
|
|
122
|
+
return {
|
|
123
|
+
referent: {
|
|
124
|
+
id,
|
|
125
|
+
provider,
|
|
126
|
+
service: 'oembed',
|
|
127
|
+
type: 'youtube',
|
|
128
|
+
},
|
|
129
|
+
type: 'reference',
|
|
130
|
+
};
|
|
131
|
+
},
|
|
132
|
+
facebook_video: (id, provider = 'https://www.facebook.com/plugins/post/oembed.json/?url=') => {
|
|
133
|
+
return {
|
|
134
|
+
referent: {
|
|
135
|
+
id,
|
|
136
|
+
provider,
|
|
137
|
+
service: 'oembed',
|
|
138
|
+
type: 'facebook-video',
|
|
139
|
+
},
|
|
140
|
+
type: 'reference',
|
|
141
|
+
};
|
|
142
|
+
},
|
|
143
|
+
facebook_post: (id, provider = 'https://www.facebook.com/plugins/post/oembed.json/?url=') => {
|
|
144
|
+
return {
|
|
145
|
+
referent: {
|
|
146
|
+
id,
|
|
147
|
+
provider,
|
|
148
|
+
service: 'oembed',
|
|
149
|
+
type: 'facebook-post',
|
|
150
|
+
},
|
|
151
|
+
type: 'reference',
|
|
152
|
+
};
|
|
153
|
+
},
|
|
154
|
+
vimeo: (id, provider = 'https://vimeo.com/api/oembed.json?url=') => {
|
|
155
|
+
return {
|
|
156
|
+
referent: {
|
|
157
|
+
id,
|
|
158
|
+
provider,
|
|
159
|
+
service: 'oembed',
|
|
160
|
+
type: 'vimeo',
|
|
161
|
+
},
|
|
162
|
+
type: 'reference',
|
|
163
|
+
};
|
|
164
|
+
},
|
|
165
|
+
instagram: (id, provider = 'https://api.instagram.com/oembed?url=') => {
|
|
166
|
+
return {
|
|
167
|
+
referent: {
|
|
168
|
+
id,
|
|
169
|
+
provider,
|
|
170
|
+
service: 'oembed',
|
|
171
|
+
type: 'instagram',
|
|
172
|
+
},
|
|
173
|
+
type: 'reference',
|
|
174
|
+
};
|
|
175
|
+
},
|
|
176
|
+
dailymotion: (id, provider = 'https://www.dailymotion.com/services/oembed?url=') => {
|
|
177
|
+
return {
|
|
178
|
+
referent: {
|
|
179
|
+
id,
|
|
180
|
+
provider,
|
|
181
|
+
service: 'oembed',
|
|
182
|
+
type: 'dailymotion',
|
|
183
|
+
},
|
|
184
|
+
type: 'reference',
|
|
185
|
+
};
|
|
186
|
+
},
|
|
187
|
+
tiktok: (id, provider = 'https://www.tiktok.com/oembed?url=') => {
|
|
188
|
+
return {
|
|
189
|
+
referent: {
|
|
190
|
+
id,
|
|
191
|
+
provider,
|
|
192
|
+
service: 'oembed',
|
|
193
|
+
type: 'tiktok',
|
|
194
|
+
},
|
|
195
|
+
type: 'reference',
|
|
196
|
+
};
|
|
197
|
+
},
|
|
111
198
|
};
|
|
112
199
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/content-elements/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/content-elements/index.ts"],"names":[],"mappings":";;;AAIa,QAAA,cAAc,GAAG;IAC5B,OAAO,EAAE,GAAG,EAAE;QACZ,OAAO;YACL,IAAI,EAAE,SAAkB;SACzB,CAAC;IACJ,CAAC;IACD,IAAI,EAAE,CAAC,OAAe,EAAE,YAAuB,MAAM,EAAE,EAAE;QACvD,OAAO;YACL,IAAI,EAAE,MAAe;YACrB,OAAO;YACP,SAAS;SACV,CAAC;IACJ,CAAC;IACD,KAAK,EAAE,CAAC,OAAe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 -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const fs_1 = require("fs");
|
|
4
|
+
const json_schema_to_typescript_1 = require("json-schema-to-typescript");
|
|
5
|
+
const input = './input.json';
|
|
6
|
+
const output = './output.ts';
|
|
7
|
+
(0, json_schema_to_typescript_1.compileFromFile)(input).then((ts) => (0, fs_1.writeFileSync)(output, ts));
|
|
8
|
+
//# sourceMappingURL=json-schema-to-ts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-schema-to-ts.js","sourceRoot":"","sources":["../../src/scripts/json-schema-to-ts.ts"],"names":[],"mappings":";;AAAA,2BAAmC;AACnC,yEAA4D;AAE5D,MAAM,KAAK,GAAG,cAAc,CAAC;AAC7B,MAAM,MAAM,GAAG,aAAa,CAAC;AAE7B,IAAA,2CAAe,EAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAA,kBAAa,EAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { GloballyUniqueIDTrait, DescribesTheANSVersionOfThisObject, SubtypeOrTemplate, ChannelTrait, Alignment, Locale, CopyrightInformation, CanonicalURL, CanonicalWebsite, Website, WebsiteURL, Short_Url, CreatedDate, LastUpdatedDate, Publish_Date, FirstPublishDate, Display_Date, LocationRelatedTrait, Geo, Address, Editor_Note, Status, Headlines, SubHeadlines, Description, CreditTrait, VanityCreditsTrait, Taxonomy, PromoItems, Related_Content, OwnerInformation, SchedulingInformation, WorkflowInformation, Pitches, Revision, Syndication, Source, Distributor, Tracking, Comments, Label, Slug, ContentRestrictions, HasAdditionalProperties, AliasesTrait, ACollectionOfContent, WebsitesInput, Contributors } from './story';
|
|
2
|
+
export interface AGallery {
|
|
3
|
+
type: 'gallery';
|
|
4
|
+
_id?: GloballyUniqueIDTrait;
|
|
5
|
+
version: DescribesTheANSVersionOfThisObject;
|
|
6
|
+
subtype?: SubtypeOrTemplate;
|
|
7
|
+
channels?: ChannelTrait;
|
|
8
|
+
alignment?: Alignment;
|
|
9
|
+
language?: Locale;
|
|
10
|
+
copyright?: CopyrightInformation;
|
|
11
|
+
canonical_url?: CanonicalURL;
|
|
12
|
+
canonical_website?: CanonicalWebsite;
|
|
13
|
+
website?: Website;
|
|
14
|
+
website_url?: WebsiteURL;
|
|
15
|
+
short_url?: Short_Url;
|
|
16
|
+
created_date?: CreatedDate;
|
|
17
|
+
last_updated_date?: LastUpdatedDate;
|
|
18
|
+
publish_date?: Publish_Date;
|
|
19
|
+
first_publish_date?: FirstPublishDate;
|
|
20
|
+
display_date?: Display_Date;
|
|
21
|
+
location?: LocationRelatedTrait;
|
|
22
|
+
geo?: Geo;
|
|
23
|
+
address?: Address;
|
|
24
|
+
editor_note?: Editor_Note;
|
|
25
|
+
status?: Status;
|
|
26
|
+
headlines?: Headlines;
|
|
27
|
+
subheadlines?: SubHeadlines;
|
|
28
|
+
description?: Description;
|
|
29
|
+
credits?: CreditTrait;
|
|
30
|
+
vanity_credits?: VanityCreditsTrait;
|
|
31
|
+
taxonomy?: Taxonomy;
|
|
32
|
+
promo_items?: PromoItems;
|
|
33
|
+
related_content?: Related_Content;
|
|
34
|
+
owner?: OwnerInformation;
|
|
35
|
+
planning?: SchedulingInformation;
|
|
36
|
+
workflow?: WorkflowInformation;
|
|
37
|
+
pitches?: Pitches;
|
|
38
|
+
revision?: Revision;
|
|
39
|
+
syndication?: Syndication;
|
|
40
|
+
source?: Source;
|
|
41
|
+
distributor?: Distributor;
|
|
42
|
+
tracking?: Tracking;
|
|
43
|
+
comments?: Comments;
|
|
44
|
+
label?: Label;
|
|
45
|
+
slug?: Slug;
|
|
46
|
+
content_restrictions?: ContentRestrictions;
|
|
47
|
+
additional_properties?: HasAdditionalProperties;
|
|
48
|
+
content_aliases?: AliasesTrait;
|
|
49
|
+
content_elements?: ACollectionOfContent;
|
|
50
|
+
websites?: WebsitesInput;
|
|
51
|
+
contributors?: Contributors;
|
|
52
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gallery.js","sourceRoot":"","sources":["../../src/types/gallery.ts"],"names":[],"mappings":""}
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/index.js
CHANGED
|
@@ -23,8 +23,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.Section = exports.Story = exports.Author = void 0;
|
|
26
|
+
exports.Gallery = exports.Section = exports.Story = exports.Author = void 0;
|
|
27
27
|
exports.Author = __importStar(require("./author"));
|
|
28
28
|
exports.Story = __importStar(require("./story"));
|
|
29
29
|
exports.Section = __importStar(require("./section"));
|
|
30
|
+
exports.Gallery = __importStar(require("./gallery"));
|
|
30
31
|
//# sourceMappingURL=index.js.map
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAmC;AACnC,iDAAiC;AACjC,qDAAqC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAmC;AACnC,iDAAiC;AACjC,qDAAqC;AACrC,qDAAqC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code.store/arcxp-sdk-ts",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"build": "tsc",
|
|
17
17
|
"lint": "tsc --noEmit && TIMING=1 eslint \"src/**/*.ts*\"",
|
|
18
18
|
"test": "vitest",
|
|
19
|
+
"gen:ts": "npx ts-node-dev ./src/scripts/json-schema-to-ts.ts",
|
|
19
20
|
"cs": "npx changeset && npx changeset version"
|
|
20
21
|
},
|
|
21
22
|
"keywords": [
|
|
@@ -43,6 +44,7 @@
|
|
|
43
44
|
"eslint": "^8.31.0",
|
|
44
45
|
"eslint-config-custom-server": "*",
|
|
45
46
|
"openapi-typescript": "^6.2.7",
|
|
47
|
+
"json-schema-to-typescript": "13.1.1",
|
|
46
48
|
"tap": "^16.3.4",
|
|
47
49
|
"ts-node-dev": "^2.0.0",
|
|
48
50
|
"vitest": "^0.33.0"
|