@kizenapps/engine 1.6.0 → 1.7.0-8f49177

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 (45) hide show
  1. package/dist/{automation-ez9zQ2sv.d.ts → automation-CT00roz_.d.ts} +3 -0
  2. package/dist/{chunk-3RZHGFVE.js → chunk-75QZJ7JX.js} +3 -3
  3. package/dist/{chunk-3RZHGFVE.js.map → chunk-75QZJ7JX.js.map} +1 -1
  4. package/dist/{chunk-3GJVC5NN.js → chunk-AFUZ4QSH.js} +29 -18
  5. package/dist/chunk-AFUZ4QSH.js.map +1 -0
  6. package/dist/{chunk-BJBB73QA.js → chunk-B3P7HFRV.js} +3 -3
  7. package/dist/{chunk-BJBB73QA.js.map → chunk-B3P7HFRV.js.map} +1 -1
  8. package/dist/{chunk-CNSOU3UB.js → chunk-BU6CSXSC.js} +3 -3
  9. package/dist/{chunk-CNSOU3UB.js.map → chunk-BU6CSXSC.js.map} +1 -1
  10. package/dist/{chunk-OMIBO27E.js → chunk-CV4PC3KZ.js} +32 -4
  11. package/dist/chunk-CV4PC3KZ.js.map +1 -0
  12. package/dist/{chunk-UXYECVO2.js → chunk-F37NPWKF.js} +3 -3
  13. package/dist/{chunk-UXYECVO2.js.map → chunk-F37NPWKF.js.map} +1 -1
  14. package/dist/{chunk-7TTCHSPL.js → chunk-IT6UUTZ3.js} +3 -3
  15. package/dist/{chunk-7TTCHSPL.js.map → chunk-IT6UUTZ3.js.map} +1 -1
  16. package/dist/{chunk-5FZ4UC6V.js → chunk-JF2SWP4D.js} +12 -9
  17. package/dist/chunk-JF2SWP4D.js.map +1 -0
  18. package/dist/{chunk-4GEJIHMC.js → chunk-QE5GKZEO.js} +4 -4
  19. package/dist/{chunk-4GEJIHMC.js.map → chunk-QE5GKZEO.js.map} +1 -1
  20. package/dist/communication.js +2 -2
  21. package/dist/contexts/base.d.ts +3 -2
  22. package/dist/contexts/base.js +4 -4
  23. package/dist/contexts/floatingFrame.d.ts +1 -0
  24. package/dist/contexts/floatingFrame.js +5 -5
  25. package/dist/contexts/recordDetail.d.ts +1 -0
  26. package/dist/contexts/recordDetail.js +5 -5
  27. package/dist/frames-AOHUyPDP.d.ts +7 -0
  28. package/dist/{generic-CyEFBI-k.d.ts → generic-ByO9VEyd.d.ts} +1 -1
  29. package/dist/index.d.ts +4 -3
  30. package/dist/index.js +4 -4
  31. package/dist/react.d.ts +8 -7
  32. package/dist/react.js +22 -14
  33. package/dist/react.js.map +1 -1
  34. package/dist/types.d.ts +4 -3
  35. package/dist/util.d.ts +3 -2
  36. package/dist/util.js +6 -6
  37. package/dist/{values-BbMHmBFn.d.ts → values-CiQIqKu7.d.ts} +3 -2
  38. package/dist/workers/calendarSource.worker.js +6 -6
  39. package/dist/workers/floatingFrame.worker.js +7 -7
  40. package/dist/workers/generic.worker.js +6 -6
  41. package/dist/workers/recordDetail.worker.js +7 -7
  42. package/package.json +1 -1
  43. package/dist/chunk-3GJVC5NN.js.map +0 -1
  44. package/dist/chunk-5FZ4UC6V.js.map +0 -1
  45. package/dist/chunk-OMIBO27E.js.map +0 -1
