@getuserfeedback/protocol 0.6.1 → 0.7.2

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 (48) hide show
  1. package/dist/app-event.d.ts +659 -17
  2. package/dist/app-event.d.ts.map +1 -1
  3. package/dist/app-event.js +71 -8
  4. package/dist/flow-assignments.d.ts +4 -4
  5. package/dist/host/constants.d.ts +2 -2
  6. package/dist/host/constants.d.ts.map +1 -1
  7. package/dist/host/constants.js +3 -1
  8. package/dist/host/sdk-types.d.ts +73 -28
  9. package/dist/host/sdk-types.d.ts.map +1 -1
  10. package/dist/host/sdk.d.ts.map +1 -1
  11. package/dist/identity-type.d.ts +4 -2
  12. package/dist/identity-type.d.ts.map +1 -1
  13. package/dist/identity-type.js +4 -2
  14. package/dist/index.d.ts +2 -86
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +1 -6
  17. package/dist/widget-commands.d.ts +102 -3
  18. package/dist/widget-commands.d.ts.map +1 -1
  19. package/dist/widget-commands.js +5 -0
  20. package/dist/widget-config.d.ts +5 -5
  21. package/package.json +22 -2
  22. package/src/app-event.ts +211 -0
  23. package/src/client-meta.ts +25 -0
  24. package/src/defaults.ts +4 -0
  25. package/src/errors.ts +58 -0
  26. package/src/flow-assignments.test.ts +63 -0
  27. package/src/flow-assignments.ts +125 -0
  28. package/src/host/command-dispatch.ts +59 -0
  29. package/src/host/command-envelope.ts +41 -0
  30. package/src/host/command-settlement.ts +121 -0
  31. package/src/host/constants.ts +103 -0
  32. package/src/host/host-event-contract.ts +277 -0
  33. package/src/host/index.ts +13 -0
  34. package/src/host/lazy-handle-client.ts +207 -0
  35. package/src/host/request-id.ts +3 -0
  36. package/src/host/sdk-types.ts +506 -0
  37. package/src/host/sdk.ts +43 -0
  38. package/src/host/unique-id.ts +17 -0
  39. package/src/identity-type.ts +102 -0
  40. package/src/index.ts +136 -0
  41. package/src/protocol-root.test.ts +476 -0
  42. package/src/public-grant-scope.ts +25 -0
  43. package/src/runtime-endpoints.ts +69 -0
  44. package/src/scopes.ts +79 -0
  45. package/src/trpc-envelope.ts +9 -0
  46. package/src/version-resolution.ts +18 -0
  47. package/src/widget-commands.ts +152 -0
  48. package/src/widget-config.ts +157 -0
@@ -1,12 +1,15 @@
1
1
  import * as z from "zod/mini";
2
2
  export { appEventIdentityTypeSchema } from "./identity-type.js";
3
3
  export declare const appEventIdentitySchema: z.ZodMiniObject<{
4
- type: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<"anonymousId" | "userId" | "traits.email" | "traits.phone" | "context.device.id" | "context.device.advertisingId" | "context.device.token", string>>;
4
+ type: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("./identity-type.js").IdentityTypeValue, string>>;
5
5
  value: z.ZodMiniString<string>;
6
6
  }, z.core.$strip>;
7
7
  type AppEventFlagValue = string | number | boolean | null | AppEventFlagValue[] | {
8
8
  [key: string]: AppEventFlagValue;
9
9
  };
