@kissflow/lowcode-client-sdk 1.0.24 → 1.0.25
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/index.d.ts +7 -7
- package/dist/kfsdk.es.js +2 -2
- package/dist/kfsdk.umd.js +1 -1
- package/dist/lowcode.d.ts +6 -6
- package/dist/lowcode.types.d.ts +9 -6
- package/dist/nocode.d.ts +6 -6
- package/dist/nocode.types.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -79,7 +79,7 @@ declare module "core/index" {
|
|
|
79
79
|
declare module "utils/client" {
|
|
80
80
|
import { BaseSDK } from "core/index";
|
|
81
81
|
export class Client extends BaseSDK {
|
|
82
|
-
showInfo(message: string): any;
|
|
82
|
+
showInfo(message: string | object): any;
|
|
83
83
|
showConfirm(args: {
|
|
84
84
|
title: string;
|
|
85
85
|
content: string;
|
|
@@ -210,8 +210,8 @@ declare module "app/page" {
|
|
|
210
210
|
getParameter(key: string): any;
|
|
211
211
|
getAllParameters(): any;
|
|
212
212
|
getVariable(key: string): any;
|
|
213
|
-
setVariable(key: string | object, value
|
|
214
|
-
openPopup(popupId: string, popupParams
|
|
213
|
+
setVariable(key: string | object, value?: any): any;
|
|
214
|
+
openPopup(popupId: string, popupParams?: object): any;
|
|
215
215
|
getComponent(componentId: string): Component;
|
|
216
216
|
}
|
|
217
217
|
}
|
|
@@ -228,7 +228,7 @@ declare module "app/dataform" {
|
|
|
228
228
|
export class Dataform extends BaseSDK {
|
|
229
229
|
private _id;
|
|
230
230
|
constructor(flowId: string);
|
|
231
|
-
importCSV(defaultValues
|
|
231
|
+
importCSV(defaultValues?: object): any;
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
234
|
declare module "board/index" {
|
|
@@ -236,7 +236,7 @@ declare module "board/index" {
|
|
|
236
236
|
export class Board extends BaseSDK {
|
|
237
237
|
private _id;
|
|
238
238
|
constructor(flowId: string);
|
|
239
|
-
importCSV(defaultValues
|
|
239
|
+
importCSV(defaultValues?: object): any;
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
242
|
declare module "app/index" {
|
|
@@ -252,7 +252,7 @@ declare module "app/index" {
|
|
|
252
252
|
constructor(props: AppContext, isCustomComponent?: boolean);
|
|
253
253
|
getVariable(key: string): any;
|
|
254
254
|
setVariable(key: string | object, value?: any): any;
|
|
255
|
-
openPage(pageId: string, pageParams
|
|
255
|
+
openPage(pageId: string, pageParams?: object): any;
|
|
256
256
|
getDecisionTable(flowId: string): DecisionTable;
|
|
257
257
|
getDataform(flowId: string): Dataform;
|
|
258
258
|
getBoard(flowId: string): Board;
|
|
@@ -276,7 +276,7 @@ declare module "index" {
|
|
|
276
276
|
formatter: Formatter;
|
|
277
277
|
env: environmentObject;
|
|
278
278
|
constructor();
|
|
279
|
-
api(url: string, args?:
|
|
279
|
+
api(url: string, args?: object): string | object;
|
|
280
280
|
initialize(): any;
|
|
281
281
|
initialise(): any;
|
|
282
282
|
}
|
package/dist/kfsdk.es.js
CHANGED
|
@@ -536,8 +536,8 @@ class CustomComponentSDK extends BaseSDK {
|
|
|
536
536
|
constructor() {
|
|
537
537
|
super();
|
|
538
538
|
}
|
|
539
|
-
api(url, args
|
|
540
|
-
return this._postMessageAsync(LISTENER_CMDS.API, { url, args });
|
|
539
|
+
api(url, args) {
|
|
540
|
+
return this._postMessageAsync(LISTENER_CMDS.API, { url, args: args || {} });
|
|
541
541
|
}
|
|
542
542
|
initialize() {
|
|
543
543
|
if (globalThis.parent && globalThis.parent === globalThis) {
|
package/dist/kfsdk.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var g=(_,s,E)=>{if(!s.has(_))throw TypeError("Cannot "+E)};var a=(_,s,E)=>(g(_,s,"read from private field"),E?E.call(_):s.get(_)),M=(_,s,E)=>{if(s.has(_))throw TypeError("Cannot add the same private member more than once");s instanceof WeakSet?s.add(_):s.set(_,E)},C=(_,s,E,l)=>(g(_,s,"write to private field"),l?l.call(_,E):s.set(_,E),E);var y=(_,s,E)=>(g(_,s,"access private method"),E);(function(_,s){typeof exports=="object"&&typeof module!="undefined"?module.exports=s():typeof define=="function"&&define.amd?define(s):(_=typeof globalThis!="undefined"?globalThis:_||self,_.kf=s())})(this,function(){var A,h,u,p,G;"use strict";let _=(r=21)=>crypto.getRandomValues(new Uint8Array(r)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),"");const s={API:"API",GET_CONTEXT:"GET_CONTEXT",RETURN:"RETURN",GET_FORM_FIELD:"GET_FORM_FIELD",UPDATE_FORM:"UPDATE_FORM",GET_TABLE:"GET_TABLE",GET_TABLE_ROW:"GET_TABLE_ROW",ADD_TABLE_ROW:"ADD_TABLE_ROW",ADD_TABLE_ROWS:"ADD_TABLE_ROWS",DELETE_TABLE_ROW:"DELETE_TABLE_ROW",TO_JSON:"TO_JSON",GET_TABLE_ROWS:"GET_TABLE_ROWS",MESSAGE:"MESSAGE",CONFIRM:"CONFIRM",ALERT:"ALERT",REDIRECT:"REDIRECT",OPEN_PAGE:"OPEN_PAGE",FORMAT_DATE:"FORMAT_DATE",FORMAT_DATE_TIME:"FORMAT_DATE_TIME",FORMAT_NUMBER:"FORMAT_NUMBER",FORMAT_CURRENCY:"FORMAT_CURRENCY",FORMAT_BOOLEAN:"FORMAT_BOOLEAN",GET_APP_VARIABLE:"GET_APP_VARIABLE",SET_APP_VARIABLE:"SET_APP_VARIABLE",GET_PAGE_VARIABLE:"GET_PAGE_VARIABLE",SET_PAGE_VARIABLE:"SET_PAGE_VARIABLE",GET_PAGE_PARAMS:"GET_PAGE_PARAMS",GET_ALL_PAGE_PARAMS:"GET_ALL_PAGE_PARAMS",PAGE_ON_CLOSE:"PAGE_ON_CLOSE",OPEN_POPUP:"OPEN_POPUP",GET_POPUP_PARAMS:"GET_POPUP_PARAMS",GET_ALL_POPUP_PARAMS:"GET_ALL_POPUP_PARAMS",CLOSE_POPUP:"CLOSE_POPUP",COMPONENT_GET:"COMPONENT_GET",COMPONENT_REFRESH:"COMPONENT_REFRESH",COMPONENT_SHOW:"COMPONENT_SHOW",COMPONENT_HIDE:"COMPONENT_HIDE",COMPONENT_ADD_EVENT_LISTENER:"COMPONENT_ADD_EVENT_LISTENER",CC_INITIALIZE:"CC_INITIALIZE",CC_WATCH_PARAMS:"CC_WATCH_PARAMS",WINDOW_NDEF_READER_NEW:"WINDOW_NDEF_READER_NEW",WINDOW_NDEF_READER_SCAN:"WINDOW_NDEF_READER_SCAN",WINDOW_NDEF_READER_WRITE:"WINDOW_NDEF_READER_WRITE",WINDOW_NDEF_READER_ADD_EVENT_LISTENER:"WINDOW_NDEF_READER_ADD_EVENT_LISTENER",WINDOW_NDEF_READER_MAKE_READONLY:"WINDOW_NDEF_READER_MAKE_READONLY",WINDOW_NDEF_READER_ABORT_SCAN:"WINDOW_NDEF_READER_ABORT_SCAN",DECISION_TABLE_EXECUTE:"DECISION_TABLE_EXECUTE",DATAFORM_IMPORT_CSV:"DATAFORM_IMPORT_CSV",BOARD_IMPORT_CSV:"BOARD_IMPORT_CSV"},E={COMPONENT_ON_MOUNT:"componentOnMount",CC_ON_PARAMS_CHANGE:"onCustomComponentParamsChange"},l={POPUP_ID:"ACTIVE_POP_UP"};function d(r="lcncsdk"){return`${r}-${_()}`}const R={};function S(r,e){if(e&&Object.keys(e).length===1&&r.command!==s.API){let t=Object.values(e)[0];return t==="undefined"?void 0:t}else return e}function D(r){globalThis.parent&&globalThis.parent!==globalThis?globalThis.parent.postMessage(r,"*"):globalThis.postMessage(r)}function m(r){if(r.origin!==globalThis.location.origin){const e=r.data;if(e!=null&&e.isEvent){const{target:i,eventParams:c,eventName:T,eventConfig:P={}}=e;let o=R[i];o._dispatchEvent(T,c),P.once&&o._removeEventListener(T);return}let{_req:t,resp:n}=e;t!=null&&t._id&&R[t._id]._dispatchMessageEvents(t,n)}}globalThis.addEventListener("message",m);class F{constructor(){M(this,A,void 0);C(this,A,{})}_addEventListener(e,t){var n;a(this,A)[e]=((n=a(this,A))==null?void 0:n[e])||[],a(this,A)[e].push(t)}_removeEventListener(e,t){if(t){let n=a(this,A)[e].findIndex(t);n>-1&&a(this,A)[e].splice(n,1);return}Reflect.deleteProperty(a(this,A),e)}_dispatchEvent(e,t){return Array.isArray(a(this,A)[e])?(a(this,A)[e].forEach(n=>n(t)),!0):!1}_dispatchMessageEvents(e,t){let n=e._id;Array.isArray(a(this,A)[n])&&(a(this,A)[n].forEach(i=>{try{let c=S(e,t);i(c)}catch(c){console.error("Message callback error: ",c)}}),this._removeEventListener(n))}}A=new WeakMap;class O extends F{_postMessageAsync(e,t,n,i){return new Promise((c,T)=>{const P=d(e.toLowerCase());D({_id:P,command:e,...t}),R[P]=this,this._addEventListener(P,async o=>{(o==null?void 0:o.errorMessage)||(o==null?void 0:o.isError)?T(o):(n&&i&&(o=await i(o)),c(o))})})}_postMessage(e,t,n){const i=d(e.toLowerCase());D({_id:i,command:e,...t}),n&&this._addEventListener(t.eventName,n)}_postMessageSync(e,t){let n=0,c={_id:d(e.toLowerCase()),command:e,...t},T=new W;T.reset(),T.store(0,n),T.encodeData(1,c),D(T.sab),T.wait(0,n,1e4);let P=T.decodeData(),{_req:o,resp:k}=P,N=S(o,k);if(N!=null&&N.isError)throw new Error(`Error: ${JSON.stringify(N,null,2)}`);return N}}let I;class W{constructor(){M(this,h,void 0);M(this,u,void 0);C(this,h,new TextEncoder),C(this,u,new TextDecoder),I=I||new SharedArrayBuffer(1024*1024),this.sab=I,this.int32Array=new Int32Array(this.sab)}load(e=0){return Atomics.load(this.int32Array,e)}store(e=0,t){return Atomics.store(this.int32Array,e,t)}reset(){return this.int32Array.fill(0)}notify(e=0,t=1){return Atomics.notify(this.int32Array,e,t)}wait(e,t,n){return Atomics.wait(this.int32Array,e,t,n)}encodeData(e=0,t){const n=(T,P)=>P===void 0?"undefined":P;let i=JSON.stringify(t,n),c=a(this,h).encode(i);return this.int32Array.set(c,e),this.int32Array}decodeData(){let e=new Uint8Array(this.int32Array),t=a(this,u).decode(e).replaceAll(/\x00/g,"");return JSON.parse(t)}}h=new WeakMap,u=new WeakMap;class B extends O{showInfo(e){return super._postMessageAsync(s.MESSAGE,{message:e})}showConfirm(e){return super._postMessageAsync(s.CONFIRM,{data:{title:e.title,content:e.content,okText:e.okText||"Ok",cancelText:e.cancelText||"Cancel"}})}redirect(e){return super._postMessageAsync(s.REDIRECT,{url:e})}}class w extends O{toDate(e){return this._postMessageAsync(s.FORMAT_DATE,{date:e})}toDateTime(e){return this._postMessageAsync(s.FORMAT_DATE_TIME,{date:e})}toNumber(e){return this._postMessageAsync(s.FORMAT_NUMBER,{value:e})}toCurrency(e,t){return this._postMessageAsync(s.FORMAT_CURRENCY,{value:e,currencyCode:t})}toBoolean(e){return this._postMessageAsync(s.FORMAT_BOOLEAN,{value:e})}}class L extends O{constructor(t){super();M(this,p);this._id=t.componentId,this.type="Component",R[this._id]=this,y(this,p,G).call(this,t.componentMethods)}onMount(t){this._postMessage(s.COMPONENT_ADD_EVENT_LISTENER,{id:this._id,eventName:E.COMPONENT_ON_MOUNT,eventConfig:{once:!0}},t)}refresh(){return this._postMessageAsync(s.COMPONENT_REFRESH,{id:this._id})}show(){return this._postMessageAsync(s.COMPONENT_SHOW,{id:this._id})}hide(){return this._postMessageAsync(s.COMPONENT_HIDE,{id:this._id})}}p=new WeakSet,G=function(t){t==null||t.forEach(n=>{this[n.name]=(...i)=>{if(n.type==="method")return this._postMessageAsync(`COMPONENT_${n.name}`,{id:this._id,parameters:i});n.type==="event"&&this._postMessage(s.COMPONENT_ADD_EVENT_LISTENER,{id:this._id,eventName:n.name,eventConfig:i[1]},i[0])}})};class U extends O{constructor(e){super(),this._id=e,this.type="CustomComponent",R[this._id]=this}watchParams(e){this._postMessage(s.CC_WATCH_PARAMS,{id:this._id,eventName:E.CC_ON_PARAMS_CHANGE,eventConfig:{once:!1}},e)}}class V extends O{constructor(e){super(),this.type="Popup",this._id=e.popupId||l.POPUP_ID}getParameter(e){return this._postMessageAsync(s.GET_POPUP_PARAMS,{key:e,popupId:this._id})}getAllParameters(){return this._postMessageAsync(s.GET_ALL_POPUP_PARAMS,{popupId:this._id})}close(){return this._postMessageAsync(s.CLOSE_POPUP,{})}getComponent(e){return this._postMessageAsync(s.COMPONENT_GET,{componentId:e},!0,t=>new L(t))}}class f extends O{constructor(e,t=!1){super(),this.type="Page",this.popup=new V({}),this._id=e.pageId}getParameter(e){return this._postMessageAsync(s.GET_PAGE_PARAMS,{key:e})}getAllParameters(){return this._postMessageAsync(s.GET_ALL_PAGE_PARAMS,{pageId:this._id})}getVariable(e){return this._postMessageAsync(s.GET_PAGE_VARIABLE,{key:e})}setVariable(e,t){return this._postMessageAsync(s.SET_PAGE_VARIABLE,{key:e,value:t})}openPopup(e,t){return this._postMessageAsync(s.OPEN_POPUP,{popupId:e,popupParams:t})}getComponent(e){return this._postMessageAsync(s.COMPONENT_GET,{componentId:e},!0,t=>new L(t))}}class v extends O{constructor(e){super(),this.flowId=e}evaluate(e){return this._postMessageAsync(s.DECISION_TABLE_EXECUTE,{flowId:this.flowId,payload:e})}}class x extends O{constructor(e){super(),this._id=e}importCSV(e){return this._postMessageAsync(s.DATAFORM_IMPORT_CSV,{flowId:this._id,defaultValues:e})}}class b extends O{constructor(e){super(),this._id=e}importCSV(e){return this._postMessageAsync(s.BOARD_IMPORT_CSV,{flowId:this._id,defaultValues:e})}}class H extends O{constructor(e,t=!1){super(),this._id=e.appId,this.page=new f(e)}getVariable(e){return this._postMessageAsync(s.GET_APP_VARIABLE,{key:e})}setVariable(e,t){return this._postMessageAsync(s.SET_APP_VARIABLE,{key:e,value:t})}openPage(e,t){return this._postMessageAsync(s.OPEN_PAGE,{pageId:e,pageParams:t})}getDecisionTable(e){return new v(e)}getDataform(e){return new x(e)}getBoard(e){return new b(e)}}class K extends O{constructor(){super()}api(e,t
|
|
1
|
+
var g=(_,s,E)=>{if(!s.has(_))throw TypeError("Cannot "+E)};var a=(_,s,E)=>(g(_,s,"read from private field"),E?E.call(_):s.get(_)),M=(_,s,E)=>{if(s.has(_))throw TypeError("Cannot add the same private member more than once");s instanceof WeakSet?s.add(_):s.set(_,E)},C=(_,s,E,l)=>(g(_,s,"write to private field"),l?l.call(_,E):s.set(_,E),E);var y=(_,s,E)=>(g(_,s,"access private method"),E);(function(_,s){typeof exports=="object"&&typeof module!="undefined"?module.exports=s():typeof define=="function"&&define.amd?define(s):(_=typeof globalThis!="undefined"?globalThis:_||self,_.kf=s())})(this,function(){var A,h,u,p,G;"use strict";let _=(r=21)=>crypto.getRandomValues(new Uint8Array(r)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),"");const s={API:"API",GET_CONTEXT:"GET_CONTEXT",RETURN:"RETURN",GET_FORM_FIELD:"GET_FORM_FIELD",UPDATE_FORM:"UPDATE_FORM",GET_TABLE:"GET_TABLE",GET_TABLE_ROW:"GET_TABLE_ROW",ADD_TABLE_ROW:"ADD_TABLE_ROW",ADD_TABLE_ROWS:"ADD_TABLE_ROWS",DELETE_TABLE_ROW:"DELETE_TABLE_ROW",TO_JSON:"TO_JSON",GET_TABLE_ROWS:"GET_TABLE_ROWS",MESSAGE:"MESSAGE",CONFIRM:"CONFIRM",ALERT:"ALERT",REDIRECT:"REDIRECT",OPEN_PAGE:"OPEN_PAGE",FORMAT_DATE:"FORMAT_DATE",FORMAT_DATE_TIME:"FORMAT_DATE_TIME",FORMAT_NUMBER:"FORMAT_NUMBER",FORMAT_CURRENCY:"FORMAT_CURRENCY",FORMAT_BOOLEAN:"FORMAT_BOOLEAN",GET_APP_VARIABLE:"GET_APP_VARIABLE",SET_APP_VARIABLE:"SET_APP_VARIABLE",GET_PAGE_VARIABLE:"GET_PAGE_VARIABLE",SET_PAGE_VARIABLE:"SET_PAGE_VARIABLE",GET_PAGE_PARAMS:"GET_PAGE_PARAMS",GET_ALL_PAGE_PARAMS:"GET_ALL_PAGE_PARAMS",PAGE_ON_CLOSE:"PAGE_ON_CLOSE",OPEN_POPUP:"OPEN_POPUP",GET_POPUP_PARAMS:"GET_POPUP_PARAMS",GET_ALL_POPUP_PARAMS:"GET_ALL_POPUP_PARAMS",CLOSE_POPUP:"CLOSE_POPUP",COMPONENT_GET:"COMPONENT_GET",COMPONENT_REFRESH:"COMPONENT_REFRESH",COMPONENT_SHOW:"COMPONENT_SHOW",COMPONENT_HIDE:"COMPONENT_HIDE",COMPONENT_ADD_EVENT_LISTENER:"COMPONENT_ADD_EVENT_LISTENER",CC_INITIALIZE:"CC_INITIALIZE",CC_WATCH_PARAMS:"CC_WATCH_PARAMS",WINDOW_NDEF_READER_NEW:"WINDOW_NDEF_READER_NEW",WINDOW_NDEF_READER_SCAN:"WINDOW_NDEF_READER_SCAN",WINDOW_NDEF_READER_WRITE:"WINDOW_NDEF_READER_WRITE",WINDOW_NDEF_READER_ADD_EVENT_LISTENER:"WINDOW_NDEF_READER_ADD_EVENT_LISTENER",WINDOW_NDEF_READER_MAKE_READONLY:"WINDOW_NDEF_READER_MAKE_READONLY",WINDOW_NDEF_READER_ABORT_SCAN:"WINDOW_NDEF_READER_ABORT_SCAN",DECISION_TABLE_EXECUTE:"DECISION_TABLE_EXECUTE",DATAFORM_IMPORT_CSV:"DATAFORM_IMPORT_CSV",BOARD_IMPORT_CSV:"BOARD_IMPORT_CSV"},E={COMPONENT_ON_MOUNT:"componentOnMount",CC_ON_PARAMS_CHANGE:"onCustomComponentParamsChange"},l={POPUP_ID:"ACTIVE_POP_UP"};function d(r="lcncsdk"){return`${r}-${_()}`}const R={};function S(r,e){if(e&&Object.keys(e).length===1&&r.command!==s.API){let t=Object.values(e)[0];return t==="undefined"?void 0:t}else return e}function D(r){globalThis.parent&&globalThis.parent!==globalThis?globalThis.parent.postMessage(r,"*"):globalThis.postMessage(r)}function m(r){if(r.origin!==globalThis.location.origin){const e=r.data;if(e!=null&&e.isEvent){const{target:i,eventParams:c,eventName:T,eventConfig:P={}}=e;let o=R[i];o._dispatchEvent(T,c),P.once&&o._removeEventListener(T);return}let{_req:t,resp:n}=e;t!=null&&t._id&&R[t._id]._dispatchMessageEvents(t,n)}}globalThis.addEventListener("message",m);class F{constructor(){M(this,A,void 0);C(this,A,{})}_addEventListener(e,t){var n;a(this,A)[e]=((n=a(this,A))==null?void 0:n[e])||[],a(this,A)[e].push(t)}_removeEventListener(e,t){if(t){let n=a(this,A)[e].findIndex(t);n>-1&&a(this,A)[e].splice(n,1);return}Reflect.deleteProperty(a(this,A),e)}_dispatchEvent(e,t){return Array.isArray(a(this,A)[e])?(a(this,A)[e].forEach(n=>n(t)),!0):!1}_dispatchMessageEvents(e,t){let n=e._id;Array.isArray(a(this,A)[n])&&(a(this,A)[n].forEach(i=>{try{let c=S(e,t);i(c)}catch(c){console.error("Message callback error: ",c)}}),this._removeEventListener(n))}}A=new WeakMap;class O extends F{_postMessageAsync(e,t,n,i){return new Promise((c,T)=>{const P=d(e.toLowerCase());D({_id:P,command:e,...t}),R[P]=this,this._addEventListener(P,async o=>{(o==null?void 0:o.errorMessage)||(o==null?void 0:o.isError)?T(o):(n&&i&&(o=await i(o)),c(o))})})}_postMessage(e,t,n){const i=d(e.toLowerCase());D({_id:i,command:e,...t}),n&&this._addEventListener(t.eventName,n)}_postMessageSync(e,t){let n=0,c={_id:d(e.toLowerCase()),command:e,...t},T=new W;T.reset(),T.store(0,n),T.encodeData(1,c),D(T.sab),T.wait(0,n,1e4);let P=T.decodeData(),{_req:o,resp:k}=P,N=S(o,k);if(N!=null&&N.isError)throw new Error(`Error: ${JSON.stringify(N,null,2)}`);return N}}let I;class W{constructor(){M(this,h,void 0);M(this,u,void 0);C(this,h,new TextEncoder),C(this,u,new TextDecoder),I=I||new SharedArrayBuffer(1024*1024),this.sab=I,this.int32Array=new Int32Array(this.sab)}load(e=0){return Atomics.load(this.int32Array,e)}store(e=0,t){return Atomics.store(this.int32Array,e,t)}reset(){return this.int32Array.fill(0)}notify(e=0,t=1){return Atomics.notify(this.int32Array,e,t)}wait(e,t,n){return Atomics.wait(this.int32Array,e,t,n)}encodeData(e=0,t){const n=(T,P)=>P===void 0?"undefined":P;let i=JSON.stringify(t,n),c=a(this,h).encode(i);return this.int32Array.set(c,e),this.int32Array}decodeData(){let e=new Uint8Array(this.int32Array),t=a(this,u).decode(e).replaceAll(/\x00/g,"");return JSON.parse(t)}}h=new WeakMap,u=new WeakMap;class B extends O{showInfo(e){return super._postMessageAsync(s.MESSAGE,{message:e})}showConfirm(e){return super._postMessageAsync(s.CONFIRM,{data:{title:e.title,content:e.content,okText:e.okText||"Ok",cancelText:e.cancelText||"Cancel"}})}redirect(e){return super._postMessageAsync(s.REDIRECT,{url:e})}}class w extends O{toDate(e){return this._postMessageAsync(s.FORMAT_DATE,{date:e})}toDateTime(e){return this._postMessageAsync(s.FORMAT_DATE_TIME,{date:e})}toNumber(e){return this._postMessageAsync(s.FORMAT_NUMBER,{value:e})}toCurrency(e,t){return this._postMessageAsync(s.FORMAT_CURRENCY,{value:e,currencyCode:t})}toBoolean(e){return this._postMessageAsync(s.FORMAT_BOOLEAN,{value:e})}}class L extends O{constructor(t){super();M(this,p);this._id=t.componentId,this.type="Component",R[this._id]=this,y(this,p,G).call(this,t.componentMethods)}onMount(t){this._postMessage(s.COMPONENT_ADD_EVENT_LISTENER,{id:this._id,eventName:E.COMPONENT_ON_MOUNT,eventConfig:{once:!0}},t)}refresh(){return this._postMessageAsync(s.COMPONENT_REFRESH,{id:this._id})}show(){return this._postMessageAsync(s.COMPONENT_SHOW,{id:this._id})}hide(){return this._postMessageAsync(s.COMPONENT_HIDE,{id:this._id})}}p=new WeakSet,G=function(t){t==null||t.forEach(n=>{this[n.name]=(...i)=>{if(n.type==="method")return this._postMessageAsync(`COMPONENT_${n.name}`,{id:this._id,parameters:i});n.type==="event"&&this._postMessage(s.COMPONENT_ADD_EVENT_LISTENER,{id:this._id,eventName:n.name,eventConfig:i[1]},i[0])}})};class U extends O{constructor(e){super(),this._id=e,this.type="CustomComponent",R[this._id]=this}watchParams(e){this._postMessage(s.CC_WATCH_PARAMS,{id:this._id,eventName:E.CC_ON_PARAMS_CHANGE,eventConfig:{once:!1}},e)}}class V extends O{constructor(e){super(),this.type="Popup",this._id=e.popupId||l.POPUP_ID}getParameter(e){return this._postMessageAsync(s.GET_POPUP_PARAMS,{key:e,popupId:this._id})}getAllParameters(){return this._postMessageAsync(s.GET_ALL_POPUP_PARAMS,{popupId:this._id})}close(){return this._postMessageAsync(s.CLOSE_POPUP,{})}getComponent(e){return this._postMessageAsync(s.COMPONENT_GET,{componentId:e},!0,t=>new L(t))}}class f extends O{constructor(e,t=!1){super(),this.type="Page",this.popup=new V({}),this._id=e.pageId}getParameter(e){return this._postMessageAsync(s.GET_PAGE_PARAMS,{key:e})}getAllParameters(){return this._postMessageAsync(s.GET_ALL_PAGE_PARAMS,{pageId:this._id})}getVariable(e){return this._postMessageAsync(s.GET_PAGE_VARIABLE,{key:e})}setVariable(e,t){return this._postMessageAsync(s.SET_PAGE_VARIABLE,{key:e,value:t})}openPopup(e,t){return this._postMessageAsync(s.OPEN_POPUP,{popupId:e,popupParams:t})}getComponent(e){return this._postMessageAsync(s.COMPONENT_GET,{componentId:e},!0,t=>new L(t))}}class v extends O{constructor(e){super(),this.flowId=e}evaluate(e){return this._postMessageAsync(s.DECISION_TABLE_EXECUTE,{flowId:this.flowId,payload:e})}}class x extends O{constructor(e){super(),this._id=e}importCSV(e){return this._postMessageAsync(s.DATAFORM_IMPORT_CSV,{flowId:this._id,defaultValues:e})}}class b extends O{constructor(e){super(),this._id=e}importCSV(e){return this._postMessageAsync(s.BOARD_IMPORT_CSV,{flowId:this._id,defaultValues:e})}}class H extends O{constructor(e,t=!1){super(),this._id=e.appId,this.page=new f(e)}getVariable(e){return this._postMessageAsync(s.GET_APP_VARIABLE,{key:e})}setVariable(e,t){return this._postMessageAsync(s.SET_APP_VARIABLE,{key:e,value:t})}openPage(e,t){return this._postMessageAsync(s.OPEN_PAGE,{pageId:e,pageParams:t})}getDecisionTable(e){return new v(e)}getDataform(e){return new x(e)}getBoard(e){return new b(e)}}class K extends O{constructor(){super()}api(e,t){return this._postMessageAsync(s.API,{url:e,args:t||{}})}initialize(){return globalThis.parent&&globalThis.parent===globalThis?Promise.reject("SDK can be initialized only inside the Kissflow platform."):this._postMessageAsync(s.CC_INITIALIZE,{},!0,e=>(this.app=new H(e,!0),this.page=new f(e,!0),this.context=new U(e.componentId),this.client=new B,this.formatter=new w,this.user=e.user,this.account=e.account,this.env=e.envDetails,this))}initialise(){return this.initialize()}}var Y=new K;return Y});
|
package/dist/lowcode.d.ts
CHANGED
|
@@ -114,7 +114,7 @@ declare module "form/index" {
|
|
|
114
114
|
declare module "utils/client" {
|
|
115
115
|
import { BaseSDK } from "core/index";
|
|
116
116
|
export class Client extends BaseSDK {
|
|
117
|
-
showInfo(message: string): any;
|
|
117
|
+
showInfo(message: string | object): any;
|
|
118
118
|
showConfirm(args: {
|
|
119
119
|
title: string;
|
|
120
120
|
content: string;
|
|
@@ -245,8 +245,8 @@ declare module "app/page" {
|
|
|
245
245
|
getParameter(key: string): any;
|
|
246
246
|
getAllParameters(): any;
|
|
247
247
|
getVariable(key: string): any;
|
|
248
|
-
setVariable(key: string | object, value
|
|
249
|
-
openPopup(popupId: string, popupParams
|
|
248
|
+
setVariable(key: string | object, value?: any): any;
|
|
249
|
+
openPopup(popupId: string, popupParams?: object): any;
|
|
250
250
|
getComponent(componentId: string): Component;
|
|
251
251
|
}
|
|
252
252
|
}
|
|
@@ -263,7 +263,7 @@ declare module "app/dataform" {
|
|
|
263
263
|
export class Dataform extends BaseSDK {
|
|
264
264
|
private _id;
|
|
265
265
|
constructor(flowId: string);
|
|
266
|
-
importCSV(defaultValues
|
|
266
|
+
importCSV(defaultValues?: object): any;
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
269
|
declare module "board/index" {
|
|
@@ -271,7 +271,7 @@ declare module "board/index" {
|
|
|
271
271
|
export class Board extends BaseSDK {
|
|
272
272
|
private _id;
|
|
273
273
|
constructor(flowId: string);
|
|
274
|
-
importCSV(defaultValues
|
|
274
|
+
importCSV(defaultValues?: object): any;
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
277
|
declare module "app/index" {
|
|
@@ -287,7 +287,7 @@ declare module "app/index" {
|
|
|
287
287
|
constructor(props: AppContext, isCustomComponent?: boolean);
|
|
288
288
|
getVariable(key: string): any;
|
|
289
289
|
setVariable(key: string | object, value?: any): any;
|
|
290
|
-
openPage(pageId: string, pageParams
|
|
290
|
+
openPage(pageId: string, pageParams?: object): any;
|
|
291
291
|
getDecisionTable(flowId: string): DecisionTable;
|
|
292
292
|
getDataform(flowId: string): Dataform;
|
|
293
293
|
getBoard(flowId: string): Board;
|
package/dist/lowcode.types.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ declare class TableForm {
|
|
|
23
23
|
updateField(args: object): any;
|
|
24
24
|
}
|
|
25
25
|
declare class Client {
|
|
26
|
-
showInfo(message: string): any;
|
|
26
|
+
showInfo(message: string | object): any;
|
|
27
27
|
showConfirm(args: {
|
|
28
28
|
title: string;
|
|
29
29
|
content: string;
|
|
@@ -62,22 +62,25 @@ declare class Page {
|
|
|
62
62
|
getParameter(key: string): any;
|
|
63
63
|
getAllParameters(): any;
|
|
64
64
|
getVariable(key: string): any;
|
|
65
|
-
setVariable(key: string | object, value
|
|
66
|
-
openPopup(popupId: string, popupParams
|
|
65
|
+
setVariable(key: string | object, value?: any): any;
|
|
66
|
+
openPopup(popupId: string, popupParams?: object): any;
|
|
67
67
|
getComponent(componentId: string): Component;
|
|
68
68
|
}
|
|
69
69
|
declare class DecisionTable {
|
|
70
70
|
evaluate(payload?: object): any;
|
|
71
71
|
}
|
|
72
72
|
declare class Dataform {
|
|
73
|
-
importCSV(defaultValues
|
|
73
|
+
importCSV(defaultValues?: object): any;
|
|
74
|
+
}
|
|
75
|
+
declare class Board {
|
|
76
|
+
importCSV(defaultValues?: object): any;
|
|
74
77
|
}
|
|
75
78
|
declare class Application {
|
|
76
79
|
page: Page
|
|
77
80
|
_id: string
|
|
78
81
|
getVariable(key: string): any;
|
|
79
82
|
setVariable(key: string | object, value?: any): any;
|
|
80
|
-
openPage(pageId: string, pageParams
|
|
83
|
+
openPage(pageId: string, pageParams?: object): any;
|
|
81
84
|
getDecisionTable(flowId: string): DecisionTable;
|
|
82
85
|
getDataform(flowId: string): Dataform;
|
|
83
86
|
getBoard(flowId: string): Board;
|
|
@@ -90,7 +93,7 @@ declare class kf {
|
|
|
90
93
|
static user: userObject
|
|
91
94
|
static env: environmentObject
|
|
92
95
|
static account: accountObject
|
|
93
|
-
api(url: string, args?: {
|
|
96
|
+
static api(url: string, args?: {
|
|
94
97
|
headers: object;
|
|
95
98
|
}): Promise<any>;
|
|
96
99
|
}
|
package/dist/nocode.d.ts
CHANGED
|
@@ -114,7 +114,7 @@ declare module "form/index" {
|
|
|
114
114
|
declare module "utils/client" {
|
|
115
115
|
import { BaseSDK } from "core/index";
|
|
116
116
|
export class Client extends BaseSDK {
|
|
117
|
-
showInfo(message: string): any;
|
|
117
|
+
showInfo(message: string | object): any;
|
|
118
118
|
showConfirm(args: {
|
|
119
119
|
title: string;
|
|
120
120
|
content: string;
|
|
@@ -254,7 +254,7 @@ declare module "app/dataform" {
|
|
|
254
254
|
export class Dataform extends BaseSDK {
|
|
255
255
|
private _id;
|
|
256
256
|
constructor(flowId: string);
|
|
257
|
-
importCSV(defaultValues
|
|
257
|
+
importCSV(defaultValues?: object): any;
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
260
|
declare module "app/decisiontable" {
|
|
@@ -301,8 +301,8 @@ declare module "app/page" {
|
|
|
301
301
|
getParameter(key: string): any;
|
|
302
302
|
getAllParameters(): any;
|
|
303
303
|
getVariable(key: string): any;
|
|
304
|
-
setVariable(key: string | object, value
|
|
305
|
-
openPopup(popupId: string, popupParams
|
|
304
|
+
setVariable(key: string | object, value?: any): any;
|
|
305
|
+
openPopup(popupId: string, popupParams?: object): any;
|
|
306
306
|
getComponent(componentId: string): Component;
|
|
307
307
|
}
|
|
308
308
|
}
|
|
@@ -311,7 +311,7 @@ declare module "board/index" {
|
|
|
311
311
|
export class Board extends BaseSDK {
|
|
312
312
|
private _id;
|
|
313
313
|
constructor(flowId: string);
|
|
314
|
-
importCSV(defaultValues
|
|
314
|
+
importCSV(defaultValues?: object): any;
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
317
|
declare module "app/index" {
|
|
@@ -327,7 +327,7 @@ declare module "app/index" {
|
|
|
327
327
|
constructor(props: AppContext, isCustomComponent?: boolean);
|
|
328
328
|
getVariable(key: string): any;
|
|
329
329
|
setVariable(key: string | object, value?: any): any;
|
|
330
|
-
openPage(pageId: string, pageParams
|
|
330
|
+
openPage(pageId: string, pageParams?: object): any;
|
|
331
331
|
getDecisionTable(flowId: string): DecisionTable;
|
|
332
332
|
getDataform(flowId: string): Dataform;
|
|
333
333
|
getBoard(flowId: string): Board;
|
package/dist/nocode.types.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ declare class TableForm {
|
|
|
23
23
|
updateField(args: object): any;
|
|
24
24
|
}
|
|
25
25
|
declare class Client {
|
|
26
|
-
showInfo(message: string): any;
|
|
26
|
+
showInfo(message: string | object): any;
|
|
27
27
|
showConfirm(args: {
|
|
28
28
|
title: string;
|
|
29
29
|
content: string;
|
|
@@ -45,7 +45,7 @@ declare class kf {
|
|
|
45
45
|
static formatter: Formatter
|
|
46
46
|
static user: userObject
|
|
47
47
|
static account: accountObject
|
|
48
|
-
api(url: string, args?: {
|
|
48
|
+
static api(url: string, args?: {
|
|
49
49
|
headers: object;
|
|
50
50
|
}): Promise<any>;
|
|
51
51
|
}
|