@contentchef/contentchef-types 11.1.0-alpha.1 → 11.1.0-alpha.3

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.
@@ -309,7 +309,7 @@ export declare enum ComponentVersionViolationCodes {
309
309
  */
310
310
  compactOrFacet = "component.compactOrFacet",
311
311
  /**
312
- * A kept field may only change its texts, or loosen its constraints
312
+ * A kept field may only change its texts and `describes`, or loosen its constraints
313
313
  */
314
314
  notLooser = "component.notLooser",
315
315
  /**
@@ -392,8 +392,8 @@ export type ComponentError = ComponentErrorOf<ComponentErrorTypes.componentNotFo
392
392
  id: MigrationPreviewId;
393
393
  }>;
394
394
  /**
395
- * This type represent where a definition's contents stand, as the get content definition API request
396
- * answers it
395
+ * This type represent where a definition's contents stand, as the get content definition, update content
396
+ * definition and get migration API requests answer it
397
397
  *
398
398
  * An upgrade or adoption that renames, removes or retypes fields bumps the definition's revision and
399
399
  * migrates its contents in the background, one migration at a time per definition
@@ -558,6 +558,19 @@ export type GetMigrationPreviewResponse = {
558
558
  */
559
559
  settingAside: number;
560
560
  };
561
+ /**
562
+ * This type represent the data needed to make a get migration API request
563
+ */
564
+ export type GetMigrationRequest = {
565
+ /**
566
+ * The content definition unique id
567
+ */
568
+ id: ContentDefinitionId;
569
+ };
570
+ /**
571
+ * This type represent the response of a get migration API request, to poll while a migration runs
572
+ */
573
+ export type GetMigrationResponse = DefinitionMigrationState;
561
574
  /**
562
575
  * This type represent the data needed to make a resume migration API request
563
576
  */
@@ -42,7 +42,7 @@ var ComponentVersionViolationCodes;
42
42
  */
43
43
  ComponentVersionViolationCodes["compactOrFacet"] = "component.compactOrFacet";
44
44
  /**
45
- * A kept field may only change its texts, or loosen its constraints
45
+ * A kept field may only change its texts and `describes`, or loosen its constraints
46
46
  */
47
47
  ComponentVersionViolationCodes["notLooser"] = "component.notLooser";
48
48
  /**
@@ -683,7 +683,12 @@ export type CreateContentResponse = ContentResponse;
683
683
  /**
684
684
  * This type represent the response of an update content API request
685
685
  */
686
- export type UpdateContentResponse = ContentResponse;
686
+ export type UpdateContentResponse = ContentResponse & {
687
+ /**
688
+ * The values set aside left to resolve after the save, so a form need not read the content again
689
+ */
690
+ setAside: SetAsideValue[];
691
+ };
687
692
  /**
688
693
  * This type represent the data needed to make a list public id API request
689
694
  */
@@ -207,7 +207,12 @@ export type CreateContentDefinitionResponse = ContentDefinitionResponse;
207
207
  /**
208
208
  * This type represent the response of an update content definition API request
209
209
  */
210
- export type UpdateContentDefinitionResponse = ContentDefinitionResponse;
210
+ export type UpdateContentDefinitionResponse = ContentDefinitionResponse & {
211
+ /**
212
+ * Where the definition's contents stand: a save that started a migration has them all behind
213
+ */
214
+ migration: DefinitionMigrationState;
215
+ };
211
216
  /**
212
217
  * This type represent the response of a get content definition API request
213
218
  */
@@ -425,5 +430,8 @@ export declare enum SchemaFieldViolationCodes {
425
430
  variantTypeNotAllowed = "variantTypeNotAllowed",
426
431
  componentArchived = "componentArchived",
427
432
  componentNotPublished = "componentNotPublished",
428
- invalidComponentMarker = "invalidComponentMarker"
433
+ invalidComponentMarker = "invalidComponentMarker",
434
+ invalidDescribes = "invalidDescribes",
435
+ describesUnknownField = "describesUnknownField",
436
+ describesUnsupportedField = "describesUnsupportedField"
429
437
  }
@@ -49,4 +49,7 @@ var SchemaFieldViolationCodes;
49
49
  SchemaFieldViolationCodes["componentArchived"] = "componentArchived";
50
50
  SchemaFieldViolationCodes["componentNotPublished"] = "componentNotPublished";
51
51
  SchemaFieldViolationCodes["invalidComponentMarker"] = "invalidComponentMarker";
