@contentchef/contentchef-types 11.1.0-alpha.2 → 11.1.1

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
  /**
@@ -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
  /**
@@ -430,5 +430,8 @@ export declare enum SchemaFieldViolationCodes {
430
430
  variantTypeNotAllowed = "variantTypeNotAllowed",
431
431
  componentArchived = "componentArchived",
432
432
  componentNotPublished = "componentNotPublished",
433
- invalidComponentMarker = "invalidComponentMarker"
433
+ invalidComponentMarker = "invalidComponentMarker",
434
+ invalidDescribes = "invalidDescribes",
435
+ describesUnknownField = "describesUnknownField",
436
+ describesUnsupportedField = "describesUnsupportedField"
434
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
  /**
@@ -459,5 +459,8 @@ export enum SchemaFieldViolationCodes {
459
459
  variantTypeNotAllowed = 'variantTypeNotAllowed',
460
460
  componentArchived = 'componentArchived',
461
461
  componentNotPublished = 'componentNotPublished',
462
- invalidComponentMarker = 'invalidComponentMarker'
462
+ invalidComponentMarker = 'invalidComponentMarker',
463
+ invalidDescribes = 'invalidDescribes',
464
+ describesUnknownField = 'describesUnknownField',
465
+ describesUnsupportedField = 'describesUnsupportedField'
463
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.2",
3
+ "version": "11.1.1",
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": "6aef68846f09d3cec95ade3d59906d1edc48db85"
37
+ "gitHead": "8ea4c3670efedc53c388f679bd4b3c859f7a066a"
38
38
  }