@pexip-engage-public/plugin 1.1.17 → 1.1.19

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.
Files changed (88) hide show
  1. package/CHANGELOG.md +18 -2
  2. package/dist/configuration/PluginConfiguration.schema.d.ts +149 -149
  3. package/dist/configuration/PluginConfiguration.schema.d.ts.map +1 -1
  4. package/dist/configuration/PluginConfiguration.schema.js +55 -55
  5. package/dist/configuration/PluginConfiguration.schema.js.map +1 -1
  6. package/dist/configuration/migration.js +16 -16
  7. package/dist/configuration/migration.js.map +1 -1
  8. package/dist/configuration-parser/hash-parser.d.ts +1 -1
  9. package/dist/configuration-parser/hash-parser.d.ts.map +1 -1
  10. package/dist/configuration-parser/hash-parser.js +3 -3
  11. package/dist/configuration-parser/hash-parser.js.map +1 -1
  12. package/dist/configuration-parser/html-parser.d.ts +1 -1
  13. package/dist/configuration-parser/html-parser.d.ts.map +1 -1
  14. package/dist/configuration-parser/html-parser.js +3 -3
  15. package/dist/configuration-parser/html-parser.js.map +1 -1
  16. package/dist/configuration-parser/index.d.ts +6 -6
  17. package/dist/configuration-parser/index.js +2 -2
  18. package/dist/configuration-parser/index.js.map +1 -1
  19. package/dist/configuration-parser/js-parser.d.ts +1 -1
  20. package/dist/configuration-parser/js-parser.d.ts.map +1 -1
  21. package/dist/configuration-parser/js-parser.js +87 -87
  22. package/dist/configuration-parser/js-parser.js.map +1 -1
  23. package/dist/configuration-parser/migrate-legacy-configuration.js +3 -3
  24. package/dist/configuration-parser/migrate-legacy-configuration.js.map +1 -1
  25. package/dist/configuration-parser-legacy/LegacyParser.d.ts.map +1 -1
  26. package/dist/configuration-parser-legacy/LegacyParser.js +62 -62
  27. package/dist/configuration-parser-legacy/LegacyParser.js.map +1 -1
  28. package/dist/configuration-parser-legacy/LegacyParser.utils.js +23 -23
  29. package/dist/configuration-parser-legacy/LegacyParser.utils.js.map +1 -1
  30. package/dist/configuration-parser-legacy/ModernParser.js +8 -8
  31. package/dist/configuration-parser-legacy/ModernParser.js.map +1 -1
  32. package/dist/configuration-parser-legacy/Parser.js +1 -1
  33. package/dist/configuration-parser-legacy/Parser.js.map +1 -1
  34. package/dist/configuration-parser-legacy/tests/LegacyDomParser.test.js +20 -20
  35. package/dist/configuration-parser-legacy/tests/LegacyDomParser.test.js.map +1 -1
  36. package/dist/configuration-parser-legacy/tests/LegacyLocationHashParser.test.js +26 -26
  37. package/dist/configuration-parser-legacy/tests/LegacyLocationHashParser.test.js.map +1 -1
  38. package/dist/configuration-parser-legacy/tests/LegacyParser.test.js +4 -4
  39. package/dist/configuration-parser-legacy/tests/LegacyParser.test.js.map +1 -1
  40. package/dist/constants.d.ts +1 -1
  41. package/dist/constants.js +1 -1
  42. package/dist/encoding.d.ts +1 -1
  43. package/dist/encoding.d.ts.map +1 -1
  44. package/dist/encoding.js +5 -5
  45. package/dist/encoding.js.map +1 -1
  46. package/dist/events/event-types.d.ts +1 -1
  47. package/dist/events/event-types.d.ts.map +1 -1
  48. package/dist/instance/PluginInstance.d.ts +10 -10
  49. package/dist/instance/PluginInstance.d.ts.map +1 -1
  50. package/dist/instance/PluginInstance.js +29 -29
  51. package/dist/instance/PluginInstance.js.map +1 -1
  52. package/dist/instance/index.d.ts.map +1 -1
  53. package/dist/instance/index.js +3 -3
  54. package/dist/instance/index.js.map +1 -1
  55. package/dist/logger.d.ts +3 -3
  56. package/dist/logger.d.ts.map +1 -1
  57. package/dist/logger.js +9 -9
  58. package/dist/logger.js.map +1 -1
  59. package/dist/state/PluginState.schema.d.ts +451 -451
  60. package/dist/state/PluginState.schema.d.ts.map +1 -1
  61. package/dist/state/PluginState.schema.js +48 -48
  62. package/dist/state/PluginState.schema.js.map +1 -1
  63. package/dist/state/schemas.d.ts +13 -13
  64. package/dist/state/schemas.js +9 -9
  65. package/dist/state/schemas.js.map +1 -1
  66. package/package.json +6 -6
  67. package/src/configuration/PluginConfiguration.schema.ts +59 -60
  68. package/src/configuration/migration.ts +16 -16
  69. package/src/configuration-parser/hash-parser.ts +3 -3
  70. package/src/configuration-parser/html-parser.ts +3 -3
  71. package/src/configuration-parser/index.ts +2 -2
  72. package/src/configuration-parser/js-parser.ts +94 -94
  73. package/src/configuration-parser/migrate-legacy-configuration.ts +4 -4
  74. package/src/configuration-parser-legacy/LegacyParser.ts +63 -62
  75. package/src/configuration-parser-legacy/LegacyParser.utils.ts +24 -24
  76. package/src/configuration-parser-legacy/ModernParser.ts +8 -8
  77. package/src/configuration-parser-legacy/Parser.ts +1 -1
  78. package/src/configuration-parser-legacy/tests/LegacyDomParser.test.ts +20 -20
  79. package/src/configuration-parser-legacy/tests/LegacyLocationHashParser.test.ts +29 -29
  80. package/src/configuration-parser-legacy/tests/LegacyParser.test.ts +4 -4
  81. package/src/constants.ts +1 -1
  82. package/src/encoding.ts +6 -6
  83. package/src/events/event-types.ts +1 -2
  84. package/src/instance/PluginInstance.ts +30 -31
  85. package/src/instance/index.ts +3 -3
  86. package/src/logger.ts +9 -9
  87. package/src/state/PluginState.schema.ts +53 -53
  88. package/src/state/schemas.ts +9 -9