52
+ SchemaFieldViolationCodes["invalidDescribes"] = "invalidDescribes";
53
+ SchemaFieldViolationCodes["describesUnknownField"] = "describesUnknownField";
54
+ SchemaFieldViolationCodes["describesUnsupportedField"] = "describesUnsupportedField";
52
55
  })(SchemaFieldViolationCodes || (exports.SchemaFieldViolationCodes = SchemaFieldViolationCodes = {}));
@@ -448,16 +448,40 @@ export type IndexableSchemaType<T, C> = SchemaType<T, C> & IndexingConf;
448
448
  * @template T Type of the field
449
449
  */
450
450
  export type TranslatableSchemaType<T extends SchemaType<any, any>> = T & TranslatableConf;
451
+ /**
452
+ * This type represent the image a text field describes, so that the content form can generate its text
453
+ * with the space's model. The value stays plain text
454
+ */
455
+ export type Describes = {
456
+ /**
457
+ * A sibling field of the same fields list, of type `media` with `constraints.type` `image`
458
+ */
459
+ field: string;
460
+ /**
461
+ * `altText` is written with fixed alt text rules, `description` following `instructions`
462
+ */
463
+ as: 'altText' | 'description';
464
+ /**
465
+ * With `description` only, at most 2000 characters, written for the model by the definition's author
466
+ */
467
+ instructions?: string;
468
+ };
469
+ /**
470
+ * Not admitted on an array's `items`, which have no siblings
471
+ */
472
+ export type DescribingConf = {
473
+ describes?: Describes;
474
+ };
451
475
  /**
452
476
  * This type represent a text field schema type
453
- * A text field can be indexed, searched when requesting the content and localized
477
+ * A text field can be indexed, searched when requesting the content, localized and describe an image
454
478
  */
455
- export type TextSchemaType = TranslatableSchemaType<IndexableSchemaType<SchemaTypeIds.TEXT, TextFieldConstraints>>;
479
+ export type TextSchemaType = TranslatableSchemaType<IndexableSchemaType<SchemaTypeIds.TEXT, TextFieldConstraints>> & DescribingConf;
456
480
  /**
457
481
  * This type represent a long text field schema type
458
- * A long text field can be indexed, searched when requesting the content and localized
482
+ * A long text field can be indexed, searched when requesting the content, localized and describe an image
459
483
  */
460
- export type LongTextSchemaType = TranslatableSchemaType<IndexableSchemaType<SchemaTypeIds.LONG_TEXT, LongTextFieldConstraints>>;
484
+ export type LongTextSchemaType = TranslatableSchemaType<IndexableSchemaType<SchemaTypeIds.LONG_TEXT, LongTextFieldConstraints>> & DescribingConf;
461
485
  /**
462
486
  * This type represent a linked content field schema type
463
487
  * A linked content field can be indexed and searched when requesting the content
@@ -337,7 +337,7 @@ export enum ComponentVersionViolationCodes {
337
337
  */
338
338
  compactOrFacet = 'component.compactOrFacet',
339
339
  /**
340
- * A kept field may only change its texts, or loosen its constraints
340
+ * A kept field may only change its texts and `describes`, or loosen its constraints
341
341
  */
342
342
  notLooser = 'component.notLooser',
343
343
  /**
@@ -409,8 +409,8 @@ export type ComponentError =
409
409
  | ComponentErrorOf<ComponentErrorTypes.migrationPreviewNotFound, { id: MigrationPreviewId }>;
410
410
 
411
411
  /**
412
- * This type represent where a definition's contents stand, as the get content definition API request
413
- * answers it
412
+ * This type represent where a definition's contents stand, as the get content definition, update content
413
+ * definition and get migration API requests answer it
414
414
  *
415
415
  * An upgrade or adoption that renames, removes or retypes fields bumps the definition's revision and
416
416
  * migrates its contents in the background, one migration at a time per definition
@@ -576,6 +576,21 @@ export type GetMigrationPreviewResponse = {
576
576
  settingAside: number;
577
577
  };
578
578
 
579
+ /**
580
+ * This type represent the data needed to make a get migration API request
581
+ */
582
+ export type GetMigrationRequest = {
583
+ /**
584
+ * The content definition unique id
585
+ */
586
+ id: ContentDefinitionId;
587
+ };
588
+
589
+ /**
590
+ * This type represent the response of a get migration API request, to poll while a migration runs
591
+ */
592
+ export type GetMigrationResponse = DefinitionMigrationState;
593
+
579
594
  /**
580
595
  * This type represent the data needed to make a resume migration API request
581
596
  */
