@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
package/dist/index.d.ts CHANGED
@@ -1,11 +1,10 @@
1
- import { type AppEventCapability as AppEventCapabilityAlias, type AppEventFlag as AppEventFlagAlias } from "./app-event.js";
2
- export { type AppEventCapability, type AppEventFlag, type AppEventPayload, type AppEventTrackInput, appEventBaseSchema, appEventCapabilitySchema, appEventContextSchema, appEventFlagProviderSchema, appEventFlagSchema, appEventFlowDismissedSchema, appEventIdentitySchema, appEventIdentityTypeSchema, appEventPayloadSchema, appEventSurveyViewedSchema, appEventTrackSchema, } from "./app-event.js";
1
+ export { type AppEventCapability, type AppEventFlag, type AppEventJsonValue, type AppEventPayload, type AppEventTrackInput, appEventBaseSchema, appEventCapabilitySchema, appEventContextSchema, appEventCustomerTrackSchema, appEventFlagProviderSchema, appEventFlagSchema, appEventFlowDismissedSchema, appEventIdentitySchema, appEventIdentityTypeSchema, appEventPayloadSchema, appEventSurveyViewedSchema, appEventSystemBaseSchema, appEventSystemTrackSchema, appEventTrackSchema, reservedSystemAppEventNames, } from "./app-event.js";
3
2
  export { type ClientMeta, clientMetaSchema, } from "./client-meta.js";
4
3
  export { DEFAULT_AUTO_DETECT_COLOR_SCHEME_ATTRS } from "./defaults.js";
5
4
  export type { ErrorEvent, ProtocolErrorCode } from "./errors.js";
6
5
  export { ErrorCategory, ErrorCategorySchema, ErrorEventSchema, ProtocolError, } from "./errors.js";
7
6
  export { type ClaimPendingFlowAssignmentsRequest, type ClaimPendingFlowAssignmentsResponse, claimPendingFlowAssignmentsRequestSchema, claimPendingFlowAssignmentsResponseSchema, type FlowAssignmentRecipientRequest, type FlowAssignmentRecord, type FlowAssignmentStatus, type FlowAssignmentTargetingContext, flowAssignmentRecipientRequestSchema, flowAssignmentRecordSchema, flowAssignmentStatusSchema, flowAssignmentTargetingContextSchema, type ListPendingFlowAssignmentsResponse, listPendingFlowAssignmentsResponseSchema, nullableUpdateFlowAssignmentLifecycleResponseSchema, type ReleaseFlowAssignmentClaimRequest, type ReleaseFlowAssignmentClaimResponse, releaseFlowAssignmentClaimRequestSchema, releaseFlowAssignmentClaimResponseSchema, type UpdateFlowAssignmentLifecycleRequest, type UpdateFlowAssignmentLifecycleResponse, updateFlowAssignmentLifecycleRequestSchema, updateFlowAssignmentLifecycleResponseSchema, } from "./flow-assignments.js";
8
- export { buildIdentityTypeGuidanceMessage, getIdentityTypeSuggestion, IDENTITY_TYPE_VALUES, type IdentityTypeValue, isIdentityTypeValue, } from "./identity-type.js";
7
+ export { buildIdentityTypeGuidanceMessage, type CustomIdentityTypeValue, getIdentityTypeSuggestion, IDENTITY_TYPE_VALUES, type IdentityTypeValue, isIdentityTypeValue, type StandardIdentityTypeValue, } from "./identity-type.js";
9
8
  export { isPublicGrantScope, type PublicGrantScope, publicGrantScopeIdSchema, } from "./public-grant-scope.js";
10
9
  export { type RuntimeEndpoints, resolveApiBaseUrl, resolveCoreUrl, resolveTrpcBaseUrl, runtimeEndpointsSchema, } from "./runtime-endpoints.js";
11
10
  export { getScopeMeta, isScope, listScopes, SCOPE_IDS, type Scope, scopeIdSchema, } from "./scopes.js";
@@ -13,87 +12,4 @@ export { type TrpcSuccessResponse, trpcSuccessResponseSchema, } from "./trpc-env
13
12
  export { type FlowVersionResolution, flowVersionResolutionSchema, type ThemeVersionResolution, themeVersionResolutionSchema, } from "./version-resolution.js";
