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

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.
@@ -17,6 +17,39 @@ export declare enum ContentsStatus {
17
17
  unarchived = "unarchived",
18
18
  all = "all"
19
19
  }
20
+ /**
21
+ * This enum represent the fields that can be used to sort a list of contents
22
+ */
23
+ export declare enum ContentSortField {
24
+ name = "name",
25
+ publicId = "publicId",
26
+ createdDate = "createdDate",
27
+ lastModifiedDate = "lastModifiedDate",
28
+ onlineDate = "onlineDate",
29
+ offlineDate = "offlineDate",
30
+ locale = "locale",
31
+ definitionName = "definitionName"
32
+ }
33
+ /**
34
+ * This enum represent the possible sort directions
35
+ */
36
+ export declare enum SortDirection {
37
+ asc = "asc",
38
+ desc = "desc"
39
+ }
40
+ /**
41
+ * This type represent the data that can be used to sort a list of contents
42
+ */
43
+ export type ListContentsSort = {
44
+ /**
45
+ * The field to sort the list of contents by
46
+ */
47
+ field: ContentSortField;
48
+ /**
49
+ * The direction to sort the list of contents in
50
+ */
51
+ direction: SortDirection;
52
+ };
20
53
  /**
21
54
  * This type represent the model of facet
22
55
  */
@@ -351,6 +384,10 @@ export type ListContentsRequest = {
351
384
  * The data used to filter the list of content
352
385
  */
353
386
  filters: ListContentsFilters;
387
+ /**
388
+ * The data used to sort the list of content
389
+ */
390
+ sort?: ListContentsSort;
354
391
  };
355
392
  /**
356
393
  * This type represent the model of the single content returned from the list of content API request
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LocalizationSettings = exports.ContentFieldViolationCodes = exports.ContentsStatus = void 0;
3
+ exports.LocalizationSettings = exports.ContentFieldViolationCodes = exports.SortDirection = exports.ContentSortField = exports.ContentsStatus = void 0;
4
4
  /**
5
5
  * This enum represent the possible content status
6
6
  */
@@ -10,6 +10,28 @@ var ContentsStatus;
10
10
  ContentsStatus["unarchived"] = "unarchived";
11
11
  ContentsStatus["all"] = "all";
12
12
  })(ContentsStatus || (exports.ContentsStatus = ContentsStatus = {}));
13
+ /**
14
+ * This enum represent the fields that can be used to sort a list of contents
15
+ */
16
+ var ContentSortField;
17
+ (function (ContentSortField) {
18
+ ContentSortField["name"] = "name";
19
+ ContentSortField["publicId"] = "publicId";
20
+ ContentSortField["createdDate"] = "createdDate";
21
+ ContentSortField["lastModifiedDate"] = "lastModifiedDate";
22
+ ContentSortField["onlineDate"] = "onlineDate";
23
+ ContentSortField["offlineDate"] = "offlineDate";
24
+ ContentSortField["locale"] = "locale";
25
+ ContentSortField["definitionName"] = "definitionName";
26
+ })(ContentSortField || (exports.ContentSortField = ContentSortField = {}));
27
+ /**
28
+ * This enum represent the possible sort directions
29
+ */
30
+ var SortDirection;
31
+ (function (SortDirection) {
32
+ SortDirection["asc"] = "asc";
33
+ SortDirection["desc"] = "desc";
34
+ })(SortDirection || (exports.SortDirection = SortDirection = {}));
13
35
  /**
14
36
  * Thin enum represent all content fields violations error codes
15
37
  */