@@ -745,7 +745,12 @@ export type CreateContentResponse = ContentResponse;
745
745
  /**
746
746
  * This type represent the response of an update content API request
747
747
  */
748
- export type UpdateContentResponse = ContentResponse;
748
+ export type UpdateContentResponse = ContentResponse & {
749
+ /**
750
+ * The values set aside left to resolve after the save, so a form need not read the content again
751
+ */
752
+ setAside: SetAsideValue[];
753
+ };
749
754
 
750
755
  /**
751
756
  * This type represent the data needed to make a list public id API request
@@ -224,7 +224,12 @@ export type CreateContentDefinitionResponse = ContentDefinitionResponse;
224
224
  /**
225
225
  * This type represent the response of an update content definition API request
226
226
  */
227
- export type UpdateContentDefinitionResponse = ContentDefinitionResponse;
227
+ export type UpdateContentDefinitionResponse = ContentDefinitionResponse & {
228
+ /**
229
+ * Where the definition's contents stand: a save that started a migration has them all behind
230
+ */
231
+ migration: DefinitionMigrationState;
232
+ };
228
233
  /**
229
234
  * This type represent the response of a get content definition API request
230
235
  */
@@ -454,5 +459,8 @@ export enum SchemaFieldViolationCodes {
454
459
  variantTypeNotAllowed = 'variantTypeNotAllowed',
455
460
  componentArchived = 'componentArchived',
456
461
  componentNotPublished = 'componentNotPublished',
457
- invalidComponentMarker = 'invalidComponentMarker'
462
+ invalidComponentMarker = 'invalidComponentMarker',
463
+ invalidDescribes = 'invalidDescribes',
464
+ describesUnknownField = 'describesUnknownField',
465
+ describesUnsupportedField = 'describesUnsupportedField'
458
466
  }
@@ -487,16 +487,42 @@ export type IndexableSchemaType<T, C> = SchemaType<T, C> & IndexingConf;
487
487
  */
488
488
  export type TranslatableSchemaType<T extends SchemaType<any, any>> = T & TranslatableConf;
489
489
 
490
+ /**
491
+ * This type represent the image a text field describes, so that the content form can generate its text
492
+ * with the space's model. The value stays plain text
493
+ */
494
+ export type Describes = {
495
+ /**
496
+ * A sibling field of the same fields list, of type `media` with `constraints.type` `image`
497
+ */
498
+ field: string;
499
+ /**
500
+ * `altText` is written with fixed alt text rules, `description` following `instructions`
501
+ */
502
+ as: 'altText' | 'description';
503
+ /**
504
+ * With `description` only, at most 2000 characters, written for the model by the definition's author
505
+ */
506
+ instructions?: string;
507
+ };
508
+
509
+ /**
510
+ * Not admitted on an array's `items`, which have no siblings
511
+ */
512
+ export type DescribingConf = {
513
+ describes?: Describes;
514
+ };
515
+
490
516
  /**
491
517
  * This type represent a text field schema type
492
- * A text field can be indexed, searched when requesting the content and localized
518
+ * A text field can be indexed, searched when requesting the content, localized and describe an image
493
519
  */
494
- export type TextSchemaType = TranslatableSchemaType<IndexableSchemaType<SchemaTypeIds.TEXT, TextFieldConstraints>>;
520
+ export type TextSchemaType = TranslatableSchemaType<IndexableSchemaType<SchemaTypeIds.TEXT, TextFieldConstraints>> & DescribingConf;
495
521
  /**
496
522
  * This type represent a long text field schema type
497
- * A long text field can be indexed, searched when requesting the content and localized
523
+ * A long text field can be indexed, searched when requesting the content, localized and describe an image
498
524
  */
499
- export type LongTextSchemaType = TranslatableSchemaType<IndexableSchemaType<SchemaTypeIds.LONG_TEXT, LongTextFieldConstraints>>;
525
+ export type LongTextSchemaType = TranslatableSchemaType<IndexableSchemaType<SchemaTypeIds.LONG_TEXT, LongTextFieldConstraints>> & DescribingConf;
500
526
  /**
501
527
  * This type represent a linked content field schema type
502
528
  * A linked content field can be indexed and searched when requesting the content
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentchef/contentchef-types",
3
- "version": "11.1.0-alpha.1",
3
+ "version": "11.1.0-alpha.3",
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": "8970d38d1236984dee510da19687d73078f76a70"
37
+ "gitHead": "0887d17c48dd6a544fb97cf43a8f30a7f86126c4"
38
38
  }