14
13
  export { type PublicCommandPayload, parseConfigureOptions, parseInitOptions, parsePublicCommand, publicCommandPayloadSchema, publicWidgetCommandKindSchema, } from "./widget-commands.js";
15
14
  export { type AuthConfigInput, type AuthJwtConfigInput, authConfigInputSchema, authJwtConfigInputSchema, type ColorSchemeConfigInput, type ConfigureOptions, type ConsentConfigInput, type CoreInstanceConfig, type CoreInstanceConfigInput, colorSchemeConfigInputSchema, configureOptionsSchema, consentConfigInputSchema, coreInstanceConfigSchema, type DebugConfigInput, debugInputSchema, type FlagsConfigInput, flagsConfigInputSchema, type HostCapabilitiesConfigInput, hostCapabilitiesConfigInputSchema, type IdentityConfigInput, INSTANCE_CONFIG_UPDATE_KEYS, type InitOptions, type InstanceUpdateableConfig, identityConfigInputSchema, initOptionsSchema, instanceUpdateableConfigSchema, type TelemetryConfigInput, telemetryConfigInputSchema, } from "./widget-config.js";
16
- /** @deprecated Prefer {@link AppEventFlag}; legacy name from root protocol surface. */
17
- export type FeatureFlagConfigInput = AppEventFlagAlias;
18
- /** @deprecated Prefer {@link appEventFlagSchema}; legacy name from root protocol surface. */
19
- export declare const featureFlagConfigInputSchema: import("zod/mini").ZodMiniObject<{
20
- key: import("zod/mini").ZodMiniString<string>;
21
- target: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniString<string>>;
22
- value: import("zod/mini").ZodMiniType<string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | {
23
- [key: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
24
- } | null)[] | {
25
- [key: string]: string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null;
26
- } | null)[] | {
27
- [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
28
- } | null)[] | {
29
- [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
30
- } | null)[] | {
31
- [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
32
- } | null)[] | {
33
- [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
34
- } | null)[] | {
35
- [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
36
- } | null)[] | {
37
- [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
38
- } | null)[] | {
39
- [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
40
- } | null)[] | {
41
- [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
42
- } | null)[] | {
43
- [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
44
- } | null)[] | {
45
- [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
46
- } | null, unknown, import("zod/v4/core").$ZodTypeInternals<string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | {
47
- [key: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
48
- } | null)[] | {
49
- [key: string]: string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null;
50
- } | null)[] | {
51
- [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
52
- } | null)[] | {
53
- [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
54
- } | null)[] | {
55
- [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
56
- } | null)[] | {
57
- [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
58
- } | null)[] | {
59
- [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
60
- } | null)[] | {
61
- [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
62
- } | null)[] | {
63
- [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
64
- } | null)[] | {
65
- [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
66
- } | null)[] | {
67
- [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
68
- } | null)[] | {
69
- [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
70
- } | null, unknown>>;
71
- variant: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniString<string>>;
72
- origin: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniEnum<{
73
- runtime_config: "runtime_config";
74
- trigger_context: "trigger_context";
75
- provider_sync: "provider_sync";
76
- api: "api";
77
- }>>;
78
- provider: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniObject<{
79
- name: import("zod/mini").ZodMiniString<string>;
80
- project: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniString<string>>;
81
- environment: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniString<string>>;
82
- }, import("zod/v4/core").$strip>>;
83
- status: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniString<string>>;
84
- reason: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniString<string>>;
85
- evaluatedAt: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniString<string>>;
86
- }, import("zod/v4/core").$strip>;
87
- /** @deprecated Prefer {@link AppEventCapability}; legacy name from root protocol surface. */
88
- export type RuntimeCapabilityConfigInput = AppEventCapabilityAlias;
89
- /** @deprecated Prefer {@link appEventCapabilitySchema}; legacy name from root protocol surface. */
90
- export declare const runtimeCapabilityConfigInputSchema: import("zod/mini").ZodMiniObject<{
91
- key: import("zod/mini").ZodMiniString<string>;
92
- source: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniString<string>>;
93
- provider: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniObject<{
94
- name: import("zod/mini").ZodMiniString<string>;
95
- project: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniString<string>>;
96
- environment: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniString<string>>;
97
- }, import("zod/v4/core").$strip>>;
98
- }, import("zod/v4/core").$strip>;
99
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,kBAAkB,IAAI,uBAAuB,EAClD,KAAK,YAAY,IAAI,iBAAiB,EAGtC,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EAC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MAAM,oBAAoB,CAAC"}
package/dist/index.js CHANGED
@@ -1,5 +1,4 @@
1
- import { appEventCapabilitySchema as appEventCapabilitySchemaAlias, appEventFlagSchema as appEventFlagSchemaAlias, } from "./app-event.js";
2
- export { appEventBaseSchema, appEventCapabilitySchema, appEventContextSchema, appEventFlagProviderSchema, appEventFlagSchema, appEventFlowDismissedSchema, appEventIdentitySchema, appEventIdentityTypeSchema, appEventPayloadSchema, appEventSurveyViewedSchema, appEventTrackSchema, } from "./app-event.js";
1
+ export { appEventBaseSchema, appEventCapabilitySchema, appEventContextSchema, appEventCustomerTrackSchema, appEventFlagProviderSchema, appEventFlagSchema, appEventFlowDismissedSchema, appEventIdentitySchema, appEventIdentityTypeSchema, appEventPayloadSchema, appEventSurveyViewedSchema, appEventSystemBaseSchema, appEventSystemTrackSchema, appEventTrackSchema, reservedSystemAppEventNames, } from "./app-event.js";
3
2
  export { clientMetaSchema, } from "./client-meta.js";
