@kizenapps/engine 1.5.0-b163380 → 1.5.0-e6096af
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ThirdPartyScript-CU4bWTIP.d.ts → ThirdPartyScript-DVgjFFyS.d.ts} +13 -1
- package/dist/{automation-WhjC7Twa.d.ts → automation-CRWtgS0X.d.ts} +9 -3
- package/dist/{chunk-4AEFC6CZ.js → chunk-3GR5AB3F.js} +39 -9
- package/dist/chunk-3GR5AB3F.js.map +1 -0
- package/dist/{chunk-OZLB7RIG.js → chunk-FXBESMDZ.js} +40 -6
- package/dist/chunk-FXBESMDZ.js.map +1 -0
- package/dist/{chunk-V6MAREX7.js → chunk-KZS4W7PY.js} +5 -4
- package/dist/chunk-KZS4W7PY.js.map +1 -0
- package/dist/{chunk-ZPFIPRXQ.js → chunk-OH5QH6NZ.js} +3 -3
- package/dist/{chunk-ZPFIPRXQ.js.map → chunk-OH5QH6NZ.js.map} +1 -1
- package/dist/{chunk-4UEAFMIO.js → chunk-ONOMSP4K.js} +161 -4
- package/dist/chunk-ONOMSP4K.js.map +1 -0
- package/dist/{chunk-DKJMM5F5.js → chunk-OU6UP7IR.js} +5 -3
- package/dist/chunk-OU6UP7IR.js.map +1 -0
- package/dist/{chunk-YZMFXGYU.js → chunk-PU3QT2HI.js} +3 -3
- package/dist/{chunk-YZMFXGYU.js.map → chunk-PU3QT2HI.js.map} +1 -1
- package/dist/{chunk-4X6FGEFW.js → chunk-TSA55WPN.js} +4 -4
- package/dist/{chunk-4X6FGEFW.js.map → chunk-TSA55WPN.js.map} +1 -1
- package/dist/{chunk-QMZCMENA.js → chunk-YKHL4H5I.js} +3 -3
- package/dist/{chunk-QMZCMENA.js.map → chunk-YKHL4H5I.js.map} +1 -1
- package/dist/communication.d.ts +2 -2
- package/dist/communication.js +2 -2
- package/dist/contexts/base.d.ts +2 -2
- package/dist/contexts/base.js +4 -4
- package/dist/contexts/floatingFrame.d.ts +1 -1
- package/dist/contexts/floatingFrame.js +5 -5
- package/dist/contexts/recordDetail.d.ts +1 -1
- package/dist/contexts/recordDetail.js +5 -5
- package/dist/{generic-DNjpHkcc.d.ts → generic-FaDES8rA.d.ts} +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.js +4 -4
- package/dist/react.d.ts +4 -4
- package/dist/react.js +5 -5
- package/dist/types.d.ts +5 -5
- package/dist/util.d.ts +3 -3
- package/dist/util.js +5 -5
- package/dist/{values-DRLCW9ke.d.ts → values-Ds-qJB6k.d.ts} +2 -2
- package/dist/workers/calendarSource.worker.js +6 -6
- package/dist/workers/floatingFrame.worker.js +7 -7
- package/dist/workers/generic.worker.js +6 -6
- package/dist/workers/recordDetail.worker.js +7 -7
- package/package.json +1 -1
- package/dist/chunk-4AEFC6CZ.js.map +0 -1
- package/dist/chunk-4UEAFMIO.js.map +0 -1
- package/dist/chunk-DKJMM5F5.js.map +0 -1
- package/dist/chunk-OZLB7RIG.js.map +0 -1
- package/dist/chunk-V6MAREX7.js.map +0 -1
|
@@ -74,6 +74,8 @@ type MaybeMessageError = {
|
|
|
74
74
|
message?: string;
|
|
75
75
|
} | undefined;
|
|
76
76
|
type EmployeeConfig<T = unknown> = Record<string, T>;
|
|
77
|
+
type ConsoleLogLevel = 'log' | 'warn' | 'error' | 'info' | 'debug';
|
|
78
|
+
type ConsoleBridge = Pick<Console, ConsoleLogLevel>;
|
|
77
79
|
|
|
78
80
|
type PromiseResolve = (value: unknown) => void;
|
|
79
81
|
type PromiseReject = (reason?: unknown) => void;
|
|
@@ -98,6 +100,12 @@ declare class WorkerPromise {
|
|
|
98
100
|
reject(id: string, reason?: unknown): void;
|
|
99
101
|
}
|
|
100
102
|
|
|
103
|
+
declare const modalSize: {
|
|
104
|
+
readonly small: 400;
|
|
105
|
+
readonly medium: 900;
|
|
106
|
+
readonly large: 1200;
|
|
107
|
+
};
|
|
108
|
+
type ModalSize = keyof typeof modalSize;
|
|
101
109
|
interface ButtonConfig {
|
|
102
110
|
label: string;
|
|
103
111
|
variant?: 'text' | 'standard';
|
|
@@ -161,12 +169,14 @@ interface ModalConfig {
|
|
|
161
169
|
dynamic?: boolean;
|
|
162
170
|
pluginApiName?: string;
|
|
163
171
|
frameless?: boolean;
|
|
172
|
+
size?: ModalSize;
|
|
164
173
|
}
|
|
165
174
|
interface ShowViewInModalOptions {
|
|
166
175
|
title?: string;
|
|
167
176
|
confirmButton?: ButtonConfig;
|
|
168
177
|
cancelButton?: ButtonConfig;
|
|
169
178
|
frameless?: boolean;
|
|
179
|
+
size?: ModalSize;
|
|
170
180
|
}
|
|
171
181
|
interface DynamicPromptConfig {
|
|
172
182
|
title?: string;
|
|
@@ -174,6 +184,7 @@ interface DynamicPromptConfig {
|
|
|
174
184
|
cancelButton?: ButtonConfig;
|
|
175
185
|
content?: ModalBlock[];
|
|
176
186
|
registerUtils?: Record<string, (...args: unknown[]) => unknown>;
|
|
187
|
+
size?: ModalSize;
|
|
177
188
|
}
|
|
178
189
|
type PromptState = Record<string, unknown>;
|
|
179
190
|
type ShowViewInModalFn = (id: string, config?: {
|
|
@@ -391,6 +402,7 @@ declare const ACTIONS: {
|
|
|
391
402
|
COPY_TO_CLIPBOARD: string;
|
|
392
403
|
SHOW_VIEW_IN_MODAL_REQUEST: string;
|
|
393
404
|
CLOSE_MODAL_REQUEST: string;
|
|
405
|
+
CONSOLE_LOG: string;
|
|
394
406
|
};
|
|
395
407
|
declare enum INDICATOR_TYPE {
|
|
396
408
|
NONE = "none",
|
|
@@ -511,4 +523,4 @@ declare class ThirdPartyScript {
|
|
|
511
523
|
call(...params: unknown[]): void;
|
|
512
524
|
}
|
|
513
525
|
|
|
514
|
-
export { type
|
|
526
|
+
export { type CurriedRefreshEntityFn as $, type Args as A, type BaseAPI as B, type CurrentUser as C, type DataCache as D, type CleanValueStoreType as E, type CloseModalFn as F, type GetOptions as G, type ConfigService as H, type Instance as I, type ConsoleLogLevel as J, type CreateRecordModalQueue as K, type CreateRelatedRecordModalQueue as L, type ModalConfig as M, type CurriedCloseModalFn as N, type CurriedDynamicPromptFn as O, type PartialEntity as P, type CurriedInstallThirdPartyScriptFn as Q, type RequestWithErrorsResponse as R, type StateChangePayload as S, ThirdPartyScript as T, type UnknownJSON as U, type CurriedKizenRequestFn as V, type WorkerContextArgs as W, type CurriedOpenCreateRecordFn as X, type CurriedOpenCreateRelatedRecordFn as Y, type CurriedPostFormDataFn as Z, type CurriedPromptFn as _, type PartialCustomObject as a, type ValueStore as a$, type CurriedShowViewInModalFn as a0, type CurriedUploadFileFn as a1, type CustomObjectCleanValue as a2, type CustomObjectValueStore as a3, type DataCacheEntry as a4, type DeleteReturnValue as a5, type DynamicPromptFn as a6, type EmployeeConfig as a7, type ErrorHandler as a8, type ErrorResponse as a9, type OnShowCreateRelatedRecordModalFn as aA, type OnShowModalFn as aB, type OpenCreateRecordFn as aC, type OpenCreateRelatedRecordFn as aD, type PartialRelatedObject as aE, type PatchReturnValue as aF, type PostFormDataPayload as aG, type PostReturnValue as aH, type Profile as aI, type PromiseMap as aJ, type PromiseReject as aK, type PromiseResolve as aL, type PromiseState as aM, type PromptFn as aN, type PutReturnValue as aO, type RefreshEntityFn as aP, type ReleaseBlockingScriptHandler as aQ, type SelectCleanValue as aR, type SelectValueStore as aS, type SetInternalSessionDataFn as aT, type SetupAssistantConfig as aU, type ShowViewInModalFn as aV, type TextValueStore as aW, type UnknownFunction as aX, type UploadFileData as aY, type UploadFileFn as aZ, type UserConfig as a_, type FieldCleanValue as aa, type FieldValueStore as ab, type GetReturnValue as ac, type InstallThirdPartyScriptFn as ad, type JSONArray as ae, type JSONObject as af, type JSONPrimitive as ag, type JSONValue as ah, type KizenConfig as ai, type KizenNetworkResponse as aj, type KizenProxySuccessResponse as ak, type KizenRequestFn as al, type KizenRequestFnHandler as am, type KnownArgs as an, type MatchSetupAssistantField as ao, type MaybeMessageError as ap, type ModalBlock as aq, type ModalCancelEventSource as ar, type ModalContainer as as, type ModalQueue as at, type ModalSize as au, type NumberCleanValue as av, type NumberValueStore as aw, type OnCloseModalFn as ax, type OnNetworkErrorFn as ay, type OnShowCreateRecordModalFn as az, type PartialUser as b, modalSize as b0, KizenRequestError as b1, ACTIONS as b2, ALLOWED_INTEGRATIONS as b3, IFRAME_PREFIX as b4, INDICATOR_TYPE as b5, type PartialTeamMember as c, type PartialBusiness as d, type PartialClientObject as e, type PostFormDataFn as f, type PromptState as g, type InternalSessionData as h, type PartialLocation as i, type RequestOptions as j, type ShowToastOptions as k, type ShowViewInModalOptions as l, type DynamicPromptConfig as m, type ConsoleBridge as n, type IncludeOption as o, type SetupAssistantField as p, type AppPlugin as q, type SelectOption as r, type AppPlugins as s, type AssistantConfigAction as t, type AssistantField as u, type AssistantLink as v, type BooleanCleanValue as w, type BooleanValueStore as x, type ButtonConfig as y, type CleanValueStore as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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-DVgjFFyS.js';
|
|
2
2
|
import { H as HideConfig, S as ShowConfig } from './floatingFrames-BzaoL7cq.js';
|
|
3
3
|
|
|
4
4
|
interface CommonPluginDefinition {
|
|
@@ -56,6 +56,7 @@ interface RunScriptOptions {
|
|
|
56
56
|
performFileUpload?: PerformKizenFileUploadFn | undefined;
|
|
57
57
|
getPendingCacheCount?: GetPendingCacheCountFn | undefined;
|
|
58
58
|
invalidateCache?: InvalidateCacheFn | undefined;
|
|
59
|
+
onConsoleLog?: OnConsoleLogFn;
|
|
59
60
|
}
|
|
60
61
|
type RequestableQueryMethods = 'get' | 'post' | 'patch' | 'delete';
|
|
61
62
|
type OnNetworkRequestFn = (method: RequestableQueryMethods, url: string, payload?: UnknownJSON, options?: UnknownJSON) => Promise<{
|
|
@@ -183,7 +184,12 @@ interface CloseModalRequestEvent extends BaseEvent {
|
|
|
183
184
|
values?: UnknownJSON;
|
|
184
185
|
canceled?: boolean;
|
|
185
186
|
}
|
|
186
|
-
|
|
187
|
+
interface ConsoleLogEvent extends BaseEvent {
|
|
188
|
+
level: ConsoleLogLevel;
|
|
189
|
+
args: unknown[];
|
|
190
|
+
}
|
|
191
|
+
type OnConsoleLogFn = (level: ConsoleLogLevel, args: unknown[]) => void;
|
|
192
|
+
type MessageEventData = QueryRequestEvent | UIOutputEvent | IframeOutputEvent | PostFormDataRequestEvent | UploadFileRequestEvent | SetStateEvent | DoneEvent | ErrorEvent | OpenWindowEvent | CommunicateEvent | HideEvent | ShowEvent | CopyToClipboardEvent | OpenCreateRecordModalRequestEvent | OpenCreateRelatedRecordModalRequestEvent | ShowToastEvent | RefreshTimelineEvent | RefreshEntityEvent | UpdateSessionDataEvent | InstallThirdPartyScriptRequestEvent | PromptRequestEvent | DynamicPromptRequestEvent | ShowViewInModalRequestEvent | CloseModalRequestEvent | AuthorizeEvent | ConsoleLogEvent;
|
|
187
193
|
type InvalidateCacheFn = (category: 'timeline' | 'entity', entityId: string) => void;
|
|
188
194
|
type GetPendingCacheCountFn = (search: string) => number;
|
|
189
195
|
interface KizenFile extends File {
|
|
@@ -344,4 +350,4 @@ interface AutomationStepConfig<T = unknown> {
|
|
|
344
350
|
plugin_api_name?: string;
|
|
345
351
|
}
|
|
346
352
|
|
|
347
|
-
export type {
|
|
353
|
+
export type { ShowEvent as $, AutomationStepConfig as A, BaseEvent as B, CommonExecutionPlugin as C, DataAdornmentConfig as D, ErrorEvent as E, FloatingFrameConfig as F, GetPendingCacheCountFn as G, HideEvent as H, IframeOutputEvent as I, OpenCreateRecordModalRequestEvent as J, KizenFile as K, OpenCreateRelatedRecordModalRequestEvent as L, MessageEventData as M, OpenWindowEvent as N, OnClearToastsFn as O, PerformKizenFileUploadFn as P, PostFormDataRequestEvent as Q, RoutablePageConfig as R, PromptRequestEvent as S, ToolbarItemConfig as T, QueryRequestEvent as U, RecipientConfig as V, RefreshEntityEvent as W, RefreshTimelineEvent as X, RequestableQueryMethods as Y, SchemaValidation as Z, SetStateEvent as _, CommonPluginDefinition as a, ShowToastEvent as a0, ShowViewInModalRequestEvent as a1, TerminatorContent as a2, Terminators as a3, UIOutputEvent as a4, UpdateSessionDataEvent as a5, UploadFilePayload as a6, UploadFileRequestEvent as a7, WindowPosition as a8, RouteScriptConfig as b, CalendarSourceConfig as c, RunScriptOptions as d, AuthorizeEvent as e, CalendarDefinition as f, CalendarScriptReturnData as g, CalendarSourceMap as h, CalendarSources as i, CloseModalRequestEvent as j, CommunicateEvent as k, ConsoleLogEvent as l, CopyToClipboardEvent as m, CreateFileIdFn as n, DoneEvent as o, DynamicPromptRequestEvent as p, ExecuteCalendarSourceScript as q, ExecuteFloatingFrameScript as r, FloatingFrameEmployeeConfig as s, FrameQuadrant as t, InstallThirdPartyScriptRequestEvent as u, InvalidateCacheFn as v, MinimizedConfig as w, OnConsoleLogFn as x, OnNetworkRequestFn as y, OnShowToastFn as z };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getPartialLocation, generateUUIDV4 } from './chunk-
|
|
2
|
-
import { getAllNestedInputsFromConfig, KizenRequestError } from './chunk-
|
|
3
|
-
import { IFRAME_PREFIX, ACTIONS, RESPONSES, COMMUNICATIONS, thirdPartyGlobalNames, getScriptIntegrationType, thirdPartySetupScripts, thirdPartyReadyPredicates } from './chunk-
|
|
1
|
+
import { getPartialLocation, generateUUIDV4 } from './chunk-OU6UP7IR.js';
|
|
2
|
+
import { getAllNestedInputsFromConfig, deserializeConsoleArg, KizenRequestError } from './chunk-ONOMSP4K.js';
|
|
3
|
+
import { IFRAME_PREFIX, ACTIONS, RESPONSES, COMMUNICATIONS, thirdPartyGlobalNames, getScriptIntegrationType, thirdPartySetupScripts, thirdPartyReadyPredicates } from './chunk-KZS4W7PY.js';
|
|
4
4
|
import { __commonJS, __toESM } from './chunk-5WRI5ZAA.js';
|
|
5
5
|
import DOMPurify from 'dompurify';
|
|
6
6
|
|
|
@@ -1828,6 +1828,7 @@ var WorkerManager = class {
|
|
|
1828
1828
|
performFileUpload;
|
|
1829
1829
|
pushHistory;
|
|
1830
1830
|
appPath;
|
|
1831
|
+
onConsoleLog;
|
|
1831
1832
|
constructor(args) {
|
|
1832
1833
|
this.scriptUIRef = args.scriptUIRef;
|
|
1833
1834
|
this.onStateChange = args.onStateChange;
|
|
@@ -1853,6 +1854,7 @@ var WorkerManager = class {
|
|
|
1853
1854
|
this.performFileUpload = args.performFileUpload;
|
|
1854
1855
|
this.pushHistory = args.pushHistory;
|
|
1855
1856
|
this.appPath = args.appPath;
|
|
1857
|
+
this.onConsoleLog = args.onConsoleLog;
|
|
1856
1858
|
if (this.plugin) {
|
|
1857
1859
|
this.frameId = `${IFRAME_PREFIX}-${this.plugin.plugin_api_name}-${this.plugin.api_name}`;
|
|
1858
1860
|
}
|
|
@@ -2071,6 +2073,24 @@ var WorkerManager = class {
|
|
|
2071
2073
|
this.handleAuthorize(consideredEvent.serviceName, consideredEvent.config);
|
|
2072
2074
|
return;
|
|
2073
2075
|
}
|
|
2076
|
+
case ACTIONS.CONSOLE_LOG: {
|
|
2077
|
+
const consideredEvent = event;
|
|
2078
|
+
let deserializedArgs = [];
|
|
2079
|
+
try {
|
|
2080
|
+
deserializedArgs = consideredEvent.args.map(deserializeConsoleArg);
|
|
2081
|
+
} catch {
|
|
2082
|
+
deserializedArgs = ["[unparseable plugin log]"];
|
|
2083
|
+
}
|
|
2084
|
+
try {
|
|
2085
|
+
console[consideredEvent.level](...deserializedArgs);
|
|
2086
|
+
} catch {
|
|
2087
|
+
}
|
|
2088
|
+
try {
|
|
2089
|
+
this.onConsoleLog?.(consideredEvent.level, deserializedArgs);
|
|
2090
|
+
} catch {
|
|
2091
|
+
}
|
|
2092
|
+
return;
|
|
2093
|
+
}
|
|
2074
2094
|
default:
|
|
2075
2095
|
return;
|
|
2076
2096
|
}
|
|
@@ -2353,6 +2373,7 @@ var WorkerManager = class {
|
|
|
2353
2373
|
viewId,
|
|
2354
2374
|
...args !== void 0 && { args },
|
|
2355
2375
|
pluginApiName: this.pluginApiName ?? "",
|
|
2376
|
+
...options?.size !== void 0 && { size: options.size },
|
|
2356
2377
|
...options?.frameless ? { frameless: true } : {
|
|
2357
2378
|
...options?.title !== void 0 && { title: options.title },
|
|
2358
2379
|
...options?.confirmButton !== void 0 && {
|
|
@@ -2498,7 +2519,8 @@ var runScript = async ({
|
|
|
2498
2519
|
createFileId,
|
|
2499
2520
|
performFileUpload,
|
|
2500
2521
|
getPendingCacheCount,
|
|
2501
|
-
invalidateCache
|
|
2522
|
+
invalidateCache,
|
|
2523
|
+
onConsoleLog
|
|
2502
2524
|
}) => {
|
|
2503
2525
|
const isDebug = isFlagEnabled("script-runner-logging");
|
|
2504
2526
|
let worker;
|
|
@@ -2575,7 +2597,8 @@ var runScript = async ({
|
|
|
2575
2597
|
createFileId,
|
|
2576
2598
|
performFileUpload,
|
|
2577
2599
|
getPendingCacheCount,
|
|
2578
|
-
invalidateCache
|
|
2600
|
+
invalidateCache,
|
|
2601
|
+
onConsoleLog
|
|
2579
2602
|
});
|
|
2580
2603
|
setLoadingState(true);
|
|
2581
2604
|
instance.run(
|
|
@@ -2624,9 +2647,16 @@ var runObjectExpression = async (expression, values) => {
|
|
|
2624
2647
|
return result;
|
|
2625
2648
|
};
|
|
2626
2649
|
|
|
2650
|
+
// src/types/modals.ts
|
|
2651
|
+
var modalSize = {
|
|
2652
|
+
small: 400,
|
|
2653
|
+
medium: 900,
|
|
2654
|
+
large: 1200
|
|
2655
|
+
};
|
|
2656
|
+
|
|
2627
2657
|
// src/index.ts
|
|
2628
|
-
var version = "1.5.0-
|
|
2658
|
+
var version = "1.5.0-e6096af";
|
|
2629
2659
|
|
|
2630
|
-
export { forceQualifiedUrl, getDisabledValue, getEnabledState, getHash, getLinkValue, getPluginSafeHTML, getQrCodeValue, getStableHash, isFlagEnabled, mergeConfig, pluginMapper, reduceEnabledResults, replaceConfigValues, runExpression, runObjectExpression, runOptionExpression, runScript, runStringExpression, version };
|
|
2631
|
-
//# sourceMappingURL=chunk-
|
|
2632
|
-
//# sourceMappingURL=chunk-
|
|
2660
|
+
export { forceQualifiedUrl, getDisabledValue, getEnabledState, getHash, getLinkValue, getPluginSafeHTML, getQrCodeValue, getStableHash, isFlagEnabled, mergeConfig, modalSize, pluginMapper, reduceEnabledResults, replaceConfigValues, runExpression, runObjectExpression, runOptionExpression, runScript, runStringExpression, version };
|
|
2661
|
+
//# sourceMappingURL=chunk-3GR5AB3F.js.map
|
|
2662
|
+
//# sourceMappingURL=chunk-3GR5AB3F.js.map
|