@ptkl/sdk 0.1.0
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.cjs.js +18451 -0
- package/dist/index.esm.js +643 -0
- package/dist/index.umd.js +649 -0
- package/dist/package.json +43 -0
- package/dist/types/api/apiUser.d.ts +9 -0
- package/dist/types/api/apps.d.ts +8 -0
- package/dist/types/api/baseClient.d.ts +5 -0
- package/dist/types/api/component.d.ts +22 -0
- package/dist/types/api/forge.d.ts +6 -0
- package/dist/types/api/functions.d.ts +8 -0
- package/dist/types/api/index.d.ts +13 -0
- package/dist/types/api/integrations/invoicing.d.ts +6 -0
- package/dist/types/api/integrations/media.d.ts +17 -0
- package/dist/types/api/integrations/serbiaUtil.d.ts +8 -0
- package/dist/types/api/integrations/vpfr.d.ts +4 -0
- package/dist/types/api/integrations.d.ts +12 -0
- package/dist/types/api/platform.d.ts +39 -0
- package/dist/types/api/ratchet.d.ts +4 -0
- package/dist/types/api/roles.d.ts +8 -0
- package/dist/types/api/sandbox.d.ts +4 -0
- package/dist/types/api/system.d.ts +4 -0
- package/dist/types/api/thunder.d.ts +13 -0
- package/dist/types/api/users.d.ts +5 -0
- package/dist/types/api/workflow.d.ts +4 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/util/detectEnv.d.ts +3 -0
- package/package.json +43 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import BaseClient from "./baseClient";
|
|
2
|
+
export default class Apps extends BaseClient {
|
|
3
|
+
private appType;
|
|
4
|
+
constructor(client: any, appType?: string);
|
|
5
|
+
updateSettings(updateValues: any, ref: string): Promise<any>;
|
|
6
|
+
download(ref: string, version: string): Promise<any>;
|
|
7
|
+
upload(formData: FormData): Promise<any>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import BaseClient from "./baseClient";
|
|
2
|
+
import { AxiosInstance } from "axios";
|
|
3
|
+
export default class Component extends BaseClient {
|
|
4
|
+
private ref;
|
|
5
|
+
constructor(adapter: AxiosInstance, ref: string);
|
|
6
|
+
new(ref: string): this;
|
|
7
|
+
find(filters: any, opts?: any): Promise<any>;
|
|
8
|
+
findOne(filter: any, opts: any): Promise<any>;
|
|
9
|
+
get(uuid: string): Promise<any>;
|
|
10
|
+
update(uuid: string, model: Record<string, any>): Promise<unknown>;
|
|
11
|
+
concurrentUpdate(uuid: string, version: number, model: Record<string, any>): Promise<unknown>;
|
|
12
|
+
create(model: Record<string, any>): Promise<unknown>;
|
|
13
|
+
delete(uuid: string): Promise<unknown>;
|
|
14
|
+
aggregate(payload: any[]): Promise<unknown>;
|
|
15
|
+
settings(): Promise<unknown>;
|
|
16
|
+
saveSettings(settings: any): Promise<unknown>;
|
|
17
|
+
saveTemplatesDist(version: string, sdkVersion: string, engine: string, dist: Record<string, string>): Promise<any>;
|
|
18
|
+
workflow(event: string, input: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
19
|
+
function(name: string, input: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
20
|
+
all(): Promise<any>;
|
|
21
|
+
setup(data: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import BaseClient from "./baseClient";
|
|
2
|
+
export default class Functions extends BaseClient {
|
|
3
|
+
list(): Promise<any>;
|
|
4
|
+
get(ref: string): Promise<any>;
|
|
5
|
+
update(uuid: string, update: any): Promise<any>;
|
|
6
|
+
run(id: string, input: any, query: any): Promise<any>;
|
|
7
|
+
generateSignature(ref: string, env: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import ApiUser from './apiUser';
|
|
2
|
+
import Functions from './functions';
|
|
3
|
+
import Platform from './platform';
|
|
4
|
+
import Roles from './roles';
|
|
5
|
+
import Users from './users';
|
|
6
|
+
declare const _default: {
|
|
7
|
+
ApiUser: typeof ApiUser;
|
|
8
|
+
Functions: typeof Functions;
|
|
9
|
+
Roles: typeof Roles;
|
|
10
|
+
Users: typeof Users;
|
|
11
|
+
Platform: typeof Platform;
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import BaseClient from "../baseClient";
|
|
2
|
+
export default class Invoicing extends BaseClient {
|
|
3
|
+
getSalesInvoices(provider: string, page: number): Promise<import("axios").AxiosResponse<any, any>>;
|
|
4
|
+
acceptPurchaseInvoice(provider: string, id: string, comment: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
5
|
+
request(method: string, endpoint: string, params: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import BaseClient from "../baseClient";
|
|
2
|
+
export default class Media extends BaseClient {
|
|
3
|
+
list(data: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
4
|
+
libraries(): Promise<import("axios").AxiosResponse<any, any>>;
|
|
5
|
+
upload(payload: any): Promise<import("axios").AxiosResponse<any, any> | undefined>;
|
|
6
|
+
delete(data: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
7
|
+
uploadBase64(data: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
8
|
+
getMedia(lib: string, key: string, encoding: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
9
|
+
download(lib: string, key: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
10
|
+
getExifData(lib: string, key: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
11
|
+
html2pdf(lib: string, data: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
12
|
+
createDir(lib: string, path: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
13
|
+
deleteDir(lib: string, path: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
14
|
+
dirs(lib: string, data: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
15
|
+
request(method: string, endpoint: string, params?: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
16
|
+
requestv1(method: string, endpoint: string, params?: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import BaseClient from "../baseClient";
|
|
2
|
+
export default class SerbiaUtil extends BaseClient {
|
|
3
|
+
nsbSearch(params: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
4
|
+
getReceiptFromUrl(url: string, source: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
5
|
+
getContoList(): Promise<import("axios").AxiosResponse<any, any>>;
|
|
6
|
+
services(method: string, endpoint: string, params?: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
7
|
+
request(method: string, endpoint: string, params: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import BaseClient from "./baseClient";
|
|
2
|
+
import { AxiosInstance } from "axios";
|
|
3
|
+
export default class Integrations extends BaseClient {
|
|
4
|
+
private integrations;
|
|
5
|
+
constructor(adapter: AxiosInstance);
|
|
6
|
+
getSerbiaUtilities(): any;
|
|
7
|
+
getMedia(): any;
|
|
8
|
+
getVPFR(): any;
|
|
9
|
+
getInvoicing(): any;
|
|
10
|
+
isInstalled(id: string): Promise<boolean>;
|
|
11
|
+
getInterfaceOf(id: string): any;
|
|
12
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
2
|
+
import Functions from "./functions";
|
|
3
|
+
import Roles from "./roles";
|
|
4
|
+
import APIUser from "./apiUser";
|
|
5
|
+
import Users from "./users";
|
|
6
|
+
import Apps from "./apps";
|
|
7
|
+
import Component from "./component";
|
|
8
|
+
import Integration from "./integrations";
|
|
9
|
+
import Ratchet from "./ratchet";
|
|
10
|
+
import Sandbox from "./sandbox";
|
|
11
|
+
import System from "./system";
|
|
12
|
+
import Workflow from "./workflow";
|
|
13
|
+
import Forge from "./forge";
|
|
14
|
+
export default class Platform {
|
|
15
|
+
private platformClient;
|
|
16
|
+
private integrationsClient;
|
|
17
|
+
constructor(options: {
|
|
18
|
+
project?: string;
|
|
19
|
+
env?: string;
|
|
20
|
+
token?: string;
|
|
21
|
+
host?: string;
|
|
22
|
+
integrationHost?: string;
|
|
23
|
+
});
|
|
24
|
+
setPlatformClient(client: AxiosInstance): void;
|
|
25
|
+
getPlatformClient(): AxiosInstance;
|
|
26
|
+
getPlatformBaseURL(): string;
|
|
27
|
+
apiUser(): APIUser;
|
|
28
|
+
function(): Functions;
|
|
29
|
+
role(): Roles;
|
|
30
|
+
user(): Users;
|
|
31
|
+
app(appType: string): Apps;
|
|
32
|
+
forge(): Forge;
|
|
33
|
+
component(ref: string): Component;
|
|
34
|
+
integrations(): Integration;
|
|
35
|
+
ratchet(): Ratchet;
|
|
36
|
+
sandbox(): Sandbox;
|
|
37
|
+
system(): System;
|
|
38
|
+
workflow(): Workflow;
|
|
39
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import BaseClient from "./baseClient";
|
|
2
|
+
export default class Roles extends BaseClient {
|
|
3
|
+
create(role: any): Promise<any>;
|
|
4
|
+
delete(uuid: string): Promise<any>;
|
|
5
|
+
list(): Promise<any>;
|
|
6
|
+
listPermissions(): Promise<any>;
|
|
7
|
+
edit(permissions: string[], workspaces: string[], level: number, uuid: string): Promise<any>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import BaseClient from "./baseClient";
|
|
2
|
+
export default class Thunder extends BaseClient {
|
|
3
|
+
read(type: string, filters: any, flag: string, options?: any): Promise<any>;
|
|
4
|
+
write(type: string, filters: any, d: any, flag: any): Promise<any>;
|
|
5
|
+
operation(name: string, filters: any, data: any): Promise<any>;
|
|
6
|
+
find(name: string, filters: any): Promise<any>;
|
|
7
|
+
findOne(name: string, filters: any): Promise<any>;
|
|
8
|
+
paginate(name: string, filters: any, options?: any): Promise<any>;
|
|
9
|
+
upsert(name: string, filters: any, data: any): Promise<any>;
|
|
10
|
+
insertOne(name: string, data: any): Promise<any>;
|
|
11
|
+
updateOne(name: string, filters: any, data: any): Promise<any>;
|
|
12
|
+
delete(name: string, filters: any): Promise<any>;
|
|
13
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ptkl/sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"build": "rollup -c"
|
|
6
|
+
},
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": "./dist/index.esm.js",
|
|
13
|
+
"require": "./dist/index.cjs.js",
|
|
14
|
+
"types": "./dist/types/index.d.ts"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"main": "./dist/index.cjs.js",
|
|
18
|
+
"module": "./dist/index.esm.js",
|
|
19
|
+
"types": "./dist/types/index.d.ts",
|
|
20
|
+
"author": "protokol.io",
|
|
21
|
+
"license": "ISC",
|
|
22
|
+
"type": "module",
|
|
23
|
+
"description": "",
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@rollup/plugin-commonjs": "^28.0.2",
|
|
26
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
27
|
+
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
28
|
+
"@rollup/plugin-typescript": "^12.1.2",
|
|
29
|
+
"@types/babel__standalone": "^7.1.9",
|
|
30
|
+
"@types/lodash": "^4.17.13",
|
|
31
|
+
"@types/node": "^22.9.0",
|
|
32
|
+
"rollup": "^4.30.1",
|
|
33
|
+
"rollup-plugin-polyfill-node": "^0.13.0",
|
|
34
|
+
"typescript": "^5.6.3",
|
|
35
|
+
"rollup-plugin-copy": "^3.5.0"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@rollup/plugin-replace": "^6.0.2",
|
|
39
|
+
"axios": "^1.7.7",
|
|
40
|
+
"dom-parser": "^1.1.5",
|
|
41
|
+
"lodash": "^4.17.21"
|
|
42
|
+
}
|
|
43
|
+
}
|