4
3
  export { DEFAULT_AUTO_DETECT_COLOR_SCHEME_ATTRS } from "./defaults.js";
5
4
  export { ErrorCategory, ErrorCategorySchema, ErrorEventSchema, ProtocolError, } from "./errors.js";
@@ -12,7 +11,3 @@ export { trpcSuccessResponseSchema, } from "./trpc-envelope.js";
12
11
  export { flowVersionResolutionSchema, themeVersionResolutionSchema, } from "./version-resolution.js";
13
12
  export { parseConfigureOptions, parseInitOptions, parsePublicCommand, publicCommandPayloadSchema, publicWidgetCommandKindSchema, } from "./widget-commands.js";
14
13
  export { authConfigInputSchema, authJwtConfigInputSchema, colorSchemeConfigInputSchema, configureOptionsSchema, consentConfigInputSchema, coreInstanceConfigSchema, debugInputSchema, flagsConfigInputSchema, hostCapabilitiesConfigInputSchema, INSTANCE_CONFIG_UPDATE_KEYS, identityConfigInputSchema, initOptionsSchema, instanceUpdateableConfigSchema, telemetryConfigInputSchema, } from "./widget-config.js";
15
- /** @deprecated Prefer {@link appEventFlagSchema}; legacy name from root protocol surface. */
16
- export const featureFlagConfigInputSchema = appEventFlagSchemaAlias;
17
- /** @deprecated Prefer {@link appEventCapabilitySchema}; legacy name from root protocol surface. */
18
- export const runtimeCapabilityConfigInputSchema = appEventCapabilitySchemaAlias;
@@ -11,6 +11,7 @@ export declare const publicWidgetCommandKindSchema: z.ZodMiniEnum<{
11
11
  init: "init";
12
12
  close: "close";
13
13
  reset: "reset";
14
+ track: "track";
14
15
  }>;
15
16
  export declare const containerPolicySchema: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
16
17
  kind: z.ZodMiniLiteral<"floating">;
@@ -76,9 +77,9 @@ export declare const publicCommandPayloadSchema: z.ZodMiniUnion<readonly [z.ZodM
76
77
  colorScheme: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
77
78
  autoDetectColorScheme: z.ZodMiniArray<z.ZodMiniString<string>>;
78
79
  }, z.core.$strict>, z.ZodMiniEnum<{
80
+ system: "system";
79
81
  light: "light";
80
82
  dark: "dark";
81
- system: "system";
82
83
  }>]>>;
