@kissflow/lowcode-client-sdk 1.0.24 → 1.0.26

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 CHANGED
@@ -48,7 +48,10 @@ declare module "core/constants" {
48
48
  WINDOW_NDEF_READER_ABORT_SCAN: string;
49
49
  DECISION_TABLE_EXECUTE: string;
50
50
  DATAFORM_IMPORT_CSV: string;
51
+ DATAFORM_OPEN_FORM: string;
52
+ PROCESS_OPEN_FORM: string;
51
53
  BOARD_IMPORT_CSV: string;
54
+ BOARD_OPEN_FORM: string;
52
55
  };
53
56
  export const EVENT_TYPES: {
54
57
  COMPONENT_ON_MOUNT: string;
@@ -79,7 +82,7 @@ declare module "core/index" {
79
82
  declare module "utils/client" {
80
83
  import { BaseSDK } from "core/index";
81
84
  export class Client extends BaseSDK {
82
- showInfo(message: string): any;
85
+ showInfo(message: string | object): any;
83
86
  showConfirm(args: {
84
87
  title: string;
85
88
  content: string;
@@ -126,6 +129,16 @@ declare module "types/external" {
126
129
  export type environmentObject = {
127
130
  isMobile: boolean;
128
131
  };
132
+ export type BoardItem = {
133
+ _id: string;
134
+ };
135
+ export type DataformItem = {
136
+ _id: string;
137
+ };
138
+ export type ProcessItem = {
139
+ _id: string;
140
+ _activity_instance_id: string;
141
+ };
129
142
  }
130
143
  declare module "types/internal" {
131
144
  import { userObject, accountObject, environmentObject } from "types/external";
@@ -210,8 +223,8 @@ declare module "app/page" {
210
223
  getParameter(key: string): any;
211
224
  getAllParameters(): any;
212
225
  getVariable(key: string): any;
213
- setVariable(key: string | object, value: any): any;
214
- openPopup(popupId: string, popupParams: object): any;
226
+ setVariable(key: string | object, value?: any): any;
227
+ openPopup(popupId: string, popupParams?: object): any;
215
228
  getComponent(componentId: string): Component;
216
229
  }
217
230
  }
@@ -225,18 +238,31 @@ declare module "app/decisiontable" {
225
238
  }
226
239
  declare module "app/dataform" {
227
240
  import { BaseSDK } from "core/index";
241
+ import { DataformItem } from "types/external";
228
242
  export class Dataform extends BaseSDK {
229
243
  private _id;
230
244
  constructor(flowId: string);
231
- importCSV(defaultValues: object): any;
245
+ importCSV(defaultValues?: object): any;
246
+ openForm(item: DataformItem): any;
232
247
  }
233
248
  }
234
249
  declare module "board/index" {
235
250
  import { BaseSDK } from "core/index";
251
+ import { BoardItem } from "types/external";
236
252
  export class Board extends BaseSDK {
237
253
  private _id;
238
254
  constructor(flowId: string);
239
- importCSV(defaultValues: object): any;
255
+ importCSV(defaultValues?: object): any;
256
+ openForm(item: BoardItem): any;
257
+ }
258
+ }
259
+ declare module "process/index" {
260
+ import { BaseSDK } from "core/index";
261
+ import { ProcessItem } from "types/external";
262
+ export class Process extends BaseSDK {
263
+ private _id;
264
+ constructor(flowId: string);
265
+ openForm(item: ProcessItem): any;
240
266
  }
241
267
  }
242
268
  declare module "app/index" {
@@ -246,16 +272,18 @@ declare module "app/index" {
246
272
  import { DecisionTable } from "app/decisiontable";
247
273
  import { Dataform } from "app/dataform";
248
274
  import { Board } from "board/index";
275
+ import { Process } from "process/index";
249
276
  export class Application extends BaseSDK {
250
277
  page: Page;
251
278
  _id: string;
252
279
  constructor(props: AppContext, isCustomComponent?: boolean);
253
280
  getVariable(key: string): any;
254
281
  setVariable(key: string | object, value?: any): any;
255
- openPage(pageId: string, pageParams: object): any;
282
+ openPage(pageId: string, pageParams?: object): any;
256
283
  getDecisionTable(flowId: string): DecisionTable;
257
284
  getDataform(flowId: string): Dataform;
258
285
  getBoard(flowId: string): Board;
286
+ getProcess(flowId: string): Process;
259
287
  }
260
288
  export * from "app/component";
261
289
  export { Page };
@@ -276,7 +304,7 @@ declare module "index" {
276
304
  formatter: Formatter;
277
305
  env: environmentObject;
278
306
  constructor();
279
- api(url: string, args?: {}): string | object;
307
+ api(url: string, args?: object): string | object;
280
308
  initialize(): any;
281
309
  initialise(): any;
282
310
  }
@@ -83,7 +83,10 @@ const LISTENER_CMDS = {
83
83
  WINDOW_NDEF_READER_ABORT_SCAN: "WINDOW_NDEF_READER_ABORT_SCAN",
84
84
  DECISION_TABLE_EXECUTE: "DECISION_TABLE_EXECUTE",
85
85
  DATAFORM_IMPORT_CSV: "DATAFORM_IMPORT_CSV",
86
- BOARD_IMPORT_CSV: "BOARD_IMPORT_CSV"
86
+ DATAFORM_OPEN_FORM: "DATAFORM_OPEN_FORM",
87
+ PROCESS_OPEN_FORM: "PROCESS_OPEN_FORM",
88
+ BOARD_IMPORT_CSV: "BOARD_IMPORT_CSV",
89
+ BOARD_OPEN_FORM: "BOARD_OPEN_FORM"
87
90
  };
88
91
  const EVENT_TYPES = {
89
92
  COMPONENT_ON_MOUNT: "componentOnMount",
@@ -576,6 +579,17 @@ class Dataform extends BaseSDK {
576
579
  defaultValues
577
580
  });
578
581
  }
582
+ openForm(item) {
583
+ if (!item._id) {
584
+ return Promise.reject({
585
+ message: "Instance Id (_id) is required"
586
+ });
587
+ }
588
+ return this._postMessageAsync(LISTENER_CMDS.DATAFORM_OPEN_FORM, {
589
+ flowId: this._id,
590
+ itemId: item._id
591
+ });
592
+ }
579
593
  }
580
594
  class Board extends BaseSDK {
581
595
  constructor(flowId) {
@@ -588,6 +602,35 @@ class Board extends BaseSDK {
588
602
  defaultValues
589
603
  });
590
604
  }
605
+ openForm(item) {
606
+ if (!item._id) {
607
+ return Promise.reject({
608
+ message: "Instance Id (_id) is required"
609
+ });
610
+ }
611
+ return this._postMessageAsync(LISTENER_CMDS.BOARD_OPEN_FORM, {
612
+ flowId: this._id,
613
+ itemId: item._id
614
+ });
615
+ }
616
+ }
617
+ class Process extends BaseSDK {
618
+ constructor(flowId) {
619
+ super();
620
+ this._id = flowId;
621
+ }
622
+ openForm(item) {
623
+ if (!item._id || !item._activity_instance_id) {
624
+ return Promise.reject({
625
+ message: "Instance Id(_id) and Activity Instance Id(_activity_instance_id) are required"
626
+ });
627
+ }
628
+ return this._postMessageAsync(LISTENER_CMDS.PROCESS_OPEN_FORM, {
629
+ flowId: this._id,
630
+ instanceId: item._id,
631
+ activityInstanceId: item._activity_instance_id
632
+ });
633
+ }
591
634
  }
592
635
  class Application extends BaseSDK {
593
636
  constructor(props, isCustomComponent = false) {
@@ -621,6 +664,9 @@ class Application extends BaseSDK {
621
664
  getBoard(flowId) {
622
665
  return new Board(flowId);
623
666
  }
667
+ getProcess(flowId) {
668
+ return new Process(flowId);
669
+ }
624
670
  }
625
671
  class NDEFReader extends BaseSDK {
626
672
  constructor() {
@@ -79,7 +79,10 @@ const LISTENER_CMDS = {
79
79
  WINDOW_NDEF_READER_ABORT_SCAN: "WINDOW_NDEF_READER_ABORT_SCAN",
80
80
  DECISION_TABLE_EXECUTE: "DECISION_TABLE_EXECUTE",
81
81
  DATAFORM_IMPORT_CSV: "DATAFORM_IMPORT_CSV",
82
- BOARD_IMPORT_CSV: "BOARD_IMPORT_CSV"
82
+ DATAFORM_OPEN_FORM: "DATAFORM_OPEN_FORM",
83
+ PROCESS_OPEN_FORM: "PROCESS_OPEN_FORM",
84
+ BOARD_IMPORT_CSV: "BOARD_IMPORT_CSV",
85
+ BOARD_OPEN_FORM: "BOARD_OPEN_FORM"
83
86
  };
84
87
  function generateId(prefix = "lcncsdk") {
85
88
  return `${prefix}-${nanoid()}`;
package/dist/kfsdk.es.js CHANGED
@@ -83,7 +83,10 @@ const LISTENER_CMDS = {
83
83
  WINDOW_NDEF_READER_ABORT_SCAN: "WINDOW_NDEF_READER_ABORT_SCAN",
84
84
  DECISION_TABLE_EXECUTE: "DECISION_TABLE_EXECUTE",
85
85
  DATAFORM_IMPORT_CSV: "DATAFORM_IMPORT_CSV",
86
- BOARD_IMPORT_CSV: "BOARD_IMPORT_CSV"
86
+ DATAFORM_OPEN_FORM: "DATAFORM_OPEN_FORM",
87
+ PROCESS_OPEN_FORM: "PROCESS_OPEN_FORM",
88
+ BOARD_IMPORT_CSV: "BOARD_IMPORT_CSV",
89
+ BOARD_OPEN_FORM: "BOARD_OPEN_FORM"
87
90
  };
88
91
  const EVENT_TYPES = {
89
92
  COMPONENT_ON_MOUNT: "componentOnMount",
@@ -486,6 +489,17 @@ class Dataform extends BaseSDK {
486
489
  defaultValues
487
490
  });
488
491
  }
492
+ openForm(item) {
493
+ if (!item._id) {
494
+ return Promise.reject({
495
+ message: "Instance Id (_id) is required"
496
+ });
497
+ }
498
+ return this._postMessageAsync(LISTENER_CMDS.DATAFORM_OPEN_FORM, {
499
+ flowId: this._id,
500
+ itemId: item._id
501
+ });
502
+ }
489
503
  }
490
504
  class Board extends BaseSDK {
491
505
  constructor(flowId) {
@@ -498,6 +512,35 @@ class Board extends BaseSDK {
498
512
  defaultValues
499
513
  });
500
514
  }
515
+ openForm(item) {
516
+ if (!item._id) {
517
+ return Promise.reject({
518
+ message: "Instance Id (_id) is required"
519
+ });
520
+ }
521
+ return this._postMessageAsync(LISTENER_CMDS.BOARD_OPEN_FORM, {
522
+ flowId: this._id,
523
+ itemId: item._id
524
+ });
525
+ }
526
+ }
527
+ class Process extends BaseSDK {
528
+ constructor(flowId) {
529
+ super();
530
+ this._id = flowId;
531
+ }
532
+ openForm(item) {
533
+ if (!item._id || !item._activity_instance_id) {
534
+ return Promise.reject({
535
+ message: "Instance Id(_id) and Activity Instance Id(_activity_instance_id) are required"
536
+ });
537
+ }
538
+ return this._postMessageAsync(LISTENER_CMDS.PROCESS_OPEN_FORM, {
539
+ flowId: this._id,
540
+ instanceId: item._id,
541
+ activityInstanceId: item._activity_instance_id
542
+ });
543
+ }
501
544
  }
502
545
  class Application extends BaseSDK {
503
546
  constructor(props, isCustomComponent = false) {
@@ -531,13 +574,16 @@ class Application extends BaseSDK {
531
574
  getBoard(flowId) {
532
575
  return new Board(flowId);
533
576
  }
577
+ getProcess(flowId) {
578
+ return new Process(flowId);
579
+ }
534
580
  }
535
581
  class CustomComponentSDK extends BaseSDK {
536
582
  constructor() {
537
583
  super();
538
584
  }
539
- api(url, args = {}) {
540
- return this._postMessageAsync(LISTENER_CMDS.API, { url, args });
585
+ api(url, args) {
586
+ return this._postMessageAsync(LISTENER_CMDS.API, { url, args: args || {} });
541
587
  }
542
588
  initialize() {
543
589
  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={}){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});
1
+ var g=(r,s,E)=>{if(!s.has(r))throw TypeError("Cannot "+E)};var a=(r,s,E)=>(g(r,s,"read from private field"),E?E.call(r):s.get(r)),d=(r,s,E)=>{if(s.has(r))throw TypeError("Cannot add the same private member more than once");s instanceof WeakSet?s.add(r):s.set(r,E)},l=(r,s,E,N)=>(g(r,s,"write to private field"),N?N.call(r,E):s.set(r,E),E);var y=(r,s,E)=>(g(r,s,"access private method"),E);(function(r,s){typeof exports=="object"&&typeof module!="undefined"?module.exports=s():typeof define=="function"&&define.amd?define(s):(r=typeof globalThis!="undefined"?globalThis:r||self,r.kf=s())})(this,function(){var A,h,M,p,F;"use strict";let r=(_=21)=>crypto.getRandomValues(new Uint8Array(_)).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",DATAFORM_OPEN_FORM:"DATAFORM_OPEN_FORM",PROCESS_OPEN_FORM:"PROCESS_OPEN_FORM",BOARD_IMPORT_CSV:"BOARD_IMPORT_CSV",BOARD_OPEN_FORM:"BOARD_OPEN_FORM"},E={COMPONENT_ON_MOUNT:"componentOnMount",CC_ON_PARAMS_CHANGE:"onCustomComponentParamsChange"},N={POPUP_ID:"ACTIVE_POP_UP"};function I(_="lcncsdk"){return`${_}-${r()}`}const R={};function S(_,e){if(e&&Object.keys(e).length===1&&_.command!==s.API){let t=Object.values(e)[0];return t==="undefined"?void 0:t}else return e}function C(_){globalThis.parent&&globalThis.parent!==globalThis?globalThis.parent.postMessage(_,"*"):globalThis.postMessage(_)}function m(_){if(_.origin!==globalThis.location.origin){const e=_.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 G{constructor(){d(this,A,void 0);l(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 G{_postMessageAsync(e,t,n,i){return new Promise((c,T)=>{const P=I(e.toLowerCase());C({_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=I(e.toLowerCase());C({_id:i,command:e,...t}),n&&this._addEventListener(t.eventName,n)}_postMessageSync(e,t){let n=0,c={_id:I(e.toLowerCase()),command:e,...t},T=new B;T.reset(),T.store(0,n),T.encodeData(1,c),C(T.sab),T.wait(0,n,1e4);let P=T.decodeData(),{_req:o,resp:k}=P,u=S(o,k);if(u!=null&&u.isError)throw new Error(`Error: ${JSON.stringify(u,null,2)}`);return u}}let D;class B{constructor(){d(this,h,void 0);d(this,M,void 0);l(this,h,new TextEncoder),l(this,M,new TextDecoder),D=D||new SharedArrayBuffer(1024*1024),this.sab=D,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,M).decode(e).replaceAll(/\x00/g,"");return JSON.parse(t)}}h=new WeakMap,M=new WeakMap;class w 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 f extends O{constructor(t){super();d(this,p);this._id=t.componentId,this.type="Component",R[this._id]=this,y(this,p,F).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,F=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||N.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 f(t))}}class L 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 f(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})}openForm(e){return e._id?this._postMessageAsync(s.DATAFORM_OPEN_FORM,{flowId:this._id,itemId:e._id}):Promise.reject({message:"Instance Id (_id) is required"})}}class b extends O{constructor(e){super(),this._id=e}importCSV(e){return this._postMessageAsync(s.BOARD_IMPORT_CSV,{flowId:this._id,defaultValues:e})}openForm(e){return e._id?this._postMessageAsync(s.BOARD_OPEN_FORM,{flowId:this._id,itemId:e._id}):Promise.reject({message:"Instance Id (_id) is required"})}}class H extends O{constructor(e){super(),this._id=e}openForm(e){return!e._id||!e._activity_instance_id?Promise.reject({message:"Instance Id(_id) and Activity Instance Id(_activity_instance_id) are required"}):this._postMessageAsync(s.PROCESS_OPEN_FORM,{flowId:this._id,instanceId:e._id,activityInstanceId:e._activity_instance_id})}}class j extends O{constructor(e,t=!1){super(),this._id=e.appId,this.page=new L(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)}getProcess(e){return new H(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 j(e,!0),this.page=new L(e,!0),this.context=new U(e.componentId),this.client=new w,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
@@ -48,7 +48,10 @@ declare module "core/constants" {
48
48
  WINDOW_NDEF_READER_ABORT_SCAN: string;
49
49
  DECISION_TABLE_EXECUTE: string;
50
50
  DATAFORM_IMPORT_CSV: string;
51
+ DATAFORM_OPEN_FORM: string;
52
+ PROCESS_OPEN_FORM: string;
51
53
  BOARD_IMPORT_CSV: string;
54
+ BOARD_OPEN_FORM: string;
52
55
  };
53
56
  export const EVENT_TYPES: {
54
57
  COMPONENT_ON_MOUNT: string;
@@ -114,7 +117,7 @@ declare module "form/index" {
114
117
  declare module "utils/client" {
115
118
  import { BaseSDK } from "core/index";
116
119
  export class Client extends BaseSDK {
117
- showInfo(message: string): any;
120
+ showInfo(message: string | object): any;
118
121
  showConfirm(args: {
119
122
  title: string;
120
123
  content: string;
@@ -161,6 +164,16 @@ declare module "types/external" {
161
164
  export type environmentObject = {
162
165
  isMobile: boolean;
163
166
  };
167
+ export type BoardItem = {
168
+ _id: string;
169
+ };
170
+ export type DataformItem = {
171
+ _id: string;
172
+ };
173
+ export type ProcessItem = {
174
+ _id: string;
175
+ _activity_instance_id: string;
176
+ };
164
177
  }
165
178
  declare module "types/internal" {
166
179
  import { userObject, accountObject, environmentObject } from "types/external";
@@ -245,8 +258,8 @@ declare module "app/page" {
245
258
  getParameter(key: string): any;
246
259
  getAllParameters(): any;
247
260
  getVariable(key: string): any;
248
- setVariable(key: string | object, value: any): any;
249
- openPopup(popupId: string, popupParams: object): any;
261
+ setVariable(key: string | object, value?: any): any;
262
+ openPopup(popupId: string, popupParams?: object): any;
250
263
  getComponent(componentId: string): Component;
251
264
  }
252
265
  }
@@ -260,18 +273,31 @@ declare module "app/decisiontable" {
260
273
  }
261
274
  declare module "app/dataform" {
262
275
  import { BaseSDK } from "core/index";
276
+ import { DataformItem } from "types/external";
263
277
  export class Dataform extends BaseSDK {
264
278
  private _id;
265
279
  constructor(flowId: string);
266
- importCSV(defaultValues: object): any;
280
+ importCSV(defaultValues?: object): any;
281
+ openForm(item: DataformItem): any;
267
282
  }
268
283
  }
269
284
  declare module "board/index" {
270
285
  import { BaseSDK } from "core/index";
286
+ import { BoardItem } from "types/external";
271
287
  export class Board extends BaseSDK {
272
288
  private _id;
273
289
  constructor(flowId: string);
274
- importCSV(defaultValues: object): any;
290
+ importCSV(defaultValues?: object): any;
291
+ openForm(item: BoardItem): any;
292
+ }
293
+ }
294
+ declare module "process/index" {
295
+ import { BaseSDK } from "core/index";
296
+ import { ProcessItem } from "types/external";
297
+ export class Process extends BaseSDK {
298
+ private _id;
299
+ constructor(flowId: string);
300
+ openForm(item: ProcessItem): any;
275
301
  }
276
302
  }
277
303
  declare module "app/index" {
@@ -281,16 +307,18 @@ declare module "app/index" {
281
307
  import { DecisionTable } from "app/decisiontable";
282
308
  import { Dataform } from "app/dataform";
283
309
  import { Board } from "board/index";
310
+ import { Process } from "process/index";
284
311
  export class Application extends BaseSDK {
285
312
  page: Page;
286
313
  _id: string;
287
314
  constructor(props: AppContext, isCustomComponent?: boolean);
288
315
  getVariable(key: string): any;
289
316
  setVariable(key: string | object, value?: any): any;
290
- openPage(pageId: string, pageParams: object): any;
317
+ openPage(pageId: string, pageParams?: object): any;
291
318
  getDecisionTable(flowId: string): DecisionTable;
292
319
  getDataform(flowId: string): Dataform;
293
320
  getBoard(flowId: string): Board;
321
+ getProcess(flowId: string): Process;
294
322
  }
295
323
  export * from "app/component";
296
324
  export { Page };
@@ -331,6 +359,7 @@ declare module "lowcode" {
331
359
  user: userObject;
332
360
  env: environmentObject;
333
361
  account: accountObject;
362
+ eventParameters: any;
334
363
  constructor(props: SDKContext);
335
364
  api(url: string, args?: {
336
365
  headers: object;
@@ -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,25 +62,34 @@ 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: any): any;
66
- openPopup(popupId: string, popupParams: object): any;
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: object): any;
73
+ importCSV(defaultValues?: object): any;
74
+ openForm(item: DataformItem): any;
75
+ }
76
+ declare class Board {
77
+ importCSV(defaultValues?: object): any;
78
+ openForm(item: BoardItem): any;
79
+ }
80
+ declare class Process {
81
+ openForm(item: ProcessItem): any;
74
82
  }
75
83
  declare class Application {
76
84
  page: Page
77
85
  _id: string
78
86
  getVariable(key: string): any;
79
87
  setVariable(key: string | object, value?: any): any;
80
- openPage(pageId: string, pageParams: object): any;
88
+ openPage(pageId: string, pageParams?: object): any;
81
89
  getDecisionTable(flowId: string): DecisionTable;
82
90
  getDataform(flowId: string): Dataform;
83
91
  getBoard(flowId: string): Board;
92
+ getProcess(flowId: string): Process;
84
93
  }
85
94
  declare class kf {
86
95
  static context: Component
@@ -90,7 +99,8 @@ declare class kf {
90
99
  static user: userObject
91
100
  static env: environmentObject
92
101
  static account: accountObject
93
- api(url: string, args?: {
102
+ static eventParameters: any
103
+ static api(url: string, args?: {
94
104
  headers: object;
95
105
  }): Promise<any>;
96
106
  }
@@ -107,4 +117,17 @@ declare type accountObject = {
107
117
 
108
118
  declare type environmentObject = {
109
119
  isMobile: boolean
120
+ }
121
+
122
+ declare type BoardItem = {
123
+ _id: string;
124
+ }
125
+
126
+ declare type DataformItem = {
127
+ _id: string;
128
+ }
129
+
130
+ declare type ProcessItem = {
131
+ _id: string;
132
+ _activity_instance_id: string;
110
133
  }
package/dist/nocode.d.ts CHANGED
@@ -48,7 +48,10 @@ declare module "core/constants" {
48
48
  WINDOW_NDEF_READER_ABORT_SCAN: string;
49
49
  DECISION_TABLE_EXECUTE: string;
50
50
  DATAFORM_IMPORT_CSV: string;
51
+ DATAFORM_OPEN_FORM: string;
52
+ PROCESS_OPEN_FORM: string;
51
53
  BOARD_IMPORT_CSV: string;
54
+ BOARD_OPEN_FORM: string;
52
55
  };
53
56
  export const EVENT_TYPES: {
54
57
  COMPONENT_ON_MOUNT: string;
@@ -114,7 +117,7 @@ declare module "form/index" {
114
117
  declare module "utils/client" {
115
118
  import { BaseSDK } from "core/index";
116
119
  export class Client extends BaseSDK {
117
- showInfo(message: string): any;
120
+ showInfo(message: string | object): any;
118
121
  showConfirm(args: {
119
122
  title: string;
120
123
  content: string;
@@ -170,6 +173,16 @@ declare module "types/external" {
170
173
  export type environmentObject = {
171
174
  isMobile: boolean;
172
175
  };
176
+ export type BoardItem = {
177
+ _id: string;
178
+ };
179
+ export type DataformItem = {
180
+ _id: string;
181
+ };
182
+ export type ProcessItem = {
183
+ _id: string;
184
+ _activity_instance_id: string;
185
+ };
173
186
  }
174
187
  declare module "types/internal" {
175
188
  import { userObject, accountObject, environmentObject } from "types/external";
@@ -221,6 +234,7 @@ declare module "nocode" {
221
234
  formatter: Formatter;
222
235
  user: userObject;
223
236
  account: accountObject;
237
+ eventParameters: any;
224
238
  constructor(props: SDKContext);
225
239
  api(url: string, args?: {
226
240
  headers: object;
@@ -251,10 +265,12 @@ declare module "app/component" {
251
265
  }
252
266
  declare module "app/dataform" {
253
267
  import { BaseSDK } from "core/index";
268
+ import { DataformItem } from "types/external";
254
269
  export class Dataform extends BaseSDK {
255
270
  private _id;
256
271
  constructor(flowId: string);
257
- importCSV(defaultValues: object): any;
272
+ importCSV(defaultValues?: object): any;
273
+ openForm(item: DataformItem): any;
258
274
  }
259
275
  }
260
276
  declare module "app/decisiontable" {
@@ -301,17 +317,28 @@ declare module "app/page" {
301
317
  getParameter(key: string): any;
302
318
  getAllParameters(): any;
303
319
  getVariable(key: string): any;
304
- setVariable(key: string | object, value: any): any;
305
- openPopup(popupId: string, popupParams: object): any;
320
+ setVariable(key: string | object, value?: any): any;
321
+ openPopup(popupId: string, popupParams?: object): any;
306
322
  getComponent(componentId: string): Component;
307
323
  }
308
324
  }
309
325
  declare module "board/index" {
310
326
  import { BaseSDK } from "core/index";
327
+ import { BoardItem } from "types/external";
311
328
  export class Board extends BaseSDK {
312
329
  private _id;
313
330
  constructor(flowId: string);
314
- importCSV(defaultValues: object): any;
331
+ importCSV(defaultValues?: object): any;
332
+ openForm(item: BoardItem): any;
333
+ }
334
+ }
335
+ declare module "process/index" {
336
+ import { BaseSDK } from "core/index";
337
+ import { ProcessItem } from "types/external";
338
+ export class Process extends BaseSDK {
339
+ private _id;
340
+ constructor(flowId: string);
341
+ openForm(item: ProcessItem): any;
315
342
  }
316
343
  }
317
344
  declare module "app/index" {
@@ -321,16 +348,18 @@ declare module "app/index" {
321
348
  import { DecisionTable } from "app/decisiontable";
322
349
  import { Dataform } from "app/dataform";
323
350
  import { Board } from "board/index";
351
+ import { Process } from "process/index";
324
352
  export class Application extends BaseSDK {
325
353
  page: Page;
326
354
  _id: string;
327
355
  constructor(props: AppContext, isCustomComponent?: boolean);
328
356
  getVariable(key: string): any;
329
357
  setVariable(key: string | object, value?: any): any;
330
- openPage(pageId: string, pageParams: object): any;
358
+ openPage(pageId: string, pageParams?: object): any;
331
359
  getDecisionTable(flowId: string): DecisionTable;
332
360
  getDataform(flowId: string): Dataform;
333
361
  getBoard(flowId: string): Board;
362
+ getProcess(flowId: string): Process;
334
363
  }
335
364
  export * from "app/component";
336
365
  export { Page };
@@ -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,8 @@ 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 eventParameters: any
49
+ static api(url: string, args?: {
49
50
  headers: object;
50
51
  }): Promise<any>;
51
52
  }
@@ -62,4 +63,17 @@ declare type accountObject = {
62
63
 
63
64
  declare type environmentObject = {
64
65
  isMobile: boolean
66
+ }
67
+
68
+ declare type BoardItem = {
69
+ _id: string;
70
+ }
71
+
72
+ declare type DataformItem = {
73
+ _id: string;
74
+ }
75
+
76
+ declare type ProcessItem = {
77
+ _id: string;
78
+ _activity_instance_id: string;
65
79
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kissflow/lowcode-client-sdk",
3
- "version": "1.0.24",
3
+ "version": "1.0.26",
4
4
  "description": "JavaScript SDK for developing over the Kissflow lowcode platform",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [