@getuserfeedback/protocol 0.5.12 → 0.6.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/dist/app-event.d.ts +274 -274
- package/dist/app-event.d.ts.map +1 -1
- package/dist/app-event.js +16 -16
- package/dist/client-meta.d.ts +13 -13
- package/dist/client-meta.d.ts.map +1 -1
- package/dist/client-meta.js +6 -6
- package/dist/flow-assignments.d.ts +183 -183
- package/dist/flow-assignments.d.ts.map +1 -1
- package/dist/flow-assignments.js +16 -16
- package/dist/identity-type.d.ts +2 -2
- package/dist/identity-type.d.ts.map +1 -1
- package/dist/identity-type.js +13 -15
- package/dist/index.d.ts +85 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/public-grant-scope.d.ts +3 -3
- package/dist/public-grant-scope.d.ts.map +1 -1
- package/dist/public-grant-scope.js +1 -1
- package/dist/runtime-endpoints.d.ts +4 -4
- package/dist/runtime-endpoints.d.ts.map +1 -1
- package/dist/runtime-endpoints.js +4 -6
- package/dist/scopes.d.ts +2 -2
- package/dist/scopes.d.ts.map +1 -1
- package/dist/scopes.js +1 -1
- package/dist/trpc-envelope.d.ts +4 -4
- package/dist/trpc-envelope.d.ts.map +1 -1
- package/dist/trpc-envelope.js +1 -1
- package/dist/version-resolution.d.ts +5 -5
- package/dist/version-resolution.d.ts.map +1 -1
- package/dist/version-resolution.js +2 -2
- package/dist/widget-commands.d.ts +108 -108
- package/dist/widget-commands.d.ts.map +1 -1
- package/dist/widget-commands.js +30 -56
- package/dist/widget-config.d.ts +161 -245
- package/dist/widget-config.d.ts.map +1 -1
- package/dist/widget-config.js +22 -36
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as z from "zod";
|
|
1
|
+
import * as z from "zod/mini";
|
|
2
2
|
import { type ConfigureOptions, type InitOptions } from "./widget-config.js";
|
|
3
|
-
export declare const publicWidgetCommandKindSchema: z.
|
|
3
|
+
export declare const publicWidgetCommandKindSchema: z.ZodMiniEnum<{
|
|
4
4
|
open: "open";
|
|
5
5
|
prefetch: "prefetch";
|
|
6
6
|
prerender: "prerender";
|
|
@@ -12,27 +12,27 @@ export declare const publicWidgetCommandKindSchema: z.ZodEnum<{
|
|
|
12
12
|
close: "close";
|
|
13
13
|
reset: "reset";
|
|
14
14
|
}>;
|
|
15
|
-
export declare const containerPolicySchema: z.
|
|
16
|
-
kind: z.
|
|
17
|
-
}, z.core.$strict>, z.
|
|
18
|
-
kind: z.
|
|
19
|
-
host: z.
|
|
20
|
-
sharing: z.
|
|
15
|
+
export declare const containerPolicySchema: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
|
|
16
|
+
kind: z.ZodMiniLiteral<"floating">;
|
|
17
|
+
}, z.core.$strict>, z.ZodMiniObject<{
|
|
18
|
+
kind: z.ZodMiniLiteral<"hostContainer">;
|
|
19
|
+
host: z.ZodMiniCustom<HTMLElement | null, HTMLElement | null>;
|
|
20
|
+
sharing: z.ZodMiniEnum<{
|
|
21
21
|
shared: "shared";
|
|
22
22
|
perFlowRun: "perFlowRun";
|
|
23
23
|
}>;
|
|
24
24
|
}, z.core.$strict>], "kind">;
|
|
25
|
-
export declare const publicCommandPayloadSchema: z.
|
|
26
|
-
kind: z.
|
|
27
|
-
flowId: z.
|
|
28
|
-
flowHandleId: z.
|
|
29
|
-
container: z.
|
|
30
|
-
containerRequirement: z.
|
|
25
|
+
export declare const publicCommandPayloadSchema: z.ZodMiniUnion<readonly [z.ZodMiniDiscriminatedUnion<[z.ZodMiniPipe<z.ZodMiniObject<{
|
|
26
|
+
kind: z.ZodMiniLiteral<"open">;
|
|
27
|
+
flowId: z.ZodMiniString<string>;
|
|
28
|
+
flowHandleId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
29
|
+
container: z.ZodMiniOptional<z.ZodMiniCustom<HTMLElement | null, HTMLElement | null>>;
|
|
30
|
+
containerRequirement: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
31
31
|
any: "any";
|
|
32
32
|
hostOnly: "hostOnly";
|
|
33
33
|
}>>;
|
|
34
|
-
hideCloseButton: z.
|
|
35
|
-
}, z.core.$strict>, z.
|
|
34
|
+
hideCloseButton: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
35
|
+
}, z.core.$strict>, z.ZodMiniTransform<{
|
|
36
36
|
kind: "open";
|
|
37
37
|
flowId: string;
|
|
38
38
|
flowHandleId?: string | undefined;
|
|
@@ -45,47 +45,47 @@ export declare const publicCommandPayloadSchema: z.ZodUnion<readonly [z.ZodDiscr
|
|
|
45
45
|
container?: HTMLElement | null | undefined;
|
|
46
46
|
containerRequirement?: "any" | "hostOnly" | undefined;
|
|
47
47
|
hideCloseButton?: boolean | undefined;
|
|
48
|
-
}>>, z.
|
|
49
|
-
kind: z.
|
|
50
|
-
flowId: z.
|
|
51
|
-
flowHandleId: z.
|
|
52
|
-
}, z.core.$strict>, z.
|
|
53
|
-
kind: z.
|
|
54
|
-
flowId: z.
|
|
55
|
-
flowHandleId: z.
|
|
56
|
-
hideCloseButton: z.
|
|
57
|
-
}, z.core.$strict>, z.
|
|
58
|
-
kind: z.
|
|
59
|
-
flowHandleId: z.
|
|
60
|
-
container: z.
|
|
61
|
-
}, z.core.$strict>, z.
|
|
62
|
-
kind: z.
|
|
63
|
-
policy: z.
|
|
64
|
-
kind: z.
|
|
65
|
-
}, z.core.$strict>, z.
|
|
66
|
-
kind: z.
|
|
67
|
-
host: z.
|
|
68
|
-
sharing: z.
|
|
48
|
+
}>>, z.ZodMiniObject<{
|
|
49
|
+
kind: z.ZodMiniLiteral<"prefetch">;
|
|
50
|
+
flowId: z.ZodMiniString<string>;
|
|
51
|
+
flowHandleId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
52
|
+
}, z.core.$strict>, z.ZodMiniObject<{
|
|
53
|
+
kind: z.ZodMiniLiteral<"prerender">;
|
|
54
|
+
flowId: z.ZodMiniString<string>;
|
|
55
|
+
flowHandleId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
56
|
+
hideCloseButton: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
57
|
+
}, z.core.$strict>, z.ZodMiniObject<{
|
|
58
|
+
kind: z.ZodMiniLiteral<"setContainer">;
|
|
59
|
+
flowHandleId: z.ZodMiniString<string>;
|
|
60
|
+
container: z.ZodMiniCustom<HTMLElement | null, HTMLElement | null>;
|
|
61
|
+
}, z.core.$strict>, z.ZodMiniObject<{
|
|
62
|
+
kind: z.ZodMiniLiteral<"setDefaultContainerPolicy">;
|
|
63
|
+
policy: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
|
|
64
|
+
kind: z.ZodMiniLiteral<"floating">;
|
|
65
|
+
}, z.core.$strict>, z.ZodMiniObject<{
|
|
66
|
+
kind: z.ZodMiniLiteral<"hostContainer">;
|
|
67
|
+
host: z.ZodMiniCustom<HTMLElement | null, HTMLElement | null>;
|
|
68
|
+
sharing: z.ZodMiniEnum<{
|
|
69
69
|
shared: "shared";
|
|
70
70
|
perFlowRun: "perFlowRun";
|
|
71
71
|
}>;
|
|
72
72
|
}, z.core.$strict>], "kind">;
|
|
73
|
-
}, z.core.$strict>, z.
|
|
74
|
-
kind: z.
|
|
75
|
-
opts: z.
|
|
76
|
-
colorScheme: z.
|
|
77
|
-
autoDetectColorScheme: z.
|
|
78
|
-
}, z.core.$strict>, z.
|
|
73
|
+
}, z.core.$strict>, z.ZodMiniObject<{
|
|
74
|
+
kind: z.ZodMiniLiteral<"configure">;
|
|
75
|
+
opts: z.ZodMiniObject<{
|
|
76
|
+
colorScheme: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
77
|
+
autoDetectColorScheme: z.ZodMiniArray<z.ZodMiniString<string>>;
|
|
78
|
+
}, z.core.$strict>, z.ZodMiniEnum<{
|
|
79
79
|
light: "light";
|
|
80
80
|
dark: "dark";
|
|
81
81
|
system: "system";
|
|
82
82
|
}>]>>;
|
|
83
|
-
consent: z.
|
|
83
|
+
consent: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniEnum<{
|
|
84
84
|
pending: "pending";
|
|
85
85
|
granted: "granted";
|
|
86
86
|
denied: "denied";
|
|
87
87
|
revoked: "revoked";
|
|
88
|
-
}>, z.
|
|
88
|
+
}>, z.ZodMiniArray<z.ZodMiniEnum<{
|
|
89
89
|
"analytics.storage": "analytics.storage";
|
|
90
90
|
"analytics.measurement": "analytics.measurement";
|
|
91
91
|
"personalization.storage": "personalization.storage";
|
|
@@ -95,31 +95,31 @@ export declare const publicCommandPayloadSchema: z.ZodUnion<readonly [z.ZodDiscr
|
|
|
95
95
|
"functionality.storage": "functionality.storage";
|
|
96
96
|
"security.storage": "security.storage";
|
|
97
97
|
}>>]>>;
|
|
98
|
-
auth: z.
|
|
99
|
-
jwt: z.
|
|
100
|
-
token: z.
|
|
101
|
-
}, z.core.$strip>, z.
|
|
98
|
+
auth: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
99
|
+
jwt: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
100
|
+
token: z.ZodMiniString<string>;
|
|
101
|
+
}, z.core.$strip>, z.ZodMiniNull]>>;
|
|
102
102
|
}, z.core.$strip>>;
|
|
103
103
|
}, z.core.$strict>;
|
|
104
|
-
}, z.core.$strict>, z.
|
|
105
|
-
kind: z.
|
|
106
|
-
opts: z.
|
|
107
|
-
apiKey: z.
|
|
108
|
-
colorScheme: z.
|
|
109
|
-
autoDetectColorScheme: z.
|
|
110
|
-
}, z.core.$strict>, z.
|
|
104
|
+
}, z.core.$strict>, z.ZodMiniObject<{
|
|
105
|
+
kind: z.ZodMiniLiteral<"init">;
|
|
106
|
+
opts: z.ZodMiniObject<{
|
|
107
|
+
apiKey: z.ZodMiniString<string>;
|
|
108
|
+
colorScheme: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
109
|
+
autoDetectColorScheme: z.ZodMiniArray<z.ZodMiniString<string>>;
|
|
110
|
+
}, z.core.$strict>, z.ZodMiniEnum<{
|
|
111
111
|
light: "light";
|
|
112
112
|
dark: "dark";
|
|
113
113
|
system: "system";
|
|
114
114
|
}>]>>;
|
|
115
|
-
disableTelemetry: z.
|
|
116
|
-
enableDebug: z.
|
|
117
|
-
defaultConsent: z.
|
|
115
|
+
disableTelemetry: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
116
|
+
enableDebug: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
|
|
117
|
+
defaultConsent: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniEnum<{
|
|
118
118
|
pending: "pending";
|
|
119
119
|
granted: "granted";
|
|
120
120
|
denied: "denied";
|
|
121
121
|
revoked: "revoked";
|
|
122
|
-
}>, z.
|
|
122
|
+
}>, z.ZodMiniArray<z.ZodMiniEnum<{
|
|
123
123
|
"analytics.storage": "analytics.storage";
|
|
124
124
|
"analytics.measurement": "analytics.measurement";
|
|
125
125
|
"personalization.storage": "personalization.storage";
|
|
@@ -129,8 +129,8 @@ export declare const publicCommandPayloadSchema: z.ZodUnion<readonly [z.ZodDiscr
|
|
|
129
129
|
"functionality.storage": "functionality.storage";
|
|
130
130
|
"security.storage": "security.storage";
|
|
131
131
|
}>>]>>;
|
|
132
|
-
clientMeta: z.
|
|
133
|
-
loader: z.
|
|
132
|
+
clientMeta: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
133
|
+
loader: z.ZodMiniEnum<{
|
|
134
134
|
custom: "custom";
|
|
135
135
|
sdk: "sdk";
|
|
136
136
|
gtm: "gtm";
|
|
@@ -138,38 +138,38 @@ export declare const publicCommandPayloadSchema: z.ZodUnion<readonly [z.ZodDiscr
|
|
|
138
138
|
rudderstack: "rudderstack";
|
|
139
139
|
tealium: "tealium";
|
|
140
140
|
}>;
|
|
141
|
-
clientName: z.
|
|
142
|
-
clientVersion: z.
|
|
143
|
-
integrator: z.
|
|
144
|
-
name: z.
|
|
145
|
-
version: z.
|
|
141
|
+
clientName: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
142
|
+
clientVersion: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
143
|
+
integrator: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
144
|
+
name: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
145
|
+
version: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
146
146
|
}, z.core.$strip>>;
|
|
147
|
-
transport: z.
|
|
147
|
+
transport: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
148
148
|
loader: "loader";
|
|
149
149
|
"script-tag": "script-tag";
|
|
150
150
|
esm: "esm";
|
|
151
151
|
"tag-manager": "tag-manager";
|
|
152
152
|
snippet: "snippet";
|
|
153
153
|
}>>;
|
|
154
|
-
runtime: z.
|
|
155
|
-
framework: z.
|
|
154
|
+
runtime: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
155
|
+
framework: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
156
156
|
next: "next";
|
|
157
157
|
vite: "vite";
|
|
158
158
|
webpack: "webpack";
|
|
159
159
|
plain: "plain";
|
|
160
160
|
}>>;
|
|
161
|
-
runtime: z.
|
|
161
|
+
runtime: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
162
162
|
browser: "browser";
|
|
163
163
|
edge: "edge";
|
|
164
164
|
}>>;
|
|
165
165
|
}, z.core.$strip>>;
|
|
166
|
-
notes: z.
|
|
166
|
+
notes: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
167
167
|
}, z.core.$strip>>;
|
|
168
|
-
capabilities: z.
|
|
169
|
-
flags: z.
|
|
170
|
-
key: z.
|
|
171
|
-
target: z.
|
|
172
|
-
value: z.
|
|
168
|
+
capabilities: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
169
|
+
flags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
170
|
+
key: z.ZodMiniString<string>;
|
|
171
|
+
target: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
172
|
+
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 | {
|
|
173
173
|
[key: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
|
|
174
174
|
} | null)[] | {
|
|
175
175
|
[key: string]: string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null;
|
|
@@ -218,48 +218,48 @@ export declare const publicCommandPayloadSchema: z.ZodUnion<readonly [z.ZodDiscr
|
|
|
218
218
|
} | null)[] | {
|
|
219
219
|
[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;
|
|
220
220
|
} | null, unknown>>;
|
|
221
|
-
variant: z.
|
|
222
|
-
origin: z.
|
|
221
|
+
variant: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
222
|
+
origin: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
223
223
|
runtime_config: "runtime_config";
|
|
224
224
|
trigger_context: "trigger_context";
|
|
225
225
|
provider_sync: "provider_sync";
|
|
226
226
|
api: "api";
|
|
227
227
|
}>>;
|
|
228
|
-
provider: z.
|
|
229
|
-
name: z.
|
|
230
|
-
project: z.
|
|
231
|
-
environment: z.
|
|
228
|
+
provider: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
229
|
+
name: z.ZodMiniString<string>;
|
|
230
|
+
project: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
231
|
+
environment: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
232
232
|
}, z.core.$strip>>;
|
|
233
|
-
status: z.
|
|
234
|
-
reason: z.
|
|
235
|
-
evaluatedAt: z.
|
|
233
|
+
status: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
234
|
+
reason: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
235
|
+
evaluatedAt: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
236
236
|
}, z.core.$strip>>>;
|
|
237
|
-
hostCapabilities: z.
|
|
238
|
-
key: z.
|
|
239
|
-
source: z.
|
|
240
|
-
provider: z.
|
|
241
|
-
name: z.
|
|
242
|
-
project: z.
|
|
243
|
-
environment: z.
|
|
237
|
+
hostCapabilities: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
238
|
+
key: z.ZodMiniString<string>;
|
|
239
|
+
source: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
240
|
+
provider: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
241
|
+
name: z.ZodMiniString<string>;
|
|
242
|
+
project: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
243
|
+
environment: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
244
244
|
}, z.core.$strip>>;
|
|
245
245
|
}, z.core.$strip>>>;
|
|
246
|
-
runtimeEndpoints: z.
|
|
247
|
-
apiUrl: z.
|
|
248
|
-
coreUrl: z.
|
|
246
|
+
runtimeEndpoints: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
247
|
+
apiUrl: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
248
|
+
coreUrl: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
249
249
|
}, z.core.$strict>>;
|
|
250
250
|
}, z.core.$strict>;
|
|
251
|
-
}, z.core.$strict>, z.
|
|
252
|
-
kind: z.
|
|
253
|
-
flowHandleId: z.
|
|
254
|
-
}, z.core.$strict>, z.
|
|
255
|
-
kind: z.
|
|
256
|
-
}, z.core.$strict>], "kind">, z.
|
|
257
|
-
kind: z.
|
|
258
|
-
traits: z.
|
|
259
|
-
}, z.core.$strict>, z.
|
|
260
|
-
kind: z.
|
|
261
|
-
userId: z.
|
|
262
|
-
traits: z.
|
|
251
|
+
}, z.core.$strict>, z.ZodMiniObject<{
|
|
252
|
+
kind: z.ZodMiniLiteral<"close">;
|
|
253
|
+
flowHandleId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
254
|
+
}, z.core.$strict>, z.ZodMiniObject<{
|
|
255
|
+
kind: z.ZodMiniLiteral<"reset">;
|
|
256
|
+
}, z.core.$strict>], "kind">, z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
257
|
+
kind: z.ZodMiniLiteral<"identify">;
|
|
258
|
+
traits: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>;
|
|
259
|
+
}, z.core.$strict>, z.ZodMiniObject<{
|
|
260
|
+
kind: z.ZodMiniLiteral<"identify">;
|
|
261
|
+
userId: z.ZodMiniString<string>;
|
|
262
|
+
traits: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnknown>>;
|
|
263
263
|
}, z.core.$strict>]>]>;
|
|
264
264
|
export type PublicCommandPayload = z.output<typeof publicCommandPayloadSchema>;
|
|
265
265
|
export type ContainerPolicy = z.output<typeof containerPolicySchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget-commands.d.ts","sourceRoot":"","sources":["../src/widget-commands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,
|
|
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"}
|
package/dist/widget-commands.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as z from "zod";
|
|
1
|
+
import * as z from "zod/mini";
|
|
2
2
|
import { configureOptionsSchema, initOptionsSchema, } from "./widget-config.js";
|
|
3
|
-
const flowHandleIdSchema = z.string().trim().
|
|
4
|
-
const flowIdSchema = z.string().trim().
|
|
3
|
+
const flowHandleIdSchema = z.string().check(z.trim(), z.minLength(1));
|
|
4
|
+
const flowIdSchema = z.string().check(z.trim(), z.minLength(1));
|
|
5
5
|
/** Public command kinds accepted from host / SDK before core dispatch. */
|
|
6
6
|
const publicWidgetCommandKinds = [
|
|
7
7
|
"open",
|
|
@@ -35,39 +35,30 @@ const htmlElementOrNullSchema = z.custom((value) => value === null || isHTMLElem
|
|
|
35
35
|
});
|
|
36
36
|
const identifyTraitsSchema = z.record(z.string(), z.unknown());
|
|
37
37
|
const identifyPayloadSchema = z.union([
|
|
38
|
-
z
|
|
39
|
-
.object({
|
|
38
|
+
z.strictObject({
|
|
40
39
|
kind: z.literal("identify"),
|
|
41
40
|
traits: identifyTraitsSchema,
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
z
|
|
45
|
-
.object({
|
|
41
|
+
}),
|
|
42
|
+
z.strictObject({
|
|
46
43
|
kind: z.literal("identify"),
|
|
47
|
-
userId: z.string().trim().
|
|
44
|
+
userId: z.string().check(z.trim(), z.minLength(1)),
|
|
48
45
|
traits: z.optional(identifyTraitsSchema),
|
|
49
|
-
})
|
|
50
|
-
.strict(),
|
|
46
|
+
}),
|
|
51
47
|
]);
|
|
52
48
|
// TODO(migration): After telemetry confirms no remaining `open.containerRequirement` in host command queues, remove the optional field and transform so unknown keys fail under `.strict()` again.
|
|
53
49
|
// [from=legacy-open-container-requirement] [to=strict-public-open-only] [scope=slice] [priority=low] [impact=medium] [risk=low]
|
|
54
50
|
const legacyOpenContainerRequirementSchema = z.enum(["any", "hostOnly"]);
|
|
55
51
|
export const containerPolicySchema = z.discriminatedUnion("kind", [
|
|
56
|
-
z
|
|
57
|
-
.object({
|
|
52
|
+
z.strictObject({
|
|
58
53
|
kind: z.literal("floating"),
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
z
|
|
62
|
-
.object({
|
|
54
|
+
}),
|
|
55
|
+
z.strictObject({
|
|
63
56
|
kind: z.literal("hostContainer"),
|
|
64
57
|
host: htmlElementOrNullSchema,
|
|
65
58
|
sharing: z.enum(["shared", "perFlowRun"]),
|
|
66
|
-
})
|
|
67
|
-
.strict(),
|
|
59
|
+
}),
|
|
68
60
|
]);
|
|
69
|
-
const openPublicPayloadSchema = z.pipe(z
|
|
70
|
-
.object({
|
|
61
|
+
const openPublicPayloadSchema = z.pipe(z.strictObject({
|
|
71
62
|
kind: z.literal("open"),
|
|
72
63
|
flowId: flowIdSchema,
|
|
73
64
|
flowHandleId: z.optional(flowHandleIdSchema),
|
|
@@ -75,62 +66,45 @@ const openPublicPayloadSchema = z.pipe(z
|
|
|
75
66
|
/** Accepted for legacy browser SDK payloads; stripped before dispatch. */
|
|
76
67
|
containerRequirement: z.optional(legacyOpenContainerRequirementSchema),
|
|
77
68
|
hideCloseButton: z.optional(z.boolean()),
|
|
78
|
-
})
|
|
79
|
-
.strict(), z.transform(({ containerRequirement: _legacy, ...rest }) => rest));
|
|
69
|
+
}), z.transform(({ containerRequirement: _legacy, ...rest }) => rest));
|
|
80
70
|
export const publicCommandPayloadSchema = z.union([
|
|
81
71
|
z.discriminatedUnion("kind", [
|
|
82
72
|
openPublicPayloadSchema,
|
|
83
|
-
z
|
|
84
|
-
.object({
|
|
73
|
+
z.strictObject({
|
|
85
74
|
kind: z.literal("prefetch"),
|
|
86
75
|
flowId: flowIdSchema,
|
|
87
76
|
flowHandleId: z.optional(flowHandleIdSchema),
|
|
88
|
-
})
|
|
89
|
-
|
|
90
|
-
z
|
|
91
|
-
.object({
|
|
77
|
+
}),
|
|
78
|
+
z.strictObject({
|
|
92
79
|
kind: z.literal("prerender"),
|
|
93
80
|
flowId: flowIdSchema,
|
|
94
81
|
flowHandleId: z.optional(flowHandleIdSchema),
|
|
95
82
|
hideCloseButton: z.optional(z.boolean()),
|
|
96
|
-
})
|
|
97
|
-
|
|
98
|
-
z
|
|
99
|
-
.object({
|
|
83
|
+
}),
|
|
84
|
+
z.strictObject({
|
|
100
85
|
kind: z.literal("setContainer"),
|
|
101
86
|
flowHandleId: flowHandleIdSchema,
|
|
102
87
|
container: htmlElementOrNullSchema,
|
|
103
|
-
})
|
|
104
|
-
|
|
105
|
-
z
|
|
106
|
-
.object({
|
|
88
|
+
}),
|
|
89
|
+
z.strictObject({
|
|
107
90
|
kind: z.literal("setDefaultContainerPolicy"),
|
|
108
91
|
policy: containerPolicySchema,
|
|
109
|
-
})
|
|
110
|
-
|
|
111
|
-
z
|
|
112
|
-
.object({
|
|
92
|
+
}),
|
|
93
|
+
z.strictObject({
|
|
113
94
|
kind: z.literal("configure"),
|
|
114
95
|
opts: configureOptionsSchema,
|
|
115
|
-
})
|
|
116
|
-
|
|
117
|
-
z
|
|
118
|
-
.object({
|
|
96
|
+
}),
|
|
97
|
+
z.strictObject({
|
|
119
98
|
kind: z.literal("init"),
|
|
120
99
|
opts: initOptionsSchema,
|
|
121
|
-
})
|
|
122
|
-
|
|
123
|
-
z
|
|
124
|
-
.object({
|
|
100
|
+
}),
|
|
101
|
+
z.strictObject({
|
|
125
102
|
kind: z.literal("close"),
|
|
126
103
|
flowHandleId: z.optional(flowHandleIdSchema),
|
|
127
|
-
})
|
|
128
|
-
|
|
129
|
-
z
|
|
130
|
-
.object({
|
|
104
|
+
}),
|
|
105
|
+
z.strictObject({
|
|
131
106
|
kind: z.literal("reset"),
|
|
132
|
-
})
|
|
133
|
-
.strict(),
|
|
107
|
+
}),
|
|
134
108
|
]),
|
|
135
109
|
identifyPayloadSchema,
|
|
136
110
|
]);
|