@contentchef/contentchef-types 10.1.0-alpha.6 → 10.1.0-alpha.8

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.
@@ -0,0 +1,481 @@
1
+ import { AuthorResponse } from './Author';
2
+ import { PagedListResponse } from './common';
3
+ import { ContentId, ListContentsFilters } from './Content';
4
+ /**
5
+ * The content export request unique id
6
+ */
7
+ export type ContentExportRequestId = number;
8
+ /**
9
+ * The content import request unique id
10
+ */
11
+ export type ContentImportRequestId = number;
12
+ /**
13
+ * The content import request item unique id
14
+ */
15
+ export type ContentImportRequestItemId = number;
16
+ /**
17
+ * This enum represent the file format of a content export, and the format an import file is read with
18
+ */
19
+ export declare enum ContentExportFormat {
20
+ JSON = "json",
21
+ CSV = "csv"
22
+ }
23
+ /**
24
+ * This enum represent the lifecycle of a content export request. Exports are processed
25
+ * asynchronously, so a freshly created request is always `queued`
26
+ */
27
+ export declare enum ContentExportStatus {
28
+ QUEUED = "queued",
29
+ PROCESSING = "processing",
30
+ COMPLETED = "completed",
31
+ FAILED = "failed"
32
+ }
33
+ /**
34
+ * This enum represent the lifecycle of a content import request. A freshly created request is
35
+ * `awaiting_upload` until the import file is uploaded to
36
+ * [[CreateContentImportRequestResponse.uploadUrl]], which is what starts the import
37
+ */
38
+ export declare enum ContentImportStatus {
39
+ AWAITING_UPLOAD = "awaiting_upload",
40
+ PROCESSING = "processing",
41
+ COMPLETED = "completed",
42
+ COMPLETED_WITH_ERRORS = "completed_with_errors",
43
+ FAILED = "failed"
44
+ }
45
+ /**
46
+ * This enum represent what an imported row describes: the content itself or one of its translations
47
+ */
48
+ export declare enum ContentImportRowType {
49
+ CONTENT = "content",
50
+ TRANSLATION = "translation"
51
+ }
52
+ /**
53
+ * This enum represent the outcome of a single imported row
54
+ */
55
+ export declare enum ContentImportItemStatus {
56
+ SUCCESS = "success",
57
+ FAILED = "failed"
58
+ }
59
+ /**
60
+ * This enum represent what the import did to the content of a successfully imported row
61
+ */
62
+ export declare enum ContentImportItemAction {
63
+ UPDATED = "updated"
64
+ }
65
+ /**
66
+ * This type represent the error attached to a failed content export or import request
67
+ */
68
+ export type ContentExportImportError = {
69
+ /**
70
+ * The error type discriminator
71
+ */
72
+ type: string;
73
+ /**
74
+ * The human readable error message
75
+ */
76
+ message: string;
77
+ };
78
+ /**
79
+ * This type represent one of the files produced by a content export, one per exported content
80
+ * definition. Files are appended as soon as they are uploaded, so a still `processing` export
81
+ * already lists the files that can be downloaded
82
+ */
83
+ export type ContentExportFile = {
84
+ /**
85
+ * The mnemonic id of the content definition the file contains the contents of
86
+ */
87
+ definitionMnemonicId: string;
88
+ /**
89
+ * The internal storage key of the file. Not fetchable as is, pass
90
+ * [[definitionMnemonicId]] to [[ContentExportImportFacade.downloadExport]] to get a
91
+ * downloadable url
92
+ */
93
+ s3Key: string;
94
+ /**
95
+ * The number of contents written in the file
96
+ */
97
+ itemCount: number;
98
+ };
99
+ /**
100
+ * This type represent the model of a content export request
101
+ */
102
+ export type ContentExportRequestResponse = {
103
+ /**
104
+ * The content export request unique id
105
+ */
106
+ id: ContentExportRequestId;
107
+ /**
108
+ * The space the exported contents belong to
109
+ */
110
+ spaceId: string;
111
+ /**
112
+ * The current status of the export
113
+ */
114
+ status: ContentExportStatus;
115
+ /**
116
+ * The filters the exported contents have been selected with
117
+ */
118
+ filters: ListContentsFilters;
119
+ /**
120
+ * The format the export files are written in
121
+ */
122
+ format: ContentExportFormat;
123
+ /**
124
+ * The separator used by the exported csv files. Meaningless when [[format]] is `json`
125
+ */
126
+ csvSeparator: string;
127
+ /**
128
+ * The files produced so far, one per exported content definition.
129
+ * Null until the export starts producing them
130
+ */
131
+ files: ContentExportFile[] | null;
132
+ /**
133
+ * The error describing why the export failed, null unless [[status]] is `failed`
134
+ */
135
+ error: ContentExportImportError | null;
136
+ /**
137
+ * The author that requested the export
138
+ */
139
+ author: AuthorResponse;
140
+ /**
141
+ * The last author that modified the export request. Only returned by
142
+ * [[ContentExportImportFacade.createExport]], the listing does not resolve it
143
+ */
144
+ latestContributor?: AuthorResponse;
145
+ /**
146
+ * The export request creation date
147
+ */
148
+ createdDate: Date;
149
+ /**
150
+ * The export request last modified date
151
+ */
152
+ lastModifiedDate: Date;
153
+ };
154
+ /**
155
+ * This type represent the data needed to make a create content export request API request
156
+ */
157
+ export type CreateContentExportRequestRequest = {
158
+ /**
159
+ * The filters selecting the contents to export, the same ones accepted by
160
+ * [[ContentFacade.list]]. When omitted every unarchived content of the space is exported.
161
+ * Archived contents cannot be imported back, so [[ListContentsFilters.contentsStatus]]
162
+ * defaults to `unarchived`
163
+ */
164
+ filters?: Partial<ListContentsFilters>;
165
+ /**
166
+ * The format to write the export files in, defaults to `json`
167
+ */
168
+ format?: ContentExportFormat;
169
+ /**
170
+ * The single character separator to write the exported csv files with, defaults to `,`.
171
+ * Ignored when [[format]] is `json`
172
+ */
173
+ csvSeparator?: string;
174
+ };
175
+ /**
176
+ * This type represent the response of a create content export request API request.
177
+ * The returned export is always `queued`: it is processed asynchronously
178
+ */
179
+ export type CreateContentExportRequestResponse = ContentExportRequestResponse;
180
+ /**
181
+ * This type represent the data needed to make a list content export requests API request
182
+ */
183
+ export type ListContentExportRequestsRequest = {
184
+ /**
185
+ * The export requests to skip (used to paginate the result), defaults to 0
186
+ */
187
+ skip?: number;
188
+ /**
189
+ * The export requests to take (used to paginate the result), defaults to 20.
190
+ * Cannot exceed [[MAX_CONTENT_EXPORT_IMPORT_PAGE_SIZE]]
191
+ */
192
+ take?: number;
193
+ };
194
+ /**
195
+ * This type represent the response of a list content export requests API request,
196
+ * sorted by [[ContentExportRequestResponse.createdDate]] descending
197
+ */
198
+ export type ListContentExportRequestsResponse = PagedListResponse<ContentExportRequestResponse>;
199
+ /**
200
+ * This type represent the data needed to make a download content export API request
201
+ */
202
+ export type DownloadContentExportRequest = {
203
+ /**
204
+ * The unique id of the completed export request to download a file of
205
+ */
206
+ exportRequestId: ContentExportRequestId;
207
+ /**
208
+ * The mnemonic id of the content definition whose exported file is wanted.
209
+ * It must be one of the [[ContentExportRequestResponse.files]] entries
210
+ */
211
+ definitionMnemonicId: string;
212
+ };
213
+ /**
214
+ * This type represent the response of a download content export API request
215
+ */
216
+ export type DownloadContentExportResponse = {
217
+ /**
218
+ * The mnemonic id of the content definition the file contains the contents of
219
+ */
220
+ definitionMnemonicId: string;
221
+ /**
222
+ * The temporary url to download the exported file from. The client does not download the
223
+ * file, fetch this url yourself
224
+ */
225
+ downloadUrl: string;
226
+ /**
227
+ * The number of seconds [[downloadUrl]] stays valid for
228
+ */
229
+ expiresInSeconds: number;
230
+ /**
231
+ * The number of contents written in the file
232
+ */
233
+ itemCount: number;
234
+ };
235
+ /**
236
+ * This type represent the options a content import file is read with
237
+ */
238
+ export type ContentImportOptions = {
239
+ /**
240
+ * The format the import file is read as
241
+ */
242
+ format: ContentExportFormat;
243
+ /**
244
+ * The separator the imported csv file is read with. Meaningless when [[format]] is `json`
245
+ */
246
+ csvSeparator?: string;
247
+ };
248
+ /**
249
+ * This type represent the model of a content import request
250
+ */
251
+ export type ContentImportRequestResponse = {
252
+ /**
253
+ * The content import request unique id
254
+ */
255
+ id: ContentImportRequestId;
256
+ /**
257
+ * The space the contents are imported in
258
+ */
259
+ spaceId: string;
260
+ /**
261
+ * The current status of the import
262
+ */
263
+ status: ContentImportStatus;
264
+ /**
265
+ * The name of the uploaded file, as declared when the import was created. Null when not declared
266
+ */
267
+ fileName: string | null;
268
+ /**
269
+ * The storage key the import file is expected at
270
+ */
271
+ s3Key: string;
272
+ /**
273
+ * The options the import file is read with
274
+ */
275
+ options: ContentImportOptions;
276
+ /**
277
+ * The arn of the workflow execution processing the import.
278
+ * Null while the import is still `awaiting_upload`
279
+ */
280
+ executionArn: string | null;
281
+ /**
282
+ * The number of rows found in the import file, null until the file has been read
283
+ */
284
+ totalItems: number | null;
285
+ /**
286
+ * The number of successfully imported rows, null until the import completes
287
+ */
288
+ succeededItems: number | null;
289
+ /**
290
+ * The number of rows that failed to import, null until the import completes.
291
+ * When greater than 0 the [[status]] is `completed_with_errors`
292
+ */
293
+ failedItems: number | null;
294
+ /**
295
+ * The error describing why the whole import failed, null unless [[status]] is `failed`.
296
+ * Single row failures are reported by [[ContentImportRequestItemResponse.error]] instead
297
+ */
298
+ error: ContentExportImportError | null;
299
+ /**
300
+ * The author that requested the import
301
+ */
302
+ author: AuthorResponse;
303
+ /**
304
+ * The import request creation date
305
+ */
306
+ createdDate: Date;
307
+ /**
308
+ * The import request last modified date
309
+ */
310
+ lastModifiedDate: Date;
311
+ };
312
+ /**
313
+ * This type represent the data needed to make a create content import request API request
314
+ */
315
+ export type CreateContentImportRequestRequest = {
316
+ /**
317
+ * The name of the file about to be uploaded, kept for display purposes only
318
+ */
319
+ fileName?: string;
320
+ /**
321
+ * The options to read the uploaded file with
322
+ */
323
+ options?: {
324
+ /**
325
+ * The format the uploaded file is read as, defaults to `json`
326
+ */
327
+ format?: ContentExportFormat;
328
+ /**
329
+ * The single character separator the uploaded csv file is read with, defaults to `,`.
330
+ * Ignored when [[format]] is `json`
331
+ */
332
+ csvSeparator?: string;
333
+ };
334
+ };
335
+ /**
336
+ * This type represent the response of a create content import request API request
337
+ */
338
+ export type CreateContentImportRequestResponse = {
339
+ /**
340
+ * The created content import request unique id
341
+ */
342
+ importRequestId: ContentImportRequestId;
343
+ /**
344
+ * The storage key the file is uploaded to
345
+ */
346
+ s3Key: string;
347
+ /**
348
+ * The temporary url to upload the import file to, with a `PUT` and a `Content-Type` of
349
+ * `text/csv` or `application/json` matching the requested format. The client does not upload
350
+ * the file, upload it yourself: the upload is what starts the import
351
+ */
352
+ uploadUrl: string;
353
+ /**
354
+ * The number of seconds [[uploadUrl]] stays valid for
355
+ */
356
+ expiresInSeconds: number;
357
+ };
358
+ /**
359
+ * This type represent the data needed to make a list content import requests API request
360
+ */
361
+ export type ListContentImportRequestsRequest = {
362
+ /**
363
+ * The import requests to skip (used to paginate the result), defaults to 0
364
+ */
365
+ skip?: number;
366
+ /**
367
+ * The import requests to take (used to paginate the result), defaults to 20.
368
+ * Cannot exceed [[MAX_CONTENT_EXPORT_IMPORT_PAGE_SIZE]]
369
+ */
370
+ take?: number;
371
+ };
372
+ /**
373
+ * This type represent the response of a list content import requests API request,
374
+ * sorted by [[ContentImportRequestResponse.createdDate]] descending
375
+ */
376
+ export type ListContentImportRequestsResponse = PagedListResponse<ContentImportRequestResponse>;
377
+ /**
378
+ * This type represent the error attached to a single failed imported row
379
+ */
380
+ export type ContentImportItemError = {
381
+ /**
382
+ * The error code discriminator
383
+ */
384
+ code: string;
385
+ /**
386
+ * The human readable error message
387
+ */
388
+ message?: string;
389
+ /**
390
+ * The error additional details, their shape depends on [[code]]
391
+ */
392
+ details?: any;
393
+ };
394
+ /**
395
+ * This type represent the outcome of a single row of a content import. One item is written per
396
+ * content row plus one per translation row, so a content with 3 translated locales produces 4 items
397
+ */
398
+ export type ContentImportRequestItemResponse = {
399
+ /**
400
+ * The content import request item unique id
401
+ */
402
+ id: ContentImportRequestItemId;
403
+ /**
404
+ * The space the contents are imported in
405
+ */
406
+ spaceId: string;
407
+ /**
408
+ * The unique id of the import request the item belongs to
409
+ */
410
+ importRequestId: ContentImportRequestId;
411
+ /**
412
+ * The zero based position of the row in the import file
413
+ */
414
+ itemIndex: number;
415
+ /**
416
+ * The public id of the imported content, null when the row did not carry a readable one
417
+ */
418
+ publicId: string | null;
419
+ /**
420
+ * The mnemonic id of the imported content definition, null when the row did not carry a
421
+ * readable one
422
+ */
423
+ definitionMnemonicId: string | null;
424
+ /**
425
+ * Whether the row describes the content itself or one of its translations
426
+ */
427
+ rowType: ContentImportRowType;
428
+ /**
429
+ * The locale the row has been imported in. Always null when [[rowType]] is `content`:
430
+ * only translation rows are locale specific
431
+ */
432
+ locale: string | null;
433
+ /**
434
+ * What the import did to the content, null when the row failed
435
+ */
436
+ action: ContentImportItemAction | null;
437
+ /**
438
+ * The outcome of the row
439
+ */
440
+ status: ContentImportItemStatus;
441
+ /**
442
+ * The unique id of the imported content, null when the row failed before the content
443
+ * could be resolved
444
+ */
445
+ contentId: ContentId | null;
446
+ /**
447
+ * The error describing why the row failed, null unless [[status]] is `failed`
448
+ */
449
+ error: ContentImportItemError | null;
450
+ };
451
+ /**
452
+ * This type represent the data needed to make a list content import request items API request
453
+ */
454
+ export type ListContentImportRequestItemsRequest = {
455
+ /**
456
+ * The unique id of the import request to list the items of
457
+ */
458
+ importRequestId: ContentImportRequestId;
459
+ /**
460
+ * The items to skip (used to paginate the result), defaults to 0
461
+ */
462
+ skip?: number;
463
+ /**
464
+ * The items to take (used to paginate the result), defaults to 50.
465
+ * Cannot exceed [[MAX_CONTENT_EXPORT_IMPORT_PAGE_SIZE]]
466
+ */
467
+ take?: number;
468
+ /**
469
+ * This filter is used to list only the items with the given outcome, typically `failed` to
470
+ * review what an import could not apply. When omitted every item is returned
471
+ */
472
+ status?: ContentImportItemStatus;
473
+ };
474
+ /**
475
+ * This type represent the response of a list content import request items API request
476
+ */
477
+ export type ListContentImportRequestItemsResponse = PagedListResponse<ContentImportRequestItemResponse>;
478
+ /**
479
+ * The maximum number of items a content export or import list API request can take in a single page
480
+ */
481
+ export declare const MAX_CONTENT_EXPORT_IMPORT_PAGE_SIZE = 100;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MAX_CONTENT_EXPORT_IMPORT_PAGE_SIZE = exports.ContentImportItemAction = exports.ContentImportItemStatus = exports.ContentImportRowType = exports.ContentImportStatus = exports.ContentExportStatus = exports.ContentExportFormat = void 0;
4
+ /**
5
+ * This enum represent the file format of a content export, and the format an import file is read with
6
+ */
7
+ var ContentExportFormat;
8
+ (function (ContentExportFormat) {
9
+ ContentExportFormat["JSON"] = "json";
10
+ ContentExportFormat["CSV"] = "csv";
11
+ })(ContentExportFormat || (exports.ContentExportFormat = ContentExportFormat = {}));
12
+ /**
13
+ * This enum represent the lifecycle of a content export request. Exports are processed
14
+ * asynchronously, so a freshly created request is always `queued`
15
+ */
16
+ var ContentExportStatus;
17
+ (function (ContentExportStatus) {
18
+ ContentExportStatus["QUEUED"] = "queued";
19
+ ContentExportStatus["PROCESSING"] = "processing";
20
+ ContentExportStatus["COMPLETED"] = "completed";
21
+ ContentExportStatus["FAILED"] = "failed";
22
+ })(ContentExportStatus || (exports.ContentExportStatus = ContentExportStatus = {}));
23
+ /**
24
+ * This enum represent the lifecycle of a content import request. A freshly created request is
25
+ * `awaiting_upload` until the import file is uploaded to
26
+ * [[CreateContentImportRequestResponse.uploadUrl]], which is what starts the import
27
+ */
28
+ var ContentImportStatus;
29
+ (function (ContentImportStatus) {
30
+ ContentImportStatus["AWAITING_UPLOAD"] = "awaiting_upload";
31
+ ContentImportStatus["PROCESSING"] = "processing";
32
+ ContentImportStatus["COMPLETED"] = "completed";
33
+ ContentImportStatus["COMPLETED_WITH_ERRORS"] = "completed_with_errors";
34
+ ContentImportStatus["FAILED"] = "failed";
35
+ })(ContentImportStatus || (exports.ContentImportStatus = ContentImportStatus = {}));
36
+ /**
37
+ * This enum represent what an imported row describes: the content itself or one of its translations
38
+ */
39
+ var ContentImportRowType;
40
+ (function (ContentImportRowType) {
41
+ ContentImportRowType["CONTENT"] = "content";
42
+ ContentImportRowType["TRANSLATION"] = "translation";
43
+ })(ContentImportRowType || (exports.ContentImportRowType = ContentImportRowType = {}));
44
+ /**
45
+ * This enum represent the outcome of a single imported row
46
+ */
47
+ var ContentImportItemStatus;
48
+ (function (ContentImportItemStatus) {
49
+ ContentImportItemStatus["SUCCESS"] = "success";
50
+ ContentImportItemStatus["FAILED"] = "failed";
51
+ })(ContentImportItemStatus || (exports.ContentImportItemStatus = ContentImportItemStatus = {}));
52
+ /**
53
+ * This enum represent what the import did to the content of a successfully imported row
54
+ */
55
+ var ContentImportItemAction;
56
+ (function (ContentImportItemAction) {
57
+ ContentImportItemAction["UPDATED"] = "updated";
58
+ })(ContentImportItemAction || (exports.ContentImportItemAction = ContentImportItemAction = {}));
59
+ /**
60
+ * The maximum number of items a content export or import list API request can take in a single page
61
+ */
62
+ exports.MAX_CONTENT_EXPORT_IMPORT_PAGE_SIZE = 100;
@@ -222,7 +222,29 @@ export type UpdateReleaseRequest = {
222
222
  */
223
223
  export type UpdateReleaseResponse = Release;
224
224
  /**
225
- * This type represent the filters that can be applied to release items in the release V2 API requests
225
+ * This enum represent the comparison operators available to a release item date filter
226
+ */
227
+ export declare enum DateFilterOperator {
228
+ lte = "lte",
229
+ gte = "gte"
230
+ }
231
+ /**
232
+ * This type represent a filter applied to one of the release item date fields
233
+ */
234
+ export type ReleaseItemDateFilter = {
235
+ /**
236
+ * The date to compare the release item date field with, as an ISO 8601 string
237
+ */
238
+ value: string;
239
+ /**
240
+ * The comparison to apply to the release item date field.
241
+ * Defaults to [[DateFilterOperator.lte]], i.e. "at or before"
242
+ */
243
+ operator?: DateFilterOperator;
244
+ };
245
+ /**
246
+ * This type represent the filters that can be applied to release items in the release V2 API requests.
247
+ * When more than one filter is given they are combined with AND
226
248
  */
227
249
  export type ReleaseItemFilters = {
228
250
  /**
@@ -241,6 +263,16 @@ export type ReleaseItemFilters = {
241
263
  * Match only the release items that are (or are not) currently selected to be published
242
264
  */
243
265
  toPublish?: boolean;
266
+ /**
267
+ * Match only the release items whose related content online date satisfies the filter.
268
+ * Release items with no online date never match, whatever the operator
269
+ */
270
+ onlineDate?: ReleaseItemDateFilter;
271
+ /**
272
+ * Match only the release items whose related content offline date satisfies the filter.
273
+ * Release items with no offline date never match, whatever the operator
274
+ */
275
+ offlineDate?: ReleaseItemDateFilter;
244
276
  };
245
277
  /**
246
278
  * This type represent the data needed to make a create release V2 API request
@@ -272,7 +304,9 @@ export type UpdateReleaseV2Request = {
272
304
  includeAll?: boolean;
273
305
  /**
274
306
  * Select the release items matching the given filters. Empty filters select all the release items.
275
- * A toPublish filter is evaluated against the selection before the update
307
+ * A toPublish filter is evaluated against the selection before the update.
308
+ * The filters are the same ones accepted by [[ListReleaseItemsV2Request]], so a selection can be
309
+ * previewed with `listReleaseItemsV2` and then applied by passing the very same filters here
276
310
  */
277
311
  filters?: ReleaseItemFilters;
278
312
  /**
@@ -1,2 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DateFilterOperator = void 0;
4
+ /**
5
+ * This enum represent the comparison operators available to a release item date filter
6
+ */
7
+ var DateFilterOperator;
8
+ (function (DateFilterOperator) {
9
+ DateFilterOperator["lte"] = "lte";
10
+ DateFilterOperator["gte"] = "gte";
11
+ })(DateFilterOperator || (exports.DateFilterOperator = DateFilterOperator = {}));
@@ -5,6 +5,7 @@ export * from './Channel';
5
5
  export * from './Content';
6
6
  export * from './ContentDefinition';
7
7
  export * from './ContentDefinitionSchema';
8
+ export * from './ContentExportImport';
8
9
  export * from './ContentRepository';
9
10
  export * from './ContentTag';
10
11
  export * from './Invites';
package/dist/api/index.js CHANGED
@@ -21,6 +21,7 @@ __exportStar(require("./Channel"), exports);
21
21
  __exportStar(require("./Content"), exports);
22
22
  __exportStar(require("./ContentDefinition"), exports);
23
23
  __exportStar(require("./ContentDefinitionSchema"), exports);
24
+ __exportStar(require("./ContentExportImport"), exports);
24
25
  __exportStar(require("./ContentRepository"), exports);
25
26
  __exportStar(require("./ContentTag"), exports);
26
27
  __exportStar(require("./Invites"), exports);
@@ -0,0 +1,510 @@
1
+ import { AuthorResponse } from './Author';
2
+ import { PagedListResponse } from './common';
3
+ import { ContentId, ListContentsFilters } from './Content';
4
+
5
+ /**
6
+ * The content export request unique id
7
+ */
8
+ export type ContentExportRequestId = number;
9
+
10
+ /**
11
+ * The content import request unique id
12
+ */
13
+ export type ContentImportRequestId = number;
14
+
15
+ /**
16
+ * The content import request item unique id
17
+ */
18
+ export type ContentImportRequestItemId = number;
19
+
20
+ /**
21
+ * This enum represent the file format of a content export, and the format an import file is read with
22
+ */
23
+ export enum ContentExportFormat {
24
+ JSON = 'json',
25
+ CSV = 'csv'
26
+ }
27
+
28
+ /**
29
+ * This enum represent the lifecycle of a content export request. Exports are processed
30
+ * asynchronously, so a freshly created request is always `queued`
31
+ */
32
+ export enum ContentExportStatus {
33
+ QUEUED = 'queued',
34
+ PROCESSING = 'processing',
35
+ COMPLETED = 'completed',
36
+ FAILED = 'failed'
37
+ }
38
+
39
+ /**
40
+ * This enum represent the lifecycle of a content import request. A freshly created request is
41
+ * `awaiting_upload` until the import file is uploaded to
42
+ * [[CreateContentImportRequestResponse.uploadUrl]], which is what starts the import
43
+ */
44
+ export enum ContentImportStatus {
45
+ AWAITING_UPLOAD = 'awaiting_upload',
46
+ PROCESSING = 'processing',
47
+ COMPLETED = 'completed',
48
+ COMPLETED_WITH_ERRORS = 'completed_with_errors',
49
+ FAILED = 'failed'
50
+ }
51
+
52
+ /**
53
+ * This enum represent what an imported row describes: the content itself or one of its translations
54
+ */
55
+ export enum ContentImportRowType {
56
+ CONTENT = 'content',
57
+ TRANSLATION = 'translation'
58
+ }
59
+
60
+ /**
61
+ * This enum represent the outcome of a single imported row
62
+ */
63
+ export enum ContentImportItemStatus {
64
+ SUCCESS = 'success',
65
+ FAILED = 'failed'
66
+ }
67
+
68
+ /**
69
+ * This enum represent what the import did to the content of a successfully imported row
70
+ */
71
+ export enum ContentImportItemAction {
72
+ UPDATED = 'updated'
73
+ }
74
+
75
+ /**
76
+ * This type represent the error attached to a failed content export or import request
77
+ */
78
+ export type ContentExportImportError = {
79
+ /**
80
+ * The error type discriminator
81
+ */
82
+ type: string;
83
+ /**
84
+ * The human readable error message
85
+ */
86
+ message: string;
87
+ };
88
+
89
+ /**
90
+ * This type represent one of the files produced by a content export, one per exported content
91
+ * definition. Files are appended as soon as they are uploaded, so a still `processing` export
92
+ * already lists the files that can be downloaded
93
+ */
94
+ export type ContentExportFile = {
95
+ /**
96
+ * The mnemonic id of the content definition the file contains the contents of
97
+ */
98
+ definitionMnemonicId: string;
99
+ /**
100
+ * The internal storage key of the file. Not fetchable as is, pass
101
+ * [[definitionMnemonicId]] to [[ContentExportImportFacade.downloadExport]] to get a
102
+ * downloadable url
103
+ */
104
+ s3Key: string;
105
+ /**
106
+ * The number of contents written in the file
107
+ */
108
+ itemCount: number;
109
+ };
110
+
111
+ /**
112
+ * This type represent the model of a content export request
113
+ */
114
+ export type ContentExportRequestResponse = {
115
+ /**
116
+ * The content export request unique id
117
+ */
118
+ id: ContentExportRequestId;
119
+ /**
120
+ * The space the exported contents belong to
121
+ */
122
+ spaceId: string;
123
+ /**
124
+ * The current status of the export
125
+ */
126
+ status: ContentExportStatus;
127
+ /**
128
+ * The filters the exported contents have been selected with
129
+ */
130
+ filters: ListContentsFilters;
131
+ /**
132
+ * The format the export files are written in
133
+ */
134
+ format: ContentExportFormat;
135
+ /**
136
+ * The separator used by the exported csv files. Meaningless when [[format]] is `json`
137
+ */
138
+ csvSeparator: string;
139
+ /**
140
+ * The files produced so far, one per exported content definition.
141
+ * Null until the export starts producing them
142
+ */
143
+ files: ContentExportFile[] | null;
144
+ /**
145
+ * The error describing why the export failed, null unless [[status]] is `failed`
146
+ */
147
+ error: ContentExportImportError | null;
148
+ /**
149
+ * The author that requested the export
150
+ */
151
+ author: AuthorResponse;
152
+ /**
153
+ * The last author that modified the export request. Only returned by
154
+ * [[ContentExportImportFacade.createExport]], the listing does not resolve it
155
+ */
156
+ latestContributor?: AuthorResponse;
157
+ /**
158
+ * The export request creation date
159
+ */
160
+ createdDate: Date;
161
+ /**
162
+ * The export request last modified date
163
+ */
164
+ lastModifiedDate: Date;
165
+ };
166
+
167
+ /**
168
+ * This type represent the data needed to make a create content export request API request
169
+ */
170
+ export type CreateContentExportRequestRequest = {
171
+ /**
172
+ * The filters selecting the contents to export, the same ones accepted by
173
+ * [[ContentFacade.list]]. When omitted every unarchived content of the space is exported.
174
+ * Archived contents cannot be imported back, so [[ListContentsFilters.contentsStatus]]
175
+ * defaults to `unarchived`
176
+ */
177
+ filters?: Partial<ListContentsFilters>;
178
+ /**
179
+ * The format to write the export files in, defaults to `json`
180
+ */
181
+ format?: ContentExportFormat;
182
+ /**
183
+ * The single character separator to write the exported csv files with, defaults to `,`.
184
+ * Ignored when [[format]] is `json`
185
+ */
186
+ csvSeparator?: string;
187
+ };
188
+
189
+ /**
190
+ * This type represent the response of a create content export request API request.
191
+ * The returned export is always `queued`: it is processed asynchronously
192
+ */
193
+ export type CreateContentExportRequestResponse = ContentExportRequestResponse;
194
+
195
+ /**
196
+ * This type represent the data needed to make a list content export requests API request
197
+ */
198
+ export type ListContentExportRequestsRequest = {
199
+ /**
200
+ * The export requests to skip (used to paginate the result), defaults to 0
201
+ */
202
+ skip?: number;
203
+ /**
204
+ * The export requests to take (used to paginate the result), defaults to 20.
205
+ * Cannot exceed [[MAX_CONTENT_EXPORT_IMPORT_PAGE_SIZE]]
206
+ */
207
+ take?: number;
208
+ };
209
+
210
+ /**
211
+ * This type represent the response of a list content export requests API request,
212
+ * sorted by [[ContentExportRequestResponse.createdDate]] descending
213
+ */
214
+ export type ListContentExportRequestsResponse = PagedListResponse<ContentExportRequestResponse>;
215
+
216
+ /**
217
+ * This type represent the data needed to make a download content export API request
218
+ */
219
+ export type DownloadContentExportRequest = {
220
+ /**
221
+ * The unique id of the completed export request to download a file of
222
+ */
223
+ exportRequestId: ContentExportRequestId;
224
+ /**
225
+ * The mnemonic id of the content definition whose exported file is wanted.
226
+ * It must be one of the [[ContentExportRequestResponse.files]] entries
227
+ */
228
+ definitionMnemonicId: string;
229
+ };
230
+
231
+ /**
232
+ * This type represent the response of a download content export API request
233
+ */
234
+ export type DownloadContentExportResponse = {
235
+ /**
236
+ * The mnemonic id of the content definition the file contains the contents of
237
+ */
238
+ definitionMnemonicId: string;
239
+ /**
240
+ * The temporary url to download the exported file from. The client does not download the
241
+ * file, fetch this url yourself
242
+ */
243
+ downloadUrl: string;
244
+ /**
245
+ * The number of seconds [[downloadUrl]] stays valid for
246
+ */
247
+ expiresInSeconds: number;
248
+ /**
249
+ * The number of contents written in the file
250
+ */
251
+ itemCount: number;
252
+ };
253
+
254
+ /**
255
+ * This type represent the options a content import file is read with
256
+ */
257
+ export type ContentImportOptions = {
258
+ /**
259
+ * The format the import file is read as
260
+ */
261
+ format: ContentExportFormat;
262
+ /**
263
+ * The separator the imported csv file is read with. Meaningless when [[format]] is `json`
264
+ */
265
+ csvSeparator?: string;
266
+ };
267
+
268
+ /**
269
+ * This type represent the model of a content import request
270
+ */
271
+ export type ContentImportRequestResponse = {
272
+ /**
273
+ * The content import request unique id
274
+ */
275
+ id: ContentImportRequestId;
276
+ /**
277
+ * The space the contents are imported in
278
+ */
279
+ spaceId: string;
280
+ /**
281
+ * The current status of the import
282
+ */
283
+ status: ContentImportStatus;
284
+ /**
285
+ * The name of the uploaded file, as declared when the import was created. Null when not declared
286
+ */
287
+ fileName: string | null;
288
+ /**
289
+ * The storage key the import file is expected at
290
+ */
291
+ s3Key: string;
292
+ /**
293
+ * The options the import file is read with
294
+ */
295
+ options: ContentImportOptions;
296
+ /**
297
+ * The arn of the workflow execution processing the import.
298
+ * Null while the import is still `awaiting_upload`
299
+ */
300
+ executionArn: string | null;
301
+ /**
302
+ * The number of rows found in the import file, null until the file has been read
303
+ */
304
+ totalItems: number | null;
305
+ /**
306
+ * The number of successfully imported rows, null until the import completes
307
+ */
308
+ succeededItems: number | null;
309
+ /**
310
+ * The number of rows that failed to import, null until the import completes.
311
+ * When greater than 0 the [[status]] is `completed_with_errors`
312
+ */
313
+ failedItems: number | null;
314
+ /**
315
+ * The error describing why the whole import failed, null unless [[status]] is `failed`.
316
+ * Single row failures are reported by [[ContentImportRequestItemResponse.error]] instead
317
+ */
318
+ error: ContentExportImportError | null;
319
+ /**
320
+ * The author that requested the import
321
+ */
322
+ author: AuthorResponse;
323
+ /**
324
+ * The import request creation date
325
+ */
326
+ createdDate: Date;
327
+ /**
328
+ * The import request last modified date
329
+ */
330
+ lastModifiedDate: Date;
331
+ };
332
+
333
+ /**
334
+ * This type represent the data needed to make a create content import request API request
335
+ */
336
+ export type CreateContentImportRequestRequest = {
337
+ /**
338
+ * The name of the file about to be uploaded, kept for display purposes only
339
+ */
340
+ fileName?: string;
341
+ /**
342
+ * The options to read the uploaded file with
343
+ */
344
+ options?: {
345
+ /**
346
+ * The format the uploaded file is read as, defaults to `json`
347
+ */
348
+ format?: ContentExportFormat;
349
+ /**
350
+ * The single character separator the uploaded csv file is read with, defaults to `,`.
351
+ * Ignored when [[format]] is `json`
352
+ */
353
+ csvSeparator?: string;
354
+ };
355
+ };
356
+
357
+ /**
358
+ * This type represent the response of a create content import request API request
359
+ */
360
+ export type CreateContentImportRequestResponse = {
361
+ /**
362
+ * The created content import request unique id
363
+ */
364
+ importRequestId: ContentImportRequestId;
365
+ /**
366
+ * The storage key the file is uploaded to
367
+ */
368
+ s3Key: string;
369
+ /**
370
+ * The temporary url to upload the import file to, with a `PUT` and a `Content-Type` of
371
+ * `text/csv` or `application/json` matching the requested format. The client does not upload
372
+ * the file, upload it yourself: the upload is what starts the import
373
+ */
374
+ uploadUrl: string;
375
+ /**
376
+ * The number of seconds [[uploadUrl]] stays valid for
377
+ */
378
+ expiresInSeconds: number;
379
+ };
380
+
381
+ /**
382
+ * This type represent the data needed to make a list content import requests API request
383
+ */
384
+ export type ListContentImportRequestsRequest = {
385
+ /**
386
+ * The import requests to skip (used to paginate the result), defaults to 0
387
+ */
388
+ skip?: number;
389
+ /**
390
+ * The import requests to take (used to paginate the result), defaults to 20.
391
+ * Cannot exceed [[MAX_CONTENT_EXPORT_IMPORT_PAGE_SIZE]]
392
+ */
393
+ take?: number;
394
+ };
395
+
396
+ /**
397
+ * This type represent the response of a list content import requests API request,
398
+ * sorted by [[ContentImportRequestResponse.createdDate]] descending
399
+ */
400
+ export type ListContentImportRequestsResponse = PagedListResponse<ContentImportRequestResponse>;
401
+
402
+ /**
403
+ * This type represent the error attached to a single failed imported row
404
+ */
405
+ export type ContentImportItemError = {
406
+ /**
407
+ * The error code discriminator
408
+ */
409
+ code: string;
410
+ /**
411
+ * The human readable error message
412
+ */
413
+ message?: string;
414
+ /**
415
+ * The error additional details, their shape depends on [[code]]
416
+ */
417
+ details?: any;
418
+ };
419
+
420
+ /**
421
+ * This type represent the outcome of a single row of a content import. One item is written per
422
+ * content row plus one per translation row, so a content with 3 translated locales produces 4 items
423
+ */
424
+ export type ContentImportRequestItemResponse = {
425
+ /**
426
+ * The content import request item unique id
427
+ */
428
+ id: ContentImportRequestItemId;
429
+ /**
430
+ * The space the contents are imported in
431
+ */
432
+ spaceId: string;
433
+ /**
434
+ * The unique id of the import request the item belongs to
435
+ */
436
+ importRequestId: ContentImportRequestId;
437
+ /**
438
+ * The zero based position of the row in the import file
439
+ */
440
+ itemIndex: number;
441
+ /**
442
+ * The public id of the imported content, null when the row did not carry a readable one
443
+ */
444
+ publicId: string | null;
445
+ /**
446
+ * The mnemonic id of the imported content definition, null when the row did not carry a
447
+ * readable one
448
+ */
449
+ definitionMnemonicId: string | null;
450
+ /**
451
+ * Whether the row describes the content itself or one of its translations
452
+ */
453
+ rowType: ContentImportRowType;
454
+ /**
455
+ * The locale the row has been imported in. Always null when [[rowType]] is `content`:
456
+ * only translation rows are locale specific
457
+ */
458
+ locale: string | null;
459
+ /**
460
+ * What the import did to the content, null when the row failed
461
+ */
462
+ action: ContentImportItemAction | null;
463
+ /**
464
+ * The outcome of the row
465
+ */
466
+ status: ContentImportItemStatus;
467
+ /**
468
+ * The unique id of the imported content, null when the row failed before the content
469
+ * could be resolved
470
+ */
471
+ contentId: ContentId | null;
472
+ /**
473
+ * The error describing why the row failed, null unless [[status]] is `failed`
474
+ */
475
+ error: ContentImportItemError | null;
476
+ };
477
+
478
+ /**
479
+ * This type represent the data needed to make a list content import request items API request
480
+ */
481
+ export type ListContentImportRequestItemsRequest = {
482
+ /**
483
+ * The unique id of the import request to list the items of
484
+ */
485
+ importRequestId: ContentImportRequestId;
486
+ /**
487
+ * The items to skip (used to paginate the result), defaults to 0
488
+ */
489
+ skip?: number;
490
+ /**
491
+ * The items to take (used to paginate the result), defaults to 50.
492
+ * Cannot exceed [[MAX_CONTENT_EXPORT_IMPORT_PAGE_SIZE]]
493
+ */
494
+ take?: number;
495
+ /**
496
+ * This filter is used to list only the items with the given outcome, typically `failed` to
497
+ * review what an import could not apply. When omitted every item is returned
498
+ */
499
+ status?: ContentImportItemStatus;
500
+ };
501
+
502
+ /**
503
+ * This type represent the response of a list content import request items API request
504
+ */
505
+ export type ListContentImportRequestItemsResponse = PagedListResponse<ContentImportRequestItemResponse>;
506
+
507
+ /**
508
+ * The maximum number of items a content export or import list API request can take in a single page
509
+ */
510
+ export const MAX_CONTENT_EXPORT_IMPORT_PAGE_SIZE = 100;
@@ -236,7 +236,31 @@ export type UpdateReleaseRequest = {
236
236
  export type UpdateReleaseResponse = Release;
237
237
 
238
238
  /**
239
- * This type represent the filters that can be applied to release items in the release V2 API requests
239
+ * This enum represent the comparison operators available to a release item date filter
240
+ */
241
+ export enum DateFilterOperator {
242
+ lte = "lte",
243
+ gte = "gte",
244
+ }
245
+
246
+ /**
247
+ * This type represent a filter applied to one of the release item date fields
248
+ */
249
+ export type ReleaseItemDateFilter = {
250
+ /**
251
+ * The date to compare the release item date field with, as an ISO 8601 string
252
+ */
253
+ value: string;
254
+ /**
255
+ * The comparison to apply to the release item date field.
256
+ * Defaults to [[DateFilterOperator.lte]], i.e. "at or before"
257
+ */
258
+ operator?: DateFilterOperator;
259
+ };
260
+
261
+ /**
262
+ * This type represent the filters that can be applied to release items in the release V2 API requests.
263
+ * When more than one filter is given they are combined with AND
240
264
  */
241
265
  export type ReleaseItemFilters = {
242
266
  /**
@@ -255,6 +279,16 @@ export type ReleaseItemFilters = {
255
279
  * Match only the release items that are (or are not) currently selected to be published
256
280
  */
257
281
  toPublish?: boolean;
282
+ /**
283
+ * Match only the release items whose related content online date satisfies the filter.
284
+ * Release items with no online date never match, whatever the operator
285
+ */
286
+ onlineDate?: ReleaseItemDateFilter;
287
+ /**
288
+ * Match only the release items whose related content offline date satisfies the filter.
289
+ * Release items with no offline date never match, whatever the operator
290
+ */
291
+ offlineDate?: ReleaseItemDateFilter;
258
292
  };
259
293
 
260
294
  /**
@@ -289,7 +323,9 @@ export type UpdateReleaseV2Request = {
289
323
  includeAll?: boolean;
290
324
  /**
291
325
  * Select the release items matching the given filters. Empty filters select all the release items.
292
- * A toPublish filter is evaluated against the selection before the update
326
+ * A toPublish filter is evaluated against the selection before the update.
327
+ * The filters are the same ones accepted by [[ListReleaseItemsV2Request]], so a selection can be
328
+ * previewed with `listReleaseItemsV2` and then applied by passing the very same filters here
293
329
  */
294
330
  filters?: ReleaseItemFilters;
295
331
  /**
package/lib/api/index.ts CHANGED
@@ -5,6 +5,7 @@ export * from './Channel';
5
5
  export * from './Content';
6
6
  export * from './ContentDefinition';
7
7
  export * from './ContentDefinitionSchema';
8
+ export * from './ContentExportImport';
8
9
  export * from './ContentRepository';
9
10
  export * from './ContentTag';
10
11
  export * from './Invites';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentchef/contentchef-types",
3
- "version": "10.1.0-alpha.6",
3
+ "version": "10.1.0-alpha.8",
4
4
  "description": "ContentChef types",
5
5
  "author": "PierpaoloIannone <piannone@byte-code.com>",
6
6
  "homepage": "https://github.com/ContentChef/contentchef-management-js-client#readme",
@@ -34,5 +34,5 @@
34
34
  "devDependencies": {
35
35
  "typescript": "^5.9.3"
36
36
  },
37
- "gitHead": "44d000ee30bfadef421bea413b472ee5290a1000"
37
+ "gitHead": "972240c74e54c066563cc1460d5331bbfc9c0d65"
38
38
  }