@contentchef/contentchef-types 11.0.0-alpha.4 → 11.0.0-alpha.5
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/{Segment.d.ts → Audience.d.ts} +121 -121
- package/dist/api/{Segment.js → Audience.js} +5 -5
- package/dist/api/Content.d.ts +25 -25
- package/dist/api/Content.js +11 -11
- package/dist/api/ContentDefinition.d.ts +11 -11
- package/dist/api/ContentDefinition.js +5 -5
- package/dist/api/ContentDefinitionSchema.d.ts +20 -20
- package/dist/api/ContentDefinitionSchema.js +1 -1
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.js +1 -1
- package/lib/api/{Segment.ts → Audience.ts} +121 -121
- package/lib/api/Content.ts +25 -25
- package/lib/api/ContentDefinition.ts +11 -11
- package/lib/api/ContentDefinitionSchema.ts +20 -20
- package/lib/api/index.ts +1 -1
- package/package.json +2 -2
|
@@ -191,10 +191,10 @@ export type ContentDefinitionResponse = {
|
|
|
191
191
|
trackableArrayFields?: ArrayField[] | null;
|
|
192
192
|
|
|
193
193
|
/**
|
|
194
|
-
* The mnemonic ids of the
|
|
194
|
+
* The mnemonic ids of the audiences this definition's personalized fields vary by
|
|
195
195
|
* Derived from the schema on every save, never assigned by the client
|
|
196
196
|
*/
|
|
197
|
-
|
|
197
|
+
audiences?: string[];
|
|
198
198
|
};
|
|
199
199
|
|
|
200
200
|
/**
|
|
@@ -288,14 +288,14 @@ export type ContentDefinitionSchemaErrors = {
|
|
|
288
288
|
*/
|
|
289
289
|
lang?: string;
|
|
290
290
|
/**
|
|
291
|
-
* This attribute represents all the error that occurs inside the
|
|
291
|
+
* This attribute represents all the error that occurs inside the audiences declaration of the
|
|
292
292
|
* definition schema object
|
|
293
293
|
*
|
|
294
|
-
* - The value is a string if the
|
|
295
|
-
* - The value is a list of AttributeViolation, one per declared
|
|
294
|
+
* - The value is a string if the audiences value is not in the expected format
|
|
295
|
+
* - The value is a list of AttributeViolation, one per declared audience that does not exist in the
|
|
296
296
|
* space or is archived
|
|
297
297
|
*/
|
|
298
|
-
|
|
298
|
+
audiences?: string | AttributeViolation[];
|
|
299
299
|
};
|
|
300
300
|
|
|
301
301
|
/**
|
|
@@ -431,9 +431,9 @@ export enum SchemaFieldViolationCodes {
|
|
|
431
431
|
translatableNotAllowed = 'translatableNotAllowed',
|
|
432
432
|
invalidEnumValue = 'invalidEnumValue',
|
|
433
433
|
compactCannotBeNested = 'compactCannotBeNested',
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
434
|
+
audienceTypeNotAllowed = 'audienceTypeNotAllowed',
|
|
435
|
+
audienceNameNotFound = 'audienceNameNotFound',
|
|
436
|
+
audienceArchived = 'audienceArchived',
|
|
437
|
+
audienceNotDeclaredByDefinition = 'audienceNotDeclaredByDefinition',
|
|
438
|
+
duplicateAudienceName = 'duplicateAudienceName'
|
|
439
439
|
}
|
|
@@ -21,7 +21,7 @@ export enum SchemaTypeIds {
|
|
|
21
21
|
ARRAY = 'array',
|
|
22
22
|
SLUG = 'slug',
|
|
23
23
|
MEDIA = 'media',
|
|
24
|
-
|
|
24
|
+
PERSONALIZED = 'personalized',
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
/**
|
|
@@ -52,13 +52,13 @@ export type ContentDefinitionSchema = {
|
|
|
52
52
|
*/
|
|
53
53
|
fragments: FragmentsTable;
|
|
54
54
|
/**
|
|
55
|
-
* The
|
|
56
|
-
* space and not be archived, and a
|
|
55
|
+
* The audiences this definition depends on, chosen by the author. Every one has to exist in the
|
|
56
|
+
* space and not be archived, and a personalized field may only vary by audiences named here, so this
|
|
57
57
|
* is what scopes a definition and gives the field editor a short list to offer
|
|
58
58
|
*
|
|
59
|
-
* Optional: a definition that declares none simply cannot hold a
|
|
59
|
+
* Optional: a definition that declares none simply cannot hold a personalized field
|
|
60
60
|
*/
|
|
61
|
-
|
|
61
|
+
audiences?: string[];
|
|
62
62
|
};
|
|
63
63
|
|
|
64
64
|
/**
|
|
@@ -329,39 +329,39 @@ export type OneLinkedContentOfConstraints = {
|
|
|
329
329
|
};
|
|
330
330
|
|
|
331
331
|
/**
|
|
332
|
-
* This type represent what every value of a
|
|
332
|
+
* This type represent what every value of a personalized field holds: one descriptor for the whole field,
|
|
333
333
|
* so the rules and the fallback cannot differ in type
|
|
334
334
|
*
|
|
335
335
|
* Only the two `one...Of` forms are admitted: `fragment` and `linked-content` are each the
|
|
336
336
|
* single-target special case of one of them, carrying an identical payload value
|
|
337
337
|
*/
|
|
338
|
-
export type
|
|
338
|
+
export type PersonalizedVariantType =
|
|
339
339
|
| { type: SchemaTypeIds.ONE_FRAGMENT_OF; constraints: OneFragmentOfConstraints; }
|
|
340
340
|
| { type: SchemaTypeIds.ONE_LINKED_CONTENT_OF; constraints: OneLinkedContentOfConstraints; };
|
|
341
341
|
|
|
342
342
|
/**
|
|
343
|
-
* This type represent the model of a
|
|
343
|
+
* This type represent the model of a personalized field constraints
|
|
344
344
|
*
|
|
345
|
-
* A
|
|
345
|
+
* A personalized field declares only *what varies* and *what shape the values have*. Which conditions
|
|
346
346
|
* exist and what each of them serves is authored per content, as an ordered list of rules plus a
|
|
347
|
-
* fallback - see [[
|
|
347
|
+
* fallback - see [[PersonalizedFieldPayload]] - so no combination has to be pre-declared here and two
|
|
348
348
|
* contents of the same definition may carry entirely different rule sets
|
|
349
349
|
*/
|
|
350
|
-
export type
|
|
350
|
+
export type PersonalizedFieldConstraints = {
|
|
351
351
|
/**
|
|
352
|
-
* The mnemonic ids of the
|
|
353
|
-
* definition declares in [[ContentDefinitionSchema.
|
|
354
|
-
* against the space, so
|
|
352
|
+
* The mnemonic ids of the audiences this field varies by, which must be among the ones the
|
|
353
|
+
* definition declares in [[ContentDefinitionSchema.audiences]]. Only the declaration is checked
|
|
354
|
+
* against the space, so an audience that does not exist is one error on the definition rather than
|
|
355
355
|
* one on every field that reached for it
|
|
356
356
|
*
|
|
357
357
|
* Declaration order carries no meaning: a rule wins by being first in the content, not by which
|
|
358
|
-
*
|
|
358
|
+
* audience it constrains
|
|
359
359
|
*/
|
|
360
|
-
|
|
360
|
+
audiences: string[];
|
|
361
361
|
/**
|
|
362
362
|
* The shape every rule value and the fallback conform to
|
|
363
363
|
*/
|
|
364
|
-
variantType:
|
|
364
|
+
variantType: PersonalizedVariantType;
|
|
365
365
|
};
|
|
366
366
|
|
|
367
367
|
/**
|
|
@@ -529,9 +529,9 @@ export type OneFragmentOfSchemaType = SchemaType<SchemaTypeIds.ONE_FRAGMENT_OF,
|
|
|
529
529
|
export type OneLinkedContentOfSchemaType = IndexableSchemaType<SchemaTypeIds.ONE_LINKED_CONTENT_OF, OneLinkedContentOfConstraints>;
|
|
530
530
|
|
|
531
531
|
/**
|
|
532
|
-
* This type represent a
|
|
532
|
+
* This type represent a personalized field schema type
|
|
533
533
|
*/
|
|
534
|
-
export type
|
|
534
|
+
export type PersonalizedSchemaType = SchemaType<SchemaTypeIds.PERSONALIZED, PersonalizedFieldConstraints>;
|
|
535
535
|
|
|
536
536
|
/**
|
|
537
537
|
* Slug schema type
|
|
@@ -565,7 +565,7 @@ export type TranslatableSchemaTypes = NumberSchemaType | TextSchemaType | LongTe
|
|
|
565
565
|
/**
|
|
566
566
|
* This type group all the schema types of a content definition that are not indexable
|
|
567
567
|
*/
|
|
568
|
-
export type PlainSchemaTypes = DateSchemaType | FragmentSchemaType | OneFragmentOfSchemaType | SlugSchemaType |
|
|
568
|
+
export type PlainSchemaTypes = DateSchemaType | FragmentSchemaType | OneFragmentOfSchemaType | SlugSchemaType | PersonalizedSchemaType;
|
|
569
569
|
|
|
570
570
|
/**
|
|
571
571
|
* This type group all schema types of a content definition
|
package/lib/api/index.ts
CHANGED
|
@@ -12,7 +12,7 @@ export * from './Invites';
|
|
|
12
12
|
export * from './MediaGallery';
|
|
13
13
|
export * from './PublishedContent';
|
|
14
14
|
export * from './PublishingRequest';
|
|
15
|
-
export * from './
|
|
15
|
+
export * from './Audience';
|
|
16
16
|
export * from './Space';
|
|
17
17
|
export * from './Subscription';
|
|
18
18
|
export * from './UnpublishRequest';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentchef/contentchef-types",
|
|
3
|
-
"version": "11.0.0-alpha.
|
|
3
|
+
"version": "11.0.0-alpha.5",
|
|
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": "
|
|
37
|
+
"gitHead": "9aec2cdbb2d04b788dec73666e71eb36f867944a"
|
|
38
38
|
}
|