@kizenapps/engine 1.5.0-eea1ed9 → 1.5.1-84037f0
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/LICENSE.md +1 -1
- package/dist/{ThirdPartyScript-CNJE0KCC.d.ts → ThirdPartyScript-DVgjFFyS.d.ts} +30 -3
- package/dist/{automation-Cq_ikix7.d.ts → automation-CRWtgS0X.d.ts} +15 -3
- package/dist/{chunk-654TQCTD.js → chunk-7CVF5MWG.js} +60 -13
- package/dist/chunk-7CVF5MWG.js.map +1 -0
- package/dist/{chunk-AW2EBAZ5.js → chunk-AZHJRYG7.js} +48 -8
- package/dist/chunk-AZHJRYG7.js.map +1 -0
- package/dist/{chunk-S4MDBKRN.js → chunk-FUUVDEWT.js} +6 -4
- package/dist/chunk-FUUVDEWT.js.map +1 -0
- package/dist/{chunk-HPIHLZEX.js → chunk-L6H2UMWR.js} +3 -3
- package/dist/{chunk-HPIHLZEX.js.map → chunk-L6H2UMWR.js.map} +1 -1
- package/dist/{chunk-ADJCDTJV.js → chunk-NDBOMIMG.js} +3 -3
- package/dist/{chunk-ADJCDTJV.js.map → chunk-NDBOMIMG.js.map} +1 -1
- package/dist/{chunk-FGNDQDEF.js → chunk-PRXJNS2N.js} +4 -4
- package/dist/{chunk-FGNDQDEF.js.map → chunk-PRXJNS2N.js.map} +1 -1
- package/dist/{chunk-A7FXRONV.js → chunk-Q7PJNG7X.js} +5 -3
- package/dist/chunk-Q7PJNG7X.js.map +1 -0
- package/dist/{chunk-IC7MWYER.js → chunk-U6ERTCKR.js} +3 -3
- package/dist/{chunk-IC7MWYER.js.map → chunk-U6ERTCKR.js.map} +1 -1
- package/dist/{chunk-RLS4JXKI.js → chunk-V2IJRIYF.js} +173 -6
- package/dist/chunk-V2IJRIYF.js.map +1 -0
- package/dist/communication.d.ts +2 -2
- package/dist/communication.js +2 -2
- package/dist/contexts/base.d.ts +9 -4
- 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-B0sTB6Bm.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 +19 -6
- package/dist/react.js +118 -74
- package/dist/react.js.map +1 -1
- package/dist/types.d.ts +5 -5
- package/dist/util.d.ts +3 -3
- package/dist/util.js +5 -5
- package/dist/{values-BpeVADqG.d.ts → values-Ds-qJB6k.d.ts} +2 -2
- package/dist/workers/calendarSource.worker.js +10 -6
- package/dist/workers/calendarSource.worker.js.map +1 -1
- package/dist/workers/floatingFrame.worker.js +8 -7
- package/dist/workers/floatingFrame.worker.js.map +1 -1
- package/dist/workers/generic.worker.js +7 -6
- package/dist/workers/generic.worker.js.map +1 -1
- package/dist/workers/recordDetail.worker.js +8 -7
- package/dist/workers/recordDetail.worker.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-654TQCTD.js.map +0 -1
- package/dist/chunk-A7FXRONV.js.map +0 -1
- package/dist/chunk-AW2EBAZ5.js.map +0 -1
- package/dist/chunk-RLS4JXKI.js.map +0 -1
- package/dist/chunk-S4MDBKRN.js.map +0 -1
package/LICENSE.md
CHANGED
|
@@ -671,4 +671,4 @@ into proprietary programs. If your program is a subroutine library, you
|
|
|
671
671
|
may consider it more useful to permit linking proprietary applications with
|
|
672
672
|
the library. If this is what you want to do, use the GNU Lesser General
|
|
673
673
|
Public License instead of this License. But first, please read
|
|
674
|
-
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
|
674
|
+
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
|
@@ -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';
|
|
@@ -160,6 +168,15 @@ interface ModalConfig {
|
|
|
160
168
|
content?: ModalBlock[];
|
|
161
169
|
dynamic?: boolean;
|
|
162
170
|
pluginApiName?: string;
|
|
171
|
+
frameless?: boolean;
|
|
172
|
+
size?: ModalSize;
|
|
173
|
+
}
|
|
174
|
+
interface ShowViewInModalOptions {
|
|
175
|
+
title?: string;
|
|
176
|
+
confirmButton?: ButtonConfig;
|
|
177
|
+
cancelButton?: ButtonConfig;
|
|
178
|
+
frameless?: boolean;
|
|
179
|
+
size?: ModalSize;
|
|
163
180
|
}
|
|
164
181
|
interface DynamicPromptConfig {
|
|
165
182
|
title?: string;
|
|
@@ -167,14 +184,20 @@ interface DynamicPromptConfig {
|
|
|
167
184
|
cancelButton?: ButtonConfig;
|
|
168
185
|
content?: ModalBlock[];
|
|
169
186
|
registerUtils?: Record<string, (...args: unknown[]) => unknown>;
|
|
187
|
+
size?: ModalSize;
|
|
170
188
|
}
|
|
171
189
|
type PromptState = Record<string, unknown>;
|
|
172
|
-
type ShowViewInModalFn = (id: string,
|
|
190
|
+
type ShowViewInModalFn = (id: string, config?: {
|
|
191
|
+
args?: UnknownJSON;
|
|
192
|
+
options?: ShowViewInModalOptions;
|
|
193
|
+
}) => Promise<{
|
|
173
194
|
canceled: boolean;
|
|
174
195
|
result?: unknown;
|
|
175
196
|
error?: unknown;
|
|
176
197
|
}>;
|
|
177
198
|
type CurriedShowViewInModalFn = (instance: Instance, promises: WorkerPromise) => ShowViewInModalFn;
|
|
199
|
+
type CloseModalFn = (values?: UnknownJSON, canceled?: boolean) => void;
|
|
200
|
+
type CurriedCloseModalFn = (instance: Instance) => CloseModalFn;
|
|
178
201
|
type DynamicPromptFn = (config: DynamicPromptConfig) => Promise<{
|
|
179
202
|
values: Record<string, ValueStore>;
|
|
180
203
|
}>;
|
|
@@ -280,6 +303,7 @@ type ValueStore = BooleanValueStore | CustomObjectValueStore | FieldValueStore |
|
|
|
280
303
|
type CleanValueStoreType = BooleanCleanValue | CustomObjectCleanValue | FieldCleanValue | NumberCleanValue | SelectCleanValue | TextCleanValue;
|
|
281
304
|
type CleanValueStore = Record<string, CleanValueStoreType>;
|
|
282
305
|
type OnShowModalFn = (config: ModalConfig, cb: (result?: UnknownJSON) => void) => void;
|
|
306
|
+
type OnCloseModalFn = (values?: UnknownJSON, canceled?: boolean) => void;
|
|
283
307
|
type OnShowCreateRecordModalFn = (objectId: string, cb: (result: UnknownJSON) => void) => void;
|
|
284
308
|
type OnShowCreateRelatedRecordModalFn = (objectId: string, relatedEntityId: string, cb: (result: UnknownJSON) => void) => void;
|
|
285
309
|
type ModalQueue = {
|
|
@@ -295,7 +319,7 @@ type CreateRelatedRecordModalQueue = {
|
|
|
295
319
|
relatedEntityId: string;
|
|
296
320
|
cb: (result: UnknownJSON) => void;
|
|
297
321
|
}[];
|
|
298
|
-
type ModalCancelEventSource = 'button' | 'close';
|
|
322
|
+
type ModalCancelEventSource = 'button' | 'close' | 'script';
|
|
299
323
|
interface ConfigService {
|
|
300
324
|
api_name: string;
|
|
301
325
|
prerequisite: boolean;
|
|
@@ -377,6 +401,8 @@ declare const ACTIONS: {
|
|
|
377
401
|
AUTHORIZE: string;
|
|
378
402
|
COPY_TO_CLIPBOARD: string;
|
|
379
403
|
SHOW_VIEW_IN_MODAL_REQUEST: string;
|
|
404
|
+
CLOSE_MODAL_REQUEST: string;
|
|
405
|
+
CONSOLE_LOG: string;
|
|
380
406
|
};
|
|
381
407
|
declare enum INDICATOR_TYPE {
|
|
382
408
|
NONE = "none",
|
|
@@ -465,6 +491,7 @@ interface WorkerContextArgs {
|
|
|
465
491
|
pluginApiName: string;
|
|
466
492
|
location: PartialLocation;
|
|
467
493
|
showViewInModal: ShowViewInModalFn;
|
|
494
|
+
closeModal: CloseModalFn;
|
|
468
495
|
}
|
|
469
496
|
type KizenConfig = Record<string, unknown>;
|
|
470
497
|
interface KnownArgs {
|
|
@@ -496,4 +523,4 @@ declare class ThirdPartyScript {
|
|
|
496
523
|
call(...params: unknown[]): void;
|
|
497
524
|
}
|
|
498
525
|
|
|
499
|
-
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 {
|
|
@@ -37,6 +37,7 @@ interface RunScriptOptions {
|
|
|
37
37
|
onShowModal: OnShowModalFn;
|
|
38
38
|
onShowCreateRecordModal: OnShowCreateRecordModalFn;
|
|
39
39
|
onShowCreateRelatedRecordModal: OnShowCreateRelatedRecordModalFn;
|
|
40
|
+
onCloseModal?: OnCloseModalFn;
|
|
40
41
|
onNetworkError?: OnNetworkErrorFn;
|
|
41
42
|
scriptBody: WorkerContextArgs['scriptBody'];
|
|
42
43
|
user: WorkerContextArgs['user'];
|
|
@@ -55,6 +56,7 @@ interface RunScriptOptions {
|
|
|
55
56
|
performFileUpload?: PerformKizenFileUploadFn | undefined;
|
|
56
57
|
getPendingCacheCount?: GetPendingCacheCountFn | undefined;
|
|
57
58
|
invalidateCache?: InvalidateCacheFn | undefined;
|
|
59
|
+
onConsoleLog?: OnConsoleLogFn;
|
|
58
60
|
}
|
|
59
61
|
type RequestableQueryMethods = 'get' | 'post' | 'patch' | 'delete';
|
|
60
62
|
type OnNetworkRequestFn = (method: RequestableQueryMethods, url: string, payload?: UnknownJSON, options?: UnknownJSON) => Promise<{
|
|
@@ -176,8 +178,18 @@ interface ShowViewInModalRequestEvent extends BaseEvent {
|
|
|
176
178
|
id: string;
|
|
177
179
|
viewId: string;
|
|
178
180
|
args?: UnknownJSON;
|
|
181
|
+
options?: ShowViewInModalOptions;
|
|
179
182
|
}
|
|
180
|
-
|
|
183
|
+
interface CloseModalRequestEvent extends BaseEvent {
|
|
184
|
+
values?: UnknownJSON;
|
|
185
|
+
canceled?: boolean;
|
|
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;
|
|
181
193
|
type InvalidateCacheFn = (category: 'timeline' | 'entity', entityId: string) => void;
|
|
182
194
|
type GetPendingCacheCountFn = (search: string) => number;
|
|
183
195
|
interface KizenFile extends File {
|
|
@@ -338,4 +350,4 @@ interface AutomationStepConfig<T = unknown> {
|
|
|
338
350
|
plugin_api_name?: string;
|
|
339
351
|
}
|
|
340
352
|
|
|
341
|
-
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-Q7PJNG7X.js';
|
|
2
|
+
import { getAllNestedInputsFromConfig, deserializeConsoleArg, KizenRequestError } from './chunk-V2IJRIYF.js';
|
|
3
|
+
import { IFRAME_PREFIX, ACTIONS, RESPONSES, COMMUNICATIONS, thirdPartyGlobalNames, getScriptIntegrationType, thirdPartySetupScripts, thirdPartyReadyPredicates } from './chunk-FUUVDEWT.js';
|
|
4
4
|
import { __commonJS, __toESM } from './chunk-5WRI5ZAA.js';
|
|
5
5
|
import DOMPurify from 'dompurify';
|
|
6
6
|
|
|
@@ -1710,7 +1710,7 @@ var reduceEnabledResults = (results) => {
|
|
|
1710
1710
|
};
|
|
1711
1711
|
var forceQualifiedUrl = (url) => {
|
|
1712
1712
|
let qualifiedUrl = url;
|
|
1713
|
-
if (/^(http|https):\/\//.test(url)) {
|
|
1713
|
+
if (/^(http|https|kizen|kizenvoice):\/\//.test(url)) {
|
|
1714
1714
|
qualifiedUrl = url;
|
|
1715
1715
|
} else if (url.startsWith("/")) {
|
|
1716
1716
|
qualifiedUrl = `${getPartialLocation().origin}${qualifiedUrl}`;
|
|
@@ -1813,6 +1813,7 @@ var WorkerManager = class {
|
|
|
1813
1813
|
setSessionData;
|
|
1814
1814
|
pluginComponentId;
|
|
1815
1815
|
onShowModal;
|
|
1816
|
+
onCloseModal;
|
|
1816
1817
|
onShowCreateRecordModal;
|
|
1817
1818
|
onShowCreateRelatedRecordModal;
|
|
1818
1819
|
onReleaseBlockingScript;
|
|
@@ -1827,6 +1828,7 @@ var WorkerManager = class {
|
|
|
1827
1828
|
performFileUpload;
|
|
1828
1829
|
pushHistory;
|
|
1829
1830
|
appPath;
|
|
1831
|
+
onConsoleLog;
|
|
1830
1832
|
constructor(args) {
|
|
1831
1833
|
this.scriptUIRef = args.scriptUIRef;
|
|
1832
1834
|
this.onStateChange = args.onStateChange;
|
|
@@ -1841,6 +1843,7 @@ var WorkerManager = class {
|
|
|
1841
1843
|
this.onClearToasts = args.onClearToasts;
|
|
1842
1844
|
this.pluginComponentId = args.pluginComponentId;
|
|
1843
1845
|
this.onShowModal = args.onShowModal;
|
|
1846
|
+
this.onCloseModal = args.onCloseModal;
|
|
1844
1847
|
this.onShowCreateRecordModal = args.onShowCreateRecordModal;
|
|
1845
1848
|
this.onShowCreateRelatedRecordModal = args.onShowCreateRelatedRecordModal;
|
|
1846
1849
|
this.onNetworkError = args.onNetworkError;
|
|
@@ -1851,6 +1854,7 @@ var WorkerManager = class {
|
|
|
1851
1854
|
this.performFileUpload = args.performFileUpload;
|
|
1852
1855
|
this.pushHistory = args.pushHistory;
|
|
1853
1856
|
this.appPath = args.appPath;
|
|
1857
|
+
this.onConsoleLog = args.onConsoleLog;
|
|
1854
1858
|
if (this.plugin) {
|
|
1855
1859
|
this.frameId = `${IFRAME_PREFIX}-${this.plugin.plugin_api_name}-${this.plugin.api_name}`;
|
|
1856
1860
|
}
|
|
@@ -2050,10 +2054,16 @@ var WorkerManager = class {
|
|
|
2050
2054
|
this.handleShowViewInModalRequest(
|
|
2051
2055
|
consideredEvent.id,
|
|
2052
2056
|
consideredEvent.viewId,
|
|
2053
|
-
consideredEvent.args
|
|
2057
|
+
consideredEvent.args,
|
|
2058
|
+
consideredEvent.options
|
|
2054
2059
|
);
|
|
2055
2060
|
return;
|
|
2056
2061
|
}
|
|
2062
|
+
case ACTIONS.CLOSE_MODAL_REQUEST: {
|
|
2063
|
+
const consideredEvent = event;
|
|
2064
|
+
this.onCloseModal?.(consideredEvent.values, consideredEvent.canceled);
|
|
2065
|
+
return;
|
|
2066
|
+
}
|
|
2057
2067
|
case ACTIONS.RELEASE_BLOCKING_SCRIPT: {
|
|
2058
2068
|
this.handleReleaseBlockingScript();
|
|
2059
2069
|
return;
|
|
@@ -2063,6 +2073,24 @@ var WorkerManager = class {
|
|
|
2063
2073
|
this.handleAuthorize(consideredEvent.serviceName, consideredEvent.config);
|
|
2064
2074
|
return;
|
|
2065
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
|
+
}
|
|
2066
2094
|
default:
|
|
2067
2095
|
return;
|
|
2068
2096
|
}
|
|
@@ -2338,13 +2366,21 @@ var WorkerManager = class {
|
|
|
2338
2366
|
});
|
|
2339
2367
|
}
|
|
2340
2368
|
};
|
|
2341
|
-
handleShowViewInModalRequest = (id, viewId, args) => {
|
|
2369
|
+
handleShowViewInModalRequest = (id, viewId, args, options) => {
|
|
2342
2370
|
if (this.onShowModal) {
|
|
2343
2371
|
this.onShowModal(
|
|
2344
2372
|
{
|
|
2345
2373
|
viewId,
|
|
2346
2374
|
...args !== void 0 && { args },
|
|
2347
|
-
pluginApiName: this.pluginApiName ?? ""
|
|
2375
|
+
pluginApiName: this.pluginApiName ?? "",
|
|
2376
|
+
...options?.size !== void 0 && { size: options.size },
|
|
2377
|
+
...options?.frameless ? { frameless: true } : {
|
|
2378
|
+
...options?.title !== void 0 && { title: options.title },
|
|
2379
|
+
...options?.confirmButton !== void 0 && {
|
|
2380
|
+
confirmButton: options.confirmButton
|
|
2381
|
+
},
|
|
2382
|
+
...options?.cancelButton !== void 0 && { cancelButton: options.cancelButton }
|
|
2383
|
+
}
|
|
2348
2384
|
},
|
|
2349
2385
|
(result = {}) => {
|
|
2350
2386
|
this.postMessage(RESPONSES.PROMPT_RESPONSE, {
|
|
@@ -2473,6 +2509,7 @@ var runScript = async ({
|
|
|
2473
2509
|
sessionData,
|
|
2474
2510
|
setSessionData,
|
|
2475
2511
|
onShowModal,
|
|
2512
|
+
onCloseModal,
|
|
2476
2513
|
onShowCreateRecordModal,
|
|
2477
2514
|
onShowCreateRelatedRecordModal,
|
|
2478
2515
|
onNetworkError,
|
|
@@ -2482,7 +2519,8 @@ var runScript = async ({
|
|
|
2482
2519
|
createFileId,
|
|
2483
2520
|
performFileUpload,
|
|
2484
2521
|
getPendingCacheCount,
|
|
2485
|
-
invalidateCache
|
|
2522
|
+
invalidateCache,
|
|
2523
|
+
onConsoleLog
|
|
2486
2524
|
}) => {
|
|
2487
2525
|
const isDebug = isFlagEnabled("script-runner-logging");
|
|
2488
2526
|
let worker;
|
|
@@ -2549,6 +2587,7 @@ var runScript = async ({
|
|
|
2549
2587
|
setSessionData,
|
|
2550
2588
|
pluginComponentId: componentId,
|
|
2551
2589
|
onShowModal,
|
|
2590
|
+
onCloseModal,
|
|
2552
2591
|
onShowCreateRecordModal,
|
|
2553
2592
|
onShowCreateRelatedRecordModal,
|
|
2554
2593
|
onNetworkError,
|
|
@@ -2558,7 +2597,8 @@ var runScript = async ({
|
|
|
2558
2597
|
createFileId,
|
|
2559
2598
|
performFileUpload,
|
|
2560
2599
|
getPendingCacheCount,
|
|
2561
|
-
invalidateCache
|
|
2600
|
+
invalidateCache,
|
|
2601
|
+
onConsoleLog
|
|
2562
2602
|
});
|
|
2563
2603
|
setLoadingState(true);
|
|
2564
2604
|
instance.run(
|
|
@@ -2607,9 +2647,16 @@ var runObjectExpression = async (expression, values) => {
|
|
|
2607
2647
|
return result;
|
|
2608
2648
|
};
|
|
2609
2649
|
|
|
2650
|
+
// src/types/modals.ts
|
|
2651
|
+
var modalSize = {
|
|
2652
|
+
small: 400,
|
|
2653
|
+
medium: 900,
|
|
2654
|
+
large: 1200
|
|
2655
|
+
};
|
|
2656
|
+
|
|
2610
2657
|
// src/index.ts
|
|
2611
|
-
var version = "1.5.
|
|
2658
|
+
var version = "1.5.1-84037f0";
|
|
2612
2659
|
|
|
2613
|
-
export { forceQualifiedUrl, getDisabledValue, getEnabledState, getHash, getLinkValue, getPluginSafeHTML, getQrCodeValue, getStableHash, isFlagEnabled, mergeConfig, pluginMapper, reduceEnabledResults, replaceConfigValues, runExpression, runObjectExpression, runOptionExpression, runScript, runStringExpression, version };
|
|
2614
|
-
//# sourceMappingURL=chunk-
|
|
2615
|
-
//# 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-7CVF5MWG.js.map
|
|
2662
|
+
//# sourceMappingURL=chunk-7CVF5MWG.js.map
|