@contentchef/contentchef-types 2.5.4 → 2.6.0-alpha.0

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,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: ListAuditLogFilters;
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,7 @@ export declare type CreatePublishingChannelRequest = {
18
18
  /**
19
19
  * The publishing channel color
20
20
  */
21
- color: string;
21
+ color?: string;
22
22
  };
23
23
  /**
24
24
  * This type represent the model of a publishing channel
@@ -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
@@ -102,7 +102,7 @@ export declare type CreateContentRepositoryRequest = {
102
102
  /**
103
103
  * The content repository color
104
104
  */
105
- color: string;
105
+ color?: string;
106
106
  /**
107
107
  * The content repository description
108
108
  */
@@ -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
@@ -191,7 +191,7 @@ export declare type CreateMediaGalleryRequest = {
191
191
  /**
192
192
  * The color of the media gallery
193
193
  */
194
- color: string;
194
+ color?: string;
195
195
  /**
196
196
  * This description of the media gallery
197
197
  */
@@ -321,14 +321,18 @@ export declare type ListMediaRequest = {
321
321
  * The number of media to take
322
322
  */
323
323
  take: number;
324
+ /**
325
+ * The number of media to skip
326
+ * This is used to paginate the media
327
+ * e.g. -> skip = 0 -> take = 10 -> media[0-9]
328
+ * skip = 10 -> take = 10 -> media[10-19]
329
+ * skip = 20 -> take = 10 -> media[20-29]
330
+ */
331
+ skip: number;
324
332
  /**
325
333
  * The folder path where to list the media
326
334
  */
327
335
  folderPath?: string;
328
- /**
329
- * The cursor needed to get the next segment of media
330
- */
331
- nextCursor?: string;
332
336
  /**
333
337
  * The type of media to retrieve
334
338
  */
@@ -350,10 +354,6 @@ export declare type GetMediaRequest = {
350
354
  * The media gallery unique id
351
355
  */
352
356
  mediaGalleryId: MediaGalleryId;
353
- /**
354
- * The media type
355
- */
356
- mediaType: MediaType;
357
357
  /**
358
358
  * The path needed to locate the media in the media gallery
359
359
  */
@@ -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;
@@ -162,6 +162,10 @@ export declare type SpaceLocale = {
162
162
  * List of supported locales (default locale is included)
163
163
  */
164
164
  locales: string[];
165
+ /**
166
+ * Fallback locale (defaults to 'en')
167
+ */
168
+ fallbackLocale: string;
165
169
  };
166
170
  /**
167
171
  * Return type of `getSpaceLocale`
@@ -206,3 +210,16 @@ export declare type UpdateSpaceDefaultLocaleRequest = {
206
210
  * Return type of `updateSpaceDefaultLocale`
207
211
  */
208
212
  export declare type UpdateSpaceDefaultLocaleResponse = SpaceLocale;
213
+ /**
214
+ * Request type to update space's fallback locale
215
+ */
216
+ export declare type UpdateSpaceFallbackLocaleRequest = {
217
+ /**
218
+ * Locale to update to space's fallback locale
219
+ */
220
+ locale: string;
221
+ };
222
+ /**
223
+ * Return type of `updateSpacefallbackLocale`
224
+ */
225
+ export declare type UpdateSpaceFallbackLocaleResponse = SpaceLocale;
@@ -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: ListAuditLogFilters;
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,7 +20,7 @@ export type CreatePublishingChannelRequest = {
20
20
  /**
21
21
  * The publishing channel color
22
22
  */
23
- color: string;
23
+ color?: string;
24
24
  };
25
25
 
26
26
  /**
@@ -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
@@ -109,7 +109,7 @@ export type CreateContentRepositoryRequest = {
109
109
  /**
110
110
  * The content repository color
111
111
  */
112
- color: string;
112
+ color?: string;
113
113
  /**
114
114
  * The content repository description
115
115
  */
@@ -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
@@ -202,7 +202,7 @@ export type CreateMediaGalleryRequest = {
202
202
  /**
203
203
  * The color of the media gallery
204
204
  */
205
- color: string;
205
+ color?: string;
206
206
  /**
207
207
  * This description of the media gallery
208
208
  */
@@ -339,14 +339,18 @@ export type ListMediaRequest = {
339
339
  * The number of media to take
340
340
  */
341
341
  take: number;
342
+ /**
343
+ * The number of media to skip
344
+ * This is used to paginate the media
345
+ * e.g. -> skip = 0 -> take = 10 -> media[0-9]
346
+ * skip = 10 -> take = 10 -> media[10-19]
347
+ * skip = 20 -> take = 10 -> media[20-29]
348
+ */
349
+ skip: number;
342
350
  /**
343
351
  * The folder path where to list the media
344
352
  */
345
353
  folderPath?: string;
346
- /**
347
- * The cursor needed to get the next segment of media
348
- */
349
- nextCursor?: string;
350
354
  /**
351
355
  * The type of media to retrieve
352
356
  */
@@ -370,10 +374,6 @@ export type GetMediaRequest = {
370
374
  * The media gallery unique id
371
375
  */
372
376
  mediaGalleryId: MediaGalleryId;
373
- /**
374
- * The media type
375
- */
376
- mediaType: MediaType;
377
377
  /**
378
378
  * The path needed to locate the media in the media gallery
379
379
  */
@@ -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/lib/api/Space.ts CHANGED
@@ -173,6 +173,11 @@ export type SpaceLocale = {
173
173
  * List of supported locales (default locale is included)
174
174
  */
175
175
  locales: string[];
176
+
177
+ /**
178
+ * Fallback locale (defaults to 'en')
179
+ */
180
+ fallbackLocale: string;
176
181
  }
177
182
 
178
183
  /**
@@ -220,3 +225,17 @@ export type UpdateSpaceDefaultLocaleRequest = {
220
225
  * Return type of `updateSpaceDefaultLocale`
221
226
  */
222
227
  export type UpdateSpaceDefaultLocaleResponse = SpaceLocale;
228
+
229
+ /**
230
+ * Request type to update space's fallback locale
231
+ */
232
+ export type UpdateSpaceFallbackLocaleRequest = {
233
+ /**
234
+ * Locale to update to space's fallback locale
235
+ */
236
+ locale: string;
237
+ }
238
+ /**
239
+ * Return type of `updateSpacefallbackLocale`
240
+ */
241
+ export type UpdateSpaceFallbackLocaleResponse = SpaceLocale;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentchef/contentchef-types",
3
- "version": "2.5.4",
3
+ "version": "2.6.0-alpha.0",
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": "b0dc55381014c85de9ac26775586963a2584ebd5"
37
+ "gitHead": "dd738eb3c9ee0725393bfa725d4843b533744229"
38
38
  }