10
+ export type AppEventJsonValue = string | number | boolean | null | AppEventJsonValue[] | {
11
+ [key: string]: AppEventJsonValue;
12
+ };
10
13
  export declare const appEventFlagProviderSchema: z.ZodMiniObject<{
11
14
  name: z.ZodMiniString<string>;
12
15
  project: z.ZodMiniOptional<z.ZodMiniString<string>>;
@@ -82,7 +85,7 @@ export declare const appEventContextSchema: z.ZodMiniObject<{
82
85
  export declare const appEventBaseSchema: z.ZodMiniObject<{
83
86
  traits: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>>;
84
87
  identities: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
85
- type: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<"anonymousId" | "userId" | "traits.email" | "traits.phone" | "context.device.id" | "context.device.advertisingId" | "context.device.token", string>>;
88
+ type: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("./identity-type.js").IdentityTypeValue, string>>;
86
89
  value: z.ZodMiniString<string>;
87
90
  }, z.core.$strip>>>;
88
91
  context: z.ZodMiniOptional<z.ZodMiniObject<{
@@ -126,10 +129,11 @@ export declare const appEventBaseSchema: z.ZodMiniObject<{
126
129
  messageId: z.ZodMiniOptional<z.ZodMiniString<string>>;
127
130
  timestamp: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
128
131
  }, z.core.$strip>;
129
- export declare const appEventSurveyViewedSchema: z.ZodMiniObject<{
132
+ export declare const reservedSystemAppEventNames: readonly ["Response Submitted", "Flow Viewed", "Flow Dismissed", "Identified"];
133
+ export declare const appEventSystemBaseSchema: z.ZodMiniObject<{
130
134
  traits: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>>;
131
135
  identities: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
132
- type: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<"anonymousId" | "userId" | "traits.email" | "traits.phone" | "context.device.id" | "context.device.advertisingId" | "context.device.token", string>>;
136
+ type: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("./identity-type.js").IdentityTypeValue, string>>;
133
137
  value: z.ZodMiniString<string>;
134
138
  }, z.core.$strip>>>;
135
139
  context: z.ZodMiniOptional<z.ZodMiniObject<{
@@ -172,15 +176,158 @@ export declare const appEventSurveyViewedSchema: z.ZodMiniObject<{
172
176
  }, z.core.$strip>>;
173
177
  messageId: z.ZodMiniOptional<z.ZodMiniString<string>>;
174
178
  timestamp: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
179
+ origin: z.ZodMiniLiteral<"system">;
180
+ }, z.core.$strip>;
181
+ export declare const appEventSurveyViewedSchema: z.ZodMiniPipe<z.ZodMiniObject<{
182
+ traits: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>>;
183
+ identities: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
184
+ type: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("./identity-type.js").IdentityTypeValue, string>>;
185
+ value: z.ZodMiniString<string>;
186
+ }, z.core.$strip>>>;
187
+ context: z.ZodMiniOptional<z.ZodMiniObject<{
188
+ page: z.ZodMiniOptional<z.ZodMiniObject<{
189
+ path: z.ZodMiniOptional<z.ZodMiniString<string>>;
190
+ referrer: z.ZodMiniOptional<z.ZodMiniString<string>>;
191
+ search: z.ZodMiniOptional<z.ZodMiniString<string>>;
192
+ }, z.core.$strip>>;
193
+ locale: z.ZodMiniOptional<z.ZodMiniString<string>>;
194
+ userAgent: z.ZodMiniOptional<z.ZodMiniString<string>>;
195
+ flags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
196
+ key: z.ZodMiniString<string>;
197
+ target: z.ZodMiniOptional<z.ZodMiniString<string>>;
198
+ value: z.ZodMiniType<AppEventFlagValue, unknown, z.core.$ZodTypeInternals<AppEventFlagValue, unknown>>;
199
+ variant: z.ZodMiniOptional<z.ZodMiniString<string>>;
200
+ origin: z.ZodMiniOptional<z.ZodMiniEnum<{
201
+ runtime_config: "runtime_config";
202
+ trigger_context: "trigger_context";
203
+ provider_sync: "provider_sync";
204
+ api: "api";
205
+ }>>;
206
+ provider: z.ZodMiniOptional<z.ZodMiniObject<{
207
+ name: z.ZodMiniString<string>;
208
+ project: z.ZodMiniOptional<z.ZodMiniString<string>>;
209
+ environment: z.ZodMiniOptional<z.ZodMiniString<string>>;
210
+ }, z.core.$strip>>;
211
+ status: z.ZodMiniOptional<z.ZodMiniString<string>>;
212
+ reason: z.ZodMiniOptional<z.ZodMiniString<string>>;
213
+ evaluatedAt: z.ZodMiniOptional<z.ZodMiniString<string>>;
214
+ }, z.core.$strip>>>;
215
+ capabilities: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
216
+ key: z.ZodMiniString<string>;
217
+ source: z.ZodMiniOptional<z.ZodMiniString<string>>;
218
+ provider: z.ZodMiniOptional<z.ZodMiniObject<{
219
+ name: z.ZodMiniString<string>;
220
+ project: z.ZodMiniOptional<z.ZodMiniString<string>>;
221
+ environment: z.ZodMiniOptional<z.ZodMiniString<string>>;
222
+ }, z.core.$strip>>;
223
+ }, z.core.$strip>>>;
224
+ }, z.core.$strip>>;
225
+ messageId: z.ZodMiniOptional<z.ZodMiniString<string>>;
226
+ timestamp: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
227
+ origin: z.ZodMiniOptional<z.ZodMiniLiteral<"system">>;
175
228
  event: z.ZodMiniLiteral<"Flow Viewed">;
176
229
  references: z.ZodMiniObject<{
177
230
  surveyId: z.ZodMiniString<string>;
178
231
  }, z.core.$strip>;
179
- }, z.core.$strip>;
180
- export declare const appEventFlowDismissedSchema: z.ZodMiniObject<{
232
+ }, z.core.$strip>, z.ZodMiniTransform<Omit<{
233
+ event: "Flow Viewed";
234
+ references: {
235
+ surveyId: string;
236
+ };
237
+ traits?: Record<string, unknown> | undefined;
238
+ identities?: {
239
+ type: import("./identity-type.js").IdentityTypeValue;
240
+ value: string;
241
+ }[] | undefined;
242
+ context?: {
243
+ page?: {
244
+ path?: string | undefined;
245
+ referrer?: string | undefined;
246
+ search?: string | undefined;
247
+ } | undefined;
248
+ locale?: string | undefined;
249
+ userAgent?: string | undefined;
250
+ flags?: {
251
+ key: string;
252
+ value: AppEventFlagValue;
253
+ target?: string | undefined;
254
+ variant?: string | undefined;
255
+ origin?: "runtime_config" | "trigger_context" | "provider_sync" | "api" | undefined;
256
+ provider?: {
257
+ name: string;
258
+ project?: string | undefined;
259
+ environment?: string | undefined;
260
+ } | undefined;
261
+ status?: string | undefined;
262
+ reason?: string | undefined;
263
+ evaluatedAt?: string | undefined;
264
+ }[] | undefined;
265
+ capabilities?: {
266
+ key: string;
267
+ source?: string | undefined;
268
+ provider?: {
269
+ name: string;
270
+ project?: string | undefined;
271
+ environment?: string | undefined;
272
+ } | undefined;
273
+ }[] | undefined;
274
+ } | undefined;
275
+ messageId?: string | undefined;
276
+ timestamp?: number | undefined;
277
+ origin?: "system" | undefined;
278
+ }, "origin"> & {
279
+ origin: "system";
280
+ }, {
281
+ event: "Flow Viewed";
282
+ references: {
283
+ surveyId: string;
284
+ };
285
+ traits?: Record<string, unknown> | undefined;
286
+ identities?: {
287
+ type: import("./identity-type.js").IdentityTypeValue;
288
+ value: string;
289
+ }[] | undefined;
290
+ context?: {
291
+ page?: {
292
+ path?: string | undefined;
293
+ referrer?: string | undefined;
294
+ search?: string | undefined;
295
+ } | undefined;
296
+ locale?: string | undefined;
297
+ userAgent?: string | undefined;
298
+ flags?: {
299
+ key: string;
300
+ value: AppEventFlagValue;
301
+ target?: string | undefined;
302
+ variant?: string | undefined;
303
+ origin?: "runtime_config" | "trigger_context" | "provider_sync" | "api" | undefined;
304
+ provider?: {
305
+ name: string;
306
+ project?: string | undefined;
307
+ environment?: string | undefined;
308
+ } | undefined;
309
+ status?: string | undefined;
310
+ reason?: string | undefined;
311
+ evaluatedAt?: string | undefined;
312
+ }[] | undefined;
313
+ capabilities?: {
314
+ key: string;
315
+ source?: string | undefined;
316
+ provider?: {
317
+ name: string;
318
+ project?: string | undefined;
319
+ environment?: string | undefined;
320
+ } | undefined;
321
+ }[] | undefined;
322
+ } | undefined;
323
+ messageId?: string | undefined;
324
+ timestamp?: number | undefined;
325
+ origin?: "system" | undefined;
326
+ }>>;
327
+ export declare const appEventFlowDismissedSchema: z.ZodMiniPipe<z.ZodMiniObject<{
181
328
  traits: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>>;
182
329
  identities: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
183
- type: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<"anonymousId" | "userId" | "traits.email" | "traits.phone" | "context.device.id" | "context.device.advertisingId" | "context.device.token", string>>;
330
+ type: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("./identity-type.js").IdentityTypeValue, string>>;
184
331
  value: z.ZodMiniString<string>;
185
332
  }, z.core.$strip>>>;
186
333
  context: z.ZodMiniOptional<z.ZodMiniObject<{
@@ -223,15 +370,110 @@ export declare const appEventFlowDismissedSchema: z.ZodMiniObject<{
223
370
  }, z.core.$strip>>;
224
371
  messageId: z.ZodMiniOptional<z.ZodMiniString<string>>;
225
372
  timestamp: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
373
+ origin: z.ZodMiniOptional<z.ZodMiniLiteral<"system">>;
226
374
  event: z.ZodMiniLiteral<"Flow Dismissed">;
227
375
  references: z.ZodMiniObject<{
228
376
  surveyId: z.ZodMiniString<string>;
229
377
  }, z.core.$strip>;
230
- }, z.core.$strip>;
231
- export declare const appEventTrackSchema: z.ZodMiniObject<{
378
+ }, z.core.$strip>, z.ZodMiniTransform<Omit<{
379
+ event: "Flow Dismissed";
380
+ references: {
381
+ surveyId: string;
382
+ };
383
+ traits?: Record<string, unknown> | undefined;
384
+ identities?: {
385
+ type: import("./identity-type.js").IdentityTypeValue;
386
+ value: string;
387
+ }[] | undefined;
388
+ context?: {
389
+ page?: {
390
+ path?: string | undefined;
391
+ referrer?: string | undefined;
392
+ search?: string | undefined;
393
+ } | undefined;
394
+ locale?: string | undefined;
395
+ userAgent?: string | undefined;
396
+ flags?: {
397
+ key: string;
398
+ value: AppEventFlagValue;
399
+ target?: string | undefined;
400
+ variant?: string | undefined;
401
+ origin?: "runtime_config" | "trigger_context" | "provider_sync" | "api" | undefined;
402
+ provider?: {
403
+ name: string;
404
+ project?: string | undefined;
405
+ environment?: string | undefined;
406
+ } | undefined;
407
+ status?: string | undefined;
408
+ reason?: string | undefined;
409
+ evaluatedAt?: string | undefined;
410
+ }[] | undefined;
411
+ capabilities?: {
412
+ key: string;
413
+ source?: string | undefined;
414
+ provider?: {
415
+ name: string;
416
+ project?: string | undefined;
417
+ environment?: string | undefined;
418
+ } | undefined;
419
+ }[] | undefined;
420
+ } | undefined;
421
+ messageId?: string | undefined;
422
+ timestamp?: number | undefined;
423
+ origin?: "system" | undefined;
424
+ }, "origin"> & {
425
+ origin: "system";
426
+ }, {
427
+ event: "Flow Dismissed";
428
+ references: {
429
+ surveyId: string;
430
+ };
431
+ traits?: Record<string, unknown> | undefined;
432
+ identities?: {
433
+ type: import("./identity-type.js").IdentityTypeValue;
434
+ value: string;
435
+ }[] | undefined;
436
+ context?: {
437
+ page?: {
438
+ path?: string | undefined;
439
+ referrer?: string | undefined;
440
+ search?: string | undefined;
441
+ } | undefined;
442
+ locale?: string | undefined;
443
+ userAgent?: string | undefined;
444
+ flags?: {
445
+ key: string;
446
+ value: AppEventFlagValue;
447
+ target?: string | undefined;
448
+ variant?: string | undefined;
449
+ origin?: "runtime_config" | "trigger_context" | "provider_sync" | "api" | undefined;
450
+ provider?: {
451
+ name: string;
452
+ project?: string | undefined;
453
+ environment?: string | undefined;
454
+ } | undefined;
455
+ status?: string | undefined;
456
+ reason?: string | undefined;
457
+ evaluatedAt?: string | undefined;
458
+ }[] | undefined;
459
+ capabilities?: {
460
+ key: string;
461
+ source?: string | undefined;
462
+ provider?: {
463
+ name: string;
464
+ project?: string | undefined;
465
+ environment?: string | undefined;
466
+ } | undefined;
467
+ }[] | undefined;
468
+ } | undefined;
469
+ messageId?: string | undefined;
470
+ timestamp?: number | undefined;
471
+ origin?: "system" | undefined;
472
+ }>>;
473
+ export declare const appEventSystemTrackSchema: z.ZodMiniObject<{
232
474
  traits: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>>;
233
475
  identities: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
234
- type: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<"anonymousId" | "userId" | "traits.email" | "traits.phone" | "context.device.id" | "context.device.advertisingId" | "context.device.token", string>>;
476
+ type: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("./identity-type.js").IdentityTypeValue, string>>;
235
477
  value: z.ZodMiniString<string>;
236
478
  }, z.core.$strip>>>;
237
479
  context: z.ZodMiniOptional<z.ZodMiniObject<{
@@ -274,6 +516,7 @@ export declare const appEventTrackSchema: z.ZodMiniObject<{
274
516
  }, z.core.$strip>>;
275
517
  messageId: z.ZodMiniOptional<z.ZodMiniString<string>>;
276
518
  timestamp: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
519
+ origin: z.ZodMiniLiteral<"system">;
277
520
  event: z.ZodMiniEnum<{
278
521
  "Flow Viewed": "Flow Viewed";
279
522
  "Flow Dismissed": "Flow Dismissed";
@@ -282,10 +525,10 @@ export declare const appEventTrackSchema: z.ZodMiniObject<{
282
525
  surveyId: z.ZodMiniString<string>;
283
526
  }, z.core.$strip>;
284
527
  }, z.core.$strip>;
285
- export declare const appEventPayloadSchema: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
528
+ export declare const appEventCustomerTrackSchema: z.ZodMiniObject<{
286
529
  traits: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>>;
287
530
  identities: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
288
- type: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<"anonymousId" | "userId" | "traits.email" | "traits.phone" | "context.device.id" | "context.device.advertisingId" | "context.device.token", string>>;
531
+ type: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("./identity-type.js").IdentityTypeValue, string>>;
289
532
  value: z.ZodMiniString<string>;
290
533
  }, z.core.$strip>>>;
291
534
  context: z.ZodMiniOptional<z.ZodMiniObject<{
@@ -328,14 +571,162 @@ export declare const appEventPayloadSchema: z.ZodMiniDiscriminatedUnion<[z.ZodMi
328
571
  }, z.core.$strip>>;
329
572
  messageId: z.ZodMiniOptional<z.ZodMiniString<string>>;
330
573
  timestamp: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
331
- event: z.ZodMiniLiteral<"Flow Viewed">;
574
+ origin: z.ZodMiniLiteral<"customer">;
575
+ event: z.ZodMiniString<string>;
576
+ properties: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniType<AppEventJsonValue, unknown, z.core.$ZodTypeInternals<AppEventJsonValue, unknown>>>>;
577
+ }, z.core.$strip>;
578
+ export declare const appEventTrackSchema: z.ZodMiniUnion<readonly [z.ZodMiniPipe<z.ZodMiniObject<{
579
+ traits: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>>;
580
+ identities: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
581
+ type: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("./identity-type.js").IdentityTypeValue, string>>;
582
+ value: z.ZodMiniString<string>;
583
+ }, z.core.$strip>>>;
584
+ context: z.ZodMiniOptional<z.ZodMiniObject<{
585
+ page: z.ZodMiniOptional<z.ZodMiniObject<{
586
+ path: z.ZodMiniOptional<z.ZodMiniString<string>>;
587
+ referrer: z.ZodMiniOptional<z.ZodMiniString<string>>;
588
+ search: z.ZodMiniOptional<z.ZodMiniString<string>>;
589
+ }, z.core.$strip>>;
590
+ locale: z.ZodMiniOptional<z.ZodMiniString<string>>;
591
+ userAgent: z.ZodMiniOptional<z.ZodMiniString<string>>;
592
+ flags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
593
+ key: z.ZodMiniString<string>;
594
+ target: z.ZodMiniOptional<z.ZodMiniString<string>>;
595
+ value: z.ZodMiniType<AppEventFlagValue, unknown, z.core.$ZodTypeInternals<AppEventFlagValue, unknown>>;
596
+ variant: z.ZodMiniOptional<z.ZodMiniString<string>>;
597
+ origin: z.ZodMiniOptional<z.ZodMiniEnum<{
598
+ runtime_config: "runtime_config";
599
+ trigger_context: "trigger_context";
600
+ provider_sync: "provider_sync";
601
+ api: "api";
602
+ }>>;
603
+ provider: z.ZodMiniOptional<z.ZodMiniObject<{
604
+ name: z.ZodMiniString<string>;
605
+ project: z.ZodMiniOptional<z.ZodMiniString<string>>;
606
+ environment: z.ZodMiniOptional<z.ZodMiniString<string>>;
607
+ }, z.core.$strip>>;
608
+ status: z.ZodMiniOptional<z.ZodMiniString<string>>;
609
+ reason: z.ZodMiniOptional<z.ZodMiniString<string>>;
610
+ evaluatedAt: z.ZodMiniOptional<z.ZodMiniString<string>>;
611
+ }, z.core.$strip>>>;
612
+ capabilities: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
613
+ key: z.ZodMiniString<string>;
614
+ source: z.ZodMiniOptional<z.ZodMiniString<string>>;
615
+ provider: z.ZodMiniOptional<z.ZodMiniObject<{
616
+ name: z.ZodMiniString<string>;
617
+ project: z.ZodMiniOptional<z.ZodMiniString<string>>;
618
+ environment: z.ZodMiniOptional<z.ZodMiniString<string>>;
619
+ }, z.core.$strip>>;
620
+ }, z.core.$strip>>>;
621
+ }, z.core.$strip>>;
622
+ messageId: z.ZodMiniOptional<z.ZodMiniString<string>>;
623
+ timestamp: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
624
+ origin: z.ZodMiniOptional<z.ZodMiniLiteral<"system">>;
625
+ event: z.ZodMiniEnum<{
626
+ "Flow Viewed": "Flow Viewed";
627
+ "Flow Dismissed": "Flow Dismissed";
628
+ }>;
332
629
  references: z.ZodMiniObject<{
333
630
  surveyId: z.ZodMiniString<string>;
334
631
  }, z.core.$strip>;
335
- }, z.core.$strip>, z.ZodMiniObject<{
632
+ }, z.core.$strip>, z.ZodMiniTransform<Omit<{
633
+ event: "Flow Viewed" | "Flow Dismissed";
634
+ references: {
635
+ surveyId: string;
636
+ };
637
+ traits?: Record<string, unknown> | undefined;
638
+ identities?: {
639
+ type: import("./identity-type.js").IdentityTypeValue;
640
+ value: string;
641
+ }[] | undefined;
642
+ context?: {
643
+ page?: {
644
+ path?: string | undefined;
645
+ referrer?: string | undefined;
646
+ search?: string | undefined;
647
+ } | undefined;
648
+ locale?: string | undefined;
649
+ userAgent?: string | undefined;
650
+ flags?: {
651
+ key: string;
652
+ value: AppEventFlagValue;
653
+ target?: string | undefined;
654
+ variant?: string | undefined;
655
+ origin?: "runtime_config" | "trigger_context" | "provider_sync" | "api" | undefined;
656
+ provider?: {
657
+ name: string;
658
+ project?: string | undefined;
659
+ environment?: string | undefined;
660
+ } | undefined;
661
+ status?: string | undefined;
662
+ reason?: string | undefined;
663
+ evaluatedAt?: string | undefined;
664
+ }[] | undefined;
665
+ capabilities?: {
666
+ key: string;
667
+ source?: string | undefined;
668
+ provider?: {
669
+ name: string;
670
+ project?: string | undefined;
671
+ environment?: string | undefined;
672
+ } | undefined;
673
+ }[] | undefined;
674
+ } | undefined;
675
+ messageId?: string | undefined;
676
+ timestamp?: number | undefined;
677
+ origin?: "system" | undefined;
678
+ }, "origin"> & {
679
+ origin: "system";
680
+ }, {
681
+ event: "Flow Viewed" | "Flow Dismissed";
682
+ references: {
683
+ surveyId: string;
684
+ };
685
+ traits?: Record<string, unknown> | undefined;
686
+ identities?: {
687
+ type: import("./identity-type.js").IdentityTypeValue;
688
+ value: string;
689
+ }[] | undefined;
690
+ context?: {
691
+ page?: {
692
+ path?: string | undefined;
693
+ referrer?: string | undefined;
694
+ search?: string | undefined;
695
+ } | undefined;
696
+ locale?: string | undefined;
697
+ userAgent?: string | undefined;
698
+ flags?: {
699
+ key: string;
700
+ value: AppEventFlagValue;
701
+ target?: string | undefined;
702
+ variant?: string | undefined;
703
+ origin?: "runtime_config" | "trigger_context" | "provider_sync" | "api" | undefined;
704
+ provider?: {
705
+ name: string;
706
+ project?: string | undefined;
707
+ environment?: string | undefined;
708
+ } | undefined;
709
+ status?: string | undefined;
710
+ reason?: string | undefined;
711
+ evaluatedAt?: string | undefined;
712
+ }[] | undefined;
713
+ capabilities?: {
714
+ key: string;
715
+ source?: string | undefined;
716
+ provider?: {
717
+ name: string;
718
+ project?: string | undefined;
719
+ environment?: string | undefined;
720
+ } | undefined;
721
+ }[] | undefined;
722
+ } | undefined;
723
+ messageId?: string | undefined;
724
+ timestamp?: number | undefined;
725
+ origin?: "system" | undefined;
726
+ }>>, z.ZodMiniObject<{
336
727
  traits: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>>;
337
728
  identities: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
338
- type: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<"anonymousId" | "userId" | "traits.email" | "traits.phone" | "context.device.id" | "context.device.advertisingId" | "context.device.token", string>>;
729
+ type: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("./identity-type.js").IdentityTypeValue, string>>;
339
730
  value: z.ZodMiniString<string>;
340
731
  }, z.core.$strip>>>;
