@kizenapps/engine 0.0.1-b1f3597
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 +674 -0
- package/README.md +160 -0
- package/dist/ThirdPartyScript-DdrF7zh7.d.ts +459 -0
- package/dist/automation-C8hsM_Rc.d.ts +36 -0
- package/dist/chunk-2MW4AGSN.js +2415 -0
- package/dist/chunk-2MW4AGSN.js.map +1 -0
- package/dist/chunk-3LDUYA57.js +61 -0
- package/dist/chunk-3LDUYA57.js.map +1 -0
- package/dist/chunk-5WRI5ZAA.js +29 -0
- package/dist/chunk-5WRI5ZAA.js.map +1 -0
- package/dist/chunk-727AYMPR.js +120 -0
- package/dist/chunk-727AYMPR.js.map +1 -0
- package/dist/chunk-GGGXYD3K.js +40 -0
- package/dist/chunk-GGGXYD3K.js.map +1 -0
- package/dist/chunk-LGJYUPYZ.js +3 -0
- package/dist/chunk-LGJYUPYZ.js.map +1 -0
- package/dist/chunk-NXLAROEM.js +730 -0
- package/dist/chunk-NXLAROEM.js.map +1 -0
- package/dist/chunk-P7GQBCEH.js +172 -0
- package/dist/chunk-P7GQBCEH.js.map +1 -0
- package/dist/chunk-UOTNQL56.js +46 -0
- package/dist/chunk-UOTNQL56.js.map +1 -0
- package/dist/chunk-VYBEGZLN.js +319 -0
- package/dist/chunk-VYBEGZLN.js.map +1 -0
- package/dist/chunk-XKKZPZMB.js +121 -0
- package/dist/chunk-XKKZPZMB.js.map +1 -0
- package/dist/communication.d.ts +13 -0
- package/dist/communication.js +6 -0
- package/dist/communication.js.map +1 -0
- package/dist/contexts/base.d.ts +99 -0
- package/dist/contexts/base.js +7 -0
- package/dist/contexts/base.js.map +1 -0
- package/dist/contexts/floatingFrame.d.ts +18 -0
- package/dist/contexts/floatingFrame.js +8 -0
- package/dist/contexts/floatingFrame.js.map +1 -0
- package/dist/contexts/recordDetail.d.ts +32 -0
- package/dist/contexts/recordDetail.js +8 -0
- package/dist/contexts/recordDetail.js.map +1 -0
- package/dist/floatingFrames-BzaoL7cq.d.ts +8 -0
- package/dist/generic-RiEgdDAq.d.ts +19 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/merge-translations.js +28 -0
- package/dist/react.d.ts +367 -0
- package/dist/react.js +2732 -0
- package/dist/react.js.map +1 -0
- package/dist/routeScript-kttY2YZh.d.ts +303 -0
- package/dist/translation.json +8 -0
- package/dist/types.d.ts +90 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/util.d.ts +40 -0
- package/dist/util.js +87 -0
- package/dist/util.js.map +1 -0
- package/dist/vite.d.ts +11 -0
- package/dist/vite.js +19 -0
- package/dist/vite.js.map +1 -0
- package/dist/workers/calendarSource.worker.d.ts +2 -0
- package/dist/workers/calendarSource.worker.js +62 -0
- package/dist/workers/calendarSource.worker.js.map +1 -0
- package/dist/workers/expression.worker.d.ts +2 -0
- package/dist/workers/expression.worker.js +35 -0
- package/dist/workers/expression.worker.js.map +1 -0
- package/dist/workers/floatingFrame.worker.d.ts +2 -0
- package/dist/workers/floatingFrame.worker.js +57 -0
- package/dist/workers/floatingFrame.worker.js.map +1 -0
- package/dist/workers/generic.worker.d.ts +2 -0
- package/dist/workers/generic.worker.js +57 -0
- package/dist/workers/generic.worker.js.map +1 -0
- package/dist/workers/recordDetail.worker.d.ts +2 -0
- package/dist/workers/recordDetail.worker.js +59 -0
- package/dist/workers/recordDetail.worker.js.map +1 -0
- package/package.json +93 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { W as WorkerContextArgs, P as PartialEntity, a as PartialCustomObject } from '../ThirdPartyScript-DdrF7zh7.js';
|
|
2
|
+
import { BaseWorkerContext } from './base.js';
|
|
3
|
+
import 'react';
|
|
4
|
+
import '../communication.js';
|
|
5
|
+
|
|
6
|
+
declare class RecordDetailWorkerContext extends BaseWorkerContext {
|
|
7
|
+
objectId: string | undefined;
|
|
8
|
+
entityId: string | undefined;
|
|
9
|
+
actionObjectId: string | undefined;
|
|
10
|
+
actionEntityId: string | undefined;
|
|
11
|
+
constructor({ objectId, entityId, actionObjectId, actionEntityId, ...rest }: WorkerContextArgs & {
|
|
12
|
+
objectId?: string;
|
|
13
|
+
entityId?: string;
|
|
14
|
+
actionObjectId?: string;
|
|
15
|
+
actionEntityId?: string;
|
|
16
|
+
});
|
|
17
|
+
currentObject(): Promise<unknown>;
|
|
18
|
+
currentEntity(): Promise<unknown>;
|
|
19
|
+
actionEntity(): Promise<unknown>;
|
|
20
|
+
getFieldValue(entity: PartialEntity, fieldId: string): unknown;
|
|
21
|
+
private getClientEntity;
|
|
22
|
+
protected isClientObject(objectId: string): boolean;
|
|
23
|
+
getEntity(objectId: string, entityId: string): Promise<unknown>;
|
|
24
|
+
getRelatedEntitiesForField(objectId: string, entityId: string, fieldId: string): Promise<unknown[]>;
|
|
25
|
+
private getPipelineEntity;
|
|
26
|
+
private getCustomEntity;
|
|
27
|
+
getObjectDetail(id: string): Promise<PartialCustomObject | undefined>;
|
|
28
|
+
refreshTimeline(): void;
|
|
29
|
+
refreshEntity(): void;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { RecordDetailWorkerContext };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { RecordDetailWorkerContext } from '../chunk-727AYMPR.js';
|
|
2
|
+
import '../chunk-NXLAROEM.js';
|
|
3
|
+
import '../chunk-VYBEGZLN.js';
|
|
4
|
+
import '../chunk-GGGXYD3K.js';
|
|
5
|
+
import '../chunk-P7GQBCEH.js';
|
|
6
|
+
import '../chunk-5WRI5ZAA.js';
|
|
7
|
+
//# sourceMappingURL=recordDetail.js.map
|
|
8
|
+
//# sourceMappingURL=recordDetail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"recordDetail.js"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { C as CommonExecutionPlugin, a as CommonPluginDefinition } from './routeScript-kttY2YZh.js';
|
|
2
|
+
|
|
3
|
+
interface GenericPluginConfig extends CommonPluginDefinition {
|
|
4
|
+
api_name: string;
|
|
5
|
+
callback?: string;
|
|
6
|
+
css?: string;
|
|
7
|
+
event_scripts?: Record<string, string>;
|
|
8
|
+
html?: string;
|
|
9
|
+
iframe_url?: string;
|
|
10
|
+
name: string;
|
|
11
|
+
script?: string;
|
|
12
|
+
type: 'script' | 'iframe' | 'html';
|
|
13
|
+
is_toolbar_item?: boolean;
|
|
14
|
+
toolbar_icon?: string;
|
|
15
|
+
toolbar_color?: string;
|
|
16
|
+
}
|
|
17
|
+
type ExecuteGenericScript = (script: string, args?: Record<string, unknown>, executionPlugin?: CommonExecutionPlugin, overrideContext?: Record<string, unknown>) => Promise<unknown>;
|
|
18
|
+
|
|
19
|
+
export type { ExecuteGenericScript as E, GenericPluginConfig as G };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { U as UnknownJSON, m as SelectOption } from './ThirdPartyScript-DdrF7zh7.js';
|
|
2
|
+
export { n as AppPlugin, o as AppPlugins, A as Args, p as AssistantConfigAction, q as AssistantField, B as BaseAPI, r as BooleanCleanValue, s as BooleanValueStore, t as ButtonConfig, u as CleanValueStore, v as CleanValueStoreType, w as ConfigService, x as CreateRecordModalQueue, y as CreateRelatedRecordModalQueue, C as CurrentUser, z as CurriedDynamicPromptFn, E as CurriedInstallThirdPartyScriptFn, F as CurriedKizenRequestFn, H as CurriedOpenCreateRecordFn, J as CurriedOpenCreateRelatedRecordFn, K as CurriedPostFormDataFn, L as CurriedPromptFn, N as CurriedRefreshEntityFn, O as CurriedUploadFileFn, Q as CustomObjectCleanValue, V as CustomObjectValueStore, D as DataCache, X as DataCacheEntry, Y as DeleteReturnValue, l as DynamicPromptConfig, Z as DynamicPromptFn, _ as EmployeeConfig, $ as ErrorHandler, a0 as ErrorResponse, a1 as FieldCleanValue, a2 as FieldValueStore, G as GetOptions, a3 as GetReturnValue, a4 as InstallThirdPartyScriptFn, I as Instance, h as InternalSessionData, a5 as JSONArray, a6 as JSONObject, a7 as JSONPrimitive, a8 as JSONValue, a9 as KizenConfig, aa as KizenRequestFn, ab as KizenRequestFnHandler, ac as KnownArgs, ad as MatchSetupAssistantField, ae as MaybeMessageError, af as ModalBlock, ag as ModalCancelEventSource, M as ModalConfig, ah as ModalContainer, ai as ModalQueue, aj as NumberCleanValue, ak as NumberValueStore, al as OnNetworkErrorFn, am as OnShowCreateRecordModalFn, an as OnShowCreateRelatedRecordModalFn, ao as OnShowModalFn, ap as OpenCreateRecordFn, aq as OpenCreateRelatedRecordFn, d as PartialBusiness, e as PartialClientObject, a as PartialCustomObject, P as PartialEntity, i as PartialLocation, ar as PartialRelatedObject, c as PartialTeamMember, b as PartialUser, as as PatchReturnValue, f as PostFormDataFn, at as PostFormDataPayload, au as PostReturnValue, av as Profile, aw as PromiseMap, ax as PromiseReject, ay as PromiseResolve, az as PromiseState, aA as PromptFn, g as PromptState, aB as PutReturnValue, aC as RefreshEntityFn, aD as ReleaseBlockingScriptHandler, j as RequestOptions, R as RequestWithErrorsResponse, aE as SelectCleanValue, aF as SelectValueStore, aG as SetInternalSessionDataFn, aH as SetupAssistantConfig, aI as SetupAssistantField, k as ShowToastOptions, S as StateChangePayload, aJ as TextValueStore, aK as UnknownFunction, aL as UploadFileData, aM as UploadFileFn, aN as UserConfig, aO as ValueStore, W as WorkerContextArgs } from './ThirdPartyScript-DdrF7zh7.js';
|
|
3
|
+
import { R as RunScriptOptions } from './routeScript-kttY2YZh.js';
|
|
4
|
+
export { A as AuthorizeEvent, B as BaseEvent, b as CalendarDefinition, c as CalendarScriptReturnData, d as CalendarSourceConfig, e as CalendarSourceMap, f as CalendarSources, C as CommonExecutionPlugin, a as CommonPluginDefinition, g as CommunicateEvent, h as CopyToClipboardEvent, i as CreateFileIdFn, D as DoneEvent, j as DynamicPromptRequestEvent, E as ErrorEvent, k as ExecuteCalendarSourceScript, l as ExecuteFloatingFrameScript, F as FloatingFrameConfig, m as FloatingFrameEmployeeConfig, n as FrameQuadrant, G as GetPendingCacheCountFn, H as HideEvent, I as IframeOutputEvent, o as InstallThirdPartyScriptRequestEvent, p as InvalidateCacheFn, K as KizenFile, M as MessageEventData, q as MinimizedConfig, O as OnClearToastsFn, r as OnNetworkRequestFn, s as OnShowToastFn, t as OpenCreateRecordModalRequestEvent, u as OpenCreateRelatedRecordModalRequestEvent, v as OpenWindowEvent, P as PerformKizenFileUploadFn, w as PostFormDataRequestEvent, x as PromptRequestEvent, Q as QueryRequestEvent, y as RecipientConfig, z as RefreshEntityEvent, J as RefreshTimelineEvent, L as RequestableQueryMethods, N as RoutablePageConfig, S as RouteScriptConfig, T as SchemaValidation, U as SetStateEvent, V as ShowEvent, W as ShowToastEvent, X as TerminatorContent, Y as Terminators, Z as UIOutputEvent, _ as UpdateSessionDataEvent, $ as UploadFilePayload, a0 as UploadFileRequestEvent, a1 as WindowPosition } from './routeScript-kttY2YZh.js';
|
|
5
|
+
export { AsyncFunctionConstructor, BuiltAsyncFn, CreateRecordResponsePayload, CreateRelatedRecordResponsePayload, ExpressionPayload, FunctionWithReturn, InstallThirdPartyScriptResponsePayload, ObjectSettingsMenuItemConfig, PostFormDataResponsePayload, PromptResponsePayload, QueryResponsePayload, RefreshEntityResponsePayload, UploadFileResponsePayload, WorkerEvent, WorkerSetup } from './types.js';
|
|
6
|
+
export { H as HideConfig, S as ShowConfig } from './floatingFrames-BzaoL7cq.js';
|
|
7
|
+
export { E as ExecuteGenericScript, G as GenericPluginConfig } from './generic-RiEgdDAq.js';
|
|
8
|
+
export { A as AutomationStepConfig, D as DataAdornmentConfig, T as ToolbarItemConfig } from './automation-C8hsM_Rc.js';
|
|
9
|
+
import 'react';
|
|
10
|
+
|
|
11
|
+
declare const runScript: ({ scriptBody, user, teamMember, business, onError, onReleaseBlockingScript, setLoadingState, clientObject, scriptUIRef, onStateChange, workerName, context, args, plugin, onShowToast, onClearToasts, terminators, executionPlugin, sessionData, setSessionData, onShowModal, onShowCreateRecordModal, onShowCreateRelatedRecordModal, onNetworkError, onNetworkRequest, appPath, pushHistory, createFileId, performFileUpload, getPendingCacheCount, invalidateCache, }: RunScriptOptions) => Promise<unknown>;
|
|
12
|
+
declare const runExpression: (expression: string, values: UnknownJSON) => Promise<boolean>;
|
|
13
|
+
declare const runStringExpression: (expression: string, values: UnknownJSON) => Promise<string>;
|
|
14
|
+
declare const runOptionExpression: (expression: string, values: UnknownJSON) => Promise<SelectOption[]>;
|
|
15
|
+
declare const runObjectExpression: (expression: string, values: UnknownJSON) => Promise<Record<string, unknown>>;
|
|
16
|
+
|
|
17
|
+
declare const version: string;
|
|
18
|
+
|
|
19
|
+
export { RunScriptOptions, SelectOption, UnknownJSON, runExpression, runObjectExpression, runOptionExpression, runScript, runStringExpression, version };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { runExpression, runObjectExpression, runOptionExpression, runScript, runStringExpression, version } from './chunk-2MW4AGSN.js';
|
|
2
|
+
import './chunk-XKKZPZMB.js';
|
|
3
|
+
import './chunk-P7GQBCEH.js';
|
|
4
|
+
import './chunk-5WRI5ZAA.js';
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Merges this package's translation keys into the consumer app's
|
|
4
|
+
* public/locales/en/translation.json. Run after extract-translations.
|
|
5
|
+
* App strings win over package strings on key conflicts.
|
|
6
|
+
*
|
|
7
|
+
* Usage: merge-plugin-translations [output-path]
|
|
8
|
+
* output-path defaults to public/locales/en/translation.json
|
|
9
|
+
*/
|
|
10
|
+
import { createRequire } from 'module';
|
|
11
|
+
import { readFileSync, writeFileSync, mkdirSync, existsSync } from 'fs';
|
|
12
|
+
import { dirname, resolve } from 'path';
|
|
13
|
+
|
|
14
|
+
const outputPath = resolve(process.cwd(), process.argv[2] ?? 'public/locales/en/translation.json');
|
|
15
|
+
|
|
16
|
+
const require = createRequire(import.meta.url);
|
|
17
|
+
const ownLocale = require('../translation.json');
|
|
18
|
+
|
|
19
|
+
const appLocale = existsSync(outputPath) ? JSON.parse(readFileSync(outputPath, 'utf-8')) : {};
|
|
20
|
+
|
|
21
|
+
const merged = { ...ownLocale, ...appLocale };
|
|
22
|
+
const sorted = Object.fromEntries(Object.entries(merged).sort());
|
|
23
|
+
|
|
24
|
+
mkdirSync(dirname(outputPath), { recursive: true });
|
|
25
|
+
writeFileSync(outputPath, JSON.stringify(sorted, null, 2) + '\n');
|
|
26
|
+
console.log(
|
|
27
|
+
`plugin-engine: merged ${Object.keys(ownLocale).length} translation key(s) into ${outputPath}`,
|
|
28
|
+
);
|
package/dist/react.d.ts
ADDED
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
import { b as CalendarDefinition, d as CalendarSourceConfig, e as CalendarSourceMap, f as CalendarSources, s as OnShowToastFn, k as ExecuteCalendarSourceScript, F as FloatingFrameConfig, l as ExecuteFloatingFrameScript, N as RoutablePageConfig, a1 as WindowPosition, m as FloatingFrameEmployeeConfig, r as OnNetworkRequestFn, i as CreateFileIdFn, P as PerformKizenFileUploadFn, G as GetPendingCacheCountFn, p as InvalidateCacheFn, S as RouteScriptConfig } from './routeScript-kttY2YZh.js';
|
|
2
|
+
import { o as AppPlugins, W as WorkerContextArgs, U as UnknownJSON, b as PartialUser, c as PartialTeamMember, d as PartialBusiness, e as PartialClientObject, ag as ModalCancelEventSource, M as ModalConfig, aH as SetupAssistantConfig, p as AssistantConfigAction, q as AssistantField } from './ThirdPartyScript-DdrF7zh7.js';
|
|
3
|
+
import { G as GenericPluginConfig, E as ExecuteGenericScript } from './generic-RiEgdDAq.js';
|
|
4
|
+
import { RefObject, JSX, ReactNode, FC, SetStateAction } from 'react';
|
|
5
|
+
import './floatingFrames-BzaoL7cq.js';
|
|
6
|
+
|
|
7
|
+
declare const useCalendarOptions: (enabled: boolean, calendarSources: CalendarSources, plugins?: AppPlugins) => {
|
|
8
|
+
calendars: Record<string, {
|
|
9
|
+
calendar: CalendarDefinition;
|
|
10
|
+
source: CalendarSourceConfig;
|
|
11
|
+
}[]>;
|
|
12
|
+
errorServices: (string | undefined)[];
|
|
13
|
+
isLoading: boolean;
|
|
14
|
+
};
|
|
15
|
+
declare const useCalendarEvents: (flatCalendars: {
|
|
16
|
+
calendar: CalendarDefinition;
|
|
17
|
+
source: CalendarSourceConfig;
|
|
18
|
+
}[], params: {
|
|
19
|
+
rangeStart: string;
|
|
20
|
+
rangeEnd: string;
|
|
21
|
+
}, plugins?: AppPlugins) => {
|
|
22
|
+
events: unknown;
|
|
23
|
+
sources: CalendarSourceMap;
|
|
24
|
+
isLoading: boolean;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
interface UseCalendarSourceCustomScriptProps {
|
|
28
|
+
onError: WorkerContextArgs['onError'];
|
|
29
|
+
showToast: OnShowToastFn;
|
|
30
|
+
clearToasts: () => void;
|
|
31
|
+
}
|
|
32
|
+
declare const useCalendarSourceCustomScript: ({ onError, showToast, clearToasts, }: UseCalendarSourceCustomScriptProps) => [ExecuteCalendarSourceScript, {
|
|
33
|
+
pending: boolean;
|
|
34
|
+
}];
|
|
35
|
+
|
|
36
|
+
interface UseFloatingFrameCustomScriptProps {
|
|
37
|
+
onError: WorkerContextArgs['onError'];
|
|
38
|
+
scriptUIRef?: WorkerContextArgs['scriptUIRef'];
|
|
39
|
+
plugin: FloatingFrameConfig;
|
|
40
|
+
onChangeMinimized?: (minimized: boolean) => void;
|
|
41
|
+
}
|
|
42
|
+
declare const useFloatingFrameCustomScript: ({ onError, scriptUIRef, plugin, onChangeMinimized, }: UseFloatingFrameCustomScriptProps) => [ExecuteFloatingFrameScript, {
|
|
43
|
+
pending: boolean;
|
|
44
|
+
hidden: boolean;
|
|
45
|
+
indicator: string;
|
|
46
|
+
triggerHidden?: boolean;
|
|
47
|
+
hideHeader?: boolean;
|
|
48
|
+
}];
|
|
49
|
+
|
|
50
|
+
interface UseGenericPluginCustomScriptProps {
|
|
51
|
+
onError: WorkerContextArgs['onError'];
|
|
52
|
+
scriptUIRef?: WorkerContextArgs['scriptUIRef'];
|
|
53
|
+
plugin?: GenericPluginConfig | undefined;
|
|
54
|
+
}
|
|
55
|
+
declare const useGenericPluginCustomScript: ({ onError, scriptUIRef, plugin, }: UseGenericPluginCustomScriptProps) => [ExecuteGenericScript, {
|
|
56
|
+
pending: boolean;
|
|
57
|
+
}];
|
|
58
|
+
|
|
59
|
+
interface UseRecordDetailCustomScriptProps {
|
|
60
|
+
entityId: string;
|
|
61
|
+
objectId: string;
|
|
62
|
+
onError: WorkerContextArgs['onError'];
|
|
63
|
+
scriptUIRef?: WorkerContextArgs['scriptUIRef'];
|
|
64
|
+
onReleaseBlockingScript?: WorkerContextArgs['onReleaseBlockingScript'];
|
|
65
|
+
}
|
|
66
|
+
declare const useRecordDetailCustomScript: ({ entityId, objectId, onError, scriptUIRef, onReleaseBlockingScript, }: UseRecordDetailCustomScriptProps) => [ExecuteGenericScript, {
|
|
67
|
+
pending: boolean;
|
|
68
|
+
}];
|
|
69
|
+
|
|
70
|
+
interface PluginCustomHTML {
|
|
71
|
+
scopedCss: string;
|
|
72
|
+
sanitizedHtml: string | null;
|
|
73
|
+
outputUIRef: RefObject<HTMLDivElement>;
|
|
74
|
+
interactableScriptRef: RefObject<HTMLDivElement>;
|
|
75
|
+
}
|
|
76
|
+
declare const usePluginCustomHTML: (currentPage?: FloatingFrameConfig | RoutablePageConfig, args?: UnknownJSON) => PluginCustomHTML;
|
|
77
|
+
|
|
78
|
+
type ResetFn = (pluginApiName: string, sourceApiName: string) => void;
|
|
79
|
+
declare const useCalendarSourceReset: () => ResetFn;
|
|
80
|
+
|
|
81
|
+
declare const useManualInteraction: (execute: ExecuteFloatingFrameScript | ExecuteGenericScript, currentPage?: {
|
|
82
|
+
event_scripts?: Record<string, string>;
|
|
83
|
+
}, elementRef?: {
|
|
84
|
+
current: HTMLElement | null;
|
|
85
|
+
}, pending?: boolean, args?: Record<string, unknown>) => void;
|
|
86
|
+
|
|
87
|
+
declare const usePluginCallback: (search: string) => void;
|
|
88
|
+
|
|
89
|
+
interface UsePluginEngineReturn {
|
|
90
|
+
scriptUIRef: React.RefObject<HTMLDivElement>;
|
|
91
|
+
outputUIRef: React.RefObject<HTMLDivElement>;
|
|
92
|
+
scopedCss: string;
|
|
93
|
+
sanitizedHtml: string | null;
|
|
94
|
+
interactableScriptRef: React.RefObject<HTMLDivElement>;
|
|
95
|
+
iframeURL?: string | undefined;
|
|
96
|
+
pending: boolean;
|
|
97
|
+
}
|
|
98
|
+
declare const usePluginPage: (currentPage?: RoutablePageConfig, search?: string, isLoading?: boolean) => UsePluginEngineReturn;
|
|
99
|
+
|
|
100
|
+
interface UseFloatingFrameArgs {
|
|
101
|
+
currentWindow: FloatingFrameConfig;
|
|
102
|
+
pathname: string;
|
|
103
|
+
id: string;
|
|
104
|
+
frameHeaderSize: number;
|
|
105
|
+
defaultPositionGap?: number;
|
|
106
|
+
viewportHeight?: number;
|
|
107
|
+
hiddenByModal?: boolean;
|
|
108
|
+
updateEmployeeConfig?: (id: string, minimized: boolean, windowPosition: WindowPosition | null) => (config: Partial<FloatingFrameEmployeeConfig>) => void;
|
|
109
|
+
}
|
|
110
|
+
interface CircleProps {
|
|
111
|
+
id: string;
|
|
112
|
+
side: 'left' | 'right';
|
|
113
|
+
circleIcon: string;
|
|
114
|
+
CustomIcon: (({ className }: {
|
|
115
|
+
className?: string;
|
|
116
|
+
}) => JSX.Element) | null;
|
|
117
|
+
circleColor: string;
|
|
118
|
+
onClick: () => void;
|
|
119
|
+
hidden: boolean;
|
|
120
|
+
}
|
|
121
|
+
interface UseFloatingFrameResult {
|
|
122
|
+
circleProps: CircleProps;
|
|
123
|
+
parentProps: {
|
|
124
|
+
className: string;
|
|
125
|
+
dragging: boolean;
|
|
126
|
+
hidden: boolean;
|
|
127
|
+
};
|
|
128
|
+
draggableProps: {
|
|
129
|
+
onStop: (_event: unknown, context: {
|
|
130
|
+
node: HTMLElement | null;
|
|
131
|
+
}) => void;
|
|
132
|
+
onStart: () => void;
|
|
133
|
+
bounds: string;
|
|
134
|
+
handle: string;
|
|
135
|
+
defaultPosition: {
|
|
136
|
+
x: number;
|
|
137
|
+
y: number;
|
|
138
|
+
};
|
|
139
|
+
position: {
|
|
140
|
+
x: number;
|
|
141
|
+
y: number;
|
|
142
|
+
};
|
|
143
|
+
disabled: boolean;
|
|
144
|
+
};
|
|
145
|
+
floatProps: {
|
|
146
|
+
pending: boolean;
|
|
147
|
+
width: number;
|
|
148
|
+
dragging: boolean;
|
|
149
|
+
height: number;
|
|
150
|
+
isCircle: boolean;
|
|
151
|
+
};
|
|
152
|
+
contentProps: {
|
|
153
|
+
className: string;
|
|
154
|
+
dragging: boolean;
|
|
155
|
+
solid: boolean;
|
|
156
|
+
};
|
|
157
|
+
minimized: boolean;
|
|
158
|
+
pending: boolean;
|
|
159
|
+
indicator: string;
|
|
160
|
+
hideHeader?: boolean | undefined;
|
|
161
|
+
isFixed: boolean;
|
|
162
|
+
isCircle: boolean;
|
|
163
|
+
outputUIRef: RefObject<HTMLDivElement>;
|
|
164
|
+
scopedCss: string;
|
|
165
|
+
sanitizedHtml: string | null;
|
|
166
|
+
interactableScriptRef: RefObject<HTMLDivElement>;
|
|
167
|
+
tooltipPosition: 'top' | 'left' | 'bottom';
|
|
168
|
+
currentPluginId?: string | undefined;
|
|
169
|
+
setMinimized: (minimized: boolean) => void;
|
|
170
|
+
dragHandleClassName: string;
|
|
171
|
+
height: number;
|
|
172
|
+
script: string | undefined;
|
|
173
|
+
dragging: boolean;
|
|
174
|
+
frameOffset: number;
|
|
175
|
+
scriptUIRef: RefObject<HTMLDivElement> | undefined;
|
|
176
|
+
}
|
|
177
|
+
declare const useFloatingFrame: (params: UseFloatingFrameArgs) => UseFloatingFrameResult;
|
|
178
|
+
|
|
179
|
+
interface AppStateWrapperProps {
|
|
180
|
+
bootstrapPlugins?: {
|
|
181
|
+
id: string;
|
|
182
|
+
api_name: string;
|
|
183
|
+
}[];
|
|
184
|
+
userConfigs?: {
|
|
185
|
+
config: UnknownJSON;
|
|
186
|
+
api_name: string;
|
|
187
|
+
}[];
|
|
188
|
+
children: (context: {
|
|
189
|
+
waitingOnRouteScript: boolean;
|
|
190
|
+
hasFinishedBootstrapping: boolean;
|
|
191
|
+
}) => ReactNode;
|
|
192
|
+
user: PartialUser;
|
|
193
|
+
teamMember: PartialTeamMember;
|
|
194
|
+
business: PartialBusiness;
|
|
195
|
+
clientObject?: PartialClientObject | undefined;
|
|
196
|
+
appPath: string;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
interface HistoryWrapperProps {
|
|
200
|
+
children: React.ReactNode;
|
|
201
|
+
onNavigate: (path: string, options?: {
|
|
202
|
+
replace?: boolean;
|
|
203
|
+
}) => void;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
interface ModalsContextValue {
|
|
207
|
+
modalState: {
|
|
208
|
+
props: {
|
|
209
|
+
show: boolean;
|
|
210
|
+
onConfirm: (values: UnknownJSON) => void;
|
|
211
|
+
onHide: (eventSource: ModalCancelEventSource, ...args: unknown[]) => void;
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
showModal: (config: ModalConfig, cb: () => void) => void;
|
|
215
|
+
showCreateRecordModal: (objectId: string, cb: (result: UnknownJSON) => void) => void;
|
|
216
|
+
showCreateRelatedRecordModal: (objectId: string, relatedEntityId: string, cb: (result: UnknownJSON) => void) => void;
|
|
217
|
+
onCreateRecordComplete: (result: UnknownJSON) => void;
|
|
218
|
+
onCreateRelatedRecordComplete: (result: UnknownJSON) => void;
|
|
219
|
+
}
|
|
220
|
+
interface ExposedModals {
|
|
221
|
+
handleShowModal: ModalsContextValue['showModal'];
|
|
222
|
+
handleShowCreateRecordModal: ModalsContextValue['showCreateRecordModal'];
|
|
223
|
+
handleShowCreateRelatedRecordModal: ModalsContextValue['showCreateRelatedRecordModal'];
|
|
224
|
+
derivedModalState: ModalsContextValue['modalState'] & {
|
|
225
|
+
config: ModalConfig;
|
|
226
|
+
};
|
|
227
|
+
handleCreateRecordComplete: (result: UnknownJSON) => void;
|
|
228
|
+
handleCreateRelatedRecordComplete: (result: UnknownJSON) => void;
|
|
229
|
+
showCreateRecordModal: boolean;
|
|
230
|
+
createRecordModalObjectId: string;
|
|
231
|
+
showCreateRelatedRecordModal: boolean;
|
|
232
|
+
showPluginModal: boolean;
|
|
233
|
+
pluginApiName: string;
|
|
234
|
+
createRelatedRecordModalObjectId: string;
|
|
235
|
+
createRelatedRecordModalRelatedEntityId: string;
|
|
236
|
+
}
|
|
237
|
+
interface ModalWrapperContextArgs {
|
|
238
|
+
showing: boolean;
|
|
239
|
+
show: boolean;
|
|
240
|
+
showPrompt: () => void;
|
|
241
|
+
onConfirm: () => void;
|
|
242
|
+
onHide: (...args: unknown[]) => void;
|
|
243
|
+
children: (modals: ExposedModals) => ReactNode;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
interface Extra {
|
|
247
|
+
error?: unknown;
|
|
248
|
+
workerName: string;
|
|
249
|
+
pluginApiName?: string;
|
|
250
|
+
objectId?: string;
|
|
251
|
+
entityId?: string;
|
|
252
|
+
}
|
|
253
|
+
interface MonitoringWrapperProps {
|
|
254
|
+
monitoringExceptionHelper: (error: Error, extra: {
|
|
255
|
+
extra: Extra;
|
|
256
|
+
}) => void;
|
|
257
|
+
children: React.ReactNode;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
interface ToastWrapperProps {
|
|
261
|
+
children: React.ReactNode;
|
|
262
|
+
showToast: OnShowToastFn;
|
|
263
|
+
clearToasts: () => void;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
interface NetworkWrapperProps {
|
|
267
|
+
children: React.ReactNode;
|
|
268
|
+
performRequest: OnNetworkRequestFn;
|
|
269
|
+
createFileId?: CreateFileIdFn | undefined;
|
|
270
|
+
performFileUpload?: PerformKizenFileUploadFn | undefined;
|
|
271
|
+
getPendingCacheCount?: GetPendingCacheCountFn | undefined;
|
|
272
|
+
invalidateCache?: InvalidateCacheFn | undefined;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
interface AdditionalContextProps {
|
|
276
|
+
showLoadingIndicator: boolean;
|
|
277
|
+
hiddenByModal: boolean;
|
|
278
|
+
hasFinishedBootstrapping: boolean;
|
|
279
|
+
waitingOnRouteScript: boolean;
|
|
280
|
+
}
|
|
281
|
+
interface PluginEngineProviderProps extends Omit<AppStateWrapperProps, 'children'>, Omit<HistoryWrapperProps, 'children'>, Omit<MonitoringWrapperProps, 'children'>, Omit<ToastWrapperProps, 'children'>, Omit<NetworkWrapperProps, 'children'> {
|
|
282
|
+
modal: Omit<ModalWrapperContextArgs, 'children'>;
|
|
283
|
+
children: (props: ExposedModals & AdditionalContextProps) => ReactNode;
|
|
284
|
+
hideFramesOnModal?: boolean;
|
|
285
|
+
t?: (s: string) => string;
|
|
286
|
+
}
|
|
287
|
+
declare const PluginEngineProvider: FC<PluginEngineProviderProps>;
|
|
288
|
+
|
|
289
|
+
declare const PluginBootstrapSuccess: () => null;
|
|
290
|
+
|
|
291
|
+
interface RouteScriptRunnerProps {
|
|
292
|
+
pathname: string;
|
|
293
|
+
routeScripts: RouteScriptConfig[];
|
|
294
|
+
}
|
|
295
|
+
declare const RouteScriptRunner: (props: RouteScriptRunnerProps) => null;
|
|
296
|
+
|
|
297
|
+
interface TemplateAssociation {
|
|
298
|
+
custom_object: {
|
|
299
|
+
id?: string;
|
|
300
|
+
object_name?: string;
|
|
301
|
+
};
|
|
302
|
+
browser_js_action_template: AssistantConfigAction;
|
|
303
|
+
}
|
|
304
|
+
interface SetupAssistantContextValue {
|
|
305
|
+
state: Record<string, unknown>;
|
|
306
|
+
setState: (stateUpdate: SetStateAction<Record<string, UnknownJSON>> | Record<string, UnknownJSON>) => void;
|
|
307
|
+
interpolateValue: (accessor: string) => unknown;
|
|
308
|
+
getNestedFields: () => AssistantField[];
|
|
309
|
+
reInferFieldsForObject: (objectKey: string) => Promise<void>;
|
|
310
|
+
inferencePending: boolean;
|
|
311
|
+
evaluateExpression: (expression: string, key: string) => Promise<unknown>;
|
|
312
|
+
shouldHideField: (key: string) => boolean;
|
|
313
|
+
shouldDisableField: (key: string) => boolean;
|
|
314
|
+
expressionsIdle: boolean;
|
|
315
|
+
getFieldErrorState: (key: string) => {
|
|
316
|
+
message: string | undefined;
|
|
317
|
+
showMessage: boolean;
|
|
318
|
+
error: boolean;
|
|
319
|
+
} | undefined;
|
|
320
|
+
validateForm: () => Promise<{
|
|
321
|
+
isValid: boolean;
|
|
322
|
+
includedKeys: string[];
|
|
323
|
+
}>;
|
|
324
|
+
waitingExpressionCount: number;
|
|
325
|
+
initialExpressionsPending: boolean;
|
|
326
|
+
flattenedFields: AssistantField[];
|
|
327
|
+
flattenedFieldsByKey: Record<string, AssistantField>;
|
|
328
|
+
afterFieldChange: (key: string) => void;
|
|
329
|
+
registerFieldResetter: (key: string, resetFn: () => void) => void;
|
|
330
|
+
disabledKeys: string[];
|
|
331
|
+
}
|
|
332
|
+
interface CustomObjectDetails {
|
|
333
|
+
id: string;
|
|
334
|
+
objectName: string;
|
|
335
|
+
fields: {
|
|
336
|
+
id: string;
|
|
337
|
+
name: string;
|
|
338
|
+
displayName: string;
|
|
339
|
+
}[];
|
|
340
|
+
}
|
|
341
|
+
declare const SetupAssistantController: ({ children, config, value, onStateChange, disabledKeys, templateAssociationsByActionApiName, getObjectByAPIName, getCustomObjectDetails, }: {
|
|
342
|
+
children: React.ReactNode;
|
|
343
|
+
config: SetupAssistantConfig;
|
|
344
|
+
value?: Record<string, UnknownJSON>;
|
|
345
|
+
onStateChange?: (state: Record<string, unknown>) => void;
|
|
346
|
+
templateAssociationsByActionApiName?: Record<string, TemplateAssociation[]>;
|
|
347
|
+
disabledKeys?: string[];
|
|
348
|
+
getObjectByAPIName: (apiName: string) => Promise<{
|
|
349
|
+
id: string;
|
|
350
|
+
object_name: string;
|
|
351
|
+
}[] | undefined>;
|
|
352
|
+
getCustomObjectDetails: (objectId: string) => Promise<CustomObjectDetails>;
|
|
353
|
+
}) => ReactNode;
|
|
354
|
+
declare const useSetupAssistant: () => SetupAssistantContextValue;
|
|
355
|
+
|
|
356
|
+
type TranslationFunction = (s: string) => string;
|
|
357
|
+
interface TranslationWrapperProps {
|
|
358
|
+
children: ReactNode;
|
|
359
|
+
t?: TranslationFunction | undefined;
|
|
360
|
+
}
|
|
361
|
+
interface TranslationContextValue {
|
|
362
|
+
t: TranslationFunction;
|
|
363
|
+
}
|
|
364
|
+
declare const TranslationWrapper: FC<TranslationWrapperProps>;
|
|
365
|
+
declare const useTranslation: () => TranslationContextValue;
|
|
366
|
+
|
|
367
|
+
export { PluginBootstrapSuccess, PluginEngineProvider, RouteScriptRunner, SetupAssistantController, type TranslationFunction, TranslationWrapper, type TranslationWrapperProps, useCalendarEvents, useCalendarOptions, useCalendarSourceCustomScript, useCalendarSourceReset, useFloatingFrame, useFloatingFrameCustomScript, useGenericPluginCustomScript, useManualInteraction, usePluginCallback, usePluginCustomHTML, usePluginPage, useRecordDetailCustomScript, useSetupAssistant, useTranslation };
|