@getuserfeedback/protocol 0.6.0 → 0.6.1

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.
@@ -0,0 +1,73 @@
1
+ import * as z from "zod/mini";
2
+ export declare const ErrorCategory: {
3
+ readonly INTERNAL: "INTERNAL";
4
+ readonly INVALID_USAGE: "INVALID_USAGE";
5
+ readonly HOST: "HOST";
6
+ };
7
+ export type ErrorCategory = (typeof ErrorCategory)[keyof typeof ErrorCategory];
8
+ export declare const ErrorCategorySchema: z.ZodMiniEnum<{
9
+ INTERNAL: "INTERNAL";
10
+ INVALID_USAGE: "INVALID_USAGE";
11
+ HOST: "HOST";
12
+ }>;
13
+ export declare const ErrorEventSchema: z.ZodMiniObject<{
14
+ id: z.ZodMiniString<string>;
15
+ name: z.ZodMiniString<string>;
16
+ message: z.ZodMiniString<string>;
17
+ stack: z.ZodMiniOptional<z.ZodMiniString<string>>;
18
+ category: z.ZodMiniEnum<{
19
+ INTERNAL: "INTERNAL";
20
+ INVALID_USAGE: "INVALID_USAGE";
21
+ HOST: "HOST";
22
+ }>;
23
+ timestamp: z.ZodMiniNumber<number>;
24
+ probability: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
25
+ context: z.ZodMiniObject<{
26
+ widgetVersion: z.ZodMiniString<string>;
27
+ clientMeta: z.ZodMiniOptional<z.ZodMiniObject<{
28
+ loader: z.ZodMiniEnum<{
29
+ custom: "custom";
30
+ sdk: "sdk";
31
+ gtm: "gtm";
32
+ segment: "segment";
33
+ rudderstack: "rudderstack";
34
+ tealium: "tealium";
35
+ }>;
36
+ clientName: z.ZodMiniOptional<z.ZodMiniString<string>>;
37
+ clientVersion: z.ZodMiniOptional<z.ZodMiniString<string>>;
38
+ integrator: z.ZodMiniOptional<z.ZodMiniObject<{
39
+ name: z.ZodMiniOptional<z.ZodMiniString<string>>;
40
+ version: z.ZodMiniOptional<z.ZodMiniString<string>>;
41
+ }, z.core.$strip>>;
42
+ transport: z.ZodMiniOptional<z.ZodMiniEnum<{
43
+ loader: "loader";
44
+ "script-tag": "script-tag";
45
+ esm: "esm";
46
+ "tag-manager": "tag-manager";
47
+ snippet: "snippet";
48
+ }>>;
49
+ runtime: z.ZodMiniOptional<z.ZodMiniObject<{
50
+ framework: z.ZodMiniOptional<z.ZodMiniEnum<{
51
+ next: "next";
52
+ vite: "vite";
53
+ webpack: "webpack";
54
+ plain: "plain";
55
+ }>>;
56
+ runtime: z.ZodMiniOptional<z.ZodMiniEnum<{
57
+ browser: "browser";
58
+ edge: "edge";
59
+ }>>;
60
+ }, z.core.$strip>>;
61
+ notes: z.ZodMiniOptional<z.ZodMiniString<string>>;
62
+ }, z.core.$strip>>;
63
+ debug: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
64
+ }, z.core.$strip>;
65
+ }, z.core.$strip>;
66
+ export type ErrorEvent = z.output<typeof ErrorEventSchema>;
67
+ export type ProtocolErrorCode = "PARSE" | "VERSION" | "UNKNOWN_TYPE";
68
+ export declare class ProtocolError extends Error {
69
+ code: ProtocolErrorCode;
70
+ details: string;
71
+ constructor(code: ProtocolErrorCode, details: string);
72
+ }
73
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAQ9B,eAAO,MAAM,aAAa;;;;CAIhB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAE/E,eAAO,MAAM,mBAAmB;;;;EAI9B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAc3B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE3D,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,SAAS,GAAG,cAAc,CAAC;AAIrE,qBAAa,aAAc,SAAQ,KAAK;IACvC,IAAI,EAAE,iBAAiB,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;gBAEJ,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM;CASpD"}
package/dist/errors.js ADDED
@@ -0,0 +1,43 @@
1
+ import * as z from "zod/mini";
2
+ import { clientMetaSchema } from "./client-meta.js";
3
+ // ---------------------------------------------------------------------------
4
+ // Error-telemetry definitions shared across widget / host.
5
+ // ---------------------------------------------------------------------------
6
+ export const ErrorCategory = {
7
+ INTERNAL: "INTERNAL",
8
+ INVALID_USAGE: "INVALID_USAGE",
9
+ HOST: "HOST",
10
+ };
11
+ export const ErrorCategorySchema = z.enum([
12
+ ErrorCategory.INTERNAL,
13
+ ErrorCategory.INVALID_USAGE,
14
+ ErrorCategory.HOST,
15
+ ]);
16
+ export const ErrorEventSchema = z.object({
17
+ id: z.string(),
18
+ name: z.string(),
19
+ message: z.string(),
20
+ stack: z.optional(z.string()),
21
+ category: ErrorCategorySchema,
22
+ timestamp: z.number(),
23
+ probability: z.optional(z.number()),
24
+ context: z.object({
25
+ widgetVersion: z.string(),
26
+ clientMeta: z.optional(clientMetaSchema),
27
+ /** When true, telemetry was captured with debug mode on (affects how to interpret context). */
28
+ debug: z.optional(z.boolean()),
29
+ }),
30
+ });
31
+ const MAX_DETAIL_LENGTH = 80;
32
+ export class ProtocolError extends Error {
33
+ code;
34
+ details;
35
+ constructor(code, details) {
36
+ const short = details.length > MAX_DETAIL_LENGTH
37
+ ? details.slice(0, MAX_DETAIL_LENGTH)
38
+ : details;
39
+ super(short);
40
+ this.code = code;
41
+ this.details = short;
42
+ }
43
+ }
@@ -358,6 +358,85 @@ export declare const updateFlowAssignmentLifecycleRequestSchema: z.ZodMiniObject
358
358
  type: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<"anonymousId" | "userId" | "traits.email" | "traits.phone" | "context.device.id" | "context.device.advertisingId" | "context.device.token", string>>;
