@ptkl/sdk 0.10.2 → 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} +393 -230
- 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/index.d.ts +22 -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} +393 -230
- package/dist/v0.10/index.d.ts +21 -0
- package/dist/{index.esm.js → v0.10/index.esm.js} +392 -227
- package/dist/v0.10/integrations/dms.d.ts +469 -0
- 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/{types → v0.10}/types/component.d.ts +27 -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/index.d.ts +0 -13
- package/dist/types/api/integrations/media.d.ts +0 -17
- package/dist/types/api/roles.d.ts +0 -9
- package/dist/types/index.d.ts +0 -29
- 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/componentUtils.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/dms.d.ts +0 -0
- /package/dist/{types → v0.10}/api/integrations/invoicing.d.ts +0 -0
- /package/dist/{types → v0.10}/api/integrations/minimax.d.ts +0 -0
- /package/dist/{types → v0.10}/api/integrations/payments.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/integrations.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/integrations.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,116 @@
|
|
|
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
|
+
forceUpdateProtectedFields: boolean;
|
|
69
|
+
};
|
|
70
|
+
type UpdateManyOptions = UpdateOptions & {
|
|
71
|
+
rollbackOnError: boolean;
|
|
72
|
+
};
|
|
73
|
+
type CreateManyOptions = {
|
|
74
|
+
rollbackOnError: boolean;
|
|
75
|
+
};
|
|
76
|
+
type ModifyOptions = {
|
|
77
|
+
upsert: boolean;
|
|
78
|
+
};
|
|
79
|
+
type ComponentOptions = {
|
|
80
|
+
version?: string;
|
|
81
|
+
};
|
|
82
|
+
type ComponentLabel = {
|
|
83
|
+
locales: Record<string, string>;
|
|
84
|
+
};
|
|
85
|
+
type ComponentWorkspace = {
|
|
86
|
+
uuid: string;
|
|
87
|
+
CreatedAt: string;
|
|
88
|
+
UpdatedAt: string;
|
|
89
|
+
DeletedAt: string | null;
|
|
90
|
+
workspace_uuid: string;
|
|
91
|
+
component_uuid: string;
|
|
92
|
+
};
|
|
93
|
+
type ComponentListItem = {
|
|
94
|
+
uuid: string;
|
|
95
|
+
CreatedAt: string;
|
|
96
|
+
UpdatedAt: string;
|
|
97
|
+
DeletedAt: string | null;
|
|
98
|
+
name: string;
|
|
99
|
+
label: ComponentLabel;
|
|
100
|
+
tag: string;
|
|
101
|
+
icon: string | null;
|
|
102
|
+
is_active: boolean;
|
|
103
|
+
is_public: boolean;
|
|
104
|
+
visible: boolean;
|
|
105
|
+
project_uuid: string;
|
|
106
|
+
scope: string;
|
|
107
|
+
sort: number;
|
|
108
|
+
public_version: string;
|
|
109
|
+
dev_version: string;
|
|
110
|
+
versions: string[] | null;
|
|
111
|
+
dependencies: string[];
|
|
112
|
+
workspaces: ComponentWorkspace[];
|
|
113
|
+
storage_size: number;
|
|
114
|
+
};
|
|
115
|
+
type ComponentListResponse = ComponentListItem[];
|
|
116
|
+
export { FindParams, FindOptions, FindResponse, FindAdvancedParams, FindAggregateParams, Model, UpdateOptions, ModifyOptions, ComponentOptions, ComponentListResponse, ComponentListItem, ComponentLabel, ComponentWorkspace, StreamCallback, StreamHandler, AggregateChainable, UpdateManyOptions, CreateManyOptions, };
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
export type PaymentProvider = 'monri';
|
|
2
|
+
export type GetPaymentLinkOptions = {
|
|
3
|
+
totalAmount: number;
|
|
4
|
+
description: string;
|
|
5
|
+
redirectUrl?: string | null;
|
|
6
|
+
};
|
|
7
|
+
export type PDFFormTextField = {
|
|
8
|
+
name: string;
|
|
9
|
+
value: string;
|
|
10
|
+
locked?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type PDFFormDateField = {
|
|
13
|
+
name: string;
|
|
14
|
+
value: string;
|
|
15
|
+
locked?: boolean;
|
|
16
|
+
};
|
|
17
|
+
export type PDFFormCheckboxField = {
|
|
18
|
+
name: string;
|
|
19
|
+
value: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type PDFFormRadioButtonGroup = {
|
|
22
|
+
name: string;
|
|
23
|
+
value: string;
|
|
24
|
+
locked?: boolean;
|
|
25
|
+
};
|
|
26
|
+
export type PDFFormListBox = {
|
|
27
|
+
name: string;
|
|
28
|
+
values: string[];
|
|
29
|
+
locked?: boolean;
|
|
30
|
+
};
|
|
31
|
+
export type PDFFormComboBox = {
|
|
32
|
+
name: string;
|
|
33
|
+
value: string;
|
|
34
|
+
};
|
|
35
|
+
export type PDFFormStructure = {
|
|
36
|
+
textfield?: PDFFormTextField[];
|
|
37
|
+
datefield?: PDFFormDateField[];
|
|
38
|
+
checkbox?: PDFFormCheckboxField[];
|
|
39
|
+
radiobuttongroup?: PDFFormRadioButtonGroup[];
|
|
40
|
+
listbox?: PDFFormListBox[];
|
|
41
|
+
combobox?: PDFFormComboBox[];
|
|
42
|
+
};
|
|
43
|
+
export type PDFOutputType = 'pdf' | 'base64' | 'file';
|
|
44
|
+
export type PDFFillOptions = {
|
|
45
|
+
input_path?: string;
|
|
46
|
+
output_path?: string;
|
|
47
|
+
output_pdf?: boolean;
|
|
48
|
+
replace?: boolean;
|
|
49
|
+
output_type?: PDFOutputType;
|
|
50
|
+
output_file_name?: string;
|
|
51
|
+
form_data?: Record<string, any>;
|
|
52
|
+
forms?: PDFFormStructure[] | any;
|
|
53
|
+
};
|
|
54
|
+
export type HTML2PDFOptions = {
|
|
55
|
+
input_html?: string;
|
|
56
|
+
input_path?: string;
|
|
57
|
+
output_path?: string;
|
|
58
|
+
output_pdf?: boolean;
|
|
59
|
+
output_type?: PDFOutputType;
|
|
60
|
+
output_file_name?: string;
|
|
61
|
+
replace?: boolean;
|
|
62
|
+
data?: Record<string, any>;
|
|
63
|
+
};
|
|
64
|
+
export type PDF2HTMLOptions = {
|
|
65
|
+
input_path?: string;
|
|
66
|
+
input_pdf?: string;
|
|
67
|
+
output_path?: string;
|
|
68
|
+
output_html?: string;
|
|
69
|
+
output_file_name?: string;
|
|
70
|
+
replace?: boolean;
|
|
71
|
+
data?: Record<string, any>;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Supported data formats for conversion operations
|
|
75
|
+
*/
|
|
76
|
+
export type DataFormat = 'json' | 'csv' | 'excel' | 'xlsx';
|
|
77
|
+
/**
|
|
78
|
+
* Parameters for data conversion between formats
|
|
79
|
+
*/
|
|
80
|
+
export type DataConversionParams = {
|
|
81
|
+
/** Source format */
|
|
82
|
+
from: DataFormat;
|
|
83
|
+
/** Target format */
|
|
84
|
+
to: DataFormat;
|
|
85
|
+
/** Optional Excel sheet name (defaults to "Sheet1") */
|
|
86
|
+
sheet_name?: string;
|
|
87
|
+
/** Include header section in output (default: true) */
|
|
88
|
+
include_header?: boolean;
|
|
89
|
+
/** Include footer section in output (default: true) */
|
|
90
|
+
include_footer?: boolean;
|
|
91
|
+
/** Render header as comments in CSV (default: false) */
|
|
92
|
+
header_as_comment?: boolean;
|
|
93
|
+
/** Render footer as comments in CSV (default: false) */
|
|
94
|
+
footer_as_comment?: boolean;
|
|
95
|
+
/** Empty rows between sections (default: 1) */
|
|
96
|
+
separator_rows?: number;
|
|
97
|
+
/** Specify order of fields/columns */
|
|
98
|
+
field_order?: string[];
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Parameters for data format validation
|
|
102
|
+
*/
|
|
103
|
+
export type DataValidationParams = {
|
|
104
|
+
/** Format to validate against */
|
|
105
|
+
format: DataFormat;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Parameters for data analysis and information extraction
|
|
109
|
+
*/
|
|
110
|
+
export type DataInfoParams = {
|
|
111
|
+
/** Format of the data to analyze */
|
|
112
|
+
format: DataFormat;
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Information about analyzed data structure and content
|
|
116
|
+
*/
|
|
117
|
+
export type DataInfo = {
|
|
118
|
+
/** Detected or specified format */
|
|
119
|
+
format: string;
|
|
120
|
+
/** Size of data in bytes */
|
|
121
|
+
size_bytes: number;
|
|
122
|
+
/** Number of records/rows */
|
|
123
|
+
record_count: number;
|
|
124
|
+
/** Number of fields/columns */
|
|
125
|
+
field_count: number;
|
|
126
|
+
/** Array of field/column names */
|
|
127
|
+
fields: string[];
|
|
128
|
+
/** Library reference UUID */
|
|
129
|
+
library_ref: string;
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* Result of data format validation
|
|
133
|
+
*/
|
|
134
|
+
export type DataValidationResult = {
|
|
135
|
+
/** Whether the data is valid for the specified format */
|
|
136
|
+
valid: boolean;
|
|
137
|
+
/** Validation message (success or error details) */
|
|
138
|
+
message: string;
|
|
139
|
+
/** Library reference UUID */
|
|
140
|
+
library_ref: string;
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* Optional parameters for data conversion operations
|
|
144
|
+
*/
|
|
145
|
+
export type ConversionOptions = {
|
|
146
|
+
/** Excel sheet name for read/write operations (defaults to "Sheet1") */
|
|
147
|
+
sheet_name?: string; /** Specify order of fields/columns */
|
|
148
|
+
field_order?: string[];
|
|
149
|
+
};
|
|
150
|
+
export type NbsIpsQrCode = {
|
|
151
|
+
TransactionType: string;
|
|
152
|
+
Version: string;
|
|
153
|
+
CharacterSet: string;
|
|
154
|
+
RecipientAccountNumber: string;
|
|
155
|
+
RecipientName: string;
|
|
156
|
+
AmountInLocalCurrency: string;
|
|
157
|
+
PayerInformation: string;
|
|
158
|
+
PaymentPurposeCode: string;
|
|
159
|
+
PurposeOfPayment: string;
|
|
160
|
+
PaymentOrderNumber: string;
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* Payload for multipart form upload
|
|
164
|
+
*/
|
|
165
|
+
export type MediaUploadPayload = {
|
|
166
|
+
/** Array of files to upload */
|
|
167
|
+
files: File[];
|
|
168
|
+
/** Directory path where files should be uploaded */
|
|
169
|
+
uploadDir: string;
|
|
170
|
+
/** Whether files should be publicly accessible */
|
|
171
|
+
public?: boolean;
|
|
172
|
+
/** If true, replace files if they already exist */
|
|
173
|
+
replace?: boolean;
|
|
174
|
+
/** Expiration timestamp in ISO 8601 format (RFC3339) */
|
|
175
|
+
expiresAt?: string;
|
|
176
|
+
/** Additional metadata as key-value pairs */
|
|
177
|
+
metadata?: Record<string, string>;
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* File structure for base64 upload
|
|
181
|
+
*/
|
|
182
|
+
export type MediaUploadBase64File = {
|
|
183
|
+
/** Name of the file including extension */
|
|
184
|
+
name: string;
|
|
185
|
+
/** MIME type of the file (e.g., 'image/png', 'application/pdf') */
|
|
186
|
+
content_type: string;
|
|
187
|
+
/** Base64-encoded file content */
|
|
188
|
+
data: string;
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* Payload for base64/JSON upload
|
|
192
|
+
*/
|
|
193
|
+
export type MediaUploadBase64Payload = {
|
|
194
|
+
/** Reference identifier for the upload operation */
|
|
195
|
+
ref?: string;
|
|
196
|
+
/** Directory path where files should be uploaded */
|
|
197
|
+
path: string;
|
|
198
|
+
/** Whether files should be publicly accessible */
|
|
199
|
+
is_public?: boolean;
|
|
200
|
+
/** If true, replace files if they already exist */
|
|
201
|
+
replace?: boolean;
|
|
202
|
+
/** Expiration timestamp (Date object or ISO 8601 string) */
|
|
203
|
+
expires_at?: Date | string;
|
|
204
|
+
/** Additional metadata as key-value pairs */
|
|
205
|
+
metadata?: Record<string, string>;
|
|
206
|
+
/** Array of files with base64-encoded content */
|
|
207
|
+
files: MediaUploadBase64File[];
|
|
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
|
+
};
|