@ptkl/sdk 0.10.1 → 1.0.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.iife.js → index.0.10.js} +1206 -238
- package/dist/index.0.9.js +2849 -0
- package/dist/package.json +12 -7
- package/dist/v0.10/api/component.d.ts +128 -0
- package/dist/v0.10/api/componentUtils.d.ts +7 -0
- package/dist/v0.10/api/index.d.ts +22 -0
- package/dist/v0.10/api/integrations/dms.d.ts +469 -0
- package/dist/v0.10/api/integrations/minimax.d.ts +289 -0
- package/dist/v0.10/api/integrations/payments.d.ts +40 -0
- package/dist/{types → v0.10}/api/integrations.d.ts +2 -0
- package/dist/{types → v0.10}/api/integrationsBaseClient.d.ts +3 -0
- package/dist/{types → v0.10}/api/platform.d.ts +2 -2
- package/dist/v0.10/apiUser.d.ts +9 -0
- package/dist/v0.10/apps.d.ts +8 -0
- package/dist/v0.10/baseClient.d.ts +6 -0
- package/dist/{types/api → v0.10}/component.d.ts +39 -4
- package/dist/v0.10/componentUtils.d.ts +7 -0
- package/dist/v0.10/config.d.ts +14 -0
- package/dist/v0.10/forge.d.ts +7 -0
- package/dist/v0.10/functions.d.ts +23 -0
- package/dist/{index.cjs.js → v0.10/index.cjs.js} +1206 -238
- package/dist/v0.10/index.d.ts +21 -0
- package/dist/{index.esm.js → v0.10/index.esm.js} +1205 -235
- package/dist/{types/api → v0.10}/integrations/dms.d.ts +11 -1
- package/dist/v0.10/integrations/invoicing.d.ts +6 -0
- package/dist/v0.10/integrations/minimax.d.ts +289 -0
- package/dist/v0.10/integrations/payments.d.ts +40 -0
- package/dist/v0.10/integrations/serbiaUtil.d.ts +10 -0
- package/dist/v0.10/integrations/vpfr.d.ts +4 -0
- package/dist/v0.10/integrations.d.ts +22 -0
- package/dist/v0.10/integrationsBaseClient.d.ts +11 -0
- package/dist/v0.10/platform.d.ts +34 -0
- package/dist/v0.10/platformBaseClient.d.ts +27 -0
- package/dist/v0.10/project.d.ts +146 -0
- package/dist/v0.10/ratchet.d.ts +196 -0
- package/dist/v0.10/sandbox.d.ts +14 -0
- package/dist/v0.10/system.d.ts +4 -0
- package/dist/v0.10/thunder.d.ts +13 -0
- package/dist/v0.10/types/component.d.ts +110 -0
- package/dist/{types → v0.10}/types/integrations.d.ts +114 -1
- package/dist/v0.10/users.d.ts +69 -0
- package/dist/v0.10/workflow.d.ts +5 -0
- package/dist/v0.9/api/apiUser.d.ts +9 -0
- package/dist/v0.9/api/apps.d.ts +8 -0
- package/dist/v0.9/api/baseClient.d.ts +6 -0
- package/dist/v0.9/api/component.d.ts +136 -0
- package/dist/v0.9/api/componentUtils.d.ts +7 -0
- package/dist/v0.9/api/config.d.ts +14 -0
- package/dist/v0.9/api/forge.d.ts +7 -0
- package/dist/v0.9/api/functions.d.ts +23 -0
- package/dist/v0.9/api/index.d.ts +24 -0
- package/dist/v0.9/api/integrations/dms.d.ts +419 -0
- package/dist/v0.9/api/integrations/invoicing.d.ts +6 -0
- package/dist/v0.9/api/integrations/minimax.d.ts +289 -0
- package/dist/v0.9/api/integrations/payments.d.ts +40 -0
- package/dist/v0.9/api/integrations/serbiaUtil.d.ts +10 -0
- package/dist/v0.9/api/integrations/vpfr.d.ts +4 -0
- package/dist/v0.9/api/integrations.d.ts +22 -0
- package/dist/v0.9/api/integrationsBaseClient.d.ts +11 -0
- package/dist/v0.9/api/platform.d.ts +34 -0
- package/dist/v0.9/api/platformBaseClient.d.ts +27 -0
- package/dist/v0.9/api/project.d.ts +146 -0
- package/dist/v0.9/api/ratchet.d.ts +196 -0
- package/dist/v0.9/api/sandbox.d.ts +14 -0
- package/dist/v0.9/api/system.d.ts +4 -0
- package/dist/v0.9/api/thunder.d.ts +13 -0
- package/dist/v0.9/api/users.d.ts +69 -0
- package/dist/v0.9/api/workflow.d.ts +5 -0
- package/dist/v0.9/apiUser.d.ts +9 -0
- package/dist/v0.9/apps.d.ts +8 -0
- package/dist/v0.9/baseClient.d.ts +6 -0
- package/dist/v0.9/component.d.ts +128 -0
- package/dist/v0.9/componentUtils.d.ts +7 -0
- package/dist/v0.9/config.d.ts +14 -0
- package/dist/v0.9/forge.d.ts +7 -0
- package/dist/v0.9/functions.d.ts +23 -0
- package/dist/v0.9/index.cjs.js +21811 -0
- package/dist/v0.9/index.d.ts +21 -0
- package/dist/v0.9/index.esm.js +2820 -0
- package/dist/v0.9/integrations/dms.d.ts +469 -0
- package/dist/v0.9/integrations/invoicing.d.ts +6 -0
- package/dist/v0.9/integrations/minimax.d.ts +289 -0
- package/dist/v0.9/integrations/payments.d.ts +40 -0
- package/dist/v0.9/integrations/serbiaUtil.d.ts +10 -0
- package/dist/v0.9/integrations/vpfr.d.ts +4 -0
- package/dist/v0.9/integrations.d.ts +22 -0
- package/dist/v0.9/integrationsBaseClient.d.ts +11 -0
- package/dist/v0.9/platform.d.ts +34 -0
- package/dist/v0.9/platformBaseClient.d.ts +27 -0
- package/dist/v0.9/project.d.ts +146 -0
- package/dist/v0.9/ratchet.d.ts +196 -0
- package/dist/v0.9/sandbox.d.ts +14 -0
- package/dist/v0.9/system.d.ts +4 -0
- package/dist/v0.9/thunder.d.ts +13 -0
- package/dist/v0.9/types/component.d.ts +116 -0
- package/dist/v0.9/types/config.d.ts +11 -0
- package/dist/v0.9/types/integrations.d.ts +321 -0
- package/dist/v0.9/types/project.d.ts +64 -0
- package/dist/v0.9/types/ratchet.d.ts +38 -0
- package/dist/v0.9/types/users.d.ts +66 -0
- package/dist/v0.9/users.d.ts +69 -0
- package/dist/v0.9/util/detectEnv.d.ts +4 -0
- package/dist/v0.9/workflow.d.ts +5 -0
- package/package.json +12 -7
- package/dist/monaco.d.ts +0 -887
- package/dist/types/api/componentUtils.d.ts +0 -5
- package/dist/types/api/index.d.ts +0 -13
- package/dist/types/api/integrations/media.d.ts +0 -17
- package/dist/types/api/integrations/payments.d.ts +0 -7
- package/dist/types/api/roles.d.ts +0 -9
- package/dist/types/index.d.ts +0 -29
- package/dist/types/types/component.d.ts +0 -50
- package/dist/types/types/media.d.ts +0 -103
- /package/dist/{types → v0.10}/api/apiUser.d.ts +0 -0
- /package/dist/{types → v0.10}/api/apps.d.ts +0 -0
- /package/dist/{types → v0.10}/api/baseClient.d.ts +0 -0
- /package/dist/{types → v0.10}/api/config.d.ts +0 -0
- /package/dist/{types → v0.10}/api/forge.d.ts +0 -0
- /package/dist/{types → v0.10}/api/functions.d.ts +0 -0
- /package/dist/{types → v0.10}/api/integrations/invoicing.d.ts +0 -0
- /package/dist/{types → v0.10}/api/integrations/serbiaUtil.d.ts +0 -0
- /package/dist/{types → v0.10}/api/integrations/vpfr.d.ts +0 -0
- /package/dist/{types → v0.10}/api/platformBaseClient.d.ts +0 -0
- /package/dist/{types → v0.10}/api/project.d.ts +0 -0
- /package/dist/{types → v0.10}/api/ratchet.d.ts +0 -0
- /package/dist/{types → v0.10}/api/sandbox.d.ts +0 -0
- /package/dist/{types → v0.10}/api/system.d.ts +0 -0
- /package/dist/{types → v0.10}/api/thunder.d.ts +0 -0
- /package/dist/{types → v0.10}/api/users.d.ts +0 -0
- /package/dist/{types → v0.10}/api/workflow.d.ts +0 -0
- /package/dist/{types → v0.10}/types/config.d.ts +0 -0
- /package/dist/{types → v0.10}/types/project.d.ts +0 -0
- /package/dist/{types → v0.10}/types/ratchet.d.ts +0 -0
- /package/dist/{types → v0.10}/types/users.d.ts +0 -0
- /package/dist/{types → v0.10}/util/detectEnv.d.ts +0 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export interface ProjectModel {
|
|
2
|
+
uuid: string;
|
|
3
|
+
name: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
created_at: string;
|
|
6
|
+
updated_at: string;
|
|
7
|
+
deleted_at?: string | null;
|
|
8
|
+
owner_uuid: string;
|
|
9
|
+
archived: boolean;
|
|
10
|
+
settings?: ProjectSettings;
|
|
11
|
+
}
|
|
12
|
+
export interface ProjectSettings {
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}
|
|
15
|
+
export interface ProjectUser {
|
|
16
|
+
uuid: string;
|
|
17
|
+
name: string;
|
|
18
|
+
email: string;
|
|
19
|
+
roles: string[];
|
|
20
|
+
created_at: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ProjectInvite {
|
|
23
|
+
uuid: string;
|
|
24
|
+
email: string;
|
|
25
|
+
roles: string[];
|
|
26
|
+
status: string;
|
|
27
|
+
created_at: string;
|
|
28
|
+
expires_at: string;
|
|
29
|
+
project_uuid: string;
|
|
30
|
+
}
|
|
31
|
+
export interface Workspace {
|
|
32
|
+
uuid: string;
|
|
33
|
+
name: string;
|
|
34
|
+
description?: string;
|
|
35
|
+
project_uuid: string;
|
|
36
|
+
created_at: string;
|
|
37
|
+
updated_at: string;
|
|
38
|
+
deleted_at?: string | null;
|
|
39
|
+
}
|
|
40
|
+
export interface Template {
|
|
41
|
+
id: string;
|
|
42
|
+
name: string;
|
|
43
|
+
description?: string;
|
|
44
|
+
version: string;
|
|
45
|
+
category?: string;
|
|
46
|
+
tags?: string[];
|
|
47
|
+
author?: string;
|
|
48
|
+
created_at?: string;
|
|
49
|
+
updated_at?: string;
|
|
50
|
+
}
|
|
51
|
+
export interface TemplateInstallation {
|
|
52
|
+
template_id: string;
|
|
53
|
+
workspace_uuid: string;
|
|
54
|
+
version?: string;
|
|
55
|
+
config?: Record<string, any>;
|
|
56
|
+
}
|
|
57
|
+
export interface Transaction {
|
|
58
|
+
uuid: string;
|
|
59
|
+
type: string;
|
|
60
|
+
amount: number;
|
|
61
|
+
status: string;
|
|
62
|
+
created_at: string;
|
|
63
|
+
metadata?: Record<string, any>;
|
|
64
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface RatchetQueryRequest {
|
|
2
|
+
name: string;
|
|
3
|
+
params: any[];
|
|
4
|
+
}
|
|
5
|
+
export interface RatchetQueryResponse<T = any> {
|
|
6
|
+
data: T;
|
|
7
|
+
status: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface RatchetCredentials {
|
|
10
|
+
type: string;
|
|
11
|
+
dsn?: string;
|
|
12
|
+
user?: string;
|
|
13
|
+
password?: string;
|
|
14
|
+
host?: string;
|
|
15
|
+
dbname?: string;
|
|
16
|
+
service_account_json?: string;
|
|
17
|
+
project_id?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface RatchetQuery {
|
|
20
|
+
id: string;
|
|
21
|
+
expression: string;
|
|
22
|
+
}
|
|
23
|
+
export interface RatchetConnection {
|
|
24
|
+
id: string;
|
|
25
|
+
type: string;
|
|
26
|
+
credentials: RatchetCredentials;
|
|
27
|
+
queries?: RatchetQuery[];
|
|
28
|
+
}
|
|
29
|
+
export interface CreateRatchetConnectionRequest {
|
|
30
|
+
id: string;
|
|
31
|
+
type: string;
|
|
32
|
+
credentials: RatchetCredentials;
|
|
33
|
+
}
|
|
34
|
+
export interface InspectQueryRequest {
|
|
35
|
+
name: string;
|
|
36
|
+
query: RatchetQuery;
|
|
37
|
+
params: any[];
|
|
38
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export interface UserModel {
|
|
2
|
+
uuid: string;
|
|
3
|
+
name: string;
|
|
4
|
+
email: string;
|
|
5
|
+
login_at: string;
|
|
6
|
+
credits: number;
|
|
7
|
+
ref: string;
|
|
8
|
+
expires_at: string | null;
|
|
9
|
+
settings: {
|
|
10
|
+
uuid: string;
|
|
11
|
+
CreatedAt: string;
|
|
12
|
+
UpdatedAt: string;
|
|
13
|
+
DeletedAt: string | null;
|
|
14
|
+
user_uuid: string;
|
|
15
|
+
timezone: string;
|
|
16
|
+
two_auth: boolean;
|
|
17
|
+
billing_address: string | null;
|
|
18
|
+
};
|
|
19
|
+
custom_fields: unknown[];
|
|
20
|
+
}
|
|
21
|
+
export interface UserClaims {
|
|
22
|
+
Entity: {
|
|
23
|
+
uuid: string;
|
|
24
|
+
identificator: string;
|
|
25
|
+
name: string;
|
|
26
|
+
};
|
|
27
|
+
Type: string;
|
|
28
|
+
TwoFactor: boolean;
|
|
29
|
+
ProjectUUID: string;
|
|
30
|
+
IsAdmin: boolean;
|
|
31
|
+
Metadata: unknown | null;
|
|
32
|
+
Version: string;
|
|
33
|
+
exp: number;
|
|
34
|
+
}
|
|
35
|
+
export interface Role {
|
|
36
|
+
uuid: string;
|
|
37
|
+
CreatedAt: string;
|
|
38
|
+
UpdatedAt: string;
|
|
39
|
+
DeletedAt: string | null;
|
|
40
|
+
name: string;
|
|
41
|
+
level: number;
|
|
42
|
+
project_uuid: string;
|
|
43
|
+
is_admin: boolean;
|
|
44
|
+
}
|
|
45
|
+
export interface EditRoleRequest {
|
|
46
|
+
permissions: string[];
|
|
47
|
+
workspaces: string[];
|
|
48
|
+
level: number;
|
|
49
|
+
}
|
|
50
|
+
export interface CreateRoleRequest extends EditRoleRequest {
|
|
51
|
+
name: string;
|
|
52
|
+
}
|
|
53
|
+
export interface RoleModel {
|
|
54
|
+
name: string;
|
|
55
|
+
permissions: string[];
|
|
56
|
+
workspaces: string[];
|
|
57
|
+
level: number;
|
|
58
|
+
}
|
|
59
|
+
export interface Permission {
|
|
60
|
+
uuid: string;
|
|
61
|
+
CreatedAt: string;
|
|
62
|
+
UpdatedAt: string;
|
|
63
|
+
DeletedAt: string | null;
|
|
64
|
+
action: string;
|
|
65
|
+
role_uuid: string;
|
|
66
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import PlatformBaseClient from "./platformBaseClient";
|
|
2
|
+
import { UserClaims, UserModel, Role, CreateRoleRequest, EditRoleRequest, RoleModel, Permission } from "./types/users";
|
|
3
|
+
import { AxiosResponse } from "axios";
|
|
4
|
+
export default class Users extends PlatformBaseClient {
|
|
5
|
+
auth(username: string, password: string, project: string): Promise<AxiosResponse<any>>;
|
|
6
|
+
/**
|
|
7
|
+
* Resend confirmation email
|
|
8
|
+
* @param email User email
|
|
9
|
+
*/
|
|
10
|
+
resendConfirmationEmail(email: string): Promise<AxiosResponse<any>>;
|
|
11
|
+
/**
|
|
12
|
+
* Request password reset email
|
|
13
|
+
* This only sends an email with a reset link, does not expose or change passwords
|
|
14
|
+
* @param email User email
|
|
15
|
+
*/
|
|
16
|
+
requestPasswordReset(email: string): Promise<AxiosResponse<any>>;
|
|
17
|
+
/**
|
|
18
|
+
* Get current user's model
|
|
19
|
+
*/
|
|
20
|
+
getUser(): Promise<AxiosResponse<UserModel>>;
|
|
21
|
+
/**
|
|
22
|
+
* Get current user's claims
|
|
23
|
+
*/
|
|
24
|
+
getClaims(): Promise<AxiosResponse<UserClaims>>;
|
|
25
|
+
/**
|
|
26
|
+
* Edit user profile
|
|
27
|
+
* @param data Profile update data
|
|
28
|
+
*/
|
|
29
|
+
editProfile(data: any): Promise<AxiosResponse<any>>;
|
|
30
|
+
/**
|
|
31
|
+
* Get user permissions
|
|
32
|
+
*/
|
|
33
|
+
getPermissions(): Promise<AxiosResponse<Permission[]>>;
|
|
34
|
+
/**
|
|
35
|
+
* Get list of available permissions
|
|
36
|
+
*/
|
|
37
|
+
listPermissions(): Promise<AxiosResponse<Permission[]>>;
|
|
38
|
+
/**
|
|
39
|
+
* Create a new role
|
|
40
|
+
* @param role Role data including name, permissions, workspaces, and level
|
|
41
|
+
*/
|
|
42
|
+
createRole(role: CreateRoleRequest): Promise<AxiosResponse<Role>>;
|
|
43
|
+
/**
|
|
44
|
+
* Delete a role
|
|
45
|
+
* @param uuid Role UUID
|
|
46
|
+
*/
|
|
47
|
+
deleteRole(uuid: string): Promise<AxiosResponse<{
|
|
48
|
+
status: boolean;
|
|
49
|
+
}>>;
|
|
50
|
+
/**
|
|
51
|
+
* List all roles
|
|
52
|
+
*/
|
|
53
|
+
listRoles(): Promise<AxiosResponse<Role[]>>;
|
|
54
|
+
/**
|
|
55
|
+
* Get role details by UUID
|
|
56
|
+
* @param uuid Role UUID
|
|
57
|
+
*/
|
|
58
|
+
getRoleModel(uuid: string): Promise<AxiosResponse<RoleModel>>;
|
|
59
|
+
/**
|
|
60
|
+
* Edit a role
|
|
61
|
+
* @param uuid Role UUID
|
|
62
|
+
* @param data Role update data including permissions, workspaces, and level
|
|
63
|
+
*/
|
|
64
|
+
editRole(uuid: string, data: EditRoleRequest): Promise<AxiosResponse<Role>>;
|
|
65
|
+
/**
|
|
66
|
+
* @deprecated Use getPermissions() instead
|
|
67
|
+
*/
|
|
68
|
+
permissions(): Promise<AxiosResponse<any>>;
|
|
69
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import PlatformBaseClient from "./platformBaseClient";
|
|
2
|
+
export default class Workflow extends PlatformBaseClient {
|
|
3
|
+
trigger(id: string, event: string, data: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
4
|
+
publish(event: string, data: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
5
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ptkl/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "rollup -c",
|
|
6
6
|
"build:monaco": "npm run build && node scripts/generate-monaco-types.cjs",
|
|
@@ -11,14 +11,19 @@
|
|
|
11
11
|
],
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
|
-
"import": "./dist/index.esm.js",
|
|
15
|
-
"require": "./dist/index.cjs.js",
|
|
16
|
-
"types": "./dist/
|
|
14
|
+
"import": "./dist/v0.9/index.esm.js",
|
|
15
|
+
"require": "./dist/v0.9/index.cjs.js",
|
|
16
|
+
"types": "./dist/v0.9/index.d.ts"
|
|
17
|
+
},
|
|
18
|
+
"./beta": {
|
|
19
|
+
"import": "./dist/v0.10/index.esm.js",
|
|
20
|
+
"require": "./dist/v0.10/index.cjs.js",
|
|
21
|
+
"types": "./dist/v0.10/index.d.ts"
|
|
17
22
|
}
|
|
18
23
|
},
|
|
19
|
-
"main": "./dist/index.cjs.js",
|
|
20
|
-
"module": "./dist/index.esm.js",
|
|
21
|
-
"types": "./dist/
|
|
24
|
+
"main": "./dist/v0.10/index.cjs.js",
|
|
25
|
+
"module": "./dist/v0.10/index.esm.js",
|
|
26
|
+
"types": "./dist/v0.10/index.d.ts",
|
|
22
27
|
"author": "protokol.io",
|
|
23
28
|
"license": "ISC",
|
|
24
29
|
"type": "module",
|