@contentchef/contentchef-types 10.1.0-alpha.0 → 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.
@@ -1,7 +1,8 @@
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";
5
+ import { PagedListResponse } from "./common";
5
6
 
6
7
  /**
7
8
  * The published content unique id
@@ -234,6 +235,244 @@ export type UpdateReleaseRequest = {
234
235
  */
235
236
  export type UpdateReleaseResponse = Release;
236
237
 
238
+ /**
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
264
+ */
265
+ export type ReleaseItemFilters = {
266
+ /**
267
+ * Case insensitive search applied to the release item content name and public id
268
+ */
269
+ search?: string;
270
+ /**
271
+ * The release item related content locales. Matches items whose content locale is any of the given values
272
+ */
273
+ locale?: string[];
274
+ /**
275
+ * The release item related content definition mnemonic ids
276
+ */
277
+ contentDefinitionMnemonicIds?: string[];
278
+ /**
279
+ * Match only the release items that are (or are not) currently selected to be published
280
+ */
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;
292
+ };
293
+
294
+ /**
295
+ * This type represent the data needed to make a create release V2 API request
296
+ */
297
+ export type CreateReleaseV2Request = {};
298
+
299
+ /**
300
+ * This type represent the response of a create release V2 API request.
301
+ * Unlike [[CreateReleaseResponse]] it does not return the release items, only their count
302
+ */
303
+ export type CreateReleaseV2Response = Omit<Release, "releaseItems"> & {
304
+ /**
305
+ * The number of items in the drafted release
306
+ */
307
+ itemsCount: number;
308
+ };
309
+
310
+ /**
311
+ * This type represent the data needed to make an update release V2 API request.
312
+ * The selection of items to publish is replaced atomically: exactly one of
313
+ * [[includeAll]], [[filters]] or [[releaseItemIds]] must be provided
314
+ */
315
+ export type UpdateReleaseV2Request = {
316
+ /**
317
+ * The release unique id to update
318
+ */
319
+ releaseId: ReleaseId;
320
+ /**
321
+ * When true, select all the release items to be published
322
+ */
323
+ includeAll?: boolean;
324
+ /**
325
+ * Select the release items matching the given filters. Empty filters select all the release items.
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
329
+ */
330
+ filters?: ReleaseItemFilters;
331
+ /**
332
+ * Select the release items with the given ids. An empty list deselects all the release items
333
+ */
334
+ releaseItemIds?: ReleaseItemId[];
335
+ };
336
+
337
+ /**
338
+ * This type represent the response of an update release V2 API request
339
+ */
340
+ export type UpdateReleaseV2Response = {
341
+ /**
342
+ * The updated release unique id
343
+ */
344
+ releaseId: ReleaseId;
345
+ /**
346
+ * The number of release items selected to be published
347
+ */
348
+ selectedCount: number;
349
+ /**
350
+ * The total number of items in the release
351
+ */
352
+ totalCount: number;
353
+ };
354
+
355
+ /**
356
+ * This type represent the data needed to make a list release items V2 API request
357
+ */
358
+ export type ListReleaseItemsV2Request = {
359
+ /**
360
+ * The release unique id
361
+ */
362
+ releaseId: ReleaseId;
363
+ /**
364
+ * The number of release items to skip
365
+ */
366
+ skip: number;
367
+ /**
368
+ * The number of release items to return (between 1 and 100)
369
+ */
370
+ take: number;
371
+ /**
372
+ * The filters to apply to the returned page of release items
373
+ */
374
+ filters?: ReleaseItemFilters;
375
+ };
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
+
449
+ /**
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.
454
+ * The facets ([[locales]], [[contentDefinitionMnemonicIds]]) and [[selectedCount]] are computed
455
+ * over the whole release, ignoring the request filters
456
+ */
457
+ export type ListReleaseItemsV2Response = PagedListResponse<ReleaseItemGroup> & {
458
+ /**
459
+ * The total number of release items matching the request filters
460
+ */
461
+ totalItems: number;
462
+ /**
463
+ * The number of release items selected to be published in the whole release
464
+ */
465
+ selectedCount: number;
466
+ /**
467
+ * The distinct content locales present in the whole release
468
+ */
469
+ locales: string[];
470
+ /**
471
+ * The distinct content definition mnemonic ids present in the whole release
472
+ */
473
+ contentDefinitionMnemonicIds: string[];
474
+ };
475
+
237
476
  /**
238
477
  * This type represent the response of a get published content API request
239
478
  */
@@ -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.0",
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": "b8990446304be212c6953c04b2a148669d190cf9"
37
+ "gitHead": "0cc1e6b2a9468100a09fed18ab3ffaca0bcb53e8"
38
38
  }