@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 @@
1
+ {"version":3,"file":"BatchExperienceEvent.d.ts","sourceRoot":"","sources":["../../../src/experience/event/BatchExperienceEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAkB7B;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAQ/B,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEvE;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAAgC,CAAA;AAEtE;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA"}
@@ -0,0 +1,37 @@
1
+ import * as z from 'zod/mini';
2
+ import { AliasEvent } from './AliasEvent';
3
+ import { ComponentViewEvent } from './ComponentViewEvent';
4
+ import { GroupEvent } from './GroupEvent';
5
+ import { IdentifyEvent } from './IdentifyEvent';
6
+ import { PageViewEvent } from './PageViewEvent';
7
+ import { ScreenViewEvent } from './ScreenViewEvent';
8
+ import { TrackEvent } from './TrackEvent';
9
+ /**
10
+ * Partial schema capturing an anonymous identifier.
11
+ *
12
+ * @remarks
13
+ * This object is merged into each event type in a batch to associate the
14
+ * event with an `anonymousId`.
15
+ */
16
+ const Anon = { anonymousId: z.string() };
17
+ /**
18
+ * Zod schema describing each valid experience/personalization event within a batch.
19
+ *
20
+ * @remarks
21
+ * This is a discriminated union on the `type` field that supports all event
22
+ * types used in batch ingestion, each extended with an `anonymousId`.
23
+ */
24
+ export const BatchExperienceEvent = z.discriminatedUnion('type', [
25
+ z.extend(AliasEvent, Anon),
26
+ z.extend(ComponentViewEvent, Anon),
27
+ z.extend(GroupEvent, Anon),
28
+ z.extend(IdentifyEvent, Anon),
29
+ z.extend(PageViewEvent, Anon),
30
+ z.extend(ScreenViewEvent, Anon),
31
+ z.extend(TrackEvent, Anon),
32
+ ]);
33
+ /**
34
+ * Zod schema describing an array of {@link BatchExperienceEvent} items.
35
+ */
36
+ export const BatchExperienceEventArray = z.array(BatchExperienceEvent);
37
+ //# sourceMappingURL=BatchExperienceEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BatchExperienceEvent.js","sourceRoot":"","sources":["../../../src/experience/event/BatchExperienceEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC;;;;;;GAMG;AACH,MAAM,IAAI,GAAG,EAAE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAA;AAExC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAC/D,CAAC,CAAC,MAAM,CAAC,UAAU,EAAE,IAAI,CAAC;IAC1B,CAAC,CAAC,MAAM,CAAC,kBAAkB,EAAE,IAAI,CAAC;IAClC,CAAC,CAAC,MAAM,CAAC,UAAU,EAAE,IAAI,CAAC;IAC1B,CAAC,CAAC,MAAM,CAAC,aAAa,EAAE,IAAI,CAAC;IAC7B,CAAC,CAAC,MAAM,CAAC,aAAa,EAAE,IAAI,CAAC;IAC7B,CAAC,CAAC,MAAM,CAAC,eAAe,EAAE,IAAI,CAAC;IAC/B,CAAC,CAAC,MAAM,CAAC,UAAU,EAAE,IAAI,CAAC;CAC3B,CAAC,CAAA;AAOF;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAA"}
@@ -0,0 +1,75 @@
1
+ import * as z from 'zod/mini';
2
+ /**
3
+ * Zod schema describing a `component` view event.
4
+ *
5
+ * @remarks
6
+ * Component view events track exposure of individual components such as
7
+ * entries or variables within a personalized experience.
8
+ *
9
+ * Extends {@link UniversalEventProperties}.
10
+ */
11
+ export declare const ComponentViewEvent: z.ZodMiniObject<{
12
+ channel: z.ZodMiniUnion<readonly [z.ZodMiniLiteral<"mobile">, z.ZodMiniLiteral<"server">, z.ZodMiniLiteral<"web">]>;
13
+ context: z.ZodMiniObject<{
14
+ app: z.ZodMiniOptional<z.ZodMiniObject<{
15
+ name: z.ZodMiniString<string>;
16
+ version: z.ZodMiniString<string>;
17
+ }, z.core.$strip>>;
18
+ campaign: z.ZodMiniObject<{
19
+ name: z.ZodMiniOptional<z.ZodMiniString<string>>;
20
+ source: z.ZodMiniOptional<z.ZodMiniString<string>>;
21
+ medium: z.ZodMiniOptional<z.ZodMiniString<string>>;
22
+ term: z.ZodMiniOptional<z.ZodMiniString<string>>;
23
+ content: z.ZodMiniOptional<z.ZodMiniString<string>>;
24
+ }, z.core.$strip>;
25
+ gdpr: z.ZodMiniObject<{
26
+ isConsentGiven: z.ZodMiniBoolean<boolean>;
27
+ }, z.core.$strip>;
28
+ library: z.ZodMiniObject<{
29
+ name: z.ZodMiniString<string>;
30
+ version: z.ZodMiniString<string>;
31
+ }, z.core.$strip>;
32
+ locale: z.ZodMiniString<string>;
33
+ location: z.ZodMiniOptional<z.ZodMiniObject<{
34
+ coordinates: z.ZodMiniOptional<z.ZodMiniObject<{
35
+ latitude: z.ZodMiniNumber<number>;
36
+ longitude: z.ZodMiniNumber<number>;
37
+ }, z.core.$strip>>;
38
+ city: z.ZodMiniOptional<z.ZodMiniString<string>>;
39
+ postalCode: z.ZodMiniOptional<z.ZodMiniString<string>>;
40
+ region: z.ZodMiniOptional<z.ZodMiniString<string>>;
41
+ regionCode: z.ZodMiniOptional<z.ZodMiniString<string>>;
42
+ country: z.ZodMiniOptional<z.ZodMiniString<string>>;
43
+ countryCode: z.ZodMiniOptional<z.ZodMiniString<string>>;
44
+ continent: z.ZodMiniOptional<z.ZodMiniString<string>>;
45
+ timezone: z.ZodMiniOptional<z.ZodMiniString<string>>;
46
+ }, z.core.$strip>>;
47
+ userAgent: z.ZodMiniOptional<z.ZodMiniString<string>>;
48
+ page: z.ZodMiniOptional<z.ZodMiniObject<{
49
+ path: z.ZodMiniString<string>;
50
+ query: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>;
51
+ referrer: z.ZodMiniString<string>;
52
+ search: z.ZodMiniString<string>;
53
+ title: z.ZodMiniOptional<z.ZodMiniString<string>>;
54
+ url: z.ZodMiniString<string>;
55
+ }, z.core.$catchall<z.ZodMiniJSONSchema>>>;
56
+ screen: z.ZodMiniOptional<z.ZodMiniObject<{
57
+ name: z.ZodMiniString<string>;
58
+ }, z.core.$catchall<z.ZodMiniJSONSchema>>>;
59
+ }, z.core.$strip>;
60
+ messageId: z.ZodMiniString<string>;
61
+ originalTimestamp: z.iso.ZodMiniISODateTime;
62
+ sentAt: z.iso.ZodMiniISODateTime;
63
+ timestamp: z.iso.ZodMiniISODateTime;
64
+ userId: z.ZodMiniOptional<z.ZodMiniString<string>>;
65
+ type: z.ZodMiniLiteral<"component">;
66
+ componentType: z.ZodMiniUnion<readonly [z.ZodMiniLiteral<"Entry">, z.ZodMiniLiteral<"Variable">]>;
67
+ componentId: z.ZodMiniString<string>;
68
+ experienceId: z.ZodMiniOptional<z.ZodMiniString<string>>;
69
+ variantIndex: z.ZodMiniNumber<number>;
70
+ }, z.core.$strip>;
71
+ /**
72
+ * TypeScript type inferred from {@link ComponentViewEvent}.
73
+ */
74
+ export type ComponentViewEvent = z.infer<typeof ComponentViewEvent>;
75
+ //# sourceMappingURL=ComponentViewEvent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComponentViewEvent.d.ts","sourceRoot":"","sources":["../../../src/experience/event/ComponentViewEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAG7B;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkC7B,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA"}
@@ -0,0 +1,43 @@
1
+ import * as z from 'zod/mini';
2
+ import { UniversalEventProperties } from './UniversalEventProperties';
3
+ /**
4
+ * Zod schema describing a `component` view event.
5
+ *
6
+ * @remarks
7
+ * Component view events track exposure of individual components such as
8
+ * entries or variables within a personalized experience.
9
+ *
10
+ * Extends {@link UniversalEventProperties}.
11
+ */
12
+ export const ComponentViewEvent = z.extend(UniversalEventProperties, {
13
+ /**
14
+ * Discriminator indicating that this event is a component view.
15
+ */
16
+ type: z.literal('component'),
17
+ /**
18
+ * Type of component that was viewed.
19
+ *
20
+ * - `'Entry'` — A content entry component.
21
+ * - `'Variable'` — A variable or inline value component.
22
+ */
23
+ componentType: z.union([z.literal('Entry'), z.literal('Variable')]),
24
+ /**
25
+ * Contentful entry ID corresponding to the component that was viewed.
26
+ */
27
+ componentId: z.string(),
28
+ /**
29
+ * Identifier of the experience that rendered this component.
30
+ *
31
+ * @remarks
32
+ * Optional; component views may occur outside of a specific experience/personalization.
33
+ */
34
+ experienceId: z.optional(z.string()),
35
+ /**
36
+ * Index of the variant associated with this component view.
37
+ *
38
+ * @remarks
39
+ * Typically corresponds to the index of the selected personalization entry.
40
+ */
41
+ variantIndex: z.number(),
42
+ });
43
+ //# sourceMappingURL=ComponentViewEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComponentViewEvent.js","sourceRoot":"","sources":["../../../src/experience/event/ComponentViewEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAC7B,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AAErE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC,wBAAwB,EAAE;IACnE;;OAEG;IACH,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;IAE5B;;;;;OAKG;IACH,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;IAEnE;;OAEG;IACH,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IAEvB;;;;;OAKG;IACH,YAAY,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAEpC;;;;;OAKG;IACH,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;CACzB,CAAC,CAAA"}