@getuserfeedback/protocol 0.4.0 → 0.5.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 +212 -0
- package/dist/app-event.d.ts.map +1 -0
- package/dist/app-event.js +50 -0
- package/dist/client-meta.d.ts +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/scopes.d.ts +1 -0
- package/dist/scopes.d.ts.map +1 -1
- package/dist/scopes.js +3 -0
- package/dist/widget-commands.d.ts +1 -1
- package/dist/widget-config.d.ts +11 -1
- package/dist/widget-config.d.ts.map +1 -1
- package/dist/widget-config.js +4 -1
- package/package.json +1 -1
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
export declare const appEventIdentityTypeSchema: z.ZodEnum<{
|
|
3
|
+
anonymousId: "anonymousId";
|
|
4
|
+
userId: "userId";
|
|
5
|
+
"traits.email": "traits.email";
|
|
6
|
+
"traits.phone": "traits.phone";
|
|
7
|
+
"context.device.id": "context.device.id";
|
|
8
|
+
"context.device.advertisingId": "context.device.advertisingId";
|
|
9
|
+
"context.device.token": "context.device.token";
|
|
10
|
+
}>;
|
|
11
|
+
export declare const appEventIdentitySchema: z.ZodObject<{
|
|
12
|
+
type: z.ZodEnum<{
|
|
13
|
+
anonymousId: "anonymousId";
|
|
14
|
+
userId: "userId";
|
|
15
|
+
"traits.email": "traits.email";
|
|
16
|
+
"traits.phone": "traits.phone";
|
|
17
|
+
"context.device.id": "context.device.id";
|
|
18
|
+
"context.device.advertisingId": "context.device.advertisingId";
|
|
19
|
+
"context.device.token": "context.device.token";
|
|
20
|
+
}>;
|
|
21
|
+
value: z.ZodString;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
export declare const appEventContextSchema: z.ZodObject<{
|
|
24
|
+
page: z.ZodOptional<z.ZodObject<{
|
|
25
|
+
path: z.ZodOptional<z.ZodString>;
|
|
26
|
+
referrer: z.ZodOptional<z.ZodString>;
|
|
27
|
+
search: z.ZodOptional<z.ZodString>;
|
|
28
|
+
}, z.core.$strip>>;
|
|
29
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
30
|
+
userAgent: z.ZodOptional<z.ZodString>;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
export declare const appEventBaseSchema: z.ZodObject<{
|
|
33
|
+
traits: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
34
|
+
identities: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
35
|
+
type: z.ZodEnum<{
|
|
36
|
+
anonymousId: "anonymousId";
|
|
37
|
+
userId: "userId";
|
|
38
|
+
"traits.email": "traits.email";
|
|
39
|
+
"traits.phone": "traits.phone";
|
|
40
|
+
"context.device.id": "context.device.id";
|
|
41
|
+
"context.device.advertisingId": "context.device.advertisingId";
|
|
42
|
+
"context.device.token": "context.device.token";
|
|
43
|
+
}>;
|
|
44
|
+
value: z.ZodString;
|
|
45
|
+
}, z.core.$strip>>>;
|
|
46
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
47
|
+
page: z.ZodOptional<z.ZodObject<{
|
|
48
|
+
path: z.ZodOptional<z.ZodString>;
|
|
49
|
+
referrer: z.ZodOptional<z.ZodString>;
|
|
50
|
+
search: z.ZodOptional<z.ZodString>;
|
|
51
|
+
}, z.core.$strip>>;
|
|
52
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
53
|
+
userAgent: z.ZodOptional<z.ZodString>;
|
|
54
|
+
}, z.core.$strip>>;
|
|
55
|
+
messageId: z.ZodOptional<z.ZodString>;
|
|
56
|
+
timestamp: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
export declare const appEventSurveyViewedSchema: z.ZodObject<{
|
|
59
|
+
traits: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
60
|
+
identities: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
61
|
+
type: z.ZodEnum<{
|
|
62
|
+
anonymousId: "anonymousId";
|
|
63
|
+
userId: "userId";
|
|
64
|
+
"traits.email": "traits.email";
|
|
65
|
+
"traits.phone": "traits.phone";
|
|
66
|
+
"context.device.id": "context.device.id";
|
|
67
|
+
"context.device.advertisingId": "context.device.advertisingId";
|
|
68
|
+
"context.device.token": "context.device.token";
|
|
69
|
+
}>;
|
|
70
|
+
value: z.ZodString;
|
|
71
|
+
}, z.core.$strip>>>;
|
|
72
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
73
|
+
page: z.ZodOptional<z.ZodObject<{
|
|
74
|
+
path: z.ZodOptional<z.ZodString>;
|
|
75
|
+
referrer: z.ZodOptional<z.ZodString>;
|
|
76
|
+
search: z.ZodOptional<z.ZodString>;
|
|
77
|
+
}, z.core.$strip>>;
|
|
78
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
79
|
+
userAgent: z.ZodOptional<z.ZodString>;
|
|
80
|
+
}, z.core.$strip>>;
|
|
81
|
+
messageId: z.ZodOptional<z.ZodString>;
|
|
82
|
+
timestamp: z.ZodOptional<z.ZodNumber>;
|
|
83
|
+
event: z.ZodLiteral<"Flow Viewed">;
|
|
84
|
+
references: z.ZodObject<{
|
|
85
|
+
surveyId: z.ZodString;
|
|
86
|
+
}, z.core.$strip>;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
export declare const appEventFlowDismissedSchema: z.ZodObject<{
|
|
89
|
+
traits: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
90
|
+
identities: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
91
|
+
type: z.ZodEnum<{
|
|
92
|
+
anonymousId: "anonymousId";
|
|
93
|
+
userId: "userId";
|
|
94
|
+
"traits.email": "traits.email";
|
|
95
|
+
"traits.phone": "traits.phone";
|
|
96
|
+
"context.device.id": "context.device.id";
|
|
97
|
+
"context.device.advertisingId": "context.device.advertisingId";
|
|
98
|
+
"context.device.token": "context.device.token";
|
|
99
|
+
}>;
|
|
100
|
+
value: z.ZodString;
|
|
101
|
+
}, z.core.$strip>>>;
|
|
102
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
103
|
+
page: z.ZodOptional<z.ZodObject<{
|
|
104
|
+
path: z.ZodOptional<z.ZodString>;
|
|
105
|
+
referrer: z.ZodOptional<z.ZodString>;
|
|
106
|
+
search: z.ZodOptional<z.ZodString>;
|
|
107
|
+
}, z.core.$strip>>;
|
|
108
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
109
|
+
userAgent: z.ZodOptional<z.ZodString>;
|
|
110
|
+
}, z.core.$strip>>;
|
|
111
|
+
messageId: z.ZodOptional<z.ZodString>;
|
|
112
|
+
timestamp: z.ZodOptional<z.ZodNumber>;
|
|
113
|
+
event: z.ZodLiteral<"Flow Dismissed">;
|
|
114
|
+
references: z.ZodObject<{
|
|
115
|
+
surveyId: z.ZodString;
|
|
116
|
+
}, z.core.$strip>;
|
|
117
|
+
}, z.core.$strip>;
|
|
118
|
+
export declare const appEventTrackSchema: z.ZodObject<{
|
|
119
|
+
traits: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
120
|
+
identities: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
121
|
+
type: z.ZodEnum<{
|
|
122
|
+
anonymousId: "anonymousId";
|
|
123
|
+
userId: "userId";
|
|
124
|
+
"traits.email": "traits.email";
|
|
125
|
+
"traits.phone": "traits.phone";
|
|
126
|
+
"context.device.id": "context.device.id";
|
|
127
|
+
"context.device.advertisingId": "context.device.advertisingId";
|
|
128
|
+
"context.device.token": "context.device.token";
|
|
129
|
+
}>;
|
|
130
|
+
value: z.ZodString;
|
|
131
|
+
}, z.core.$strip>>>;
|
|
132
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
133
|
+
page: z.ZodOptional<z.ZodObject<{
|
|
134
|
+
path: z.ZodOptional<z.ZodString>;
|
|
135
|
+
referrer: z.ZodOptional<z.ZodString>;
|
|
136
|
+
search: z.ZodOptional<z.ZodString>;
|
|
137
|
+
}, z.core.$strip>>;
|
|
138
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
139
|
+
userAgent: z.ZodOptional<z.ZodString>;
|
|
140
|
+
}, z.core.$strip>>;
|
|
141
|
+
messageId: z.ZodOptional<z.ZodString>;
|
|
142
|
+
timestamp: z.ZodOptional<z.ZodNumber>;
|
|
143
|
+
event: z.ZodEnum<{
|
|
144
|
+
"Flow Viewed": "Flow Viewed";
|
|
145
|
+
"Flow Dismissed": "Flow Dismissed";
|
|
146
|
+
}>;
|
|
147
|
+
references: z.ZodObject<{
|
|
148
|
+
surveyId: z.ZodString;
|
|
149
|
+
}, z.core.$strip>;
|
|
150
|
+
}, z.core.$strip>;
|
|
151
|
+
export declare const appEventPayloadSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
152
|
+
traits: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
153
|
+
identities: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
154
|
+
type: z.ZodEnum<{
|
|
155
|
+
anonymousId: "anonymousId";
|
|
156
|
+
userId: "userId";
|
|
157
|
+
"traits.email": "traits.email";
|
|
158
|
+
"traits.phone": "traits.phone";
|
|
159
|
+
"context.device.id": "context.device.id";
|
|
160
|
+
"context.device.advertisingId": "context.device.advertisingId";
|
|
161
|
+
"context.device.token": "context.device.token";
|
|
162
|
+
}>;
|
|
163
|
+
value: z.ZodString;
|
|
164
|
+
}, z.core.$strip>>>;
|
|
165
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
166
|
+
page: z.ZodOptional<z.ZodObject<{
|
|
167
|
+
path: z.ZodOptional<z.ZodString>;
|
|
168
|
+
referrer: z.ZodOptional<z.ZodString>;
|
|
169
|
+
search: z.ZodOptional<z.ZodString>;
|
|
170
|
+
}, z.core.$strip>>;
|
|
171
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
172
|
+
userAgent: z.ZodOptional<z.ZodString>;
|
|
173
|
+
}, z.core.$strip>>;
|
|
174
|
+
messageId: z.ZodOptional<z.ZodString>;
|
|
175
|
+
timestamp: z.ZodOptional<z.ZodNumber>;
|
|
176
|
+
event: z.ZodLiteral<"Flow Viewed">;
|
|
177
|
+
references: z.ZodObject<{
|
|
178
|
+
surveyId: z.ZodString;
|
|
179
|
+
}, z.core.$strip>;
|
|
180
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
181
|
+
traits: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
182
|
+
identities: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
183
|
+
type: z.ZodEnum<{
|
|
184
|
+
anonymousId: "anonymousId";
|
|
185
|
+
userId: "userId";
|
|
186
|
+
"traits.email": "traits.email";
|
|
187
|
+
"traits.phone": "traits.phone";
|
|
188
|
+
"context.device.id": "context.device.id";
|
|
189
|
+
"context.device.advertisingId": "context.device.advertisingId";
|
|
190
|
+
"context.device.token": "context.device.token";
|
|
191
|
+
}>;
|
|
192
|
+
value: z.ZodString;
|
|
193
|
+
}, z.core.$strip>>>;
|
|
194
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
195
|
+
page: z.ZodOptional<z.ZodObject<{
|
|
196
|
+
path: z.ZodOptional<z.ZodString>;
|
|
197
|
+
referrer: z.ZodOptional<z.ZodString>;
|
|
198
|
+
search: z.ZodOptional<z.ZodString>;
|
|
199
|
+
}, z.core.$strip>>;
|
|
200
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
201
|
+
userAgent: z.ZodOptional<z.ZodString>;
|
|
202
|
+
}, z.core.$strip>>;
|
|
203
|
+
messageId: z.ZodOptional<z.ZodString>;
|
|
204
|
+
timestamp: z.ZodOptional<z.ZodNumber>;
|
|
205
|
+
event: z.ZodLiteral<"Flow Dismissed">;
|
|
206
|
+
references: z.ZodObject<{
|
|
207
|
+
surveyId: z.ZodString;
|
|
208
|
+
}, z.core.$strip>;
|
|
209
|
+
}, z.core.$strip>], "event">;
|
|
210
|
+
export type AppEventTrackInput = z.output<typeof appEventTrackSchema>;
|
|
211
|
+
export type AppEventPayload = z.output<typeof appEventPayloadSchema>;
|
|
212
|
+
//# sourceMappingURL=app-event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-event.d.ts","sourceRoot":"","sources":["../src/app-event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,eAAO,MAAM,0BAA0B;;;;;;;;EAQrC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;iBAGjC,CAAC;AAQH,eAAO,MAAM,qBAAqB;;;;;;;;iBAIhC,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;iBAM7B,CAAC;AAMH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAGrC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAGtC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAG9B,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAGhC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACtE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
export const appEventIdentityTypeSchema = z.enum([
|
|
3
|
+
"anonymousId",
|
|
4
|
+
"userId",
|
|
5
|
+
"traits.email",
|
|
6
|
+
"traits.phone",
|
|
7
|
+
"context.device.id",
|
|
8
|
+
"context.device.advertisingId",
|
|
9
|
+
"context.device.token",
|
|
10
|
+
]);
|
|
11
|
+
export const appEventIdentitySchema = z.object({
|
|
12
|
+
type: appEventIdentityTypeSchema,
|
|
13
|
+
value: z.string().trim().min(1),
|
|
14
|
+
});
|
|
15
|
+
const appEventPageSchema = z.object({
|
|
16
|
+
path: z.optional(z.string()),
|
|
17
|
+
referrer: z.optional(z.string()),
|
|
18
|
+
search: z.optional(z.string()),
|
|
19
|
+
});
|
|
20
|
+
export const appEventContextSchema = z.object({
|
|
21
|
+
page: z.optional(appEventPageSchema),
|
|
22
|
+
locale: z.optional(z.string()),
|
|
23
|
+
userAgent: z.optional(z.string()),
|
|
24
|
+
});
|
|
25
|
+
export const appEventBaseSchema = z.object({
|
|
26
|
+
traits: z.optional(z.record(z.string(), z.unknown())),
|
|
27
|
+
identities: z.optional(z.array(appEventIdentitySchema)),
|
|
28
|
+
context: z.optional(appEventContextSchema),
|
|
29
|
+
messageId: z.optional(z.string()),
|
|
30
|
+
timestamp: z.optional(z.number()),
|
|
31
|
+
});
|
|
32
|
+
const appEventSurveyReferenceSchema = z.object({
|
|
33
|
+
surveyId: z.string(),
|
|
34
|
+
});
|
|
35
|
+
export const appEventSurveyViewedSchema = appEventBaseSchema.extend({
|
|
36
|
+
event: z.literal("Flow Viewed"),
|
|
37
|
+
references: appEventSurveyReferenceSchema,
|
|
38
|
+
});
|
|
39
|
+
export const appEventFlowDismissedSchema = appEventBaseSchema.extend({
|
|
40
|
+
event: z.literal("Flow Dismissed"),
|
|
41
|
+
references: appEventSurveyReferenceSchema,
|
|
42
|
+
});
|
|
43
|
+
export const appEventTrackSchema = appEventBaseSchema.extend({
|
|
44
|
+
event: z.enum(["Flow Viewed", "Flow Dismissed"]),
|
|
45
|
+
references: appEventSurveyReferenceSchema,
|
|
46
|
+
});
|
|
47
|
+
export const appEventPayloadSchema = z.discriminatedUnion("event", [
|
|
48
|
+
appEventSurveyViewedSchema,
|
|
49
|
+
appEventFlowDismissedSchema,
|
|
50
|
+
]);
|
package/dist/client-meta.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
2
|
export declare const clientMetaSchema: z.ZodObject<{
|
|
3
3
|
loader: z.ZodEnum<{
|
|
4
|
+
custom: "custom";
|
|
4
5
|
sdk: "sdk";
|
|
5
6
|
gtm: "gtm";
|
|
6
7
|
segment: "segment";
|
|
7
8
|
rudderstack: "rudderstack";
|
|
8
9
|
tealium: "tealium";
|
|
9
|
-
custom: "custom";
|
|
10
10
|
}>;
|
|
11
11
|
clientName: z.ZodOptional<z.ZodString>;
|
|
12
12
|
clientVersion: z.ZodOptional<z.ZodString>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
export { type AppEventPayload, type AppEventTrackInput, appEventBaseSchema, appEventContextSchema, appEventFlowDismissedSchema, appEventIdentitySchema, appEventIdentityTypeSchema, appEventPayloadSchema, appEventSurveyViewedSchema, appEventTrackSchema, } from "./app-event.js";
|
|
2
|
+
export { type ClientMeta, clientMetaSchema, } from "./client-meta.js";
|
|
1
3
|
export { DEFAULT_AUTO_DETECT_COLOR_SCHEME_ATTRS } from "./defaults.js";
|
|
2
|
-
export { getScopeMeta, listScopes, SCOPE_IDS, type Scope, scopeIdSchema, } from "./scopes.js";
|
|
4
|
+
export { getScopeMeta, isScope, listScopes, SCOPE_IDS, type Scope, scopeIdSchema, } from "./scopes.js";
|
|
3
5
|
export { type FlowVersionResolution, flowVersionResolutionSchema, type ThemeVersionResolution, themeVersionResolutionSchema, } from "./version-resolution.js";
|
|
4
6
|
export { type PublicCommandPayload, parseConfigureOptions, parseInitOptions, parsePublicCommand, publicCommandPayloadSchema, } from "./widget-commands.js";
|
|
5
|
-
export { type ColorSchemeConfigInput, type ConfigureOptions, colorSchemeConfigInputSchema, configureOptionsSchema, consentConfigInputSchema, type InitOptions, initOptionsSchema, } from "./widget-config.js";
|
|
7
|
+
export { type ColorSchemeConfigInput, type ConfigureOptions, colorSchemeConfigInputSchema, configureOptionsSchema, consentConfigInputSchema, type InitOptions, initOptionsSchema, isPublicGrantScope, type PublicGrantScope, publicGrantScopeIdSchema, } from "./widget-config.js";
|
|
6
8
|
//# sourceMappingURL=index.d.ts.map
|
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,EAAE,sCAAsC,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EACN,YAAY,EACZ,UAAU,EACV,SAAS,EACT,KAAK,KAAK,EACV,aAAa,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,KAAK,qBAAqB,EAC1B,2BAA2B,EAC3B,KAAK,sBAAsB,EAC3B,4BAA4B,GAC5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACN,KAAK,oBAAoB,EACzB,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EAClB,0BAA0B,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,4BAA4B,EAC5B,sBAAsB,EACtB,wBAAwB,EACxB,KAAK,WAAW,EAChB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,kBAAkB,EAClB,qBAAqB,EACrB,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,YAAY,EACZ,OAAO,EACP,UAAU,EACV,SAAS,EACT,KAAK,KAAK,EACV,aAAa,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,KAAK,qBAAqB,EAC1B,2BAA2B,EAC3B,KAAK,sBAAsB,EAC3B,4BAA4B,GAC5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACN,KAAK,oBAAoB,EACzB,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EAClB,0BAA0B,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,4BAA4B,EAC5B,sBAAsB,EACtB,wBAAwB,EACxB,KAAK,WAAW,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,gBAAgB,EACrB,wBAAwB,GACxB,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
export { appEventBaseSchema, appEventContextSchema, appEventFlowDismissedSchema, appEventIdentitySchema, appEventIdentityTypeSchema, appEventPayloadSchema, appEventSurveyViewedSchema, appEventTrackSchema, } from "./app-event.js";
|
|
2
|
+
export { clientMetaSchema, } from "./client-meta.js";
|
|
1
3
|
export { DEFAULT_AUTO_DETECT_COLOR_SCHEME_ATTRS } from "./defaults.js";
|
|
2
|
-
export { getScopeMeta, listScopes, SCOPE_IDS, scopeIdSchema, } from "./scopes.js";
|
|
4
|
+
export { getScopeMeta, isScope, listScopes, SCOPE_IDS, scopeIdSchema, } from "./scopes.js";
|
|
3
5
|
export { flowVersionResolutionSchema, themeVersionResolutionSchema, } from "./version-resolution.js";
|
|
4
6
|
export { parseConfigureOptions, parseInitOptions, parsePublicCommand, publicCommandPayloadSchema, } from "./widget-commands.js";
|
|
5
|
-
export { colorSchemeConfigInputSchema, configureOptionsSchema, consentConfigInputSchema, initOptionsSchema, } from "./widget-config.js";
|
|
7
|
+
export { colorSchemeConfigInputSchema, configureOptionsSchema, consentConfigInputSchema, initOptionsSchema, isPublicGrantScope, publicGrantScopeIdSchema, } from "./widget-config.js";
|
package/dist/scopes.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export declare const scopeIdSchema: z.ZodEnum<{
|
|
|
20
20
|
"ads.personalization": "ads.personalization";
|
|
21
21
|
}>;
|
|
22
22
|
export type Scope = (typeof SCOPE_IDS)[number];
|
|
23
|
+
export declare function isScope(value: unknown): value is Scope;
|
|
23
24
|
export type ScopeMeta = {
|
|
24
25
|
description: string;
|
|
25
26
|
};
|
package/dist/scopes.d.ts.map
CHANGED
|
@@ -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;IACvB,yBAAyB;IACzB,aAAa;IACb,eAAe;IACf,qBAAqB;CAUrB,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;EAAoB,CAAC;AAE/C,MAAM,MAAM,KAAK,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/C,MAAM,MAAM,SAAS,GAAG;IACvB,WAAW,EAAE,MAAM,CAAC;CACpB,CAAC;AAqCF,wBAAgB,YAAY,CAAC,EAAE,EAAE,KAAK,GAAG,SAAS,CAEjD;AAED,wBAAgB,UAAU,IAAI,aAAa,CAAC;IAAE,EAAE,EAAE,KAAK,CAAA;CAAE,GAAG,SAAS,CAAC,CAKrE"}
|
|
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;IACvB,yBAAyB;IACzB,aAAa;IACb,eAAe;IACf,qBAAqB;CAUrB,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;EAAoB,CAAC;AAE/C,MAAM,MAAM,KAAK,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/C,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,KAAK,CAEtD;AAED,MAAM,MAAM,SAAS,GAAG;IACvB,WAAW,EAAE,MAAM,CAAC;CACpB,CAAC;AAqCF,wBAAgB,YAAY,CAAC,EAAE,EAAE,KAAK,GAAG,SAAS,CAEjD;AAED,wBAAgB,UAAU,IAAI,aAAa,CAAC;IAAE,EAAE,EAAE,KAAK,CAAA;CAAE,GAAG,SAAS,CAAC,CAKrE"}
|
package/dist/scopes.js
CHANGED
|
@@ -10,6 +10,9 @@ export const SCOPE_IDS = [
|
|
|
10
10
|
"ads.personalization",
|
|
11
11
|
];
|
|
12
12
|
export const scopeIdSchema = z.enum(SCOPE_IDS);
|
|
13
|
+
export function isScope(value) {
|
|
14
|
+
return scopeIdSchema.safeParse(value).success;
|
|
15
|
+
}
|
|
13
16
|
const scopeMetaById = {
|
|
14
17
|
"functionality.storage": {
|
|
15
18
|
description: "Allow essential storage for core widget behavior (e.g., frequency capping, dismissals, draft answers).",
|
|
@@ -115,12 +115,12 @@ export declare const publicCommandPayloadSchema: z.ZodUnion<readonly [z.ZodDiscr
|
|
|
115
115
|
}>>]>>;
|
|
116
116
|
clientMeta: z.ZodOptional<z.ZodObject<{
|
|
117
117
|
loader: z.ZodEnum<{
|
|
118
|
+
custom: "custom";
|
|
118
119
|
sdk: "sdk";
|
|
119
120
|
gtm: "gtm";
|
|
120
121
|
segment: "segment";
|
|
121
122
|
rudderstack: "rudderstack";
|
|
122
123
|
tealium: "tealium";
|
|
123
|
-
custom: "custom";
|
|
124
124
|
}>;
|
|
125
125
|
clientName: z.ZodOptional<z.ZodString>;
|
|
126
126
|
clientVersion: z.ZodOptional<z.ZodString>;
|
package/dist/widget-config.d.ts
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
+
export declare const publicGrantScopeIdSchema: z.ZodEnum<{
|
|
3
|
+
"analytics.storage": "analytics.storage";
|
|
4
|
+
"analytics.measurement": "analytics.measurement";
|
|
5
|
+
"personalization.storage": "personalization.storage";
|
|
6
|
+
"ads.storage": "ads.storage";
|
|
7
|
+
"ads.user_data": "ads.user_data";
|
|
8
|
+
"ads.personalization": "ads.personalization";
|
|
9
|
+
}>;
|
|
10
|
+
export type PublicGrantScope = z.infer<typeof publicGrantScopeIdSchema>;
|
|
11
|
+
export declare function isPublicGrantScope(value: unknown): value is PublicGrantScope;
|
|
2
12
|
export declare const colorSchemeConfigInputSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
3
13
|
autoDetectColorScheme: z.ZodArray<z.ZodString>;
|
|
4
14
|
}, z.core.$strict>, z.ZodEnum<{
|
|
@@ -81,12 +91,12 @@ export declare const initOptionsSchema: z.ZodObject<{
|
|
|
81
91
|
}>>]>>;
|
|
82
92
|
clientMeta: z.ZodOptional<z.ZodObject<{
|
|
83
93
|
loader: z.ZodEnum<{
|
|
94
|
+
custom: "custom";
|
|
84
95
|
sdk: "sdk";
|
|
85
96
|
gtm: "gtm";
|
|
86
97
|
segment: "segment";
|
|
87
98
|
rudderstack: "rudderstack";
|
|
88
99
|
tealium: "tealium";
|
|
89
|
-
custom: "custom";
|
|
90
100
|
}>;
|
|
91
101
|
clientName: z.ZodOptional<z.ZodString>;
|
|
92
102
|
clientVersion: z.ZodOptional<z.ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget-config.d.ts","sourceRoot":"","sources":["../src/widget-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"widget-config.d.ts","sourceRoot":"","sources":["../src/widget-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AA2BzB,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;AAED,eAAO,MAAM,4BAA4B;;;;;;IAOvC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAC5C,OAAO,4BAA4B,CACnC,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;KAGnC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE3E,eAAO,MAAM,gBAAgB,2EAI3B,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;iBAShC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;kBAMzB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEvE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAWpB,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE7D,eAAO,MAAM,2BAA2B,EAAE,sBAEzC,CAAC"}
|
package/dist/widget-config.js
CHANGED
|
@@ -14,7 +14,10 @@ const publicGrantScopeIds = [
|
|
|
14
14
|
"ads.user_data",
|
|
15
15
|
"ads.personalization",
|
|
16
16
|
];
|
|
17
|
-
const publicGrantScopeIdSchema = z.enum(publicGrantScopeIds);
|
|
17
|
+
export const publicGrantScopeIdSchema = z.enum(publicGrantScopeIds);
|
|
18
|
+
export function isPublicGrantScope(value) {
|
|
19
|
+
return publicGrantScopeIdSchema.safeParse(value).success;
|
|
20
|
+
}
|
|
18
21
|
export const colorSchemeConfigInputSchema = z.union([
|
|
19
22
|
z
|
|
20
23
|
.object({
|