@pexip-engage-public/plugin-configuration-parser
Advanced tools
Comparing version 2.0.0-canary-20231023080955 to 2.0.0-canary-20231025101109
# @pexip-engage-public/plugin-configuration-parser | ||
## 2.0.0-canary-20231023080955 | ||
## 2.0.0-canary-20231025101109 | ||
@@ -12,4 +12,4 @@ ### Major Changes | ||
- Updated dependencies [f94a30b50] | ||
- @pexip-engage-public/plugin-configuration@2.0.0-canary-20231023080955 | ||
- @pexip-engage-public/plugin-utils@2.0.0-canary-20231023080955 | ||
- @pexip-engage-public/plugin-configuration@2.0.0-canary-20231025101109 | ||
- @pexip-engage-public/plugin-utils@2.0.0-canary-20231025101109 | ||
@@ -16,0 +16,0 @@ ## 1.2.1 |
export declare const DEPRECATED_TOKEN: { | ||
readonly LOCK: "#"; | ||
readonly OFFICE: "L"; | ||
readonly START: "'"; | ||
readonly LOCK: "#"; | ||
readonly OFFICE: "L"; | ||
readonly START: "'"; | ||
}; | ||
export declare const TOKEN: { | ||
readonly EMPLOYEE: "E"; | ||
readonly CUSTOMER: "C"; | ||
readonly LOCK: "*"; | ||
readonly MEETING_TYPE: "M"; | ||
readonly OFFICE: "O"; | ||
readonly QUESTION: "Q"; | ||
readonly SUBJECT: "S"; | ||
readonly TIMETABLE: "T"; | ||
readonly EMPLOYEE: "E"; | ||
readonly CUSTOMER: "C"; | ||
readonly LOCK: "*"; | ||
readonly MEETING_TYPE: "M"; | ||
readonly OFFICE: "O"; | ||
readonly QUESTION: "Q"; | ||
readonly SUBJECT: "S"; | ||
readonly TIMETABLE: "T"; | ||
}; | ||
//# sourceMappingURL=constants.d.ts.map | ||
//# sourceMappingURL=constants.d.ts.map |
export const DEPRECATED_TOKEN = { | ||
LOCK: "#", | ||
OFFICE: "L", | ||
START: "'", | ||
LOCK: "#", | ||
OFFICE: "L", | ||
START: "'", | ||
}; | ||
export const TOKEN = { | ||
EMPLOYEE: "E", | ||
CUSTOMER: "C", | ||
LOCK: "*", | ||
MEETING_TYPE: "M", | ||
OFFICE: "O", | ||
QUESTION: "Q", | ||
SUBJECT: "S", | ||
TIMETABLE: "T", | ||
EMPLOYEE: "E", | ||
CUSTOMER: "C", | ||
LOCK: "*", | ||
MEETING_TYPE: "M", | ||
OFFICE: "O", | ||
QUESTION: "Q", | ||
SUBJECT: "S", | ||
TIMETABLE: "T", | ||
}; |
import { parseDOMParams, parseJSConfigParams, parseSkedifyURIHashParams } from "./LegacyParser.js"; | ||
import { createMigrationInstructions, legacyHashToPluginInputConfiguration } from "./LegacyParser.utils.js"; | ||
import { | ||
createMigrationInstructions, | ||
legacyHashToPluginInputConfiguration, | ||
} from "./LegacyParser.utils.js"; | ||
import { decodeConfigHash } from "./ModernParser.js"; | ||
@@ -9,14 +12,14 @@ import { configToHash, configToHtml, configToJS } from "./ModernParser.utils.js"; | ||
export declare const legacyUtils: { | ||
domToLegacyConfig: typeof parseDOMParams; | ||
jsToLegacyConfig: typeof parseJSConfigParams; | ||
hashToLegacyConfig: typeof parseSkedifyURIHashParams; | ||
legacyConfigToMigrations: typeof createMigrationInstructions; | ||
legacyConfigToConfig: typeof legacyHashToPluginInputConfiguration; | ||
domToLegacyConfig: typeof parseDOMParams; | ||
jsToLegacyConfig: typeof parseJSConfigParams; | ||
hashToLegacyConfig: typeof parseSkedifyURIHashParams; | ||
legacyConfigToMigrations: typeof createMigrationInstructions; | ||
legacyConfigToConfig: typeof legacyHashToPluginInputConfiguration; | ||
}; | ||
export declare const modernUtils: { | ||
configToJS: typeof configToJS; | ||
configToHtml: typeof configToHtml; | ||
configToHash: typeof configToHash; | ||
hashToConfig: typeof decodeConfigHash; | ||
configToJS: typeof configToJS; | ||
configToHtml: typeof configToHtml; | ||
configToHash: typeof configToHash; | ||
hashToConfig: typeof decodeConfigHash; | ||
}; | ||
//# sourceMappingURL=index.d.ts.map | ||
//# sourceMappingURL=index.d.ts.map |
import type { PluginConfiguration } from "@pexip-engage-public/plugin-configuration"; | ||
interface LegacyParseParams { | ||
element?: HTMLElement | null; | ||
hash?: string | null; | ||
options?: UnsafeLegacyPluginConfiguration | null; | ||
element?: HTMLElement | null; | ||
hash?: string | null; | ||
options?: UnsafeLegacyPluginConfiguration | null; | ||
} | ||
export declare function parse({ element, hash, options }: LegacyParseParams): { | ||
domConfig: PluginConfiguration; | ||
hashConfig: PluginConfiguration; | ||
jsConfig: PluginConfiguration; | ||
domConfig: PluginConfiguration; | ||
hashConfig: PluginConfiguration; | ||
jsConfig: PluginConfiguration; | ||
}; | ||
export declare function parseDOMParams(element?: HTMLElement | null): LegacyPluginHashConfiguration; | ||
export declare function parseSkedifyURIHashParams(hash?: string | null): LegacyPluginHashConfiguration; | ||
export declare function parseJSConfigParams(config?: UnsafeLegacyPluginConfiguration | null): LegacyPluginHashConfiguration; | ||
export declare function parseSkedifyURIHashParams( | ||
hash?: string | null, | ||
): LegacyPluginHashConfiguration; | ||
export declare function parseJSConfigParams( | ||
config?: UnsafeLegacyPluginConfiguration | null, | ||
): LegacyPluginHashConfiguration; | ||
/** | ||
@@ -19,175 +23,175 @@ * Unvalidated PluginConfiguration that allows all leaves for string values. | ||
export interface UnsafeLegacyPluginConfiguration { | ||
oauth?: { | ||
client?: string; | ||
token?: string; | ||
resource_code?: string; | ||
}; | ||
session?: { | ||
status?: string; | ||
id?: string; | ||
source_tags?: string[] | string; | ||
}; | ||
customer?: { | ||
company?: string; | ||
customer_number?: string; | ||
date_of_birth?: string; | ||
email?: string; | ||
external_id?: string; | ||
first_name?: string; | ||
gender?: string; | ||
id?: string; | ||
is_existing?: string | boolean; | ||
language?: string; | ||
last_name?: string; | ||
location?: { | ||
geolocation?: string; | ||
city?: string; | ||
country?: string; | ||
postal_code?: string; | ||
state?: string; | ||
street_1?: string; | ||
}; | ||
phone_number?: string; | ||
preferred_contact_id?: string; | ||
preferred_office_id?: string; | ||
timezone?: string; | ||
}; | ||
appointment?: { | ||
subject_id?: string; | ||
office_id?: string; | ||
listing_id?: string; | ||
}; | ||
external_subject_id?: string; | ||
external_office_id?: string; | ||
external_listing_id?: string; | ||
lead_segment_code?: string; | ||
hints?: { | ||
intent?: string; | ||
contacts?: string[] | string; | ||
external_employee_ids?: string[] | string; | ||
}; | ||
oauth?: { | ||
client?: string; | ||
token?: string; | ||
resource_code?: string; | ||
}; | ||
session?: { | ||
status?: string; | ||
id?: string; | ||
source_tags?: string[] | string; | ||
}; | ||
customer?: { | ||
company?: string; | ||
customer_number?: string; | ||
date_of_birth?: string; | ||
email?: string; | ||
external_id?: string; | ||
first_name?: string; | ||
gender?: string; | ||
id?: string; | ||
is_existing?: string | boolean; | ||
language?: string; | ||
meeting_types?: string[] | string; | ||
application?: { | ||
scroll?: string; | ||
timezone_selection?: string; | ||
}; | ||
last_name?: string; | ||
location?: { | ||
formatted_address?: string; | ||
geolocation?: string; | ||
city?: string; | ||
country?: string; | ||
postal_code?: string; | ||
state?: string; | ||
street_1?: string; | ||
geolocation?: string; | ||
city?: string; | ||
country?: string; | ||
postal_code?: string; | ||
state?: string; | ||
street_1?: string; | ||
}; | ||
searchCountry?: string[] | string; | ||
search?: { | ||
country?: string | string[]; | ||
}; | ||
flow?: string; | ||
phone_number?: string; | ||
preferred_contact_id?: string; | ||
preferred_office_id?: string; | ||
timezone?: string; | ||
}; | ||
appointment?: { | ||
subject_id?: string; | ||
office_id?: string; | ||
listing_id?: string; | ||
}; | ||
external_subject_id?: string; | ||
external_office_id?: string; | ||
external_listing_id?: string; | ||
lead_segment_code?: string; | ||
hints?: { | ||
intent?: string; | ||
contacts?: string[] | string; | ||
external_employee_ids?: string[] | string; | ||
}; | ||
language?: string; | ||
meeting_types?: string[] | string; | ||
application?: { | ||
scroll?: string; | ||
timezone_selection?: string; | ||
}; | ||
location?: { | ||
formatted_address?: string; | ||
geolocation?: string; | ||
city?: string; | ||
country?: string; | ||
postal_code?: string; | ||
state?: string; | ||
street_1?: string; | ||
}; | ||
searchCountry?: string[] | string; | ||
search?: { | ||
country?: string | string[]; | ||
}; | ||
flow?: string; | ||
intent?: string; | ||
} | ||
export interface LegacyPluginHashConfiguration { | ||
/** Maps to parameter oauth.resource_code (see above). */ | ||
rco?: string; | ||
/** Maps to parameter appointment.subject_id (see above). */ | ||
sub?: string; | ||
/** Maps to parameter external_subject_id (see above). */ | ||
esb?: string; | ||
/** Maps to parameter appointment.listing_id (see above). */ | ||
lis?: string; | ||
/** Maps to parameter appointment.external_listing_id (see above). */ | ||
eli?: string; | ||
/** Maps to parameter lead_segment_code (see above). */ | ||
lsc?: string; | ||
/** Maps to parameter appointment.office_id (see above). */ | ||
off?: string; | ||
/** Maps to parameter external_office_id (see above). */ | ||
eof?: string; | ||
/** Maps to parameter hints.intent (see above). */ | ||
act?: string; | ||
/** An array of contact-IDs. This parameter has the same effect as hints.contacts (see above). */ | ||
con?: string | string[]; | ||
/** An array of external employee-IDs. This parameter has the same effect as hints.external_employee_ids (see above). */ | ||
eco?: string | string[]; | ||
/** Maps to parameter searchCountry (see above). */ | ||
sco?: string | string[]; | ||
/** Maps to parameter flow (see above). */ | ||
flo?: string; | ||
/** Maps to parameter meeting_types (see above). */ | ||
mty?: string | string[]; | ||
/** Maps to parameter application.scroll (see above). */ | ||
scr?: string; | ||
/** Maps to parameter application.timezone_selection (see above). */ | ||
ets?: string; | ||
/** Maps to parameter language (see above). */ | ||
lng?: string; | ||
/** SESSION */ | ||
/** Maps to parameter session.status (see above). */ | ||
cas?: string; | ||
/** Maps to parameter session.id (see above). */ | ||
sid?: string; | ||
/** Maps to parameter session.source_tags (see above). */ | ||
sst?: string | string[]; | ||
/** CUSTOMER */ | ||
/** Maps to parameter customer.company (see above).*/ | ||
ccom?: string; | ||
/** Maps to parameter customer.customer_number (see above).*/ | ||
ccn?: string; | ||
/** Maps to parameter customer.date_of_birth (see above).*/ | ||
cdob?: string; | ||
/** Maps to parameter customer.email (see above).*/ | ||
cem?: string; | ||
/** Maps to parameter customer.external_id (see above).*/ | ||
ceid?: string; | ||
/** Maps to parameter customer.first_name (see above).*/ | ||
cfn?: string; | ||
/** Maps to parameter customer.gender (see above).*/ | ||
cgr?: string; | ||
/** Maps to parameter customer.id (see above).*/ | ||
cid?: string; | ||
/** Maps to parameter customer.is_existing (see above).*/ | ||
cie?: string; | ||
/** Maps to parameter customer.language (see above).*/ | ||
clng?: string; | ||
/** Maps to parameter customer.last_name (see above).*/ | ||
cln?: string; | ||
/** Maps to parameter customer.location.geolocation (see above). */ | ||
cgl?: string; | ||
/** Maps to parameter customer.location.city (see above). */ | ||
cci?: string; | ||
/** Maps to parameter customer.location.country (see above).*/ | ||
cco?: string; | ||
/** Maps to parameter customer.location.postal_code (see above).*/ | ||
cpc?: string; | ||
/** Maps to parameter customer.location.state (see above).*/ | ||
csa?: string; | ||
/** Maps to parameter customer.location.street_1 (see above).*/ | ||
cst?: string; | ||
/** Maps to parameter customer.phone_number (see above).*/ | ||
cpn?: string; | ||
/** Maps to parameter customer.preferred_contact_id (see above).*/ | ||
cpci?: string; | ||
/** Maps to parameter customer.preferred_office_id (see above).*/ | ||
cpoi?: string; | ||
/** Maps to parameter customer.timezone (see above).*/ | ||
ctz?: string; | ||
/** LOCATION */ | ||
/** Maps to parameter location.formatted_address (see above).*/ | ||
lfa?: string; | ||
/** Maps to parameter location.geolocation (see above).*/ | ||
lgl?: string; | ||
/** Maps to parameter location.city (see above).*/ | ||
lci?: string; | ||
/** Maps to parameter location.country (see above).*/ | ||
lco?: string; | ||
/** Maps to parameter location.postal_code (see above).*/ | ||
lpc?: string; | ||
/** Maps to parameter location.state (see above).*/ | ||
lsa?: string; | ||
/** Maps to parameter location.street_1 (see above).*/ | ||
lst?: string; | ||
/** Maps to parameter oauth.resource_code (see above). */ | ||
rco?: string; | ||
/** Maps to parameter appointment.subject_id (see above). */ | ||
sub?: string; | ||
/** Maps to parameter external_subject_id (see above). */ | ||
esb?: string; | ||
/** Maps to parameter appointment.listing_id (see above). */ | ||
lis?: string; | ||
/** Maps to parameter appointment.external_listing_id (see above). */ | ||
eli?: string; | ||
/** Maps to parameter lead_segment_code (see above). */ | ||
lsc?: string; | ||
/** Maps to parameter appointment.office_id (see above). */ | ||
off?: string; | ||
/** Maps to parameter external_office_id (see above). */ | ||
eof?: string; | ||
/** Maps to parameter hints.intent (see above). */ | ||
act?: string; | ||
/** An array of contact-IDs. This parameter has the same effect as hints.contacts (see above). */ | ||
con?: string | string[]; | ||
/** An array of external employee-IDs. This parameter has the same effect as hints.external_employee_ids (see above). */ | ||
eco?: string | string[]; | ||
/** Maps to parameter searchCountry (see above). */ | ||
sco?: string | string[]; | ||
/** Maps to parameter flow (see above). */ | ||
flo?: string; | ||
/** Maps to parameter meeting_types (see above). */ | ||
mty?: string | string[]; | ||
/** Maps to parameter application.scroll (see above). */ | ||
scr?: string; | ||
/** Maps to parameter application.timezone_selection (see above). */ | ||
ets?: string; | ||
/** Maps to parameter language (see above). */ | ||
lng?: string; | ||
/** SESSION */ | ||
/** Maps to parameter session.status (see above). */ | ||
cas?: string; | ||
/** Maps to parameter session.id (see above). */ | ||
sid?: string; | ||
/** Maps to parameter session.source_tags (see above). */ | ||
sst?: string | string[]; | ||
/** CUSTOMER */ | ||
/** Maps to parameter customer.company (see above).*/ | ||
ccom?: string; | ||
/** Maps to parameter customer.customer_number (see above).*/ | ||
ccn?: string; | ||
/** Maps to parameter customer.date_of_birth (see above).*/ | ||
cdob?: string; | ||
/** Maps to parameter customer.email (see above).*/ | ||
cem?: string; | ||
/** Maps to parameter customer.external_id (see above).*/ | ||
ceid?: string; | ||
/** Maps to parameter customer.first_name (see above).*/ | ||
cfn?: string; | ||
/** Maps to parameter customer.gender (see above).*/ | ||
cgr?: string; | ||
/** Maps to parameter customer.id (see above).*/ | ||
cid?: string; | ||
/** Maps to parameter customer.is_existing (see above).*/ | ||
cie?: string; | ||
/** Maps to parameter customer.language (see above).*/ | ||
clng?: string; | ||
/** Maps to parameter customer.last_name (see above).*/ | ||
cln?: string; | ||
/** Maps to parameter customer.location.geolocation (see above). */ | ||
cgl?: string; | ||
/** Maps to parameter customer.location.city (see above). */ | ||
cci?: string; | ||
/** Maps to parameter customer.location.country (see above).*/ | ||
cco?: string; | ||
/** Maps to parameter customer.location.postal_code (see above).*/ | ||
cpc?: string; | ||
/** Maps to parameter customer.location.state (see above).*/ | ||
csa?: string; | ||
/** Maps to parameter customer.location.street_1 (see above).*/ | ||
cst?: string; | ||
/** Maps to parameter customer.phone_number (see above).*/ | ||
cpn?: string; | ||
/** Maps to parameter customer.preferred_contact_id (see above).*/ | ||
cpci?: string; | ||
/** Maps to parameter customer.preferred_office_id (see above).*/ | ||
cpoi?: string; | ||
/** Maps to parameter customer.timezone (see above).*/ | ||
ctz?: string; | ||
/** LOCATION */ | ||
/** Maps to parameter location.formatted_address (see above).*/ | ||
lfa?: string; | ||
/** Maps to parameter location.geolocation (see above).*/ | ||
lgl?: string; | ||
/** Maps to parameter location.city (see above).*/ | ||
lci?: string; | ||
/** Maps to parameter location.country (see above).*/ | ||
lco?: string; | ||
/** Maps to parameter location.postal_code (see above).*/ | ||
lpc?: string; | ||
/** Maps to parameter location.state (see above).*/ | ||
lsa?: string; | ||
/** Maps to parameter location.street_1 (see above).*/ | ||
lst?: string; | ||
} | ||
export {}; | ||
//# sourceMappingURL=LegacyParser.d.ts.map | ||
//# sourceMappingURL=LegacyParser.d.ts.map |
import { logger } from "@pexip-engage-public/plugin-utils"; | ||
import { decodeURIParameters as legacyDecodeURIParameters } from "skedify-uri-encoding"; | ||
import { legacyHashToPluginInputConfiguration, logDeprecationWarnings, } from "./LegacyParser.utils.js"; | ||
import { | ||
legacyHashToPluginInputConfiguration, | ||
logDeprecationWarnings, | ||
} from "./LegacyParser.utils.js"; | ||
import { sanitize } from "./utils.js"; | ||
export function parse({ element, hash, options }) { | ||
const domConfig = parseDOMParams(element); | ||
const hashConfig = parseSkedifyURIHashParams(hash); | ||
const jsConfig = parseJSConfigParams(options); | ||
logDeprecationWarnings({ dom: domConfig, hash: hashConfig, js: jsConfig }); | ||
return { | ||
domConfig: legacyHashToPluginInputConfiguration(domConfig), | ||
hashConfig: legacyHashToPluginInputConfiguration(hashConfig), | ||
jsConfig: legacyHashToPluginInputConfiguration(jsConfig), | ||
}; | ||
const domConfig = parseDOMParams(element); | ||
const hashConfig = parseSkedifyURIHashParams(hash); | ||
const jsConfig = parseJSConfigParams(options); | ||
logDeprecationWarnings({ dom: domConfig, hash: hashConfig, js: jsConfig }); | ||
return { | ||
domConfig: legacyHashToPluginInputConfiguration(domConfig), | ||
hashConfig: legacyHashToPluginInputConfiguration(hashConfig), | ||
jsConfig: legacyHashToPluginInputConfiguration(jsConfig), | ||
}; | ||
} | ||
const ATTR_PREFIX = "skedify:"; | ||
export function parseDOMParams(element) { | ||
if (!element) | ||
return {}; | ||
function getAttribute(name) { | ||
const value = element?.getAttribute(ATTR_PREFIX + name)?.trim(); | ||
return value || undefined; | ||
} | ||
const configuration = sanitize({ | ||
/** OAUTH */ | ||
rco: getAttribute("oauth.resource_code"), | ||
// token: getAttribute("oauth.token"), | ||
/** SESSION */ | ||
cas: getAttribute("session.status"), | ||
sid: getAttribute("session.id"), | ||
sst: getAttribute("session.source_tags"), | ||
/** CUSTOMER */ | ||
ccom: getAttribute("customer.company"), | ||
ccn: getAttribute("customer.customer_number"), | ||
cdob: getAttribute("customer.date_of_birth"), | ||
cem: getAttribute("customer.email"), | ||
ceid: getAttribute("customer.external_id"), | ||
cfn: getAttribute("customer.first_name"), | ||
cgr: getAttribute("customer.gender"), | ||
cid: getAttribute("customer.id"), | ||
cie: getAttribute("customer.is_existing"), | ||
clng: getAttribute("customer.language"), | ||
cln: getAttribute("customer.last_name"), | ||
cgl: getAttribute("customer.location.geolocation"), | ||
cci: getAttribute("customer.location.city"), | ||
cco: getAttribute("customer.location.country"), | ||
cpc: getAttribute("customer.location.postal_code"), | ||
csa: getAttribute("customer.location.state"), | ||
cst: getAttribute("customer.location.street_1"), | ||
cpn: getAttribute("customer.phone_number"), | ||
cpci: getAttribute("customer.preferred_contact_id"), | ||
cpoi: getAttribute("customer.preferred_office_id"), | ||
ctz: getAttribute("customer.timezone"), | ||
/** APPOINTMENT */ | ||
off: getAttribute("appointment.office_id"), | ||
sub: getAttribute("appointment.subject_id"), | ||
lis: getAttribute("appointment.listing_id"), | ||
/** EXTERNAL */ | ||
esb: getAttribute("external_subject_id"), | ||
eof: getAttribute("external_office_id"), | ||
eli: getAttribute("external_listing_id"), | ||
lsc: getAttribute("lead_segment_code"), | ||
/** HINTS */ | ||
con: getAttribute("hints.contacts"), | ||
eco: getAttribute("hints.external_employee_ids"), | ||
act: getAttribute("intent") ?? getAttribute("hints.intent"), | ||
lng: getAttribute("language"), | ||
mty: getAttribute("meeting_types"), | ||
/** APPLICATION */ | ||
scr: getAttribute("application.scroll"), | ||
ets: getAttribute("application.timezone_selection"), | ||
/** LOCATION */ | ||
lfa: getAttribute("location.formatted_address"), | ||
lgl: getAttribute("location.geolocation"), | ||
lci: getAttribute("location.city"), | ||
lco: getAttribute("location.country"), | ||
lpc: getAttribute("location.postal_code"), | ||
lsa: getAttribute("location.state"), | ||
lst: getAttribute("location.street_1"), | ||
sco: getAttribute("searchCountry") ?? getAttribute("search.country"), | ||
flo: getAttribute("flow"), | ||
}); | ||
return configuration; | ||
if (!element) return {}; | ||
function getAttribute(name) { | ||
const value = element?.getAttribute(ATTR_PREFIX + name)?.trim(); | ||
return value || undefined; | ||
} | ||
const configuration = sanitize({ | ||
/** OAUTH */ | ||
rco: getAttribute("oauth.resource_code"), | ||
// token: getAttribute("oauth.token"), | ||
/** SESSION */ | ||
cas: getAttribute("session.status"), | ||
sid: getAttribute("session.id"), | ||
sst: getAttribute("session.source_tags"), | ||
/** CUSTOMER */ | ||
ccom: getAttribute("customer.company"), | ||
ccn: getAttribute("customer.customer_number"), | ||
cdob: getAttribute("customer.date_of_birth"), | ||
cem: getAttribute("customer.email"), | ||
ceid: getAttribute("customer.external_id"), | ||
cfn: getAttribute("customer.first_name"), | ||
cgr: getAttribute("customer.gender"), | ||
cid: getAttribute("customer.id"), | ||
cie: getAttribute("customer.is_existing"), | ||
clng: getAttribute("customer.language"), | ||
cln: getAttribute("customer.last_name"), | ||
cgl: getAttribute("customer.location.geolocation"), | ||
cci: getAttribute("customer.location.city"), | ||
cco: getAttribute("customer.location.country"), | ||
cpc: getAttribute("customer.location.postal_code"), | ||
csa: getAttribute("customer.location.state"), | ||
cst: getAttribute("customer.location.street_1"), | ||
cpn: getAttribute("customer.phone_number"), | ||
cpci: getAttribute("customer.preferred_contact_id"), | ||
cpoi: getAttribute("customer.preferred_office_id"), | ||
ctz: getAttribute("customer.timezone"), | ||
/** APPOINTMENT */ | ||
off: getAttribute("appointment.office_id"), | ||
sub: getAttribute("appointment.subject_id"), | ||
lis: getAttribute("appointment.listing_id"), | ||
/** EXTERNAL */ | ||
esb: getAttribute("external_subject_id"), | ||
eof: getAttribute("external_office_id"), | ||
eli: getAttribute("external_listing_id"), | ||
lsc: getAttribute("lead_segment_code"), | ||
/** HINTS */ | ||
con: getAttribute("hints.contacts"), | ||
eco: getAttribute("hints.external_employee_ids"), | ||
act: getAttribute("intent") ?? getAttribute("hints.intent"), | ||
lng: getAttribute("language"), | ||
mty: getAttribute("meeting_types"), | ||
/** APPLICATION */ | ||
scr: getAttribute("application.scroll"), | ||
ets: getAttribute("application.timezone_selection"), | ||
/** LOCATION */ | ||
lfa: getAttribute("location.formatted_address"), | ||
lgl: getAttribute("location.geolocation"), | ||
lci: getAttribute("location.city"), | ||
lco: getAttribute("location.country"), | ||
lpc: getAttribute("location.postal_code"), | ||
lsa: getAttribute("location.state"), | ||
lst: getAttribute("location.street_1"), | ||
sco: getAttribute("searchCountry") ?? getAttribute("search.country"), | ||
flo: getAttribute("flow"), | ||
}); | ||
return configuration; | ||
} | ||
const HASH_PREFIX = "#skedify"; | ||
export function parseSkedifyURIHashParams(hash) { | ||
if (!hash?.startsWith(HASH_PREFIX)) | ||
return {}; | ||
const encodedParams = hash.slice(HASH_PREFIX.length); | ||
try { | ||
// TODO probably want to validate this? | ||
const configuration = sanitize(legacyDecodeURIParameters(encodedParams)); | ||
return configuration; | ||
} | ||
catch (err) { | ||
logger.error("We could not decode the given configuration. Configuration is ignored.", err instanceof Error ? err.message : undefined); | ||
return {}; | ||
} | ||
if (!hash?.startsWith(HASH_PREFIX)) return {}; | ||
const encodedParams = hash.slice(HASH_PREFIX.length); | ||
try { | ||
// TODO probably want to validate this? | ||
const configuration = sanitize(legacyDecodeURIParameters(encodedParams)); | ||
return configuration; | ||
} catch (err) { | ||
logger.error( | ||
"We could not decode the given configuration. Configuration is ignored.", | ||
err instanceof Error ? err.message : undefined, | ||
); | ||
return {}; | ||
} | ||
} | ||
export function parseJSConfigParams(config) { | ||
if (!config) | ||
return {}; | ||
const configuration = sanitize({ | ||
/** OAUTH */ | ||
rco: config.oauth?.resource_code, | ||
// token: getAttribute("oauth.token"), | ||
/** SESSION */ | ||
cas: config.session?.status, | ||
sid: config.session?.id, | ||
sst: config.session?.source_tags, | ||
/** CUSTOMER */ | ||
ccom: config.customer?.company, | ||
ccn: config.customer?.customer_number, | ||
cdob: config.customer?.date_of_birth, | ||
cem: config.customer?.email, | ||
ceid: config.customer?.external_id, | ||
cfn: config.customer?.first_name, | ||
cgr: config.customer?.gender, | ||
cid: config.customer?.id, | ||
cie: config.customer?.is_existing?.toString(), | ||
clng: config.customer?.language, | ||
cln: config.customer?.last_name, | ||
cgl: config.customer?.location?.geolocation, | ||
cci: config.customer?.location?.city, | ||
cco: config.customer?.location?.country, | ||
cpc: config.customer?.location?.postal_code, | ||
csa: config.customer?.location?.state, | ||
cst: config.customer?.location?.street_1, | ||
cpn: config.customer?.phone_number, | ||
cpci: config.customer?.preferred_contact_id, | ||
cpoi: config.customer?.preferred_office_id, | ||
ctz: config.customer?.timezone, | ||
/** APPOINTMENT */ | ||
off: config.appointment?.office_id, | ||
sub: config.appointment?.subject_id, | ||
lis: config.appointment?.listing_id, | ||
/** EXTERNAL */ | ||
esb: config.external_subject_id, | ||
eof: config.external_office_id, | ||
eli: config.external_listing_id, | ||
lsc: config.lead_segment_code, | ||
/** HINTS */ | ||
con: config.hints?.contacts, | ||
eco: config.hints?.external_employee_ids, | ||
act: config.intent ?? config.hints?.intent, | ||
lng: config.language, | ||
mty: config.meeting_types, | ||
/** APPLICATION */ | ||
scr: config.application?.scroll, | ||
ets: config.application?.timezone_selection, | ||
/** LOCATION */ | ||
lfa: config.location?.formatted_address, | ||
lgl: config.location?.geolocation, | ||
lci: config.location?.city, | ||
lco: config.location?.country, | ||
lpc: config.location?.postal_code, | ||
lsa: config.location?.state, | ||
lst: config.location?.street_1, | ||
sco: config.searchCountry ?? config.search?.country, | ||
flo: config.flow, | ||
}); | ||
return configuration; | ||
if (!config) return {}; | ||
const configuration = sanitize({ | ||
/** OAUTH */ | ||
rco: config.oauth?.resource_code, | ||
// token: getAttribute("oauth.token"), | ||
/** SESSION */ | ||
cas: config.session?.status, | ||
sid: config.session?.id, | ||
sst: config.session?.source_tags, | ||
/** CUSTOMER */ | ||
ccom: config.customer?.company, | ||
ccn: config.customer?.customer_number, | ||
cdob: config.customer?.date_of_birth, | ||
cem: config.customer?.email, | ||
ceid: config.customer?.external_id, | ||
cfn: config.customer?.first_name, | ||
cgr: config.customer?.gender, | ||
cid: config.customer?.id, | ||
cie: config.customer?.is_existing?.toString(), | ||
clng: config.customer?.language, | ||
cln: config.customer?.last_name, | ||
cgl: config.customer?.location?.geolocation, | ||
cci: config.customer?.location?.city, | ||
cco: config.customer?.location?.country, | ||
cpc: config.customer?.location?.postal_code, | ||
csa: config.customer?.location?.state, | ||
cst: config.customer?.location?.street_1, | ||
cpn: config.customer?.phone_number, | ||
cpci: config.customer?.preferred_contact_id, | ||
cpoi: config.customer?.preferred_office_id, | ||
ctz: config.customer?.timezone, | ||
/** APPOINTMENT */ | ||
off: config.appointment?.office_id, | ||
sub: config.appointment?.subject_id, | ||
lis: config.appointment?.listing_id, | ||
/** EXTERNAL */ | ||
esb: config.external_subject_id, | ||
eof: config.external_office_id, | ||
eli: config.external_listing_id, | ||
lsc: config.lead_segment_code, | ||
/** HINTS */ | ||
con: config.hints?.contacts, | ||
eco: config.hints?.external_employee_ids, | ||
act: config.intent ?? config.hints?.intent, | ||
lng: config.language, | ||
mty: config.meeting_types, | ||
/** APPLICATION */ | ||
scr: config.application?.scroll, | ||
ets: config.application?.timezone_selection, | ||
/** LOCATION */ | ||
lfa: config.location?.formatted_address, | ||
lgl: config.location?.geolocation, | ||
lci: config.location?.city, | ||
lco: config.location?.country, | ||
lpc: config.location?.postal_code, | ||
lsa: config.location?.state, | ||
lst: config.location?.street_1, | ||
sco: config.searchCountry ?? config.search?.country, | ||
flo: config.flow, | ||
}); | ||
return configuration; | ||
} |
import type { PluginConfiguration } from "@pexip-engage-public/plugin-configuration"; | ||
import type { LegacyPluginHashConfiguration } from "./LegacyParser.js"; | ||
import { type JSConfig } from "./ModernParser.js"; | ||
export declare function legacyHashToPluginInputConfiguration(config: LegacyPluginHashConfiguration): PluginConfiguration; | ||
export declare function legacyHashToPluginInputConfiguration( | ||
config: LegacyPluginHashConfiguration, | ||
): PluginConfiguration; | ||
export declare function logDeprecationWarnings(params: CreateMigrationInstructions): void; | ||
interface CreateMigrationInstructions { | ||
dom: LegacyPluginHashConfiguration | null; | ||
js: LegacyPluginHashConfiguration | null; | ||
hash: LegacyPluginHashConfiguration | null; | ||
dom: LegacyPluginHashConfiguration | null; | ||
js: LegacyPluginHashConfiguration | null; | ||
hash: LegacyPluginHashConfiguration | null; | ||
} | ||
export declare function createMigrationInstructions({ dom, hash, js }: CreateMigrationInstructions): { | ||
dom: { | ||
unsupported: ("lgl" | "lci" | "lco" | "lpc" | "lsa" | "lst")[] | ("location.geolocation" | "location.city" | "location.country" | "location.postal_code" | "location.state" | "location.street_1")[] | ("skedify:location.geolocation" | "skedify:location.city" | "skedify:location.country" | "skedify:location.postal_code" | "skedify:location.state" | "skedify:location.street_1")[] | null; | ||
migration: any[] | null; | ||
} | null; | ||
hash: { | ||
migration: string; | ||
unsupported: ("lgl" | "lci" | "lco" | "lpc" | "lsa" | "lst")[] | ("location.geolocation" | "location.city" | "location.country" | "location.postal_code" | "location.state" | "location.street_1")[] | ("skedify:location.geolocation" | "skedify:location.city" | "skedify:location.country" | "skedify:location.postal_code" | "skedify:location.state" | "skedify:location.street_1")[] | null; | ||
} | null; | ||
js: { | ||
unsupported: ("lgl" | "lci" | "lco" | "lpc" | "lsa" | "lst")[] | ("location.geolocation" | "location.city" | "location.country" | "location.postal_code" | "location.state" | "location.street_1")[] | ("skedify:location.geolocation" | "skedify:location.city" | "skedify:location.country" | "skedify:location.postal_code" | "skedify:location.state" | "skedify:location.street_1")[] | null; | ||
migration: JSConfig; | ||
} | null; | ||
export declare function createMigrationInstructions({ | ||
dom, | ||
hash, | ||
js, | ||
}: CreateMigrationInstructions): { | ||
dom: { | ||
unsupported: | ||
| ("lgl" | "lci" | "lco" | "lpc" | "lsa" | "lst")[] | ||
| ( | ||
| "location.geolocation" | ||
| "location.city" | ||
| "location.country" | ||
| "location.postal_code" | ||
| "location.state" | ||
| "location.street_1" | ||
)[] | ||
| ( | ||
| "skedify:location.geolocation" | ||
| "skedify:location.city" | ||
| "skedify:location.country" | ||
| "skedify:location.postal_code" | ||
| "skedify:location.state" | ||
| "skedify:location.street_1" | ||
)[] | ||
| null; | ||
migration: any[] | null; | ||
} | null; | ||
hash: { | ||
migration: string; | ||
unsupported: | ||
| ("lgl" | "lci" | "lco" | "lpc" | "lsa" | "lst")[] | ||
| ( | ||
| "location.geolocation" | ||
| "location.city" | ||
| "location.country" | ||
| "location.postal_code" | ||
| "location.state" | ||
| "location.street_1" | ||
)[] | ||
| ( | ||
| "skedify:location.geolocation" | ||
| "skedify:location.city" | ||
| "skedify:location.country" | ||
| "skedify:location.postal_code" | ||
| "skedify:location.state" | ||
| "skedify:location.street_1" | ||
)[] | ||
| null; | ||
} | null; | ||
js: { | ||
unsupported: | ||
| ("lgl" | "lci" | "lco" | "lpc" | "lsa" | "lst")[] | ||
| ( | ||
| "location.geolocation" | ||
| "location.city" | ||
| "location.country" | ||
| "location.postal_code" | ||
| "location.state" | ||
| "location.street_1" | ||
)[] | ||
| ( | ||
| "skedify:location.geolocation" | ||
| "skedify:location.city" | ||
| "skedify:location.country" | ||
| "skedify:location.postal_code" | ||
| "skedify:location.state" | ||
| "skedify:location.street_1" | ||
)[] | ||
| null; | ||
migration: JSConfig; | ||
} | null; | ||
}; | ||
@@ -28,2 +88,2 @@ export declare function insertMeetingTypeStepInFlow(flow?: string): string | undefined; | ||
export {}; | ||
//# sourceMappingURL=LegacyParser.utils.d.ts.map | ||
//# sourceMappingURL=LegacyParser.utils.d.ts.map |
@@ -6,257 +6,251 @@ import { logger } from "@pexip-engage-public/plugin-utils"; | ||
export function legacyHashToPluginInputConfiguration(config) { | ||
return sanitize({ | ||
flow: transformDeprecatedTokens(insertMeetingTypeStepInFlow(config.flo)), | ||
intent: config.act, | ||
"subject-ids": config.sub ?? config.esb, | ||
"subject-type": config.sub ? "id" : config.esb ? "externalId" : undefined, | ||
"office-ids": config.off ?? config.eof, | ||
"office-type": config.off ? "id" : config.eof ? "externalId" : undefined, | ||
"listing-id": config.lis ?? config.eli, | ||
"listing-type": config.lis ? "id" : config.eli ? "externalId" : undefined, | ||
"employee-ids": config.con ?? config.eco, | ||
"employee-type": config.con ? "id" : config.eco ? "externalId" : undefined, | ||
"lead_segment-id": config.lsc, | ||
"lead_segment-type": config.lsc ? "code" : undefined, | ||
"oauth-resource_code": config.rco, | ||
"session-status": config.cas, | ||
"session-id": config.sid, | ||
"session-source_tags": config.sst, | ||
"customer-company": config.ccom, | ||
"customer-customer_number": config.ccn, | ||
"customer-date_of_birth": config.cdob, | ||
"customer-email": config.cem, | ||
"customer-external_id": config.ceid, | ||
"customer-first_name": config.cfn, | ||
"customer-gender": config.cgr, | ||
"customer-id": config.cid, | ||
"customer-is_existing": config.cie, | ||
"customer-language": config.clng, | ||
"customer-last_name": config.cln, | ||
"customer-location-city": config.cci, | ||
"customer-location-country": config.cco, | ||
"customer-location-geolocation": config.cgl, | ||
"customer-location-postal_code": config.cpc, | ||
"customer-location-state": config.csa, | ||
"customer-location-street_1": config.cst, | ||
"customer-phone_number": config.cpn, | ||
"customer-preferred_contact_id": config.cpci, | ||
"customer-preferred_office_id": config.cpoi, | ||
"customer-timezone": config.ctz, | ||
language: config.lng, | ||
meeting_types: config.mty, | ||
"application-scroll": config.scr === "disable_initial_scroll_on_schedule" ? "disabled" : undefined, | ||
"application-timezone_selection": config.ets, | ||
"location-initial_search": config.lfa, | ||
search_countries: config.sco, | ||
source_href: undefined, | ||
"browser-timezone": undefined, | ||
}); | ||
return sanitize({ | ||
flow: transformDeprecatedTokens(insertMeetingTypeStepInFlow(config.flo)), | ||
intent: config.act, | ||
"subject-ids": config.sub ?? config.esb, | ||
"subject-type": config.sub ? "id" : config.esb ? "externalId" : undefined, | ||
"office-ids": config.off ?? config.eof, | ||
"office-type": config.off ? "id" : config.eof ? "externalId" : undefined, | ||
"listing-id": config.lis ?? config.eli, | ||
"listing-type": config.lis ? "id" : config.eli ? "externalId" : undefined, | ||
"employee-ids": config.con ?? config.eco, | ||
"employee-type": config.con ? "id" : config.eco ? "externalId" : undefined, | ||
"lead_segment-id": config.lsc, | ||
"lead_segment-type": config.lsc ? "code" : undefined, | ||
"oauth-resource_code": config.rco, | ||
"session-status": config.cas, | ||
"session-id": config.sid, | ||
"session-source_tags": config.sst, | ||
"customer-company": config.ccom, | ||
"customer-customer_number": config.ccn, | ||
"customer-date_of_birth": config.cdob, | ||
"customer-email": config.cem, | ||
"customer-external_id": config.ceid, | ||
"customer-first_name": config.cfn, | ||
"customer-gender": config.cgr, | ||
"customer-id": config.cid, | ||
"customer-is_existing": config.cie, | ||
"customer-language": config.clng, | ||
"customer-last_name": config.cln, | ||
"customer-location-city": config.cci, | ||
"customer-location-country": config.cco, | ||
"customer-location-geolocation": config.cgl, | ||
"customer-location-postal_code": config.cpc, | ||
"customer-location-state": config.csa, | ||
"customer-location-street_1": config.cst, | ||
"customer-phone_number": config.cpn, | ||
"customer-preferred_contact_id": config.cpci, | ||
"customer-preferred_office_id": config.cpoi, | ||
"customer-timezone": config.ctz, | ||
language: config.lng, | ||
meeting_types: config.mty, | ||
"application-scroll": | ||
config.scr === "disable_initial_scroll_on_schedule" ? "disabled" : undefined, | ||
"application-timezone_selection": config.ets, | ||
"application-theme": undefined, | ||
"location-initial_search": config.lfa, | ||
search_countries: config.sco, | ||
source_href: undefined, | ||
"browser-timezone": undefined, | ||
}); | ||
} | ||
export function logDeprecationWarnings(params) { | ||
const { dom, hash, js } = createMigrationInstructions(params); | ||
if (dom || hash || js) { | ||
logger.group("DEPRECATED CONFIGURATION"); | ||
if (dom) { | ||
const { migration, unsupported } = dom; | ||
if (unsupported) { | ||
logger.warn(`DOM: Following keys are not supported anymore:\n${unsupported.join(", ")}`); | ||
} | ||
if (migration) { | ||
logger.warn("Detected unsupported DOM config. Please update your DOM element to:\n%o", `<div class="pexip-engage-plugin" ${migration.join(" ")}></div>`); | ||
} | ||
} | ||
if (hash) { | ||
const { migration, unsupported } = hash; | ||
if (unsupported) { | ||
logger.warn(`Hash: Following keys are not supported anymore:\n${unsupported.join(", ")}`); | ||
} | ||
logger.warn("Detected deprecated hash config. Please update your hash to:\n%o", migration); | ||
} | ||
if (js) { | ||
const { migration, unsupported } = js; | ||
if (unsupported) { | ||
logger.warn(`JS: Following keys are not supported anymore:\n${unsupported.join(", ")}`); | ||
} | ||
logger.warn("Detected deprecated JS config. Please update your JS to:\n%o", `PexipEngage.Plugin(element, ${JSON.stringify(migration)})`); | ||
} | ||
logger.groupEnd(); | ||
const { dom, hash, js } = createMigrationInstructions(params); | ||
if (dom || hash || js) { | ||
logger.group("DEPRECATED CONFIGURATION"); | ||
if (dom) { | ||
const { migration, unsupported } = dom; | ||
if (unsupported) { | ||
logger.warn(`DOM: Following keys are not supported anymore:\n${unsupported.join(", ")}`); | ||
} | ||
if (migration) { | ||
logger.warn( | ||
"Detected unsupported DOM config. Please update your DOM element to:\n%o", | ||
`<div class="pexip-engage-plugin" ${migration.join(" ")}></div>`, | ||
); | ||
} | ||
} | ||
if (hash) { | ||
const { migration, unsupported } = hash; | ||
if (unsupported) { | ||
logger.warn(`Hash: Following keys are not supported anymore:\n${unsupported.join(", ")}`); | ||
} | ||
logger.warn("Detected deprecated hash config. Please update your hash to:\n%o", migration); | ||
} | ||
if (js) { | ||
const { migration, unsupported } = js; | ||
if (unsupported) { | ||
logger.warn(`JS: Following keys are not supported anymore:\n${unsupported.join(", ")}`); | ||
} | ||
logger.warn( | ||
"Detected deprecated JS config. Please update your JS to:\n%o", | ||
`PexipEngage.Plugin(element, ${JSON.stringify(migration)})`, | ||
); | ||
} | ||
logger.groupEnd(); | ||
} | ||
} | ||
export function createMigrationInstructions({ dom, hash, js }) { | ||
return { | ||
dom: dom && createDOMParamWarnings(dom), | ||
hash: hash && createHashParamWarnings(hash), | ||
js: js && createJSParamWarning(js), | ||
}; | ||
return { | ||
dom: dom && createDOMParamWarnings(dom), | ||
hash: hash && createHashParamWarnings(hash), | ||
js: js && createJSParamWarning(js), | ||
}; | ||
} | ||
function createDOMParamWarnings(hashConfig) { | ||
if (Object.keys(hashConfig).length === 0) | ||
return null; | ||
const unsupported = getUnsupportedKeys(hashConfig, "html"); | ||
const config = legacyHashToPluginInputConfiguration(hashConfig); | ||
const migrations = Object.entries(config) | ||
.map(([key, value]) => value && `${ATTR_PREFIX}${key}="${value}"`) | ||
.filter(Boolean); | ||
const migration = migrations.length === 0 ? null : migrations; | ||
if (!unsupported && !migration) | ||
return null; | ||
return { unsupported, migration }; | ||
if (Object.keys(hashConfig).length === 0) return null; | ||
const unsupported = getUnsupportedKeys(hashConfig, "html"); | ||
const config = legacyHashToPluginInputConfiguration(hashConfig); | ||
const migrations = Object.entries(config) | ||
.map(([key, value]) => value && `${ATTR_PREFIX}${key}="${value}"`) | ||
.filter(Boolean); | ||
const migration = migrations.length === 0 ? null : migrations; | ||
if (!unsupported && !migration) return null; | ||
return { unsupported, migration }; | ||
} | ||
function createHashParamWarnings(hashConfig) { | ||
if (Object.keys(hashConfig).length === 0) | ||
return null; | ||
const unsupported = getUnsupportedKeys(hashConfig, "hash"); | ||
const config = legacyHashToPluginInputConfiguration(hashConfig); | ||
const modernHash = encodeConfigAsHash(config); | ||
return { migration: modernHash, unsupported }; | ||
if (Object.keys(hashConfig).length === 0) return null; | ||
const unsupported = getUnsupportedKeys(hashConfig, "hash"); | ||
const config = legacyHashToPluginInputConfiguration(hashConfig); | ||
const modernHash = encodeConfigAsHash(config); | ||
return { migration: modernHash, unsupported }; | ||
} | ||
function createJSParamWarning(hashConfig) { | ||
if (Object.keys(hashConfig).length === 0) | ||
return null; | ||
const unsupported = getUnsupportedKeys(hashConfig, "js"); | ||
const config = legacyHashToPluginInputConfiguration(hashConfig); | ||
const jsConfig = sanitize({ | ||
config: { | ||
flow: config.flow, | ||
intent: config.intent, | ||
language: config.language, | ||
employee: { | ||
ids: config["employee-ids"], | ||
type: config["employee-type"], | ||
}, | ||
application: { | ||
scroll: config["application-scroll"], | ||
timezoneSelection: config["application-timezone_selection"], | ||
}, | ||
customer: { | ||
company: config["customer-company"], | ||
customer_number: config["customer-customer_number"], | ||
date_of_birth: config["customer-date_of_birth"], | ||
email: config["customer-email"], | ||
external_id: config["customer-external_id"], | ||
first_name: config["customer-first_name"], | ||
gender: config["customer-gender"], | ||
id: config["customer-id"], | ||
is_existing: config["customer-is_existing"], | ||
language: config["customer-language"], | ||
last_name: config["customer-last_name"], | ||
location: { | ||
city: config["customer-location-city"], | ||
country: config["customer-location-country"], | ||
geolocation: config["customer-location-geolocation"], | ||
postal_code: config["customer-location-postal_code"], | ||
state: config["customer-location-state"], | ||
street_1: config["customer-location-street_1"], | ||
}, | ||
phone_number: config["customer-phone_number"], | ||
preferred_contact_id: config["customer-preferred_contact_id"], | ||
preferred_office_id: config["customer-preferred_office_id"], | ||
timezone: config["customer-timezone"], | ||
}, | ||
leadSegment: { | ||
id: config["lead_segment-id"], | ||
type: config["lead_segment-type"], | ||
}, | ||
listing: { | ||
id: config["listing-id"], | ||
type: config["listing-type"], | ||
}, | ||
location: { | ||
initialSearch: config["location-initial_search"], | ||
}, | ||
meetingTypes: config["meeting_types"], | ||
oauth: { | ||
resourceCode: config["oauth-resource_code"], | ||
}, | ||
office: { | ||
ids: config["office-ids"], | ||
type: config["office-type"], | ||
}, | ||
searchCountries: config["search_countries"], | ||
session: { | ||
id: config["session-id"], | ||
sourceTags: config["session-source_tags"], | ||
status: config["session-status"], | ||
}, | ||
subject: { | ||
ids: config["subject-ids"], | ||
type: config["subject-type"], | ||
}, | ||
timetable: {}, | ||
if (Object.keys(hashConfig).length === 0) return null; | ||
const unsupported = getUnsupportedKeys(hashConfig, "js"); | ||
const config = legacyHashToPluginInputConfiguration(hashConfig); | ||
const jsConfig = sanitize({ | ||
config: { | ||
flow: config.flow, | ||
intent: config.intent, | ||
language: config.language, | ||
employee: { | ||
ids: config["employee-ids"], | ||
type: config["employee-type"], | ||
}, | ||
application: { | ||
scroll: config["application-scroll"], | ||
timezoneSelection: config["application-timezone_selection"], | ||
theme: config["application-theme"], | ||
}, | ||
customer: { | ||
company: config["customer-company"], | ||
customer_number: config["customer-customer_number"], | ||
date_of_birth: config["customer-date_of_birth"], | ||
email: config["customer-email"], | ||
external_id: config["customer-external_id"], | ||
first_name: config["customer-first_name"], | ||
gender: config["customer-gender"], | ||
id: config["customer-id"], | ||
is_existing: config["customer-is_existing"], | ||
language: config["customer-language"], | ||
last_name: config["customer-last_name"], | ||
location: { | ||
city: config["customer-location-city"], | ||
country: config["customer-location-country"], | ||
geolocation: config["customer-location-geolocation"], | ||
postal_code: config["customer-location-postal_code"], | ||
state: config["customer-location-state"], | ||
street_1: config["customer-location-street_1"], | ||
}, | ||
}); | ||
return { | ||
unsupported, | ||
migration: jsConfig, | ||
}; | ||
phone_number: config["customer-phone_number"], | ||
preferred_contact_id: config["customer-preferred_contact_id"], | ||
preferred_office_id: config["customer-preferred_office_id"], | ||
timezone: config["customer-timezone"], | ||
}, | ||
leadSegment: { | ||
id: config["lead_segment-id"], | ||
type: config["lead_segment-type"], | ||
}, | ||
listing: { | ||
id: config["listing-id"], | ||
type: config["listing-type"], | ||
}, | ||
location: { | ||
initialSearch: config["location-initial_search"], | ||
}, | ||
meetingTypes: config["meeting_types"], | ||
oauth: { | ||
resourceCode: config["oauth-resource_code"], | ||
}, | ||
office: { | ||
ids: config["office-ids"], | ||
type: config["office-type"], | ||
}, | ||
searchCountries: config["search_countries"], | ||
session: { | ||
id: config["session-id"], | ||
sourceTags: config["session-source_tags"], | ||
status: config["session-status"], | ||
}, | ||
subject: { | ||
ids: config["subject-ids"], | ||
type: config["subject-type"], | ||
}, | ||
timetable: {}, | ||
}, | ||
}); | ||
return { | ||
unsupported, | ||
migration: jsConfig, | ||
}; | ||
} | ||
const UNSUPPORTED_HASH_KEY_TO_JS = { | ||
lgl: "location.geolocation", | ||
lci: "location.city", | ||
lco: "location.country", | ||
lpc: "location.postal_code", | ||
lsa: "location.state", | ||
lst: "location.street_1", | ||
lgl: "location.geolocation", | ||
lci: "location.city", | ||
lco: "location.country", | ||
lpc: "location.postal_code", | ||
lsa: "location.state", | ||
lst: "location.street_1", | ||
}; | ||
const UNSUPPORTED_HASH_KEY_TO_HTML = { | ||
lgl: "skedify:location.geolocation", | ||
lci: "skedify:location.city", | ||
lco: "skedify:location.country", | ||
lpc: "skedify:location.postal_code", | ||
lsa: "skedify:location.state", | ||
lst: "skedify:location.street_1", | ||
lgl: "skedify:location.geolocation", | ||
lci: "skedify:location.city", | ||
lco: "skedify:location.country", | ||
lpc: "skedify:location.postal_code", | ||
lsa: "skedify:location.state", | ||
lst: "skedify:location.street_1", | ||
}; | ||
const UNSUPPORTED_KEYS = ["lgl", "lci", "lco", "lpc", "lsa", "lst"]; | ||
function getUnsupportedKeys(hashConfig, type) { | ||
const unsupported = Object.keys(hashConfig).filter((key) => UNSUPPORTED_KEYS.includes(key)); | ||
if (unsupported.length === 0) | ||
return null; | ||
if (type === "hash") | ||
return unsupported; | ||
if (type === "js") | ||
return unsupported.map((hash) => UNSUPPORTED_HASH_KEY_TO_JS[hash]); | ||
if (type === "html") | ||
return unsupported.map((hash) => UNSUPPORTED_HASH_KEY_TO_HTML[hash]); | ||
return unsupported; | ||
const unsupported = Object.keys(hashConfig).filter((key) => UNSUPPORTED_KEYS.includes(key)); | ||
if (unsupported.length === 0) return null; | ||
if (type === "hash") return unsupported; | ||
if (type === "js") return unsupported.map((hash) => UNSUPPORTED_HASH_KEY_TO_JS[hash]); | ||
if (type === "html") return unsupported.map((hash) => UNSUPPORTED_HASH_KEY_TO_HTML[hash]); | ||
return unsupported; | ||
} | ||
export function insertMeetingTypeStepInFlow(flow) { | ||
if (!flow) | ||
return undefined; | ||
const tokens = flow.split(""); | ||
const MEETING_TYPE_IDX = tokens.indexOf(TOKEN.MEETING_TYPE); | ||
if (MEETING_TYPE_IDX !== -1) | ||
return flow; | ||
function getIndexToInsert(tokenIndex) { | ||
const previousTokenIndex = tokenIndex - 1; | ||
const isLocked = tokens[previousTokenIndex] === DEPRECATED_TOKEN.LOCK; | ||
// We should insert M before the lock token. | ||
return isLocked ? previousTokenIndex : tokenIndex; | ||
} | ||
// MeetingType is a separate required step, so inject it before Office or Subject | ||
// when it's not present. | ||
const OFFICE_IDX = tokens.indexOf(TOKEN.OFFICE); | ||
const SUBJECT_IDX = tokens.indexOf(TOKEN.SUBJECT); | ||
if (OFFICE_IDX !== -1) { | ||
tokens.splice(getIndexToInsert(OFFICE_IDX), 0, TOKEN.MEETING_TYPE); | ||
} | ||
else if (SUBJECT_IDX !== -1) { | ||
tokens.splice(getIndexToInsert(SUBJECT_IDX), 0, TOKEN.MEETING_TYPE); | ||
} | ||
return tokens.join(""); | ||
if (!flow) return undefined; | ||
const tokens = flow.split(""); | ||
const MEETING_TYPE_IDX = tokens.indexOf(TOKEN.MEETING_TYPE); | ||
if (MEETING_TYPE_IDX !== -1) return flow; | ||
function getIndexToInsert(tokenIndex) { | ||
const previousTokenIndex = tokenIndex - 1; | ||
const isLocked = tokens[previousTokenIndex] === DEPRECATED_TOKEN.LOCK; | ||
// We should insert M before the lock token. | ||
return isLocked ? previousTokenIndex : tokenIndex; | ||
} | ||
// MeetingType is a separate required step, so inject it before Office or Subject | ||
// when it's not present. | ||
const OFFICE_IDX = tokens.indexOf(TOKEN.OFFICE); | ||
const SUBJECT_IDX = tokens.indexOf(TOKEN.SUBJECT); | ||
if (OFFICE_IDX !== -1) { | ||
tokens.splice(getIndexToInsert(OFFICE_IDX), 0, TOKEN.MEETING_TYPE); | ||
} else if (SUBJECT_IDX !== -1) { | ||
tokens.splice(getIndexToInsert(SUBJECT_IDX), 0, TOKEN.MEETING_TYPE); | ||
} | ||
return tokens.join(""); | ||
} | ||
export function transformDeprecatedTokens(flow) { | ||
if (!flow) | ||
return undefined; | ||
return flow | ||
.split("") | ||
.map((token) => { | ||
if (token === DEPRECATED_TOKEN.LOCK) | ||
return TOKEN.LOCK; | ||
if (token === DEPRECATED_TOKEN.OFFICE) | ||
return TOKEN.OFFICE; | ||
if (token === DEPRECATED_TOKEN.START) | ||
return ""; | ||
return token; | ||
if (!flow) return undefined; | ||
return flow | ||
.split("") | ||
.map((token) => { | ||
if (token === DEPRECATED_TOKEN.LOCK) return TOKEN.LOCK; | ||
if (token === DEPRECATED_TOKEN.OFFICE) return TOKEN.OFFICE; | ||
if (token === DEPRECATED_TOKEN.START) return ""; | ||
return token; | ||
}) | ||
.join(""); | ||
.join(""); | ||
} |
import type { PluginConfiguration } from "@pexip-engage-public/plugin-configuration"; | ||
interface ModernParseParams { | ||
element?: HTMLElement | null; | ||
hash?: string | null; | ||
options?: JSConfig | null; | ||
element?: HTMLElement | null; | ||
hash?: string | null; | ||
options?: JSConfig | null; | ||
} | ||
export declare function parse({ element, hash, options }: ModernParseParams): { | ||
domConfig: PluginConfiguration; | ||
hashConfig: PluginConfiguration; | ||
jsConfig: PluginConfiguration; | ||
domConfig: PluginConfiguration; | ||
hashConfig: PluginConfiguration; | ||
jsConfig: PluginConfiguration; | ||
}; | ||
@@ -17,3 +17,6 @@ export declare const HASH_PREFIX = "#pexip-"; | ||
export type HTMLConfig = { | ||
[key in keyof PluginConfiguration as `${typeof ATTR_PREFIX}${key}`]: Exclude<PluginConfiguration[key], string[] | null | boolean>; | ||
[key in keyof PluginConfiguration as `${typeof ATTR_PREFIX}${key}`]: Exclude< | ||
PluginConfiguration[key], | ||
string[] | null | boolean | ||
>; | ||
}; | ||
@@ -24,74 +27,75 @@ type StringConfig = string | null; | ||
export interface JSConfig { | ||
config?: { | ||
flow?: StringConfig; | ||
intent?: StringConfig; | ||
language?: StringConfig; | ||
employee?: { | ||
ids?: StringArrayConfig; | ||
type?: StringConfig; | ||
}; | ||
application?: { | ||
scroll?: "disabled" | number | null; | ||
timezoneSelection?: StringConfig; | ||
}; | ||
customer?: { | ||
company?: StringConfig; | ||
customer_number?: StringConfig; | ||
date_of_birth?: StringConfig; | ||
email?: StringConfig; | ||
external_id?: StringConfig; | ||
first_name?: StringConfig; | ||
gender?: StringConfig; | ||
id?: StringConfig; | ||
is_existing?: BooleanConfig; | ||
language?: StringConfig; | ||
last_name?: StringConfig; | ||
location?: { | ||
city?: StringConfig; | ||
country?: StringConfig; | ||
geolocation?: StringConfig; | ||
postal_code?: StringConfig; | ||
state?: StringConfig; | ||
street_1?: StringConfig; | ||
}; | ||
phone_number?: StringConfig; | ||
preferred_contact_id?: StringConfig; | ||
preferred_office_id?: StringConfig; | ||
timezone?: StringConfig; | ||
}; | ||
leadSegment?: { | ||
id?: StringConfig; | ||
type?: StringConfig; | ||
}; | ||
listing?: { | ||
id?: StringConfig; | ||
type?: StringConfig; | ||
}; | ||
location?: { | ||
initialSearch?: StringConfig; | ||
}; | ||
meetingTypes?: StringArrayConfig; | ||
oauth?: { | ||
resourceCode?: StringConfig; | ||
}; | ||
office?: { | ||
ids?: StringArrayConfig; | ||
type?: StringConfig; | ||
}; | ||
searchCountries?: StringArrayConfig; | ||
session?: { | ||
id?: StringConfig; | ||
sourceTags?: StringArrayConfig; | ||
status?: StringConfig; | ||
}; | ||
subject?: { | ||
ids?: StringArrayConfig; | ||
type?: StringConfig; | ||
}; | ||
timetable?: { | ||
startDate?: StringConfig; | ||
}; | ||
config?: { | ||
flow?: StringConfig; | ||
intent?: StringConfig; | ||
language?: StringConfig; | ||
employee?: { | ||
ids?: StringArrayConfig; | ||
type?: StringConfig; | ||
}; | ||
application?: { | ||
scroll?: "disabled" | number | null; | ||
timezoneSelection?: StringConfig; | ||
theme?: string | null; | ||
}; | ||
customer?: { | ||
company?: StringConfig; | ||
customer_number?: StringConfig; | ||
date_of_birth?: StringConfig; | ||
email?: StringConfig; | ||
external_id?: StringConfig; | ||
first_name?: StringConfig; | ||
gender?: StringConfig; | ||
id?: StringConfig; | ||
is_existing?: BooleanConfig; | ||
language?: StringConfig; | ||
last_name?: StringConfig; | ||
location?: { | ||
city?: StringConfig; | ||
country?: StringConfig; | ||
geolocation?: StringConfig; | ||
postal_code?: StringConfig; | ||
state?: StringConfig; | ||
street_1?: StringConfig; | ||
}; | ||
phone_number?: StringConfig; | ||
preferred_contact_id?: StringConfig; | ||
preferred_office_id?: StringConfig; | ||
timezone?: StringConfig; | ||
}; | ||
leadSegment?: { | ||
id?: StringConfig; | ||
type?: StringConfig; | ||
}; | ||
listing?: { | ||
id?: StringConfig; | ||
type?: StringConfig; | ||
}; | ||
location?: { | ||
initialSearch?: StringConfig; | ||
}; | ||
meetingTypes?: StringArrayConfig; | ||
oauth?: { | ||
resourceCode?: StringConfig; | ||
}; | ||
office?: { | ||
ids?: StringArrayConfig; | ||
type?: StringConfig; | ||
}; | ||
searchCountries?: StringArrayConfig; | ||
session?: { | ||
id?: StringConfig; | ||
sourceTags?: StringArrayConfig; | ||
status?: StringConfig; | ||
}; | ||
subject?: { | ||
ids?: StringArrayConfig; | ||
type?: StringConfig; | ||
}; | ||
timetable?: { | ||
startDate?: StringConfig; | ||
}; | ||
}; | ||
} | ||
export {}; | ||
//# sourceMappingURL=ModernParser.d.ts.map | ||
//# sourceMappingURL=ModernParser.d.ts.map |
import { decodeURIParameters, encodeURIParameters, sanitize } from "./utils.js"; | ||
export function parse({ element, hash, options }) { | ||
return { | ||
domConfig: parseDOMParams(element), | ||
hashConfig: decodeConfigHash(hash), | ||
jsConfig: parseJSParams(options), | ||
}; | ||
return { | ||
domConfig: parseDOMParams(element), | ||
hashConfig: decodeConfigHash(hash), | ||
jsConfig: parseJSParams(options), | ||
}; | ||
} | ||
export const HASH_PREFIX = "#pexip-"; | ||
export function encodeConfigAsHash(value) { | ||
return HASH_PREFIX + encodeURIParameters(value); | ||
return HASH_PREFIX + encodeURIParameters(value); | ||
} | ||
export function decodeConfigHash(hash) { | ||
if (!hash || !hash.startsWith(HASH_PREFIX)) | ||
return {}; | ||
const value = hash.slice(HASH_PREFIX.length); | ||
const configuration = decodeURIParameters(value); | ||
return configuration; | ||
if (!hash || !hash.startsWith(HASH_PREFIX)) return {}; | ||
const value = hash.slice(HASH_PREFIX.length); | ||
const configuration = decodeURIParameters(value); | ||
return configuration; | ||
} | ||
export const ATTR_PREFIX = "data-pexip-"; | ||
function parseDOMParams(element) { | ||
if (!element) | ||
return {}; | ||
const attributes = element.getAttributeNames().filter((name) => name.startsWith(ATTR_PREFIX)); | ||
const object = {}; | ||
for (const attribute of attributes) { | ||
const key = attribute.replace(ATTR_PREFIX, ""); | ||
object[key] = element.getAttribute(attribute)?.trim() || undefined; | ||
} | ||
return sanitize(object); | ||
if (!element) return {}; | ||
const attributes = element.getAttributeNames().filter((name) => name.startsWith(ATTR_PREFIX)); | ||
const object = {}; | ||
for (const attribute of attributes) { | ||
const key = attribute.replace(ATTR_PREFIX, ""); | ||
object[key] = element.getAttribute(attribute)?.trim() || undefined; | ||
} | ||
return sanitize(object); | ||
} | ||
function parseJSParams(jsConfig) { | ||
if (!jsConfig?.config) | ||
return {}; | ||
const { config } = jsConfig; | ||
return sanitize(objectToDashConfig(config)); | ||
if (!jsConfig?.config) return {}; | ||
const { config } = jsConfig; | ||
return sanitize(objectToDashConfig(config)); | ||
} | ||
function objectToDashConfig(inputObject, current, result = {}) { | ||
for (let key in inputObject) { | ||
let value = inputObject[key]; | ||
let newKey = current ? `${current}-${key}` : key; | ||
if (Array.isArray(value)) { | ||
result[newKey] = value; | ||
} | ||
else if (value && typeof value === "object") { | ||
objectToDashConfig(value, newKey, result); | ||
} | ||
else { | ||
result[newKey] = value; | ||
} | ||
for (let key in inputObject) { | ||
let value = inputObject[key]; | ||
let newKey = current ? `${current}-${key}` : key; | ||
if (Array.isArray(value)) { | ||
result[newKey] = value; | ||
} else if (value && typeof value === "object") { | ||
objectToDashConfig(value, newKey, result); | ||
} else { | ||
result[newKey] = value; | ||
} | ||
return result; | ||
} | ||
return result; | ||
} |
@@ -6,2 +6,2 @@ import type { PluginConfiguration } from "@pexip-engage-public/plugin-configuration"; | ||
export declare function configToJS(config: PluginConfiguration): JSConfig; | ||
//# sourceMappingURL=ModernParser.utils.d.ts.map | ||
//# sourceMappingURL=ModernParser.utils.d.ts.map |
import { ATTR_PREFIX } from "./ModernParser.js"; | ||
export function configToHash(config) { | ||
return config; | ||
return config; | ||
} | ||
export function configToHtml(config) { | ||
return Object.entries(config).map(([key, value]) => `${ATTR_PREFIX}${key}="${value}"`); | ||
return Object.entries(config).map(([key, value]) => `${ATTR_PREFIX}${key}="${value}"`); | ||
} | ||
export function configToJS(config) { | ||
const result = {}; | ||
for (let key in config) { | ||
const value = config[key]; | ||
const keys = key.split("-"); | ||
setValue(result, keys, value); | ||
} | ||
return { config: result }; | ||
const result = {}; | ||
for (let key in config) { | ||
const value = config[key]; | ||
const keys = key.split("-"); | ||
setValue(result, keys, value); | ||
} | ||
return { config: result }; | ||
} | ||
function setValue(target, keys, value) { | ||
let targetObj = target; | ||
const [lastKey] = keys.splice(-1, 1); | ||
for (const key of keys) { | ||
if (!targetObj[key]) { | ||
targetObj[key] = {}; | ||
} | ||
targetObj = targetObj[key]; | ||
let targetObj = target; | ||
const [lastKey] = keys.splice(-1, 1); | ||
for (const key of keys) { | ||
if (!targetObj[key]) { | ||
targetObj[key] = {}; | ||
} | ||
//@ts-expect-error | ||
targetObj[lastKey] = value; | ||
targetObj = targetObj[key]; | ||
} | ||
//@ts-expect-error | ||
targetObj[lastKey] = value; | ||
} |
import type { PluginConfiguration } from "@pexip-engage-public/plugin-configuration"; | ||
export { encodeConfigAsHash } from "./ModernParser.js"; | ||
export { decodeURIParameters, encodeURIParameters } from "./utils.js"; | ||
export declare function parsePluginConfiguration({ browserTimeZone, element, hash, href, options, }: { | ||
element?: HTMLElement; | ||
hash?: string; | ||
options?: unknown; | ||
href?: string; | ||
browserTimeZone?: string; | ||
export declare function parsePluginConfiguration({ | ||
browserTimeZone, | ||
element, | ||
hash, | ||
href, | ||
options, | ||
}: { | ||
element?: HTMLElement; | ||
hash?: string; | ||
options?: unknown; | ||
href?: string; | ||
browserTimeZone?: string; | ||
}): { | ||
config: PluginConfiguration; | ||
domConfig: PluginConfiguration; | ||
hashConfig: PluginConfiguration; | ||
jsConfig: PluginConfiguration; | ||
config: PluginConfiguration; | ||
domConfig: PluginConfiguration; | ||
hashConfig: PluginConfiguration; | ||
jsConfig: PluginConfiguration; | ||
}; | ||
export declare function createSearchParamConfig({ config }: { | ||
config: PluginConfiguration; | ||
export declare function createSearchParamConfig({ | ||
config, | ||
}: { | ||
config: PluginConfiguration; | ||
}): URLSearchParams; | ||
export declare function parseFromSearchParamConfig(searchParams: URLSearchParams): unknown; | ||
//# sourceMappingURL=Parser.d.ts.map | ||
//# sourceMappingURL=Parser.d.ts.map |
@@ -6,30 +6,29 @@ import { parse as legacyParser } from "./LegacyParser.js"; | ||
export { decodeURIParameters, encodeURIParameters } from "./utils.js"; | ||
export function parsePluginConfiguration({ browserTimeZone, element, hash, href, options = {}, }) { | ||
if (!isValidConfiguration(options)) | ||
throw new Error("Invalid configuration passed, expected an object."); | ||
const legacy = legacyParser({ element, hash, options }); | ||
const modern = modernParser({ element, hash, options }); | ||
const domConfig = { ...legacy.domConfig, ...modern.domConfig }; | ||
const hashConfig = { ...legacy.hashConfig, ...modern.hashConfig }; | ||
const jsConfig = { ...legacy.jsConfig, ...modern.jsConfig }; | ||
const config = { | ||
...domConfig, | ||
...hashConfig, | ||
...jsConfig, | ||
source_href: href, | ||
"browser-timezone": browserTimeZone, | ||
}; | ||
return { config, domConfig, hashConfig, jsConfig }; | ||
export function parsePluginConfiguration({ browserTimeZone, element, hash, href, options = {} }) { | ||
if (!isValidConfiguration(options)) | ||
throw new Error("Invalid configuration passed, expected an object."); | ||
const legacy = legacyParser({ element, hash, options }); | ||
const modern = modernParser({ element, hash, options }); | ||
const domConfig = { ...legacy.domConfig, ...modern.domConfig }; | ||
const hashConfig = { ...legacy.hashConfig, ...modern.hashConfig }; | ||
const jsConfig = { ...legacy.jsConfig, ...modern.jsConfig }; | ||
const config = { | ||
...domConfig, | ||
...hashConfig, | ||
...jsConfig, | ||
source_href: href, | ||
"browser-timezone": browserTimeZone, | ||
}; | ||
return { config, domConfig, hashConfig, jsConfig }; | ||
} | ||
const CONFIGURATION_SEARCH_PARAM_KEY = "configuration.pexip"; | ||
export function createSearchParamConfig({ config }) { | ||
const searchParams = new URLSearchParams(); | ||
searchParams.set(CONFIGURATION_SEARCH_PARAM_KEY, encodeURIParameters(config)); | ||
return searchParams; | ||
const searchParams = new URLSearchParams(); | ||
searchParams.set(CONFIGURATION_SEARCH_PARAM_KEY, encodeURIParameters(config)); | ||
return searchParams; | ||
} | ||
export function parseFromSearchParamConfig(searchParams) { | ||
const config = searchParams.get(CONFIGURATION_SEARCH_PARAM_KEY); | ||
if (!config) | ||
return null; | ||
return decodeURIParameters(config); | ||
const config = searchParams.get(CONFIGURATION_SEARCH_PARAM_KEY); | ||
if (!config) return null; | ||
return decodeURIParameters(config); | ||
} |
export {}; | ||
//# sourceMappingURL=LegacyDomParser.test.d.ts.map | ||
//# sourceMappingURL=LegacyDomParser.test.d.ts.map |
@@ -5,33 +5,33 @@ import { describe, expect, it } from "vitest"; | ||
describe("parseDOMParams", () => { | ||
it("should work", () => { | ||
const element = createFakeElement({ | ||
"skedify:appointment.subject_id": "<subject-id here>", | ||
"skedify:appointment.office_id": "<office-id here>", | ||
"skedify:language": "nl-BE", | ||
"skedify:meeting_types": "video,office", | ||
"skedify:flow": "S'TQC", | ||
"skedify:location.formatted_address": "Zuiderlaan 1, 9000 Ghent, Belgium", | ||
"skedify:location.geolocation": "123;456", | ||
"skedify:location.city": "Ghent", | ||
"skedify:location.country": "Belgium", | ||
"skedify:location.postal_code": "9000", | ||
"skedify:location.state": "Oost-Vlaanderen", | ||
"skedify:location.street_1": "Zuiderlaan 1", | ||
"skedify:customer.location.formatted_address": "Zuiderlaan 1, 9000 Ghent, Belgium", | ||
"skedify:customer.location.geolocation": "123;456", | ||
"skedify:customer.location.city": "Ghent", | ||
"skedify:customer.location.country": "Belgium", | ||
"skedify:customer.location.postal_code": "9000", | ||
"skedify:customer.location.state": "Oost-Vlaanderen", | ||
"skedify:customer.location.street_1": "Zuiderlaan 1", | ||
"skedify:application.scroll": "disable_initial_scroll_on_schedule", | ||
"skedify:listing_id": "<listing-id here>", | ||
"skedify:external_listing_id": "<external-listing-id here>", | ||
"skedify:application.timezone_selection": "enable_timezone_selection", | ||
"skedify:session.id": "269828b4-df32-42fe-80c7-4fb72b692f7e", | ||
"skedify:session.source_tags": "A;B;C", | ||
"skedify:session.status": "disabled", | ||
"skedify:search.country": "BE", | ||
}); | ||
expect(legacyParse({ element })).toMatchInlineSnapshot(` | ||
it("should work", () => { | ||
const element = createFakeElement({ | ||
"skedify:appointment.subject_id": "<subject-id here>", | ||
"skedify:appointment.office_id": "<office-id here>", | ||
"skedify:language": "nl-BE", | ||
"skedify:meeting_types": "video,office", | ||
"skedify:flow": "S'TQC", | ||
"skedify:location.formatted_address": "Zuiderlaan 1, 9000 Ghent, Belgium", | ||
"skedify:location.geolocation": "123;456", | ||
"skedify:location.city": "Ghent", | ||
"skedify:location.country": "Belgium", | ||
"skedify:location.postal_code": "9000", | ||
"skedify:location.state": "Oost-Vlaanderen", | ||
"skedify:location.street_1": "Zuiderlaan 1", | ||
"skedify:customer.location.formatted_address": "Zuiderlaan 1, 9000 Ghent, Belgium", | ||
"skedify:customer.location.geolocation": "123;456", | ||
"skedify:customer.location.city": "Ghent", | ||
"skedify:customer.location.country": "Belgium", | ||
"skedify:customer.location.postal_code": "9000", | ||
"skedify:customer.location.state": "Oost-Vlaanderen", | ||
"skedify:customer.location.street_1": "Zuiderlaan 1", | ||
"skedify:application.scroll": "disable_initial_scroll_on_schedule", | ||
"skedify:listing_id": "<listing-id here>", | ||
"skedify:external_listing_id": "<external-listing-id here>", | ||
"skedify:application.timezone_selection": "enable_timezone_selection", | ||
"skedify:session.id": "269828b4-df32-42fe-80c7-4fb72b692f7e", | ||
"skedify:session.source_tags": "A;B;C", | ||
"skedify:session.status": "disabled", | ||
"skedify:search.country": "BE", | ||
}); | ||
expect(legacyParse({ element })).toMatchInlineSnapshot(` | ||
{ | ||
@@ -66,8 +66,8 @@ "domConfig": { | ||
`); | ||
}); | ||
it("should have special treatment for hints.contacts", () => { | ||
const element = createFakeElement({ | ||
"skedify:hints.contacts": "1 2 3 4 5", | ||
}); | ||
it("should have special treatment for hints.contacts", () => { | ||
const element = createFakeElement({ | ||
"skedify:hints.contacts": "1 2 3 4 5", | ||
}); | ||
expect(legacyParse({ element })).toMatchInlineSnapshot(` | ||
expect(legacyParse({ element })).toMatchInlineSnapshot(` | ||
{ | ||
@@ -82,8 +82,8 @@ "domConfig": { | ||
`); | ||
}); | ||
it("should ignore empty hints.contacts", () => { | ||
const element = createFakeElement({ | ||
"skedify:hints.contacts": "", | ||
}); | ||
it("should ignore empty hints.contacts", () => { | ||
const element = createFakeElement({ | ||
"skedify:hints.contacts": "", | ||
}); | ||
expect(legacyParse({ element })).toMatchInlineSnapshot(` | ||
expect(legacyParse({ element })).toMatchInlineSnapshot(` | ||
{ | ||
@@ -95,20 +95,20 @@ "domConfig": {}, | ||
`); | ||
}); | ||
it("should have special treatment for hints.intent", () => { | ||
const element = createFakeElement({ | ||
"skedify:hints.intent": "invite", | ||
}); | ||
it("should have special treatment for hints.intent", () => { | ||
const element = createFakeElement({ | ||
"skedify:hints.intent": "invite", | ||
}); | ||
const result = legacyParse({ element }); | ||
expect(result.domConfig["intent"]).toBe("invite"); | ||
const result = legacyParse({ element }); | ||
expect(result.domConfig["intent"]).toBe("invite"); | ||
}); | ||
it("should work with prefilled customer values", () => { | ||
const element = createFakeElement({ | ||
"skedify:customer.timezone": "Europe/Brussels", | ||
"skedify:customer.first_name": "Ken", | ||
"skedify:customer.last_name": "Depelchin", | ||
"skedify:customer.email": "ken@skedify.co", | ||
"skedify:customer.phone_number": "0478123123", | ||
"skedify:customer.customer_number": "123", | ||
}); | ||
it("should work with prefilled customer values", () => { | ||
const element = createFakeElement({ | ||
"skedify:customer.timezone": "Europe/Brussels", | ||
"skedify:customer.first_name": "Ken", | ||
"skedify:customer.last_name": "Depelchin", | ||
"skedify:customer.email": "ken@skedify.co", | ||
"skedify:customer.phone_number": "0478123123", | ||
"skedify:customer.customer_number": "123", | ||
}); | ||
expect(legacyParse({ element })).toMatchInlineSnapshot(` | ||
expect(legacyParse({ element })).toMatchInlineSnapshot(` | ||
{ | ||
@@ -127,8 +127,8 @@ "domConfig": { | ||
`); | ||
}); | ||
it("should have special treatment for hints.external_employee_ids", () => { | ||
const element = createFakeElement({ | ||
"skedify:hints.external_employee_ids": "1 2 3 4 5", | ||
}); | ||
it("should have special treatment for hints.external_employee_ids", () => { | ||
const element = createFakeElement({ | ||
"skedify:hints.external_employee_ids": "1 2 3 4 5", | ||
}); | ||
expect(legacyParse({ element })).toMatchInlineSnapshot(` | ||
expect(legacyParse({ element })).toMatchInlineSnapshot(` | ||
{ | ||
@@ -143,8 +143,8 @@ "domConfig": { | ||
`); | ||
}); | ||
it("should ignore empty hints.external_employee_ids", () => { | ||
const element = createFakeElement({ | ||
"skedify:hints.external_employee_ids": "", | ||
}); | ||
it("should ignore empty hints.external_employee_ids", () => { | ||
const element = createFakeElement({ | ||
"skedify:hints.external_employee_ids": "", | ||
}); | ||
expect(legacyParse({ element })).toMatchInlineSnapshot(` | ||
expect(legacyParse({ element })).toMatchInlineSnapshot(` | ||
{ | ||
@@ -156,3 +156,3 @@ "domConfig": {}, | ||
`); | ||
}); | ||
}); | ||
}); |
export {}; | ||
//# sourceMappingURL=LegacyLocationHashParser.test.d.ts.map | ||
//# sourceMappingURL=LegacyLocationHashParser.test.d.ts.map |
@@ -5,46 +5,46 @@ import { describe, expect, it } from "vitest"; | ||
describe("parseSkedifyURIHashParams", () => { | ||
it("should create a valid object from the encoded values", () => { | ||
const hash = createFakeHash({ | ||
rco: "example resource code", | ||
sub: "example subject id", | ||
off: "example office id", | ||
ctz: "example customer timezone", | ||
con: "contact_id_1,contact_id_2", | ||
sco: "BE", | ||
lng: "example language", | ||
flo: "example flow", | ||
cfn: "example customer first_name", | ||
cln: "example customer last_name", | ||
cem: "example customer email", | ||
cpn: "example customer phone number", | ||
ccn: "example customer customer number", | ||
mty: "example meeting_types", | ||
// Location | ||
lfa: "Zuiderlaan 1, 9000 Ghent, Belgium", | ||
lgl: "55.79086400000001;12.157552", | ||
lci: "Ghent", | ||
lco: "BE", | ||
lpc: "9000", | ||
lsa: "Oost-Vlaanderen", | ||
lst: "Zuiderlaan 1", | ||
// Customer location | ||
cgl: "55.79086400000001;12.157552", | ||
cci: "Ghent", | ||
cco: "BE", | ||
cpc: "9000", | ||
csa: "Oost-Vlaanderen", | ||
cst: "Zuiderlaan 1", | ||
// Application | ||
scr: "default", | ||
ets: "enable_timezone_selection", | ||
// Listings | ||
lis: "1", | ||
eli: "ABC123", | ||
// hints | ||
eco: ["4", "5", "6"], | ||
// Session | ||
sid: "269828b4-df32-42fe-80c7-4fb72b692f7e", | ||
sst: "A;B;C", | ||
}); | ||
expect(legacyParse({ hash })).toMatchInlineSnapshot(` | ||
it("should create a valid object from the encoded values", () => { | ||
const hash = createFakeHash({ | ||
rco: "example resource code", | ||
sub: "example subject id", | ||
off: "example office id", | ||
ctz: "example customer timezone", | ||
con: "contact_id_1,contact_id_2", | ||
sco: "BE", | ||
lng: "example language", | ||
flo: "example flow", | ||
cfn: "example customer first_name", | ||
cln: "example customer last_name", | ||
cem: "example customer email", | ||
cpn: "example customer phone number", | ||
ccn: "example customer customer number", | ||
mty: "example meeting_types", | ||
// Location | ||
lfa: "Zuiderlaan 1, 9000 Ghent, Belgium", | ||
lgl: "55.79086400000001;12.157552", | ||
lci: "Ghent", | ||
lco: "BE", | ||
lpc: "9000", | ||
lsa: "Oost-Vlaanderen", | ||
lst: "Zuiderlaan 1", | ||
// Customer location | ||
cgl: "55.79086400000001;12.157552", | ||
cci: "Ghent", | ||
cco: "BE", | ||
cpc: "9000", | ||
csa: "Oost-Vlaanderen", | ||
cst: "Zuiderlaan 1", | ||
// Application | ||
scr: "default", | ||
ets: "enable_timezone_selection", | ||
// Listings | ||
lis: "1", | ||
eli: "ABC123", | ||
// hints | ||
eco: ["4", "5", "6"], | ||
// Session | ||
sid: "269828b4-df32-42fe-80c7-4fb72b692f7e", | ||
sst: "A;B;C", | ||
}); | ||
expect(legacyParse({ hash })).toMatchInlineSnapshot(` | ||
{ | ||
@@ -86,3 +86,3 @@ "domConfig": {}, | ||
`); | ||
}); | ||
}); | ||
}); |
export {}; | ||
//# sourceMappingURL=LegacyParser.test.d.ts.map | ||
//# sourceMappingURL=LegacyParser.test.d.ts.map |
@@ -6,20 +6,20 @@ import { describe, expect, it } from "vitest"; | ||
describe("LegacyConfigurationParser", () => { | ||
it("Should correctly cascade config options", () => { | ||
const config = legacyParse({ | ||
element: createFakeElement({ | ||
"skedify:searchCountry": "EN", | ||
"skedify:appointment.subject_id": "1", | ||
"skedify:appointment.office_id": "2000", | ||
}), | ||
hash: createFakeHash({ | ||
sco: "DE,NB", | ||
sub: "2", | ||
lis: "3000", | ||
}), | ||
options: { | ||
searchCountry: "BE,NL", | ||
lead_segment_code: "CODE_123", | ||
}, | ||
}); | ||
expect(config).toMatchInlineSnapshot(` | ||
it("Should correctly cascade config options", () => { | ||
const config = legacyParse({ | ||
element: createFakeElement({ | ||
"skedify:searchCountry": "EN", | ||
"skedify:appointment.subject_id": "1", | ||
"skedify:appointment.office_id": "2000", | ||
}), | ||
hash: createFakeHash({ | ||
sco: "DE,NB", | ||
sub: "2", | ||
lis: "3000", | ||
}), | ||
options: { | ||
searchCountry: "BE,NL", | ||
lead_segment_code: "CODE_123", | ||
}, | ||
}); | ||
expect(config).toMatchInlineSnapshot(` | ||
{ | ||
@@ -47,10 +47,10 @@ "domConfig": { | ||
`); | ||
}); | ||
}); | ||
}); | ||
describe("parseLegacyHashConfig", () => { | ||
it("Should correctly parse legacy configuration", () => { | ||
const legacyConfig = legacyParse({ | ||
hash: "#skedifyeyJmbG8iOiJTI09UUUMiLCJvZmYiOiI2In0f", | ||
}); | ||
expect(legacyConfig).toMatchInlineSnapshot(` | ||
it("Should correctly parse legacy configuration", () => { | ||
const legacyConfig = legacyParse({ | ||
hash: "#skedifyeyJmbG8iOiJTI09UUUMiLCJvZmYiOiI2In0f", | ||
}); | ||
expect(legacyConfig).toMatchInlineSnapshot(` | ||
{ | ||
@@ -66,8 +66,8 @@ "domConfig": {}, | ||
`); | ||
}); | ||
it("Should correctly parse legacy special encoded character configuration", () => { | ||
const legacyConfig = legacyParse({ | ||
hash: "#skedifyeyJjZW0iOiJjaGFybG90dGVzY2hyb+tAaG90bWFpbC5jb20iLCJjZm4iOiJDaGFybG90dGUiLCJjbG4iOiJTY2hyb+siLCJjcG4iOiIwNDk3IDk5IDk5IDk5IiwiZWxpIjoiRTEzRkRGNzEtNkUwRi1FIEUxMS04RjZELTAwMEQzQUJBM0Q5QyJ9e", | ||
}); | ||
it("Should correctly parse legacy special encoded character configuration", () => { | ||
const legacyConfig = legacyParse({ | ||
hash: "#skedifyeyJjZW0iOiJjaGFybG90dGVzY2hyb+tAaG90bWFpbC5jb20iLCJjZm4iOiJDaGFybG90dGUiLCJjbG4iOiJTY2hyb+siLCJjcG4iOiIwNDk3IDk5IDk5IDk5IiwiZWxpIjoiRTEzRkRGNzEtNkUwRi1FIEUxMS04RjZELTAwMEQzQUJBM0Q5QyJ9e", | ||
}); | ||
expect(legacyConfig).toMatchInlineSnapshot(` | ||
expect(legacyConfig).toMatchInlineSnapshot(` | ||
{ | ||
@@ -86,23 +86,23 @@ "domConfig": {}, | ||
`); | ||
}); | ||
}); | ||
}); | ||
describe("insertMeetingTypeStepInFlow", () => { | ||
it("should correctly handle empty flow", () => { | ||
expect(insertMeetingTypeStepInFlow()).toBeUndefined(); | ||
}); | ||
it("should correctly stop when M is already present", () => { | ||
expect(insertMeetingTypeStepInFlow("#S#M#O#ETQC")).toBe("#S#M#O#ETQC"); | ||
}); | ||
it("should correctly insert M when O is locked", () => { | ||
expect(insertMeetingTypeStepInFlow("S#OTQC")).toBe("SM#OTQC"); | ||
}); | ||
it("should correctly insert M when S is locked", () => { | ||
expect(insertMeetingTypeStepInFlow("#SOTQC")).toBe("#SMOTQC"); | ||
}); | ||
it("should correctly insert M when S & O is locked", () => { | ||
expect(insertMeetingTypeStepInFlow("#S#OETQC")).toBe("#SM#OETQC"); | ||
}); | ||
it("should correctly insert M when S & O & E is locked", () => { | ||
expect(insertMeetingTypeStepInFlow("#S#O#ETQC")).toBe("#SM#O#ETQC"); | ||
}); | ||
it("should correctly handle empty flow", () => { | ||
expect(insertMeetingTypeStepInFlow()).toBeUndefined(); | ||
}); | ||
it("should correctly stop when M is already present", () => { | ||
expect(insertMeetingTypeStepInFlow("#S#M#O#ETQC")).toBe("#S#M#O#ETQC"); | ||
}); | ||
it("should correctly insert M when O is locked", () => { | ||
expect(insertMeetingTypeStepInFlow("S#OTQC")).toBe("SM#OTQC"); | ||
}); | ||
it("should correctly insert M when S is locked", () => { | ||
expect(insertMeetingTypeStepInFlow("#SOTQC")).toBe("#SMOTQC"); | ||
}); | ||
it("should correctly insert M when S & O is locked", () => { | ||
expect(insertMeetingTypeStepInFlow("#S#OETQC")).toBe("#SM#OETQC"); | ||
}); | ||
it("should correctly insert M when S & O & E is locked", () => { | ||
expect(insertMeetingTypeStepInFlow("#S#O#ETQC")).toBe("#SM#O#ETQC"); | ||
}); | ||
}); |
import type { LegacyPluginHashConfiguration } from "../LegacyParser.js"; | ||
export declare function createFakeHash(obj?: LegacyPluginHashConfiguration): string; | ||
export declare function createFakeElement(attributes: Record<string, string>): HTMLDivElement; | ||
//# sourceMappingURL=test-utils.d.ts.map | ||
//# sourceMappingURL=test-utils.d.ts.map |
import { encodeURIParameters } from "skedify-uri-encoding"; | ||
export function createFakeHash(obj) { | ||
const values = encodeURIParameters(obj ?? {}); | ||
return `#skedify${values}`; | ||
const values = encodeURIParameters(obj ?? {}); | ||
return `#skedify${values}`; | ||
} | ||
export function createFakeElement(attributes) { | ||
const element = global.window.document.createElement("div"); | ||
Object.entries(attributes).forEach(([key, value]) => element.setAttribute(key, value)); | ||
return element; | ||
const element = global.window.document.createElement("div"); | ||
Object.entries(attributes).forEach(([key, value]) => element.setAttribute(key, value)); | ||
return element; | ||
} |
@@ -6,12 +6,14 @@ /** | ||
*/ | ||
export declare function sanitize<T extends { | ||
export declare function sanitize< | ||
T extends { | ||
[key: string]: any; | ||
}>(obj: { | ||
[K in keyof Required<T>]: T[K]; | ||
}, | ||
>(obj: { | ||
[K in keyof Required<T>]: T[K]; | ||
}): T; | ||
export declare function encodeURIParameters<T>(obj: T): string; | ||
export declare function decodeURIParameters(str: string): { | ||
[key: string]: any; | ||
[key: string]: any; | ||
}; | ||
export declare function isValidConfiguration(configuration: unknown): configuration is object; | ||
//# sourceMappingURL=utils.d.ts.map | ||
//# sourceMappingURL=utils.d.ts.map |
@@ -7,33 +7,39 @@ /** | ||
export function sanitize(obj) { | ||
for (const key in obj) { | ||
if (!obj[key]) { | ||
delete obj[key]; | ||
} | ||
if (typeof obj[key] !== "object") { | ||
continue; // If not an object, skip to the next iteration | ||
} | ||
// The property is an object | ||
sanitize(obj[key]); // <-- Make a recursive call on the nested object | ||
if (Object.keys(obj[key]).length === 0) { | ||
delete obj[key]; // The object had no properties, so delete that property | ||
} | ||
for (const key in obj) { | ||
if (!obj[key]) { | ||
delete obj[key]; | ||
} | ||
return obj; | ||
if (typeof obj[key] !== "object") { | ||
continue; // If not an object, skip to the next iteration | ||
} | ||
// The property is an object | ||
sanitize(obj[key]); // <-- Make a recursive call on the nested object | ||
if (Object.keys(obj[key]).length === 0) { | ||
delete obj[key]; // The object had no properties, so delete that property | ||
} | ||
} | ||
return obj; | ||
} | ||
export function encodeURIParameters(obj) { | ||
const str = JSON.stringify(obj); | ||
return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function (_, p1) { | ||
return String.fromCharCode(parseInt(p1, 16)); | ||
})); | ||
const str = JSON.stringify(obj); | ||
return btoa( | ||
encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function (_, p1) { | ||
return String.fromCharCode(parseInt(p1, 16)); | ||
}), | ||
); | ||
} | ||
export function decodeURIParameters(str) { | ||
const result = JSON.parse(decodeURIComponent(Array.prototype.map | ||
const result = JSON.parse( | ||
decodeURIComponent( | ||
Array.prototype.map | ||
.call(atob(str), function (c) { | ||
return "%" + ("00" + c.charCodeAt(0).toString(16)).slice(-2); | ||
}) | ||
.join(""))); | ||
return sanitize(result); | ||
return "%" + ("00" + c.charCodeAt(0).toString(16)).slice(-2); | ||
}) | ||
.join(""), | ||
), | ||
); | ||
return sanitize(result); | ||
} | ||
export function isValidConfiguration(configuration) { | ||
return typeof configuration === "object" && configuration !== null; | ||
return typeof configuration === "object" && configuration !== null; | ||
} |
{ | ||
"name": "@pexip-engage-public/plugin-configuration-parser", | ||
"version": "2.0.0-canary-20231023080955", | ||
"version": "2.0.0-canary-20231025101109", | ||
"homepage": "https://github.com/skedify/frontend-mono/tree/develop/apps/plugin-remix/packages/configuration-parser#readme", | ||
@@ -33,4 +33,4 @@ "bugs": { | ||
"skedify-uri-encoding": "^2.1.1", | ||
"@pexip-engage-public/plugin-configuration": "2.0.0-canary-20231023080955", | ||
"@pexip-engage-public/plugin-utils": "2.0.0-canary-20231023080955" | ||
"@pexip-engage-public/plugin-configuration": "2.0.0-canary-20231025101109", | ||
"@pexip-engage-public/plugin-utils": "2.0.0-canary-20231025101109" | ||
}, | ||
@@ -41,4 +41,4 @@ "devDependencies": { | ||
"vitest": "^0.34.6", | ||
"@pexip-engage/tsconfig": "0.0.10-canary-20231023080955", | ||
"eslint-config-pexip-engage": "0.0.40" | ||
"eslint-config-pexip-engage": "0.0.41-canary-20231025101109", | ||
"@pexip-engage/tsconfig": "0.0.10-canary-20231025101109" | ||
}, | ||
@@ -45,0 +45,0 @@ "volta": { |
@@ -5,3 +5,3 @@ import { parseDOMParams, parseJSConfigParams, parseSkedifyURIHashParams } from "./LegacyParser.js"; | ||
legacyHashToPluginInputConfiguration, | ||
} from "./LegacyParser.utils.js" | ||
} from "./LegacyParser.utils.js"; | ||
import { decodeConfigHash } from "./ModernParser.js"; | ||
@@ -8,0 +8,0 @@ import { configToHash, configToHtml, configToJS } from "./ModernParser.utils.js"; |
@@ -55,2 +55,3 @@ import type { PluginConfiguration } from "@pexip-engage-public/plugin-configuration"; | ||
"application-timezone_selection": config.ets, | ||
"application-theme": undefined, | ||
"location-initial_search": config.lfa, | ||
@@ -167,2 +168,3 @@ search_countries: config.sco, | ||
timezoneSelection: config["application-timezone_selection"], | ||
theme: config["application-theme"], | ||
}, | ||
@@ -169,0 +171,0 @@ customer: { |
@@ -106,2 +106,3 @@ import type { PluginConfiguration } from "@pexip-engage-public/plugin-configuration"; | ||
timezoneSelection?: StringConfig; | ||
theme?: string | null; | ||
}; | ||
@@ -108,0 +109,0 @@ customer?: { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
3330
144017
+ Added@pexip-engage-public/plugin-configuration@2.0.0-canary-20231025101109(transitive)
+ Added@pexip-engage-public/plugin-utils@2.0.0-canary-20231025101109(transitive)
- Removed@pexip-engage-public/plugin-configuration@2.0.0-canary-20231023080955(transitive)
- Removed@pexip-engage-public/plugin-utils@2.0.0-canary-20231023080955(transitive)
Updated@pexip-engage-public/plugin-configuration@2.0.0-canary-20231025101109
Updated@pexip-engage-public/plugin-utils@2.0.0-canary-20231025101109