@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,196 @@
|
|
|
1
|
+
import PlatformBaseClient from "./platformBaseClient";
|
|
2
|
+
import { AxiosResponse } from "axios";
|
|
3
|
+
import { RatchetQueryResponse, RatchetConnection, CreateRatchetConnectionRequest, InspectQueryRequest } from "./types/ratchet";
|
|
4
|
+
export default class Ratchet extends PlatformBaseClient {
|
|
5
|
+
/**
|
|
6
|
+
* Get all database connections for the current project
|
|
7
|
+
*
|
|
8
|
+
* @returns List of all configured ratchet connections
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const ratchet = new Ratchet();
|
|
13
|
+
* const connections = await ratchet.getConnections();
|
|
14
|
+
* console.log(connections.data); // Array of connections
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
getConnections(): Promise<AxiosResponse<RatchetConnection[]>>;
|
|
18
|
+
/**
|
|
19
|
+
* Get a specific database connection by ID
|
|
20
|
+
*
|
|
21
|
+
* @param id - Connection ID
|
|
22
|
+
* @returns Connection details including queries
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* const ratchet = new Ratchet();
|
|
27
|
+
* const connection = await ratchet.getConnection('users_db');
|
|
28
|
+
* console.log(connection.data.queries); // Available queries for this connection
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
getConnection(id: string): Promise<AxiosResponse<RatchetConnection>>;
|
|
32
|
+
/**
|
|
33
|
+
* Create a new database connection
|
|
34
|
+
*
|
|
35
|
+
* Supports multiple database types:
|
|
36
|
+
* - MySQL: Use credentials with host, dbname, user, password
|
|
37
|
+
* - PostgreSQL: Use credentials with host, dbname, user, password
|
|
38
|
+
* - MongoDB: Use DSN connection string
|
|
39
|
+
* - BigQuery: Use service_account_json and project_id
|
|
40
|
+
*
|
|
41
|
+
* @param connection - Connection configuration
|
|
42
|
+
* @returns Created connection details
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```typescript
|
|
46
|
+
* const ratchet = new Ratchet();
|
|
47
|
+
*
|
|
48
|
+
* // MySQL/PostgreSQL connection
|
|
49
|
+
* await ratchet.createConnection({
|
|
50
|
+
* id: 'users_db',
|
|
51
|
+
* type: 'MySQL',
|
|
52
|
+
* credentials: {
|
|
53
|
+
* type: 'Credentials',
|
|
54
|
+
* host: 'localhost',
|
|
55
|
+
* dbname: 'users',
|
|
56
|
+
* user: 'admin',
|
|
57
|
+
* password: 'secret'
|
|
58
|
+
* }
|
|
59
|
+
* });
|
|
60
|
+
*
|
|
61
|
+
* // MongoDB connection
|
|
62
|
+
* await ratchet.createConnection({
|
|
63
|
+
* id: 'mongo_db',
|
|
64
|
+
* type: 'MongoDB',
|
|
65
|
+
* credentials: {
|
|
66
|
+
* type: 'DSN',
|
|
67
|
+
* dsn: 'mongodb://localhost:27017/mydb'
|
|
68
|
+
* }
|
|
69
|
+
* });
|
|
70
|
+
*
|
|
71
|
+
* // BigQuery connection
|
|
72
|
+
* await ratchet.createConnection({
|
|
73
|
+
* id: 'analytics_bq',
|
|
74
|
+
* type: 'BigQuery',
|
|
75
|
+
* credentials: {
|
|
76
|
+
* type: 'ServiceAccount',
|
|
77
|
+
* service_account_json: '{"type":"service_account",...}',
|
|
78
|
+
* project_id: 'my-project-id'
|
|
79
|
+
* }
|
|
80
|
+
* });
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
createConnection(connection: CreateRatchetConnectionRequest): Promise<AxiosResponse<RatchetConnection>>;
|
|
84
|
+
/**
|
|
85
|
+
* Update an existing database connection
|
|
86
|
+
*
|
|
87
|
+
* @param connection - Updated connection configuration
|
|
88
|
+
* @returns Success status
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```typescript
|
|
92
|
+
* const ratchet = new Ratchet();
|
|
93
|
+
* await ratchet.updateConnection({
|
|
94
|
+
* id: 'users_db',
|
|
95
|
+
* type: 'postgres',
|
|
96
|
+
* credentials: {
|
|
97
|
+
* type: 'postgres',
|
|
98
|
+
* host: 'localhost',
|
|
99
|
+
* dbname: 'users',
|
|
100
|
+
* user: 'admin',
|
|
101
|
+
* password: 'new_secret'
|
|
102
|
+
* },
|
|
103
|
+
* queries: [
|
|
104
|
+
* { id: 'get_user', expression: 'SELECT * FROM users WHERE id = $1' }
|
|
105
|
+
* ]
|
|
106
|
+
* });
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
updateConnection(connection: RatchetConnection): Promise<AxiosResponse<{
|
|
110
|
+
status: boolean;
|
|
111
|
+
}>>;
|
|
112
|
+
/**
|
|
113
|
+
* Delete a database connection
|
|
114
|
+
*
|
|
115
|
+
* @param id - Connection ID to delete
|
|
116
|
+
* @returns Success status
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```typescript
|
|
120
|
+
* const ratchet = new Ratchet();
|
|
121
|
+
* await ratchet.deleteConnection('users_db');
|
|
122
|
+
* ```
|
|
123
|
+
*/
|
|
124
|
+
deleteConnection(id: string): Promise<AxiosResponse<{
|
|
125
|
+
status: boolean;
|
|
126
|
+
}>>;
|
|
127
|
+
/**
|
|
128
|
+
* Test a database connection without saving it
|
|
129
|
+
*
|
|
130
|
+
* @param connection - Connection configuration to test
|
|
131
|
+
* @returns Success status if connection is valid
|
|
132
|
+
*
|
|
133
|
+
* @example
|
|
134
|
+
* ```typescript
|
|
135
|
+
* const ratchet = new Ratchet();
|
|
136
|
+
* const isValid = await ratchet.testConnection({
|
|
137
|
+
* id: 'test_db',
|
|
138
|
+
* type: 'postgres',
|
|
139
|
+
* credentials: {
|
|
140
|
+
* type: 'postgres',
|
|
141
|
+
* host: 'localhost',
|
|
142
|
+
* dbname: 'test',
|
|
143
|
+
* user: 'admin',
|
|
144
|
+
* password: 'secret'
|
|
145
|
+
* }
|
|
146
|
+
* });
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
testConnection(connection: RatchetConnection): Promise<AxiosResponse<{
|
|
150
|
+
status: boolean;
|
|
151
|
+
}>>;
|
|
152
|
+
/**
|
|
153
|
+
* Execute a predefined database query
|
|
154
|
+
*
|
|
155
|
+
* Runs a query that has been previously configured in a ratchet connection.
|
|
156
|
+
* The query is identified by a qualified name in the format: `connectionId.queryId`
|
|
157
|
+
*
|
|
158
|
+
* @param name - Qualified name of the query (format: `connectionId.queryId`)
|
|
159
|
+
* @param params - Array of parameters to pass to the query
|
|
160
|
+
* @returns Query execution results
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* ```typescript
|
|
164
|
+
* const ratchet = new Ratchet();
|
|
165
|
+
*
|
|
166
|
+
* // Execute a query with parameters
|
|
167
|
+
* const result = await ratchet.query('users_db.get_user_by_id', [123]);
|
|
168
|
+
*
|
|
169
|
+
* // Execute a query without parameters
|
|
170
|
+
* const allUsers = await ratchet.query('users_db.get_all_users', []);
|
|
171
|
+
* ```
|
|
172
|
+
*/
|
|
173
|
+
query<T = any>(name: string, params: any[] | Record<string, any>): Promise<AxiosResponse<RatchetQueryResponse<T>>>;
|
|
174
|
+
/**
|
|
175
|
+
* Inspect and execute a custom query without saving it
|
|
176
|
+
*
|
|
177
|
+
* This allows you to test queries before saving them to a connection.
|
|
178
|
+
*
|
|
179
|
+
* @param request - Query inspection request with connection name, query, and params
|
|
180
|
+
* @returns Query execution results
|
|
181
|
+
*
|
|
182
|
+
* @example
|
|
183
|
+
* ```typescript
|
|
184
|
+
* const ratchet = new Ratchet();
|
|
185
|
+
* const result = await ratchet.inspectQuery({
|
|
186
|
+
* name: 'users_db.test_query',
|
|
187
|
+
* query: {
|
|
188
|
+
* id: 'test_query',
|
|
189
|
+
* expression: 'SELECT * FROM users WHERE email = $1'
|
|
190
|
+
* },
|
|
191
|
+
* params: ['user@example.com']
|
|
192
|
+
* });
|
|
193
|
+
* ```
|
|
194
|
+
*/
|
|
195
|
+
inspectQuery<T = any>(request: InspectQueryRequest): Promise<AxiosResponse<RatchetQueryResponse<T>>>;
|
|
196
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import PlatformBaseClient from "./platformBaseClient";
|
|
2
|
+
export default class Sandbox extends PlatformBaseClient {
|
|
3
|
+
/**
|
|
4
|
+
* Call the sandbox service to execute a serverless function
|
|
5
|
+
*
|
|
6
|
+
* @param name
|
|
7
|
+
* @param data
|
|
8
|
+
* @returns
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const result = await platform.sandbox().spark("myFunction", { foo: "bar" })
|
|
12
|
+
*/
|
|
13
|
+
spark(name: string, data: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import PlatformBaseClient from "./platformBaseClient";
|
|
2
|
+
export default class Thunder extends PlatformBaseClient {
|
|
3
|
+
read(type: string, filters: any, flag: string, options?: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
4
|
+
write(type: string, filters: any, d: any, flag: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
5
|
+
operation(name: string, filters: any, data: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
6
|
+
find(name: string, filters: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
7
|
+
findOne(name: string, filters: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
8
|
+
paginate(name: string, filters: any, options?: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
9
|
+
upsert(name: string, filters: any, data: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
10
|
+
insertOne(name: string, data: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
11
|
+
updateOne(name: string, filters: any, data: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
12
|
+
delete(name: string, filters: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
type FindParams = {
|
|
2
|
+
currentPage?: number;
|
|
3
|
+
perPage?: number;
|
|
4
|
+
sortBy?: string;
|
|
5
|
+
sortDesc?: boolean;
|
|
6
|
+
filterOn?: string[];
|
|
7
|
+
filter?: any;
|
|
8
|
+
disabled?: any;
|
|
9
|
+
dateFrom?: string;
|
|
10
|
+
dateTo?: string;
|
|
11
|
+
dateField?: string;
|
|
12
|
+
$adv?: FindAdvancedParams;
|
|
13
|
+
$aggregate?: FindAggregateParams[];
|
|
14
|
+
};
|
|
15
|
+
type FindOptions = {
|
|
16
|
+
cache?: boolean;
|
|
17
|
+
buildttl?: number;
|
|
18
|
+
locale?: string;
|
|
19
|
+
unmaskPasswords?: boolean;
|
|
20
|
+
};
|
|
21
|
+
type FindResponse = {
|
|
22
|
+
items: Model[];
|
|
23
|
+
total: number;
|
|
24
|
+
page: number;
|
|
25
|
+
pages: number;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Callback function for processing each document in a stream
|
|
29
|
+
* @param document - A single model document from the stream
|
|
30
|
+
*/
|
|
31
|
+
type StreamCallback = (document: Model) => void | Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Streaming response handler
|
|
34
|
+
*/
|
|
35
|
+
type StreamHandler = {
|
|
36
|
+
onData: StreamCallback;
|
|
37
|
+
onError?: (error: Error) => void;
|
|
38
|
+
onEnd?: () => void;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Chainable aggregate result that supports both buffered and streaming modes
|
|
42
|
+
*/
|
|
43
|
+
type AggregateChainable = {
|
|
44
|
+
onData: (callback: StreamCallback) => AggregateChainable;
|
|
45
|
+
onError: (callback: (error: Error) => void) => AggregateChainable;
|
|
46
|
+
onEnd: (callback: () => void) => AggregateChainable;
|
|
47
|
+
then: <T>(resolve?: (value: any) => T, reject?: (error: any) => any) => Promise<T>;
|
|
48
|
+
catch: (reject: (error: any) => any) => Promise<any>;
|
|
49
|
+
};
|
|
50
|
+
type FindAdvancedParams = {
|
|
51
|
+
[key: string]: any;
|
|
52
|
+
};
|
|
53
|
+
type FindAggregateParams = {
|
|
54
|
+
[key: string]: any;
|
|
55
|
+
};
|
|
56
|
+
type Model = {
|
|
57
|
+
uuid: string;
|
|
58
|
+
__version__: number;
|
|
59
|
+
created_at: string;
|
|
60
|
+
updated_at: string;
|
|
61
|
+
created_by: string;
|
|
62
|
+
updated_by: string;
|
|
63
|
+
deleted_at: string;
|
|
64
|
+
deleted_by: string;
|
|
65
|
+
[key: string]: any;
|
|
66
|
+
};
|
|
67
|
+
type UpdateOptions = {
|
|
68
|
+
force_update_protected_fields: boolean;
|
|
69
|
+
};
|
|
70
|
+
type ModifyOptions = {
|
|
71
|
+
upsert: boolean;
|
|
72
|
+
};
|
|
73
|
+
type ComponentOptions = {
|
|
74
|
+
version?: string;
|
|
75
|
+
};
|
|
76
|
+
type ComponentLabel = {
|
|
77
|
+
locales: Record<string, string>;
|
|
78
|
+
};
|
|
79
|
+
type ComponentWorkspace = {
|
|
80
|
+
uuid: string;
|
|
81
|
+
CreatedAt: string;
|
|
82
|
+
UpdatedAt: string;
|
|
83
|
+
DeletedAt: string | null;
|
|
84
|
+
workspace_uuid: string;
|
|
85
|
+
component_uuid: string;
|
|
86
|
+
};
|
|
87
|
+
type ComponentListItem = {
|
|
88
|
+
uuid: string;
|
|
89
|
+
CreatedAt: string;
|
|
90
|
+
UpdatedAt: string;
|
|
91
|
+
DeletedAt: string | null;
|
|
92
|
+
name: string;
|
|
93
|
+
label: ComponentLabel;
|
|
94
|
+
tag: string;
|
|
95
|
+
icon: string | null;
|
|
96
|
+
is_active: boolean;
|
|
97
|
+
is_public: boolean;
|
|
98
|
+
visible: boolean;
|
|
99
|
+
project_uuid: string;
|
|
100
|
+
scope: string;
|
|
101
|
+
sort: number;
|
|
102
|
+
public_version: string;
|
|
103
|
+
dev_version: string;
|
|
104
|
+
versions: string[] | null;
|
|
105
|
+
dependencies: string[];
|
|
106
|
+
workspaces: ComponentWorkspace[];
|
|
107
|
+
storage_size: number;
|
|
108
|
+
};
|
|
109
|
+
type ComponentListResponse = ComponentListItem[];
|
|
110
|
+
export { FindParams, FindOptions, FindResponse, FindAdvancedParams, FindAggregateParams, Model, UpdateOptions, ModifyOptions, ComponentOptions, ComponentListResponse, ComponentListItem, ComponentLabel, ComponentWorkspace, StreamCallback, StreamHandler, AggregateChainable, };
|
|
@@ -52,7 +52,7 @@ export type PDFFillOptions = {
|
|
|
52
52
|
forms?: PDFFormStructure[] | any;
|
|
53
53
|
};
|
|
54
54
|
export type HTML2PDFOptions = {
|
|
55
|
-
input_html?:
|
|
55
|
+
input_html?: string;
|
|
56
56
|
input_path?: string;
|
|
57
57
|
output_path?: string;
|
|
58
58
|
output_pdf?: boolean;
|
|
@@ -206,3 +206,116 @@ export type MediaUploadBase64Payload = {
|
|
|
206
206
|
/** Array of files with base64-encoded content */
|
|
207
207
|
files: MediaUploadBase64File[];
|
|
208
208
|
};
|
|
209
|
+
/**
|
|
210
|
+
* Filters for document listing endpoints
|
|
211
|
+
*/
|
|
212
|
+
export type DocumentListParams = {
|
|
213
|
+
/** Optional text to search within documents */
|
|
214
|
+
searchText?: string;
|
|
215
|
+
/** Whether to search recursively through directories */
|
|
216
|
+
recursive?: boolean;
|
|
217
|
+
};
|
|
218
|
+
export type DocumentSourceType = "component" | string;
|
|
219
|
+
export type DocumentSource = {
|
|
220
|
+
type: DocumentSourceType;
|
|
221
|
+
value: string;
|
|
222
|
+
label: string;
|
|
223
|
+
tag: string;
|
|
224
|
+
};
|
|
225
|
+
export type DocumentFieldDataMapping = {
|
|
226
|
+
sourceField?: string;
|
|
227
|
+
};
|
|
228
|
+
export type DocumentFieldSource = "text" | "options" | "datepicker" | DocumentSource["tag"];
|
|
229
|
+
export type DocumentField = {
|
|
230
|
+
field: string;
|
|
231
|
+
label?: string | null;
|
|
232
|
+
source: DocumentFieldSource;
|
|
233
|
+
value?: string | number | null;
|
|
234
|
+
format?: string;
|
|
235
|
+
data?: DocumentFieldDataMapping;
|
|
236
|
+
};
|
|
237
|
+
export type DocumentAuditEntry = {
|
|
238
|
+
time: string;
|
|
239
|
+
name?: string;
|
|
240
|
+
uuid?: string;
|
|
241
|
+
};
|
|
242
|
+
export type DocumentVariant = {
|
|
243
|
+
name: string;
|
|
244
|
+
version: number;
|
|
245
|
+
content: string;
|
|
246
|
+
sources?: DocumentSource[];
|
|
247
|
+
fields?: DocumentField[];
|
|
248
|
+
createdBy?: DocumentAuditEntry;
|
|
249
|
+
updatedBy?: DocumentAuditEntry;
|
|
250
|
+
deletedBy?: DocumentAuditEntry;
|
|
251
|
+
};
|
|
252
|
+
export type DocumentResponse = {
|
|
253
|
+
name: string;
|
|
254
|
+
variants: DocumentVariant[];
|
|
255
|
+
createdBy?: DocumentAuditEntry;
|
|
256
|
+
updatedBy?: DocumentAuditEntry;
|
|
257
|
+
deletedBy?: DocumentAuditEntry;
|
|
258
|
+
};
|
|
259
|
+
export type DocumentListItem = {
|
|
260
|
+
name: string;
|
|
261
|
+
createdBy?: DocumentAuditEntry;
|
|
262
|
+
updatedBy?: DocumentAuditEntry;
|
|
263
|
+
deletedBy?: DocumentAuditEntry;
|
|
264
|
+
};
|
|
265
|
+
export type DocumentListResponse = DocumentListItem[];
|
|
266
|
+
/**
|
|
267
|
+
* Payload for creating a document
|
|
268
|
+
*/
|
|
269
|
+
export type DocumentCreatePayload = {
|
|
270
|
+
/** Document path (including directory and filename) */
|
|
271
|
+
path: string;
|
|
272
|
+
/** Document content (plain text or structured) */
|
|
273
|
+
content?: string;
|
|
274
|
+
/** Document variant identifier */
|
|
275
|
+
variant?: string;
|
|
276
|
+
/** Optional document sources metadata */
|
|
277
|
+
sources?: DocumentSource[];
|
|
278
|
+
/** Optional custom fields metadata */
|
|
279
|
+
fields?: DocumentField[];
|
|
280
|
+
};
|
|
281
|
+
/**
|
|
282
|
+
* Payload for updating an existing document
|
|
283
|
+
*/
|
|
284
|
+
export type DocumentUpdatePayload = {
|
|
285
|
+
/** Document path (including directory and filename) */
|
|
286
|
+
path: string;
|
|
287
|
+
/** Variant to update */
|
|
288
|
+
variant?: string;
|
|
289
|
+
/** Current version used for optimistic locking */
|
|
290
|
+
version?: number;
|
|
291
|
+
/** Updated content */
|
|
292
|
+
content?: string;
|
|
293
|
+
/** Updated sources metadata */
|
|
294
|
+
sources?: DocumentSource[];
|
|
295
|
+
/** Updated fields metadata */
|
|
296
|
+
fields?: DocumentField[];
|
|
297
|
+
};
|
|
298
|
+
/**
|
|
299
|
+
* Payload for restoring a deleted document
|
|
300
|
+
*/
|
|
301
|
+
export type DocumentRestorePayload = {
|
|
302
|
+
/** Path of the deleted document */
|
|
303
|
+
path: string;
|
|
304
|
+
/** Optional new path to restore to */
|
|
305
|
+
newPath?: string;
|
|
306
|
+
};
|
|
307
|
+
/**
|
|
308
|
+
* Payload for creating a document comment
|
|
309
|
+
*/
|
|
310
|
+
export type DocumentCommentPayload = {
|
|
311
|
+
/** Target document path */
|
|
312
|
+
path: string;
|
|
313
|
+
/** Comment body */
|
|
314
|
+
content: string;
|
|
315
|
+
/** Variant the comment belongs to */
|
|
316
|
+
variant?: string;
|
|
317
|
+
/** Comment start position */
|
|
318
|
+
from?: number;
|
|
319
|
+
/** Comment end position */
|
|
320
|
+
to?: number;
|
|
321
|
+
};
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import PlatformBaseClient from "./platformBaseClient";
|
|
2
|
+
export default class APIUser extends PlatformBaseClient {
|
|
3
|
+
auth(username: string, password: string, project: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
4
|
+
newSecret(uuid: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
5
|
+
revokeSecret(uuid: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
6
|
+
edit(uuid: string, roles: string[]): Promise<import("axios").AxiosResponse<any, any>>;
|
|
7
|
+
list(): Promise<any>;
|
|
8
|
+
get(uuid: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import PlatformBaseClient from "./platformBaseClient";
|
|
2
|
+
export default class Apps extends PlatformBaseClient {
|
|
3
|
+
private appType;
|
|
4
|
+
constructor(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
|
+
}
|