359
359
  value: z.ZodMiniString<string>;
360
360
  }, z.core.$strip>>>;
361
+ context: z.ZodMiniOptional<z.ZodMiniObject<{
362
+ flags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
363
+ key: z.ZodMiniString<string>;
364
+ target: z.ZodMiniOptional<z.ZodMiniString<string>>;
365
+ 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 | {
366
+ [key: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
367
+ } | null)[] | {
368
+ [key: string]: string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null;
369
+ } | null)[] | {
370
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
371
+ } | null)[] | {
372
+ [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;
373
+ } | null)[] | {
374
+ [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;
375
+ } | null)[] | {
376
+ [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;
377
+ } | null)[] | {
378
+ [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;
379
+ } | null)[] | {
380
+ [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;
381
+ } | null)[] | {
382
+ [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;
383
+ } | null)[] | {
384
+ [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;
385
+ } | null)[] | {
386
+ [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;
387
+ } | null)[] | {
388
+ [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;
389
+ } | 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 | {
390
+ [key: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
391
+ } | null)[] | {
392
+ [key: string]: string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null;
393
+ } | null)[] | {
394
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
395
+ } | null)[] | {
396
+ [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;
397
+ } | null)[] | {
398
+ [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;
399
+ } | null)[] | {
400
+ [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;
401
+ } | null)[] | {
402
+ [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;
403
+ } | null)[] | {
404
+ [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;
405
+ } | null)[] | {
406
+ [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;
407
+ } | null)[] | {
408
+ [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;
409
+ } | null)[] | {
410
+ [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;
411
+ } | null)[] | {
412
+ [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;
413
+ } | null, unknown>>;
414
+ variant: z.ZodMiniOptional<z.ZodMiniString<string>>;
415
+ origin: z.ZodMiniOptional<z.ZodMiniEnum<{
416
+ runtime_config: "runtime_config";
417
+ trigger_context: "trigger_context";
418
+ provider_sync: "provider_sync";
419
+ api: "api";
420
+ }>>;
421
+ provider: z.ZodMiniOptional<z.ZodMiniObject<{
422
+ name: z.ZodMiniString<string>;
423
+ project: z.ZodMiniOptional<z.ZodMiniString<string>>;
424
+ environment: z.ZodMiniOptional<z.ZodMiniString<string>>;
425
+ }, z.core.$strip>>;
426
+ status: z.ZodMiniOptional<z.ZodMiniString<string>>;
427
+ reason: z.ZodMiniOptional<z.ZodMiniString<string>>;
428
+ evaluatedAt: z.ZodMiniOptional<z.ZodMiniString<string>>;
429
+ }, z.core.$strip>>>;
430
+ capabilities: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
431
+ key: z.ZodMiniString<string>;
432
+ source: z.ZodMiniOptional<z.ZodMiniString<string>>;
433
+ provider: z.ZodMiniOptional<z.ZodMiniObject<{
434
+ name: z.ZodMiniString<string>;
435
+ project: z.ZodMiniOptional<z.ZodMiniString<string>>;
436
+ environment: z.ZodMiniOptional<z.ZodMiniString<string>>;
437
+ }, z.core.$strip>>;
438
+ }, z.core.$strip>>>;
439
+ }, z.core.$strip>>;
361
440
  flowAssignmentId: z.ZodMiniString<string>;
