@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
package/dist/api/Content.js
CHANGED
|
@@ -86,17 +86,17 @@ var ContentFieldViolationCodes;
|
|
|
86
86
|
ContentFieldViolationCodes["textFieldValueMissingInListOfValue"] = "textField.valueMissingInListOfValue";
|
|
87
87
|
ContentFieldViolationCodes["textFieldValueIsNotAString"] = "textField.valueIsNotAString";
|
|
88
88
|
ContentFieldViolationCodes["textFieldBlankValueNotAllowed"] = "textField.blankValueNotAllowed";
|
|
89
|
-
ContentFieldViolationCodes["
|
|
90
|
-
ContentFieldViolationCodes["
|
|
91
|
-
ContentFieldViolationCodes["
|
|
92
|
-
ContentFieldViolationCodes["
|
|
93
|
-
ContentFieldViolationCodes["
|
|
94
|
-
ContentFieldViolationCodes["
|
|
95
|
-
ContentFieldViolationCodes["
|
|
96
|
-
ContentFieldViolationCodes["
|
|
97
|
-
ContentFieldViolationCodes["
|
|
98
|
-
ContentFieldViolationCodes["
|
|
99
|
-
ContentFieldViolationCodes["
|
|
89
|
+
ContentFieldViolationCodes["personalizedFieldValueIsNotPersonalized"] = "personalizedField.valueIsNotPersonalized";
|
|
90
|
+
ContentFieldViolationCodes["personalizedFieldRulesIsNotAnArray"] = "personalizedField.rulesIsNotAnArray";
|
|
91
|
+
ContentFieldViolationCodes["personalizedFieldRuleIsNotAnObject"] = "personalizedField.ruleIsNotAnObject";
|
|
92
|
+
ContentFieldViolationCodes["personalizedFieldRuleConditionMissing"] = "personalizedField.ruleConditionMissing";
|
|
93
|
+
ContentFieldViolationCodes["personalizedFieldDuplicateRuleId"] = "personalizedField.duplicateRuleId";
|
|
94
|
+
ContentFieldViolationCodes["personalizedFieldAudienceNotDeclared"] = "personalizedField.audienceNotDeclared";
|
|
95
|
+
ContentFieldViolationCodes["personalizedFieldFallbackRequired"] = "personalizedField.fallbackRequired";
|
|
96
|
+
ContentFieldViolationCodes["personalizedFieldAudienceNotFound"] = "personalizedField.audienceNotFound";
|
|
97
|
+
ContentFieldViolationCodes["personalizedFieldAudienceArchived"] = "personalizedField.audienceArchived";
|
|
98
|
+
ContentFieldViolationCodes["personalizedFieldAudienceKeyNotFound"] = "personalizedField.audienceKeyNotFound";
|
|
99
|
+
ContentFieldViolationCodes["personalizedFieldAudienceKeyDeprecated"] = "personalizedField.audienceKeyDeprecated";
|
|
100
100
|
})(ContentFieldViolationCodes || (exports.ContentFieldViolationCodes = ContentFieldViolationCodes = {}));
|
|
101
101
|
var LocalizationSettings;
|
|
102
102
|
(function (LocalizationSettings) {
|
|
@@ -176,10 +176,10 @@ export type ContentDefinitionResponse = {
|
|
|
176
176
|
*/
|
|
177
177
|
trackableArrayFields?: ArrayField[] | null;
|
|
178
178
|
/**
|
|
179
|
-
* The mnemonic ids of the
|
|
179
|
+
* The mnemonic ids of the audiences this definition's personalized fields vary by
|
|
180
180
|
* Derived from the schema on every save, never assigned by the client
|
|
181
181
|
*/
|
|
182
|
-
|
|
182
|
+
audiences?: string[];
|
|
183
183
|
};
|
|
184
184
|
/**
|
|
185
185
|
* This type represent the response of a create content definition API request
|
|
@@ -267,14 +267,14 @@ export type ContentDefinitionSchemaErrors = {
|
|
|
267
267
|
*/
|
|
268
268
|
lang?: string;
|
|
269
269
|
/**
|
|
270
|
-
* This attribute represents all the error that occurs inside the
|
|
270
|
+
* This attribute represents all the error that occurs inside the audiences declaration of the
|
|
271
271
|
* definition schema object
|
|
272
272
|
*
|
|
273
|
-
* - The value is a string if the
|
|
274
|
-
* - The value is a list of AttributeViolation, one per declared
|
|
273
|
+
* - The value is a string if the audiences value is not in the expected format
|
|
274
|
+
* - The value is a list of AttributeViolation, one per declared audience that does not exist in the
|
|
275
275
|
* space or is archived
|
|
276
276
|
*/
|
|
277
|
-
|
|
277
|
+
audiences?: string | AttributeViolation[];
|
|
278
278
|
};
|
|
279
279
|
/**
|
|
280
280
|
* This type represent the model for the schema fragment errors
|
|
@@ -403,9 +403,9 @@ export declare enum SchemaFieldViolationCodes {
|
|
|
403
403
|
translatableNotAllowed = "translatableNotAllowed",
|
|
404
404
|
invalidEnumValue = "invalidEnumValue",
|
|
405
405
|
compactCannotBeNested = "compactCannotBeNested",
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
406
|
+
audienceTypeNotAllowed = "audienceTypeNotAllowed",
|
|
407
|
+
audienceNameNotFound = "audienceNameNotFound",
|
|
408
|
+
audienceArchived = "audienceArchived",
|
|
409
|
+
audienceNotDeclaredByDefinition = "audienceNotDeclaredByDefinition",
|
|
410
|
+
duplicateAudienceName = "duplicateAudienceName"
|
|
411
411
|
}
|
|
@@ -45,9 +45,9 @@ var SchemaFieldViolationCodes;
|
|
|
45
45
|
SchemaFieldViolationCodes["translatableNotAllowed"] = "translatableNotAllowed";
|
|
46
46
|
SchemaFieldViolationCodes["invalidEnumValue"] = "invalidEnumValue";
|
|
47
47
|
SchemaFieldViolationCodes["compactCannotBeNested"] = "compactCannotBeNested";
|
|
48
|
-
SchemaFieldViolationCodes["
|
|
49
|
-
SchemaFieldViolationCodes["
|
|
50
|
-
SchemaFieldViolationCodes["
|
|
51
|
-
SchemaFieldViolationCodes["
|
|
52
|
-
SchemaFieldViolationCodes["
|
|
48
|
+
SchemaFieldViolationCodes["audienceTypeNotAllowed"] = "audienceTypeNotAllowed";
|
|
49
|
+
SchemaFieldViolationCodes["audienceNameNotFound"] = "audienceNameNotFound";
|
|
50
|
+
SchemaFieldViolationCodes["audienceArchived"] = "audienceArchived";
|
|
51
|
+
SchemaFieldViolationCodes["audienceNotDeclaredByDefinition"] = "audienceNotDeclaredByDefinition";
|
|
52
|
+
SchemaFieldViolationCodes["duplicateAudienceName"] = "duplicateAudienceName";
|
|
53
53
|
})(SchemaFieldViolationCodes || (exports.SchemaFieldViolationCodes = SchemaFieldViolationCodes = {}));
|
|
@@ -20,7 +20,7 @@ export declare enum SchemaTypeIds {
|
|
|
20
20
|
ARRAY = "array",
|
|
21
21
|
SLUG = "slug",
|
|
22
22
|
MEDIA = "media",
|
|
23
|
-
|
|
23
|
+
PERSONALIZED = "personalized"
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* This enum represent al possible long text sub types
|
|
@@ -49,13 +49,13 @@ export type ContentDefinitionSchema = {
|
|
|
49
49
|
*/
|
|
50
50
|
fragments: FragmentsTable;
|
|
51
51
|
/**
|
|
52
|
-
* The
|
|
53
|
-
* space and not be archived, and a
|
|
52
|
+
* The audiences this definition depends on, chosen by the author. Every one has to exist in the
|
|
53
|
+
* space and not be archived, and a personalized field may only vary by audiences named here, so this
|
|
54
54
|
* is what scopes a definition and gives the field editor a short list to offer
|
|
55
55
|
*
|
|
56
|
-
* Optional: a definition that declares none simply cannot hold a
|
|
56
|
+
* Optional: a definition that declares none simply cannot hold a personalized field
|
|
57
57
|
*/
|
|
58
|
-
|
|
58
|
+
audiences?: string[];
|
|
59
59
|
};
|
|
60
60
|
/**
|
|
61
61
|
* This type represent the model of the attribute fragments in a content definition schema
|
|
@@ -303,13 +303,13 @@ export type OneLinkedContentOfConstraints = {
|
|
|
303
303
|
linkType?: LinkType;
|
|
304
304
|
};
|
|
305
305
|
/**
|
|
306
|
-
* This type represent what every value of a
|
|
306
|
+
* This type represent what every value of a personalized field holds: one descriptor for the whole field,
|
|
307
307
|
* so the rules and the fallback cannot differ in type
|
|
308
308
|
*
|
|
309
309
|
* Only the two `one...Of` forms are admitted: `fragment` and `linked-content` are each the
|
|
310
310
|
* single-target special case of one of them, carrying an identical payload value
|
|
311
311
|
*/
|
|
312
|
-
export type
|
|
312
|
+
export type PersonalizedVariantType = {
|
|
313
313
|
type: SchemaTypeIds.ONE_FRAGMENT_OF;
|
|
314
314
|
constraints: OneFragmentOfConstraints;
|
|
315
315
|
} | {
|
|
@@ -317,28 +317,28 @@ export type SegmentVariantType = {
|
|
|
317
317
|
constraints: OneLinkedContentOfConstraints;
|
|
318
318
|
};
|
|
319
319
|
/**
|
|
320
|
-
* This type represent the model of a
|
|
320
|
+
* This type represent the model of a personalized field constraints
|
|
321
321
|
*
|
|
322
|
-
* A
|
|
322
|
+
* A personalized field declares only *what varies* and *what shape the values have*. Which conditions
|
|
323
323
|
* exist and what each of them serves is authored per content, as an ordered list of rules plus a
|
|
324
|
-
* fallback - see [[
|
|
324
|
+
* fallback - see [[PersonalizedFieldPayload]] - so no combination has to be pre-declared here and two
|
|
325
325
|
* contents of the same definition may carry entirely different rule sets
|
|
326
326
|
*/
|
|
327
|
-
export type
|
|
327
|
+
export type PersonalizedFieldConstraints = {
|
|
328
328
|
/**
|
|
329
|
-
* The mnemonic ids of the
|
|
330
|
-
* definition declares in [[ContentDefinitionSchema.
|
|
331
|
-
* against the space, so
|
|
329
|
+
* The mnemonic ids of the audiences this field varies by, which must be among the ones the
|
|
330
|
+
* definition declares in [[ContentDefinitionSchema.audiences]]. Only the declaration is checked
|
|
331
|
+
* against the space, so an audience that does not exist is one error on the definition rather than
|
|
332
332
|
* one on every field that reached for it
|
|
333
333
|
*
|
|
334
334
|
* Declaration order carries no meaning: a rule wins by being first in the content, not by which
|
|
335
|
-
*
|
|
335
|
+
* audience it constrains
|
|
336
336
|
*/
|
|
337
|
-
|
|
337
|
+
audiences: string[];
|
|
338
338
|
/**
|
|
339
339
|
* The shape every rule value and the fallback conform to
|
|
340
340
|
*/
|
|
341
|
-
variantType:
|
|
341
|
+
variantType: PersonalizedVariantType;
|
|
342
342
|
};
|
|
343
343
|
/**
|
|
344
344
|
* This type represent the model of an array field constraints
|
|
@@ -492,9 +492,9 @@ export type OneFragmentOfSchemaType = SchemaType<SchemaTypeIds.ONE_FRAGMENT_OF,
|
|
|
492
492
|
*/
|
|
493
493
|
export type OneLinkedContentOfSchemaType = IndexableSchemaType<SchemaTypeIds.ONE_LINKED_CONTENT_OF, OneLinkedContentOfConstraints>;
|
|
494
494
|
/**
|
|
495
|
-
* This type represent a
|
|
495
|
+
* This type represent a personalized field schema type
|
|
496
496
|
*/
|
|
497
|
-
export type
|
|
497
|
+
export type PersonalizedSchemaType = SchemaType<SchemaTypeIds.PERSONALIZED, PersonalizedFieldConstraints>;
|
|
498
498
|
/**
|
|
499
499
|
* Slug schema type
|
|
500
500
|
* This type is indexable and translatable by default
|
|
@@ -520,7 +520,7 @@ export type TranslatableSchemaTypes = NumberSchemaType | TextSchemaType | LongTe
|
|
|
520
520
|
/**
|
|
521
521
|
* This type group all the schema types of a content definition that are not indexable
|
|
522
522
|
*/
|
|
523
|
-
export type PlainSchemaTypes = DateSchemaType | FragmentSchemaType | OneFragmentOfSchemaType | SlugSchemaType |
|
|
523
|
+
export type PlainSchemaTypes = DateSchemaType | FragmentSchemaType | OneFragmentOfSchemaType | SlugSchemaType | PersonalizedSchemaType;
|
|
524
524
|
/**
|
|
525
525
|
* This type group all schema types of a content definition
|
|
526
526
|
*/
|
|
@@ -23,7 +23,7 @@ var SchemaTypeIds;
|
|
|
23
23
|
SchemaTypeIds["ARRAY"] = "array";
|
|
24
24
|
SchemaTypeIds["SLUG"] = "slug";
|
|
25
25
|
SchemaTypeIds["MEDIA"] = "media";
|
|
26
|
-
SchemaTypeIds["
|
|
26
|
+
SchemaTypeIds["PERSONALIZED"] = "personalized";
|
|
27
27
|
})(SchemaTypeIds || (exports.SchemaTypeIds = SchemaTypeIds = {}));
|
|
28
28
|
/**
|
|
29
29
|
* This enum represent al possible long text sub types
|
package/dist/api/index.d.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/dist/api/index.js
CHANGED
|
@@ -28,7 +28,7 @@ __exportStar(require("./Invites"), exports);
|
|
|
28
28
|
__exportStar(require("./MediaGallery"), exports);
|
|
29
29
|
__exportStar(require("./PublishedContent"), exports);
|
|
30
30
|
__exportStar(require("./PublishingRequest"), exports);
|
|
31
|
-
__exportStar(require("./
|
|
31
|
+
__exportStar(require("./Audience"), exports);
|
|
32
32
|
__exportStar(require("./Space"), exports);
|
|
33
33
|
__exportStar(require("./Subscription"), exports);
|
|
34
34
|
__exportStar(require("./UnpublishRequest"), exports);
|