@reactionary/core 0.11.1 → 0.12.0
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/analytics/context.js +173 -0
- package/analytics/dispatcher.js +181 -0
- package/analytics/index.js +6 -0
- package/analytics/legacy-adapter.js +48 -0
- package/analytics/origins.js +64 -0
- package/analytics/recording-subscriber.js +26 -0
- package/analytics/refs.js +14 -0
- package/capabilities/analytics.capability.js +265 -84
- package/capabilities/analytics.provider.js +13 -0
- package/capabilities/index.js +1 -0
- package/client/client-builder.js +45 -16
- package/index.js +1 -0
- package/package.json +1 -1
- package/schemas/models/analytics/consent.model.js +10 -0
- package/schemas/models/analytics/dispatch.model.js +15 -0
- package/schemas/models/analytics/envelope.model.js +38 -0
- package/schemas/models/analytics/event-parts.model.js +47 -0
- package/schemas/models/analytics/event.model.js +255 -0
- package/schemas/models/analytics/index.js +6 -0
- package/schemas/models/analytics/origin.model.js +113 -0
- package/schemas/models/analytics.model.js +0 -2
- package/schemas/models/index.js +1 -0
- package/schemas/mutations/analytics/events/account.mutation.js +66 -0
- package/schemas/mutations/analytics/events/base.mutation.js +10 -0
- package/schemas/mutations/analytics/events/browse.mutation.js +53 -0
- package/schemas/mutations/analytics/events/commerce.mutation.js +79 -0
- package/schemas/mutations/analytics/events/index.js +85 -0
- package/schemas/mutations/analytics/index.js +1 -0
- package/schemas/session.schema.js +3 -1
- package/src/analytics/context.d.ts +85 -0
- package/src/analytics/dispatcher.d.ts +71 -0
- package/src/analytics/index.d.ts +6 -0
- package/src/analytics/legacy-adapter.d.ts +10 -0
- package/src/analytics/origins.d.ts +25 -0
- package/src/analytics/recording-subscriber.d.ts +18 -0
- package/src/analytics/refs.d.ts +8 -0
- package/src/capabilities/analytics.capability.d.ts +64 -17
- package/src/capabilities/analytics.provider.d.ts +24 -0
- package/src/capabilities/index.d.ts +1 -0
- package/src/client/client-builder.d.ts +25 -2
- package/src/index.d.ts +1 -0
- package/src/schemas/capabilities.schema.d.ts +8 -1
- package/src/schemas/models/analytics/consent.model.d.ts +13 -0
- package/src/schemas/models/analytics/dispatch.model.d.ts +29 -0
- package/src/schemas/models/analytics/envelope.model.d.ts +565 -0
- package/src/schemas/models/analytics/event-parts.model.d.ts +248 -0
- package/src/schemas/models/analytics/event.model.d.ts +83182 -0
- package/src/schemas/models/analytics/index.d.ts +6 -0
- package/src/schemas/models/analytics/origin.model.d.ts +275 -0
- package/src/schemas/models/analytics.model.d.ts +1 -2
- package/src/schemas/models/index.d.ts +1 -0
- package/src/schemas/mutations/analytics/events/account.mutation.d.ts +1939 -0
- package/src/schemas/mutations/analytics/events/base.mutation.d.ts +121 -0
- package/src/schemas/mutations/analytics/events/browse.mutation.d.ts +1832 -0
- package/src/schemas/mutations/analytics/events/commerce.mutation.d.ts +30188 -0
- package/src/schemas/mutations/analytics/events/index.d.ts +33928 -0
- package/src/schemas/mutations/analytics/index.d.ts +1 -0
- package/src/schemas/mutations/checkout.mutation.d.ts +4 -4
- package/src/schemas/mutations/product-list.mutation.d.ts +2 -2
- package/src/schemas/session.schema.d.ts +8 -0
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
import type { InferType } from '../../../zod-utils.js';
|
|
3
|
+
export declare const AssociationKindSchema: z.ZodEnum<{
|
|
4
|
+
related: "related";
|
|
5
|
+
"cross-sell": "cross-sell";
|
|
6
|
+
upsell: "upsell";
|
|
7
|
+
accessories: "accessories";
|
|
8
|
+
}>;
|
|
9
|
+
export declare const CartOriginKindSchema: z.ZodEnum<{
|
|
10
|
+
upsell: "upsell";
|
|
11
|
+
page: "page";
|
|
12
|
+
"mini-cart": "mini-cart";
|
|
13
|
+
}>;
|
|
14
|
+
export declare const QuickOrderKindSchema: z.ZodEnum<{
|
|
15
|
+
"sku-entry": "sku-entry";
|
|
16
|
+
csv: "csv";
|
|
17
|
+
scan: "scan";
|
|
18
|
+
}>;
|
|
19
|
+
export declare const OriginSearchSchema: z.ZodObject<{
|
|
20
|
+
type: z.ZodLiteral<"search">;
|
|
21
|
+
identifier: z.ZodObject<{
|
|
22
|
+
term: z.ZodString;
|
|
23
|
+
facets: z.ZodArray<z.ZodObject<{
|
|
24
|
+
facet: z.ZodObject<{
|
|
25
|
+
key: z.ZodString;
|
|
26
|
+
}, z.core.$loose>;
|
|
27
|
+
key: z.ZodString;
|
|
28
|
+
}, z.core.$strip>>;
|
|
29
|
+
filters: z.ZodArray<z.ZodString>;
|
|
30
|
+
paginationOptions: z.ZodObject<{
|
|
31
|
+
pageNumber: z.ZodDefault<z.ZodNumber>;
|
|
32
|
+
pageSize: z.ZodDefault<z.ZodNumber>;
|
|
33
|
+
}, z.core.$loose>;
|
|
34
|
+
categoryFilter: z.ZodOptional<z.ZodObject<{
|
|
35
|
+
facet: z.ZodObject<{
|
|
36
|
+
key: z.ZodString;
|
|
37
|
+
}, z.core.$loose>;
|
|
38
|
+
key: z.ZodString;
|
|
39
|
+
}, z.core.$strip>>;
|
|
40
|
+
company: z.ZodOptional<z.ZodObject<{
|
|
41
|
+
taxIdentifier: z.ZodString;
|
|
42
|
+
}, z.core.$loose>>;
|
|
43
|
+
}, z.core.$loose>;
|
|
44
|
+
position: z.ZodInt;
|
|
45
|
+
}, z.core.$loose>;
|
|
46
|
+
export declare const OriginAutocompleteSchema: z.ZodObject<{
|
|
47
|
+
type: z.ZodLiteral<"autocomplete">;
|
|
48
|
+
term: z.ZodString;
|
|
49
|
+
position: z.ZodInt;
|
|
50
|
+
}, z.core.$loose>;
|
|
51
|
+
export declare const OriginCategorySchema: z.ZodObject<{
|
|
52
|
+
type: z.ZodLiteral<"category">;
|
|
53
|
+
categoryId: z.ZodObject<{
|
|
54
|
+
key: z.ZodString;
|
|
55
|
+
}, z.core.$loose>;
|
|
56
|
+
filters: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
57
|
+
facet: z.ZodObject<{
|
|
58
|
+
key: z.ZodString;
|
|
59
|
+
}, z.core.$loose>;
|
|
60
|
+
key: z.ZodString;
|
|
61
|
+
}, z.core.$strip>>>;
|
|
62
|
+
position: z.ZodInt;
|
|
63
|
+
}, z.core.$loose>;
|
|
64
|
+
export declare const OriginListSchema: z.ZodObject<{
|
|
65
|
+
type: z.ZodLiteral<"list">;
|
|
66
|
+
recommendationId: z.ZodOptional<z.ZodObject<{
|
|
67
|
+
key: z.ZodString;
|
|
68
|
+
algorithm: z.ZodString;
|
|
69
|
+
}, z.core.$loose>>;
|
|
70
|
+
carouselName: z.ZodString;
|
|
71
|
+
position: z.ZodInt;
|
|
72
|
+
}, z.core.$loose>;
|
|
73
|
+
export declare const OriginAssociationsSchema: z.ZodObject<{
|
|
74
|
+
type: z.ZodLiteral<"associations">;
|
|
75
|
+
productId: z.ZodObject<{
|
|
76
|
+
key: z.ZodString;
|
|
77
|
+
}, z.core.$loose>;
|
|
78
|
+
kind: z.ZodEnum<{
|
|
79
|
+
related: "related";
|
|
80
|
+
"cross-sell": "cross-sell";
|
|
81
|
+
upsell: "upsell";
|
|
82
|
+
accessories: "accessories";
|
|
83
|
+
}>;
|
|
84
|
+
position: z.ZodInt;
|
|
85
|
+
}, z.core.$loose>;
|
|
86
|
+
export declare const OriginProductListSchema: z.ZodObject<{
|
|
87
|
+
type: z.ZodLiteral<"product-list">;
|
|
88
|
+
listId: z.ZodObject<{
|
|
89
|
+
listType: z.ZodEnum<{
|
|
90
|
+
favorite: "favorite";
|
|
91
|
+
wish: "wish";
|
|
92
|
+
requisition: "requisition";
|
|
93
|
+
shopping: "shopping";
|
|
94
|
+
}>;
|
|
95
|
+
key: z.ZodString;
|
|
96
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
97
|
+
userId: z.ZodString;
|
|
98
|
+
}, z.core.$loose>>;
|
|
99
|
+
}, z.core.$loose>;
|
|
100
|
+
position: z.ZodInt;
|
|
101
|
+
}, z.core.$loose>;
|
|
102
|
+
export declare const OriginPromotionSchema: z.ZodObject<{
|
|
103
|
+
type: z.ZodLiteral<"promotion">;
|
|
104
|
+
promotionId: z.ZodObject<{
|
|
105
|
+
key: z.ZodString;
|
|
106
|
+
}, z.core.$loose>;
|
|
107
|
+
slot: z.ZodString;
|
|
108
|
+
}, z.core.$loose>;
|
|
109
|
+
export declare const OriginContentSchema: z.ZodObject<{
|
|
110
|
+
type: z.ZodLiteral<"content">;
|
|
111
|
+
contentId: z.ZodString;
|
|
112
|
+
slot: z.ZodOptional<z.ZodString>;
|
|
113
|
+
}, z.core.$loose>;
|
|
114
|
+
export declare const OriginCartSchema: z.ZodObject<{
|
|
115
|
+
type: z.ZodLiteral<"cart">;
|
|
116
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
117
|
+
upsell: "upsell";
|
|
118
|
+
page: "page";
|
|
119
|
+
"mini-cart": "mini-cart";
|
|
120
|
+
}>>;
|
|
121
|
+
}, z.core.$loose>;
|
|
122
|
+
export declare const OriginOrderSchema: z.ZodObject<{
|
|
123
|
+
type: z.ZodLiteral<"order">;
|
|
124
|
+
orderId: z.ZodObject<{
|
|
125
|
+
key: z.ZodString;
|
|
126
|
+
}, z.core.$loose>;
|
|
127
|
+
}, z.core.$loose>;
|
|
128
|
+
export declare const OriginQuickOrderSchema: z.ZodObject<{
|
|
129
|
+
type: z.ZodLiteral<"quick-order">;
|
|
130
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
131
|
+
"sku-entry": "sku-entry";
|
|
132
|
+
csv: "csv";
|
|
133
|
+
scan: "scan";
|
|
134
|
+
}>>;
|
|
135
|
+
}, z.core.$loose>;
|
|
136
|
+
export declare const OriginDirectSchema: z.ZodObject<{
|
|
137
|
+
type: z.ZodLiteral<"direct">;
|
|
138
|
+
}, z.core.$loose>;
|
|
139
|
+
export declare const OriginPdpSchema: z.ZodObject<{
|
|
140
|
+
type: z.ZodLiteral<"pdp">;
|
|
141
|
+
readonly upstream: z.ZodOptional<z.ZodType<Origin>>;
|
|
142
|
+
}, z.core.$loose>;
|
|
143
|
+
export declare const OriginSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
144
|
+
type: z.ZodLiteral<"search">;
|
|
145
|
+
identifier: z.ZodObject<{
|
|
146
|
+
term: z.ZodString;
|
|
147
|
+
facets: z.ZodArray<z.ZodObject<{
|
|
148
|
+
facet: z.ZodObject<{
|
|
149
|
+
key: z.ZodString;
|
|
150
|
+
}, z.core.$loose>;
|
|
151
|
+
key: z.ZodString;
|
|
152
|
+
}, z.core.$strip>>;
|
|
153
|
+
filters: z.ZodArray<z.ZodString>;
|
|
154
|
+
paginationOptions: z.ZodObject<{
|
|
155
|
+
pageNumber: z.ZodDefault<z.ZodNumber>;
|
|
156
|
+
pageSize: z.ZodDefault<z.ZodNumber>;
|
|
157
|
+
}, z.core.$loose>;
|
|
158
|
+
categoryFilter: z.ZodOptional<z.ZodObject<{
|
|
159
|
+
facet: z.ZodObject<{
|
|
160
|
+
key: z.ZodString;
|
|
161
|
+
}, z.core.$loose>;
|
|
162
|
+
key: z.ZodString;
|
|
163
|
+
}, z.core.$strip>>;
|
|
164
|
+
company: z.ZodOptional<z.ZodObject<{
|
|
165
|
+
taxIdentifier: z.ZodString;
|
|
166
|
+
}, z.core.$loose>>;
|
|
167
|
+
}, z.core.$loose>;
|
|
168
|
+
position: z.ZodInt;
|
|
169
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
170
|
+
type: z.ZodLiteral<"autocomplete">;
|
|
171
|
+
term: z.ZodString;
|
|
172
|
+
position: z.ZodInt;
|
|
173
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
174
|
+
type: z.ZodLiteral<"category">;
|
|
175
|
+
categoryId: z.ZodObject<{
|
|
176
|
+
key: z.ZodString;
|
|
177
|
+
}, z.core.$loose>;
|
|
178
|
+
filters: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
179
|
+
facet: z.ZodObject<{
|
|
180
|
+
key: z.ZodString;
|
|
181
|
+
}, z.core.$loose>;
|
|
182
|
+
key: z.ZodString;
|
|
183
|
+
}, z.core.$strip>>>;
|
|
184
|
+
position: z.ZodInt;
|
|
185
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
186
|
+
type: z.ZodLiteral<"list">;
|
|
187
|
+
recommendationId: z.ZodOptional<z.ZodObject<{
|
|
188
|
+
key: z.ZodString;
|
|
189
|
+
algorithm: z.ZodString;
|
|
190
|
+
}, z.core.$loose>>;
|
|
191
|
+
carouselName: z.ZodString;
|
|
192
|
+
position: z.ZodInt;
|
|
193
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
194
|
+
type: z.ZodLiteral<"associations">;
|
|
195
|
+
productId: z.ZodObject<{
|
|
196
|
+
key: z.ZodString;
|
|
197
|
+
}, z.core.$loose>;
|
|
198
|
+
kind: z.ZodEnum<{
|
|
199
|
+
related: "related";
|
|
200
|
+
"cross-sell": "cross-sell";
|
|
201
|
+
upsell: "upsell";
|
|
202
|
+
accessories: "accessories";
|
|
203
|
+
}>;
|
|
204
|
+
position: z.ZodInt;
|
|
205
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
206
|
+
type: z.ZodLiteral<"product-list">;
|
|
207
|
+
listId: z.ZodObject<{
|
|
208
|
+
listType: z.ZodEnum<{
|
|
209
|
+
favorite: "favorite";
|
|
210
|
+
wish: "wish";
|
|
211
|
+
requisition: "requisition";
|
|
212
|
+
shopping: "shopping";
|
|
213
|
+
}>;
|
|
214
|
+
key: z.ZodString;
|
|
215
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
216
|
+
userId: z.ZodString;
|
|
217
|
+
}, z.core.$loose>>;
|
|
218
|
+
}, z.core.$loose>;
|
|
219
|
+
position: z.ZodInt;
|
|
220
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
221
|
+
type: z.ZodLiteral<"promotion">;
|
|
222
|
+
promotionId: z.ZodObject<{
|
|
223
|
+
key: z.ZodString;
|
|
224
|
+
}, z.core.$loose>;
|
|
225
|
+
slot: z.ZodString;
|
|
226
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
227
|
+
type: z.ZodLiteral<"content">;
|
|
228
|
+
contentId: z.ZodString;
|
|
229
|
+
slot: z.ZodOptional<z.ZodString>;
|
|
230
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
231
|
+
type: z.ZodLiteral<"cart">;
|
|
232
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
233
|
+
upsell: "upsell";
|
|
234
|
+
page: "page";
|
|
235
|
+
"mini-cart": "mini-cart";
|
|
236
|
+
}>>;
|
|
237
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
238
|
+
type: z.ZodLiteral<"order">;
|
|
239
|
+
orderId: z.ZodObject<{
|
|
240
|
+
key: z.ZodString;
|
|
241
|
+
}, z.core.$loose>;
|
|
242
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
243
|
+
type: z.ZodLiteral<"quick-order">;
|
|
244
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
245
|
+
"sku-entry": "sku-entry";
|
|
246
|
+
csv: "csv";
|
|
247
|
+
scan: "scan";
|
|
248
|
+
}>>;
|
|
249
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
250
|
+
type: z.ZodLiteral<"pdp">;
|
|
251
|
+
readonly upstream: z.ZodOptional<z.ZodType<Origin>>;
|
|
252
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
253
|
+
type: z.ZodLiteral<"direct">;
|
|
254
|
+
}, z.core.$loose>], "type">;
|
|
255
|
+
export type AssociationKind = InferType<typeof AssociationKindSchema>;
|
|
256
|
+
export type CartOriginKind = InferType<typeof CartOriginKindSchema>;
|
|
257
|
+
export type QuickOrderKind = InferType<typeof QuickOrderKindSchema>;
|
|
258
|
+
export type OriginSearch = InferType<typeof OriginSearchSchema>;
|
|
259
|
+
export type OriginAutocomplete = InferType<typeof OriginAutocompleteSchema>;
|
|
260
|
+
export type OriginCategory = InferType<typeof OriginCategorySchema>;
|
|
261
|
+
export type OriginList = InferType<typeof OriginListSchema>;
|
|
262
|
+
export type OriginAssociations = InferType<typeof OriginAssociationsSchema>;
|
|
263
|
+
export type OriginProductList = InferType<typeof OriginProductListSchema>;
|
|
264
|
+
export type OriginPromotion = InferType<typeof OriginPromotionSchema>;
|
|
265
|
+
export type OriginContent = InferType<typeof OriginContentSchema>;
|
|
266
|
+
export type OriginCart = InferType<typeof OriginCartSchema>;
|
|
267
|
+
export type OriginOrder = InferType<typeof OriginOrderSchema>;
|
|
268
|
+
export type OriginQuickOrder = InferType<typeof OriginQuickOrderSchema>;
|
|
269
|
+
export type OriginDirect = InferType<typeof OriginDirectSchema>;
|
|
270
|
+
/** Declared by hand because the schema is recursive. */
|
|
271
|
+
export interface OriginPdp {
|
|
272
|
+
type: 'pdp';
|
|
273
|
+
upstream?: Origin | undefined;
|
|
274
|
+
}
|
|
275
|
+
export type Origin = OriginSearch | OriginAutocomplete | OriginCategory | OriginList | OriginAssociations | OriginProductList | OriginPromotion | OriginContent | OriginCart | OriginOrder | OriginQuickOrder | OriginPdp | OriginDirect;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
2
|
import type { InferType } from '../../zod-utils.js';
|
|
3
|
-
export declare const AnalyticsEventSchema: z.ZodObject<{}, z.core.$loose>;
|
|
4
3
|
export declare const AnalyticsOutcomeSchema: z.ZodEnum<{
|
|
5
4
|
accepted: "accepted";
|
|
6
5
|
ignored: "ignored";
|
|
@@ -24,5 +23,5 @@ export declare const AnalyticsResultSchema: z.ZodObject<{
|
|
|
24
23
|
}>;
|
|
25
24
|
}, z.core.$strip>>;
|
|
26
25
|
}, z.core.$loose>;
|
|
27
|
-
export type
|
|
26
|
+
export type AnalyticsOutcome = InferType<typeof AnalyticsOutcomeSchema>;
|
|
28
27
|
export type AnalyticsResult = InferType<typeof AnalyticsResultSchema>;
|