@getuserfeedback/protocol 1.2.0 → 1.3.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.
|
@@ -91,6 +91,11 @@ export declare const flowAssignmentTargetingContextSchema: z.ZodMiniObject<{
|
|
|
91
91
|
environment: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
92
92
|
}, z.core.$strip>>;
|
|
93
93
|
}, z.core.$strip>>>;
|
|
94
|
+
page: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
95
|
+
path: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
96
|
+
referrer: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
97
|
+
search: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
98
|
+
}, z.core.$strip>>;
|
|
94
99
|
}, z.core.$strip>;
|
|
95
100
|
export declare const flowAssignmentRecipientRequestSchema: z.ZodMiniObject<{
|
|
96
101
|
identities: z.ZodMiniDefault<z.ZodMiniArray<z.ZodMiniObject<{
|
|
@@ -175,6 +180,11 @@ export declare const flowAssignmentRecipientRequestSchema: z.ZodMiniObject<{
|
|
|
175
180
|
environment: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
176
181
|
}, z.core.$strip>>;
|
|
177
182
|
}, z.core.$strip>>>;
|
|
183
|
+
page: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
184
|
+
path: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
185
|
+
referrer: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
186
|
+
search: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
187
|
+
}, z.core.$strip>>;
|
|
178
188
|
}, z.core.$strip>>;
|
|
179
189
|
at: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
180
190
|
}, z.core.$strip>;
|
|
@@ -320,6 +330,11 @@ export declare const claimPendingFlowAssignmentsRequestSchema: z.ZodMiniObject<{
|
|
|
320
330
|
environment: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
321
331
|
}, z.core.$strip>>;
|
|
322
332
|
}, z.core.$strip>>>;
|
|
333
|
+
page: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
334
|
+
path: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
335
|
+
referrer: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
336
|
+
search: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
337
|
+
}, z.core.$strip>>;
|
|
323
338
|
}, z.core.$strip>>;
|
|
324
339
|
holdOwnerKey: z.ZodMiniString<string>;
|
|
325
340
|
at: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
@@ -439,6 +454,11 @@ export declare const updateFlowAssignmentLifecycleRequestSchema: z.ZodMiniObject
|
|
|
439
454
|
environment: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
440
455
|
}, z.core.$strip>>;
|
|
441
456
|
}, z.core.$strip>>>;
|
|
457
|
+
page: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
458
|
+
path: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
459
|
+
referrer: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
460
|
+
search: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
461
|
+
}, z.core.$strip>>;
|
|
442
462
|
}, z.core.$strip>>;
|
|
443
463
|
flowAssignmentId: z.ZodMiniString<string>;
|
|
444
464
|
flowVersionId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
@@ -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,GAC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6 +24,11 @@ export const flowAssignmentStatusSchema = z.enum([
|
|
|
24
24
|
export const flowAssignmentTargetingContextSchema = z.object({
|
|
25
25
|
flags: z.optional(z.array(appEventFlagSchema)),
|
|
26
26
|
capabilities: z.optional(z.array(appEventCapabilitySchema)),
|
|
27
|
+
page: z.optional(z.object({
|
|
28
|
+
path: z.optional(z.string().check(z.trim(), z.minLength(1))),
|
|
29
|
+
referrer: z.optional(z.string().check(z.trim(), z.minLength(1))),
|
|
30
|
+
search: z.optional(z.string().check(z.trim(), z.minLength(1))),
|
|
31
|
+
})),
|
|
27
32
|
});
|
|
28
33
|
export const flowAssignmentRecipientRequestSchema = z.object({
|
|
29
34
|
identities: z._default(z.array(flowAssignmentIdentitySchema), []),
|
package/package.json
CHANGED
|
@@ -12,6 +12,7 @@ describe("flow assignment request contracts", () => {
|
|
|
12
12
|
context: {
|
|
13
13
|
flags: [{ key: "new_checkout", value: true }],
|
|
14
14
|
capabilities: [{ key: "checkout.drawer", source: "host-app" }],
|
|
15
|
+
page: { path: "/checkout", search: "?step=payment" },
|
|
15
16
|
},
|
|
16
17
|
});
|
|
17
18
|
|
|
@@ -23,6 +24,10 @@ describe("flow assignment request contracts", () => {
|
|
|
23
24
|
key: "checkout.drawer",
|
|
24
25
|
source: "host-app",
|
|
25
26
|
});
|
|
27
|
+
expect(result.context?.page).toEqual({
|
|
28
|
+
path: "/checkout",
|
|
29
|
+
search: "?step=payment",
|
|
30
|
+
});
|
|
26
31
|
});
|
|
27
32
|
|
|
28
33
|
it("accepts runtime targeting context for claimPending", () => {
|
|
@@ -31,12 +36,14 @@ describe("flow assignment request contracts", () => {
|
|
|
31
36
|
context: {
|
|
32
37
|
flags: [{ key: "pricing_test", value: "variant_a" }],
|
|
33
38
|
capabilities: [{ key: "billing.portal" }],
|
|
39
|
+
page: { path: "/billing" },
|
|
34
40
|
},
|
|
35
41
|
});
|
|
36
42
|
|
|
37
43
|
expect(result.identities).toEqual([]);
|
|
38
44
|
expect(result.context?.flags?.[0]?.key).toBe("pricing_test");
|
|
39
45
|
expect(result.context?.capabilities?.[0]?.key).toBe("billing.portal");
|
|
46
|
+
expect(result.context?.page?.path).toBe("/billing");
|
|
40
47
|
});
|
|
41
48
|
|
|
42
49
|
it("accepts external ID identities for recipient continuity", () => {
|
|
@@ -103,6 +110,7 @@ describe("flow assignment request contracts", () => {
|
|
|
103
110
|
context: {
|
|
104
111
|
flags: [{ key: "new_checkout", value: true }],
|
|
105
112
|
capabilities: [{ key: "checkout.drawer", source: "host-app" }],
|
|
113
|
+
page: { path: "/checkout" },
|
|
106
114
|
},
|
|
107
115
|
});
|
|
108
116
|
|
|
@@ -114,5 +122,6 @@ describe("flow assignment request contracts", () => {
|
|
|
114
122
|
key: "checkout.drawer",
|
|
115
123
|
source: "host-app",
|
|
116
124
|
});
|
|
125
|
+
expect(result.context?.page?.path).toBe("/checkout");
|
|
117
126
|
});
|
|
118
127
|
});
|
package/src/flow-assignments.ts
CHANGED
|
@@ -48,6 +48,13 @@ export const flowAssignmentStatusSchema = z.enum([
|
|
|
48
48
|
export const flowAssignmentTargetingContextSchema = z.object({
|
|
49
49
|
flags: z.optional(z.array(appEventFlagSchema)),
|
|
50
50
|
capabilities: z.optional(z.array(appEventCapabilitySchema)),
|
|
51
|
+
page: z.optional(
|
|
52
|
+
z.object({
|
|
53
|
+
path: z.optional(z.string().check(z.trim(), z.minLength(1))),
|
|
54
|
+
referrer: z.optional(z.string().check(z.trim(), z.minLength(1))),
|
|
55
|
+
search: z.optional(z.string().check(z.trim(), z.minLength(1))),
|
|
56
|
+
}),
|
|
57
|
+
),
|
|
51
58
|
});
|
|
52
59
|
|
|
53
60
|
export const flowAssignmentRecipientRequestSchema = z.object({
|