@@ -1,5 +1,6 @@
1
1
  import { b2 as ACTIONS, U as UnknownJSON, b3 as ALLOWED_INTEGRATIONS, J as ConsoleLogLevel, M as ModalConfig, S as StateChangePayload, k as ShowToastOptions, h as InternalSessionData, l as ShowViewInModalOptions, aT as SetInternalSessionDataFn, aB as OnShowModalFn, az as OnShowCreateRecordModalFn, aA as OnShowCreateRelatedRecordModalFn, ax as OnCloseModalFn, ay as OnNetworkErrorFn, W as WorkerContextArgs, a7 as EmployeeConfig } from './ThirdPartyScript-CvOXQBiO.js';
2
2
  import { H as HideConfig, S as ShowConfig } from './floatingFrames-BzaoL7cq.js';
3
+ import { B as BuildIframeURLWithProxyOptions } from './frames-AOHUyPDP.js';
3
4
 
4
5
  interface CommonPluginDefinition {
5
6
  plugin_api_name: string;
@@ -75,12 +76,14 @@ interface QueryRequestEvent extends BaseEvent {
75
76
  }
76
77
  interface UIOutputEvent extends BaseEvent {
77
78
  markup: string;
79
+ options?: BuildIframeURLWithProxyOptions;
78
80
  }
79
81
  interface IframeOutputEvent extends BaseEvent {
80
82
  url: string;
81
83
  allow?: string[];
82
84
  sandbox?: string[];
83
85
  preserve?: boolean;
86
+ name: string;
84
87
  }
85
88
  interface PostFormDataRequestEvent extends BaseEvent {
86
89
  id: string;
@@ -1,4 +1,4 @@
1
- import { ROUTE_CHANGE_INTERNAL_EVENT } from './chunk-BJBB73QA.js';
1
+ import { ROUTE_CHANGE_INTERNAL_EVENT } from './chunk-B3P7HFRV.js';
2
2
 
3
3
  // src/util/run.ts
4
4
  var getPartialLocation = () => {
@@ -96,5 +96,5 @@ var findMatchingAction = (availableActions, apiName) => {
96
96
  };
97
97
 
98
98
  export { buildCodeRunnerFunction, emitRouteChange, findMatchingAction, generateExecutionKey, generateUUIDV4, getPartialLocation };
99
- //# sourceMappingURL=chunk-3RZHGFVE.js.map
100
- //# sourceMappingURL=chunk-3RZHGFVE.js.map
99
+ //# sourceMappingURL=chunk-75QZJ7JX.js.map
100
+ //# sourceMappingURL=chunk-75QZJ7JX.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/util/run.ts"],"names":["action"],"mappings":";;;AAKO,IAAM,qBAAqB,MAAuB;AACvD,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,OAAO,QAAA,CAAS,IAAA;AAAA,IACtB,IAAA,EAAM,OAAO,QAAA,CAAS,IAAA;AAAA,IACtB,IAAA,EAAM,OAAO,QAAA,CAAS,IAAA;AAAA,IACtB,MAAA,EAAQ,OAAO,QAAA,CAAS,MAAA;AAAA,IACxB,QAAA,EAAU,OAAO,QAAA,CAAS,QAAA;AAAA,IAC1B,MAAA,EAAQ,OAAO,QAAA,CAAS,MAAA;AAAA,IACxB,IAAA,EAAM,OAAO,QAAA,CAAS,IAAA;AAAA,IACtB,QAAA,EAAU,OAAO,QAAA,CAAS;AAAA,GAC5B;AACF;AAEO,IAA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,WAAW,OAAA,KAAY;AAAA,GACvE;AAEA,EAAA,OAAO,MAAA;AACT","file":"chunk-3RZHGFVE.js","sourcesContent":["import { ROUTE_CHANGE_INTERNAL_EVENT } from '../communication/constants.js';\nimport type { PartialLocation } from '../types/common.js';\nimport type { CommonExecutionPlugin, CommonPluginDefinition } from '../types/run.js';\nimport type { AsyncFunctionConstructor, BuiltAsyncFn } from '../types/workers.js';\n\nexport const getPartialLocation = (): PartialLocation => {\n return {\n host: window.location.host,\n hash: window.location.hash,\n href: window.location.href,\n origin: window.location.origin,\n pathname: window.location.pathname,\n search: window.location.search,\n port: window.location.port,\n protocol: window.location.protocol,\n };\n};\n\nexport const generateUUIDV4 = (): string => {\n let d = new Date().getTime();\n\n if (typeof performance !== 'undefined' && typeof performance.now === 'function') {\n d += performance.now();\n }\n\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = ((d + Math.random() * 16) % 16) | 0;\n d = Math.floor(d / 16);\n return (c === 'x' ? r : (r & 0x3) | 0x8).toString(16);\n });\n};\n\nconst AsyncFunction = (\n Object.getPrototypeOf(async function () {\n /* empty */\n }) as { constructor: AsyncFunctionConstructor }\n).constructor;\n\nexport const buildCodeRunnerFunction = (script: string): BuiltAsyncFn => {\n const functionBody = `\n const __cleanup = this.__cleanup.bind(this);\n const __error = this.onError.bind(this);\n\n const console = this.console;\n\n let __kizen_internal_result;\n\n {\n this.__setup();\n }\n\n try {\n __kizen_internal_result = await (async () => { ${script} })();\n } catch (ex) {\n __error(ex);\n } finally {\n __cleanup(__kizen_internal_result);\n }\n `;\n\n try {\n const fn = new AsyncFunction(functionBody);\n\n return { fn, functionBody };\n } catch {\n const errorFnBody = `\n this.__setup();\n\n this.onError({ message: \"The script has a syntax error and could not be parsed\" });\n \n this.__cleanup();\n `;\n\n const fn = new AsyncFunction(errorFnBody);\n\n return { fn, functionBody: errorFnBody };\n }\n};\n\nexport const generateExecutionKey = (\n pluginConfig?: CommonPluginDefinition | CommonExecutionPlugin,\n): string => {\n return `${pluginConfig?.plugin_api_name ?? ''}-${pluginConfig?.id ?? ''}-${pluginConfig?.api_name ?? ''}-${pluginConfig?.script_id ?? ''}`;\n};\n\nexport const emitRouteChange = (): void => {\n const event = new CustomEvent(ROUTE_CHANGE_INTERNAL_EVENT, {\n detail: {\n location: getPartialLocation(),\n },\n });\n\n window.dispatchEvent(event);\n};\n\nconst splitScriptApiName = (\n scriptApiName: string,\n): { pluginApiName: string | undefined; actionApiName: string | undefined } => {\n const [pluginApiName, actionApiName] = scriptApiName.split('.');\n\n return {\n pluginApiName,\n actionApiName,\n };\n};\n\nexport const findMatchingAction = (\n availableActions: {\n pluginApp?: {\n apiName: string;\n };\n apiName: string;\n }[],\n apiName?: string,\n): unknown => {\n if (!apiName) {\n return null;\n }\n\n const { pluginApiName, actionApiName } = splitScriptApiName(apiName);\n\n if (!pluginApiName) {\n const action = availableActions.find((act) => !act.pluginApp && act.apiName === actionApiName);\n\n return action;\n }\n\n const action = availableActions.find(\n (act) => act.apiName === actionApiName && act.pluginApp?.apiName === pluginApiName,\n );\n\n return action;\n};\n"]}
1
+ {"version":3,"sources":["../src/util/run.ts"],"names":["action"],"mappings":";;;AAKO,IAAM,qBAAqB,MAAuB;AACvD,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,OAAO,QAAA,CAAS,IAAA;AAAA,IACtB,IAAA,EAAM,OAAO,QAAA,CAAS,IAAA;AAAA,IACtB,IAAA,EAAM,OAAO,QAAA,CAAS,IAAA;AAAA,IACtB,MAAA,EAAQ,OAAO,QAAA,CAAS,MAAA;AAAA,IACxB,QAAA,EAAU,OAAO,QAAA,CAAS,QAAA;AAAA,IAC1B,MAAA,EAAQ,OAAO,QAAA,CAAS,MAAA;AAAA,IACxB,IAAA,EAAM,OAAO,QAAA,CAAS,IAAA;AAAA,IACtB,QAAA,EAAU,OAAO,QAAA,CAAS;AAAA,GAC5B;AACF;AAEO,IAAM,iBAAiB,MA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KAAY;AAAA,GACvE;AAEA,EAAA,OAAO,MAAA;AACT","file":"chunk-75QZJ7JX.js","sourcesContent":["import { ROUTE_CHANGE_INTERNAL_EVENT } from '../communication/constants.js';\nimport type { PartialLocation } from '../types/common.js';\nimport type { CommonExecutionPlugin, CommonPluginDefinition } from '../types/run.js';\nimport type { AsyncFunctionConstructor, BuiltAsyncFn } from '../types/workers.js';\n\nexport const getPartialLocation = (): PartialLocation => {\n return {\n host: window.location.host,\n hash: window.location.hash,\n href: window.location.href,\n origin: window.location.origin,\n pathname: window.location.pathname,\n search: window.location.search,\n port: window.location.port,\n protocol: window.location.protocol,\n };\n};\n\nexport const generateUUIDV4 = (): string => {\n let d = new Date().getTime();\n\n if (typeof performance !== 'undefined' && typeof performance.now === 'function') {\n d += performance.now();\n }\n\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = ((d + Math.random() * 16) % 16) | 0;\n d = Math.floor(d / 16);\n return (c === 'x' ? r : (r & 0x3) | 0x8).toString(16);\n });\n};\n\nconst AsyncFunction = (\n Object.getPrototypeOf(async function () {\n /* empty */\n }) as { constructor: AsyncFunctionConstructor }\n).constructor;\n\nexport const buildCodeRunnerFunction = (script: string): BuiltAsyncFn => {\n const functionBody = `\n const __cleanup = this.__cleanup.bind(this);\n const __error = this.onError.bind(this);\n\n const console = this.console;\n\n let __kizen_internal_result;\n\n {\n this.__setup();\n }\n\n try {\n __kizen_internal_result = await (async () => { ${script} })();\n } catch (ex) {\n __error(ex);\n } finally {\n __cleanup(__kizen_internal_result);\n }\n `;\n\n try {\n const fn = new AsyncFunction(functionBody);\n\n return { fn, functionBody };\n } catch {\n const errorFnBody = `\n this.__setup();\n\n this.onError({ message: \"The script has a syntax error and could not be parsed\" });\n \n this.__cleanup();\n `;\n\n const fn = new AsyncFunction(errorFnBody);\n\n return { fn, functionBody: errorFnBody };\n }\n};\n\nexport const generateExecutionKey = (\n pluginConfig?: CommonPluginDefinition | CommonExecutionPlugin,\n): string => {\n return `${pluginConfig?.plugin_api_name ?? ''}-${pluginConfig?.id ?? ''}-${pluginConfig?.api_name ?? ''}-${pluginConfig?.script_id ?? ''}`;\n};\n\nexport const emitRouteChange = (): void => {\n const event = new CustomEvent(ROUTE_CHANGE_INTERNAL_EVENT, {\n detail: {\n location: getPartialLocation(),\n },\n });\n\n window.dispatchEvent(event);\n};\n\nconst splitScriptApiName = (\n scriptApiName: string,\n): { pluginApiName: string | undefined; actionApiName: string | undefined } => {\n const [pluginApiName, actionApiName] = scriptApiName.split('.');\n\n return {\n pluginApiName,\n actionApiName,\n };\n};\n\nexport const findMatchingAction = (\n availableActions: {\n pluginApp?: {\n apiName: string;\n };\n apiName: string;\n }[],\n apiName?: string,\n): unknown => {\n if (!apiName) {\n return null;\n }\n\n const { pluginApiName, actionApiName } = splitScriptApiName(apiName);\n\n if (!pluginApiName) {\n const action = availableActions.find((act) => !act.pluginApp && act.apiName === actionApiName);\n\n return action;\n }\n\n const action = availableActions.find(\n (act) => act.apiName === actionApiName && act.pluginApp?.apiName === pluginApiName,\n );\n\n return action;\n};\n"]}
@@ -1,6 +1,6 @@
1
- import { getPartialLocation, generateUUIDV4 } from './chunk-3RZHGFVE.js';
2
- import { getAllNestedInputsFromConfig, deserializeConsoleArg, KizenRequestError } from './chunk-OMIBO27E.js';
3
- import { IFRAME_PREFIX, ACTIONS, RESPONSES, COMMUNICATIONS, thirdPartyGlobalNames, getScriptIntegrationType, thirdPartySetupScripts, thirdPartyReadyPredicates } from './chunk-BJBB73QA.js';
1
+ import { getPartialLocation, generateUUIDV4 } from './chunk-75QZJ7JX.js';
2
+ import { getAllNestedInputsFromConfig, buildIframeURLWithProxy, deserializeConsoleArg, KizenRequestError } from './chunk-CV4PC3KZ.js';
3
+ import { IFRAME_PREFIX, ACTIONS, RESPONSES, COMMUNICATIONS, thirdPartyGlobalNames, getScriptIntegrationType, thirdPartySetupScripts, thirdPartyReadyPredicates } from './chunk-B3P7HFRV.js';
4
4
  import { __commonJS, __toESM } from './chunk-5WRI5ZAA.js';
5
5
  import DOMPurify from 'dompurify';
6
6
 
@@ -1755,12 +1755,22 @@ var getLinkValue = (value, include, getParam) => {
1755
1755
  const result = appendParams(baseValue, params);
1756
1756
  return result;
1757
1757
  };
1758
- var getPluginSafeHTML = (html) => {
1758
+ var getPluginSafeHTML = (html, pluginApiName, options) => {
1759
1759
  if (!html) {
1760
1760
  return { html: "", error: null, removed: [] };
1761
1761
  }
1762
1762
  try {
1763
- const cleanHtml = DOMPurify.sanitize(html, {
1763
+ const purify = DOMPurify();
1764
+ purify.addHook("uponSanitizeElement", (node, data) => {
1765
+ if (data.tagName === "iframe") {
1766
+ const element = node;
1767
+ const src = element.getAttribute("src") ?? "";
1768
+ const newUrl = buildIframeURLWithProxy(src, options);
1769
+ element.setAttribute("src", newUrl);
1770
+ element.setAttribute("name", pluginApiName ?? "");
1771
+ }
1772
+ });
1773
+ const cleanHtml = purify.sanitize(html, {
1764
1774
  ADD_TAGS: ["iframe"],
1765
1775
  ADD_ATTR: [
1766
1776
  "allow",
@@ -1776,7 +1786,7 @@ var getPluginSafeHTML = (html) => {
1776
1786
  "title"
1777
1787
  ]
1778
1788
  });
1779
- return { html: cleanHtml, error: null, removed: DOMPurify.removed };
1789
+ return { html: cleanHtml, error: null, removed: purify.removed };
1780
1790
  } catch (err) {
1781
1791
  return { html: "", error: err, removed: [] };
1782
1792
  }
@@ -1893,7 +1903,7 @@ var WorkerManager = class {
1893
1903
  }
1894
1904
  case ACTIONS.UI_OUTPUT: {
1895
1905
  const consideredEvent = event;
1896
- this.handleUIOutput(consideredEvent.markup);
1906
+ this.handleUIOutput(consideredEvent.markup, consideredEvent.options);
1897
1907
  return;
1898
1908
  }
1899
1909
  case ACTIONS.IFRAME_OUTPUT: {
@@ -1902,7 +1912,8 @@ var WorkerManager = class {
1902
1912
  consideredEvent.url,
1903
1913
  consideredEvent.allow,
1904
1914
  consideredEvent.sandbox,
1905
- consideredEvent.preserve
1915
+ consideredEvent.preserve,
1916
+ consideredEvent.name
1906
1917
  );
1907
1918
  return;
1908
1919
  }
@@ -2127,12 +2138,11 @@ var WorkerManager = class {
2127
2138
  } else if (type === COMMUNICATIONS.CALL_THIRD_PARTY_SCRIPT) {
2128
2139
  this.handleCallThirdPartyScript(recipient.type, params);
2129
2140
  } else {
2130
- const pluginApiName = this.executionPlugin?.plugin_api_name ?? this.plugin?.plugin_api_name;
2131
2141
  const event = new CustomEvent(`integration:${type}`, {
2132
2142
  detail: {
2133
2143
  recipient: {
2134
2144
  ...recipient,
2135
- plugin: pluginApiName
2145
+ plugin: this.pluginApiName
2136
2146
  },
2137
2147
  args
2138
2148
  }
@@ -2184,9 +2194,9 @@ var WorkerManager = class {
2184
2194
  this.postMessage(RESPONSES.QUERY_RESPONSE, { error, id });
2185
2195
  }
2186
2196
  };
2187
- handleUIOutput = (markup) => {
2197
+ handleUIOutput = (markup, options) => {
2188
2198
  if (this.scriptUIRef?.current) {
2189
- const sanitizedMarkup = getPluginSafeHTML(markup).html;
2199
+ const sanitizedMarkup = getPluginSafeHTML(markup, this.pluginApiName, options).html;
2190
2200
  this.scriptUIRef.current.innerHTML = sanitizedMarkup;
2191
2201
  }
2192
2202
  };
@@ -2196,12 +2206,13 @@ var WorkerManager = class {
2196
2206
  this.handleDone(payload.preserve);
2197
2207
  }
2198
2208
  };
2199
- handleIframeOutput = (url, allow = [], sandbox = [], preserve = false) => {
2209
+ handleIframeOutput = (url, allow = [], sandbox = [], preserve = false, name = "") => {
2200
2210
  if (this.scriptUIRef?.current) {
2201
2211
  const parsedAllowList = allow.filter((a) => allowedAllowValues.includes(a));
2202
2212
  const parsedSandboxList = sandbox.filter((s) => allowedSandboxValues.includes(s));
2203
2213
  this.waitForFrame = true;
2204
2214
  const element = document.createElement("iframe");
2215
+ element.name = name;
2205
2216
  element.src = url;
2206
2217
  element.allow = parsedAllowList.join("; ");
2207
2218
  parsedSandboxList.forEach((s) => {
@@ -2361,7 +2372,7 @@ var WorkerManager = class {
2361
2372
  this.onShowModal(
2362
2373
  {
2363
2374
  ...config,
2364
- pluginApiName: this.pluginApiName ?? "",
2375
+ pluginApiName: this.pluginApiName,
2365
2376
  dynamic
2366
2377
  },
2367
2378
  (result = {}) => {
@@ -2384,7 +2395,7 @@ var WorkerManager = class {
2384
2395
  {
2385
2396
  viewId,
2386
2397
  ...args !== void 0 && { args },
2387
- pluginApiName: this.pluginApiName ?? "",
2398
+ pluginApiName: this.pluginApiName,
2388
2399
  ...options?.size !== void 0 && { size: options.size },
2389
2400
  ...options?.frameless ? { frameless: true } : {
2390
2401
  ...options?.title !== void 0 && { title: options.title },
@@ -2670,8 +2681,8 @@ var modalSize = {
2670
2681
  };
2671
2682
 
2672
2683
  // src/index.ts
2673
- var version = "1.6.0";
2684
+ var version = "1.7.0-8f49177";
2674
2685
 
2675
2686
  export { forceQualifiedUrl, getDisabledValue, getEnabledState, getHash, getLinkValue, getPluginSafeHTML, getQrCodeValue, getStableHash, isFlagEnabled, mergeConfig, modalSize, pluginMapper, reduceEnabledResults, replaceConfigValues, runExpression, runObjectExpression, runOptionExpression, runScript, runStringExpression, version };
2676
- //# sourceMappingURL=chunk-3GJVC5NN.js.map
2677
- //# sourceMappingURL=chunk-3GJVC5NN.js.map
2687
+ //# sourceMappingURL=chunk-AFUZ4QSH.js.map
2688
+ //# sourceMappingURL=chunk-AFUZ4QSH.js.map