@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.
@@ -1,4 +1,4 @@
1
- import * as z from "zod";
1
+ import * as z from "zod/mini";
2
2
  export const IDENTITY_TYPE_VALUES = [
3
3
  "anonymousId",
4
4
  "userId",
@@ -37,23 +37,21 @@ export const buildIdentityTypeGuidanceMessage = (value) => {
37
37
  const mappingExamples = COMMON_IDENTITY_TYPE_MAPPINGS.map(([from, to]) => `${from} -> ${to}`).join(", ");
38
38
  return `Unsupported identity type ${displayValue}. Use one of: ${IDENTITY_TYPE_VALUES.join(", ")}. Common mappings: ${mappingExamples}.`;
39
39
  };
40
- export const appEventIdentityTypeSchema = z
41
- .string()
42
- .trim()
43
- .min(1, "Identity type is required.")
44
- .superRefine((value, ctx) => {
45
- if (!isIdentityTypeValue(value)) {
46
- ctx.addIssue({
47
- code: "custom",
48
- fatal: true,
49
- message: buildIdentityTypeGuidanceMessage(value),
50
- });
40
+ const identityTypeInputSchema = z.string().check(z.trim(), z.minLength(1, { error: "Identity type is required." }), z.check((ctx) => {
41
+ if (isIdentityTypeValue(ctx.value)) {
42
+ return;
51
43
  }
52
- })
53
- .transform((value) => {
44
+ ctx.issues.push({
45
+ code: "custom",
46
+ input: ctx.value,
47
+ message: buildIdentityTypeGuidanceMessage(ctx.value),
48
+ continue: false,
49
+ });
50
+ }));
51
+ export const appEventIdentityTypeSchema = z.pipe(identityTypeInputSchema, z.transform((value) => {
54
52
  const parsed = parseIdentityTypeValue(value);
55
53
  if (parsed === null) {
56
54
  throw new Error(`Identity type should have been validated before transform: ${value}`);
57
55
  }
58
56
  return parsed;
59
- });
57
+ }));
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { type AppEventCapability as AppEventCapabilityAlias, type AppEventFlag as AppEventFlagAlias } from "./app-event.js";
1
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";
2
3
  export { type ClientMeta, clientMetaSchema, } from "./client-meta.js";
3
4
  export { DEFAULT_AUTO_DETECT_COLOR_SCHEME_ATTRS } from "./defaults.js";
@@ -9,5 +10,88 @@ export { getScopeMeta, isScope, listScopes, SCOPE_IDS, type Scope, scopeIdSchema
9
10
  export { type TrpcSuccessResponse, trpcSuccessResponseSchema, } from "./trpc-envelope.js";
10
11
  export { type FlowVersionResolution, flowVersionResolutionSchema, type ThemeVersionResolution, themeVersionResolutionSchema, } from "./version-resolution.js";
11
12
  export { type PublicCommandPayload, parseConfigureOptions, parseInitOptions, parsePublicCommand, publicCommandPayloadSchema, publicWidgetCommandKindSchema, } from "./widget-commands.js";
12
- export { type AuthConfigInput, type AuthJwtConfigInput, authConfigInputSchema, authJwtConfigInputSchema, type ColorSchemeConfigInput, type ConfigureOptions, type ConsentConfigInput, type CoreInstanceConfig, type CoreInstanceConfigInput, colorSchemeConfigInputSchema, configureOptionsSchema, consentConfigInputSchema, coreInstanceConfigSchema, type DebugConfigInput, debugInputSchema, type FeatureFlagConfigInput, type FlagsConfigInput, featureFlagConfigInputSchema, flagsConfigInputSchema, type HostCapabilitiesConfigInput, hostCapabilitiesConfigInputSchema, type IdentityConfigInput, INSTANCE_CONFIG_UPDATE_KEYS, type InitOptions, type InstanceUpdateableConfig, identityConfigInputSchema, initOptionsSchema, instanceUpdateableConfigSchema, type RuntimeCapabilityConfigInput, runtimeCapabilityConfigInputSchema, type TelemetryConfigInput, telemetryConfigInputSchema, } from "./widget-config.js";
13
+ export { type AuthConfigInput, type AuthJwtConfigInput, authConfigInputSchema, authJwtConfigInputSchema, type ColorSchemeConfigInput, type ConfigureOptions, type ConsentConfigInput, type CoreInstanceConfig, type CoreInstanceConfigInput, colorSchemeConfigInputSchema, configureOptionsSchema, consentConfigInputSchema, coreInstanceConfigSchema, type DebugConfigInput, debugInputSchema, type FlagsConfigInput, flagsConfigInputSchema, type HostCapabilitiesConfigInput, hostCapabilitiesConfigInputSchema, type IdentityConfigInput, INSTANCE_CONFIG_UPDATE_KEYS, type InitOptions, type InstanceUpdateableConfig, identityConfigInputSchema, initOptionsSchema, instanceUpdateableConfigSchema, type TelemetryConfigInput, telemetryConfigInputSchema, } from "./widget-config.js";
14
+ /** @deprecated Prefer {@link AppEventFlag}; legacy name from root protocol surface. */
15
+ export type FeatureFlagConfigInput = AppEventFlagAlias;
16
+ /** @deprecated Prefer {@link appEventFlagSchema}; legacy name from root protocol surface. */
17
+ export declare const featureFlagConfigInputSchema: import("zod/mini").ZodMiniObject<{
18
+ key: import("zod/mini").ZodMiniString<string>;
19
+ target: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniString<string>>;
20
+ value: import("zod/mini").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 | {
21
+ [key: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
22
+ } | null)[] | {
23
+ [key: string]: string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null;
24
+ } | null)[] | {
25
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
26
+ } | null)[] | {
27
+ [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;
28
+ } | null)[] | {
29
+ [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;
30
+ } | null)[] | {
31
+ [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;
32
+ } | null)[] | {
33
+ [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;
34
+ } | null)[] | {
35
+ [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;
36
+ } | null)[] | {
37
+ [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;
38
+ } | null)[] | {
39
+ [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;
40
+ } | null)[] | {
41
+ [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;
42
+ } | null)[] | {
43
+ [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;
44
+ } | null, unknown, import("zod/v4/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 | {
45
+ [key: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
46
+ } | null)[] | {
47
+ [key: string]: string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null;
48
+ } | null)[] | {
49
+ [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | /*elided*/ any | null)[] | /*elided*/ any | null)[] | /*elided*/ any | null;
50
+ } | null)[] | {
51
+ [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;
52
+ } | null)[] | {
53
+ [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;
54
+ } | null)[] | {
55
+ [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;
56
+ } | null)[] | {
57
+ [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;
58
+ } | null)[] | {
59
+ [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;
60
+ } | null)[] | {
61
+ [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;
62
+ } | null)[] | {
63
+ [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;
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 | (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;
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 | (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;
68
+ } | null, unknown>>;
69
+ variant: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniString<string>>;
70
+ origin: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniEnum<{
71
+ runtime_config: "runtime_config";
72
+ trigger_context: "trigger_context";
73
+ provider_sync: "provider_sync";
74
+ api: "api";
75
+ }>>;
76
+ provider: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniObject<{
77
+ name: import("zod/mini").ZodMiniString<string>;
78
+ project: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniString<string>>;
79
+ environment: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniString<string>>;
80
+ }, import("zod/v4/core").$strip>>;
81
+ status: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniString<string>>;
82
+ reason: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniString<string>>;
83
+ evaluatedAt: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniString<string>>;
84
+ }, import("zod/v4/core").$strip>;
85
+ /** @deprecated Prefer {@link AppEventCapability}; legacy name from root protocol surface. */
86
+ export type RuntimeCapabilityConfigInput = AppEventCapabilityAlias;
87
+ /** @deprecated Prefer {@link appEventCapabilitySchema}; legacy name from root protocol surface. */
88
+ export declare const runtimeCapabilityConfigInputSchema: import("zod/mini").ZodMiniObject<{
89
+ key: import("zod/mini").ZodMiniString<string>;
90
+ source: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniString<string>>;
91
+ provider: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniObject<{
92
+ name: import("zod/mini").ZodMiniString<string>;
93
+ project: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniString<string>>;
94
+ environment: import("zod/mini").ZodMiniOptional<import("zod/mini").ZodMiniString<string>>;
95
+ }, import("zod/v4/core").$strip>>;
96
+ }, import("zod/v4/core").$strip>;
13
97
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACj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AAK,sBAAsB,EAC3B,4BAA4B,GAC5B,MAAM,yBAAyB,CAAC;AACjC,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,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,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;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
@@ -1,3 +1,4 @@
1
+ import { appEventCapabilitySchema as appEventCapabilitySchemaAlias, appEventFlagSchema as appEventFlagSchemaAlias, } from "./app-event.js";
1
2
  export { appEventBaseSchema, appEventCapabilitySchema, appEventContextSchema, appEventFlagProviderSchema, appEventFlagSchema, appEventFlowDismissedSchema, appEventIdentitySchema, appEventIdentityTypeSchema, appEventPayloadSchema, appEventSurveyViewedSchema, appEventTrackSchema, } from "./app-event.js";
2
3
  export { clientMetaSchema, } from "./client-meta.js";
3
4
  export { DEFAULT_AUTO_DETECT_COLOR_SCHEME_ATTRS } from "./defaults.js";
@@ -9,4 +10,8 @@ export { getScopeMeta, isScope, listScopes, SCOPE_IDS, scopeIdSchema, } from "./
9
10
  export { trpcSuccessResponseSchema, } from "./trpc-envelope.js";
10
11
  export { flowVersionResolutionSchema, themeVersionResolutionSchema, } from "./version-resolution.js";
11
12
  export { parseConfigureOptions, parseInitOptions, parsePublicCommand, publicCommandPayloadSchema, publicWidgetCommandKindSchema, } from "./widget-commands.js";
12
- export { authConfigInputSchema, authJwtConfigInputSchema, colorSchemeConfigInputSchema, configureOptionsSchema, consentConfigInputSchema, coreInstanceConfigSchema, debugInputSchema, featureFlagConfigInputSchema, flagsConfigInputSchema, hostCapabilitiesConfigInputSchema, INSTANCE_CONFIG_UPDATE_KEYS, identityConfigInputSchema, initOptionsSchema, instanceUpdateableConfigSchema, runtimeCapabilityConfigInputSchema, telemetryConfigInputSchema, } from "./widget-config.js";
13
+ export { authConfigInputSchema, authJwtConfigInputSchema, colorSchemeConfigInputSchema, configureOptionsSchema, consentConfigInputSchema, coreInstanceConfigSchema, debugInputSchema, flagsConfigInputSchema, hostCapabilitiesConfigInputSchema, INSTANCE_CONFIG_UPDATE_KEYS, identityConfigInputSchema, initOptionsSchema, instanceUpdateableConfigSchema, telemetryConfigInputSchema, } from "./widget-config.js";
14
+ /** @deprecated Prefer {@link appEventFlagSchema}; legacy name from root protocol surface. */
15
+ export const featureFlagConfigInputSchema = appEventFlagSchemaAlias;
16
+ /** @deprecated Prefer {@link appEventCapabilitySchema}; legacy name from root protocol surface. */
17
+ export const runtimeCapabilityConfigInputSchema = appEventCapabilitySchemaAlias;
@@ -1,5 +1,5 @@
1
- import * as z from "zod";
2
- export declare const publicGrantScopeIdSchema: z.ZodEnum<{
1
+ import * as z from "zod/mini";
2
+ export declare const publicGrantScopeIdSchema: z.ZodMiniEnum<{
3
3
  "analytics.storage": "analytics.storage";
4
4
  "analytics.measurement": "analytics.measurement";
5
5
  "personalization.storage": "personalization.storage";
@@ -7,6 +7,6 @@ export declare const publicGrantScopeIdSchema: z.ZodEnum<{
7
7
  "ads.user_data": "ads.user_data";
8
8
  "ads.personalization": "ads.personalization";
9
9
  }>;
10
- export type PublicGrantScope = z.infer<typeof publicGrantScopeIdSchema>;
10
+ export type PublicGrantScope = z.output<typeof publicGrantScopeIdSchema>;
11
11
  export declare function isPublicGrantScope(value: unknown): value is PublicGrantScope;
12
12
  //# sourceMappingURL=public-grant-scope.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"public-grant-scope.d.ts","sourceRoot":"","sources":["../src/public-grant-scope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAkBzB,eAAO,MAAM,wBAAwB;;;;;;;EAA8B,CAAC;AAEpE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAExE,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,gBAAgB,CAE5E"}
1
+ {"version":3,"file":"public-grant-scope.d.ts","sourceRoot":"","sources":["../src/public-grant-scope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAkB9B,eAAO,MAAM,wBAAwB;;;;;;;EAA8B,CAAC;AAEpE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAEzE,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,gBAAgB,CAE5E"}
@@ -1,4 +1,4 @@
1
- import * as z from "zod";
1
+ import * as z from "zod/mini";
2
2
  const publicGrantScopeIds = [
3
3
  "analytics.storage",
4
4
  "analytics.measurement",
@@ -1,7 +1,7 @@
1
- import * as z from "zod";
2
- export declare const runtimeEndpointsSchema: z.ZodObject<{
3
- apiUrl: z.ZodOptional<z.ZodString>;
4
- coreUrl: z.ZodOptional<z.ZodString>;
1
+ import * as z from "zod/mini";
2
+ export declare const runtimeEndpointsSchema: z.ZodMiniObject<{
3
+ apiUrl: z.ZodMiniOptional<z.ZodMiniString<string>>;
4
+ coreUrl: z.ZodMiniOptional<z.ZodMiniString<string>>;
5
5
  }, z.core.$strict>;
6
6
  export type RuntimeEndpoints = z.output<typeof runtimeEndpointsSchema>;
7
7
  export declare const resolveCoreUrl: (runtimeEndpoints: RuntimeEndpoints | undefined) => URL | null;
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-endpoints.d.ts","sourceRoot":"","sources":["../src/runtime-endpoints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAIzB,eAAO,MAAM,sBAAsB;;;kBAKzB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAqBvE,eAAO,MAAM,cAAc,GAC1B,kBAAkB,gBAAgB,GAAG,SAAS,KAC5C,GAAG,GAAG,IAER,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC7B,kBAAkB,gBAAgB,GAAG,SAAS,KAC5C,GAAG,GAAG,IAaR,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC9B,kBAAkB,gBAAgB,GAAG,SAAS,KAC5C,GAAG,GAAG,IAaR,CAAC"}
1
+ {"version":3,"file":"runtime-endpoints.d.ts","sourceRoot":"","sources":["../src/runtime-endpoints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAI9B,eAAO,MAAM,sBAAsB;;;kBAGjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAqBvE,eAAO,MAAM,cAAc,GAC1B,kBAAkB,gBAAgB,GAAG,SAAS,KAC5C,GAAG,GAAG,IAER,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC7B,kBAAkB,gBAAgB,GAAG,SAAS,KAC5C,GAAG,GAAG,IAaR,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC9B,kBAAkB,gBAAgB,GAAG,SAAS,KAC5C,GAAG,GAAG,IAaR,CAAC"}
@@ -1,11 +1,9 @@
1
- import * as z from "zod";
2
- const absoluteUrlSchema = z.string().trim().url();
3
- export const runtimeEndpointsSchema = z
4
- .object({
1
+ import * as z from "zod/mini";
2
+ const absoluteUrlSchema = z.string().check(z.trim(), z.url());
3
+ export const runtimeEndpointsSchema = z.strictObject({
5
4
  apiUrl: z.optional(absoluteUrlSchema),
6
5
  coreUrl: z.optional(absoluteUrlSchema),
7
- })
8
- .strict();
6
+ });
9
7
  const parseAbsoluteUrl = (value) => {
10
8
  if (!value) {
11
9
  return null;
package/dist/scopes.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as z from "zod";
1
+ import * as z from "zod/mini";
2
2
  export declare const SCOPE_IDS: readonly [
3
3
  "functionality.storage",
4
4
  "security.storage",
@@ -9,7 +9,7 @@ export declare const SCOPE_IDS: readonly [
9
9
  "ads.user_data",
10
10
  "ads.personalization"
11
11
  ];
12
- export declare const scopeIdSchema: z.ZodEnum<{
12
+ export declare const scopeIdSchema: z.ZodMiniEnum<{
13
13
  "analytics.storage": "analytics.storage";
14
14
  "analytics.measurement": "analytics.measurement";
15
15
  "personalization.storage": "personalization.storage";
@@ -1 +1 @@
1
- {"version":3,"file":"scopes.d.ts","sourceRoot":"","sources":["../src/scopes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,eAAO,MAAM,SAAS,EAAE,SAAS;IAChC,uBAAuB;IACvB,kBAAkB;IAClB,mBAAmB;IACnB,uBAAuB;I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
@@ -1,4 +1,4 @@
1
- import * as z from "zod";
1
+ import * as z from "zod/mini";
2
2
  export const SCOPE_IDS = [
3
3
  "functionality.storage",
4
4
  "security.storage",
@@ -1,7 +1,7 @@
1
- import * as z from "zod";
2
- export declare const trpcSuccessResponseSchema: z.ZodObject<{
3
- result: z.ZodObject<{
4
- data: z.ZodUnknown;
1
+ import * as z from "zod/mini";
2
+ export declare const trpcSuccessResponseSchema: z.ZodMiniObject<{
3
+ result: z.ZodMiniObject<{
4
+ data: z.ZodMiniUnknown;
5
5
  }, z.core.$strip>;
6
6
  }, z.core.$strip>;
7
7
  export type TrpcSuccessResponse = z.output<typeof trpcSuccessResponseSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"trpc-envelope.d.ts","sourceRoot":"","sources":["../src/trpc-envelope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,eAAO,MAAM,yBAAyB;;;;iBAIpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
1
+ {"version":3,"file":"trpc-envelope.d.ts","sourceRoot":"","sources":["../src/trpc-envelope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAE9B,eAAO,MAAM,yBAAyB;;;;iBAIpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
- import * as z from "zod";
1
+ import * as z from "zod/mini";
2
2
  export const trpcSuccessResponseSchema = z.object({
3
3
  result: z.object({
4
4
  data: z.unknown(),
@@ -1,9 +1,9 @@
1
- import * as z from "zod";
2
- export declare const flowVersionResolutionSchema: z.ZodObject<{
3
- flowVersionId: z.ZodString;
1
+ import * as z from "zod/mini";
2
+ export declare const flowVersionResolutionSchema: z.ZodMiniObject<{
3
+ flowVersionId: z.ZodMiniString<string>;
4
4
  }, z.core.$strip>;
5
- export declare const themeVersionResolutionSchema: z.ZodObject<{
6
- themeVersionId: z.ZodString;
5
+ export declare const themeVersionResolutionSchema: z.ZodMiniObject<{
6
+ themeVersionId: z.ZodMiniString<string>;
7
7
  }, z.core.$strip>;
8
8
  export type FlowVersionResolution = z.output<typeof flowVersionResolutionSchema>;
9
9
  export type ThemeVersionResolution = z.output<typeof themeVersionResolutionSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"version-resolution.d.ts","sourceRoot":"","sources":["../src/version-resolution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAIzB,eAAO,MAAM,2BAA2B;;iBAEtC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;iBAEvC,CAAC;AAEH,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"}
1
+ {"version":3,"file":"version-resolution.d.ts","sourceRoot":"","sources":["../src/version-resolution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAI9B,eAAO,MAAM,2BAA2B;;iBAEtC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;iBAEvC,CAAC;AAEH,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"}
@@ -1,5 +1,5 @@
1
- import * as z from "zod";
2
- const versionIdSchema = z.string().trim().min(1);
1
+ import * as z from "zod/mini";
2
+ const versionIdSchema = z.string().check(z.trim(), z.minLength(1));
3
3
  export const flowVersionResolutionSchema = z.object({
4
4
  flowVersionId: versionIdSchema,
5
5
  });