@contentful/optimization-api-schemas 0.1.0-alpha
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/LICENSE +21 -0
- package/README.md +127 -0
- package/dist/contentful/AudienceEntry.d.ts +73 -0
- package/dist/contentful/AudienceEntry.d.ts.map +1 -0
- package/dist/contentful/AudienceEntry.js +41 -0
- package/dist/contentful/AudienceEntry.js.map +1 -0
- package/dist/contentful/CtflEntry.d.ts +206 -0
- package/dist/contentful/CtflEntry.d.ts.map +1 -0
- package/dist/contentful/CtflEntry.js +122 -0
- package/dist/contentful/CtflEntry.js.map +1 -0
- package/dist/contentful/MergeTagEntry.d.ts +68 -0
- package/dist/contentful/MergeTagEntry.d.ts.map +1 -0
- package/dist/contentful/MergeTagEntry.js +38 -0
- package/dist/contentful/MergeTagEntry.js.map +1 -0
- package/dist/contentful/PersonalizationConfig.d.ts +437 -0
- package/dist/contentful/PersonalizationConfig.d.ts.map +1 -0
- package/dist/contentful/PersonalizationConfig.js +164 -0
- package/dist/contentful/PersonalizationConfig.js.map +1 -0
- package/dist/contentful/PersonalizationEntry.d.ts +541 -0
- package/dist/contentful/PersonalizationEntry.d.ts.map +1 -0
- package/dist/contentful/PersonalizationEntry.js +95 -0
- package/dist/contentful/PersonalizationEntry.js.map +1 -0
- package/dist/contentful/PersonalizedEntry.d.ts +244 -0
- package/dist/contentful/PersonalizedEntry.d.ts.map +1 -0
- package/dist/contentful/PersonalizedEntry.js +27 -0
- package/dist/contentful/PersonalizedEntry.js.map +1 -0
- package/dist/contentful/index.d.ts +7 -0
- package/dist/contentful/index.d.ts.map +1 -0
- package/dist/contentful/index.js +7 -0
- package/dist/contentful/index.js.map +1 -0
- package/dist/experience/BatchExperienceResponse.d.ts +110 -0
- package/dist/experience/BatchExperienceResponse.d.ts.map +1 -0
- package/dist/experience/BatchExperienceResponse.js +25 -0
- package/dist/experience/BatchExperienceResponse.js.map +1 -0
- package/dist/experience/ExperienceRequest.d.ts +440 -0
- package/dist/experience/ExperienceRequest.d.ts.map +1 -0
- package/dist/experience/ExperienceRequest.js +36 -0
- package/dist/experience/ExperienceRequest.js.map +1 -0
- package/dist/experience/ExperienceResponse.d.ts +173 -0
- package/dist/experience/ExperienceResponse.d.ts.map +1 -0
- package/dist/experience/ExperienceResponse.js +38 -0
- package/dist/experience/ExperienceResponse.js.map +1 -0
- package/dist/experience/ResponseEnvelope.d.ts +35 -0
- package/dist/experience/ResponseEnvelope.d.ts.map +1 -0
- package/dist/experience/ResponseEnvelope.js +31 -0
- package/dist/experience/ResponseEnvelope.js.map +1 -0
- package/dist/experience/change/Change.d.ts +138 -0
- package/dist/experience/change/Change.d.ts.map +1 -0
- package/dist/experience/change/Change.js +102 -0
- package/dist/experience/change/Change.js.map +1 -0
- package/dist/experience/change/index.d.ts +2 -0
- package/dist/experience/change/index.d.ts.map +1 -0
- package/dist/experience/change/index.js +2 -0
- package/dist/experience/change/index.js.map +1 -0
- package/dist/experience/event/AliasEvent.d.ts +73 -0
- package/dist/experience/event/AliasEvent.d.ts.map +1 -0
- package/dist/experience/event/AliasEvent.js +20 -0
- package/dist/experience/event/AliasEvent.js.map +1 -0
- package/dist/experience/event/BatchExperienceEvent.d.ts +820 -0
- package/dist/experience/event/BatchExperienceEvent.d.ts.map +1 -0
- package/dist/experience/event/BatchExperienceEvent.js +37 -0
- package/dist/experience/event/BatchExperienceEvent.js.map +1 -0
- package/dist/experience/event/ComponentViewEvent.d.ts +75 -0
- package/dist/experience/event/ComponentViewEvent.d.ts.map +1 -0
- package/dist/experience/event/ComponentViewEvent.js +43 -0
- package/dist/experience/event/ComponentViewEvent.js.map +1 -0
- package/dist/experience/event/ExperienceEvent.d.ts +810 -0
- package/dist/experience/event/ExperienceEvent.d.ts.map +1 -0
- package/dist/experience/event/ExperienceEvent.js +29 -0
- package/dist/experience/event/ExperienceEvent.js.map +1 -0
- package/dist/experience/event/GroupEvent.d.ts +73 -0
- package/dist/experience/event/GroupEvent.d.ts.map +1 -0
- package/dist/experience/event/GroupEvent.js +20 -0
- package/dist/experience/event/GroupEvent.js.map +1 -0
- package/dist/experience/event/IdentifyEvent.d.ts +71 -0
- package/dist/experience/event/IdentifyEvent.d.ts.map +1 -0
- package/dist/experience/event/IdentifyEvent.js +24 -0
- package/dist/experience/event/IdentifyEvent.js.map +1 -0
- package/dist/experience/event/PageViewEvent.d.ts +128 -0
- package/dist/experience/event/PageViewEvent.d.ts.map +1 -0
- package/dist/experience/event/PageViewEvent.js +44 -0
- package/dist/experience/event/PageViewEvent.js.map +1 -0
- package/dist/experience/event/ScreenViewEvent.d.ts +111 -0
- package/dist/experience/event/ScreenViewEvent.d.ts.map +1 -0
- package/dist/experience/event/ScreenViewEvent.js +43 -0
- package/dist/experience/event/ScreenViewEvent.js.map +1 -0
- package/dist/experience/event/TrackEvent.d.ts +73 -0
- package/dist/experience/event/TrackEvent.d.ts.map +1 -0
- package/dist/experience/event/TrackEvent.js +27 -0
- package/dist/experience/event/TrackEvent.js.map +1 -0
- package/dist/experience/event/UniversalEventProperties.d.ts +175 -0
- package/dist/experience/event/UniversalEventProperties.d.ts.map +1 -0
- package/dist/experience/event/UniversalEventProperties.js +100 -0
- package/dist/experience/event/UniversalEventProperties.js.map +1 -0
- package/dist/experience/event/index.d.ts +12 -0
- package/dist/experience/event/index.d.ts.map +1 -0
- package/dist/experience/event/index.js +12 -0
- package/dist/experience/event/index.js.map +1 -0
- package/dist/experience/event/properties/App.d.ts +25 -0
- package/dist/experience/event/properties/App.d.ts.map +1 -0
- package/dist/experience/event/properties/App.js +21 -0
- package/dist/experience/event/properties/App.js.map +1 -0
- package/dist/experience/event/properties/Campaign.d.ts +34 -0
- package/dist/experience/event/properties/Campaign.d.ts.map +1 -0
- package/dist/experience/event/properties/Campaign.js +30 -0
- package/dist/experience/event/properties/Campaign.js.map +1 -0
- package/dist/experience/event/properties/Channel.d.ts +17 -0
- package/dist/experience/event/properties/Channel.d.ts.map +1 -0
- package/dist/experience/event/properties/Channel.js +13 -0
- package/dist/experience/event/properties/Channel.js.map +1 -0
- package/dist/experience/event/properties/Dictionary.d.ts +13 -0
- package/dist/experience/event/properties/Dictionary.d.ts.map +1 -0
- package/dist/experience/event/properties/Dictionary.js +9 -0
- package/dist/experience/event/properties/Dictionary.js.map +1 -0
- package/dist/experience/event/properties/GeoLocation.d.ts +66 -0
- package/dist/experience/event/properties/GeoLocation.d.ts.map +1 -0
- package/dist/experience/event/properties/GeoLocation.js +76 -0
- package/dist/experience/event/properties/GeoLocation.js.map +1 -0
- package/dist/experience/event/properties/Library.d.ts +22 -0
- package/dist/experience/event/properties/Library.d.ts.map +1 -0
- package/dist/experience/event/properties/Library.js +18 -0
- package/dist/experience/event/properties/Library.js.map +1 -0
- package/dist/experience/event/properties/Page.d.ts +39 -0
- package/dist/experience/event/properties/Page.d.ts.map +1 -0
- package/dist/experience/event/properties/Page.js +36 -0
- package/dist/experience/event/properties/Page.js.map +1 -0
- package/dist/experience/event/properties/Properties.d.ts +13 -0
- package/dist/experience/event/properties/Properties.d.ts.map +1 -0
- package/dist/experience/event/properties/Properties.js +9 -0
- package/dist/experience/event/properties/Properties.js.map +1 -0
- package/dist/experience/event/properties/Screen.d.ts +19 -0
- package/dist/experience/event/properties/Screen.d.ts.map +1 -0
- package/dist/experience/event/properties/Screen.js +15 -0
- package/dist/experience/event/properties/Screen.js.map +1 -0
- package/dist/experience/event/properties/Traits.d.ts +14 -0
- package/dist/experience/event/properties/Traits.d.ts.map +1 -0
- package/dist/experience/event/properties/Traits.js +10 -0
- package/dist/experience/event/properties/Traits.js.map +1 -0
- package/dist/experience/event/properties/index.d.ts +11 -0
- package/dist/experience/event/properties/index.d.ts.map +1 -0
- package/dist/experience/event/properties/index.js +11 -0
- package/dist/experience/event/properties/index.js.map +1 -0
- package/dist/experience/index.d.ts +8 -0
- package/dist/experience/index.d.ts.map +1 -0
- package/dist/experience/index.js +8 -0
- package/dist/experience/index.js.map +1 -0
- package/dist/experience/personalization/SelectedPersonalization.d.ts +86 -0
- package/dist/experience/personalization/SelectedPersonalization.d.ts.map +1 -0
- package/dist/experience/personalization/SelectedPersonalization.js +48 -0
- package/dist/experience/personalization/SelectedPersonalization.js.map +1 -0
- package/dist/experience/personalization/index.d.ts +2 -0
- package/dist/experience/personalization/index.d.ts.map +1 -0
- package/dist/experience/personalization/index.js +2 -0
- package/dist/experience/personalization/index.js.map +1 -0
- package/dist/experience/profile/Profile.d.ts +104 -0
- package/dist/experience/profile/Profile.d.ts.map +1 -0
- package/dist/experience/profile/Profile.js +72 -0
- package/dist/experience/profile/Profile.js.map +1 -0
- package/dist/experience/profile/index.d.ts +3 -0
- package/dist/experience/profile/index.d.ts.map +1 -0
- package/dist/experience/profile/index.js +3 -0
- package/dist/experience/profile/index.js.map +1 -0
- package/dist/experience/profile/properties/SessionStatistics.d.ts +60 -0
- package/dist/experience/profile/properties/SessionStatistics.d.ts.map +1 -0
- package/dist/experience/profile/properties/SessionStatistics.js +50 -0
- package/dist/experience/profile/properties/SessionStatistics.js.map +1 -0
- package/dist/experience/profile/properties/index.d.ts +2 -0
- package/dist/experience/profile/properties/index.d.ts.map +1 -0
- package/dist/experience/profile/properties/index.js +2 -0
- package/dist/experience/profile/properties/index.js.map +1 -0
- package/dist/index.cjs +684 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +425 -0
- package/dist/index.mjs.map +1 -0
- package/dist/insights/event/BatchInsightsEvent.d.ts +173 -0
- package/dist/insights/event/BatchInsightsEvent.d.ts.map +1 -0
- package/dist/insights/event/BatchInsightsEvent.js +32 -0
- package/dist/insights/event/BatchInsightsEvent.js.map +1 -0
- package/dist/insights/event/InsightsEvent.d.ts +145 -0
- package/dist/insights/event/InsightsEvent.d.ts.map +1 -0
- package/dist/insights/event/InsightsEvent.js +16 -0
- package/dist/insights/event/InsightsEvent.js.map +1 -0
- package/dist/insights/event/index.d.ts +3 -0
- package/dist/insights/event/index.d.ts.map +1 -0
- package/dist/insights/event/index.js +3 -0
- package/dist/insights/event/index.js.map +1 -0
- package/dist/insights/index.d.ts +2 -0
- package/dist/insights/index.d.ts.map +1 -0
- package/dist/insights/index.js +2 -0
- package/dist/insights/index.js.map +1 -0
- package/package.json +25 -0
|
@@ -0,0 +1,541 @@
|
|
|
1
|
+
import type { Entry } from 'contentful';
|
|
2
|
+
import * as z from 'zod/mini';
|
|
3
|
+
import { CtflEntry, Link } from './CtflEntry';
|
|
4
|
+
/**
|
|
5
|
+
* Union of supported personalization types.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* `nt_experiment` represents experiments (A/B tests), and `nt_personalization`
|
|
9
|
+
* represents always-on personalized experiences.
|
|
10
|
+
*/
|
|
11
|
+
export declare const PersonalizationType: z.ZodMiniUnion<readonly [z.ZodMiniLiteral<"nt_experiment">, z.ZodMiniLiteral<"nt_personalization">]>;
|
|
12
|
+
/**
|
|
13
|
+
* TypeScript type inferred from {@link PersonalizationType}.
|
|
14
|
+
*/
|
|
15
|
+
export type PersonalizationType = z.infer<typeof PersonalizationType>;
|
|
16
|
+
/**
|
|
17
|
+
* Zod schema describing the fields of a Personalization entry.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* Extends the generic {@link EntryFields} with personalization-specific
|
|
21
|
+
* properties such as name, description, type, config, audience, and variants.
|
|
22
|
+
*/
|
|
23
|
+
export declare const PersonalizationFields: z.ZodMiniObject<{
|
|
24
|
+
nt_name: z.ZodMiniString<string>;
|
|
25
|
+
nt_description: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
26
|
+
nt_type: z.ZodMiniUnion<readonly [z.ZodMiniLiteral<"nt_experiment">, z.ZodMiniLiteral<"nt_personalization">]>;
|
|
27
|
+
nt_config: z.ZodMiniPipe<z.ZodMiniOptional<z.ZodMiniPrefault<z.ZodMiniNullable<z.ZodMiniObject<{
|
|
28
|
+
distribution: z.ZodMiniOptional<z.ZodMiniPrefault<z.ZodMiniArray<z.ZodMiniNumber<number>>>>;
|
|
29
|
+
traffic: z.ZodMiniOptional<z.ZodMiniPrefault<z.ZodMiniNumber<number>>>;
|
|
30
|
+
components: z.ZodMiniOptional<z.ZodMiniPrefault<z.ZodMiniArray<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
|
|
31
|
+
type: z.ZodMiniOptional<z.ZodMiniLiteral<"EntryReplacement">>;
|
|
32
|
+
baseline: z.ZodMiniObject<{
|
|
33
|
+
id: z.ZodMiniString<string>;
|
|
34
|
+
hidden: z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
variants: z.ZodMiniArray<z.ZodMiniObject<{
|
|
37
|
+
id: z.ZodMiniString<string>;
|
|
38
|
+
hidden: z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>;
|
|
39
|
+
}, z.core.$strip>>;
|
|
40
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
41
|
+
type: z.ZodMiniLiteral<"InlineVariable">;
|
|
42
|
+
key: z.ZodMiniString<string>;
|
|
43
|
+
valueType: z.ZodMiniEnum<{
|
|
44
|
+
Boolean: "Boolean";
|
|
45
|
+
Number: "Number";
|
|
46
|
+
Object: "Object";
|
|
47
|
+
String: "String";
|
|
48
|
+
}>;
|
|
49
|
+
baseline: z.ZodMiniObject<{
|
|
50
|
+
value: z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniBoolean<boolean>, z.ZodMiniNull, z.ZodMiniNumber<number>, z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniJSONSchema>]>;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
variants: z.ZodMiniArray<z.ZodMiniObject<{
|
|
53
|
+
value: z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniBoolean<boolean>, z.ZodMiniNull, z.ZodMiniNumber<number>, z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniJSONSchema>]>;
|
|
54
|
+
}, z.core.$strip>>;
|
|
55
|
+
}, z.core.$strip>], "type">>>>;
|
|
56
|
+
sticky: z.ZodMiniOptional<z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>>;
|
|
57
|
+
}, z.core.$strip>>>>, z.ZodMiniTransform<{
|
|
58
|
+
distribution?: number[] | undefined;
|
|
59
|
+
traffic?: number | undefined;
|
|
60
|
+
components?: ({
|
|
61
|
+
baseline: {
|
|
62
|
+
id: string;
|
|
63
|
+
hidden: boolean;
|
|
64
|
+
};
|
|
65
|
+
variants: {
|
|
66
|
+
id: string;
|
|
67
|
+
hidden: boolean;
|
|
68
|
+
}[];
|
|
69
|
+
type?: "EntryReplacement" | undefined;
|
|
70
|
+
} | {
|
|
71
|
+
type: "InlineVariable";
|
|
72
|
+
key: string;
|
|
73
|
+
valueType: "Boolean" | "Number" | "Object" | "String";
|
|
74
|
+
baseline: {
|
|
75
|
+
value: string | number | boolean | Record<string, z.core.util.JSONType> | null;
|
|
76
|
+
};
|
|
77
|
+
variants: {
|
|
78
|
+
value: string | number | boolean | Record<string, z.core.util.JSONType> | null;
|
|
79
|
+
}[];
|
|
80
|
+
})[] | undefined;
|
|
81
|
+
sticky?: boolean | undefined;
|
|
82
|
+
} | null, {
|
|
83
|
+
distribution?: number[] | undefined;
|
|
84
|
+
traffic?: number | undefined;
|
|
85
|
+
components?: ({
|
|
86
|
+
baseline: {
|
|
87
|
+
id: string;
|
|
88
|
+
hidden: boolean;
|
|
89
|
+
};
|
|
90
|
+
variants: {
|
|
91
|
+
id: string;
|
|
92
|
+
hidden: boolean;
|
|
93
|
+
}[];
|
|
94
|
+
type?: "EntryReplacement" | undefined;
|
|
95
|
+
} | {
|
|
96
|
+
type: "InlineVariable";
|
|
97
|
+
key: string;
|
|
98
|
+
valueType: "Boolean" | "Number" | "Object" | "String";
|
|
99
|
+
baseline: {
|
|
100
|
+
value: string | number | boolean | Record<string, z.core.util.JSONType> | null;
|
|
101
|
+
};
|
|
102
|
+
variants: {
|
|
103
|
+
value: string | number | boolean | Record<string, z.core.util.JSONType> | null;
|
|
104
|
+
}[];
|
|
105
|
+
})[] | undefined;
|
|
106
|
+
sticky?: boolean | undefined;
|
|
107
|
+
} | null>>;
|
|
108
|
+
nt_audience: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniObject<{
|
|
109
|
+
metadata: z.ZodMiniObject<{
|
|
110
|
+
tags: z.ZodMiniArray<z.ZodMiniObject<{
|
|
111
|
+
sys: z.ZodMiniObject<{
|
|
112
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
113
|
+
linkType: z.ZodMiniLiteral<"Tag">;
|
|
114
|
+
id: z.ZodMiniString<string>;
|
|
115
|
+
}, z.core.$strip>;
|
|
116
|
+
}, z.core.$strip>>;
|
|
117
|
+
}, z.core.$catchall<z.ZodMiniJSONSchema>>;
|
|
118
|
+
sys: z.ZodMiniObject<{
|
|
119
|
+
type: z.ZodMiniLiteral<"Entry">;
|
|
120
|
+
contentType: z.ZodMiniObject<{
|
|
121
|
+
sys: z.ZodMiniObject<{
|
|
122
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
123
|
+
linkType: z.ZodMiniLiteral<"ContentType">;
|
|
124
|
+
id: z.ZodMiniString<string>;
|
|
125
|
+
}, z.core.$strip>;
|
|
126
|
+
}, z.core.$strip>;
|
|
127
|
+
publishedVersion: z.ZodMiniNumber<number>;
|
|
128
|
+
id: z.ZodMiniString<string>;
|
|
129
|
+
createdAt: z.ZodMiniAny;
|
|
130
|
+
updatedAt: z.ZodMiniAny;
|
|
131
|
+
locale: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
132
|
+
revision: z.ZodMiniNumber<number>;
|
|
133
|
+
space: z.ZodMiniObject<{
|
|
134
|
+
sys: z.ZodMiniObject<{
|
|
135
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
136
|
+
linkType: z.ZodMiniLiteral<"Space">;
|
|
137
|
+
id: z.ZodMiniString<string>;
|
|
138
|
+
}, z.core.$strip>;
|
|
139
|
+
}, z.core.$strip>;
|
|
140
|
+
environment: z.ZodMiniObject<{
|
|
141
|
+
sys: z.ZodMiniObject<{
|
|
142
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
143
|
+
linkType: z.ZodMiniLiteral<"Environment">;
|
|
144
|
+
id: z.ZodMiniString<string>;
|
|
145
|
+
}, z.core.$strip>;
|
|
146
|
+
}, z.core.$strip>;
|
|
147
|
+
}, z.core.$strip>;
|
|
148
|
+
fields: z.ZodMiniObject<{
|
|
149
|
+
nt_audience_id: z.ZodMiniString<string>;
|
|
150
|
+
nt_name: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
151
|
+
nt_description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
152
|
+
}, z.core.$catchall<z.ZodMiniJSONSchema>>;
|
|
153
|
+
}, z.core.$strip>>>;
|
|
154
|
+
nt_variants: z.ZodMiniOptional<z.ZodMiniPrefault<z.ZodMiniArray<z.ZodMiniCustom<Entry, Entry>>>>;
|
|
155
|
+
nt_experience_id: z.ZodMiniString<string>;
|
|
156
|
+
}, z.core.$catchall<z.ZodMiniJSONSchema>>;
|
|
157
|
+
/**
|
|
158
|
+
* TypeScript type inferred from {@link PersonalizationFields}.
|
|
159
|
+
*/
|
|
160
|
+
export type PersonalizationFields = z.infer<typeof PersonalizationFields>;
|
|
161
|
+
/**
|
|
162
|
+
* Zod schema describing a Personalization entry, which is associated with a {@link PersonalizedEntry } via its `fields.nt_experiences`.
|
|
163
|
+
*/
|
|
164
|
+
export declare const PersonalizationEntry: z.ZodMiniObject<{
|
|
165
|
+
metadata: z.ZodMiniObject<{
|
|
166
|
+
tags: z.ZodMiniArray<z.ZodMiniObject<{
|
|
167
|
+
sys: z.ZodMiniObject<{
|
|
168
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
169
|
+
linkType: z.ZodMiniLiteral<"Tag">;
|
|
170
|
+
id: z.ZodMiniString<string>;
|
|
171
|
+
}, z.core.$strip>;
|
|
172
|
+
}, z.core.$strip>>;
|
|
173
|
+
}, z.core.$catchall<z.ZodMiniJSONSchema>>;
|
|
174
|
+
sys: z.ZodMiniObject<{
|
|
175
|
+
type: z.ZodMiniLiteral<"Entry">;
|
|
176
|
+
contentType: z.ZodMiniObject<{
|
|
177
|
+
sys: z.ZodMiniObject<{
|
|
178
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
179
|
+
linkType: z.ZodMiniLiteral<"ContentType">;
|
|
180
|
+
id: z.ZodMiniString<string>;
|
|
181
|
+
}, z.core.$strip>;
|
|
182
|
+
}, z.core.$strip>;
|
|
183
|
+
publishedVersion: z.ZodMiniNumber<number>;
|
|
184
|
+
id: z.ZodMiniString<string>;
|
|
185
|
+
createdAt: z.ZodMiniAny;
|
|
186
|
+
updatedAt: z.ZodMiniAny;
|
|
187
|
+
locale: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
188
|
+
revision: z.ZodMiniNumber<number>;
|
|
189
|
+
space: z.ZodMiniObject<{
|
|
190
|
+
sys: z.ZodMiniObject<{
|
|
191
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
192
|
+
linkType: z.ZodMiniLiteral<"Space">;
|
|
193
|
+
id: z.ZodMiniString<string>;
|
|
194
|
+
}, z.core.$strip>;
|
|
195
|
+
}, z.core.$strip>;
|
|
196
|
+
environment: z.ZodMiniObject<{
|
|
197
|
+
sys: z.ZodMiniObject<{
|
|
198
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
199
|
+
linkType: z.ZodMiniLiteral<"Environment">;
|
|
200
|
+
id: z.ZodMiniString<string>;
|
|
201
|
+
}, z.core.$strip>;
|
|
202
|
+
}, z.core.$strip>;
|
|
203
|
+
}, z.core.$strip>;
|
|
204
|
+
fields: z.ZodMiniObject<{
|
|
205
|
+
nt_name: z.ZodMiniString<string>;
|
|
206
|
+
nt_description: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
207
|
+
nt_type: z.ZodMiniUnion<readonly [z.ZodMiniLiteral<"nt_experiment">, z.ZodMiniLiteral<"nt_personalization">]>;
|
|
208
|
+
nt_config: z.ZodMiniPipe<z.ZodMiniOptional<z.ZodMiniPrefault<z.ZodMiniNullable<z.ZodMiniObject<{
|
|
209
|
+
distribution: z.ZodMiniOptional<z.ZodMiniPrefault<z.ZodMiniArray<z.ZodMiniNumber<number>>>>;
|
|
210
|
+
traffic: z.ZodMiniOptional<z.ZodMiniPrefault<z.ZodMiniNumber<number>>>;
|
|
211
|
+
components: z.ZodMiniOptional<z.ZodMiniPrefault<z.ZodMiniArray<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
|
|
212
|
+
type: z.ZodMiniOptional<z.ZodMiniLiteral<"EntryReplacement">>;
|
|
213
|
+
baseline: z.ZodMiniObject<{
|
|
214
|
+
id: z.ZodMiniString<string>;
|
|
215
|
+
hidden: z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>;
|
|
216
|
+
}, z.core.$strip>;
|
|
217
|
+
variants: z.ZodMiniArray<z.ZodMiniObject<{
|
|
218
|
+
id: z.ZodMiniString<string>;
|
|
219
|
+
hidden: z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>;
|
|
220
|
+
}, z.core.$strip>>;
|
|
221
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
222
|
+
type: z.ZodMiniLiteral<"InlineVariable">;
|
|
223
|
+
key: z.ZodMiniString<string>;
|
|
224
|
+
valueType: z.ZodMiniEnum<{
|
|
225
|
+
Boolean: "Boolean";
|
|
226
|
+
Number: "Number";
|
|
227
|
+
Object: "Object";
|
|
228
|
+
String: "String";
|
|
229
|
+
}>;
|
|
230
|
+
baseline: z.ZodMiniObject<{
|
|
231
|
+
value: z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniBoolean<boolean>, z.ZodMiniNull, z.ZodMiniNumber<number>, z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniJSONSchema>]>;
|
|
232
|
+
}, z.core.$strip>;
|
|
233
|
+
variants: z.ZodMiniArray<z.ZodMiniObject<{
|
|
234
|
+
value: z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniBoolean<boolean>, z.ZodMiniNull, z.ZodMiniNumber<number>, z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniJSONSchema>]>;
|
|
235
|
+
}, z.core.$strip>>;
|
|
236
|
+
}, z.core.$strip>], "type">>>>;
|
|
237
|
+
sticky: z.ZodMiniOptional<z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>>;
|
|
238
|
+
}, z.core.$strip>>>>, z.ZodMiniTransform<{
|
|
239
|
+
distribution?: number[] | undefined;
|
|
240
|
+
traffic?: number | undefined;
|
|
241
|
+
components?: ({
|
|
242
|
+
baseline: {
|
|
243
|
+
id: string;
|
|
244
|
+
hidden: boolean;
|
|
245
|
+
};
|
|
246
|
+
variants: {
|
|
247
|
+
id: string;
|
|
248
|
+
hidden: boolean;
|
|
249
|
+
}[];
|
|
250
|
+
type?: "EntryReplacement" | undefined;
|
|
251
|
+
} | {
|
|
252
|
+
type: "InlineVariable";
|
|
253
|
+
key: string;
|
|
254
|
+
valueType: "Boolean" | "Number" | "Object" | "String";
|
|
255
|
+
baseline: {
|
|
256
|
+
value: string | number | boolean | Record<string, z.core.util.JSONType> | null;
|
|
257
|
+
};
|
|
258
|
+
variants: {
|
|
259
|
+
value: string | number | boolean | Record<string, z.core.util.JSONType> | null;
|
|
260
|
+
}[];
|
|
261
|
+
})[] | undefined;
|
|
262
|
+
sticky?: boolean | undefined;
|
|
263
|
+
} | null, {
|
|
264
|
+
distribution?: number[] | undefined;
|
|
265
|
+
traffic?: number | undefined;
|
|
266
|
+
components?: ({
|
|
267
|
+
baseline: {
|
|
268
|
+
id: string;
|
|
269
|
+
hidden: boolean;
|
|
270
|
+
};
|
|
271
|
+
variants: {
|
|
272
|
+
id: string;
|
|
273
|
+
hidden: boolean;
|
|
274
|
+
}[];
|
|
275
|
+
type?: "EntryReplacement" | undefined;
|
|
276
|
+
} | {
|
|
277
|
+
type: "InlineVariable";
|
|
278
|
+
key: string;
|
|
279
|
+
valueType: "Boolean" | "Number" | "Object" | "String";
|
|
280
|
+
baseline: {
|
|
281
|
+
value: string | number | boolean | Record<string, z.core.util.JSONType> | null;
|
|
282
|
+
};
|
|
283
|
+
variants: {
|
|
284
|
+
value: string | number | boolean | Record<string, z.core.util.JSONType> | null;
|
|
285
|
+
}[];
|
|
286
|
+
})[] | undefined;
|
|
287
|
+
sticky?: boolean | undefined;
|
|
288
|
+
} | null>>;
|
|
289
|
+
nt_audience: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniObject<{
|
|
290
|
+
metadata: z.ZodMiniObject<{
|
|
291
|
+
tags: z.ZodMiniArray<z.ZodMiniObject<{
|
|
292
|
+
sys: z.ZodMiniObject<{
|
|
293
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
294
|
+
linkType: z.ZodMiniLiteral<"Tag">;
|
|
295
|
+
id: z.ZodMiniString<string>;
|
|
296
|
+
}, z.core.$strip>;
|
|
297
|
+
}, z.core.$strip>>;
|
|
298
|
+
}, z.core.$catchall<z.ZodMiniJSONSchema>>;
|
|
299
|
+
sys: z.ZodMiniObject<{
|
|
300
|
+
type: z.ZodMiniLiteral<"Entry">;
|
|
301
|
+
contentType: z.ZodMiniObject<{
|
|
302
|
+
sys: z.ZodMiniObject<{
|
|
303
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
304
|
+
linkType: z.ZodMiniLiteral<"ContentType">;
|
|
305
|
+
id: z.ZodMiniString<string>;
|
|
306
|
+
}, z.core.$strip>;
|
|
307
|
+
}, z.core.$strip>;
|
|
308
|
+
publishedVersion: z.ZodMiniNumber<number>;
|
|
309
|
+
id: z.ZodMiniString<string>;
|
|
310
|
+
createdAt: z.ZodMiniAny;
|
|
311
|
+
updatedAt: z.ZodMiniAny;
|
|
312
|
+
locale: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
313
|
+
revision: z.ZodMiniNumber<number>;
|
|
314
|
+
space: z.ZodMiniObject<{
|
|
315
|
+
sys: z.ZodMiniObject<{
|
|
316
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
317
|
+
linkType: z.ZodMiniLiteral<"Space">;
|
|
318
|
+
id: z.ZodMiniString<string>;
|
|
319
|
+
}, z.core.$strip>;
|
|
320
|
+
}, z.core.$strip>;
|
|
321
|
+
environment: z.ZodMiniObject<{
|
|
322
|
+
sys: z.ZodMiniObject<{
|
|
323
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
324
|
+
linkType: z.ZodMiniLiteral<"Environment">;
|
|
325
|
+
id: z.ZodMiniString<string>;
|
|
326
|
+
}, z.core.$strip>;
|
|
327
|
+
}, z.core.$strip>;
|
|
328
|
+
}, z.core.$strip>;
|
|
329
|
+
fields: z.ZodMiniObject<{
|
|
330
|
+
nt_audience_id: z.ZodMiniString<string>;
|
|
331
|
+
nt_name: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
332
|
+
nt_description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
333
|
+
}, z.core.$catchall<z.ZodMiniJSONSchema>>;
|
|
334
|
+
}, z.core.$strip>>>;
|
|
335
|
+
nt_variants: z.ZodMiniOptional<z.ZodMiniPrefault<z.ZodMiniArray<z.ZodMiniCustom<Entry, Entry>>>>;
|
|
336
|
+
nt_experience_id: z.ZodMiniString<string>;
|
|
337
|
+
}, z.core.$catchall<z.ZodMiniJSONSchema>>;
|
|
338
|
+
}, z.core.$strip>;
|
|
339
|
+
/**
|
|
340
|
+
* TypeScript type inferred from {@link PersonalizationEntry}.
|
|
341
|
+
*/
|
|
342
|
+
export type PersonalizationEntry = z.infer<typeof PersonalizationEntry>;
|
|
343
|
+
/**
|
|
344
|
+
* Type guard for {@link PersonalizationEntry}.
|
|
345
|
+
*
|
|
346
|
+
* @param entry - Contentful entry or link to test.
|
|
347
|
+
* @returns `true` if the value conforms to {@link PersonalizationEntry}, otherwise `false`.
|
|
348
|
+
*/
|
|
349
|
+
export declare function isPersonalizationEntry(entry: CtflEntry | Link): entry is PersonalizationEntry;
|
|
350
|
+
/**
|
|
351
|
+
* Zod schema describing an array of personalization entries or links.
|
|
352
|
+
*
|
|
353
|
+
* @remarks
|
|
354
|
+
* Each element may be a {@link Link} or a fully resolved {@link PersonalizationEntry}.
|
|
355
|
+
*/
|
|
356
|
+
export declare const PersonalizationEntryArray: z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
357
|
+
sys: z.ZodMiniObject<{
|
|
358
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
359
|
+
linkType: z.ZodMiniString<string>;
|
|
360
|
+
id: z.ZodMiniString<string>;
|
|
361
|
+
}, z.core.$strip>;
|
|
362
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
363
|
+
metadata: z.ZodMiniObject<{
|
|
364
|
+
tags: z.ZodMiniArray<z.ZodMiniObject<{
|
|
365
|
+
sys: z.ZodMiniObject<{
|
|
366
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
367
|
+
linkType: z.ZodMiniLiteral<"Tag">;
|
|
368
|
+
id: z.ZodMiniString<string>;
|
|
369
|
+
}, z.core.$strip>;
|
|
370
|
+
}, z.core.$strip>>;
|
|
371
|
+
}, z.core.$catchall<z.ZodMiniJSONSchema>>;
|
|
372
|
+
sys: z.ZodMiniObject<{
|
|
373
|
+
type: z.ZodMiniLiteral<"Entry">;
|
|
374
|
+
contentType: z.ZodMiniObject<{
|
|
375
|
+
sys: z.ZodMiniObject<{
|
|
376
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
377
|
+
linkType: z.ZodMiniLiteral<"ContentType">;
|
|
378
|
+
id: z.ZodMiniString<string>;
|
|
379
|
+
}, z.core.$strip>;
|
|
380
|
+
}, z.core.$strip>;
|
|
381
|
+
publishedVersion: z.ZodMiniNumber<number>;
|
|
382
|
+
id: z.ZodMiniString<string>;
|
|
383
|
+
createdAt: z.ZodMiniAny;
|
|
384
|
+
updatedAt: z.ZodMiniAny;
|
|
385
|
+
locale: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
386
|
+
revision: z.ZodMiniNumber<number>;
|
|
387
|
+
space: z.ZodMiniObject<{
|
|
388
|
+
sys: z.ZodMiniObject<{
|
|
389
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
390
|
+
linkType: z.ZodMiniLiteral<"Space">;
|
|
391
|
+
id: z.ZodMiniString<string>;
|
|
392
|
+
}, z.core.$strip>;
|
|
393
|
+
}, z.core.$strip>;
|
|
394
|
+
environment: z.ZodMiniObject<{
|
|
395
|
+
sys: z.ZodMiniObject<{
|
|
396
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
397
|
+
linkType: z.ZodMiniLiteral<"Environment">;
|
|
398
|
+
id: z.ZodMiniString<string>;
|
|
399
|
+
}, z.core.$strip>;
|
|
400
|
+
}, z.core.$strip>;
|
|
401
|
+
}, z.core.$strip>;
|
|
402
|
+
fields: z.ZodMiniObject<{
|
|
403
|
+
nt_name: z.ZodMiniString<string>;
|
|
404
|
+
nt_description: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
405
|
+
nt_type: z.ZodMiniUnion<readonly [z.ZodMiniLiteral<"nt_experiment">, z.ZodMiniLiteral<"nt_personalization">]>;
|
|
406
|
+
nt_config: z.ZodMiniPipe<z.ZodMiniOptional<z.ZodMiniPrefault<z.ZodMiniNullable<z.ZodMiniObject<{
|
|
407
|
+
distribution: z.ZodMiniOptional<z.ZodMiniPrefault<z.ZodMiniArray<z.ZodMiniNumber<number>>>>;
|
|
408
|
+
traffic: z.ZodMiniOptional<z.ZodMiniPrefault<z.ZodMiniNumber<number>>>;
|
|
409
|
+
components: z.ZodMiniOptional<z.ZodMiniPrefault<z.ZodMiniArray<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
|
|
410
|
+
type: z.ZodMiniOptional<z.ZodMiniLiteral<"EntryReplacement">>;
|
|
411
|
+
baseline: z.ZodMiniObject<{
|
|
412
|
+
id: z.ZodMiniString<string>;
|
|
413
|
+
hidden: z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>;
|
|
414
|
+
}, z.core.$strip>;
|
|
415
|
+
variants: z.ZodMiniArray<z.ZodMiniObject<{
|
|
416
|
+
id: z.ZodMiniString<string>;
|
|
417
|
+
hidden: z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>;
|
|
418
|
+
}, z.core.$strip>>;
|
|
419
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
420
|
+
type: z.ZodMiniLiteral<"InlineVariable">;
|
|
421
|
+
key: z.ZodMiniString<string>;
|
|
422
|
+
valueType: z.ZodMiniEnum<{
|
|
423
|
+
Boolean: "Boolean";
|
|
424
|
+
Number: "Number";
|
|
425
|
+
Object: "Object";
|
|
426
|
+
String: "String";
|
|
427
|
+
}>;
|
|
428
|
+
baseline: z.ZodMiniObject<{
|
|
429
|
+
value: z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniBoolean<boolean>, z.ZodMiniNull, z.ZodMiniNumber<number>, z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniJSONSchema>]>;
|
|
430
|
+
}, z.core.$strip>;
|
|
431
|
+
variants: z.ZodMiniArray<z.ZodMiniObject<{
|
|
432
|
+
value: z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniBoolean<boolean>, z.ZodMiniNull, z.ZodMiniNumber<number>, z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniJSONSchema>]>;
|
|
433
|
+
}, z.core.$strip>>;
|
|
434
|
+
}, z.core.$strip>], "type">>>>;
|
|
435
|
+
sticky: z.ZodMiniOptional<z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>>;
|
|
436
|
+
}, z.core.$strip>>>>, z.ZodMiniTransform<{
|
|
437
|
+
distribution?: number[] | undefined;
|
|
438
|
+
traffic?: number | undefined;
|
|
439
|
+
components?: ({
|
|
440
|
+
baseline: {
|
|
441
|
+
id: string;
|
|
442
|
+
hidden: boolean;
|
|
443
|
+
};
|
|
444
|
+
variants: {
|
|
445
|
+
id: string;
|
|
446
|
+
hidden: boolean;
|
|
447
|
+
}[];
|
|
448
|
+
type?: "EntryReplacement" | undefined;
|
|
449
|
+
} | {
|
|
450
|
+
type: "InlineVariable";
|
|
451
|
+
key: string;
|
|
452
|
+
valueType: "Boolean" | "Number" | "Object" | "String";
|
|
453
|
+
baseline: {
|
|
454
|
+
value: string | number | boolean | Record<string, z.core.util.JSONType> | null;
|
|
455
|
+
};
|
|
456
|
+
variants: {
|
|
457
|
+
value: string | number | boolean | Record<string, z.core.util.JSONType> | null;
|
|
458
|
+
}[];
|
|
459
|
+
})[] | undefined;
|
|
460
|
+
sticky?: boolean | undefined;
|
|
461
|
+
} | null, {
|
|
462
|
+
distribution?: number[] | undefined;
|
|
463
|
+
traffic?: number | undefined;
|
|
464
|
+
components?: ({
|
|
465
|
+
baseline: {
|
|
466
|
+
id: string;
|
|
467
|
+
hidden: boolean;
|
|
468
|
+
};
|
|
469
|
+
variants: {
|
|
470
|
+
id: string;
|
|
471
|
+
hidden: boolean;
|
|
472
|
+
}[];
|
|
473
|
+
type?: "EntryReplacement" | undefined;
|
|
474
|
+
} | {
|
|
475
|
+
type: "InlineVariable";
|
|
476
|
+
key: string;
|
|
477
|
+
valueType: "Boolean" | "Number" | "Object" | "String";
|
|
478
|
+
baseline: {
|
|
479
|
+
value: string | number | boolean | Record<string, z.core.util.JSONType> | null;
|
|
480
|
+
};
|
|
481
|
+
variants: {
|
|
482
|
+
value: string | number | boolean | Record<string, z.core.util.JSONType> | null;
|
|
483
|
+
}[];
|
|
484
|
+
})[] | undefined;
|
|
485
|
+
sticky?: boolean | undefined;
|
|
486
|
+
} | null>>;
|
|
487
|
+
nt_audience: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniObject<{
|
|
488
|
+
metadata: z.ZodMiniObject<{
|
|
489
|
+
tags: z.ZodMiniArray<z.ZodMiniObject<{
|
|
490
|
+
sys: z.ZodMiniObject<{
|
|
491
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
492
|
+
linkType: z.ZodMiniLiteral<"Tag">;
|
|
493
|
+
id: z.ZodMiniString<string>;
|
|
494
|
+
}, z.core.$strip>;
|
|
495
|
+
}, z.core.$strip>>;
|
|
496
|
+
}, z.core.$catchall<z.ZodMiniJSONSchema>>;
|
|
497
|
+
sys: z.ZodMiniObject<{
|
|
498
|
+
type: z.ZodMiniLiteral<"Entry">;
|
|
499
|
+
contentType: z.ZodMiniObject<{
|
|
500
|
+
sys: z.ZodMiniObject<{
|
|
501
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
502
|
+
linkType: z.ZodMiniLiteral<"ContentType">;
|
|
503
|
+
id: z.ZodMiniString<string>;
|
|
504
|
+
}, z.core.$strip>;
|
|
505
|
+
}, z.core.$strip>;
|
|
506
|
+
publishedVersion: z.ZodMiniNumber<number>;
|
|
507
|
+
id: z.ZodMiniString<string>;
|
|
508
|
+
createdAt: z.ZodMiniAny;
|
|
509
|
+
updatedAt: z.ZodMiniAny;
|
|
510
|
+
locale: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
511
|
+
revision: z.ZodMiniNumber<number>;
|
|
512
|
+
space: z.ZodMiniObject<{
|
|
513
|
+
sys: z.ZodMiniObject<{
|
|
514
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
515
|
+
linkType: z.ZodMiniLiteral<"Space">;
|
|
516
|
+
id: z.ZodMiniString<string>;
|
|
517
|
+
}, z.core.$strip>;
|
|
518
|
+
}, z.core.$strip>;
|
|
519
|
+
environment: z.ZodMiniObject<{
|
|
520
|
+
sys: z.ZodMiniObject<{
|
|
521
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
522
|
+
linkType: z.ZodMiniLiteral<"Environment">;
|
|
523
|
+
id: z.ZodMiniString<string>;
|
|
524
|
+
}, z.core.$strip>;
|
|
525
|
+
}, z.core.$strip>;
|
|
526
|
+
}, z.core.$strip>;
|
|
527
|
+
fields: z.ZodMiniObject<{
|
|
528
|
+
nt_audience_id: z.ZodMiniString<string>;
|
|
529
|
+
nt_name: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
530
|
+
nt_description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
531
|
+
}, z.core.$catchall<z.ZodMiniJSONSchema>>;
|
|
532
|
+
}, z.core.$strip>>>;
|
|
533
|
+
nt_variants: z.ZodMiniOptional<z.ZodMiniPrefault<z.ZodMiniArray<z.ZodMiniCustom<Entry, Entry>>>>;
|
|
534
|
+
nt_experience_id: z.ZodMiniString<string>;
|
|
535
|
+
}, z.core.$catchall<z.ZodMiniJSONSchema>>;
|
|
536
|
+
}, z.core.$strip>]>>;
|
|
537
|
+
/**
|
|
538
|
+
* TypeScript type inferred from {@link PersonalizationEntryArray}.
|
|
539
|
+
*/
|
|
540
|
+
export type PersonalizationEntryArray = z.infer<typeof PersonalizationEntryArray>;
|
|
541
|
+
//# sourceMappingURL=PersonalizationEntry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PersonalizationEntry.d.ts","sourceRoot":"","sources":["../../src/contentful/PersonalizationEntry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAE7B,OAAO,EAAE,SAAS,EAAe,IAAI,EAAE,MAAM,aAAa,CAAA;AAG1D;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,sGAG9B,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAErE;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yCA6DhC,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEzE;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAE/B,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEvE;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,GAAG,KAAK,IAAI,oBAAoB,CAE7F;AAED;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAAiD,CAAA;AAEvF;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import * as z from 'zod/mini';
|
|
2
|
+
import { AudienceEntry } from './AudienceEntry';
|
|
3
|
+
import { CtflEntry, EntryFields, Link } from './CtflEntry';
|
|
4
|
+
import { PersonalizationConfig } from './PersonalizationConfig';
|
|
5
|
+
/**
|
|
6
|
+
* Union of supported personalization types.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* `nt_experiment` represents experiments (A/B tests), and `nt_personalization`
|
|
10
|
+
* represents always-on personalized experiences.
|
|
11
|
+
*/
|
|
12
|
+
export const PersonalizationType = z.union([
|
|
13
|
+
z.literal('nt_experiment'),
|
|
14
|
+
z.literal('nt_personalization'),
|
|
15
|
+
]);
|
|
16
|
+
/**
|
|
17
|
+
* Zod schema describing the fields of a Personalization entry.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* Extends the generic {@link EntryFields} with personalization-specific
|
|
21
|
+
* properties such as name, description, type, config, audience, and variants.
|
|
22
|
+
*/
|
|
23
|
+
export const PersonalizationFields = z.extend(EntryFields, {
|
|
24
|
+
/**
|
|
25
|
+
* The name of the personalization (Short Text).
|
|
26
|
+
*/
|
|
27
|
+
nt_name: z.string(),
|
|
28
|
+
/**
|
|
29
|
+
* The description of the personalization (Short Text).
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Optional, may be `null` if no description is provided.
|
|
33
|
+
*/
|
|
34
|
+
nt_description: z.optional(z.nullable(z.string())),
|
|
35
|
+
/**
|
|
36
|
+
* The type of the personalization (`nt_experiment` | `nt_personalization`).
|
|
37
|
+
*/
|
|
38
|
+
nt_type: PersonalizationType,
|
|
39
|
+
/**
|
|
40
|
+
* The configuration of a {@link PersonalizationEntry } (JSON).
|
|
41
|
+
*
|
|
42
|
+
* @remarks
|
|
43
|
+
* Accepts `null` or an explicit {@link PersonalizationConfig} and converts
|
|
44
|
+
* falsy/undefined values into a default configuration.
|
|
45
|
+
*/
|
|
46
|
+
nt_config: z.pipe(z.optional(z.prefault(z.nullable(PersonalizationConfig), null)), z.transform((v) => v ?? {
|
|
47
|
+
traffic: 0,
|
|
48
|
+
distribution: [0.5, 0.5],
|
|
49
|
+
components: [],
|
|
50
|
+
sticky: false,
|
|
51
|
+
})),
|
|
52
|
+
/**
|
|
53
|
+
* The audience of the personalization (Audience).
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* Optional and nullable; when omitted or `null`, the personalization may apply
|
|
57
|
+
* to all users.
|
|
58
|
+
*/
|
|
59
|
+
nt_audience: z.optional(z.nullable(AudienceEntry)),
|
|
60
|
+
/**
|
|
61
|
+
* All used variants of the personalization (Contentful references to other Content Types).
|
|
62
|
+
*
|
|
63
|
+
* @remarks
|
|
64
|
+
* Modeled as an array of untyped Contentful entries and defaults to an empty
|
|
65
|
+
* array when omitted.
|
|
66
|
+
*/
|
|
67
|
+
nt_variants: z.optional(z.prefault(z.array(z.custom()), [])),
|
|
68
|
+
/**
|
|
69
|
+
* The personalization/experience ID related to this personalization entry.
|
|
70
|
+
*/
|
|
71
|
+
nt_experience_id: z.string(),
|
|
72
|
+
});
|
|
73
|
+
/**
|
|
74
|
+
* Zod schema describing a Personalization entry, which is associated with a {@link PersonalizedEntry } via its `fields.nt_experiences`.
|
|
75
|
+
*/
|
|
76
|
+
export const PersonalizationEntry = z.extend(CtflEntry, {
|
|
77
|
+
fields: PersonalizationFields,
|
|
78
|
+
});
|
|
79
|
+
/**
|
|
80
|
+
* Type guard for {@link PersonalizationEntry}.
|
|
81
|
+
*
|
|
82
|
+
* @param entry - Contentful entry or link to test.
|
|
83
|
+
* @returns `true` if the value conforms to {@link PersonalizationEntry}, otherwise `false`.
|
|
84
|
+
*/
|
|
85
|
+
export function isPersonalizationEntry(entry) {
|
|
86
|
+
return PersonalizationEntry.safeParse(entry).success;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Zod schema describing an array of personalization entries or links.
|
|
90
|
+
*
|
|
91
|
+
* @remarks
|
|
92
|
+
* Each element may be a {@link Link} or a fully resolved {@link PersonalizationEntry}.
|
|
93
|
+
*/
|
|
94
|
+
export const PersonalizationEntryArray = z.array(z.union([Link, PersonalizationEntry]));
|
|
95
|
+
//# sourceMappingURL=PersonalizationEntry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PersonalizationEntry.js","sourceRoot":"","sources":["../../src/contentful/PersonalizationEntry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAE/D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC;IACzC,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC;IAC1B,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC;CAChC,CAAC,CAAA;AAOF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE;IACzD;;OAEG;IACH,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IAEnB;;;;;OAKG;IACH,cAAc,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IAElD;;OAEG;IACH,OAAO,EAAE,mBAAmB;IAE5B;;;;;;OAMG;IACH,SAAS,EAAE,CAAC,CAAC,IAAI,CACf,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,IAAI,CAAC,CAAC,EAC/D,CAAC,CAAC,SAAS,CACT,CAAC,CAAC,EAAE,EAAE,CACJ,CAAC,IAAI;QACH,OAAO,EAAE,CAAC;QACV,YAAY,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;QACxB,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,KAAK;KACd,CACJ,CACF;IAED;;;;;;OAMG;IACH,WAAW,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;IAElD;;;;;;OAMG;IACH,WAAW,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAS,CAAC,EAAE,EAAE,CAAC,CAAC;IAEnE;;OAEG;IACH,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE;CAC7B,CAAC,CAAA;AAOF;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE;IACtD,MAAM,EAAE,qBAAqB;CAC9B,CAAC,CAAA;AAOF;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAAuB;IAC5D,OAAO,oBAAoB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAA;AACtD,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAA"}
|