@pexip-engage-public/plugin 1.1.40 → 1.2.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/CHANGELOG.md +16 -0
- package/dist/configuration/PluginConfiguration.schema.d.ts +122 -510
- package/dist/configuration/PluginConfiguration.schema.d.ts.map +1 -1
- package/dist/configuration/PluginConfiguration.schema.js +14 -14
- package/dist/configuration/PluginConfiguration.schema.js.map +1 -1
- package/dist/events/event-types.d.ts +1 -0
- package/dist/events/event-types.d.ts.map +1 -1
- package/dist/instance/PluginInstance.d.ts +5 -5
- package/dist/state/PluginState.schema.d.ts +167 -996
- package/dist/state/PluginState.schema.d.ts.map +1 -1
- package/dist/state/PluginState.schema.js +7 -7
- package/dist/state/PluginState.schema.js.map +1 -1
- package/dist/state/schemas.d.ts +56 -139
- package/dist/state/schemas.d.ts.map +1 -1
- package/dist/state/schemas.js +3 -3
- package/dist/state/schemas.js.map +1 -1
- package/package.json +6 -6
- package/src/configuration/PluginConfiguration.schema.ts +14 -14
- package/src/events/event-types.ts +1 -0
- package/src/state/PluginState.schema.ts +7 -6
- package/src/state/schemas.ts +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PluginState.schema.d.ts","sourceRoot":"","sources":["../../src/state/PluginState.schema.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"PluginState.schema.d.ts","sourceRoot":"","sources":["../../src/state/PluginState.schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAOzB,OAAO,EAGL,KAAK,YAAY,EAGlB,MAAM,cAAc,CAAC;AAEtB,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AACxD,MAAM,WAAW,WAAY,SAAQ,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC;CAAG;AACzE,MAAM,WAAW,gBAAiB,SAAQ,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC;CAAG;AAE9E,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0E5B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from "zod";
|
|
2
2
|
import { FlowSchema, PluginConfigurationSchema, } from "../configuration/PluginConfiguration.schema.js";
|
|
3
3
|
import { CustomerFormSchema, form, LocationSchema, MeetingTypeSchema, } from "./schemas.js";
|
|
4
4
|
export const PluginStateSchema = z.object({
|
|
@@ -19,18 +19,18 @@ export const PluginStateSchema = z.object({
|
|
|
19
19
|
*/
|
|
20
20
|
timetable: z.literal(true).optional(),
|
|
21
21
|
})
|
|
22
|
-
.
|
|
22
|
+
.prefault({}),
|
|
23
23
|
fileUploads: z
|
|
24
|
-
.record(z.object({ answerId: z.string(), fileName: z.string(), uploadUrl: z.string().nullable() }))
|
|
24
|
+
.record(z.string(), z.object({ answerId: z.string(), fileName: z.string(), uploadUrl: z.string().nullable() }))
|
|
25
25
|
.optional(),
|
|
26
26
|
flow: FlowSchema,
|
|
27
27
|
leadSegmentId: z.string().optional(),
|
|
28
28
|
listingId: z.string().optional(),
|
|
29
29
|
/** The selected geolocation of the user */
|
|
30
|
-
location: LocationSchema.
|
|
30
|
+
location: LocationSchema.prefault({}),
|
|
31
31
|
meetingType: MeetingTypeSchema.optional(),
|
|
32
32
|
meetingTypes: MeetingTypeSchema.array().optional(),
|
|
33
|
-
metadata: z.record(z.unknown()).optional(),
|
|
33
|
+
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
34
34
|
officeId: z.string().optional(),
|
|
35
35
|
offices: z.string().array().optional(),
|
|
36
36
|
questions: form.questionnaire,
|
|
@@ -44,7 +44,7 @@ export const PluginStateSchema = z.object({
|
|
|
44
44
|
questions: z.literal(true).optional(),
|
|
45
45
|
subject: z.literal(true).optional(),
|
|
46
46
|
})
|
|
47
|
-
.
|
|
47
|
+
.prefault({}),
|
|
48
48
|
subjectGroups: z.string().array().optional(),
|
|
49
49
|
subjectId: z.string().optional(),
|
|
50
50
|
subjects: z.string().array().optional(),
|
|
@@ -65,7 +65,7 @@ export const PluginStateSchema = z.object({
|
|
|
65
65
|
/** used timezone when selecting a timeslot */
|
|
66
66
|
timeZone: z.string().optional(),
|
|
67
67
|
}))
|
|
68
|
-
.
|
|
68
|
+
.prefault({}),
|
|
69
69
|
/** Warnings that should be logged to the console */
|
|
70
70
|
warning: z.string().optional(),
|
|
71
71
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PluginState.schema.js","sourceRoot":"","sources":["../../src/state/PluginState.schema.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"PluginState.schema.js","sourceRoot":"","sources":["../../src/state/PluginState.schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EACL,UAAU,EACV,yBAAyB,GAC1B,MAAM,gDAAgD,CAAC;AAExD,OAAO,EACL,kBAAkB,EAClB,IAAI,EAEJ,cAAc,EACd,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAMtB,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAExC,6EAA6E;IAC7E,MAAM,EAAE,yBAAyB;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C,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;SAC7B,CAAC;KACH,CAAC;SACD,GAAG,CACF,CAAC,CAAC,MAAM,CAAC;QACP,8CAA8C;QAC9C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAChC,CAAC,CACH;SACA,QAAQ,CAAC,EAAE,CAAC;IACf,oDAAoD;IACpD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC"}
|
package/dist/state/schemas.d.ts
CHANGED
|
@@ -1,172 +1,89 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare const IdTypeSchema: z.ZodDefault<z.ZodEnum<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
export declare const IdTypeSchema: z.ZodDefault<z.ZodEnum<{
|
|
3
|
+
id: "id";
|
|
4
|
+
externalId: "externalId";
|
|
5
|
+
}>>;
|
|
6
|
+
export declare const LeadSegmentTypeSchema: z.ZodDefault<z.ZodEnum<{
|
|
7
|
+
id: "id";
|
|
8
|
+
code: "code";
|
|
9
|
+
}>>;
|
|
10
|
+
export declare const MeetingTypeSchema: z.ZodEnum<{
|
|
11
|
+
VIDEO: "VIDEO";
|
|
12
|
+
PHONE: "PHONE";
|
|
13
|
+
ON_LOCATION: "ON_LOCATION";
|
|
14
|
+
OFFICE: "OFFICE";
|
|
15
|
+
}>;
|
|
16
|
+
export declare const IntentSchema: z.ZodEnum<{
|
|
17
|
+
schedule: "schedule";
|
|
18
|
+
reschedule: "reschedule";
|
|
19
|
+
invite: "invite";
|
|
20
|
+
edit: "edit";
|
|
21
|
+
cancel: "cancel";
|
|
22
|
+
complete: "complete";
|
|
23
|
+
decline: "decline";
|
|
24
|
+
}>;
|
|
6
25
|
export declare const form: {
|
|
7
|
-
boolean: z.
|
|
8
|
-
email: z.ZodOptional<z.ZodNullable<z.
|
|
9
|
-
questionnaire: z.ZodOptional<z.
|
|
26
|
+
boolean: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>, z.ZodTransform<"on" | undefined, string | boolean | null | undefined>>;
|
|
27
|
+
email: z.ZodOptional<z.ZodNullable<z.ZodEmail>>;
|
|
28
|
+
questionnaire: z.ZodOptional<z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>, z.ZodTransform<Record<string, string | string[]>, Record<string, string | string[]>>>>;
|
|
10
29
|
string: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
11
30
|
};
|
|
12
31
|
export declare const util: {
|
|
13
|
-
array: z.
|
|
32
|
+
array: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>, z.ZodTransform<string[], string | string[] | null | undefined>>;
|
|
14
33
|
coerced: {
|
|
15
|
-
array: z.
|
|
16
|
-
string: z.ZodOptional<z.
|
|
34
|
+
array: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodCoercedString<unknown>, z.ZodArray<z.ZodCoercedString<unknown>>]>>>, z.ZodTransform<string[], string | string[] | null | undefined>>;
|
|
35
|
+
string: z.ZodOptional<z.ZodCoercedString<unknown>>;
|
|
17
36
|
};
|
|
18
37
|
};
|
|
19
38
|
export declare const GeolocationSchema: z.ZodObject<{
|
|
20
|
-
latitude: z.
|
|
21
|
-
longitude: z.
|
|
22
|
-
},
|
|
23
|
-
latitude: number;
|
|
24
|
-
longitude: number;
|
|
25
|
-
}, {
|
|
26
|
-
latitude: number;
|
|
27
|
-
longitude: number;
|
|
28
|
-
}>;
|
|
39
|
+
latitude: z.ZodCoercedNumber<unknown>;
|
|
40
|
+
longitude: z.ZodCoercedNumber<unknown>;
|
|
41
|
+
}, z.core.$strip>;
|
|
29
42
|
export declare const CustomerFormSchema: z.ZodObject<{
|
|
30
|
-
additionalCustomers: z.
|
|
43
|
+
additionalCustomers: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodOptional<z.ZodNullable<z.ZodEmail>>>>>, z.ZodTransform<string[] | undefined, (string | null | undefined)[] | null | undefined>>;
|
|
31
44
|
company: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
32
45
|
customerNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
33
|
-
email: z.ZodOptional<z.ZodNullable<z.
|
|
34
|
-
existing: z.
|
|
46
|
+
email: z.ZodOptional<z.ZodNullable<z.ZodEmail>>;
|
|
47
|
+
existing: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>, z.ZodTransform<"on" | undefined, string | boolean | null | undefined>>;
|
|
35
48
|
externalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
36
49
|
firstName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
37
|
-
id: z.ZodOptional<z.ZodNullable<z.
|
|
50
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodCoercedString<unknown>>>;
|
|
38
51
|
language: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
39
52
|
lastName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
40
53
|
location: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
41
54
|
city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
42
55
|
countryCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
43
56
|
geolocation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
44
|
-
latitude: z.
|
|
45
|
-
longitude: z.
|
|
46
|
-
},
|
|
47
|
-
latitude: number;
|
|
48
|
-
longitude: number;
|
|
49
|
-
}, {
|
|
50
|
-
latitude: number;
|
|
51
|
-
longitude: number;
|
|
52
|
-
}>>>;
|
|
57
|
+
latitude: z.ZodCoercedNumber<unknown>;
|
|
58
|
+
longitude: z.ZodCoercedNumber<unknown>;
|
|
59
|
+
}, z.core.$strip>>>;
|
|
53
60
|
postalCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
54
61
|
state: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
55
62
|
street1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
56
63
|
street2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
57
64
|
timeZone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
58
|
-
},
|
|
59
|
-
city?: string | null | undefined;
|
|
60
|
-
countryCode?: string | null | undefined;
|
|
61
|
-
geolocation?: {
|
|
62
|
-
latitude: number;
|
|
63
|
-
longitude: number;
|
|
64
|
-
} | null | undefined;
|
|
65
|
-
postalCode?: string | null | undefined;
|
|
66
|
-
state?: string | null | undefined;
|
|
67
|
-
street1?: string | null | undefined;
|
|
68
|
-
street2?: string | null | undefined;
|
|
69
|
-
timeZone?: string | null | undefined;
|
|
70
|
-
}, {
|
|
71
|
-
city?: string | null | undefined;
|
|
72
|
-
countryCode?: string | null | undefined;
|
|
73
|
-
geolocation?: {
|
|
74
|
-
latitude: number;
|
|
75
|
-
longitude: number;
|
|
76
|
-
} | null | undefined;
|
|
77
|
-
postalCode?: string | null | undefined;
|
|
78
|
-
state?: string | null | undefined;
|
|
79
|
-
street1?: string | null | undefined;
|
|
80
|
-
street2?: string | null | undefined;
|
|
81
|
-
timeZone?: string | null | undefined;
|
|
82
|
-
}>>>;
|
|
65
|
+
}, z.core.$strip>>>;
|
|
83
66
|
phoneNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
84
67
|
timeZone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
email?: string | null | undefined;
|
|
92
|
-
existing?: "on" | undefined;
|
|
93
|
-
firstName?: string | null | undefined;
|
|
94
|
-
language?: string | null | undefined;
|
|
95
|
-
lastName?: string | null | undefined;
|
|
96
|
-
timeZone?: string | null | undefined;
|
|
97
|
-
location?: {
|
|
98
|
-
city?: string | null | undefined;
|
|
99
|
-
countryCode?: string | null | undefined;
|
|
100
|
-
geolocation?: {
|
|
101
|
-
latitude: number;
|
|
102
|
-
longitude: number;
|
|
103
|
-
} | null | undefined;
|
|
104
|
-
postalCode?: string | null | undefined;
|
|
105
|
-
state?: string | null | undefined;
|
|
106
|
-
street1?: string | null | undefined;
|
|
107
|
-
street2?: string | null | undefined;
|
|
108
|
-
timeZone?: string | null | undefined;
|
|
109
|
-
} | null | undefined;
|
|
110
|
-
phoneNumber?: string | null | undefined;
|
|
111
|
-
}, {
|
|
112
|
-
id?: string | null | undefined;
|
|
113
|
-
externalId?: string | null | undefined;
|
|
114
|
-
additionalCustomers?: (string | null | undefined)[] | null | undefined;
|
|
115
|
-
company?: string | null | undefined;
|
|
116
|
-
customerNumber?: string | null | undefined;
|
|
117
|
-
email?: string | null | undefined;
|
|
118
|
-
existing?: string | boolean | null | undefined;
|
|
119
|
-
firstName?: string | null | undefined;
|
|
120
|
-
language?: string | null | undefined;
|
|
121
|
-
lastName?: string | null | undefined;
|
|
122
|
-
timeZone?: string | null | undefined;
|
|
123
|
-
location?: {
|
|
124
|
-
city?: string | null | undefined;
|
|
125
|
-
countryCode?: string | null | undefined;
|
|
126
|
-
geolocation?: {
|
|
127
|
-
latitude: number;
|
|
128
|
-
longitude: number;
|
|
129
|
-
} | null | undefined;
|
|
130
|
-
postalCode?: string | null | undefined;
|
|
131
|
-
state?: string | null | undefined;
|
|
132
|
-
street1?: string | null | undefined;
|
|
133
|
-
street2?: string | null | undefined;
|
|
134
|
-
timeZone?: string | null | undefined;
|
|
135
|
-
} | null | undefined;
|
|
136
|
-
phoneNumber?: string | null | undefined;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
export declare const QuestionnaireSchema: z.ZodOptional<z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>, z.ZodTransform<Record<string, string | string[]>, Record<string, string | string[]>>>>;
|
|
70
|
+
export declare const LocationSourceSchema: z.ZodEnum<{
|
|
71
|
+
config: "config";
|
|
72
|
+
listing: "listing";
|
|
73
|
+
user: "user";
|
|
137
74
|
}>;
|
|
138
|
-
export declare const QuestionnaireSchema: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>, Record<string, string | string[]>, Record<string, string | string[]>>>;
|
|
139
|
-
export declare const LocationSourceSchema: z.ZodEnum<["config", "listing", "user"]>;
|
|
140
75
|
export declare const LocationSchema: z.ZodObject<{
|
|
141
76
|
formattedAddress: z.ZodOptional<z.ZodString>;
|
|
142
77
|
geolocation: z.ZodOptional<z.ZodObject<{
|
|
143
|
-
latitude: z.
|
|
144
|
-
longitude: z.
|
|
145
|
-
},
|
|
146
|
-
latitude: number;
|
|
147
|
-
longitude: number;
|
|
148
|
-
}, {
|
|
149
|
-
latitude: number;
|
|
150
|
-
longitude: number;
|
|
151
|
-
}>>;
|
|
78
|
+
latitude: z.ZodCoercedNumber<unknown>;
|
|
79
|
+
longitude: z.ZodCoercedNumber<unknown>;
|
|
80
|
+
}, z.core.$strip>>;
|
|
152
81
|
placeId: z.ZodOptional<z.ZodString>;
|
|
153
|
-
source: z.ZodDefault<z.ZodEnum<
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
} | undefined;
|
|
160
|
-
formattedAddress?: string | undefined;
|
|
161
|
-
placeId?: string | undefined;
|
|
162
|
-
}, {
|
|
163
|
-
geolocation?: {
|
|
164
|
-
latitude: number;
|
|
165
|
-
longitude: number;
|
|
166
|
-
} | undefined;
|
|
167
|
-
formattedAddress?: string | undefined;
|
|
168
|
-
placeId?: string | undefined;
|
|
169
|
-
source?: "config" | "listing" | "user" | undefined;
|
|
170
|
-
}>;
|
|
82
|
+
source: z.ZodDefault<z.ZodEnum<{
|
|
83
|
+
config: "config";
|
|
84
|
+
listing: "listing";
|
|
85
|
+
user: "user";
|
|
86
|
+
}>>;
|
|
87
|
+
}, z.core.$strip>;
|
|
171
88
|
export declare function valueToArray<T extends string>(input?: T | T[] | null, separator?: string): T[] | undefined;
|
|
172
89
|
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/state/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/state/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,eAAO,MAAM,YAAY;;;GAA6C,CAAC;AACvE,eAAO,MAAM,qBAAqB;;;GAAyC,CAAC;AAC5E,eAAO,MAAM,iBAAiB;;;;;EAAsD,CAAC;AACrF,eAAO,MAAM,YAAY;;;;;;;;EAQvB,CAAC;AAEH,eAAO,MAAM,IAAI;;;;;CA8BhB,CAAC;AAEF,eAAO,MAAM,IAAI;;;;;;CAYhB,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;iBAG5B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4B7B,CAAC;AAEH,eAAO,MAAM,mBAAmB,uMAAqB,CAAC;AACtD,eAAO,MAAM,oBAAoB;;;;EAAwC,CAAC;AAE1E,eAAO,MAAM,cAAc;;;;;;;;;;;;iBAKzB,CAAC;AAGH,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,EAC3C,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,IAAI,EACtB,SAAS,GAAE,MAAc,GACxB,CAAC,EAAE,GAAG,SAAS,CASjB"}
|
package/dist/state/schemas.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from "zod";
|
|
2
2
|
export const IdTypeSchema = z.enum(["id", "externalId"]).default("id");
|
|
3
3
|
export const LeadSegmentTypeSchema = z.enum(["id", "code"]).default("code");
|
|
4
4
|
export const MeetingTypeSchema = z.enum(["VIDEO", "PHONE", "ON_LOCATION", "OFFICE"]);
|
|
@@ -20,9 +20,9 @@ export const form = {
|
|
|
20
20
|
return "on";
|
|
21
21
|
return undefined;
|
|
22
22
|
}),
|
|
23
|
-
email: z.
|
|
23
|
+
email: z.email().nullish(),
|
|
24
24
|
questionnaire: z
|
|
25
|
-
.record(z.union([z.string().trim(), z.array(z.string().trim())]))
|
|
25
|
+
.record(z.string(), z.union([z.string().trim(), z.array(z.string().trim())]))
|
|
26
26
|
.transform((val) => {
|
|
27
27
|
Object.keys(val).forEach((key) => {
|
|
28
28
|
if (Array.isArray(val[key])) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/state/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/state/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACvE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAC5E,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAC;AACrF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,IAAI,CAAC;IACjC,UA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,CAAC,QAAQ,EAAE;IACvC,WAAW,EAAE,iBAAiB,CAAC,QAAQ,EAAE;IACzC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,MAAM,EAAE,oBAAoB,CAAC,OAAO,CAAC,MAAM,CAAC;CAC7C,CAAC,CAAC;AAEH,MAAM,KAAK,GAAG,GAAG,CAAC;AAClB,MAAM,UAAU,YAAY,CAC1B,KAAsB,EACtB,YAAoB,KAAK;IAEzB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QAC7B,IAAI,OAAO,KAAK,EAAE;YAAE,OAAO,SAAS,CAAC;QAErC,OAAO,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAQ,CAAC;IACzD,CAAC;IAED,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAClD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pexip-engage-public/plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"homepage": "https://github.com/skedify/frontend-mono/tree/develop/apps/booking-plugin/packages/plugin-public#readme",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/skedify/frontend-mono/issues"
|
|
@@ -38,16 +38,16 @@
|
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"skedify-uri-encoding": "^2.1.2",
|
|
41
|
-
"zod": "^
|
|
42
|
-
"@pexip-engage-public/graphql": "1.
|
|
43
|
-
"@pexip-engage-public/utils": "0.1.
|
|
41
|
+
"zod": "^4.2.1",
|
|
42
|
+
"@pexip-engage-public/graphql": "1.4.0",
|
|
43
|
+
"@pexip-engage-public/utils": "0.1.53"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@total-typescript/ts-reset": "^0.6.1",
|
|
47
47
|
"happy-dom": "^20.0.11",
|
|
48
|
-
"vitest": "^4.0.
|
|
48
|
+
"vitest": "^4.0.16",
|
|
49
49
|
"@pexip-engage/tsconfig": "0.1.1",
|
|
50
|
-
"eslint-config-pexip-engage": "1.
|
|
50
|
+
"eslint-config-pexip-engage": "1.3.0"
|
|
51
51
|
},
|
|
52
52
|
"volta": {
|
|
53
53
|
"extends": "../../../../package.json"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MeetingType } from "@pexip-engage-public/graphql";
|
|
2
|
-
import
|
|
2
|
+
import * as z from "zod";
|
|
3
3
|
import { DEFAULT_FLOW, getSupportedLng } from "../constants.js";
|
|
4
4
|
import {
|
|
5
5
|
CustomerFormSchema,
|
|
@@ -74,16 +74,16 @@ export const PluginConfigurationSchema = z
|
|
|
74
74
|
*/
|
|
75
75
|
timeZoneSelection: z.enum(["enable", "disable"]).default("enable"),
|
|
76
76
|
})
|
|
77
|
-
.
|
|
77
|
+
.prefault({}),
|
|
78
78
|
browser: z
|
|
79
79
|
.object({
|
|
80
80
|
href: z.string().optional(),
|
|
81
81
|
timeZone: z.string().optional(),
|
|
82
82
|
})
|
|
83
|
-
.
|
|
83
|
+
.prefault({}),
|
|
84
84
|
customer: CustomerFormSchema.optional(),
|
|
85
85
|
/** @deprecated Only use me during application init! */
|
|
86
|
-
employees: z.object({ ids: util.coerced.array, type: IdTypeSchema }).
|
|
86
|
+
employees: z.object({ ids: util.coerced.array, type: IdTypeSchema }).prefault({}),
|
|
87
87
|
flow: FlowSchema,
|
|
88
88
|
/** @deprecated Only use me during application init! */
|
|
89
89
|
initialFormattedAddress: z.string().optional(),
|
|
@@ -101,15 +101,15 @@ export const PluginConfigurationSchema = z
|
|
|
101
101
|
.transform((value) => getSupportedLng(value)),
|
|
102
102
|
/** Lead Segment. This allows a subject to be preselected matching the lead segment code/id.*/
|
|
103
103
|
/** @deprecated Only use me during application init! */
|
|
104
|
-
leadSegment: z.object({ id: util.coerced.string, type: LeadSegmentTypeSchema }).
|
|
104
|
+
leadSegment: z.object({ id: util.coerced.string, type: LeadSegmentTypeSchema }).prefault({}),
|
|
105
105
|
/** @deprecated Only use me during application init! */
|
|
106
|
-
listing: z.object({ id: util.coerced.string, type: IdTypeSchema }).
|
|
106
|
+
listing: z.object({ id: util.coerced.string, type: IdTypeSchema }).prefault({}),
|
|
107
107
|
/**
|
|
108
108
|
* This parameter is used for prefilling the location search step, so that offices are already scoped to this location.
|
|
109
109
|
*
|
|
110
110
|
* When location is passed, both geolocation & formatted_address are required.
|
|
111
111
|
*/
|
|
112
|
-
location: LocationSchema.
|
|
112
|
+
location: LocationSchema.prefault({}),
|
|
113
113
|
/** @deprecated Only use me during application init! */
|
|
114
114
|
meetingTypes: util.coerced.array.transform((val) => val.filter(isMeetingType)),
|
|
115
115
|
/**
|
|
@@ -121,9 +121,9 @@ export const PluginConfigurationSchema = z
|
|
|
121
121
|
/** A resource_code of an existing appointment. This will allow you to complete or change an appointment. This parameter is mostly used by redirects from external sources (e.g. e-mails) and should usually not be provided manually. */
|
|
122
122
|
resourceCode: z.string().optional(),
|
|
123
123
|
})
|
|
124
|
-
.
|
|
124
|
+
.prefault({}),
|
|
125
125
|
/** @deprecated Only use me during application init! */
|
|
126
|
-
offices: z.object({ ids: util.coerced.array, type: IdTypeSchema }).
|
|
126
|
+
offices: z.object({ ids: util.coerced.array, type: IdTypeSchema }).prefault({}),
|
|
127
127
|
// TODO remove these from config, introduce a leftover
|
|
128
128
|
questions: form.questionnaire,
|
|
129
129
|
/**
|
|
@@ -144,9 +144,9 @@ export const PluginConfigurationSchema = z
|
|
|
144
144
|
/** Used to enable/disable tracking of events in the plugin for insights about conversion. @default "default" */
|
|
145
145
|
status: z.enum(["default", "disabled"]).default("default"),
|
|
146
146
|
})
|
|
147
|
-
.
|
|
147
|
+
.prefault({}),
|
|
148
148
|
/** @deprecated Only use me during application init! */
|
|
149
|
-
subjectGroups: z.object({ ids: util.coerced.array, type: IdTypeSchema }).
|
|
149
|
+
subjectGroups: z.object({ ids: util.coerced.array, type: IdTypeSchema }).prefault({}),
|
|
150
150
|
subjectQuestions: z
|
|
151
151
|
.array(
|
|
152
152
|
z.object({
|
|
@@ -156,7 +156,7 @@ export const PluginConfigurationSchema = z
|
|
|
156
156
|
)
|
|
157
157
|
.optional(),
|
|
158
158
|
/** @deprecated Only use me during application init! */
|
|
159
|
-
subjects: z.object({ ids: util.coerced.array, type: IdTypeSchema }).
|
|
159
|
+
subjects: z.object({ ids: util.coerced.array, type: IdTypeSchema }).prefault({}),
|
|
160
160
|
timetable: z
|
|
161
161
|
.object({
|
|
162
162
|
/**
|
|
@@ -173,7 +173,7 @@ export const PluginConfigurationSchema = z
|
|
|
173
173
|
*/
|
|
174
174
|
view: z.enum(["week", "month"]).default("week"),
|
|
175
175
|
})
|
|
176
|
-
.
|
|
176
|
+
.prefault({}),
|
|
177
177
|
version: z.enum(["1.0.0"]).optional(),
|
|
178
178
|
})
|
|
179
|
-
.
|
|
179
|
+
.prefault({});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from "zod";
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
FlowSchema,
|
|
@@ -37,9 +37,10 @@ export const PluginStateSchema = z.object({
|
|
|
37
37
|
*/
|
|
38
38
|
timetable: z.literal(true).optional(),
|
|
39
39
|
})
|
|
40
|
-
.
|
|
40
|
+
.prefault({}),
|
|
41
41
|
fileUploads: z
|
|
42
42
|
.record(
|
|
43
|
+
z.string(),
|
|
43
44
|
z.object({ answerId: z.string(), fileName: z.string(), uploadUrl: z.string().nullable() }),
|
|
44
45
|
)
|
|
45
46
|
.optional(),
|
|
@@ -47,10 +48,10 @@ export const PluginStateSchema = z.object({
|
|
|
47
48
|
leadSegmentId: z.string().optional(),
|
|
48
49
|
listingId: z.string().optional(),
|
|
49
50
|
/** The selected geolocation of the user */
|
|
50
|
-
location: LocationSchema.
|
|
51
|
+
location: LocationSchema.prefault({}),
|
|
51
52
|
meetingType: MeetingTypeSchema.optional(),
|
|
52
53
|
meetingTypes: MeetingTypeSchema.array().optional(),
|
|
53
|
-
metadata: z.record(z.unknown()).optional(),
|
|
54
|
+
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
54
55
|
officeId: z.string().optional(),
|
|
55
56
|
offices: z.string().array().optional(),
|
|
56
57
|
questions: form.questionnaire,
|
|
@@ -64,7 +65,7 @@ export const PluginStateSchema = z.object({
|
|
|
64
65
|
questions: z.literal(true).optional(),
|
|
65
66
|
subject: z.literal(true).optional(),
|
|
66
67
|
})
|
|
67
|
-
.
|
|
68
|
+
.prefault({}),
|
|
68
69
|
subjectGroups: z.string().array().optional(),
|
|
69
70
|
subjectId: z.string().optional(),
|
|
70
71
|
subjects: z.string().array().optional(),
|
|
@@ -87,7 +88,7 @@ export const PluginStateSchema = z.object({
|
|
|
87
88
|
timeZone: z.string().optional(),
|
|
88
89
|
}),
|
|
89
90
|
)
|
|
90
|
-
.
|
|
91
|
+
.prefault({}),
|
|
91
92
|
/** Warnings that should be logged to the console */
|
|
92
93
|
warning: z.string().optional(),
|
|
93
94
|
});
|
package/src/state/schemas.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from "zod";
|
|
2
2
|
|
|
3
3
|
export const IdTypeSchema = z.enum(["id", "externalId"]).default("id");
|
|
4
4
|
export const LeadSegmentTypeSchema = z.enum(["id", "code"]).default("code");
|
|
@@ -22,9 +22,9 @@ export const form = {
|
|
|
22
22
|
|
|
23
23
|
return undefined;
|
|
24
24
|
}),
|
|
25
|
-
email: z.
|
|
25
|
+
email: z.email().nullish(),
|
|
26
26
|
questionnaire: z
|
|
27
|
-
.record(z.union([z.string().trim(), z.array(z.string().trim())]))
|
|
27
|
+
.record(z.string(), z.union([z.string().trim(), z.array(z.string().trim())]))
|
|
28
28
|
.transform((val) => {
|
|
29
29
|
Object.keys(val).forEach((key) => {
|
|
30
30
|
if (Array.isArray(val[key])) {
|