@contentchef/contentchef-types 10.1.0-alpha.1 → 10.1.0-alpha.11

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.
@@ -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 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
  /**
@@ -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<ReleaseItem> & {
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
  */
package/lib/api/Space.ts CHANGED
@@ -258,3 +258,108 @@ export type UpdateSpacePublishingLocalesRequest = {
258
258
  * Return type of `updateSpacePublishingLocales`
259
259
  */
260
260
  export type UpdateSpacePublishingLocalesResponse = SpaceLocale;
261
+
262
+ /**
263
+ * This enum represent the lifecycle of a space deletion. A freshly requested deletion is
264
+ * `requested` and stays revocable until [[SpaceDeletionResponse.deleteAfter]], after which it
265
+ * becomes `running` and can no longer be withdrawn
266
+ */
267
+ export enum SpaceDeletionStatus {
268
+ /**
269
+ * Asked for, inside the revocation window, still revocable
270
+ */
271
+ REQUESTED = 'requested',
272
+ /**
273
+ * Withdrawn inside the revocation window, nothing has been deleted
274
+ */
275
+ REVOKED = 'revoked',
276
+ RUNNING = 'running',
277
+ DELETED = 'deleted',
278
+ FAILED = 'failed',
279
+ /**
280
+ * A dry run, only started by hand: it reports what it would delete and changes nothing
281
+ */
282
+ INSPECTED = 'inspected'
283
+ }
284
+
285
+ /**
286
+ * This type represent the model of a space deletion, the only record that outlives a deleted space
287
+ */
288
+ export type SpaceDeletionResponse = {
289
+ /**
290
+ * The space the deletion refers to
291
+ */
292
+ spaceId: string;
293
+ /**
294
+ * The current status of the deletion
295
+ */
296
+ status: SpaceDeletionStatus;
297
+ /**
298
+ * The name the space had, captured when the deletion was requested because deleting the space
299
+ * destroys it
300
+ */
301
+ spaceName?: string;
302
+ /**
303
+ * The subscription the space was claimed under, preserved for the same reason as [[spaceName]]
304
+ */
305
+ subscriptionId?: string;
306
+ /**
307
+ * The account that requested the deletion
308
+ */
309
+ requestedBy?: string;
310
+ /**
311
+ * The account that withdrew the deletion, only set when [[status]] is `revoked`
312
+ */
313
+ revokedBy?: string;
314
+ /**
315
+ * The ISO date the revocation window shuts at: until then the deletion can be withdrawn with
316
+ * [[SystemFacade.revokeSpaceDeletion]], after it the deletion starts
317
+ */
318
+ deleteAfter?: string;
319
+ /**
320
+ * The arn of the workflow execution performing the deletion
321
+ */
322
+ executionArn?: string;
323
+ /**
324
+ * Whether the deletion only reported what it would delete, without deleting anything
325
+ */
326
+ dryRun?: boolean;
327
+ /**
328
+ * How many rows have been deleted, per domain and per table. Written when the deletion ends
329
+ */
330
+ counts?: { [domain: string]: { [table: string]: number; }; };
331
+ /**
332
+ * The message describing why the deletion failed, only set when [[status]] is `failed`
333
+ */
334
+ error?: string;
335
+ /**
336
+ * The ISO date the deletion record was last written at
337
+ */
338
+ updatedAt?: string;
339
+ };
340
+
341
+ /**
342
+ * This type represent the response of a delete space API request. The deletion has not happened
343
+ * yet: it is only requested, and stays revocable for [[revocableForHours]]
344
+ */
345
+ export type DeleteSpaceResponse = {
346
+ /**
347
+ * Always true, the request has been accepted
348
+ */
349
+ requested: boolean;
350
+ /**
351
+ * How long the deletion stays revocable, in hours
352
+ */
353
+ revocableForHours: number;
354
+ };
355
+
356
+ /**
357
+ * Return type of `revokeSpaceDeletion`, the withdrawn deletion record
358
+ */
359
+ export type RevokeSpaceDeletionResponse = SpaceDeletionResponse;
360
+
361
+ /**
362
+ * Return type of `getSpaceDeletionStatus`. It is null when the space has never had a deletion
363
+ * requested: no request is a normal answer, not a missing resource
364
+ */
365
+ export type GetSpaceDeletionStatusResponse = SpaceDeletionResponse | null;
@@ -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.1",
3
+ "version": "10.1.0-alpha.11",
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": "05e45ae2e7f58035520a882982dceabef27a063d"
37
+ "gitHead": "ea72e6f60f7e98e9b54477fc72ec7673502d9e93"
38
38
  }