@contentchef/contentchef-types 2.5.2 → 2.5.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.
- package/dist/api/AuditLog.d.ts +11 -5
- package/dist/api/ContentDefinitionSchema.d.ts +16 -2
- package/dist/api/ContentDefinitionSchema.js +1 -0
- package/dist/api/ContentTranslation.d.ts +10 -0
- package/dist/api/MediaGallery.d.ts +22 -1
- package/lib/api/AuditLog.ts +10 -5
- package/lib/api/ContentDefinitionSchema.ts +16 -1
- package/lib/api/ContentTranslation.ts +21 -6
- package/lib/api/MediaGallery.ts +24 -1
- package/package.json +2 -2
package/dist/api/AuditLog.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { AuthorResponse } from './Author';
|
|
2
|
+
import { PublishingChannelId } from './Channel';
|
|
1
3
|
import { PagedListResponse } from './common';
|
|
2
4
|
import { ContentId } from './Content';
|
|
3
|
-
import { ContentRepositoryId } from './ContentRepository';
|
|
4
5
|
import { ContentDefinitionId } from './ContentDefinition';
|
|
6
|
+
import { ContentRepositoryId } from './ContentRepository';
|
|
5
7
|
import { MediaGalleryId } from './MediaGallery';
|
|
6
|
-
import { PublishingChannelId } from './Channel';
|
|
7
|
-
import { AuthorResponse } from './Author';
|
|
8
8
|
/**
|
|
9
9
|
* This type represent the audit log unique id type
|
|
10
10
|
*/
|
|
@@ -94,8 +94,13 @@ export declare enum SubjectActions {
|
|
|
94
94
|
export declare type ListAuditLogRequest = {
|
|
95
95
|
skip: number;
|
|
96
96
|
take: number;
|
|
97
|
-
filters
|
|
97
|
+
filters?: ListAuditLogFilters;
|
|
98
98
|
};
|
|
99
|
+
declare type LatestActivitesRequest<ToRemove extends keyof ListAuditLogFilters> = Omit<ListAuditLogRequest, 'filters'> & {
|
|
100
|
+
filters: Omit<ListAuditLogFilters, ToRemove>;
|
|
101
|
+
};
|
|
102
|
+
export declare type UserTeamLatestActivitiesRequest = LatestActivitesRequest<'userTeamLatestActivities'>;
|
|
103
|
+
export declare type UserLatestActivitiesRequest = LatestActivitesRequest<'userLatestActivities'>;
|
|
99
104
|
/**
|
|
100
105
|
* This type represent all the filters used to filter a list of audit logs
|
|
101
106
|
*/
|
|
@@ -133,7 +138,7 @@ export declare type ListByRepositoryIdRequest = {
|
|
|
133
138
|
* The unique repository id
|
|
134
139
|
*/
|
|
135
140
|
repositoryId: ContentRepositoryId;
|
|
136
|
-
};
|
|
141
|
+
} & (Partial<UserTeamLatestActivitiesRequest> | Partial<UserLatestActivitiesRequest>);
|
|
137
142
|
/**
|
|
138
143
|
* The model the represent the audit log parent filter used in the list of audit logs
|
|
139
144
|
*/
|
|
@@ -196,3 +201,4 @@ export declare type ListAuditLogItem = {
|
|
|
196
201
|
* This type represent the response of a list audit log API request
|
|
197
202
|
*/
|
|
198
203
|
export declare type ListAuditLogResponse = PagedListResponse<ListAuditLogItem>;
|
|
204
|
+
export {};
|
|
@@ -18,7 +18,8 @@ export declare enum SchemaTypeIds {
|
|
|
18
18
|
ONE_FRAGMENT_OF = "oneFragmentOf",
|
|
19
19
|
ONE_LINKED_CONTENT_OF = "oneLinkedContentOf",
|
|
20
20
|
ARRAY = "array",
|
|
21
|
-
SLUG = "slug"
|
|
21
|
+
SLUG = "slug",
|
|
22
|
+
MEDIA = "media"
|
|
22
23
|
}
|
|
23
24
|
/**
|
|
24
25
|
* This enum represent al possible long text sub types
|
|
@@ -328,6 +329,15 @@ export declare type SlugConstraints = {
|
|
|
328
329
|
prefix?: string;
|
|
329
330
|
allowSlash?: boolean;
|
|
330
331
|
};
|
|
332
|
+
/**
|
|
333
|
+
* Constraints of a `media` field
|
|
334
|
+
*/
|
|
335
|
+
export declare type MediaConstraints = {
|
|
336
|
+
/**
|
|
337
|
+
* Determines type of media (raw, video, image)
|
|
338
|
+
*/
|
|
339
|
+
type: MediaType;
|
|
340
|
+
};
|
|
331
341
|
/**
|
|
332
342
|
* This type represent the model of a Schema Type Field
|
|
333
343
|
* @template T The type of the field
|
|
@@ -403,6 +413,10 @@ export declare type CloudinaryVideoSchemaType = TranslatableSchemaType<SchemaTyp
|
|
|
403
413
|
* This type represent a cloudinary raw field schema type
|
|
404
414
|
*/
|
|
405
415
|
export declare type CloudinaryRawSchemaType = TranslatableSchemaType<SchemaType<SchemaTypeIds.CLOUDINARY_RAW, {}>>;
|
|
416
|
+
/**
|
|
417
|
+
* Media field schema type
|
|
418
|
+
*/
|
|
419
|
+
export declare type MediaSchemaType = TranslatableSchemaType<SchemaType<SchemaTypeIds.MEDIA, MediaConstraints>>;
|
|
406
420
|
/**
|
|
407
421
|
* This type represent a number field schema type
|
|
408
422
|
* A number field can be indexed and searched when requesting the content
|
|
@@ -451,7 +465,7 @@ export declare type IndexableSchemaTypes = TextSchemaType | LongTextSchemaType |
|
|
|
451
465
|
/**
|
|
452
466
|
* This are all the fields that can be localized
|
|
453
467
|
*/
|
|
454
|
-
export declare type TranslatableSchemaTypes = TextSchemaType | LongTextSchemaType | CloudinaryPublicIdSchemaType | CloudinaryImageSchemaType | CloudinaryVideoSchemaType | CloudinaryRawSchemaType;
|
|
468
|
+
export declare type TranslatableSchemaTypes = TextSchemaType | LongTextSchemaType | CloudinaryPublicIdSchemaType | CloudinaryImageSchemaType | CloudinaryVideoSchemaType | CloudinaryRawSchemaType | MediaSchemaType;
|
|
455
469
|
/**
|
|
456
470
|
* This type group all the schema types of a content definition that are not indexable
|
|
457
471
|
*/
|
|
@@ -22,6 +22,7 @@ var SchemaTypeIds;
|
|
|
22
22
|
SchemaTypeIds["ONE_LINKED_CONTENT_OF"] = "oneLinkedContentOf";
|
|
23
23
|
SchemaTypeIds["ARRAY"] = "array";
|
|
24
24
|
SchemaTypeIds["SLUG"] = "slug";
|
|
25
|
+
SchemaTypeIds["MEDIA"] = "media";
|
|
25
26
|
})(SchemaTypeIds = exports.SchemaTypeIds || (exports.SchemaTypeIds = {}));
|
|
26
27
|
/**
|
|
27
28
|
* This enum represent al possible long text sub types
|
|
@@ -48,3 +48,13 @@ export declare type ListContentTranslationRequest = {
|
|
|
48
48
|
contentId: ContentId;
|
|
49
49
|
};
|
|
50
50
|
export declare type ListContentTranslationResponse = ContentTranslation[];
|
|
51
|
+
export declare type DeleteContentTranslationRequest = {
|
|
52
|
+
contentId: ContentId;
|
|
53
|
+
locale: string;
|
|
54
|
+
};
|
|
55
|
+
export declare type DeleteContentTranslationResponse = boolean;
|
|
56
|
+
export declare type CleanContentTranslationRequest = {
|
|
57
|
+
contentId: ContentId;
|
|
58
|
+
locales: string[];
|
|
59
|
+
};
|
|
60
|
+
export declare type CleanContentTranslationResponse = boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PagedListResponse } from './common';
|
|
2
1
|
import { AuthorResponse } from './Author';
|
|
2
|
+
import { PagedListResponse } from './common';
|
|
3
3
|
/**
|
|
4
4
|
* This type describe the result of a list request on media
|
|
5
5
|
* @template T The type of media requested
|
|
@@ -481,3 +481,24 @@ export declare type UpdateMediaResponse = Media;
|
|
|
481
481
|
* This type represent the possible type of media accepted
|
|
482
482
|
*/
|
|
483
483
|
export declare type MediaType = 'image' | 'video' | 'raw';
|
|
484
|
+
/**
|
|
485
|
+
* Parameters needed to delete a media
|
|
486
|
+
*/
|
|
487
|
+
export declare type DeleteMediaRequest = {
|
|
488
|
+
/**
|
|
489
|
+
* The media gallery unique id where the media is located
|
|
490
|
+
*/
|
|
491
|
+
mediaGalleryId: number;
|
|
492
|
+
/**
|
|
493
|
+
* The media public id
|
|
494
|
+
*/
|
|
495
|
+
mediaPublicId: string;
|
|
496
|
+
/**
|
|
497
|
+
* The type of the media to add
|
|
498
|
+
*/
|
|
499
|
+
resourceType: MediaType;
|
|
500
|
+
};
|
|
501
|
+
/**
|
|
502
|
+
* Success or failure (boolean) of a delete media request
|
|
503
|
+
*/
|
|
504
|
+
export declare type DeleteMediaResponse = boolean;
|
package/lib/api/AuditLog.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { AuthorResponse } from './Author';
|
|
2
|
+
import { PublishingChannelId } from './Channel';
|
|
1
3
|
import { PagedListResponse } from './common';
|
|
2
4
|
import { ContentId } from './Content';
|
|
3
|
-
import { ContentRepositoryId } from './ContentRepository';
|
|
4
5
|
import { ContentDefinitionId } from './ContentDefinition';
|
|
6
|
+
import { ContentRepositoryId } from './ContentRepository';
|
|
5
7
|
import { MediaGalleryId } from './MediaGallery';
|
|
6
|
-
import { PublishingChannelId } from './Channel';
|
|
7
|
-
import { AuthorResponse } from './Author';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* This type represent the audit log unique id type
|
|
@@ -98,9 +98,14 @@ export enum SubjectActions {
|
|
|
98
98
|
export type ListAuditLogRequest = {
|
|
99
99
|
skip: number;
|
|
100
100
|
take: number;
|
|
101
|
-
filters
|
|
101
|
+
filters?: ListAuditLogFilters;
|
|
102
102
|
};
|
|
103
103
|
|
|
104
|
+
type LatestActivitesRequest<ToRemove extends keyof ListAuditLogFilters> = Omit<ListAuditLogRequest, 'filters'> & {filters: Omit<ListAuditLogFilters, ToRemove>}
|
|
105
|
+
|
|
106
|
+
export type UserTeamLatestActivitiesRequest = LatestActivitesRequest<'userTeamLatestActivities'>;
|
|
107
|
+
export type UserLatestActivitiesRequest = LatestActivitesRequest<'userLatestActivities'>;
|
|
108
|
+
|
|
104
109
|
/**
|
|
105
110
|
* This type represent all the filters used to filter a list of audit logs
|
|
106
111
|
*/
|
|
@@ -139,7 +144,7 @@ export type ListByRepositoryIdRequest = {
|
|
|
139
144
|
* The unique repository id
|
|
140
145
|
*/
|
|
141
146
|
repositoryId: ContentRepositoryId;
|
|
142
|
-
};
|
|
147
|
+
} & (Partial<UserTeamLatestActivitiesRequest> | Partial<UserLatestActivitiesRequest>);
|
|
143
148
|
|
|
144
149
|
/**
|
|
145
150
|
* The model the represent the audit log parent filter used in the list of audit logs
|
|
@@ -20,6 +20,7 @@ export enum SchemaTypeIds {
|
|
|
20
20
|
ONE_LINKED_CONTENT_OF = 'oneLinkedContentOf',
|
|
21
21
|
ARRAY = 'array',
|
|
22
22
|
SLUG = 'slug',
|
|
23
|
+
MEDIA = 'media',
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
/**
|
|
@@ -360,6 +361,16 @@ export type SlugConstraints = {
|
|
|
360
361
|
allowSlash?: boolean;
|
|
361
362
|
};
|
|
362
363
|
|
|
364
|
+
/**
|
|
365
|
+
* Constraints of a `media` field
|
|
366
|
+
*/
|
|
367
|
+
export type MediaConstraints = {
|
|
368
|
+
/**
|
|
369
|
+
* Determines type of media (raw, video, image)
|
|
370
|
+
*/
|
|
371
|
+
type: MediaType;
|
|
372
|
+
};
|
|
373
|
+
|
|
363
374
|
/**
|
|
364
375
|
* This type represent the model of a Schema Type Field
|
|
365
376
|
* @template T The type of the field
|
|
@@ -440,6 +451,10 @@ export type CloudinaryVideoSchemaType = TranslatableSchemaType<SchemaType<Schema
|
|
|
440
451
|
* This type represent a cloudinary raw field schema type
|
|
441
452
|
*/
|
|
442
453
|
export type CloudinaryRawSchemaType = TranslatableSchemaType<SchemaType<SchemaTypeIds.CLOUDINARY_RAW, {}>>;
|
|
454
|
+
/**
|
|
455
|
+
* Media field schema type
|
|
456
|
+
*/
|
|
457
|
+
export type MediaSchemaType = TranslatableSchemaType<SchemaType<SchemaTypeIds.MEDIA, MediaConstraints>>;
|
|
443
458
|
/**
|
|
444
459
|
* This type represent a number field schema type
|
|
445
460
|
* A number field can be indexed and searched when requesting the content
|
|
@@ -495,7 +510,7 @@ export type IndexableSchemaTypes = TextSchemaType | LongTextSchemaType | LinkedC
|
|
|
495
510
|
/**
|
|
496
511
|
* This are all the fields that can be localized
|
|
497
512
|
*/
|
|
498
|
-
export type TranslatableSchemaTypes = TextSchemaType | LongTextSchemaType | CloudinaryPublicIdSchemaType | CloudinaryImageSchemaType | CloudinaryVideoSchemaType | CloudinaryRawSchemaType;
|
|
513
|
+
export type TranslatableSchemaTypes = TextSchemaType | LongTextSchemaType | CloudinaryPublicIdSchemaType | CloudinaryImageSchemaType | CloudinaryVideoSchemaType | CloudinaryRawSchemaType | MediaSchemaType;
|
|
499
514
|
|
|
500
515
|
/**
|
|
501
516
|
* This type group all the schema types of a content definition that are not indexable
|
|
@@ -8,7 +8,7 @@ export type FieldTranslation = {
|
|
|
8
8
|
path: FieldPath;
|
|
9
9
|
value: string;
|
|
10
10
|
checksum: string;
|
|
11
|
-
}
|
|
11
|
+
};
|
|
12
12
|
|
|
13
13
|
export type ContentTranslation = {
|
|
14
14
|
id: ContentTranslationId;
|
|
@@ -21,14 +21,14 @@ export type ContentTranslation = {
|
|
|
21
21
|
latestContributor: AuthorResponse;
|
|
22
22
|
content: ContentResponse;
|
|
23
23
|
status: ContentTranslationStatus;
|
|
24
|
-
}
|
|
24
|
+
};
|
|
25
25
|
|
|
26
26
|
export type GetContentTranslationRequest = {
|
|
27
27
|
contentId: ContentId;
|
|
28
28
|
locale: string;
|
|
29
|
-
}
|
|
29
|
+
};
|
|
30
30
|
|
|
31
|
-
export type GetContentTranslationResponse = ContentTranslation & { translatedContent: ContentResponse };
|
|
31
|
+
export type GetContentTranslationResponse = ContentTranslation & { translatedContent: ContentResponse; };
|
|
32
32
|
|
|
33
33
|
export type CreateContentTranslationRequest = {
|
|
34
34
|
contentId: ContentId;
|
|
@@ -55,6 +55,21 @@ export enum ContentTranslationStatus {
|
|
|
55
55
|
|
|
56
56
|
export type ListContentTranslationRequest = {
|
|
57
57
|
contentId: ContentId;
|
|
58
|
-
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export type ListContentTranslationResponse = ContentTranslation[];
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
export type DeleteContentTranslationRequest = {
|
|
64
|
+
contentId: ContentId;
|
|
65
|
+
locale: string;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export type DeleteContentTranslationResponse = boolean;
|
|
69
|
+
|
|
70
|
+
export type CleanContentTranslationRequest = {
|
|
71
|
+
contentId: ContentId;
|
|
72
|
+
locales: string[];
|
|
73
|
+
};
|
|
59
74
|
|
|
60
|
-
export type
|
|
75
|
+
export type CleanContentTranslationResponse = boolean;
|
package/lib/api/MediaGallery.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PagedListResponse } from './common';
|
|
2
1
|
import { AuthorResponse } from './Author';
|
|
2
|
+
import { PagedListResponse } from './common';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* This type describe the result of a list request on media
|
|
@@ -509,3 +509,26 @@ export type UpdateMediaResponse = Media;
|
|
|
509
509
|
* This type represent the possible type of media accepted
|
|
510
510
|
*/
|
|
511
511
|
export type MediaType = 'image' | 'video' | 'raw';
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* Parameters needed to delete a media
|
|
515
|
+
*/
|
|
516
|
+
export type DeleteMediaRequest = {
|
|
517
|
+
/**
|
|
518
|
+
* The media gallery unique id where the media is located
|
|
519
|
+
*/
|
|
520
|
+
mediaGalleryId: number;
|
|
521
|
+
/**
|
|
522
|
+
* The media public id
|
|
523
|
+
*/
|
|
524
|
+
mediaPublicId: string;
|
|
525
|
+
/**
|
|
526
|
+
* The type of the media to add
|
|
527
|
+
*/
|
|
528
|
+
resourceType: MediaType;
|
|
529
|
+
};
|
|
530
|
+
|
|
531
|
+
/**
|
|
532
|
+
* Success or failure (boolean) of a delete media request
|
|
533
|
+
*/
|
|
534
|
+
export type DeleteMediaResponse = boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentchef/contentchef-types",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.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": "^4.0.5"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "abbd192cd0a8e8de0dde6b886c558d0133ce3056"
|
|
38
38
|
}
|