@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.
Files changed (195) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +127 -0
  3. package/dist/contentful/AudienceEntry.d.ts +73 -0
  4. package/dist/contentful/AudienceEntry.d.ts.map +1 -0
  5. package/dist/contentful/AudienceEntry.js +41 -0
  6. package/dist/contentful/AudienceEntry.js.map +1 -0
  7. package/dist/contentful/CtflEntry.d.ts +206 -0
  8. package/dist/contentful/CtflEntry.d.ts.map +1 -0
  9. package/dist/contentful/CtflEntry.js +122 -0
  10. package/dist/contentful/CtflEntry.js.map +1 -0
  11. package/dist/contentful/MergeTagEntry.d.ts +68 -0
  12. package/dist/contentful/MergeTagEntry.d.ts.map +1 -0
  13. package/dist/contentful/MergeTagEntry.js +38 -0
  14. package/dist/contentful/MergeTagEntry.js.map +1 -0
  15. package/dist/contentful/PersonalizationConfig.d.ts +437 -0
  16. package/dist/contentful/PersonalizationConfig.d.ts.map +1 -0
  17. package/dist/contentful/PersonalizationConfig.js +164 -0
  18. package/dist/contentful/PersonalizationConfig.js.map +1 -0
  19. package/dist/contentful/PersonalizationEntry.d.ts +541 -0
  20. package/dist/contentful/PersonalizationEntry.d.ts.map +1 -0
  21. package/dist/contentful/PersonalizationEntry.js +95 -0
  22. package/dist/contentful/PersonalizationEntry.js.map +1 -0
  23. package/dist/contentful/PersonalizedEntry.d.ts +244 -0
  24. package/dist/contentful/PersonalizedEntry.d.ts.map +1 -0
  25. package/dist/contentful/PersonalizedEntry.js +27 -0
  26. package/dist/contentful/PersonalizedEntry.js.map +1 -0
  27. package/dist/contentful/index.d.ts +7 -0
  28. package/dist/contentful/index.d.ts.map +1 -0
  29. package/dist/contentful/index.js +7 -0
  30. package/dist/contentful/index.js.map +1 -0
  31. package/dist/experience/BatchExperienceResponse.d.ts +110 -0
  32. package/dist/experience/BatchExperienceResponse.d.ts.map +1 -0
  33. package/dist/experience/BatchExperienceResponse.js +25 -0
  34. package/dist/experience/BatchExperienceResponse.js.map +1 -0
  35. package/dist/experience/ExperienceRequest.d.ts +440 -0
  36. package/dist/experience/ExperienceRequest.d.ts.map +1 -0
  37. package/dist/experience/ExperienceRequest.js +36 -0
  38. package/dist/experience/ExperienceRequest.js.map +1 -0
  39. package/dist/experience/ExperienceResponse.d.ts +173 -0
  40. package/dist/experience/ExperienceResponse.d.ts.map +1 -0
  41. package/dist/experience/ExperienceResponse.js +38 -0
  42. package/dist/experience/ExperienceResponse.js.map +1 -0
  43. package/dist/experience/ResponseEnvelope.d.ts +35 -0
  44. package/dist/experience/ResponseEnvelope.d.ts.map +1 -0
  45. package/dist/experience/ResponseEnvelope.js +31 -0
  46. package/dist/experience/ResponseEnvelope.js.map +1 -0
  47. package/dist/experience/change/Change.d.ts +138 -0
  48. package/dist/experience/change/Change.d.ts.map +1 -0
  49. package/dist/experience/change/Change.js +102 -0
  50. package/dist/experience/change/Change.js.map +1 -0
  51. package/dist/experience/change/index.d.ts +2 -0
  52. package/dist/experience/change/index.d.ts.map +1 -0
  53. package/dist/experience/change/index.js +2 -0
  54. package/dist/experience/change/index.js.map +1 -0
  55. package/dist/experience/event/AliasEvent.d.ts +73 -0
  56. package/dist/experience/event/AliasEvent.d.ts.map +1 -0
  57. package/dist/experience/event/AliasEvent.js +20 -0
  58. package/dist/experience/event/AliasEvent.js.map +1 -0
  59. package/dist/experience/event/BatchExperienceEvent.d.ts +820 -0
  60. package/dist/experience/event/BatchExperienceEvent.d.ts.map +1 -0
  61. package/dist/experience/event/BatchExperienceEvent.js +37 -0
  62. package/dist/experience/event/BatchExperienceEvent.js.map +1 -0
  63. package/dist/experience/event/ComponentViewEvent.d.ts +75 -0
  64. package/dist/experience/event/ComponentViewEvent.d.ts.map +1 -0
  65. package/dist/experience/event/ComponentViewEvent.js +43 -0
  66. package/dist/experience/event/ComponentViewEvent.js.map +1 -0
  67. package/dist/experience/event/ExperienceEvent.d.ts +810 -0
  68. package/dist/experience/event/ExperienceEvent.d.ts.map +1 -0
  69. package/dist/experience/event/ExperienceEvent.js +29 -0
  70. package/dist/experience/event/ExperienceEvent.js.map +1 -0
  71. package/dist/experience/event/GroupEvent.d.ts +73 -0
  72. package/dist/experience/event/GroupEvent.d.ts.map +1 -0
  73. package/dist/experience/event/GroupEvent.js +20 -0
  74. package/dist/experience/event/GroupEvent.js.map +1 -0
  75. package/dist/experience/event/IdentifyEvent.d.ts +71 -0
  76. package/dist/experience/event/IdentifyEvent.d.ts.map +1 -0
  77. package/dist/experience/event/IdentifyEvent.js +24 -0
  78. package/dist/experience/event/IdentifyEvent.js.map +1 -0
  79. package/dist/experience/event/PageViewEvent.d.ts +128 -0
  80. package/dist/experience/event/PageViewEvent.d.ts.map +1 -0
  81. package/dist/experience/event/PageViewEvent.js +44 -0
  82. package/dist/experience/event/PageViewEvent.js.map +1 -0
  83. package/dist/experience/event/ScreenViewEvent.d.ts +111 -0
  84. package/dist/experience/event/ScreenViewEvent.d.ts.map +1 -0
  85. package/dist/experience/event/ScreenViewEvent.js +43 -0
  86. package/dist/experience/event/ScreenViewEvent.js.map +1 -0
  87. package/dist/experience/event/TrackEvent.d.ts +73 -0
  88. package/dist/experience/event/TrackEvent.d.ts.map +1 -0
  89. package/dist/experience/event/TrackEvent.js +27 -0
  90. package/dist/experience/event/TrackEvent.js.map +1 -0
  91. package/dist/experience/event/UniversalEventProperties.d.ts +175 -0
  92. package/dist/experience/event/UniversalEventProperties.d.ts.map +1 -0
  93. package/dist/experience/event/UniversalEventProperties.js +100 -0
  94. package/dist/experience/event/UniversalEventProperties.js.map +1 -0
  95. package/dist/experience/event/index.d.ts +12 -0
  96. package/dist/experience/event/index.d.ts.map +1 -0
  97. package/dist/experience/event/index.js +12 -0
  98. package/dist/experience/event/index.js.map +1 -0
  99. package/dist/experience/event/properties/App.d.ts +25 -0
  100. package/dist/experience/event/properties/App.d.ts.map +1 -0
  101. package/dist/experience/event/properties/App.js +21 -0
  102. package/dist/experience/event/properties/App.js.map +1 -0
  103. package/dist/experience/event/properties/Campaign.d.ts +34 -0
  104. package/dist/experience/event/properties/Campaign.d.ts.map +1 -0
  105. package/dist/experience/event/properties/Campaign.js +30 -0
  106. package/dist/experience/event/properties/Campaign.js.map +1 -0
  107. package/dist/experience/event/properties/Channel.d.ts +17 -0
  108. package/dist/experience/event/properties/Channel.d.ts.map +1 -0
  109. package/dist/experience/event/properties/Channel.js +13 -0
  110. package/dist/experience/event/properties/Channel.js.map +1 -0
  111. package/dist/experience/event/properties/Dictionary.d.ts +13 -0
  112. package/dist/experience/event/properties/Dictionary.d.ts.map +1 -0
  113. package/dist/experience/event/properties/Dictionary.js +9 -0
  114. package/dist/experience/event/properties/Dictionary.js.map +1 -0
  115. package/dist/experience/event/properties/GeoLocation.d.ts +66 -0
  116. package/dist/experience/event/properties/GeoLocation.d.ts.map +1 -0
  117. package/dist/experience/event/properties/GeoLocation.js +76 -0
  118. package/dist/experience/event/properties/GeoLocation.js.map +1 -0
  119. package/dist/experience/event/properties/Library.d.ts +22 -0
  120. package/dist/experience/event/properties/Library.d.ts.map +1 -0
  121. package/dist/experience/event/properties/Library.js +18 -0
  122. package/dist/experience/event/properties/Library.js.map +1 -0
  123. package/dist/experience/event/properties/Page.d.ts +39 -0
  124. package/dist/experience/event/properties/Page.d.ts.map +1 -0
  125. package/dist/experience/event/properties/Page.js +36 -0
  126. package/dist/experience/event/properties/Page.js.map +1 -0
  127. package/dist/experience/event/properties/Properties.d.ts +13 -0
  128. package/dist/experience/event/properties/Properties.d.ts.map +1 -0
  129. package/dist/experience/event/properties/Properties.js +9 -0
  130. package/dist/experience/event/properties/Properties.js.map +1 -0
  131. package/dist/experience/event/properties/Screen.d.ts +19 -0
  132. package/dist/experience/event/properties/Screen.d.ts.map +1 -0
  133. package/dist/experience/event/properties/Screen.js +15 -0
  134. package/dist/experience/event/properties/Screen.js.map +1 -0
  135. package/dist/experience/event/properties/Traits.d.ts +14 -0
  136. package/dist/experience/event/properties/Traits.d.ts.map +1 -0
  137. package/dist/experience/event/properties/Traits.js +10 -0
  138. package/dist/experience/event/properties/Traits.js.map +1 -0
  139. package/dist/experience/event/properties/index.d.ts +11 -0
  140. package/dist/experience/event/properties/index.d.ts.map +1 -0
  141. package/dist/experience/event/properties/index.js +11 -0
  142. package/dist/experience/event/properties/index.js.map +1 -0
  143. package/dist/experience/index.d.ts +8 -0
  144. package/dist/experience/index.d.ts.map +1 -0
  145. package/dist/experience/index.js +8 -0
  146. package/dist/experience/index.js.map +1 -0
  147. package/dist/experience/personalization/SelectedPersonalization.d.ts +86 -0
  148. package/dist/experience/personalization/SelectedPersonalization.d.ts.map +1 -0
  149. package/dist/experience/personalization/SelectedPersonalization.js +48 -0
  150. package/dist/experience/personalization/SelectedPersonalization.js.map +1 -0
  151. package/dist/experience/personalization/index.d.ts +2 -0
  152. package/dist/experience/personalization/index.d.ts.map +1 -0
  153. package/dist/experience/personalization/index.js +2 -0
  154. package/dist/experience/personalization/index.js.map +1 -0
  155. package/dist/experience/profile/Profile.d.ts +104 -0
  156. package/dist/experience/profile/Profile.d.ts.map +1 -0
  157. package/dist/experience/profile/Profile.js +72 -0
  158. package/dist/experience/profile/Profile.js.map +1 -0
  159. package/dist/experience/profile/index.d.ts +3 -0
  160. package/dist/experience/profile/index.d.ts.map +1 -0
  161. package/dist/experience/profile/index.js +3 -0
  162. package/dist/experience/profile/index.js.map +1 -0
  163. package/dist/experience/profile/properties/SessionStatistics.d.ts +60 -0
  164. package/dist/experience/profile/properties/SessionStatistics.d.ts.map +1 -0
  165. package/dist/experience/profile/properties/SessionStatistics.js +50 -0
  166. package/dist/experience/profile/properties/SessionStatistics.js.map +1 -0
  167. package/dist/experience/profile/properties/index.d.ts +2 -0
  168. package/dist/experience/profile/properties/index.d.ts.map +1 -0
  169. package/dist/experience/profile/properties/index.js +2 -0
  170. package/dist/experience/profile/properties/index.js.map +1 -0
  171. package/dist/index.cjs +684 -0
  172. package/dist/index.cjs.map +1 -0
  173. package/dist/index.d.ts +4 -0
  174. package/dist/index.d.ts.map +1 -0
  175. package/dist/index.js +4 -0
  176. package/dist/index.js.map +1 -0
  177. package/dist/index.mjs +425 -0
  178. package/dist/index.mjs.map +1 -0
  179. package/dist/insights/event/BatchInsightsEvent.d.ts +173 -0
  180. package/dist/insights/event/BatchInsightsEvent.d.ts.map +1 -0
  181. package/dist/insights/event/BatchInsightsEvent.js +32 -0
  182. package/dist/insights/event/BatchInsightsEvent.js.map +1 -0
  183. package/dist/insights/event/InsightsEvent.d.ts +145 -0
  184. package/dist/insights/event/InsightsEvent.d.ts.map +1 -0
  185. package/dist/insights/event/InsightsEvent.js +16 -0
  186. package/dist/insights/event/InsightsEvent.js.map +1 -0
  187. package/dist/insights/event/index.d.ts +3 -0
  188. package/dist/insights/event/index.d.ts.map +1 -0
  189. package/dist/insights/event/index.js +3 -0
  190. package/dist/insights/event/index.js.map +1 -0
  191. package/dist/insights/index.d.ts +2 -0
  192. package/dist/insights/index.d.ts.map +1 -0
  193. package/dist/insights/index.js +2 -0
  194. package/dist/insights/index.js.map +1 -0
  195. 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,7 @@
1
+ export * from './AudienceEntry';
2
+ export * from './CtflEntry';
3
+ export * from './MergeTagEntry';
4
+ export * from './PersonalizationConfig';
5
+ export * from './PersonalizationEntry';
6
+ export * from './PersonalizedEntry';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -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,7 @@
1
+ export * from './AudienceEntry';
2
+ export * from './CtflEntry';
3
+ export * from './MergeTagEntry';
4
+ export * from './PersonalizationConfig';
5
+ export * from './PersonalizationEntry';
6
+ export * from './PersonalizedEntry';
7
+ //# sourceMappingURL=index.js.map
@@ -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"}