83
84
  consent: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniEnum<{
84
85
  pending: "pending";
@@ -108,9 +109,9 @@ export declare const publicCommandPayloadSchema: z.ZodMiniUnion<readonly [z.ZodM
108
109
  colorScheme: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
109
110
  autoDetectColorScheme: z.ZodMiniArray<z.ZodMiniString<string>>;
110
111
  }, z.core.$strict>, z.ZodMiniEnum<{
112
+ system: "system";
111
113
  light: "light";
112
114
  dark: "dark";
113
- system: "system";
114
115
  }>]>>;
115
116
  disableTelemetry: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
116
117
  enableDebug: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -253,7 +254,105 @@ export declare const publicCommandPayloadSchema: z.ZodMiniUnion<readonly [z.ZodM
253
254
  flowHandleId: z.ZodMiniOptional<z.ZodMiniString<string>>;
254
255
  }, z.core.$strict>, z.ZodMiniObject<{
255
256
  kind: z.ZodMiniLiteral<"reset">;
256
- }, z.core.$strict>], "kind">, z.ZodMiniUnion<readonly [z.ZodMiniObject<{
257
+ }, z.core.$strict>, z.ZodMiniObject<{
258
+ traits: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>>;
259
+ identities: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
260
+ type: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("./identity-type.js").IdentityTypeValue, string>>;
261
+ value: z.ZodMiniString<string>;
262
+ }, z.core.$strip>>>;
263
+ context: z.ZodMiniOptional<z.ZodMiniObject<{
264
+ page: z.ZodMiniOptional<z.ZodMiniObject<{
265
+ path: z.ZodMiniOptional<z.ZodMiniString<string>>;
266
+ referrer: z.ZodMiniOptional<z.ZodMiniString<string>>;
267
+ search: z.ZodMiniOptional<z.ZodMiniString<string>>;
268
+ }, z.core.$strip>>;
269
+ locale: z.ZodMiniOptional<z.ZodMiniString<string>>;
270
+ userAgent: z.ZodMiniOptional<z.ZodMiniString<string>>;
271
+ flags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
272
+ key: z.ZodMiniString<string>;
273
+ target: z.ZodMiniOptional<z.ZodMiniString<string>>;
274
+ value: z.ZodMiniType<string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | {
275
+ [key: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
276
+ } | null)[] | {
277
+ [key: string]: string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null;
278
+ } | null)[] | {
279
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
280
+ } | null)[] | {
281
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
282
+ } | null)[] | {
283
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
284
+ } | null)[] | {
285
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
286
+ } | null)[] | {
287
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
288
+ } | null)[] | {
289
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
290
+ } | null)[] | {
291
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
292
+ } | null)[] | {
293
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
294
+ } | null)[] | {
295
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
296
+ } | null)[] | {
297
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
298
+ } | null, unknown, z.core.$ZodTypeInternals<string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | {
299
+ [key: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
300
+ } | null)[] | {
301
+ [key: string]: string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null;
302
+ } | null)[] | {
303
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
304
+ } | null)[] | {
305
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
306
+ } | null)[] | {
307
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
308
+ } | null)[] | {
309
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
310
+ } | null)[] | {
311
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
312
+ } | null)[] | {
313
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
314
+ } | null)[] | {
315
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
316
+ } | null)[] | {
317
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
318
+ } | null)[] | {
319
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
320
+ } | null)[] | {
321
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
322
+ } | null, unknown>>;
323
+ variant: z.ZodMiniOptional<z.ZodMiniString<string>>;
324
+ origin: z.ZodMiniOptional<z.ZodMiniEnum<{
325
+ runtime_config: "runtime_config";
326
+ trigger_context: "trigger_context";
327
+ provider_sync: "provider_sync";
328
+ api: "api";
329
+ }>>;
330
+ provider: z.ZodMiniOptional<z.ZodMiniObject<{
331
+ name: z.ZodMiniString<string>;
332
+ project: z.ZodMiniOptional<z.ZodMiniString<string>>;
333
+ environment: z.ZodMiniOptional<z.ZodMiniString<string>>;
334
+ }, z.core.$strip>>;
335
+ status: z.ZodMiniOptional<z.ZodMiniString<string>>;
336
+ reason: z.ZodMiniOptional<z.ZodMiniString<string>>;
337
+ evaluatedAt: z.ZodMiniOptional<z.ZodMiniString<string>>;
338
+ }, z.core.$strip>>>;
339
+ capabilities: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
340
+ key: z.ZodMiniString<string>;
341
+ source: z.ZodMiniOptional<z.ZodMiniString<string>>;
342
+ provider: z.ZodMiniOptional<z.ZodMiniObject<{
343
+ name: z.ZodMiniString<string>;
344
+ project: z.ZodMiniOptional<z.ZodMiniString<string>>;
345
+ environment: z.ZodMiniOptional<z.ZodMiniString<string>>;
346
+ }, z.core.$strip>>;
347
+ }, z.core.$strip>>>;
348
+ }, z.core.$strip>>;
349
+ messageId: z.ZodMiniOptional<z.ZodMiniString<string>>;
350
+ timestamp: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
351
+ origin: z.ZodMiniLiteral<"customer">;
352
+ event: z.ZodMiniString<string>;
353
+ properties: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniType<import("./app-event.js").AppEventJsonValue, unknown, z.core.$ZodTypeInternals<import("./app-event.js").AppEventJsonValue, unknown>>>>;
354
+ kind: z.ZodMiniLiteral<"track">;
355
+ }, z.core.$strip>], "kind">, z.ZodMiniUnion<readonly [z.ZodMiniObject<{
257
356
  kind: z.ZodMiniLiteral<"identify">;
258
357
  traits: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>;
259
358
  }, z.core.$strict>, z.ZodMiniObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"widget-commands.d.ts","sourceRoot":"","sources":["../src/widget-commands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAC9B,OAAO,EACN,KAAK,gBAAgB,EAErB,KAAK,WAAW,EAEhB,MAAM,oBAAoB,CAAC;AAmB5B,eAAO,MAAM,6BAA6B;;;;;;;;;;;EAAmC,CAAC;AAyC9E,eAAO,MAAM,qBAAqB;;;;;;;;;4BAShC,CAAC;AAeH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAwCrC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE/E,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAErE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,CAE5D;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,CAEtE;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,oBAAoB,CAEvE"}
1
+ {"version":3,"file":"widget-commands.d.ts","sourceRoot":"","sources":["../src/widget-commands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAE9B,OAAO,EACN,KAAK,gBAAgB,EAErB,KAAK,WAAW,EAEhB,MAAM,oBAAoB,CAAC;AAoB5B,eAAO,MAAM,6BAA6B;;;;;;;;;;;;EAAmC,CAAC;AAyC9E,eAAO,MAAM,qBAAqB;;;;;;;;;4BAShC,CAAC;AAeH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBA2CrC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE/E,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAErE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,CAE5D;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,CAEtE;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,oBAAoB,CAEvE"}
@@ -1,4 +1,5 @@
1
1
  import * as z from "zod/mini";
2
+ import { appEventCustomerTrackSchema } from "./app-event.js";
2
3
  import { configureOptionsSchema, initOptionsSchema, } from "./widget-config.js";
3
4
  const flowHandleIdSchema = z.string().check(z.trim(), z.minLength(1));
4
5
  const flowIdSchema = z.string().check(z.trim(), z.minLength(1));
@@ -14,6 +15,7 @@ const publicWidgetCommandKinds = [
14
15
  "init",
15
16
  "close",
16
17
  "reset",
18
+ "track",
17
19
  ];
18
20
  export const publicWidgetCommandKindSchema = z.enum(publicWidgetCommandKinds);
19
21
  const isHTMLElementLike = (value) => {
@@ -105,6 +107,9 @@ export const publicCommandPayloadSchema = z.union([
105
107
  z.strictObject({
106
108
  kind: z.literal("reset"),
107
109
  }),
110
+ z.extend(appEventCustomerTrackSchema, {
111
+ kind: z.literal("track"),
112
+ }),
108
113
  ]),
109
114
  identifyPayloadSchema,
110
115
  ]);
@@ -2,9 +2,9 @@ import * as z from "zod/mini";
2
2
  export declare const colorSchemeConfigInputSchema: z.ZodMiniUnion<readonly [z.ZodMiniObject<{
3
3
  autoDetectColorScheme: z.ZodMiniArray<z.ZodMiniString<string>>;
4
4
  }, z.core.$strict>, z.ZodMiniEnum<{
5
+ system: "system";
5
6
  light: "light";
6
7
  dark: "dark";
7
- system: "system";
8
8
  }>]>;
9
9
  export type ColorSchemeConfigInput = z.output<typeof colorSchemeConfigInputSchema>;
10
10
  export declare const telemetryConfigInputSchema: z.ZodMiniObject<{
@@ -128,9 +128,9 @@ export declare const configureOptionsSchema: z.ZodMiniObject<{
128
128
  colorScheme: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
129
129
  autoDetectColorScheme: z.ZodMiniArray<z.ZodMiniString<string>>;
130
130
  }, z.core.$strict>, z.ZodMiniEnum<{
131
+ system: "system";
131
132
  light: "light";
132
133
  dark: "dark";
133
- system: "system";
134
134
  }>]>>;
135
135
  consent: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniEnum<{
136
136
  pending: "pending";
@@ -159,9 +159,9 @@ export declare const initOptionsSchema: z.ZodMiniObject<{
159
159
  colorScheme: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
160
160
  autoDetectColorScheme: z.ZodMiniArray<z.ZodMiniString<string>>;
161
161
  }, z.core.$strict>, z.ZodMiniEnum<{
162
+ system: "system";
162
163
  light: "light";
163
164
  dark: "dark";
164
- system: "system";
165
165
  }>]>>;
166
166
  disableTelemetry: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
167
167
  enableDebug: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -310,9 +310,9 @@ export declare const instanceUpdateableConfigSchema: z.ZodMiniObject<{
310
310
  colorScheme: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
311
311
  autoDetectColorScheme: z.ZodMiniArray<z.ZodMiniString<string>>;
312
312
  }, z.core.$strict>, z.ZodMiniEnum<{
313
+ system: "system";
313
314
  light: "light";
314
315
  dark: "dark";
315
- system: "system";
316
316
  }>]>>;
