@getuserfeedback/protocol 3.0.3 → 3.0.5
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/flow-display.d.ts +65 -0
- package/dist/flow-display.d.ts.map +1 -1
- package/dist/flow-display.js +12 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/preview-connection.d.ts +20 -0
- package/dist/preview-connection.d.ts.map +1 -0
- package/dist/preview-connection.js +18 -0
- package/package.json +1 -1
- package/src/flow-display.test.ts +76 -0
- package/src/flow-display.ts +18 -0
- package/src/index.ts +8 -0
- package/src/preview-connection.test.ts +47 -0
- package/src/preview-connection.ts +28 -0
package/dist/flow-display.d.ts
CHANGED
|
@@ -10,6 +10,22 @@ export declare const runtimeDisplayTriggerSchema: z.ZodMiniDiscriminatedUnion<[z
|
|
|
10
10
|
}, z.core.$strip>, z.ZodMiniObject<{
|
|
11
11
|
kind: z.ZodMiniLiteral<"exit_intent">;
|
|
12
12
|
}, z.core.$strip>], "kind">;
|
|
13
|
+
export declare const runtimeDisplayAttentionPolicySchema: z.ZodMiniObject<{
|
|
14
|
+
priority: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
15
|
+
critical: "critical";
|
|
16
|
+
high: "high";
|
|
17
|
+
normal: "normal";
|
|
18
|
+
low: "low";
|
|
19
|
+
}>>;
|
|
20
|
+
attentionMode: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
21
|
+
exclusive: "exclusive";
|
|
22
|
+
concurrent: "concurrent";
|
|
23
|
+
}>>;
|
|
24
|
+
cooldown: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
25
|
+
key: z.ZodMiniString<string>;
|
|
26
|
+
afterDisplayMs: z.ZodMiniNumber<number>;
|
|
27
|
+
}, z.core.$strip>, z.ZodMiniNull]>>;
|
|
28
|
+
}, z.core.$strip>;
|
|
13
29
|
export declare const runtimeDisplayBroadcastOpportunitySchema: z.ZodMiniObject<{
|
|
14
30
|
opportunityId: z.ZodMiniString<string>;
|
|
15
31
|
flowId: z.ZodMiniString<string>;
|
|
@@ -30,6 +46,22 @@ export declare const runtimeDisplayBroadcastOpportunitySchema: z.ZodMiniObject<{
|
|
|
30
46
|
}, z.core.$strip>, z.ZodMiniObject<{
|
|
31
47
|
kind: z.ZodMiniLiteral<"exit_intent">;
|
|
32
48
|
}, z.core.$strip>], "kind">>;
|
|
49
|
+
attentionPolicy: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
50
|
+
priority: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
51
|
+
critical: "critical";
|
|
52
|
+
high: "high";
|
|
53
|
+
normal: "normal";
|
|
54
|
+
low: "low";
|
|
55
|
+
}>>;
|
|
56
|
+
attentionMode: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
57
|
+
exclusive: "exclusive";
|
|
58
|
+
concurrent: "concurrent";
|
|
59
|
+
}>>;
|
|
60
|
+
cooldown: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
61
|
+
key: z.ZodMiniString<string>;
|
|
62
|
+
afterDisplayMs: z.ZodMiniNumber<number>;
|
|
63
|
+
}, z.core.$strip>, z.ZodMiniNull]>>;
|
|
64
|
+
}, z.core.$strip>>;
|
|
33
65
|
}, z.core.$strip>;
|
|
34
66
|
export declare const runtimeDisplayBroadcastsSchema: z.ZodMiniObject<{
|
|
35
67
|
version: z.ZodMiniString<string>;
|
|
@@ -53,6 +85,22 @@ export declare const runtimeDisplayBroadcastsSchema: z.ZodMiniObject<{
|
|
|
53
85
|
}, z.core.$strip>, z.ZodMiniObject<{
|
|
54
86
|
kind: z.ZodMiniLiteral<"exit_intent">;
|
|
55
87
|
}, z.core.$strip>], "kind">>;
|
|
88
|
+
attentionPolicy: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
89
|
+
priority: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
90
|
+
critical: "critical";
|
|
91
|
+
high: "high";
|
|
92
|
+
normal: "normal";
|
|
93
|
+
low: "low";
|
|
94
|
+
}>>;
|
|
95
|
+
attentionMode: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
96
|
+
exclusive: "exclusive";
|
|
97
|
+
concurrent: "concurrent";
|
|
98
|
+
}>>;
|
|
99
|
+
cooldown: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
100
|
+
key: z.ZodMiniString<string>;
|
|
101
|
+
afterDisplayMs: z.ZodMiniNumber<number>;
|
|
102
|
+
}, z.core.$strip>, z.ZodMiniNull]>>;
|
|
103
|
+
}, z.core.$strip>>;
|
|
56
104
|
}, z.core.$strip>>;
|
|
57
105
|
}, z.core.$strip>;
|
|
58
106
|
export declare const flowDisplaySyncRequestSchema: z.ZodMiniObject<{
|
|
@@ -198,11 +246,28 @@ export declare const flowDisplaySyncResponseSchema: z.ZodMiniObject<{
|
|
|
198
246
|
}, z.core.$strip>, z.ZodMiniObject<{
|
|
199
247
|
kind: z.ZodMiniLiteral<"exit_intent">;
|
|
200
248
|
}, z.core.$strip>], "kind">>;
|
|
249
|
+
attentionPolicy: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
250
|
+
priority: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
251
|
+
critical: "critical";
|
|
252
|
+
high: "high";
|
|
253
|
+
normal: "normal";
|
|
254
|
+
low: "low";
|
|
255
|
+
}>>;
|
|
256
|
+
attentionMode: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
257
|
+
exclusive: "exclusive";
|
|
258
|
+
concurrent: "concurrent";
|
|
259
|
+
}>>;
|
|
260
|
+
cooldown: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
261
|
+
key: z.ZodMiniString<string>;
|
|
262
|
+
afterDisplayMs: z.ZodMiniNumber<number>;
|
|
263
|
+
}, z.core.$strip>, z.ZodMiniNull]>>;
|
|
264
|
+
}, z.core.$strip>>;
|
|
201
265
|
}, z.core.$strip>>;
|
|
202
266
|
}, z.core.$strip>;
|
|
203
267
|
}, z.core.$strip>;
|
|
204
268
|
export type RuntimeDisplayBroadcasts = z.output<typeof runtimeDisplayBroadcastsSchema>;
|
|
205
269
|
export type RuntimeDisplayBroadcastOpportunity = z.output<typeof runtimeDisplayBroadcastOpportunitySchema>;
|
|
270
|
+
export type RuntimeDisplayAttentionPolicy = z.output<typeof runtimeDisplayAttentionPolicySchema>;
|
|
206
271
|
export type RuntimeDisplayEligibility = z.output<typeof runtimeDisplayEligibilitySchema>;
|
|
207
272
|
export type RuntimeDisplayTrigger = z.output<typeof runtimeDisplayTriggerSchema>;
|
|
208
273
|
export type FlowDisplaySyncRequest = z.output<typeof flowDisplaySyncRequestSchema>;
|
|
@@ -1 +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,2BAA2B;;;;2BAOtC,CAAC;AAQH,eAAO,MAAM,wCAAwC
|
|
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,2BAA2B;;;;2BAOtC,CAAC;AAQH,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;iBAY9C,CAAC;AAEH,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAenD,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,6BAA6B,GAAG,CAAC,CAAC,MAAM,CACnD,OAAO,mCAAmC,CAC1C,CAAC;AACF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAC/C,OAAO,+BAA+B,CACtC,CAAC;AACF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAC3C,OAAO,2BAA2B,CAClC,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"}
|
package/dist/flow-display.js
CHANGED
|
@@ -17,6 +17,17 @@ export const runtimeDisplayTriggerSchema = z.discriminatedUnion("kind", [
|
|
|
17
17
|
const immediateRuntimeDisplayTrigger = {
|
|
18
18
|
kind: "immediate",
|
|
19
19
|
};
|
|
20
|
+
export const runtimeDisplayAttentionPolicySchema = z.object({
|
|
21
|
+
priority: z.optional(z.enum(["critical", "high", "normal", "low"])),
|
|
22
|
+
attentionMode: z.optional(z.enum(["exclusive", "concurrent"])),
|
|
23
|
+
cooldown: z.optional(z.union([
|
|
24
|
+
z.object({
|
|
25
|
+
key: z.string().check(z.trim(), z.minLength(1)),
|
|
26
|
+
afterDisplayMs: z.number().check(z.positive()),
|
|
27
|
+
}),
|
|
28
|
+
z.null(),
|
|
29
|
+
])),
|
|
30
|
+
});
|
|
20
31
|
export const runtimeDisplayBroadcastOpportunitySchema = z.object({
|
|
21
32
|
opportunityId: z.string().check(z.trim(), z.minLength(1)),
|
|
22
33
|
flowId: z.string().check(z.trim(), z.minLength(1)),
|
|
@@ -28,6 +39,7 @@ export const runtimeDisplayBroadcastOpportunitySchema = z.object({
|
|
|
28
39
|
}),
|
|
29
40
|
runtimeEligibility: runtimeDisplayEligibilitySchema,
|
|
30
41
|
runtimeTrigger: z._default(runtimeDisplayTriggerSchema, immediateRuntimeDisplayTrigger),
|
|
42
|
+
attentionPolicy: z.optional(runtimeDisplayAttentionPolicySchema),
|
|
31
43
|
});
|
|
32
44
|
export const runtimeDisplayBroadcastsSchema = z.object({
|
|
33
45
|
version: z.string().check(z.trim(), z.minLength(1)),
|
package/dist/index.d.ts
CHANGED
|
@@ -6,8 +6,9 @@ export { DEFAULT_AUTO_DETECT_COLOR_SCHEME_ATTRS } from "./defaults.js";
|
|
|
6
6
|
export type { ErrorEvent, ProtocolErrorCode } from "./errors.js";
|
|
7
7
|
export { ErrorCategory, ErrorCategorySchema, ErrorEventSchema, ProtocolError, } from "./errors.js";
|
|
8
8
|
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";
|
|
9
|
-
export { type FlowDisplaySyncRequest, type FlowDisplaySyncResponse, flowDisplaySyncRequestSchema, flowDisplaySyncResponseSchema, type RuntimeDisplayBroadcastOpportunity, type RuntimeDisplayBroadcasts, type RuntimeDisplayEligibility, type RuntimeDisplayTrigger, runtimeDisplayBroadcastOpportunitySchema, runtimeDisplayBroadcastsSchema, runtimeDisplayEligibilitySchema, runtimeDisplayTriggerSchema, } from "./flow-display.js";
|
|
9
|
+
export { type FlowDisplaySyncRequest, type FlowDisplaySyncResponse, flowDisplaySyncRequestSchema, flowDisplaySyncResponseSchema, type RuntimeDisplayAttentionPolicy, type RuntimeDisplayBroadcastOpportunity, type RuntimeDisplayBroadcasts, type RuntimeDisplayEligibility, type RuntimeDisplayTrigger, runtimeDisplayAttentionPolicySchema, runtimeDisplayBroadcastOpportunitySchema, runtimeDisplayBroadcastsSchema, runtimeDisplayEligibilitySchema, runtimeDisplayTriggerSchema, } from "./flow-display.js";
|
|
10
10
|
export { buildIdentityTypeGuidanceMessage, getIdentityTypeSuggestion, IDENTITY_TYPE_VALUES, type IdentityTypeValue, isIdentityTypeValue, type StandardIdentityTypeValue, } from "./identity-type.js";
|
|
11
|
+
export { type PreviewConnectionPairRequest, type PreviewConnectionPairResponse, previewConnectionPairRequestSchema, previewConnectionPairResponseSchema, } from "./preview-connection.js";
|
|
11
12
|
export { isPublicGrantScope, type PublicGrantScope, publicGrantScopeIdSchema, } from "./public-grant-scope.js";
|
|
12
13
|
export { type RuntimeEndpoints, resolveApiBaseUrl, resolveCoreUrl, resolveRealtimeUrl, resolveTrpcBaseUrl, runtimeEndpointsSchema, } from "./runtime-endpoints.js";
|
|
13
14
|
export { getScopeMeta, isScope, listScopes, SCOPE_IDS, type Scope, type ScopeMeta, scopeIdSchema, } from "./scopes.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,EACN,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,yBAAyB,GACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACN,KAAK,kBAAkB,EACvB,wBAAwB,GACxB,MAAM,oBAAoB,CAAC;AAC5B,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,0BAA0B,EAC1B,0BAA0B,E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rB,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
|
@@ -5,8 +5,9 @@ export { coreCommandPayloadSchema, } from "./core-commands.js";
|
|
|
5
5
|
export { DEFAULT_AUTO_DETECT_COLOR_SCHEME_ATTRS } from "./defaults.js";
|
|
6
6
|
export { ErrorCategory, ErrorCategorySchema, ErrorEventSchema, ProtocolError, } from "./errors.js";
|
|
7
7
|
export { claimPendingFlowAssignmentsRequestSchema, claimPendingFlowAssignmentsResponseSchema, flowAssignmentRecipientRequestSchema, flowAssignmentRecordSchema, flowAssignmentStatusSchema, flowAssignmentTargetingContextSchema, listPendingFlowAssignmentsResponseSchema, nullableUpdateFlowAssignmentLifecycleResponseSchema, releaseFlowAssignmentClaimRequestSchema, releaseFlowAssignmentClaimResponseSchema, updateFlowAssignmentLifecycleRequestSchema, updateFlowAssignmentLifecycleResponseSchema, } from "./flow-assignments.js";
|
|
8
|
-
export { flowDisplaySyncRequestSchema, flowDisplaySyncResponseSchema, runtimeDisplayBroadcastOpportunitySchema, runtimeDisplayBroadcastsSchema, runtimeDisplayEligibilitySchema, runtimeDisplayTriggerSchema, } from "./flow-display.js";
|
|
8
|
+
export { flowDisplaySyncRequestSchema, flowDisplaySyncResponseSchema, runtimeDisplayAttentionPolicySchema, runtimeDisplayBroadcastOpportunitySchema, runtimeDisplayBroadcastsSchema, runtimeDisplayEligibilitySchema, runtimeDisplayTriggerSchema, } from "./flow-display.js";
|
|
9
9
|
export { buildIdentityTypeGuidanceMessage, getIdentityTypeSuggestion, IDENTITY_TYPE_VALUES, isIdentityTypeValue, } from "./identity-type.js";
|
|
10
|
+
export { previewConnectionPairRequestSchema, previewConnectionPairResponseSchema, } from "./preview-connection.js";
|
|
10
11
|
export { isPublicGrantScope, publicGrantScopeIdSchema, } from "./public-grant-scope.js";
|
|
11
12
|
export { resolveApiBaseUrl, resolveCoreUrl, resolveRealtimeUrl, resolveTrpcBaseUrl, runtimeEndpointsSchema, } from "./runtime-endpoints.js";
|
|
12
13
|
export { getScopeMeta, isScope, listScopes, SCOPE_IDS, scopeIdSchema, } from "./scopes.js";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as z from "zod/mini";
|
|
2
|
+
export declare const previewConnectionPairRequestSchema: z.ZodMiniObject<{
|
|
3
|
+
capabilities: z.ZodMiniArray<z.ZodMiniString<string>>;
|
|
4
|
+
expectedRevision: z.ZodMiniNumber<number>;
|
|
5
|
+
pairedIdentity: z.ZodMiniString<string>;
|
|
6
|
+
pairedUrl: z.ZodMiniNullable<z.ZodMiniURL>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export declare const previewConnectionPairResponseSchema: z.ZodMiniObject<{
|
|
9
|
+
appId: z.ZodMiniString<string>;
|
|
10
|
+
capabilities: z.ZodMiniArray<z.ZodMiniString<string>>;
|
|
11
|
+
id: z.ZodMiniString<string>;
|
|
12
|
+
organizationId: z.ZodMiniString<string>;
|
|
13
|
+
pairedAt: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
14
|
+
pairedIdentity: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
15
|
+
pairedUrl: z.ZodMiniNullable<z.ZodMiniURL>;
|
|
16
|
+
revision: z.ZodMiniNumber<number>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export type PreviewConnectionPairRequest = z.output<typeof previewConnectionPairRequestSchema>;
|
|
19
|
+
export type PreviewConnectionPairResponse = z.output<typeof previewConnectionPairResponseSchema>;
|
|
20
|
+
//# sourceMappingURL=preview-connection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-connection.d.ts","sourceRoot":"","sources":["../src/preview-connection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAI9B,eAAO,MAAM,kCAAkC;;;;;iBAK7C,CAAC;AAEH,eAAO,MAAM,mCAAmC;;;;;;;;;iBAS9C,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAClD,OAAO,kCAAkC,CACzC,CAAC;AACF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CACnD,OAAO,mCAAmC,CAC1C,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as z from "zod/mini";
|
|
2
|
+
const nonEmptyStringSchema = z.string().check(z.trim(), z.minLength(1));
|
|
3
|
+
export const previewConnectionPairRequestSchema = z.object({
|
|
4
|
+
capabilities: z.array(nonEmptyStringSchema),
|
|
5
|
+
expectedRevision: z.number().check(z.int(), z.positive()),
|
|
6
|
+
pairedIdentity: nonEmptyStringSchema,
|
|
7
|
+
pairedUrl: z.nullable(z.url()),
|
|
8
|
+
});
|
|
9
|
+
export const previewConnectionPairResponseSchema = z.object({
|
|
10
|
+
appId: nonEmptyStringSchema,
|
|
11
|
+
capabilities: z.array(nonEmptyStringSchema),
|
|
12
|
+
id: nonEmptyStringSchema,
|
|
13
|
+
organizationId: nonEmptyStringSchema,
|
|
14
|
+
pairedAt: z.nullable(z.string()),
|
|
15
|
+
pairedIdentity: z.nullable(nonEmptyStringSchema),
|
|
16
|
+
pairedUrl: z.nullable(z.url()),
|
|
17
|
+
revision: z.number().check(z.int(), z.positive()),
|
|
18
|
+
});
|
package/package.json
CHANGED
package/src/flow-display.test.ts
CHANGED
|
@@ -103,6 +103,82 @@ describe("flow display sync contracts", () => {
|
|
|
103
103
|
});
|
|
104
104
|
});
|
|
105
105
|
|
|
106
|
+
it("accepts runtime broadcast attention policy metadata", () => {
|
|
107
|
+
const result = flowDisplaySyncResponseSchema.parse({
|
|
108
|
+
fetchedAt: "2026-06-18T00:00:00.000Z",
|
|
109
|
+
assignments: {
|
|
110
|
+
claimed: [],
|
|
111
|
+
},
|
|
112
|
+
broadcasts: {
|
|
113
|
+
version: "broadcasts_1",
|
|
114
|
+
opportunities: [
|
|
115
|
+
{
|
|
116
|
+
opportunityId: "rtb_daver_1",
|
|
117
|
+
flowId: "sur_1",
|
|
118
|
+
flowVersionId: "flv_1",
|
|
119
|
+
source: {
|
|
120
|
+
kind: "runtime_broadcast",
|
|
121
|
+
},
|
|
122
|
+
runtimeEligibility: {
|
|
123
|
+
requiredCapabilities: [],
|
|
124
|
+
},
|
|
125
|
+
attentionPolicy: {
|
|
126
|
+
priority: "high",
|
|
127
|
+
attentionMode: "concurrent",
|
|
128
|
+
cooldown: {
|
|
129
|
+
key: "automation:dauto_1",
|
|
130
|
+
afterDisplayMs: 60_000,
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
},
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
expect(result.broadcasts.opportunities[0]?.attentionPolicy).toEqual({
|
|
139
|
+
priority: "high",
|
|
140
|
+
attentionMode: "concurrent",
|
|
141
|
+
cooldown: {
|
|
142
|
+
key: "automation:dauto_1",
|
|
143
|
+
afterDisplayMs: 60_000,
|
|
144
|
+
},
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
it("rejects invalid runtime broadcast attention policy metadata", () => {
|
|
149
|
+
expect(() =>
|
|
150
|
+
flowDisplaySyncResponseSchema.parse({
|
|
151
|
+
fetchedAt: "2026-06-18T00:00:00.000Z",
|
|
152
|
+
assignments: {
|
|
153
|
+
claimed: [],
|
|
154
|
+
},
|
|
155
|
+
broadcasts: {
|
|
156
|
+
version: "broadcasts_1",
|
|
157
|
+
opportunities: [
|
|
158
|
+
{
|
|
159
|
+
opportunityId: "rtb_daver_1",
|
|
160
|
+
flowId: "sur_1",
|
|
161
|
+
flowVersionId: "flv_1",
|
|
162
|
+
source: {
|
|
163
|
+
kind: "runtime_broadcast",
|
|
164
|
+
},
|
|
165
|
+
runtimeEligibility: {
|
|
166
|
+
requiredCapabilities: [],
|
|
167
|
+
},
|
|
168
|
+
attentionPolicy: {
|
|
169
|
+
priority: "urgent",
|
|
170
|
+
cooldown: {
|
|
171
|
+
key: "automation:dauto_1",
|
|
172
|
+
afterDisplayMs: -1,
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
],
|
|
177
|
+
},
|
|
178
|
+
}),
|
|
179
|
+
).toThrow();
|
|
180
|
+
});
|
|
181
|
+
|
|
106
182
|
it("defaults legacy runtime broadcast opportunities to an immediate runtime trigger", () => {
|
|
107
183
|
const result = flowDisplaySyncResponseSchema.parse({
|
|
108
184
|
fetchedAt: "2026-06-18T00:00:00.000Z",
|
package/src/flow-display.ts
CHANGED
|
@@ -33,6 +33,20 @@ const immediateRuntimeDisplayTrigger: z.output<
|
|
|
33
33
|
kind: "immediate",
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
+
export const runtimeDisplayAttentionPolicySchema = z.object({
|
|
37
|
+
priority: z.optional(z.enum(["critical", "high", "normal", "low"])),
|
|
38
|
+
attentionMode: z.optional(z.enum(["exclusive", "concurrent"])),
|
|
39
|
+
cooldown: z.optional(
|
|
40
|
+
z.union([
|
|
41
|
+
z.object({
|
|
42
|
+
key: z.string().check(z.trim(), z.minLength(1)),
|
|
43
|
+
afterDisplayMs: z.number().check(z.positive()),
|
|
44
|
+
}),
|
|
45
|
+
z.null(),
|
|
46
|
+
]),
|
|
47
|
+
),
|
|
48
|
+
});
|
|
49
|
+
|
|
36
50
|
export const runtimeDisplayBroadcastOpportunitySchema = z.object({
|
|
37
51
|
opportunityId: z.string().check(z.trim(), z.minLength(1)),
|
|
38
52
|
flowId: z.string().check(z.trim(), z.minLength(1)),
|
|
@@ -47,6 +61,7 @@ export const runtimeDisplayBroadcastOpportunitySchema = z.object({
|
|
|
47
61
|
runtimeDisplayTriggerSchema,
|
|
48
62
|
immediateRuntimeDisplayTrigger,
|
|
49
63
|
),
|
|
64
|
+
attentionPolicy: z.optional(runtimeDisplayAttentionPolicySchema),
|
|
50
65
|
});
|
|
51
66
|
|
|
52
67
|
export const runtimeDisplayBroadcastsSchema = z.object({
|
|
@@ -79,6 +94,9 @@ export type RuntimeDisplayBroadcasts = z.output<
|
|
|
79
94
|
export type RuntimeDisplayBroadcastOpportunity = z.output<
|
|
80
95
|
typeof runtimeDisplayBroadcastOpportunitySchema
|
|
81
96
|
>;
|
|
97
|
+
export type RuntimeDisplayAttentionPolicy = z.output<
|
|
98
|
+
typeof runtimeDisplayAttentionPolicySchema
|
|
99
|
+
>;
|
|
82
100
|
export type RuntimeDisplayEligibility = z.output<
|
|
83
101
|
typeof runtimeDisplayEligibilitySchema
|
|
84
102
|
>;
|
package/src/index.ts
CHANGED
|
@@ -75,10 +75,12 @@ export {
|
|
|
75
75
|
type FlowDisplaySyncResponse,
|
|
76
76
|
flowDisplaySyncRequestSchema,
|
|
77
77
|
flowDisplaySyncResponseSchema,
|
|
78
|
+
type RuntimeDisplayAttentionPolicy,
|
|
78
79
|
type RuntimeDisplayBroadcastOpportunity,
|
|
79
80
|
type RuntimeDisplayBroadcasts,
|
|
80
81
|
type RuntimeDisplayEligibility,
|
|
81
82
|
type RuntimeDisplayTrigger,
|
|
83
|
+
runtimeDisplayAttentionPolicySchema,
|
|
82
84
|
runtimeDisplayBroadcastOpportunitySchema,
|
|
83
85
|
runtimeDisplayBroadcastsSchema,
|
|
84
86
|
runtimeDisplayEligibilitySchema,
|
|
@@ -92,6 +94,12 @@ export {
|
|
|
92
94
|
isIdentityTypeValue,
|
|
93
95
|
type StandardIdentityTypeValue,
|
|
94
96
|
} from "./identity-type.js";
|
|
97
|
+
export {
|
|
98
|
+
type PreviewConnectionPairRequest,
|
|
99
|
+
type PreviewConnectionPairResponse,
|
|
100
|
+
previewConnectionPairRequestSchema,
|
|
101
|
+
previewConnectionPairResponseSchema,
|
|
102
|
+
} from "./preview-connection.js";
|
|
95
103
|
export {
|
|
96
104
|
isPublicGrantScope,
|
|
97
105
|
type PublicGrantScope,
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { describe, expect, it } from "bun:test";
|
|
2
|
+
import {
|
|
3
|
+
previewConnectionPairRequestSchema,
|
|
4
|
+
previewConnectionPairResponseSchema,
|
|
5
|
+
} from "./preview-connection";
|
|
6
|
+
|
|
7
|
+
describe("preview connection protocol", () => {
|
|
8
|
+
it("parses pair requests", () => {
|
|
9
|
+
const result = previewConnectionPairRequestSchema.parse({
|
|
10
|
+
capabilities: ["post-message", "flow-display-sync"],
|
|
11
|
+
expectedRevision: 3,
|
|
12
|
+
pairedIdentity: "preview-identity",
|
|
13
|
+
pairedUrl: "https://customer.example.com/app",
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
expect(result).toEqual({
|
|
17
|
+
capabilities: ["post-message", "flow-display-sync"],
|
|
18
|
+
expectedRevision: 3,
|
|
19
|
+
pairedIdentity: "preview-identity",
|
|
20
|
+
pairedUrl: "https://customer.example.com/app",
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it("parses pair responses", () => {
|
|
25
|
+
const result = previewConnectionPairResponseSchema.parse({
|
|
26
|
+
appId: "app_123",
|
|
27
|
+
capabilities: ["post-message"],
|
|
28
|
+
id: "prvs_123",
|
|
29
|
+
organizationId: "org_123",
|
|
30
|
+
pairedAt: "2026-06-28T00:00:00.000Z",
|
|
31
|
+
pairedIdentity: "preview-identity",
|
|
32
|
+
pairedUrl: null,
|
|
33
|
+
revision: 4,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
expect(result).toEqual({
|
|
37
|
+
appId: "app_123",
|
|
38
|
+
capabilities: ["post-message"],
|
|
39
|
+
id: "prvs_123",
|
|
40
|
+
organizationId: "org_123",
|
|
41
|
+
pairedAt: "2026-06-28T00:00:00.000Z",
|
|
42
|
+
pairedIdentity: "preview-identity",
|
|
43
|
+
pairedUrl: null,
|
|
44
|
+
revision: 4,
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as z from "zod/mini";
|
|
2
|
+
|
|
3
|
+
const nonEmptyStringSchema = z.string().check(z.trim(), z.minLength(1));
|
|
4
|
+
|
|
5
|
+
export const previewConnectionPairRequestSchema = z.object({
|
|
6
|
+
capabilities: z.array(nonEmptyStringSchema),
|
|
7
|
+
expectedRevision: z.number().check(z.int(), z.positive()),
|
|
8
|
+
pairedIdentity: nonEmptyStringSchema,
|
|
9
|
+
pairedUrl: z.nullable(z.url()),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export const previewConnectionPairResponseSchema = z.object({
|
|
13
|
+
appId: nonEmptyStringSchema,
|
|
14
|
+
capabilities: z.array(nonEmptyStringSchema),
|
|
15
|
+
id: nonEmptyStringSchema,
|
|
16
|
+
organizationId: nonEmptyStringSchema,
|
|
17
|
+
pairedAt: z.nullable(z.string()),
|
|
18
|
+
pairedIdentity: z.nullable(nonEmptyStringSchema),
|
|
19
|
+
pairedUrl: z.nullable(z.url()),
|
|
20
|
+
revision: z.number().check(z.int(), z.positive()),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export type PreviewConnectionPairRequest = z.output<
|
|
24
|
+
typeof previewConnectionPairRequestSchema
|
|
25
|
+
>;
|
|
26
|
+
export type PreviewConnectionPairResponse = z.output<
|
|
27
|
+
typeof previewConnectionPairResponseSchema
|
|
28
|
+
>;
|