341
732
  context: z.ZodMiniOptional<z.ZodMiniObject<{
@@ -378,11 +769,262 @@ export declare const appEventPayloadSchema: z.ZodMiniDiscriminatedUnion<[z.ZodMi
378
769
  }, z.core.$strip>>;
379
770
  messageId: z.ZodMiniOptional<z.ZodMiniString<string>>;
380
771
  timestamp: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
381
- event: z.ZodMiniLiteral<"Flow Dismissed">;
772
+ origin: z.ZodMiniLiteral<"customer">;
773
+ event: z.ZodMiniString<string>;
774
+ properties: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniType<AppEventJsonValue, unknown, z.core.$ZodTypeInternals<AppEventJsonValue, unknown>>>>;
775
+ }, z.core.$strip>]>;
776
+ export declare const appEventPayloadSchema: z.ZodMiniUnion<readonly [z.ZodMiniPipe<z.ZodMiniObject<{
777
+ traits: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>>;
778
+ identities: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
779
+ type: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("./identity-type.js").IdentityTypeValue, string>>;
780
+ value: z.ZodMiniString<string>;
781
+ }, z.core.$strip>>>;
782
+ context: z.ZodMiniOptional<z.ZodMiniObject<{
783
+ page: z.ZodMiniOptional<z.ZodMiniObject<{
784
+ path: z.ZodMiniOptional<z.ZodMiniString<string>>;
785
+ referrer: z.ZodMiniOptional<z.ZodMiniString<string>>;
786
+ search: z.ZodMiniOptional<z.ZodMiniString<string>>;
787
+ }, z.core.$strip>>;
788
+ locale: z.ZodMiniOptional<z.ZodMiniString<string>>;
789
+ userAgent: z.ZodMiniOptional<z.ZodMiniString<string>>;
790
+ flags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
791
+ key: z.ZodMiniString<string>;
792
+ target: z.ZodMiniOptional<z.ZodMiniString<string>>;
793
+ value: z.ZodMiniType<AppEventFlagValue, unknown, z.core.$ZodTypeInternals<AppEventFlagValue, unknown>>;
794
+ variant: z.ZodMiniOptional<z.ZodMiniString<string>>;
795
+ origin: z.ZodMiniOptional<z.ZodMiniEnum<{
796
+ runtime_config: "runtime_config";
797
+ trigger_context: "trigger_context";
798
+ provider_sync: "provider_sync";
799
+ api: "api";
800
+ }>>;
801
+ provider: z.ZodMiniOptional<z.ZodMiniObject<{
802
+ name: z.ZodMiniString<string>;
803
+ project: z.ZodMiniOptional<z.ZodMiniString<string>>;
804
+ environment: z.ZodMiniOptional<z.ZodMiniString<string>>;
805
+ }, z.core.$strip>>;
806
+ status: z.ZodMiniOptional<z.ZodMiniString<string>>;
807
+ reason: z.ZodMiniOptional<z.ZodMiniString<string>>;
808
+ evaluatedAt: z.ZodMiniOptional<z.ZodMiniString<string>>;
809
+ }, z.core.$strip>>>;
810
+ capabilities: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
811
+ key: z.ZodMiniString<string>;
812
+ source: z.ZodMiniOptional<z.ZodMiniString<string>>;
813
+ provider: z.ZodMiniOptional<z.ZodMiniObject<{
814
+ name: z.ZodMiniString<string>;
815
+ project: z.ZodMiniOptional<z.ZodMiniString<string>>;
816
+ environment: z.ZodMiniOptional<z.ZodMiniString<string>>;
817
+ }, z.core.$strip>>;
818
+ }, z.core.$strip>>>;
819
+ }, z.core.$strip>>;
820
+ messageId: z.ZodMiniOptional<z.ZodMiniString<string>>;
821
+ timestamp: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
822
+ origin: z.ZodMiniOptional<z.ZodMiniLiteral<"system">>;
823
+ event: z.ZodMiniEnum<{
824
+ "Flow Viewed": "Flow Viewed";
825
+ "Flow Dismissed": "Flow Dismissed";
826
+ }>;
827
+ references: z.ZodMiniObject<{
828
+ surveyId: z.ZodMiniString<string>;
829
+ }, z.core.$strip>;
830
+ }, z.core.$strip>, z.ZodMiniTransform<Omit<{
831
+ event: "Flow Viewed" | "Flow Dismissed";
832
+ references: {
833
+ surveyId: string;
834
+ };
835
+ traits?: Record<string, unknown> | undefined;
836
+ identities?: {
837
+ type: import("./identity-type.js").IdentityTypeValue;
838
+ value: string;
839
+ }[] | undefined;
840
+ context?: {
841
+ page?: {
842
+ path?: string | undefined;
843
+ referrer?: string | undefined;
844
+ search?: string | undefined;
845
+ } | undefined;
846
+ locale?: string | undefined;
847
+ userAgent?: string | undefined;
848
+ flags?: {
849
+ key: string;
850
+ value: AppEventFlagValue;
851
+ target?: string | undefined;
852
+ variant?: string | undefined;
853
+ origin?: "runtime_config" | "trigger_context" | "provider_sync" | "api" | undefined;
854
+ provider?: {
855
+ name: string;
856
+ project?: string | undefined;
857
+ environment?: string | undefined;
858
+ } | undefined;
859
+ status?: string | undefined;
860
+ reason?: string | undefined;
861
+ evaluatedAt?: string | undefined;
862
+ }[] | undefined;
863
+ capabilities?: {
864
+ key: string;
865
+ source?: string | undefined;
866
+ provider?: {
867
+ name: string;
868
+ project?: string | undefined;
869
+ environment?: string | undefined;
870
+ } | undefined;
871
+ }[] | undefined;
872
+ } | undefined;
873
+ messageId?: string | undefined;
874
+ timestamp?: number | undefined;
875
+ origin?: "system" | undefined;
876
+ }, "origin"> & {
877
+ origin: "system";
878
+ }, {
879
+ event: "Flow Viewed" | "Flow Dismissed";
880
+ references: {
881
+ surveyId: string;
882
+ };
883
+ traits?: Record<string, unknown> | undefined;
884
+ identities?: {
885
+ type: import("./identity-type.js").IdentityTypeValue;
886
+ value: string;
887
+ }[] | undefined;
888
+ context?: {
889
+ page?: {
890
+ path?: string | undefined;
891
+ referrer?: string | undefined;
892
+ search?: string | undefined;
893
+ } | undefined;
894
+ locale?: string | undefined;
895
+ userAgent?: string | undefined;
896
+ flags?: {
897
+ key: string;
898
+ value: AppEventFlagValue;
899
+ target?: string | undefined;
900
+ variant?: string | undefined;
901
+ origin?: "runtime_config" | "trigger_context" | "provider_sync" | "api" | undefined;
902
+ provider?: {
903
+ name: string;
904
+ project?: string | undefined;
905
+ environment?: string | undefined;
906
+ } | undefined;
907
+ status?: string | undefined;
908
+ reason?: string | undefined;
909
+ evaluatedAt?: string | undefined;
910
+ }[] | undefined;
911
+ capabilities?: {
912
+ key: string;
913
+ source?: string | undefined;
914
+ provider?: {
915
+ name: string;
916
+ project?: string | undefined;
917
+ environment?: string | undefined;
918
+ } | undefined;
919
+ }[] | undefined;
920
+ } | undefined;
921
+ messageId?: string | undefined;
922
+ timestamp?: number | undefined;
923
+ origin?: "system" | undefined;
924
+ }>>, z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
925
+ traits: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>>;
926
+ identities: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
927
+ type: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("./identity-type.js").IdentityTypeValue, string>>;
928
+ value: z.ZodMiniString<string>;
929
+ }, z.core.$strip>>>;
930
+ context: z.ZodMiniOptional<z.ZodMiniObject<{
931
+ page: z.ZodMiniOptional<z.ZodMiniObject<{
932
+ path: z.ZodMiniOptional<z.ZodMiniString<string>>;
933
+ referrer: z.ZodMiniOptional<z.ZodMiniString<string>>;
934
+ search: z.ZodMiniOptional<z.ZodMiniString<string>>;
935
+ }, z.core.$strip>>;
936
+ locale: z.ZodMiniOptional<z.ZodMiniString<string>>;
937
+ userAgent: z.ZodMiniOptional<z.ZodMiniString<string>>;
938
+ flags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
939
+ key: z.ZodMiniString<string>;
940
+ target: z.ZodMiniOptional<z.ZodMiniString<string>>;
941
+ value: z.ZodMiniType<AppEventFlagValue, unknown, z.core.$ZodTypeInternals<AppEventFlagValue, unknown>>;
942
+ variant: z.ZodMiniOptional<z.ZodMiniString<string>>;
943
+ origin: z.ZodMiniOptional<z.ZodMiniEnum<{
944
+ runtime_config: "runtime_config";
945
+ trigger_context: "trigger_context";
946
+ provider_sync: "provider_sync";
947
+ api: "api";
948
+ }>>;
949
+ provider: z.ZodMiniOptional<z.ZodMiniObject<{
950
+ name: z.ZodMiniString<string>;
951
+ project: z.ZodMiniOptional<z.ZodMiniString<string>>;
952
+ environment: z.ZodMiniOptional<z.ZodMiniString<string>>;
953
+ }, z.core.$strip>>;
954
+ status: z.ZodMiniOptional<z.ZodMiniString<string>>;
955
+ reason: z.ZodMiniOptional<z.ZodMiniString<string>>;
956
+ evaluatedAt: z.ZodMiniOptional<z.ZodMiniString<string>>;
957
+ }, z.core.$strip>>>;
958
+ capabilities: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
959
+ key: z.ZodMiniString<string>;
960
+ source: z.ZodMiniOptional<z.ZodMiniString<string>>;
961
+ provider: z.ZodMiniOptional<z.ZodMiniObject<{
962
+ name: z.ZodMiniString<string>;
963
+ project: z.ZodMiniOptional<z.ZodMiniString<string>>;
964
+ environment: z.ZodMiniOptional<z.ZodMiniString<string>>;
965
+ }, z.core.$strip>>;
966
+ }, z.core.$strip>>>;
967
+ }, z.core.$strip>>;
968
+ messageId: z.ZodMiniOptional<z.ZodMiniString<string>>;
969
+ timestamp: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
970
+ origin: z.ZodMiniLiteral<"system">;
971
+ event: z.ZodMiniEnum<{
972
+ "Flow Viewed": "Flow Viewed";
973
+ "Flow Dismissed": "Flow Dismissed";
974
+ }>;
382
975
  references: z.ZodMiniObject<{
383
976
  surveyId: z.ZodMiniString<string>;
384
977
  }, z.core.$strip>;
