@getuserfeedback/protocol 1.3.1 → 1.5.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.
@@ -2,6 +2,10 @@ import * as z from "zod/mini";
2
2
  import type { IdentityTypeValue } from "./identity-type.js";
3
3
  export type FlowAssignmentExternalIdIdentityTypeValue = `externalId.users.none.${string}`;
4
4
  export type FlowAssignmentIdentityTypeValue = IdentityTypeValue | FlowAssignmentExternalIdIdentityTypeValue;
5
+ export declare const flowAssignmentIdentitySchema: z.ZodMiniObject<{
6
+ type: z.ZodMiniUnion<readonly [z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<"anonymousId" | "userId" | "traits.email" | "traits.phone" | "context.device.id" | "context.device.advertisingId" | "context.device.token", string>>, z.ZodMiniType<`externalId.users.none.${string}`, `externalId.users.none.${string}`, z.core.$ZodTypeInternals<`externalId.users.none.${string}`, `externalId.users.none.${string}`>>]>;
7
+ value: z.ZodMiniString<string>;
8
+ }, z.core.$strip>;
5
9
  export declare const flowAssignmentStatusSchema: z.ZodMiniEnum<{
6
10
  pending: "pending";
7
11
  held: "held";
@@ -1 +1 @@
1
- {"version":3,"file":"flow-assignments.d.ts","sourceRoot":"","sources":["../src/flow-assignments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAO9B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,MAAM,yCAAyC,GACpD,yBAAyB,MAAM,EAAE,CAAC;AACnC,MAAM,MAAM,+BAA+B,GACxC,iBAAiB,GACjB,yCAAyC,CAAC;AAsB7C,eAAO,MAAM,0BAA0B;;;;;;;;;;EAUrC,CAAC;AAEH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAU/C,CAAC;AAEH,eAA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,MAAM,mCAAmC,GAAG,CAAC,CAAC,MAAM,CACzD,OAAO,yCAAyC,CAChD,CAAC;AACF,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,MAAM,CACxD,OAAO,wCAAwC,CAC/C,CAAC;AACF,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CACvD,OAAO,uCAAuC,CAC9C,CAAC;AACF,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,MAAM,CACxD,OAAO,wCAAwC,CAC/C,CAAC;AACF,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,MAAM,CAC1D,OAAO,0CAA0C,CACjD,CAAC;AACF,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,MAAM,CAC3D,OAAO,2CAA2C,CAClD,CAAC"}
@@ -3,7 +3,7 @@ import { appEventCapabilitySchema, appEventFlagSchema, appEventIdentityTypeSchem
3
3
  const flowAssignmentExternalIdIdentityTypeSchema = z.string().check(z.trim(), z.minLength(1), z.regex(/^externalId\.users\.none\.[a-z0-9][a-z0-9_.-]*$/, {
4
4
  message: "External ID identity type must use externalId.users.none.<type> with a lowercase Segment external ID type.",
5
5
  }));
6
- const flowAssignmentIdentitySchema = z.object({
6
+ export const flowAssignmentIdentitySchema = z.object({
7
7
  type: z.union([
8
8
  appEventIdentityTypeSchema,
9
9
  flowAssignmentExternalIdIdentityTypeSchema,
@@ -0,0 +1,194 @@
1
+ import * as z from "zod/mini";
2
+ export declare const runtimeDisplayEligibilitySchema: z.ZodMiniObject<{
3
+ requiredCapabilities: z.ZodMiniDefault<z.ZodMiniArray<z.ZodMiniString<string>>>;
4
+ requiredPage: z.ZodMiniOptional<z.ZodMiniObject<{
5
+ path: z.ZodMiniString<string>;
6
+ }, z.core.$strip>>;
7
+ }, z.core.$strip>;
8
+ export declare const runtimeDisplayBroadcastOpportunitySchema: z.ZodMiniObject<{
9
+ opportunityId: z.ZodMiniString<string>;
10
+ flowId: z.ZodMiniString<string>;
11
+ flowVersionId: z.ZodMiniString<string>;
12
+ source: z.ZodMiniObject<{
13
+ kind: z.ZodMiniLiteral<"runtime_broadcast">;
14
+ automationId: z.ZodMiniOptional<z.ZodMiniString<string>>;
15
+ automationVersionId: z.ZodMiniOptional<z.ZodMiniString<string>>;
16
+ }, z.core.$strip>;
17
+ runtimeEligibility: z.ZodMiniObject<{
18
+ requiredCapabilities: z.ZodMiniDefault<z.ZodMiniArray<z.ZodMiniString<string>>>;
19
+ requiredPage: z.ZodMiniOptional<z.ZodMiniObject<{
20
+ path: z.ZodMiniString<string>;
21
+ }, z.core.$strip>>;
22
+ }, z.core.$strip>;
23
+ }, z.core.$strip>;
24
+ export declare const runtimeDisplayBroadcastsSchema: z.ZodMiniObject<{
25
+ version: z.ZodMiniString<string>;
26
+ opportunities: z.ZodMiniArray<z.ZodMiniObject<{
27
+ opportunityId: z.ZodMiniString<string>;
28
+ flowId: z.ZodMiniString<string>;
29
+ flowVersionId: z.ZodMiniString<string>;
30
+ source: z.ZodMiniObject<{
31
+ kind: z.ZodMiniLiteral<"runtime_broadcast">;
32
+ automationId: z.ZodMiniOptional<z.ZodMiniString<string>>;
33
+ automationVersionId: z.ZodMiniOptional<z.ZodMiniString<string>>;
34
+ }, z.core.$strip>;
35
+ runtimeEligibility: z.ZodMiniObject<{
36
+ requiredCapabilities: z.ZodMiniDefault<z.ZodMiniArray<z.ZodMiniString<string>>>;
37
+ requiredPage: z.ZodMiniOptional<z.ZodMiniObject<{
38
+ path: z.ZodMiniString<string>;
39
+ }, z.core.$strip>>;
40
+ }, z.core.$strip>;
41
+ }, z.core.$strip>>;
42
+ }, z.core.$strip>;
43
+ export declare const flowDisplaySyncRequestSchema: z.ZodMiniObject<{
44
+ identities: z.ZodMiniDefault<z.ZodMiniArray<z.ZodMiniObject<{
45
+ type: z.ZodMiniUnion<readonly [z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<"anonymousId" | "userId" | "traits.email" | "traits.phone" | "context.device.id" | "context.device.advertisingId" | "context.device.token", string>>, z.ZodMiniType<`externalId.users.none.${string}`, `externalId.users.none.${string}`, z.core.$ZodTypeInternals<`externalId.users.none.${string}`, `externalId.users.none.${string}`>>]>;
46
+ value: z.ZodMiniString<string>;
47
+ }, z.core.$strip>>>;
48
+ context: z.ZodMiniOptional<z.ZodMiniObject<{
49
+ flags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
50
+ key: z.ZodMiniString<string>;
51
+ target: z.ZodMiniOptional<z.ZodMiniString<string>>;
52
+ 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 | {
53
+ [key: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
54
+ } | null)[] | {
55
+ [key: string]: string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null;
56
+ } | null)[] | {
57
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*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 | /*elided*/ any | /*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 | /*elided*/ any | /*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 | /*elided*/ any | /*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 | /*elided*/ any | /*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 | /*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;
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 | /*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;
70
+ } | null)[] | {
71
+ [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;
72
+ } | null)[] | {
73
+ [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;
74
+ } | null)[] | {
75
+ [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;
76
+ } | 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 | {
77
+ [key: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
78
+ } | null)[] | {
79
+ [key: string]: string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null;
80
+ } | null)[] | {
81
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
82
+ } | null)[] | {
83
+ [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;
84
+ } | null)[] | {
85
+ [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;
86
+ } | null)[] | {
87
+ [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;
88
+ } | null)[] | {
89
+ [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;
90
+ } | null)[] | {
91
+ [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;
92
+ } | null)[] | {
93
+ [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;
94
+ } | null)[] | {
95
+ [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;
96
+ } | null)[] | {
97
+ [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;
98
+ } | null)[] | {
99
+ [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;
100
+ } | null, unknown>>;
101
+ variant: z.ZodMiniOptional<z.ZodMiniString<string>>;
102
+ origin: z.ZodMiniOptional<z.ZodMiniEnum<{
103
+ runtime_config: "runtime_config";
104
+ trigger_context: "trigger_context";
105
+ provider_sync: "provider_sync";
106
+ api: "api";
107
+ }>>;
108
+ provider: z.ZodMiniOptional<z.ZodMiniObject<{
109
+ name: z.ZodMiniString<string>;
110
+ project: z.ZodMiniOptional<z.ZodMiniString<string>>;
111
+ environment: z.ZodMiniOptional<z.ZodMiniString<string>>;
112
+ }, z.core.$strip>>;
113
+ status: z.ZodMiniOptional<z.ZodMiniString<string>>;
114
+ reason: z.ZodMiniOptional<z.ZodMiniString<string>>;
115
+ evaluatedAt: z.ZodMiniOptional<z.ZodMiniString<string>>;
116
+ }, z.core.$strip>>>;
117
+ capabilities: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
118
+ key: z.ZodMiniString<string>;
119
+ source: z.ZodMiniOptional<z.ZodMiniString<string>>;
120
+ provider: z.ZodMiniOptional<z.ZodMiniObject<{
121
+ name: z.ZodMiniString<string>;
122
+ project: z.ZodMiniOptional<z.ZodMiniString<string>>;
123
+ environment: z.ZodMiniOptional<z.ZodMiniString<string>>;
124
+ }, z.core.$strip>>;
125
+ }, z.core.$strip>>>;
126
+ page: z.ZodMiniOptional<z.ZodMiniObject<{
127
+ path: z.ZodMiniOptional<z.ZodMiniString<string>>;
128
+ referrer: z.ZodMiniOptional<z.ZodMiniString<string>>;
129
+ search: z.ZodMiniOptional<z.ZodMiniString<string>>;
130
+ }, z.core.$strip>>;
131
+ }, z.core.$strip>>;
132
+ holdOwnerKey: z.ZodMiniString<string>;
133
+ at: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
134
+ assignmentLimit: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
135
+ knownBroadcastManifestVersion: z.ZodMiniOptional<z.ZodMiniString<string>>;
136
+ }, z.core.$strip>;
137
+ export declare const flowDisplaySyncResponseSchema: z.ZodMiniObject<{
138
+ fetchedAt: z.ZodMiniString<string>;
139
+ assignments: z.ZodMiniObject<{
140
+ claimed: z.ZodMiniArray<z.ZodMiniObject<{
141
+ flowAssignmentId: z.ZodMiniString<string>;
142
+ flowId: z.ZodMiniString<string>;
143
+ holdGroupToken: z.ZodMiniOptional<z.ZodMiniString<string>>;
144
+ presentedFlowVersionId: z.ZodMiniOptional<z.ZodMiniString<string>>;
145
+ latestFlowVersionId: z.ZodMiniString<string>;
146
+ status: z.ZodMiniEnum<{
147
+ pending: "pending";
148
+ held: "held";
149
+ presented: "presented";
150
+ completed: "completed";
151
+ expired: "expired";
152
+ superseded: "superseded";
153
+ withdrawn_pending: "withdrawn_pending";
154
+ withdrawn_presented: "withdrawn_presented";
155
+ withdrawn_final: "withdrawn_final";
156
+ }>;
157
+ assignedAt: z.ZodMiniString<string>;
158
+ expiresAt: z.ZodMiniOptional<z.ZodMiniString<string>>;
159
+ heldAt: z.ZodMiniOptional<z.ZodMiniString<string>>;
160
+ holdExpiresAt: z.ZodMiniOptional<z.ZodMiniString<string>>;
161
+ presentedAt: z.ZodMiniOptional<z.ZodMiniString<string>>;
162
+ completedAt: z.ZodMiniOptional<z.ZodMiniString<string>>;
163
+ expiredAt: z.ZodMiniOptional<z.ZodMiniString<string>>;
164
+ supersededAt: z.ZodMiniOptional<z.ZodMiniString<string>>;
165
+ withdrawnAt: z.ZodMiniOptional<z.ZodMiniString<string>>;
166
+ withdrawnFinalAt: z.ZodMiniOptional<z.ZodMiniString<string>>;
167
+ }, z.core.$strip>>;
168
+ }, z.core.$strip>;
169
+ broadcasts: z.ZodMiniObject<{
170
+ version: z.ZodMiniString<string>;
171
+ opportunities: z.ZodMiniArray<z.ZodMiniObject<{
172
+ opportunityId: z.ZodMiniString<string>;
173
+ flowId: z.ZodMiniString<string>;
174
+ flowVersionId: z.ZodMiniString<string>;
175
+ source: z.ZodMiniObject<{
176
+ kind: z.ZodMiniLiteral<"runtime_broadcast">;
177
+ automationId: z.ZodMiniOptional<z.ZodMiniString<string>>;
178
+ automationVersionId: z.ZodMiniOptional<z.ZodMiniString<string>>;
179
+ }, z.core.$strip>;
180
+ runtimeEligibility: z.ZodMiniObject<{
181
+ requiredCapabilities: z.ZodMiniDefault<z.ZodMiniArray<z.ZodMiniString<string>>>;
182
+ requiredPage: z.ZodMiniOptional<z.ZodMiniObject<{
183
+ path: z.ZodMiniString<string>;
184
+ }, z.core.$strip>>;
185
+ }, z.core.$strip>;
186
+ }, z.core.$strip>>;
187
+ }, z.core.$strip>;
188
+ }, z.core.$strip>;
189
+ export type RuntimeDisplayBroadcasts = z.output<typeof runtimeDisplayBroadcastsSchema>;
190
+ export type RuntimeDisplayBroadcastOpportunity = z.output<typeof runtimeDisplayBroadcastOpportunitySchema>;
191
+ export type RuntimeDisplayEligibility = z.output<typeof runtimeDisplayEligibilitySchema>;
192
+ export type FlowDisplaySyncRequest = z.output<typeof flowDisplaySyncRequestSchema>;
193
+ export type FlowDisplaySyncResponse = z.output<typeof flowDisplaySyncResponseSchema>;
194
+ //# sourceMappingURL=flow-display.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flow-display.d.ts","sourceRoot":"","sources":["../src/flow-display.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAQ9B,eAAO,MAAM,+BAA+B;;;;;iBAU1C,CAAC;AAEH,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;iBAUnD,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;iBAGzC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBASvC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMxC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAC9C,OAAO,8BAA8B,CACrC,CAAC;AACF,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,MAAM,CACxD,OAAO,wCAAwC,CAC/C,CAAC;AACF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAC/C,OAAO,+BAA+B,CACtC,CAAC;AACF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAC5C,OAAO,4BAA4B,CACnC,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAC7C,OAAO,6BAA6B,CACpC,CAAC"}
@@ -0,0 +1,38 @@
1
+ import * as z from "zod/mini";
2
+ import { flowAssignmentIdentitySchema, flowAssignmentRecordSchema, flowAssignmentTargetingContextSchema, } from "./flow-assignments.js";
3
+ export const runtimeDisplayEligibilitySchema = z.object({
4
+ requiredCapabilities: z._default(z.array(z.string().check(z.trim(), z.minLength(1))), []),
5
+ requiredPage: z.optional(z.object({
6
+ path: z.string().check(z.trim(), z.minLength(1)),
7
+ })),
8
+ });
9
+ export const runtimeDisplayBroadcastOpportunitySchema = z.object({
10
+ opportunityId: z.string().check(z.trim(), z.minLength(1)),
11
+ flowId: z.string().check(z.trim(), z.minLength(1)),
12
+ flowVersionId: z.string().check(z.trim(), z.minLength(1)),
13
+ source: z.object({
14
+ kind: z.literal("runtime_broadcast"),
15
+ automationId: z.optional(z.string().check(z.trim(), z.minLength(1))),
16
+ automationVersionId: z.optional(z.string().check(z.trim(), z.minLength(1))),
17
+ }),
18
+ runtimeEligibility: runtimeDisplayEligibilitySchema,
19
+ });
20
+ export const runtimeDisplayBroadcastsSchema = z.object({
21
+ version: z.string().check(z.trim(), z.minLength(1)),
22
+ opportunities: z.array(runtimeDisplayBroadcastOpportunitySchema),
23
+ });
24
+ export const flowDisplaySyncRequestSchema = z.object({
25
+ identities: z._default(z.array(flowAssignmentIdentitySchema), []),
26
+ context: z.optional(flowAssignmentTargetingContextSchema),
27
+ holdOwnerKey: z.string().check(z.trim(), z.minLength(1)),
28
+ at: z.optional(z.number()),
29
+ assignmentLimit: z.optional(z.number()),
30
+ knownBroadcastManifestVersion: z.optional(z.string().check(z.trim(), z.minLength(1))),
31
+ });
32
+ export const flowDisplaySyncResponseSchema = z.object({
33
+ fetchedAt: z.string(),
34
+ assignments: z.object({
35
+ claimed: z.array(flowAssignmentRecordSchema),
36
+ }),
37
+ broadcasts: runtimeDisplayBroadcastsSchema,
38
+ });
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ export { DEFAULT_AUTO_DETECT_COLOR_SCHEME_ATTRS } from "./defaults.js";
4
4
  export type { ErrorEvent, ProtocolErrorCode } from "./errors.js";
5
5
  export { ErrorCategory, ErrorCategorySchema, ErrorEventSchema, ProtocolError, } from "./errors.js";
6
6
  export { type ClaimPendingFlowAssignmentsRequest, type ClaimPendingFlowAssignmentsResponse, claimPendingFlowAssignmentsRequestSchema, claimPendingFlowAssignmentsResponseSchema, type FlowAssignmentExternalIdIdentityTypeValue, type FlowAssignmentIdentityTypeValue, 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";
7
+ export { type FlowDisplaySyncRequest, type FlowDisplaySyncResponse, flowDisplaySyncRequestSchema, flowDisplaySyncResponseSchema, type RuntimeDisplayBroadcasts, runtimeDisplayBroadcastsSchema, } from "./flow-display.js";
7
8
  export { buildIdentityTypeGuidanceMessage, getIdentityTypeSuggestion, IDENTITY_TYPE_VALUES, type IdentityTypeValue, isIdentityTypeValue, type StandardIdentityTypeValue, } from "./identity-type.js";
8
9
  export { isPublicGrantScope, type PublicGrantScope, publicGrantScopeIdSchema, } from "./public-grant-scope.js";
9
10
  export { type RuntimeEndpoints, resolveApiBaseUrl, resolveCoreUrl, resolveTrpcBaseUrl, runtimeEndpointsSchema, } from "./runtime-endpoints.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot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BAAgB,EACrB,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,sBAAsB,EACtB,KAAK,2BAA2B,EAChC,iCAAiC,EACjC,KAAK,mBAAmB,EACxB,2BAA2B,EAC3B,KAAK,WAAW,EAChB,KAAK,wBAAwB,EAC7B,yBAAyB,EACzB,iBAAiB,EACjB,8BAA8B,EAC9B,KAAK,oBAAoB,EACzB,0BAA0B,GAC1B,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,kBAAkB,EAClB,wBAAwB,EACxB,qBAAqB,EACrB,2BAA2B,EAC3B,wBAAwB,EACxB,0BAA0B,EAC1B,kBAAkB,EAClB,2BAA2B,EAC3B,sBAAsB,EACtB,0BAA0B,EAC1B,qBAAqB,EACrB,0BAA0B,EAC1B,wBAAwB,EACxB,yBAAyB,EACzB,mBAAmB,EACnB,2BAA2B,GAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,KAAK,UAAU,EACf,gBAAgB,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,sCAAsC,EAAE,MAAM,eAAe,CAAC;AACvE,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EACN,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,KAAK,kCAAkC,EACvC,KAAK,mCAAmC,EACxC,wCAAwC,EACxC,yCAAyC,EACzC,KAAK,yCAAyC,EAC9C,KAAK,+BAA+B,EACpC,KAAK,8BAA8B,EACnC,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,8BAA8B,EACnC,oCAAoC,EACpC,0BA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CAAgC,GAChC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,KAAK,oBAAoB,EACzB,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EAClB,0BAA0B,EAC1B,6BAA6B,GAC7B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,6BAA6B,EAC7B,4BAA4B,EAC5B,sBAAsB,EACtB,wBAAwB,EACxB,wBAAwB,EACxB,KAAK,gBAAgB,EACrB,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,sBAAsB,EACtB,KAAK,2BAA2B,EAChC,iCAAiC,EACjC,KAAK,mBAAmB,EACxB,2BAA2B,EAC3B,KAAK,WAAW,EAChB,KAAK,wBAAwB,EAC7B,yBAAyB,EACzB,iBAAiB,EACjB,8BAA8B,EAC9B,KAAK,oBAAoB,EACzB,0BAA0B,GAC1B,MAAM,oBAAoB,CAAC"}
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@ export { clientMetaSchema, } from "./client-meta.js";
3
3
  export { DEFAULT_AUTO_DETECT_COLOR_SCHEME_ATTRS } from "./defaults.js";
4
4
  export { ErrorCategory, ErrorCategorySchema, ErrorEventSchema, ProtocolError, } from "./errors.js";
5
5
  export { claimPendingFlowAssignmentsRequestSchema, claimPendingFlowAssignmentsResponseSchema, flowAssignmentRecipientRequestSchema, flowAssignmentRecordSchema, flowAssignmentStatusSchema, flowAssignmentTargetingContextSchema, listPendingFlowAssignmentsResponseSchema, nullableUpdateFlowAssignmentLifecycleResponseSchema, releaseFlowAssignmentClaimRequestSchema, releaseFlowAssignmentClaimResponseSchema, updateFlowAssignmentLifecycleRequestSchema, updateFlowAssignmentLifecycleResponseSchema, } from "./flow-assignments.js";
6
+ export { flowDisplaySyncRequestSchema, flowDisplaySyncResponseSchema, runtimeDisplayBroadcastsSchema, } from "./flow-display.js";
6
7
  export { buildIdentityTypeGuidanceMessage, getIdentityTypeSuggestion, IDENTITY_TYPE_VALUES, isIdentityTypeValue, } from "./identity-type.js";
7
8
  export { isPublicGrantScope, publicGrantScopeIdSchema, } from "./public-grant-scope.js";
8
9
  export { resolveApiBaseUrl, resolveCoreUrl, resolveTrpcBaseUrl, runtimeEndpointsSchema, } from "./runtime-endpoints.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getuserfeedback/protocol",
3
- "version": "1.3.1",
3
+ "version": "1.5.0",
4
4
  "description": "getuserfeedback widget protocol — host surface and (later) wire protocol",
5
5
  "keywords": [
6
6
  "getuserfeedback",
@@ -106,6 +106,12 @@
106
106
  "import": "./dist/flow-assignments.js",
107
107
  "default": "./dist/flow-assignments.js"
108
108
  },
109
+ "./flow-display": {
110
+ "types": "./dist/flow-display.d.ts",
111
+ "bun": "./src/flow-display.ts",
112
+ "import": "./dist/flow-display.js",
113
+ "default": "./dist/flow-display.js"
114
+ },
109
115
  "./trpc-envelope": {
110
116
  "types": "./dist/trpc-envelope.d.ts",
111
117
  "bun": "./src/trpc-envelope.ts",
@@ -25,7 +25,7 @@ const flowAssignmentExternalIdIdentityTypeSchema = z.string().check(
25
25
  FlowAssignmentExternalIdIdentityTypeValue
26
26
  >;
27
27
 
28
- const flowAssignmentIdentitySchema = z.object({
28
+ export const flowAssignmentIdentitySchema = z.object({
29
29
  type: z.union([
30
30
  appEventIdentityTypeSchema,
31
31
  flowAssignmentExternalIdIdentityTypeSchema,
@@ -0,0 +1,99 @@
1
+ import { describe, expect, it } from "bun:test";
2
+ import {
3
+ flowDisplaySyncRequestSchema,
4
+ flowDisplaySyncResponseSchema,
5
+ } from "./flow-display";
6
+
7
+ describe("flow display sync contracts", () => {
8
+ it("accepts assignment claim input plus broadcast manifest version", () => {
9
+ const result = flowDisplaySyncRequestSchema.parse({
10
+ holdOwnerKey: "inst_1",
11
+ identities: [{ type: "anonymousId", value: "anon_1" }],
12
+ context: {
13
+ page: { path: "/pricing" },
14
+ capabilities: [{ key: "checkout.drawer" }],
15
+ },
16
+ assignmentLimit: 2,
17
+ knownBroadcastManifestVersion: "broadcasts_1",
18
+ });
19
+
20
+ expect(result).toEqual({
21
+ holdOwnerKey: "inst_1",
22
+ identities: [{ type: "anonymousId", value: "anon_1" }],
23
+ context: {
24
+ page: { path: "/pricing" },
25
+ capabilities: [{ key: "checkout.drawer" }],
26
+ },
27
+ assignmentLimit: 2,
28
+ knownBroadcastManifestVersion: "broadcasts_1",
29
+ });
30
+ });
31
+
32
+ it("accepts claimed assignments with an empty broadcast manifest", () => {
33
+ const result = flowDisplaySyncResponseSchema.parse({
34
+ fetchedAt: "2026-06-18T00:00:00.000Z",
35
+ assignments: {
36
+ claimed: [
37
+ {
38
+ flowAssignmentId: "fa_1",
39
+ flowId: "sur_1",
40
+ holdGroupToken: "hold_1",
41
+ latestFlowVersionId: "flv_1",
42
+ status: "held",
43
+ assignedAt: "2026-06-18T00:00:00.000Z",
44
+ },
45
+ ],
46
+ },
47
+ broadcasts: {
48
+ version: "empty",
49
+ opportunities: [],
50
+ },
51
+ });
52
+
53
+ expect(result.assignments.claimed[0]?.flowAssignmentId).toBe("fa_1");
54
+ expect(result.broadcasts.opportunities).toEqual([]);
55
+ });
56
+
57
+ it("accepts runtime broadcast opportunities", () => {
58
+ const result = flowDisplaySyncResponseSchema.parse({
59
+ fetchedAt: "2026-06-18T00:00:00.000Z",
60
+ assignments: {
61
+ claimed: [],
62
+ },
63
+ broadcasts: {
64
+ version: "broadcasts_1",
65
+ opportunities: [
66
+ {
67
+ opportunityId: "rtb_daver_1",
68
+ flowId: "sur_1",
69
+ flowVersionId: "flv_1",
70
+ source: {
71
+ kind: "runtime_broadcast",
72
+ automationId: "dauto_1",
73
+ automationVersionId: "daver_1",
74
+ },
75
+ runtimeEligibility: {
76
+ requiredCapabilities: ["checkout.drawer"],
77
+ requiredPage: { path: "/checkout/*" },
78
+ },
79
+ },
80
+ ],
81
+ },
82
+ });
83
+
84
+ expect(result.broadcasts.opportunities[0]).toEqual({
85
+ opportunityId: "rtb_daver_1",
86
+ flowId: "sur_1",
87
+ flowVersionId: "flv_1",
88
+ source: {
89
+ kind: "runtime_broadcast",
90
+ automationId: "dauto_1",
91
+ automationVersionId: "daver_1",
92
+ },
93
+ runtimeEligibility: {
94
+ requiredCapabilities: ["checkout.drawer"],
95
+ requiredPage: { path: "/checkout/*" },
96
+ },
97
+ });
98
+ });
99
+ });
@@ -0,0 +1,71 @@
1
+ import * as z from "zod/mini";
2
+
3
+ import {
4
+ flowAssignmentIdentitySchema,
5
+ flowAssignmentRecordSchema,
6
+ flowAssignmentTargetingContextSchema,
7
+ } from "./flow-assignments.js";
8
+
9
+ export const runtimeDisplayEligibilitySchema = z.object({
10
+ requiredCapabilities: z._default(
11
+ z.array(z.string().check(z.trim(), z.minLength(1))),
12
+ [],
13
+ ),
14
+ requiredPage: z.optional(
15
+ z.object({
16
+ path: z.string().check(z.trim(), z.minLength(1)),
17
+ }),
18
+ ),
19
+ });
20
+
21
+ export const runtimeDisplayBroadcastOpportunitySchema = z.object({
22
+ opportunityId: z.string().check(z.trim(), z.minLength(1)),
23
+ flowId: z.string().check(z.trim(), z.minLength(1)),
24
+ flowVersionId: z.string().check(z.trim(), z.minLength(1)),
25
+ source: z.object({
26
+ kind: z.literal("runtime_broadcast"),
27
+ automationId: z.optional(z.string().check(z.trim(), z.minLength(1))),
28
+ automationVersionId: z.optional(z.string().check(z.trim(), z.minLength(1))),
29
+ }),
30
+ runtimeEligibility: runtimeDisplayEligibilitySchema,
31
+ });
32
+
33
+ export const runtimeDisplayBroadcastsSchema = z.object({
34
+ version: z.string().check(z.trim(), z.minLength(1)),
35
+ opportunities: z.array(runtimeDisplayBroadcastOpportunitySchema),
36
+ });
37
+
38
+ export const flowDisplaySyncRequestSchema = z.object({
39
+ identities: z._default(z.array(flowAssignmentIdentitySchema), []),
40
+ context: z.optional(flowAssignmentTargetingContextSchema),
41
+ holdOwnerKey: z.string().check(z.trim(), z.minLength(1)),
42
+ at: z.optional(z.number()),
43
+ assignmentLimit: z.optional(z.number()),
44
+ knownBroadcastManifestVersion: z.optional(
45
+ z.string().check(z.trim(), z.minLength(1)),
46
+ ),
47
+ });
48
+
49
+ export const flowDisplaySyncResponseSchema = z.object({
50
+ fetchedAt: z.string(),
51
+ assignments: z.object({
52
+ claimed: z.array(flowAssignmentRecordSchema),
53
+ }),
54
+ broadcasts: runtimeDisplayBroadcastsSchema,
55
+ });
56
+
57
+ export type RuntimeDisplayBroadcasts = z.output<
58
+ typeof runtimeDisplayBroadcastsSchema
59
+ >;
60
+ export type RuntimeDisplayBroadcastOpportunity = z.output<
61
+ typeof runtimeDisplayBroadcastOpportunitySchema
62
+ >;
63
+ export type RuntimeDisplayEligibility = z.output<
64
+ typeof runtimeDisplayEligibilitySchema
65
+ >;
66
+ export type FlowDisplaySyncRequest = z.output<
67
+ typeof flowDisplaySyncRequestSchema
68
+ >;
69
+ export type FlowDisplaySyncResponse = z.output<
70
+ typeof flowDisplaySyncResponseSchema
71
+ >;
package/src/index.ts CHANGED
@@ -61,6 +61,14 @@ export {
61
61
  updateFlowAssignmentLifecycleRequestSchema,
62
62
  updateFlowAssignmentLifecycleResponseSchema,
63
63
  } from "./flow-assignments.js";
64
+ export {
65
+ type FlowDisplaySyncRequest,
66
+ type FlowDisplaySyncResponse,
67
+ flowDisplaySyncRequestSchema,
68
+ flowDisplaySyncResponseSchema,
69
+ type RuntimeDisplayBroadcasts,
70
+ runtimeDisplayBroadcastsSchema,
71
+ } from "./flow-display.js";
64
72
  export {
65
73
  buildIdentityTypeGuidanceMessage,
66
74
  getIdentityTypeSuggestion,