Skip to content

Commit

Permalink
Merge pull request #101 from manu2699/open-forms
Browse files Browse the repository at this point in the history
fetch, addrows types fixe
  • Loading branch information
saravanan10393 authored May 13, 2024
2 parents 768293e + 722717e commit 2984d6c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kissflow/lowcode-client-sdk",
"version": "1.0.26",
"version": "1.0.27",
"description": "JavaScript SDK for developing over the Kissflow lowcode platform",
"types": "dist/index.d.ts",
"files": [
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk/src/form/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Table extends BaseSDK {
});
}

addRows(rows: [object]) {
addRows(rows: object[]) {
return this._postMessageAsync(LISTENER_CMDS.ADD_TABLE_ROWS, {
tableId: this.tableId,
rows
Expand All @@ -86,7 +86,7 @@ class Table extends BaseSDK {
});
}

deleteRows(rows: [string]){
deleteRows(rows: string[]){
return this._postMessageAsync(LISTENER_CMDS.DELETE_TABLE_ROW, {
tableId: this.tableId,
rows
Expand Down
6 changes: 2 additions & 4 deletions packages/sdk/src/lowcode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Application, Page, Component, Popup } from "./app";
import { window } from "./window";

import { SDKContext } from "./types/internal";
import { userObject, accountObject, environmentObject } from "./types/external";
import { userObject, accountObject, environmentObject, FetchOptions } from "./types/external";

class LowcodeSDK extends BaseSDK {
context: Component | Form | TableForm | Page | Popup;
Expand Down Expand Up @@ -48,9 +48,7 @@ class LowcodeSDK extends BaseSDK {
}
async api(
url: string,
args?: {
headers: object;
}
args?: FetchOptions
) {
const response = await globalThis.fetch(url, {
...args,
Expand Down
6 changes: 2 additions & 4 deletions packages/sdk/src/nocode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Client, Formatter } from "./utils";
import { window } from "./window";

import { SDKContext } from "./types/internal";
import { userObject, accountObject } from "./types/external";
import { userObject, accountObject, FetchOptions } from "./types/external";

class NocodeSDK extends BaseSDK {
context: Form | TableForm;
Expand Down Expand Up @@ -35,9 +35,7 @@ class NocodeSDK extends BaseSDK {
}
async api(
url: string,
args?: {
headers: object;
}
args?: FetchOptions
) {
const response = await globalThis.fetch(url, {
...args,
Expand Down
6 changes: 6 additions & 0 deletions packages/sdk/src/types/external.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,10 @@ export type DataformItem = {
export type ProcessItem = {
_id: string;
_activity_instance_id: string;
}

export type FetchOptions = {
method?: string,
body?: string | object;
headers?: object;
}

0 comments on commit 2984d6c

Please sign in to comment.