362
441
  flowVersionId: z.ZodMiniOptional<z.ZodMiniString<string>>;
363
442
  holdGroupToken: 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;AAQ9B,eAAO,MAAM,0BAA0B;;;;;;;;;;EAUrC,CAAC;AAEH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAG/C,CAAC;AAEH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAI/C,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmBrC,CAAC;AAEH,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAGnD,CAAC;AAEH,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AO,MAAM,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAE/D,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC/E,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CACpD,OAAO,oCAAoC,CAC3C,CAAC;AACF,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CACpD,OAAO,oCAAoC,CAC3C,CAAC;AACF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC/E,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,MAAM,CACxD,OAAO,wCAAwC,CAC/C,CAAC;AACF,MAAM,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"}
@@ -55,6 +55,7 @@ export const claimPendingFlowAssignmentsResponseSchema = z.object({
55
55
  });
56
56
  export const updateFlowAssignmentLifecycleRequestSchema = z.object({
57
57
  identities: z._default(z.array(appEventIdentitySchema), []),
58
+ context: z.optional(flowAssignmentTargetingContextSchema),
58
59
  flowAssignmentId: z.string().check(z.trim(), z.minLength(1)),
59
60
  flowVersionId: z.optional(z.string().check(z.trim(), z.minLength(1))),
60
61
  holdGroupToken: z.optional(z.string().check(z.trim(), z.minLength(1))),
package/dist/index.d.ts CHANGED
@@ -2,6 +2,8 @@ import { type AppEventCapability as AppEventCapabilityAlias, type AppEventFlag a
2
2
  export { type AppEventCapability, type AppEventFlag, type AppEventPayload, type AppEventTrackInput, appEventBaseSchema, appEventCapabilitySchema, appEventContextSchema, appEventFlagProviderSchema, appEventFlagSchema, appEventFlowDismissedSchema, appEventIdentitySchema, appEventIdentityTypeSchema, appEventPayloadSchema, appEventSurveyViewedSchema, appEventTrackSchema, } from "./app-event.js";
3
3
  export { type ClientMeta, clientMetaSchema, } from "./client-meta.js";
4
4
  export { DEFAULT_AUTO_DETECT_COLOR_SCHEME_ATTRS } from "./defaults.js";
5
+ export type { ErrorEvent, ProtocolErrorCode } from "./errors.js";
6
+ export { ErrorCategory, ErrorCategorySchema, ErrorEventSchema, ProtocolError, } from "./errors.js";
5
7
  export { type ClaimPendingFlowAssignmentsRequest, type ClaimPendingFlowAssignmentsResponse, claimPendingFlowAssignmentsRequestSchema, claimPendingFlowAssignmentsResponseSchema, type FlowAssignmentRecipientRequest, type FlowAssignmentRecord, type FlowAssignmentStatus, type FlowAssignmentTargetingContext, flowAssignmentRecipientRequestSchema, flowAssignmentRecordSchema, flowAssignmentStatusSchema, flowAssignmentTargetingContextSchema, type ListPendingFlowAssignmentsResponse, listPendingFlowAssignmentsResponseSchema, nullableUpdateFlowAssignmentLifecycleResponseSchema, type ReleaseFlowAssignmentClaimRequest, type ReleaseFlowAssignmentClaimResponse, releaseFlowAssignmentClaimRequestSchema, releaseFlowAssignmentClaimResponseSchema, type UpdateFlowAssignmentLifecycleRequest, type UpdateFlowAssignmentLifecycleResponse, updateFlowAssignmentLifecycleRequestSchema, updateFlowAssignmentLifecycleResponseSchema, } from "./flow-assignments.js";
6
8
  export { buildIdentityTypeGuidanceMessage, getIdentityTypeSuggestion, IDENTITY_TYPE_VALUES, type IdentityTypeValue, isIdentityTypeValue, } from "./identity-type.js";
7
9
  export { isPublicGrantScope, type PublicGrantScope, publicGrantScopeIdSchema, } from "./public-grant-scope.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,kBAAkB,IAAI,uBAAuB,EAClD,KAAK,YAAY,IAAI,iBAAiB,EAGtC,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,kBAAkB,EAClB,wBAAwB,EACxB,qBAAqB,EACrB,0BAA0B,EAC1B,kBAAkB,EAClB,2BAA2B,EAC3B,sBAAsB,EACtB,0BAA0B,EAC1B,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,KAAK,UAAU,EACf,gBAAgB,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,sCAAsC,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EACN,KAAK,kCAAkC,EACvC,KAAK,mCAAmC,EACxC,wCAAwC,EACxC,yCAAyC,EACzC,KAAK,8BAA8B,EACnC,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,8BAA8B,EACnC,oCAAoC,EACpC,0BAA0B,EAC1B,0BAA0B,EAC1B,oCAAoC,EACpC,KAAK,kCAAkC,EACvC,wCAAwC,EACxC,mDAAmD,EACnD,KAAK,iCAAiC,EACtC,KAAK,kCAAkC,EACvC,uCAAuC,EACvC,wCAAwC,EACxC,KAAK,oCAAoC,EACzC,KAAK,qCAAqC,EAC1C,0CAA0C,EAC1C,2CAA2C,GAC3C,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACN,gCAAgC,EAChC,yBAAyB,EACzB,oBAAoB,EACpB,KAAK,iBAAiB,EACtB,mBAAmB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAC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BAA2B,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;AAE5B,uFAAuF;AACvF,MAAM,MAAM,sBAAsB,GAAG,iBAAiB,CAAC;AAEvD,6FAA6F;AAC7F,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAA0B,CAAC;AAEpE,6FAA6F;AAC7F,MAAM,MAAM,4BAA4B,GAAG,uBAAuB,CAAC;AAEnE,mGAAmG;AACnG,eAAO,MAAM,kCAAkC;;;;;;;;gCAAgC,CAAC"}
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@ import { appEventCapabilitySchema as appEventCapabilitySchemaAlias, appEventFlag
2
2
  export { appEventBaseSchema, appEventCapabilitySchema, appEventContextSchema, appEventFlagProviderSchema, appEventFlagSchema, appEventFlowDismissedSchema, appEventIdentitySchema, appEventIdentityTypeSchema, appEventPayloadSchema, appEventSurveyViewedSchema, appEventTrackSchema, } from "./app-event.js";
3
3
  export { clientMetaSchema, } from "./client-meta.js";
4
4
  export { DEFAULT_AUTO_DETECT_COLOR_SCHEME_ATTRS } from "./defaults.js";
5
+ export { ErrorCategory, ErrorCategorySchema, ErrorEventSchema, ProtocolError, } from "./errors.js";
5
6
  export { claimPendingFlowAssignmentsRequestSchema, claimPendingFlowAssignmentsResponseSchema, flowAssignmentRecipientRequestSchema, flowAssignmentRecordSchema, flowAssignmentStatusSchema, flowAssignmentTargetingContextSchema, listPendingFlowAssignmentsResponseSchema, nullableUpdateFlowAssignmentLifecycleResponseSchema, releaseFlowAssignmentClaimRequestSchema, releaseFlowAssignmentClaimResponseSchema, updateFlowAssignmentLifecycleRequestSchema, updateFlowAssignmentLifecycleResponseSchema, } from "./flow-assignments.js";
6
7
  export { buildIdentityTypeGuidanceMessage, getIdentityTypeSuggestion, IDENTITY_TYPE_VALUES, isIdentityTypeValue, } from "./identity-type.js";
7
8
  export { isPublicGrantScope, publicGrantScopeIdSchema, } from "./public-grant-scope.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getuserfeedback/protocol",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "getuserfeedback widget protocol — host surface and (later) wire protocol",
5
5
  "keywords": [
6
6
  "getuserfeedback",