@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,244 @@
|
|
|
1
|
+
import type { Entry } from 'contentful';
|
|
2
|
+
import * as z from 'zod/mini';
|
|
3
|
+
/**
|
|
4
|
+
* Zod schema describing a Contentful entry that has attached personalizations.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* Extends {@link CtflEntry} and adds `nt_experiences` to the `fields` object.
|
|
8
|
+
*/
|
|
9
|
+
export declare const PersonalizedEntry: z.ZodMiniObject<{
|
|
10
|
+
metadata: z.ZodMiniObject<{
|
|
11
|
+
tags: z.ZodMiniArray<z.ZodMiniObject<{
|
|
12
|
+
sys: z.ZodMiniObject<{
|
|
13
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
14
|
+
linkType: z.ZodMiniLiteral<"Tag">;
|
|
15
|
+
id: z.ZodMiniString<string>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
}, z.core.$strip>>;
|
|
18
|
+
}, z.core.$catchall<z.ZodMiniJSONSchema>>;
|
|
19
|
+
sys: z.ZodMiniObject<{
|
|
20
|
+
type: z.ZodMiniLiteral<"Entry">;
|
|
21
|
+
contentType: z.ZodMiniObject<{
|
|
22
|
+
sys: z.ZodMiniObject<{
|
|
23
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
24
|
+
linkType: z.ZodMiniLiteral<"ContentType">;
|
|
25
|
+
id: z.ZodMiniString<string>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
publishedVersion: z.ZodMiniNumber<number>;
|
|
29
|
+
id: z.ZodMiniString<string>;
|
|
30
|
+
createdAt: z.ZodMiniAny;
|
|
31
|
+
updatedAt: z.ZodMiniAny;
|
|
32
|
+
locale: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
33
|
+
revision: z.ZodMiniNumber<number>;
|
|
34
|
+
space: z.ZodMiniObject<{
|
|
35
|
+
sys: z.ZodMiniObject<{
|
|
36
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
37
|
+
linkType: z.ZodMiniLiteral<"Space">;
|
|
38
|
+
id: z.ZodMiniString<string>;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
environment: z.ZodMiniObject<{
|
|
42
|
+
sys: z.ZodMiniObject<{
|
|
43
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
44
|
+
linkType: z.ZodMiniLiteral<"Environment">;
|
|
45
|
+
id: z.ZodMiniString<string>;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
fields: z.ZodMiniObject<{
|
|
50
|
+
nt_experiences: z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
51
|
+
sys: z.ZodMiniObject<{
|
|
52
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
53
|
+
linkType: z.ZodMiniString<string>;
|
|
54
|
+
id: z.ZodMiniString<string>;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
57
|
+
metadata: z.ZodMiniObject<{
|
|
58
|
+
tags: z.ZodMiniArray<z.ZodMiniObject<{
|
|
59
|
+
sys: z.ZodMiniObject<{
|
|
60
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
61
|
+
linkType: z.ZodMiniLiteral<"Tag">;
|
|
62
|
+
id: z.ZodMiniString<string>;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
}, z.core.$strip>>;
|
|
65
|
+
}, z.core.$catchall<z.ZodMiniJSONSchema>>;
|
|
66
|
+
sys: z.ZodMiniObject<{
|
|
67
|
+
type: z.ZodMiniLiteral<"Entry">;
|
|
68
|
+
contentType: z.ZodMiniObject<{
|
|
69
|
+
sys: z.ZodMiniObject<{
|
|
70
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
71
|
+
linkType: z.ZodMiniLiteral<"ContentType">;
|
|
72
|
+
id: z.ZodMiniString<string>;
|
|
73
|
+
}, z.core.$strip>;
|
|
74
|
+
}, z.core.$strip>;
|
|
75
|
+
publishedVersion: z.ZodMiniNumber<number>;
|
|
76
|
+
id: z.ZodMiniString<string>;
|
|
77
|
+
createdAt: z.ZodMiniAny;
|
|
78
|
+
updatedAt: z.ZodMiniAny;
|
|
79
|
+
locale: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
80
|
+
revision: z.ZodMiniNumber<number>;
|
|
81
|
+
space: z.ZodMiniObject<{
|
|
82
|
+
sys: z.ZodMiniObject<{
|
|
83
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
84
|
+
linkType: z.ZodMiniLiteral<"Space">;
|
|
85
|
+
id: z.ZodMiniString<string>;
|
|
86
|
+
}, z.core.$strip>;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
environment: z.ZodMiniObject<{
|
|
89
|
+
sys: z.ZodMiniObject<{
|
|
90
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
91
|
+
linkType: z.ZodMiniLiteral<"Environment">;
|
|
92
|
+
id: z.ZodMiniString<string>;
|
|
93
|
+
}, z.core.$strip>;
|
|
94
|
+
}, z.core.$strip>;
|
|
95
|
+
}, z.core.$strip>;
|
|
96
|
+
fields: z.ZodMiniObject<{
|
|
97
|
+
nt_name: z.ZodMiniString<string>;
|
|
98
|
+
nt_description: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
99
|
+
nt_type: z.ZodMiniUnion<readonly [z.ZodMiniLiteral<"nt_experiment">, z.ZodMiniLiteral<"nt_personalization">]>;
|
|
100
|
+
nt_config: z.ZodMiniPipe<z.ZodMiniOptional<z.ZodMiniPrefault<z.ZodMiniNullable<z.ZodMiniObject<{
|
|
101
|
+
distribution: z.ZodMiniOptional<z.ZodMiniPrefault<z.ZodMiniArray<z.ZodMiniNumber<number>>>>;
|
|
102
|
+
traffic: z.ZodMiniOptional<z.ZodMiniPrefault<z.ZodMiniNumber<number>>>;
|
|
103
|
+
components: z.ZodMiniOptional<z.ZodMiniPrefault<z.ZodMiniArray<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
|
|
104
|
+
type: z.ZodMiniOptional<z.ZodMiniLiteral<"EntryReplacement">>;
|
|
105
|
+
baseline: z.ZodMiniObject<{
|
|
106
|
+
id: z.ZodMiniString<string>;
|
|
107
|
+
hidden: z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>;
|
|
108
|
+
}, z.core.$strip>;
|
|
109
|
+
variants: z.ZodMiniArray<z.ZodMiniObject<{
|
|
110
|
+
id: z.ZodMiniString<string>;
|
|
111
|
+
hidden: z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>;
|
|
112
|
+
}, z.core.$strip>>;
|
|
113
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
114
|
+
type: z.ZodMiniLiteral<"InlineVariable">;
|
|
115
|
+
key: z.ZodMiniString<string>;
|
|
116
|
+
valueType: z.ZodMiniEnum<{
|
|
117
|
+
Boolean: "Boolean";
|
|
118
|
+
Number: "Number";
|
|
119
|
+
Object: "Object";
|
|
120
|
+
String: "String";
|
|
121
|
+
}>;
|
|
122
|
+
baseline: z.ZodMiniObject<{
|
|
123
|
+
value: z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniBoolean<boolean>, z.ZodMiniNull, z.ZodMiniNumber<number>, z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniJSONSchema>]>;
|
|
124
|
+
}, z.core.$strip>;
|
|
125
|
+
variants: z.ZodMiniArray<z.ZodMiniObject<{
|
|
126
|
+
value: z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniBoolean<boolean>, z.ZodMiniNull, z.ZodMiniNumber<number>, z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniJSONSchema>]>;
|
|
127
|
+
}, z.core.$strip>>;
|
|
128
|
+
}, z.core.$strip>], "type">>>>;
|
|
129
|
+
sticky: z.ZodMiniOptional<z.ZodMiniPrefault<z.ZodMiniBoolean<boolean>>>;
|
|
130
|
+
}, z.core.$strip>>>>, z.ZodMiniTransform<{
|
|
131
|
+
distribution?: number[] | undefined;
|
|
132
|
+
traffic?: number | undefined;
|
|
133
|
+
components?: ({
|
|
134
|
+
baseline: {
|
|
135
|
+
id: string;
|
|
136
|
+
hidden: boolean;
|
|
137
|
+
};
|
|
138
|
+
variants: {
|
|
139
|
+
id: string;
|
|
140
|
+
hidden: boolean;
|
|
141
|
+
}[];
|
|
142
|
+
type?: "EntryReplacement" | undefined;
|
|
143
|
+
} | {
|
|
144
|
+
type: "InlineVariable";
|
|
145
|
+
key: string;
|
|
146
|
+
valueType: "Boolean" | "Number" | "Object" | "String";
|
|
147
|
+
baseline: {
|
|
148
|
+
value: string | number | boolean | Record<string, z.core.util.JSONType> | null;
|
|
149
|
+
};
|
|
150
|
+
variants: {
|
|
151
|
+
value: string | number | boolean | Record<string, z.core.util.JSONType> | null;
|
|
152
|
+
}[];
|
|
153
|
+
})[] | undefined;
|
|
154
|
+
sticky?: boolean | undefined;
|
|
155
|
+
} | null, {
|
|
156
|
+
distribution?: number[] | undefined;
|
|
157
|
+
traffic?: number | undefined;
|
|
158
|
+
components?: ({
|
|
159
|
+
baseline: {
|
|
160
|
+
id: string;
|
|
161
|
+
hidden: boolean;
|
|
162
|
+
};
|
|
163
|
+
variants: {
|
|
164
|
+
id: string;
|
|
165
|
+
hidden: boolean;
|
|
166
|
+
}[];
|
|
167
|
+
type?: "EntryReplacement" | undefined;
|
|
168
|
+
} | {
|
|
169
|
+
type: "InlineVariable";
|
|
170
|
+
key: string;
|
|
171
|
+
valueType: "Boolean" | "Number" | "Object" | "String";
|
|
172
|
+
baseline: {
|
|
173
|
+
value: string | number | boolean | Record<string, z.core.util.JSONType> | null;
|
|
174
|
+
};
|
|
175
|
+
variants: {
|
|
176
|
+
value: string | number | boolean | Record<string, z.core.util.JSONType> | null;
|
|
177
|
+
}[];
|
|
178
|
+
})[] | undefined;
|
|
179
|
+
sticky?: boolean | undefined;
|
|
180
|
+
} | null>>;
|
|
181
|
+
nt_audience: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniObject<{
|
|
182
|
+
metadata: z.ZodMiniObject<{
|
|
183
|
+
tags: z.ZodMiniArray<z.ZodMiniObject<{
|
|
184
|
+
sys: z.ZodMiniObject<{
|
|
185
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
186
|
+
linkType: z.ZodMiniLiteral<"Tag">;
|
|
187
|
+
id: z.ZodMiniString<string>;
|
|
188
|
+
}, z.core.$strip>;
|
|
189
|
+
}, z.core.$strip>>;
|
|
190
|
+
}, z.core.$catchall<z.ZodMiniJSONSchema>>;
|
|
191
|
+
sys: z.ZodMiniObject<{
|
|
192
|
+
type: z.ZodMiniLiteral<"Entry">;
|
|
193
|
+
contentType: z.ZodMiniObject<{
|
|
194
|
+
sys: z.ZodMiniObject<{
|
|
195
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
196
|
+
linkType: z.ZodMiniLiteral<"ContentType">;
|
|
197
|
+
id: z.ZodMiniString<string>;
|
|
198
|
+
}, z.core.$strip>;
|
|
199
|
+
}, z.core.$strip>;
|
|
200
|
+
publishedVersion: z.ZodMiniNumber<number>;
|
|
201
|
+
id: z.ZodMiniString<string>;
|
|
202
|
+
createdAt: z.ZodMiniAny;
|
|
203
|
+
updatedAt: z.ZodMiniAny;
|
|
204
|
+
locale: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
205
|
+
revision: z.ZodMiniNumber<number>;
|
|
206
|
+
space: z.ZodMiniObject<{
|
|
207
|
+
sys: z.ZodMiniObject<{
|
|
208
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
209
|
+
linkType: z.ZodMiniLiteral<"Space">;
|
|
210
|
+
id: z.ZodMiniString<string>;
|
|
211
|
+
}, z.core.$strip>;
|
|
212
|
+
}, z.core.$strip>;
|
|
213
|
+
environment: z.ZodMiniObject<{
|
|
214
|
+
sys: z.ZodMiniObject<{
|
|
215
|
+
type: z.ZodMiniLiteral<"Link">;
|
|
216
|
+
linkType: z.ZodMiniLiteral<"Environment">;
|
|
217
|
+
id: z.ZodMiniString<string>;
|
|
218
|
+
}, z.core.$strip>;
|
|
219
|
+
}, z.core.$strip>;
|
|
220
|
+
}, z.core.$strip>;
|
|
221
|
+
fields: z.ZodMiniObject<{
|
|
222
|
+
nt_audience_id: z.ZodMiniString<string>;
|
|
223
|
+
nt_name: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
224
|
+
nt_description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
225
|
+
}, z.core.$catchall<z.ZodMiniJSONSchema>>;
|
|
226
|
+
}, z.core.$strip>>>;
|
|
227
|
+
nt_variants: z.ZodMiniOptional<z.ZodMiniPrefault<z.ZodMiniArray<z.ZodMiniCustom<Entry, Entry>>>>;
|
|
228
|
+
nt_experience_id: z.ZodMiniString<string>;
|
|
229
|
+
}, z.core.$catchall<z.ZodMiniJSONSchema>>;
|
|
230
|
+
}, z.core.$strip>]>>;
|
|
231
|
+
}, z.core.$catchall<z.ZodMiniJSONSchema>>;
|
|
232
|
+
}, z.core.$strip>;
|
|
233
|
+
/**
|
|
234
|
+
* TypeScript type inferred from {@link PersonalizedEntry}.
|
|
235
|
+
*/
|
|
236
|
+
export type PersonalizedEntry = z.infer<typeof PersonalizedEntry>;
|
|
237
|
+
/**
|
|
238
|
+
* Type guard for {@link PersonalizedEntry}.
|
|
239
|
+
*
|
|
240
|
+
* @param entry - Contentful entry to test.
|
|
241
|
+
* @returns `true` if the entry conforms to {@link PersonalizedEntry}, otherwise `false`.
|
|
242
|
+
*/
|
|
243
|
+
export declare function isPersonalizedEntry(entry: Entry | undefined): entry is PersonalizedEntry;
|
|
244
|
+
//# sourceMappingURL=PersonalizedEntry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PersonalizedEntry.d.ts","sourceRoot":"","sources":["../../src/contentful/PersonalizedEntry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAI7B;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAO5B,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAEjE;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,GAAG,KAAK,IAAI,iBAAiB,CAExF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as z from 'zod/mini';
|
|
2
|
+
import { CtflEntry, EntryFields } from './CtflEntry';
|
|
3
|
+
import { PersonalizationEntryArray } from './PersonalizationEntry';
|
|
4
|
+
/**
|
|
5
|
+
* Zod schema describing a Contentful entry that has attached personalizations.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Extends {@link CtflEntry} and adds `nt_experiences` to the `fields` object.
|
|
9
|
+
*/
|
|
10
|
+
export const PersonalizedEntry = z.extend(CtflEntry, {
|
|
11
|
+
fields: z.extend(EntryFields, {
|
|
12
|
+
/**
|
|
13
|
+
* Personalization or experimentation experiences attached to this entry.
|
|
14
|
+
*/
|
|
15
|
+
nt_experiences: PersonalizationEntryArray,
|
|
16
|
+
}),
|
|
17
|
+
});
|
|
18
|
+
/**
|
|
19
|
+
* Type guard for {@link PersonalizedEntry}.
|
|
20
|
+
*
|
|
21
|
+
* @param entry - Contentful entry to test.
|
|
22
|
+
* @returns `true` if the entry conforms to {@link PersonalizedEntry}, otherwise `false`.
|
|
23
|
+
*/
|
|
24
|
+
export function isPersonalizedEntry(entry) {
|
|
25
|
+
return PersonalizedEntry.safeParse(entry).success;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=PersonalizedEntry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PersonalizedEntry.js","sourceRoot":"","sources":["../../src/contentful/PersonalizedEntry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAC7B,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAA;AAElE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE;IACnD,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE;QAC5B;;WAEG;QACH,cAAc,EAAE,yBAAyB;KAC1C,CAAC;CACH,CAAC,CAAA;AAOF;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAwB;IAC1D,OAAO,iBAAiB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAA;AACnD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contentful/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,yBAAyB,CAAA;AACvC,cAAc,wBAAwB,CAAA;AACtC,cAAc,qBAAqB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contentful/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,yBAAyB,CAAA;AACvC,cAAc,wBAAwB,CAAA;AACtC,cAAc,qBAAqB,CAAA"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import * as z from 'zod/mini';
|
|
2
|
+
/**
|
|
3
|
+
* Zod schema describing the `data` property of a batch experience response.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* A batch request may return zero or more profiles. When no profiles are
|
|
7
|
+
* returned, `profiles` may be omitted or an empty array.
|
|
8
|
+
*/
|
|
9
|
+
export declare const BatchExperienceData: z.ZodMiniObject<{
|
|
10
|
+
/**
|
|
11
|
+
* Profiles evaluated or affected by the batch experience request.
|
|
12
|
+
*/
|
|
13
|
+
profiles: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
14
|
+
id: z.ZodMiniString<string>;
|
|
15
|
+
stableId: z.ZodMiniString<string>;
|
|
16
|
+
random: z.ZodMiniNumber<number>;
|
|
17
|
+
audiences: z.ZodMiniArray<z.ZodMiniString<string>>;
|
|
18
|
+
traits: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniJSONSchema>;
|
|
19
|
+
location: z.ZodMiniObject<{
|
|
20
|
+
coordinates: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
21
|
+
latitude: z.ZodMiniNumber<number>;
|
|
22
|
+
longitude: z.ZodMiniNumber<number>;
|
|
23
|
+
}, z.core.$strip>>;
|
|
24
|
+
city: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
25
|
+
postalCode: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
26
|
+
region: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
27
|
+
regionCode: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
28
|
+
country: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
29
|
+
countryCode: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
30
|
+
continent: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
31
|
+
timezone: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
session: z.ZodMiniObject<{
|
|
34
|
+
id: z.ZodMiniString<string>;
|
|
35
|
+
isReturningVisitor: z.ZodMiniBoolean<boolean>;
|
|
36
|
+
landingPage: z.ZodMiniObject<{
|
|
37
|
+
path: z.ZodMiniString<string>;
|
|
38
|
+
query: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>;
|
|
39
|
+
referrer: z.ZodMiniString<string>;
|
|
40
|
+
search: z.ZodMiniString<string>;
|
|
41
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
42
|
+
url: z.ZodMiniString<string>;
|
|
43
|
+
}, z.core.$catchall<z.ZodMiniJSONSchema>>;
|
|
44
|
+
count: z.ZodMiniNumber<number>;
|
|
45
|
+
activeSessionLength: z.ZodMiniNumber<number>;
|
|
46
|
+
averageSessionLength: z.ZodMiniNumber<number>;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
}, z.core.$strip>>>;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
/**
|
|
51
|
+
* TypeScript type inferred from {@link BatchExperienceData}.
|
|
52
|
+
*/
|
|
53
|
+
export type BatchExperienceData = z.infer<typeof BatchExperienceData>;
|
|
54
|
+
/**
|
|
55
|
+
* Zod schema describing a batch experience response from the Experience API.
|
|
56
|
+
*
|
|
57
|
+
* @remarks
|
|
58
|
+
* Extends {@link ResponseEnvelope} with {@link BatchExperienceData} as the
|
|
59
|
+
* `data` payload.
|
|
60
|
+
*/
|
|
61
|
+
export declare const BatchExperienceResponse: z.ZodMiniObject<{
|
|
62
|
+
message: z.ZodMiniString<string>;
|
|
63
|
+
error: z.ZodMiniNullable<z.ZodMiniBoolean<boolean>>;
|
|
64
|
+
data: z.ZodMiniObject<{
|
|
65
|
+
/**
|
|
66
|
+
* Profiles evaluated or affected by the batch experience request.
|
|
67
|
+
*/
|
|
68
|
+
profiles: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
69
|
+
id: z.ZodMiniString<string>;
|
|
70
|
+
stableId: z.ZodMiniString<string>;
|
|
71
|
+
random: z.ZodMiniNumber<number>;
|
|
72
|
+
audiences: z.ZodMiniArray<z.ZodMiniString<string>>;
|
|
73
|
+
traits: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniJSONSchema>;
|
|
74
|
+
location: z.ZodMiniObject<{
|
|
75
|
+
coordinates: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
76
|
+
latitude: z.ZodMiniNumber<number>;
|
|
77
|
+
longitude: z.ZodMiniNumber<number>;
|
|
78
|
+
}, z.core.$strip>>;
|
|
79
|
+
city: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
80
|
+
postalCode: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
81
|
+
region: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
82
|
+
regionCode: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
83
|
+
country: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
84
|
+
countryCode: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
85
|
+
continent: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
86
|
+
timezone: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
session: z.ZodMiniObject<{
|
|
89
|
+
id: z.ZodMiniString<string>;
|
|
90
|
+
isReturningVisitor: z.ZodMiniBoolean<boolean>;
|
|
91
|
+
landingPage: z.ZodMiniObject<{
|
|
92
|
+
path: z.ZodMiniString<string>;
|
|
93
|
+
query: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>;
|
|
94
|
+
referrer: z.ZodMiniString<string>;
|
|
95
|
+
search: z.ZodMiniString<string>;
|
|
96
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
97
|
+
url: z.ZodMiniString<string>;
|
|
98
|
+
}, z.core.$catchall<z.ZodMiniJSONSchema>>;
|
|
99
|
+
count: z.ZodMiniNumber<number>;
|
|
100
|
+
activeSessionLength: z.ZodMiniNumber<number>;
|
|
101
|
+
averageSessionLength: z.ZodMiniNumber<number>;
|
|
102
|
+
}, z.core.$strip>;
|
|
103
|
+
}, z.core.$strip>>>;
|
|
104
|
+
}, z.core.$strip>;
|
|
105
|
+
}, z.core.$strip>;
|
|
106
|
+
/**
|
|
107
|
+
* TypeScript type inferred from {@link BatchExperienceResponse}.
|
|
108
|
+
*/
|
|
109
|
+
export type BatchExperienceResponse = z.infer<typeof BatchExperienceResponse>;
|
|
110
|
+
//# sourceMappingURL=BatchExperienceResponse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BatchExperienceResponse.d.ts","sourceRoot":"","sources":["../../src/experience/BatchExperienceResponse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAI7B;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB;IAC9B;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAEH,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAErE;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB;;;;QAlBlC;;WAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgB2F,CAAA;AAEhG;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as z from 'zod/mini';
|
|
2
|
+
import { Profile } from './profile';
|
|
3
|
+
import { ResponseEnvelope } from './ResponseEnvelope';
|
|
4
|
+
/**
|
|
5
|
+
* Zod schema describing the `data` property of a batch experience response.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* A batch request may return zero or more profiles. When no profiles are
|
|
9
|
+
* returned, `profiles` may be omitted or an empty array.
|
|
10
|
+
*/
|
|
11
|
+
export const BatchExperienceData = z.object({
|
|
12
|
+
/**
|
|
13
|
+
* Profiles evaluated or affected by the batch experience request.
|
|
14
|
+
*/
|
|
15
|
+
profiles: z.optional(z.array(Profile)),
|
|
16
|
+
});
|
|
17
|
+
/**
|
|
18
|
+
* Zod schema describing a batch experience response from the Experience API.
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
* Extends {@link ResponseEnvelope} with {@link BatchExperienceData} as the
|
|
22
|
+
* `data` payload.
|
|
23
|
+
*/
|
|
24
|
+
export const BatchExperienceResponse = z.extend(ResponseEnvelope, { data: BatchExperienceData });
|
|
25
|
+
//# sourceMappingURL=BatchExperienceResponse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BatchExperienceResponse.js","sourceRoot":"","sources":["../../src/experience/BatchExperienceResponse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C;;OAEG;IACH,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;CACvC,CAAC,CAAA;AAOF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE,CAAC,CAAA"}
|