385
- }, z.core.$strip>], "event">;
978
+ }, z.core.$strip>, z.ZodMiniObject<{
979
+ traits: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>>;
980
+ identities: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
981
+ type: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("./identity-type.js").IdentityTypeValue, string>>;
982
+ value: z.ZodMiniString<string>;
983
+ }, z.core.$strip>>>;
984
+ context: z.ZodMiniOptional<z.ZodMiniObject<{
985
+ page: z.ZodMiniOptional<z.ZodMiniObject<{
986
+ path: z.ZodMiniOptional<z.ZodMiniString<string>>;
987
+ referrer: z.ZodMiniOptional<z.ZodMiniString<string>>;
988
+ search: z.ZodMiniOptional<z.ZodMiniString<string>>;
989
+ }, z.core.$strip>>;
990
+ locale: z.ZodMiniOptional<z.ZodMiniString<string>>;
991
+ userAgent: z.ZodMiniOptional<z.ZodMiniString<string>>;
992
+ flags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
993
+ key: z.ZodMiniString<string>;
994
+ target: z.ZodMiniOptional<z.ZodMiniString<string>>;
995
+ value: z.ZodMiniType<AppEventFlagValue, unknown, z.core.$ZodTypeInternals<AppEventFlagValue, unknown>>;
996
+ variant: z.ZodMiniOptional<z.ZodMiniString<string>>;
997
+ origin: z.ZodMiniOptional<z.ZodMiniEnum<{
998
+ runtime_config: "runtime_config";
999
+ trigger_context: "trigger_context";
1000
+ provider_sync: "provider_sync";
1001
+ api: "api";
1002
+ }>>;
1003
+ provider: z.ZodMiniOptional<z.ZodMiniObject<{
1004
+ name: z.ZodMiniString<string>;
1005
+ project: z.ZodMiniOptional<z.ZodMiniString<string>>;
1006
+ environment: z.ZodMiniOptional<z.ZodMiniString<string>>;
1007
+ }, z.core.$strip>>;
1008
+ status: z.ZodMiniOptional<z.ZodMiniString<string>>;
1009
+ reason: z.ZodMiniOptional<z.ZodMiniString<string>>;
1010
+ evaluatedAt: z.ZodMiniOptional<z.ZodMiniString<string>>;
1011
+ }, z.core.$strip>>>;
1012
+ capabilities: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
1013
+ key: z.ZodMiniString<string>;
1014
+ source: z.ZodMiniOptional<z.ZodMiniString<string>>;
1015
+ provider: z.ZodMiniOptional<z.ZodMiniObject<{
1016
+ name: z.ZodMiniString<string>;
1017
+ project: z.ZodMiniOptional<z.ZodMiniString<string>>;
1018
+ environment: z.ZodMiniOptional<z.ZodMiniString<string>>;
1019
+ }, z.core.$strip>>;
1020
+ }, z.core.$strip>>>;
1021
+ }, z.core.$strip>>;
1022
+ messageId: z.ZodMiniOptional<z.ZodMiniString<string>>;
1023
+ timestamp: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
1024
+ origin: z.ZodMiniLiteral<"customer">;
1025
+ event: z.ZodMiniString<string>;
1026
+ properties: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniType<AppEventJsonValue, unknown, z.core.$ZodTypeInternals<AppEventJsonValue, unknown>>>>;
1027
+ }, z.core.$strip>], "origin">]>;
386
1028
  export type AppEventTrackInput = z.output<typeof appEventTrackSchema>;
387
1029
  export type AppEventPayload = z.output<typeof appEventPayloadSchema>;
388
1030
  export type AppEventFlag = z.output<typeof appEventFlagSchema>;