317
317
  consent: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniEnum<{
318
318
  pending: "pending";
@@ -354,9 +354,9 @@ export declare const coreInstanceConfigSchema: z.ZodMiniObject<{
354
354
  colorScheme: z.ZodMiniDefault<z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
355
355
  autoDetectColorScheme: z.ZodMiniArray<z.ZodMiniString<string>>;
356
356
  }, z.core.$strict>, z.ZodMiniEnum<{
357
+ system: "system";
357
358
  light: "light";
358
359
  dark: "dark";
359
- system: "system";
360
360
  }>]>>>;
361
361
  disableTelemetry: z.ZodMiniDefault<z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>>;
362
362
  enableDebug: z.ZodMiniDefault<z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getuserfeedback/protocol",
3
- "version": "0.6.1",
3
+ "version": "0.7.2",
4
4
  "description": "getuserfeedback widget protocol — host surface and (later) wire protocol",
5
5
  "keywords": [
6
6
  "getuserfeedback",
@@ -8,82 +8,101 @@
8
8
  "protocol"
9
9
  ],
10
10
  "license": "MIT",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/getuserfeedback/getuserfeedback.git"
14
+ },
11
15
  "publishConfig": {
12
16
  "access": "public"
13
17
  },
14
18
  "type": "module",
15
19
  "sideEffects": false,
