@contentchef/contentchef-types 10.1.0-alpha.1 → 10.1.0-alpha.10
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.d.ts +65 -0
- package/dist/api/Content.js +23 -1
- package/dist/api/ContentExportImport.d.ts +533 -0
- package/dist/api/ContentExportImport.js +62 -0
- package/dist/api/PublishedContent.d.ts +117 -6
- package/dist/api/PublishedContent.js +9 -0
- package/dist/api/UnpublishRequest.d.ts +97 -0
- package/dist/api/UnpublishRequest.js +7 -0
- package/dist/api/index.d.ts +2 -0
- package/dist/api/index.js +2 -0
- package/lib/api/Content.ts +68 -0
- package/lib/api/ContentExportImport.ts +564 -0
- package/lib/api/PublishedContent.ts +121 -6
- package/lib/api/UnpublishRequest.ts +104 -0
- package/lib/api/index.ts +2 -0
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContentId } from "./Content";
|
|
1
|
+
import { ContentId, LocalizationSettings } from "./Content";
|
|
2
2
|
import { AuthorResponse } from "./Author";
|
|
3
3
|
import { ContentRepositoryId } from "./ContentRepository";
|
|
4
4
|
import { ContentTranslationStatus } from "./ContentTranslation";
|
|
@@ -236,7 +236,31 @@ export type UpdateReleaseRequest = {
|
|
|
236
236
|
export type UpdateReleaseResponse = Release;
|
|
237
237
|
|
|
238
238
|
/**
|
|
239
|
-
* This
|
|
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
|
/**
|
|
@@ -244,9 +268,9 @@ export type ReleaseItemFilters = {
|
|
|
244
268
|
*/
|
|
245
269
|
search?: string;
|
|
246
270
|
/**
|
|
247
|
-
* The release item related content locale
|
|
271
|
+
* The release item related content locales. Matches items whose content locale is any of the given values
|
|
248
272
|
*/
|
|
249
|
-
locale?: string;
|
|
273
|
+
locale?: string[];
|
|
250
274
|
/**
|
|
251
275
|
* The release item related content definition mnemonic ids
|
|
252
276
|
*/
|
|
@@ -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
|
/**
|
|
@@ -338,12 +374,91 @@ export type ListReleaseItemsV2Request = {
|
|
|
338
374
|
filters?: ReleaseItemFilters;
|
|
339
375
|
};
|
|
340
376
|
|
|
377
|
+
/**
|
|
378
|
+
* This type represent a single locale variant of a content inside a release item group
|
|
379
|
+
*/
|
|
380
|
+
export type ReleaseItemVariant = {
|
|
381
|
+
/**
|
|
382
|
+
* The release item unique id
|
|
383
|
+
*/
|
|
384
|
+
id: ReleaseItemId;
|
|
385
|
+
/**
|
|
386
|
+
* The variant content locale
|
|
387
|
+
*/
|
|
388
|
+
contentLocale: string | null;
|
|
389
|
+
/**
|
|
390
|
+
* Mark if the release item is selected to be published
|
|
391
|
+
*/
|
|
392
|
+
toPublish: boolean;
|
|
393
|
+
/**
|
|
394
|
+
* Status of the ContentTranslation (defined if content is derived from a translation)
|
|
395
|
+
*/
|
|
396
|
+
translationStatus: ContentTranslationStatus | null;
|
|
397
|
+
/**
|
|
398
|
+
* The localization settings of the related content
|
|
399
|
+
*/
|
|
400
|
+
contentLocalizationSettings: LocalizationSettings;
|
|
401
|
+
/**
|
|
402
|
+
* The localized content unique id (defined if content is derived from a translation)
|
|
403
|
+
*/
|
|
404
|
+
localizedContentId: string | null;
|
|
405
|
+
/**
|
|
406
|
+
* The release item related content tags
|
|
407
|
+
*/
|
|
408
|
+
contentTags: string[];
|
|
409
|
+
/**
|
|
410
|
+
* The release item related content online date, as an ISO 8601 string
|
|
411
|
+
*/
|
|
412
|
+
onlineDate: string | null;
|
|
413
|
+
/**
|
|
414
|
+
* The release item related content offline date, as an ISO 8601 string
|
|
415
|
+
*/
|
|
416
|
+
offlineDate: string | null;
|
|
417
|
+
};
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* This type represent a release content along with its locale variants matching the request filters
|
|
421
|
+
*/
|
|
422
|
+
export type ReleaseItemGroup = {
|
|
423
|
+
/**
|
|
424
|
+
* The related content unique id
|
|
425
|
+
*/
|
|
426
|
+
contentId: ContentId;
|
|
427
|
+
/**
|
|
428
|
+
* The related content public id
|
|
429
|
+
*/
|
|
430
|
+
publicId: string;
|
|
431
|
+
/**
|
|
432
|
+
* The related content name
|
|
433
|
+
*/
|
|
434
|
+
contentName: string;
|
|
435
|
+
/**
|
|
436
|
+
* The related content definition mnemonic id
|
|
437
|
+
*/
|
|
438
|
+
contentDefinitionMnemonicId: string;
|
|
439
|
+
/**
|
|
440
|
+
* The related content repository mnemonic id
|
|
441
|
+
*/
|
|
442
|
+
contentRepositoryMnemonicId: string;
|
|
443
|
+
/**
|
|
444
|
+
* The locale variants of the content matching the request filters
|
|
445
|
+
*/
|
|
446
|
+
variants: ReleaseItemVariant[];
|
|
447
|
+
};
|
|
448
|
+
|
|
341
449
|
/**
|
|
342
450
|
* This type represent the response of a list release items V2 API request.
|
|
451
|
+
* The release items are grouped by content: one [[ReleaseItemGroup]] per content id with all of its
|
|
452
|
+
* filter-matching locale variants, so pagination (over groups) never splits a content across pages
|
|
453
|
+
* and [[PagedListResponse.total]] counts the matching groups.
|
|
343
454
|
* The facets ([[locales]], [[contentDefinitionMnemonicIds]]) and [[selectedCount]] are computed
|
|
344
455
|
* over the whole release, ignoring the request filters
|
|
345
456
|
*/
|
|
346
|
-
export type ListReleaseItemsV2Response = PagedListResponse<
|
|
457
|
+
export type ListReleaseItemsV2Response = PagedListResponse<ReleaseItemGroup> & {
|
|
458
|
+
/**
|
|
459
|
+
* The total number of release items matching the request filters
|
|
460
|
+
*/
|
|
461
|
+
totalItems: number;
|
|
347
462
|
/**
|
|
348
463
|
* The number of release items selected to be published in the whole release
|
|
349
464
|
*/
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { ContentId } from './Content';
|
|
2
|
+
import { AuthorResponse } from './Author';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The unpublish request unique id
|
|
6
|
+
*/
|
|
7
|
+
export type UnpublishRequestId = number;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* This type represent the data needed to make an unpublish content API request
|
|
11
|
+
*/
|
|
12
|
+
export type UnpublishContentRequest = {
|
|
13
|
+
/**
|
|
14
|
+
* The content id to unpublish. Every staged locale of the content is unpublished
|
|
15
|
+
*/
|
|
16
|
+
contentId: number;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* This type represent the response of an unpublish content API request
|
|
21
|
+
*/
|
|
22
|
+
export type UnpublishContentResponse = {
|
|
23
|
+
/**
|
|
24
|
+
* The staged content version that has been removed.
|
|
25
|
+
* Undefined when nothing was staged, meaning the request was a no-op
|
|
26
|
+
*/
|
|
27
|
+
contentVersion?: number;
|
|
28
|
+
/**
|
|
29
|
+
* The content locales whose staged content has actually been removed or reverted to its live version
|
|
30
|
+
*/
|
|
31
|
+
locales: string[];
|
|
32
|
+
/**
|
|
33
|
+
* The number of release items dropped from the non archived releases containing the content
|
|
34
|
+
*/
|
|
35
|
+
removedReleaseItems: number;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* This type represent the data needed to make a list unpublish requests API request
|
|
40
|
+
*/
|
|
41
|
+
export type ListUnpublishRequestsRequest = {
|
|
42
|
+
/**
|
|
43
|
+
* The content id to list the unpublish requests of
|
|
44
|
+
*/
|
|
45
|
+
contentId: number;
|
|
46
|
+
/**
|
|
47
|
+
* The content version to list the unpublish requests of.
|
|
48
|
+
* When omitted the whole unpublish history of the content is returned
|
|
49
|
+
*/
|
|
50
|
+
contentVersion?: number;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* This type represent the model of an unpublish request, the audit record of a content
|
|
55
|
+
* having been unpublished. It is written after the unpublish has been applied, so it always
|
|
56
|
+
* describes a completed unpublish
|
|
57
|
+
*/
|
|
58
|
+
export type UnpublishRequestResponse = {
|
|
59
|
+
/**
|
|
60
|
+
* The unpublish request unique id
|
|
61
|
+
*/
|
|
62
|
+
id: UnpublishRequestId;
|
|
63
|
+
/**
|
|
64
|
+
* The author that unpublished the content
|
|
65
|
+
*/
|
|
66
|
+
author: AuthorResponse;
|
|
67
|
+
/**
|
|
68
|
+
* The unique id of the unpublished content
|
|
69
|
+
*/
|
|
70
|
+
contentId: ContentId;
|
|
71
|
+
/**
|
|
72
|
+
* The unpublished content version
|
|
73
|
+
*/
|
|
74
|
+
contentVersion: number;
|
|
75
|
+
/**
|
|
76
|
+
* The content locales that have been unpublished
|
|
77
|
+
*/
|
|
78
|
+
locales: string[];
|
|
79
|
+
/**
|
|
80
|
+
* The date the content has been unpublished, as opposed to [[createdDate]]
|
|
81
|
+
* which is the date this audit record has been written
|
|
82
|
+
*/
|
|
83
|
+
unpublishedDate: Date;
|
|
84
|
+
/**
|
|
85
|
+
* The unpublish request creation date
|
|
86
|
+
*/
|
|
87
|
+
createdDate: Date;
|
|
88
|
+
/**
|
|
89
|
+
* The unpublish request last modified date
|
|
90
|
+
*/
|
|
91
|
+
lastModifiedDate: Date;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* This type represent the response of a list unpublish requests API request, sorted by
|
|
96
|
+
* [[UnpublishRequestResponse.unpublishedDate]] descending.
|
|
97
|
+
* Only the [[MAX_LISTED_UNPUBLISH_REQUESTS]] most recent unpublish requests are returned
|
|
98
|
+
*/
|
|
99
|
+
export type ListUnpublishRequestsResponse = UnpublishRequestResponse[];
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* The maximum number of unpublish requests returned by a list unpublish requests API request
|
|
103
|
+
*/
|
|
104
|
+
export const MAX_LISTED_UNPUBLISH_REQUESTS = 5;
|
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';
|
|
@@ -13,6 +14,7 @@ export * from './PublishedContent';
|
|
|
13
14
|
export * from './PublishingRequest';
|
|
14
15
|
export * from './Space';
|
|
15
16
|
export * from './Subscription';
|
|
17
|
+
export * from './UnpublishRequest';
|
|
16
18
|
export * from './User';
|
|
17
19
|
export * from './UserConsents';
|
|
18
20
|
export * from './UserPermission';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentchef/contentchef-types",
|
|
3
|
-
"version": "10.1.0-alpha.
|
|
3
|
+
"version": "10.1.0-alpha.10",
|
|
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": "
|
|
37
|
+
"gitHead": "0cc1e6b2a9468100a09fed18ab3ffaca0bcb53e8"
|
|
38
38
|
}
|