@getuserfeedback/protocol 0.5.12 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app-event.d.ts +274 -274
- package/dist/app-event.d.ts.map +1 -1
- package/dist/app-event.js +16 -16
- package/dist/client-meta.d.ts +13 -13
- package/dist/client-meta.d.ts.map +1 -1
- package/dist/client-meta.js +6 -6
- package/dist/flow-assignments.d.ts +183 -183
- package/dist/flow-assignments.d.ts.map +1 -1
- package/dist/flow-assignments.js +16 -16
- package/dist/identity-type.d.ts +2 -2
- package/dist/identity-type.d.ts.map +1 -1
- package/dist/identity-type.js +13 -15
- package/dist/index.d.ts +85 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/public-grant-scope.d.ts +3 -3
- package/dist/public-grant-scope.d.ts.map +1 -1
- package/dist/public-grant-scope.js +1 -1
- package/dist/runtime-endpoints.d.ts +4 -4
- package/dist/runtime-endpoints.d.ts.map +1 -1
- package/dist/runtime-endpoints.js +4 -6
- package/dist/scopes.d.ts +2 -2
- package/dist/scopes.d.ts.map +1 -1
- package/dist/scopes.js +1 -1
- package/dist/trpc-envelope.d.ts +4 -4
- package/dist/trpc-envelope.d.ts.map +1 -1
- package/dist/trpc-envelope.js +1 -1
- package/dist/version-resolution.d.ts +5 -5
- package/dist/version-resolution.d.ts.map +1 -1
- package/dist/version-resolution.js +2 -2
- package/dist/widget-commands.d.ts +108 -108
- package/dist/widget-commands.d.ts.map +1 -1
- package/dist/widget-commands.js +30 -56
- package/dist/widget-config.d.ts +161 -245
- package/dist/widget-config.d.ts.map +1 -1
- package/dist/widget-config.js +22 -36
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget-config.d.ts","sourceRoot":"","sources":["../src/widget-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"widget-config.d.ts","sourceRoot":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G,CAAC,CAAC,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
package/dist/widget-config.js
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import * as z from "zod";
|
|
2
|
-
import { appEventCapabilitySchema, appEventFlagSchema
|
|
1
|
+
import * as z from "zod/mini";
|
|
2
|
+
import { appEventCapabilitySchema, appEventFlagSchema } from "./app-event.js";
|
|
3
3
|
import { clientMetaSchema } from "./client-meta.js";
|
|
4
4
|
import { DEFAULT_AUTO_DETECT_COLOR_SCHEME_ATTRS } from "./defaults.js";
|
|
5
5
|
import { runtimeEndpointsSchema } from "./runtime-endpoints.js";
|
|
6
6
|
import { scopeIdSchema } from "./scopes.js";
|
|
7
7
|
const colorSchemeValueSchema = z.enum(["light", "dark", "system"]);
|
|
8
8
|
const autoDetectColorSchemeArraySchema = z
|
|
9
|
-
.array(z.string().trim().
|
|
10
|
-
.
|
|
9
|
+
.array(z.string().check(z.trim(), z.minLength(1)))
|
|
10
|
+
.check(z.minLength(1));
|
|
11
11
|
export const colorSchemeConfigInputSchema = z.union([
|
|
12
|
-
z
|
|
13
|
-
.object({
|
|
12
|
+
z.strictObject({
|
|
14
13
|
autoDetectColorScheme: autoDetectColorSchemeArraySchema,
|
|
15
|
-
})
|
|
16
|
-
.strict(),
|
|
14
|
+
}),
|
|
17
15
|
colorSchemeValueSchema,
|
|
18
16
|
]);
|
|
19
17
|
export const telemetryConfigInputSchema = z.object({
|
|
@@ -29,32 +27,25 @@ export const debugInputSchema = z.union([
|
|
|
29
27
|
z.array(z.string()),
|
|
30
28
|
]);
|
|
31
29
|
export const authJwtConfigInputSchema = z.object({
|
|
32
|
-
token: z.string().trim().
|
|
30
|
+
token: z.string().check(z.trim(), z.minLength(1)),
|
|
33
31
|
});
|
|
34
32
|
export const authConfigInputSchema = z.object({
|
|
35
33
|
jwt: z.optional(z.union([authJwtConfigInputSchema, z.null()])),
|
|
36
34
|
});
|
|
37
35
|
export const identityConfigInputSchema = z.object({
|
|
38
|
-
anonymousId: z.optional(z.string().trim().
|
|
39
|
-
userId: z.optional(z.string().trim().
|
|
36
|
+
anonymousId: z.optional(z.string().check(z.trim(), z.minLength(1))),
|
|
37
|
+
userId: z.optional(z.string().check(z.trim(), z.minLength(1))),
|
|
40
38
|
traits: z.optional(z.record(z.string(), z.unknown())),
|
|
41
39
|
});
|
|
42
40
|
export const flagsConfigInputSchema = z.array(appEventFlagSchema);
|
|
43
41
|
export const hostCapabilitiesConfigInputSchema = z.array(appEventCapabilitySchema);
|
|
44
|
-
|
|
45
|
-
export const featureFlagConfigInputSchema = appEventFlagSchema;
|
|
46
|
-
/** @deprecated Prefer {@link appEventCapabilitySchema}; legacy name from widget-config surface. */
|
|
47
|
-
export const runtimeCapabilityConfigInputSchema = appEventCapabilitySchema;
|
|
48
|
-
export const configureOptionsSchema = z
|
|
49
|
-
.object({
|
|
42
|
+
export const configureOptionsSchema = z.strictObject({
|
|
50
43
|
colorScheme: z.optional(colorSchemeConfigInputSchema),
|
|
51
44
|
consent: z.optional(consentConfigInputSchema),
|
|
52
45
|
auth: z.optional(authConfigInputSchema),
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
.object({
|
|
57
|
-
apiKey: z.string().trim().min(1),
|
|
46
|
+
});
|
|
47
|
+
export const initOptionsSchema = z.strictObject({
|
|
48
|
+
apiKey: z.string().check(z.trim(), z.minLength(1)),
|
|
58
49
|
colorScheme: z.optional(colorSchemeConfigInputSchema),
|
|
59
50
|
disableTelemetry: z.optional(z.boolean()),
|
|
60
51
|
enableDebug: z.optional(debugInputSchema),
|
|
@@ -64,8 +55,7 @@ export const initOptionsSchema = z
|
|
|
64
55
|
flags: z.optional(flagsConfigInputSchema),
|
|
65
56
|
hostCapabilities: z.optional(hostCapabilitiesConfigInputSchema),
|
|
66
57
|
runtimeEndpoints: z.optional(runtimeEndpointsSchema),
|
|
67
|
-
})
|
|
68
|
-
.strict();
|
|
58
|
+
});
|
|
69
59
|
export const DEFAULT_COLOR_SCHEME_CONFIG = {
|
|
70
60
|
autoDetectColorScheme: [...DEFAULT_AUTO_DETECT_COLOR_SCHEME_ATTRS],
|
|
71
61
|
};
|
|
@@ -74,14 +64,12 @@ export const DEFAULT_COLOR_SCHEME_CONFIG = {
|
|
|
74
64
|
* Telemetry, enableDebug, clientMeta, SDK protocol capabilities, customer
|
|
75
65
|
* flags, and customer host capabilities are set at registration only.
|
|
76
66
|
*/
|
|
77
|
-
export const instanceUpdateableConfigSchema = z
|
|
78
|
-
.object({
|
|
67
|
+
export const instanceUpdateableConfigSchema = z.strictObject({
|
|
79
68
|
colorScheme: z.optional(colorSchemeConfigInputSchema),
|
|
80
69
|
consent: z.optional(consentConfigInputSchema),
|
|
81
70
|
auth: z.optional(authConfigInputSchema),
|
|
82
71
|
identity: z.optional(identityConfigInputSchema),
|
|
83
|
-
})
|
|
84
|
-
.strict();
|
|
72
|
+
});
|
|
85
73
|
/** Keys that may be merged into instance config (updatable subset). */
|
|
86
74
|
export const INSTANCE_CONFIG_UPDATE_KEYS = [
|
|
87
75
|
"colorScheme",
|
|
@@ -96,21 +84,19 @@ export const INSTANCE_CONFIG_UPDATE_KEYS = [
|
|
|
96
84
|
* resolved state. For update shape use InstanceUpdateableConfig. Configure
|
|
97
85
|
* command opts are in widget-commands (widgetConfigUpdateSchema).
|
|
98
86
|
*/
|
|
99
|
-
export const coreInstanceConfigSchema = z
|
|
100
|
-
.
|
|
101
|
-
colorScheme: z.optional(colorSchemeConfigInputSchema).default({
|
|
87
|
+
export const coreInstanceConfigSchema = z.strictObject({
|
|
88
|
+
colorScheme: z._default(z.optional(colorSchemeConfigInputSchema), {
|
|
102
89
|
autoDetectColorScheme: [...DEFAULT_AUTO_DETECT_COLOR_SCHEME_ATTRS],
|
|
103
90
|
}),
|
|
104
|
-
disableTelemetry: z.optional(z.boolean())
|
|
105
|
-
enableDebug: z.optional(debugInputSchema)
|
|
91
|
+
disableTelemetry: z._default(z.optional(z.boolean()), false),
|
|
92
|
+
enableDebug: z._default(z.optional(debugInputSchema), false),
|
|
106
93
|
consent: z.optional(consentConfigInputSchema),
|
|
107
94
|
auth: z.optional(authConfigInputSchema),
|
|
108
95
|
identity: z.optional(identityConfigInputSchema),
|
|
109
|
-
apiKey: z.string().trim().
|
|
96
|
+
apiKey: z.string().check(z.trim(), z.minLength(1)),
|
|
110
97
|
clientMeta: z.optional(clientMetaSchema),
|
|
111
98
|
capabilities: z.optional(z.array(z.string())),
|
|
112
99
|
flags: z.optional(flagsConfigInputSchema),
|
|
113
100
|
hostCapabilities: z.optional(hostCapabilitiesConfigInputSchema),
|
|
114
101
|
runtimeEndpoints: z.optional(runtimeEndpointsSchema),
|
|
115
|
-
})
|
|
116
|
-
.strict();
|
|
102
|
+
});
|