16
20
  "files": [
17
- "dist"
21
+ "dist",
22
+ "src"
18
23
  ],
19
24
  "exports": {
20
25
  ".": {
21
26
  "types": "./dist/index.d.ts",
27
+ "bun": "./src/index.ts",
22
28
  "import": "./dist/index.js",
23
29
  "default": "./dist/index.js"
24
30
  },
25
31
  "./host": {
26
32
  "types": "./dist/host/index.d.ts",
33
+ "bun": "./src/host/index.ts",
27
34
  "import": "./dist/host/index.js",
28
35
  "default": "./dist/host/index.js"
29
36
  },
30
37
  "./host/sdk-types": {
31
38
  "types": "./dist/host/sdk-types.d.ts",
39
+ "bun": "./src/host/sdk-types.ts",
32
40
  "import": "./dist/host/sdk-types.js",
33
41
  "default": "./dist/host/sdk-types.js"
34
42
  },
35
43
  "./host/host-event-contract": {
36
44
  "types": "./dist/host/host-event-contract.d.ts",
45
+ "bun": "./src/host/host-event-contract.ts",
37
46
  "import": "./dist/host/host-event-contract.js",
38
47
  "default": "./dist/host/host-event-contract.js"
39
48
  },
40
49
  "./host/constants": {
41
50
  "types": "./dist/host/constants.d.ts",
51
+ "bun": "./src/host/constants.ts",
42
52
  "import": "./dist/host/constants.js",
43
53
  "default": "./dist/host/constants.js"
44
54
  },
45
55
  "./host/command-dispatch": {
46
56
  "types": "./dist/host/command-dispatch.d.ts",
57
+ "bun": "./src/host/command-dispatch.ts",
47
58
  "import": "./dist/host/command-dispatch.js",
48
59
  "default": "./dist/host/command-dispatch.js"
49
60
  },
50
61
  "./host/command-settlement": {
51
62
  "types": "./dist/host/command-settlement.d.ts",
63
+ "bun": "./src/host/command-settlement.ts",
52
64
  "import": "./dist/host/command-settlement.js",
53
65
  "default": "./dist/host/command-settlement.js"
54
66
  },
55
67
  "./host/sdk": {
56
68
  "types": "./dist/host/sdk.d.ts",
69
+ "bun": "./src/host/sdk.ts",
57
70
  "import": "./dist/host/sdk.js",
58
71
  "default": "./dist/host/sdk.js"
59
72
  },
60
73
  "./host/request-id": {
61
74
  "types": "./dist/host/request-id.d.ts",
75
+ "bun": "./src/host/request-id.ts",
62
76
  "import": "./dist/host/request-id.js",
63
77
  "default": "./dist/host/request-id.js"
64
78
  },
65
79
  "./host/unique-id": {
66
80
  "types": "./dist/host/unique-id.d.ts",
81
+ "bun": "./src/host/unique-id.ts",
67
82
  "import": "./dist/host/unique-id.js",
68
83
  "default": "./dist/host/unique-id.js"
69
84
  },
70
85
  "./host/lazy-handle-client": {
71
86
  "types": "./dist/host/lazy-handle-client.d.ts",
87
+ "bun": "./src/host/lazy-handle-client.ts",
72
88
  "import": "./dist/host/lazy-handle-client.js",
73
89
  "default": "./dist/host/lazy-handle-client.js"
74
90
  },
75
91
  "./version-resolution": {
76
92
  "types": "./dist/version-resolution.d.ts",
93
+ "bun": "./src/version-resolution.ts",
77
94
  "import": "./dist/version-resolution.js",
78
95
  "default": "./dist/version-resolution.js"
79
96
  },
80
97
  "./flow-assignments": {
81
98
  "types": "./dist/flow-assignments.d.ts",
99
+ "bun": "./src/flow-assignments.ts",
82
100
  "import": "./dist/flow-assignments.js",
83
101
  "default": "./dist/flow-assignments.js"
84
102
  },
85
103
  "./trpc-envelope": {
86
104
  "types": "./dist/trpc-envelope.d.ts",
105
+ "bun": "./src/trpc-envelope.ts",
87
106
  "import": "./dist/trpc-envelope.js",
88
107
  "default": "./dist/trpc-envelope.js"
89
108
  }
@@ -91,6 +110,7 @@
91
110
  "scripts": {
92
111
  "lint": "ultracite check .",
93
112
  "build": "bun ../../scripts/clean-build-output.ts dist tsconfig.tsbuildinfo && tsc -b tsconfig.json",
113
+ "types": "bun ../../scripts/clean-build-output.ts dist tsconfig.tsbuildinfo && tsc -b tsconfig.json --emitDeclarationOnly",
94
114
  "typecheck": "tsc -b tsconfig.json",
95
115
  "test": "bun test --dots",
96
116
  "pack:verify": "node ../../scripts/pack-and-verify.cjs",