@contentchef/contentchef-types 11.0.0-alpha.2 → 11.0.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.
@@ -266,6 +266,15 @@ export type ContentDefinitionSchemaErrors = {
266
266
  * This attribute represents an error if the language of the schema is not a valid string
267
267
  */
268
268
  lang?: string;
269
+ /**
270
+ * This attribute represents all the error that occurs inside the segments declaration of the
271
+ * definition schema object
272
+ *
273
+ * - The value is a string if the segments value is not in the expected format
274
+ * - The value is a list of AttributeViolation, one per declared segment that does not exist in the
275
+ * space or is archived
276
+ */
277
+ segments?: string | AttributeViolation[];
269
278
  };
270
279
  /**
271
280
  * This type represent the model for the schema fragment errors
@@ -397,5 +406,6 @@ export declare enum SchemaFieldViolationCodes {
397
406
  segmentTypeNotAllowed = "segmentTypeNotAllowed",
398
407
  segmentNameNotFound = "segmentNameNotFound",
399
408
  segmentArchived = "segmentArchived",
409
+ segmentNotDeclaredByDefinition = "segmentNotDeclaredByDefinition",
400
410
  duplicateSegmentName = "duplicateSegmentName"
401
411
  }
@@ -48,5 +48,6 @@ var SchemaFieldViolationCodes;
48
48
  SchemaFieldViolationCodes["segmentTypeNotAllowed"] = "segmentTypeNotAllowed";
49
49
  SchemaFieldViolationCodes["segmentNameNotFound"] = "segmentNameNotFound";
50
50
  SchemaFieldViolationCodes["segmentArchived"] = "segmentArchived";
51
+ SchemaFieldViolationCodes["segmentNotDeclaredByDefinition"] = "segmentNotDeclaredByDefinition";
51
52
  SchemaFieldViolationCodes["duplicateSegmentName"] = "duplicateSegmentName";
52
53
  })(SchemaFieldViolationCodes || (exports.SchemaFieldViolationCodes = SchemaFieldViolationCodes = {}));
@@ -48,6 +48,14 @@ export type ContentDefinitionSchema = {
48
48
  * A Fragment is a custom field defined by the user and can be used internally in the definition
49
49
  */
50
50
  fragments: FragmentsTable;
51
+ /**
52
+ * The segments this definition depends on, chosen by the author. Every one has to exist in the
53
+ * space and not be archived, and a segmented field may only vary by segments named here, so this
54
+ * is what scopes a definition and gives the field editor a short list to offer
55
+ *
56
+ * Optional: a definition that declares none simply cannot hold a segmented field
57
+ */
58
+ segments?: string[];
51
59
  };
52
60
  /**
53
61
  * This type represent the model of the attribute fragments in a content definition schema
@@ -318,8 +326,13 @@ export type SegmentVariantType = {
318
326
  */
319
327
  export type SegmentedFieldConstraints = {
320
328
  /**
321
- * The mnemonic ids of the segments this field varies by. Declaration order carries no meaning: a
322
- * rule wins by being first in the content, not by which segment it constrains
329
+ * The mnemonic ids of the segments this field varies by, which must be among the ones the
330
+ * definition declares in [[ContentDefinitionSchema.segments]]. Only the declaration is checked
331
+ * against the space, so a segment that does not exist is one error on the definition rather than
332
+ * one on every field that reached for it
333
+ *
334
+ * Declaration order carries no meaning: a rule wins by being first in the content, not by which
335
+ * segment it constrains
323
336
  */
324
337
  segments: string[];
325
338
  /**
@@ -287,6 +287,15 @@ export type ContentDefinitionSchemaErrors = {
287
287
  * This attribute represents an error if the language of the schema is not a valid string
288
288
  */
289
289
  lang?: string;
290
+ /**
291
+ * This attribute represents all the error that occurs inside the segments declaration of the
292
+ * definition schema object
293
+ *
294
+ * - The value is a string if the segments value is not in the expected format
295
+ * - The value is a list of AttributeViolation, one per declared segment that does not exist in the
296
+ * space or is archived
297
+ */
298
+ segments?: string | AttributeViolation[];
290
299
  };
291
300
 
292
301
  /**
@@ -425,5 +434,6 @@ export enum SchemaFieldViolationCodes {
425
434
  segmentTypeNotAllowed = 'segmentTypeNotAllowed',
426
435
  segmentNameNotFound = 'segmentNameNotFound',
427
436
  segmentArchived = 'segmentArchived',
437
+ segmentNotDeclaredByDefinition = 'segmentNotDeclaredByDefinition',
428
438
  duplicateSegmentName = 'duplicateSegmentName'
429
439
  }
@@ -51,6 +51,14 @@ export type ContentDefinitionSchema = {
51
51
  * A Fragment is a custom field defined by the user and can be used internally in the definition
52
52
  */
53
53
  fragments: FragmentsTable;
54
+ /**
55
+ * The segments this definition depends on, chosen by the author. Every one has to exist in the
56
+ * space and not be archived, and a segmented field may only vary by segments named here, so this
57
+ * is what scopes a definition and gives the field editor a short list to offer
58
+ *
59
+ * Optional: a definition that declares none simply cannot hold a segmented field
60
+ */
61
+ segments?: string[];
54
62
  };
55
63
 
56
64
  /**
@@ -341,8 +349,13 @@ export type SegmentVariantType =
341
349
  */
342
350
  export type SegmentedFieldConstraints = {
343
351
  /**
344
- * The mnemonic ids of the segments this field varies by. Declaration order carries no meaning: a
345
- * rule wins by being first in the content, not by which segment it constrains
352
+ * The mnemonic ids of the segments this field varies by, which must be among the ones the
353
+ * definition declares in [[ContentDefinitionSchema.segments]]. Only the declaration is checked
354
+ * against the space, so a segment that does not exist is one error on the definition rather than
355
+ * one on every field that reached for it
356
+ *
357
+ * Declaration order carries no meaning: a rule wins by being first in the content, not by which
358
+ * segment it constrains
346
359
  */
347
360
  segments: string[];
348
361
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentchef/contentchef-types",
3
- "version": "11.0.0-alpha.2",
3
+ "version": "11.0.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": "58fd14f63fafe3be82bc829bb3a835a2e4f94c30"
37
+ "gitHead": "778b33af62f27ed0f992fc1d50025f2cf8c90836"
38
38
  }