@@ -1 +1 @@
1
- {"version":3,"file":"PluginState.schema.d.ts","sourceRoot":"","sources":["../../src/state/PluginState.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,OAAO,EAGL,KAAK,YAAY,EAIlB,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA0BtB,8CAA8C;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QASzE;;;;WAIG;;;;;;;;;;;;;;;;;;;;;;;IAYP,2CAA2C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAS3C,+DAA+D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA8BzD,8CAA8C;;;;;;;IAKpD,oDAAoD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEpD,CAAC"}
@@ -1,28 +1,66 @@
1
1
  import { z } from "zod";
2
2
  import { FlowSchema, PluginConfigurationSchema, } from "../configuration/PluginConfiguration.schema.js";
3
- import { util, CustomerFormSchema, LocationSchema, MeetingTypeSchema, form, } from "./schemas.js";
3
+ import { CustomerFormSchema, form, LocationSchema, MeetingTypeSchema, util, } from "./schemas.js";
4
4
  export const PluginStateSchema = z.object({
5
- flow: FlowSchema,
6
- subjectId: z.string().optional(),
7
- officeId: z.string().optional(),
8
- employeeId: z.string().optional(),
9
5
  appointmentId: z.string().optional(),
10
6
  callbackRequestId: z.string().optional(),
11
- metadata: z.record(z.unknown()).optional(),
7
+ /** This object is the validated version `PluginConfiguration.current.ts` */
8
+ config: PluginConfigurationSchema,
9
+ customer: CustomerFormSchema.optional(),
10
+ employeeId: z.string().optional(),
11
+ // resolved values used for SRS
12
+ employees: z.string().array().optional(),
13
+ errors: z
14
+ .object({
15
+ /**
16
+ * Each step can have errors, in case of the timetable this currently only happens when
17
+ * a slot is booked by another customer between selecting the slot, and confirming the appointment
18
+ * (request).
19
+ */
20
+ timetable: z.literal(true).optional(),
21
+ })
22
+ .default({}),
23
+ fileUploads: z
24
+ .record(z.object({ answerId: z.string(), fileName: z.string(), uploadUrl: z.string().nullable() }))
25
+ .optional(),
26
+ flow: FlowSchema,
27
+ leadSegmentId: z.string().optional(),
28
+ listingId: z.string().optional(),
29
+ /** The selected geolocation of the user */
30
+ location: LocationSchema.default({}),
12
31
  meetingType: MeetingTypeSchema.optional(),
32
+ meetingTypes: MeetingTypeSchema.array().optional(),
33
+ metadata: z.record(z.unknown()).optional(),
34
+ officeId: z.string().optional(),
35
+ offices: z.string().array().optional(),
36
+ questions: form.questionnaire,
37
+ schedulable: z.boolean().default(true),
38
+ /** Marking certain steps as (automatically) skipped or not. */
39
+ skipped: z
40
+ .object({
41
+ employee: z.literal(true).optional(),
42
+ meetingType: z.literal(true).optional(),
43
+ office: z.literal(true).optional(),
44
+ questions: z.literal(true).optional(),
45
+ subject: z.literal(true).optional(),
46
+ })
47
+ .default({}),
48
+ subjectGroups: z.string().array().optional(),
49
+ subjectId: z.string().optional(),
50
+ subjects: z.string().array().optional(),
13
51
  timetable: z
14
52
  .union([
15
53
  z.object({
54
+ employeeIds: z.undefined(),
55
+ end: z.undefined(),
16
56
  intent: z.literal("callback").optional(),
17
57
  start: z.undefined(),
18
- end: z.undefined(),
19
- employeeIds: z.undefined(),
20
58
  }),
21
59
  z.object({
60
+ employeeIds: util.array,
61
+ end: z.string().optional(),
22
62
  intent: z.literal("schedule").optional(),
23
63
  start: z.string().optional(),
24
- end: z.string().optional(),
25
- employeeIds: util.array,
26
64
  }),
27
65
  ])
28
66
  .and(z.object({
@@ -30,45 +68,7 @@ export const PluginStateSchema = z.object({
30
68
  timeZone: z.string().optional(),
31
69
  }))
32
70
  .default({}),
33
- customer: CustomerFormSchema.optional(),
34
- questions: form.questionnaire,
35
- fileUploads: z
36
- .record(z.object({ fileName: z.string(), answerId: z.string(), uploadUrl: z.string().nullable() }))
37
- .optional(),
38
- /** The selected geolocation of the user */
39
- location: LocationSchema.default({}),
40
- // resolved values used for SRS
41
- employees: z.string().array().optional(),
42
- leadSegmentId: z.string().optional(),
43
- listingId: z.string().optional(),
44
- meetingTypes: MeetingTypeSchema.array().optional(),
45
- offices: z.string().array().optional(),
46
- subjectGroups: z.string().array().optional(),
47
- subjects: z.string().array().optional(),
48
- schedulable: z.boolean().default(true),
49
- /** Marking certain steps as (automatically) skipped or not. */
50
- skipped: z
51
- .object({
52
- subject: z.literal(true).optional(),
53
- office: z.literal(true).optional(),
54
- meetingType: z.literal(true).optional(),
55
- employee: z.literal(true).optional(),
56
- questions: z.literal(true).optional(),
57
- })
58
- .default({}),
59
- errors: z
60
- .object({
61
- /**
62
- * Each step can have errors, in case of the timetable this currently only happens when
63
- * a slot is booked by another customer between selecting the slot, and confirming the appointment
64
- * (request).
65
- */
66
- timetable: z.literal(true).optional(),
67
- })
68
- .default({}),
69
71
  /** Warnings that should be logged to the console */
70
72
  warning: z.string().optional(),
71
- /** This object is the validated version `PluginConfiguration.current.ts` */
72
- config: PluginConfigurationSchema,
73
73
  });
74
74
  //# sourceMappingURL=PluginState.schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PluginState.schema.js","sourceRoot":"","sources":["../../src/state/PluginState.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,UAAU,EACV,yBAAyB,GAC1B,MAAM,gDAAgD,CAAC;AAExD,OAAO,EACL,IAAI,EACJ,kBAAkB,EAElB,cAAc,EACd,iBAAiB,EACjB,IAAI,GACL,MAAM,cAAc,CAAC;AAMtB,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,IAAI,EAAE,UAA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,CAAC,EAAE,CAAC;IACd,oDAAoD;IACpD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC"}
@@ -5,15 +5,15 @@ export declare const MeetingTypeSchema: z.ZodEnum<["VIDEO", "PHONE", "ON_LOCATIO
5
5
  export declare const IntentSchema: z.ZodEnum<["schedule", "reschedule", "invite", "edit", "cancel", "complete", "decline"]>;
6
6
  export declare const form: {
7
7
  boolean: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>>, "on" | undefined, string | boolean | null | undefined>;
8
- string: z.ZodOptional<z.ZodNullable<z.ZodString>>;
9
8
  email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
10
9
  questionnaire: 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[]>>>;
10
+ string: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
11
  };
12
12
  export declare const util: {
13
13
  array: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>>, string[], string | string[] | null | undefined>;
14
14
  coerced: {
15
- string: z.ZodOptional<z.ZodString>;
16
15
  array: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>>, string[], string | string[] | null | undefined>;
16
+ string: z.ZodOptional<z.ZodString>;
17
17
  };
18
18
  };
19
19
  export declare const GeolocationSchema: z.ZodObject<{
@@ -27,6 +27,7 @@ export declare const GeolocationSchema: z.ZodObject<{
27
27
  longitude: number;
28
28
  }>;
29
29
  export declare const CustomerFormSchema: z.ZodObject<{
30
+ additionalCustomers: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodOptional<z.ZodNullable<z.ZodString>>, "many">>>, string[] | undefined, (string | null | undefined)[] | null | undefined>;
30
31
  company: z.ZodOptional<z.ZodNullable<z.ZodString>>;
31
32
  customerNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>;
32
33
  email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -50,10 +51,10 @@ export declare const CustomerFormSchema: z.ZodObject<{
50
51
  longitude: number;
51
52
  }>>>;
52
53
  postalCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
53
- timeZone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
54
54
  state: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55
55
  street1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
56
56
  street2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
57
+ timeZone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
57
58
  }, "strip", z.ZodTypeAny, {
58
59
  city?: string | null | undefined;
59
60
  countryCode?: string | null | undefined;
@@ -62,10 +63,10 @@ export declare const CustomerFormSchema: z.ZodObject<{
62
63
  longitude: number;
63
64
  } | null | undefined;
64
65
  postalCode?: string | null | undefined;
65
- timeZone?: string | null | undefined;
66
66
  state?: string | null | undefined;
67
67
  street1?: string | null | undefined;
68
68
  street2?: string | null | undefined;
69
+ timeZone?: string | null | undefined;
69
70
  }, {
70
71
  city?: string | null | undefined;
71
72
  countryCode?: string | null | undefined;
@@ -74,17 +75,17 @@ export declare const CustomerFormSchema: z.ZodObject<{
74
75
  longitude: number;
75
76
  } | null | undefined;
76
77
  postalCode?: string | null | undefined;
77
- timeZone?: string | null | undefined;
78
78
  state?: string | null | undefined;
79
79
  street1?: string | null | undefined;
80
80
  street2?: string | null | undefined;
81
+ timeZone?: string | null | undefined;
81
82
  }>>>;
82
83
  phoneNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>;
83
84
  timeZone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
84
- additionalCustomers: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodOptional<z.ZodNullable<z.ZodString>>, "many">>>, string[] | undefined, (string | null | undefined)[] | null | undefined>;
85
85
  }, "strip", z.ZodTypeAny, {
86
86
  id?: string | null | undefined;
87
87
  externalId?: string | null | undefined;
88
+ additionalCustomers?: string[] | undefined;
88
89
  company?: string | null | undefined;
89
90
  customerNumber?: string | null | undefined;
90
91
  email?: string | null | undefined;
@@ -101,16 +102,16 @@ export declare const CustomerFormSchema: z.ZodObject<{
101
102
  longitude: number;
102
103
  } | null | undefined;
103
104
  postalCode?: string | null | undefined;
104
- timeZone?: string | null | undefined;
105
105
  state?: string | null | undefined;
106
106
  street1?: string | null | undefined;
107
107
  street2?: string | null | undefined;
108
+ timeZone?: string | null | undefined;
108
109
  } | null | undefined;
109
110
  phoneNumber?: string | null | undefined;
110
- additionalCustomers?: string[] | undefined;
111
111
  }, {
112
112
  id?: string | null | undefined;
113
113
  externalId?: string | null | undefined;
114
+ additionalCustomers?: (string | null | undefined)[] | null | undefined;
114
115
  company?: string | null | undefined;
115
116
  customerNumber?: string | null | undefined;
116
117
  email?: string | null | undefined;
@@ -127,18 +128,17 @@ export declare const CustomerFormSchema: z.ZodObject<{
127
128
  longitude: number;
128
129
  } | null | undefined;
129
130
  postalCode?: string | null | undefined;
130
- timeZone?: string | null | undefined;
131
131
  state?: string | null | undefined;
132
132
  street1?: string | null | undefined;
133
133
  street2?: string | null | undefined;
134
+ timeZone?: string | null | undefined;
134
135
  } | null | undefined;
135
136
  phoneNumber?: string | null | undefined;
136
- additionalCustomers?: (string | null | undefined)[] | null | undefined;
137
137
  }>;
138
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
139
  export declare const LocationSourceSchema: z.ZodEnum<["config", "listing", "user"]>;
140
140
  export declare const LocationSchema: z.ZodObject<{
141
- source: z.ZodDefault<z.ZodEnum<["config", "listing", "user"]>>;
141
+ formattedAddress: z.ZodOptional<z.ZodString>;
142
142
  geolocation: z.ZodOptional<z.ZodObject<{
143
143
  latitude: z.ZodNumber;
144
144
  longitude: z.ZodNumber;
@@ -149,8 +149,8 @@ export declare const LocationSchema: z.ZodObject<{
149
149
  latitude: number;
150
150
  longitude: number;
151
151
  }>>;
152
- formattedAddress: z.ZodOptional<z.ZodString>;
153
152
  placeId: z.ZodOptional<z.ZodString>;
153
+ source: z.ZodDefault<z.ZodEnum<["config", "listing", "user"]>>;
154
154
  }, "strip", z.ZodTypeAny, {
155
155
  source: "config" | "listing" | "user";
156
156
  geolocation?: {
@@ -164,9 +164,9 @@ export declare const LocationSchema: z.ZodObject<{
164
164
  latitude: number;
165
165
  longitude: number;
166
166
  } | undefined;
167
- source?: "config" | "listing" | "user" | undefined;
168
167
  formattedAddress?: string | undefined;
169
168
  placeId?: string | undefined;
169
+ source?: "config" | "listing" | "user" | undefined;
170
170
  }>;
171
171
  export declare function valueToArray<T extends string>(input?: T | T[] | null, separator?: string): T[] | undefined;
172
172
  //# sourceMappingURL=schemas.d.ts.map
@@ -20,7 +20,6 @@ export const form = {
20
20
  return "on";
21
21
  return undefined;
22
22
  }),
23
- string: z.string().nullish(),
24
23
  email: z.string().email().nullish(),
25
24
  questionnaire: z
26
25
  .record(z.union([z.string().trim(), z.array(z.string().trim())]))
@@ -42,6 +41,7 @@ export const form = {
42
41
  return val;
43
42
  })
44
43
  .optional(),
44
+ string: z.string().nullish(),
45
45
  };
46
46
  export const util = {
47
47
  array: z
@@ -49,11 +49,11 @@ export const util = {
49
49
  .nullish()
50
50
  .transform((val) => valueToArray(val) ?? []),
51
51
  coerced: {
52
- string: z.coerce.string().optional(),
53
52
  array: z
54
53
  .union([z.coerce.string(), z.coerce.string().array()])
55
54
  .nullish()
56
55
  .transform((val) => valueToArray(val) ?? []),
56
+ string: z.coerce.string().optional(),
57
57
  },
58
58
  };
59
59
  export const GeolocationSchema = z.object({
@@ -61,6 +61,10 @@ export const GeolocationSchema = z.object({
61
61
  longitude: z.coerce.number(),
62
62
  });
63
63
  export const CustomerFormSchema = z.object({
64
+ additionalCustomers: z
65
+ .array(form.email)
66
+ .nullish()
67
+ .transform((val) => val?.filter(Boolean)),
64
68
  company: form.string,
65
69
  customerNumber: form.string,
66
70
  email: form.email,
@@ -76,26 +80,22 @@ export const CustomerFormSchema = z.object({
76
80
  countryCode: form.string,
77
81
  geolocation: GeolocationSchema.nullish(),
78
82
  postalCode: form.string,
79
- timeZone: form.string,
80
83
  state: form.string,
81
84
  street1: form.string,
82
85
  street2: form.string,
86
+ timeZone: form.string,
83
87
  })
84
88
  .nullish(),
85
89
  phoneNumber: form.string,
86
90
  timeZone: form.string,
87
- additionalCustomers: z
88
- .array(form.email)
89
- .nullish()
90
- .transform((val) => val?.filter(Boolean)),
91
91
  });
92
92
  export const QuestionnaireSchema = form.questionnaire;
93
93
  export const LocationSourceSchema = z.enum(["config", "listing", "user"]);
94
94
  export const LocationSchema = z.object({
95
- source: LocationSourceSchema.default("user"),
96
- geolocation: GeolocationSchema.optional(),
97
95
  formattedAddress: z.string().optional(),
96
+ geolocation: GeolocationSchema.optional(),
98
97
  placeId: z.string().optional(),
98
+ source: LocationSourceSchema.default("user"),
99
99
  });
100
100
  const COMMA = ",";
101
101
  export function valueToArray(input, separator = COMMA) {
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/state/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,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,iBAAi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AAC,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;AAE1E,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,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.1.17",
3
+ "version": "1.1.19",
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"
@@ -37,16 +37,16 @@
37
37
  "dependencies": {
38
38
  "iframe-resizer": "4.3.11",
39
39
  "skedify-uri-encoding": "^2.1.2",
40
- "zod": "^3.25.64",
41
- "@pexip-engage-public/graphql": "1.1.1",
42
- "@pexip-engage/utils": "0.1.43"
40
+ "zod": "^3.25.67",
41
+ "@pexip-engage-public/graphql": "1.1.3",
42
+ "@pexip-engage/utils": "0.1.45"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@total-typescript/ts-reset": "^0.6.1",
46
46
  "happy-dom": "^18.0.1",
47
- "vitest": "^3.2.3",
47
+ "vitest": "^3.2.4",
48
48
  "@pexip-engage/tsconfig": "0.1.1",
49
- "eslint-config-pexip-engage": "1.1.21"
49
+ "eslint-config-pexip-engage": "1.1.23"
50
50
  },
51
51
  "volta": {
52
52
  "extends": "../../../../package.json"
@@ -1,16 +1,15 @@
1
- import { z } from "zod";
2
-
3
1
  import type { MeetingType } from "@pexip-engage-public/graphql";
2
+ import { z } from "zod";
4
3
  import { DEFAULT_FLOW, getSupportedLng } from "../constants.js";
5
4
  import {
6
- util,
7
5
  CustomerFormSchema,
6
+ form,
8
7
  IdTypeSchema,
9
8
  IntentSchema,
10
9
  LeadSegmentTypeSchema,
11
10
  LocationSchema,
12
11
  MeetingTypeSchema,
13
- form,
12
+ util,
14
13
  valueToArray,
15
14
  } from "../state/schemas.js";
16
15
 
@@ -47,67 +46,76 @@ function isMeetingType(meetingType: string): meetingType is MeetingType {
47
46
 
48
47
  export const PluginConfigurationSchema = z
49
48
  .object({
50
- version: z.enum(["1.0.0"]).optional(),
51
- flow: FlowSchema,
52
- intent: IntentSchema.default("schedule"),
53
- /**
54
- * An RFC 5646-compatible language tag.
55
- *
56
- * This will cause the plugin to be displayed in the specified language, unless the language is unavailable.
57
- *
58
- * In that case, a best-effort fallback will be performed with increasingly more generic variants of the specified language or finally 'en' if no variants of the specified language are available.
59
- */
60
- language: z
61
- .string()
62
- .optional()
63
- .transform((value) => getSupportedLng(value)),
64
- /** @deprecated Only use me during application init! */
65
- employees: z.object({ ids: util.coerced.array, type: IdTypeSchema }).default({}),
66
49
  application: z
67
50
  .object({
51
+ /**
52
+ * Used to enable/disable customer location search.
53
+ * @default error
54
+ */
55
+ customerLocationSearch: z.enum(["always", "error"]).default("error"),
68
56
  /**
69
57
  * Used to enable/disable the office search step.
70
58
  * @defualt "optional"
71
59
  * @type { "required" | "optional" }
72
60
  */
73
61
  officeSearch: z.enum(["required", "optional"]).default("optional"),
62
+ recaptcha: z.enum(["disable", "enable"]).default("enable"),
74
63
  /**
75
64
  * Used to set scroll top value when navigating steps
76
65
  * @default -90
77
66
  * @type { "disabled" | number }
78
67
  */
79
68
  scroll: z.union([z.enum(["disabled"]), z.coerce.number()]).default(-90),
80
- /**
81
- * Used to enable/disable customer location search.
82
- * @default error
83
- */
84
- customerLocationSearch: z.enum(["always", "error"]).default("error"),
69
+ theme: z.string().optional(),
85
70
  /**
86
71
  * Used to enable timezone selection when the meeting type is video or phone.
87
72
  * @default "enable"
88
73
  * @type {"enable" | "disable"}
89
74
  */
90
75
  timeZoneSelection: z.enum(["enable", "disable"]).default("enable"),
91
- theme: z.string().optional(),
92
- recaptcha: z.enum(["disable", "enable"]).default("enable"),
93
76
  })
94
77
  .default({}),
95
78
  browser: z
96
79
  .object({
97
- timeZone: z.string().optional(),
98
80
  href: z.string().optional(),
81
+ timeZone: z.string().optional(),
99
82
  })
100
83
  .default({}),
101
84
  customer: CustomerFormSchema.optional(),
85
+ /** @deprecated Only use me during application init! */
86
+ employees: z.object({ ids: util.coerced.array, type: IdTypeSchema }).default({}),
87
+ flow: FlowSchema,
88
+ /** @deprecated Only use me during application init! */
89
+ initialFormattedAddress: z.string().optional(),
90
+ intent: IntentSchema.default("schedule"),
91
+ /**
92
+ * An RFC 5646-compatible language tag.
93
+ *
94
+ * This will cause the plugin to be displayed in the specified language, unless the language is unavailable.
95
+ *
96
+ * In that case, a best-effort fallback will be performed with increasingly more generic variants of the specified language or finally 'en' if no variants of the specified language are available.
97
+ */
98
+ language: z
99
+ .string()
100
+ .optional()
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
104
  leadSegment: z.object({ id: util.coerced.string, type: LeadSegmentTypeSchema }).default({}),
105
105
  /** @deprecated Only use me during application init! */
106
106
  listing: z.object({ id: util.coerced.string, type: IdTypeSchema }).default({}),
107
- /** @deprecated Only use me during application init! */
108
- initialFormattedAddress: z.string().optional(),
107
+ /**
108
+ * This parameter is used for prefilling the location search step, so that offices are already scoped to this location.
109
+ *
110
+ * When location is passed, both geolocation & formatted_address are required.
111
+ */
112
+ location: LocationSchema.default({}),
109
113
  /** @deprecated Only use me during application init! */
110
114
  meetingTypes: util.coerced.array.transform((val) => val.filter(isMeetingType)),
115
+ /**
116
+ * This parameter is used for passing a message to the customer. It is displayed in plugin and e-mails.
117
+ */
118
+ messageForCustomer: z.string().optional(),
111
119
  oauth: z
112
120
  .object({
113
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. */
@@ -116,6 +124,8 @@ export const PluginConfigurationSchema = z
116
124
  .default({}),
117
125
  /** @deprecated Only use me during application init! */
118
126
  offices: z.object({ ids: util.coerced.array, type: IdTypeSchema }).default({}),
127
+ // TODO remove these from config, introduce a leftover
128
+ questions: form.questionnaire,
119
129
  /**
120
130
  * The country that should be used for searching locations. Should be a two letter ISO 3166-1 country code.
121
131
  *
@@ -124,8 +134,6 @@ export const PluginConfigurationSchema = z
124
134
  searchCountries: util.array.refine((arg) => arg.length <= 5),
125
135
  session: z
126
136
  .object({
127
- /** Used to enable/disable tracking of events in the plugin for insights about conversion. @default "default" */
128
- status: z.enum(["default", "disabled"]).default("default"),
129
137
  /** Pass your own custom session ID. */
130
138
  id: z.string().optional(),
131
139
  /** Pass source tags seperated with a semi-colon. */
@@ -133,20 +141,24 @@ export const PluginConfigurationSchema = z
133
141
  .union([z.string(), z.string().array()])
134
142
  .optional()
135
143
  .transform((val) => valueToArray(val, ";")),
144
+ /** Used to enable/disable tracking of events in the plugin for insights about conversion. @default "default" */
145
+ status: z.enum(["default", "disabled"]).default("default"),
136
146
  })
137
147
  .default({}),
138
148
  /** @deprecated Only use me during application init! */
139
- subjects: z.object({ ids: util.coerced.array, type: IdTypeSchema }).default({}),
140
- /** @deprecated Only use me during application init! */
141
149
  subjectGroups: z.object({ ids: util.coerced.array, type: IdTypeSchema }).default({}),
150
+ subjectQuestions: z
151
+ .array(
152
+ z.object({
153
+ externalId: z.string(),
154
+ value: z.union([z.string().trim(), z.array(z.string().trim())]),
155
+ }),
156
+ )
157
+ .optional(),
158
+ /** @deprecated Only use me during application init! */
159
+ subjects: z.object({ ids: util.coerced.array, type: IdTypeSchema }).default({}),
142
160
  timetable: z
143
161
  .object({
144
- /**
145
- * Used to decide wether to show month of week timetable view
146
- * @experimental
147
- * @default "week"
148
- */
149
- view: z.enum(["week", "month"]).default("week"),
150
162
  /**
151
163
  * Used to enable meeting type switcher on timetable step
152
164
  * @experimental
@@ -154,27 +166,14 @@ export const PluginConfigurationSchema = z
154
166
  * @type {"enable" | "disable"}
155
167
  */
156
168
  meetingTypeSelector: z.enum(["enable", "disable"]).default("disable"),
169
+ /**
170
+ * Used to decide wether to show month of week timetable view
171
+ * @experimental
172
+ * @default "week"
173
+ */
174
+ view: z.enum(["week", "month"]).default("week"),
157
175
  })
158
176
  .default({}),
159
- // TODO remove these from config, introduce a leftover
160
- questions: form.questionnaire,
161
- subjectQuestions: z
162
- .array(
163
- z.object({
164
- externalId: z.string(),
165
- value: z.union([z.string().trim(), z.array(z.string().trim())]),
166
- }),
167
- )
168
- .optional(),
169
- /**
170
- * This parameter is used for prefilling the location search step, so that offices are already scoped to this location.
171
- *
172
- * When location is passed, both geolocation & formatted_address are required.
173
- */
174
- location: LocationSchema.default({}),
175
- /**
176
- * This parameter is used for passing a message to the customer. It is displayed in plugin and e-mails.
177
- */
178
- messageForCustomer: z.string().optional(),
177
+ version: z.enum(["1.0.0"]).optional(),
179
178
  })
180
179
  .default({});