@@ -0,0 +1,97 @@
1
+ import { ContentId } from './Content';
2
+ import { AuthorResponse } from './Author';
3
+ /**
4
+ * The unpublish request unique id
5
+ */
6
+ export type UnpublishRequestId = number;
7
+ /**
8
+ * This type represent the data needed to make an unpublish content API request
9
+ */
10
+ export type UnpublishContentRequest = {
11
+ /**
12
+ * The content id to unpublish. Every staged locale of the content is unpublished
13
+ */
14
+ contentId: number;
15
+ };
16
+ /**
17
+ * This type represent the response of an unpublish content API request
18
+ */
19
+ export type UnpublishContentResponse = {
20
+ /**
21
+ * The staged content version that has been removed.
22
+ * Undefined when nothing was staged, meaning the request was a no-op
23
+ */
24
+ contentVersion?: number;
25
+ /**
26
+ * The content locales whose staged content has actually been removed or reverted to its live version
27
+ */
28
+ locales: string[];
29
+ /**
30
+ * The number of release items dropped from the non archived releases containing the content
31
+ */
32
+ removedReleaseItems: number;
33
+ };
34
+ /**
35
+ * This type represent the data needed to make a list unpublish requests API request
36
+ */
37
+ export type ListUnpublishRequestsRequest = {
38
+ /**
39
+ * The content id to list the unpublish requests of
40
+ */
41
+ contentId: number;
42
+ /**
43
+ * The content version to list the unpublish requests of.
44
+ * When omitted the whole unpublish history of the content is returned
45
+ */
46
+ contentVersion?: number;
47
+ };
48
+ /**
49
+ * This type represent the model of an unpublish request, the audit record of a content
50
+ * having been unpublished. It is written after the unpublish has been applied, so it always
51
+ * describes a completed unpublish
52
+ */
53
+ export type UnpublishRequestResponse = {
54
+ /**
55
+ * The unpublish request unique id
56
+ */
57
+ id: UnpublishRequestId;
58
+ /**
59
+ * The author that unpublished the content
60
+ */
61
+ author: AuthorResponse;
62
+ /**
63
+ * The unique id of the unpublished content
64
+ */
65
+ contentId: ContentId;
66
+ /**
67
+ * The unpublished content version
68
+ */
69
+ contentVersion: number;
70
+ /**
71
+ * The content locales that have been unpublished
72
+ */
73
+ locales: string[];
74
+ /**
75
+ * The date the content has been unpublished, as opposed to [[createdDate]]
76
+ * which is the date this audit record has been written
77
+ */
78
+ unpublishedDate: Date;
79
+ /**
80
+ * The unpublish request creation date
81
+ */
82
+ createdDate: Date;
83
+ /**
84
+ * The unpublish request last modified date
85
+ */
86
+ lastModifiedDate: Date;
87
+ };
88
+ /**
89
+ * This type represent the response of a list unpublish requests API request, sorted by
90
+ * [[UnpublishRequestResponse.unpublishedDate]] descending.
91
+ * Only the [[MAX_LISTED_UNPUBLISH_REQUESTS]] most recent unpublish requests are returned
92
+ */
93
+ export type ListUnpublishRequestsResponse = UnpublishRequestResponse[];
94
+ /**
95
+ * The maximum number of unpublish requests returned by a list unpublish requests API request
96
+ */
97
+ export declare const MAX_LISTED_UNPUBLISH_REQUESTS = 5;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MAX_LISTED_UNPUBLISH_REQUESTS = void 0;
4
+ /**
5
+ * The maximum number of unpublish requests returned by a list unpublish requests API request
6
+ */
7
+ exports.MAX_LISTED_UNPUBLISH_REQUESTS = 5;
@@ -13,6 +13,7 @@ export * from './PublishedContent';
13
13
  export * from './PublishingRequest';
14
14
  export * from './Space';
15
15
  export * from './Subscription';
16
+ export * from './UnpublishRequest';
16
17
  export * from './User';
17
18
  export * from './UserConsents';
18
19
  export * from './UserPermission';
package/dist/api/index.js CHANGED
@@ -29,6 +29,7 @@ __exportStar(require("./PublishedContent"), exports);
29
29
  __exportStar(require("./PublishingRequest"), exports);
30
30
  __exportStar(require("./Space"), exports);
31
31
  __exportStar(require("./Subscription"), exports);
32
+ __exportStar(require("./UnpublishRequest"), exports);
32
33
  __exportStar(require("./User"), exports);
33
34
  __exportStar(require("./UserConsents"), exports);
34
35
  __exportStar(require("./UserPermission"), exports);
@@ -29,6 +29,42 @@ export enum ContentsStatus {
29
29
  all = "all",
30
30
  }
31
31
 
32
+ /**
33
+ * This enum represent the fields that can be used to sort a list of contents
34
+ */
35
+ export enum ContentSortField {
36
+ name = "name",
37
+ publicId = "publicId",
38
+ createdDate = "createdDate",
39
+ lastModifiedDate = "lastModifiedDate",
40
+ onlineDate = "onlineDate",
41
+ offlineDate = "offlineDate",
42
+ locale = "locale",
43
+ definitionName = "definitionName",
44
+ }
45
+
46
+ /**
47
+ * This enum represent the possible sort directions
48
+ */
49
+ export enum SortDirection {
50
+ asc = "asc",
51
+ desc = "desc",
52
+ }
53
+
54
+ /**
55
+ * This type represent the data that can be used to sort a list of contents
56
+ */
57
+ export type ListContentsSort = {
58
+ /**
59
+ * The field to sort the list of contents by
60
+ */
61
+ field: ContentSortField;
62
+ /**
63
+ * The direction to sort the list of contents in
64
+ */
65
+ direction: SortDirection;
66
+ };
67
+
32
68
  /**
33
69
  * This type represent the model of facet
34
70
  */
@@ -383,6 +419,10 @@ export type ListContentsRequest = {
383
419
  * The data used to filter the list of content
384
420
  */
385
421
  filters: ListContentsFilters;
422
+ /**
423
+ * The data used to sort the list of content
424
+ */
425
+ sort?: ListContentsSort;
386
426
  };
387
427
 
388
428
  /**
@@ -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
@@ -13,6 +13,7 @@ export * from './PublishedContent';
13
13
  export * from './PublishingRequest';
14
14
  export * from './Space';
15
15
  export * from './Subscription';
16
+ export * from './UnpublishRequest';
16
17
  export * from './User';
17
18
  export * from './UserConsents';
18
19
  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.4",
3
+ "version": "10.1.0-alpha.6",
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": "8d55c6ca85b34f658c27a974daf759e2adcf358c"
37
+ "gitHead": "44d000ee30bfadef421bea413b472ee5290a1000"
38
38
  }