@ptkl/sdk 0.10.2 → 1.0.1

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.
Files changed (132) hide show
  1. package/dist/{index.iife.js → index.0.10.js} +417 -230
  2. package/dist/index.0.9.js +2849 -0
  3. package/dist/package.json +12 -7
  4. package/dist/v0.10/api/component.d.ts +136 -0
  5. package/dist/v0.10/api/componentUtils.d.ts +16 -0
  6. package/dist/v0.10/api/index.d.ts +22 -0
  7. package/dist/{types → v0.10}/api/integrationsBaseClient.d.ts +3 -0
  8. package/dist/{types → v0.10}/api/platform.d.ts +2 -2
  9. package/dist/v0.10/apiUser.d.ts +9 -0
  10. package/dist/v0.10/apps.d.ts +8 -0
  11. package/dist/v0.10/baseClient.d.ts +6 -0
  12. package/dist/{types/api → v0.10}/component.d.ts +39 -4
  13. package/dist/v0.10/componentUtils.d.ts +7 -0
  14. package/dist/v0.10/config.d.ts +14 -0
  15. package/dist/v0.10/forge.d.ts +7 -0
  16. package/dist/v0.10/functions.d.ts +23 -0
  17. package/dist/{index.cjs.js → v0.10/index.cjs.js} +417 -230
  18. package/dist/v0.10/index.d.ts +21 -0
  19. package/dist/{index.esm.js → v0.10/index.esm.js} +416 -227
  20. package/dist/v0.10/integrations/dms.d.ts +469 -0
  21. package/dist/v0.10/integrations/invoicing.d.ts +6 -0
  22. package/dist/v0.10/integrations/minimax.d.ts +289 -0
  23. package/dist/v0.10/integrations/payments.d.ts +40 -0
  24. package/dist/v0.10/integrations/serbiaUtil.d.ts +10 -0
  25. package/dist/v0.10/integrations/vpfr.d.ts +4 -0
  26. package/dist/v0.10/integrations.d.ts +22 -0
  27. package/dist/v0.10/integrationsBaseClient.d.ts +11 -0
  28. package/dist/v0.10/platform.d.ts +34 -0
  29. package/dist/v0.10/platformBaseClient.d.ts +27 -0
  30. package/dist/v0.10/project.d.ts +146 -0
  31. package/dist/v0.10/ratchet.d.ts +196 -0
  32. package/dist/v0.10/sandbox.d.ts +14 -0
  33. package/dist/v0.10/system.d.ts +4 -0
  34. package/dist/v0.10/thunder.d.ts +13 -0
  35. package/dist/v0.10/types/component.d.ts +298 -0
  36. package/dist/v0.10/users.d.ts +69 -0
  37. package/dist/v0.10/workflow.d.ts +5 -0
  38. package/dist/v0.9/api/apiUser.d.ts +9 -0
  39. package/dist/v0.9/api/apps.d.ts +8 -0
  40. package/dist/v0.9/api/baseClient.d.ts +6 -0
  41. package/dist/v0.9/api/component.d.ts +136 -0
  42. package/dist/v0.9/api/config.d.ts +14 -0
  43. package/dist/v0.9/api/forge.d.ts +7 -0
  44. package/dist/v0.9/api/functions.d.ts +23 -0
  45. package/dist/v0.9/api/index.d.ts +24 -0
  46. package/dist/v0.9/api/integrations/dms.d.ts +419 -0
  47. package/dist/v0.9/api/integrations/invoicing.d.ts +6 -0
  48. package/dist/v0.9/api/integrations/minimax.d.ts +289 -0
  49. package/dist/v0.9/api/integrations/payments.d.ts +40 -0
  50. package/dist/v0.9/api/integrations/serbiaUtil.d.ts +10 -0
  51. package/dist/v0.9/api/integrations/vpfr.d.ts +4 -0
  52. package/dist/v0.9/api/integrations.d.ts +22 -0
  53. package/dist/v0.9/api/integrationsBaseClient.d.ts +11 -0
  54. package/dist/v0.9/api/platform.d.ts +34 -0
  55. package/dist/v0.9/api/platformBaseClient.d.ts +27 -0
  56. package/dist/v0.9/api/project.d.ts +146 -0
  57. package/dist/v0.9/api/ratchet.d.ts +196 -0
  58. package/dist/v0.9/api/sandbox.d.ts +14 -0
  59. package/dist/v0.9/api/system.d.ts +4 -0
  60. package/dist/v0.9/api/thunder.d.ts +13 -0
  61. package/dist/v0.9/api/users.d.ts +69 -0
  62. package/dist/v0.9/api/workflow.d.ts +5 -0
  63. package/dist/v0.9/apiUser.d.ts +9 -0
  64. package/dist/v0.9/apps.d.ts +8 -0
  65. package/dist/v0.9/baseClient.d.ts +6 -0
  66. package/dist/v0.9/component.d.ts +128 -0
  67. package/dist/v0.9/componentUtils.d.ts +7 -0
  68. package/dist/v0.9/config.d.ts +14 -0
  69. package/dist/v0.9/forge.d.ts +7 -0
  70. package/dist/v0.9/functions.d.ts +23 -0
  71. package/dist/v0.9/index.cjs.js +21811 -0
  72. package/dist/v0.9/index.d.ts +21 -0
  73. package/dist/v0.9/index.esm.js +2820 -0
  74. package/dist/v0.9/integrations/dms.d.ts +469 -0
  75. package/dist/v0.9/integrations/invoicing.d.ts +6 -0
  76. package/dist/v0.9/integrations/minimax.d.ts +289 -0
  77. package/dist/v0.9/integrations/payments.d.ts +40 -0
  78. package/dist/v0.9/integrations/serbiaUtil.d.ts +10 -0
  79. package/dist/v0.9/integrations/vpfr.d.ts +4 -0
  80. package/dist/v0.9/integrations.d.ts +22 -0
  81. package/dist/v0.9/integrationsBaseClient.d.ts +11 -0
  82. package/dist/v0.9/platform.d.ts +34 -0
  83. package/dist/v0.9/platformBaseClient.d.ts +27 -0
  84. package/dist/v0.9/project.d.ts +146 -0
  85. package/dist/v0.9/ratchet.d.ts +196 -0
  86. package/dist/v0.9/sandbox.d.ts +14 -0
  87. package/dist/v0.9/system.d.ts +4 -0
  88. package/dist/v0.9/thunder.d.ts +13 -0
  89. package/dist/{types → v0.9}/types/component.d.ts +34 -2
  90. package/dist/v0.9/types/config.d.ts +11 -0
  91. package/dist/v0.9/types/integrations.d.ts +321 -0
  92. package/dist/v0.9/types/project.d.ts +64 -0
  93. package/dist/v0.9/types/ratchet.d.ts +38 -0
  94. package/dist/v0.9/types/users.d.ts +66 -0
  95. package/dist/v0.9/users.d.ts +69 -0
  96. package/dist/v0.9/util/detectEnv.d.ts +4 -0
  97. package/dist/v0.9/workflow.d.ts +5 -0
  98. package/package.json +12 -7
  99. package/dist/monaco.d.ts +0 -887
  100. package/dist/types/api/index.d.ts +0 -13
  101. package/dist/types/api/integrations/media.d.ts +0 -17
  102. package/dist/types/api/roles.d.ts +0 -9
  103. package/dist/types/index.d.ts +0 -29
  104. package/dist/types/types/media.d.ts +0 -103
  105. /package/dist/{types → v0.10}/api/apiUser.d.ts +0 -0
  106. /package/dist/{types → v0.10}/api/apps.d.ts +0 -0
  107. /package/dist/{types → v0.10}/api/baseClient.d.ts +0 -0
  108. /package/dist/{types → v0.10}/api/config.d.ts +0 -0
  109. /package/dist/{types → v0.10}/api/forge.d.ts +0 -0
  110. /package/dist/{types → v0.10}/api/functions.d.ts +0 -0
  111. /package/dist/{types → v0.10}/api/integrations/dms.d.ts +0 -0
  112. /package/dist/{types → v0.10}/api/integrations/invoicing.d.ts +0 -0
  113. /package/dist/{types → v0.10}/api/integrations/minimax.d.ts +0 -0
  114. /package/dist/{types → v0.10}/api/integrations/payments.d.ts +0 -0
  115. /package/dist/{types → v0.10}/api/integrations/serbiaUtil.d.ts +0 -0
  116. /package/dist/{types → v0.10}/api/integrations/vpfr.d.ts +0 -0
  117. /package/dist/{types → v0.10}/api/integrations.d.ts +0 -0
  118. /package/dist/{types → v0.10}/api/platformBaseClient.d.ts +0 -0
  119. /package/dist/{types → v0.10}/api/project.d.ts +0 -0
  120. /package/dist/{types → v0.10}/api/ratchet.d.ts +0 -0
  121. /package/dist/{types → v0.10}/api/sandbox.d.ts +0 -0
  122. /package/dist/{types → v0.10}/api/system.d.ts +0 -0
  123. /package/dist/{types → v0.10}/api/thunder.d.ts +0 -0
  124. /package/dist/{types → v0.10}/api/users.d.ts +0 -0
  125. /package/dist/{types → v0.10}/api/workflow.d.ts +0 -0
  126. /package/dist/{types → v0.10}/types/config.d.ts +0 -0
  127. /package/dist/{types → v0.10}/types/integrations.d.ts +0 -0
  128. /package/dist/{types → v0.10}/types/project.d.ts +0 -0
  129. /package/dist/{types → v0.10}/types/ratchet.d.ts +0 -0
  130. /package/dist/{types → v0.10}/types/users.d.ts +0 -0
  131. /package/dist/{types → v0.10}/util/detectEnv.d.ts +0 -0
  132. /package/dist/{types → v0.9}/api/componentUtils.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,4 @@
1
+ import PlatformBaseClient from "./platformBaseClient";
2
+ export default class System extends PlatformBaseClient {
3
+ resourceResolver(ref: string, resourceName: string, format?: string): Promise<import("axios").AxiosResponse<any, any>>;
4
+ }
@@ -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,298 @@
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
+ type FieldRoles = {
117
+ see: string[];
118
+ edit: string[];
119
+ };
120
+ type Context = {
121
+ key: string;
122
+ value: any;
123
+ };
124
+ type FieldConstraints = {
125
+ required?: boolean;
126
+ unique?: boolean;
127
+ placeholder?: string;
128
+ default?: string;
129
+ length?: {
130
+ min?: number | null;
131
+ max?: number | null;
132
+ };
133
+ not_allowed_words?: string;
134
+ regex?: string;
135
+ date?: {
136
+ pattern?: string;
137
+ disable_past_dates?: boolean;
138
+ disable_future_dates?: boolean;
139
+ disabled_dates?: {
140
+ dates?: string[];
141
+ to?: string;
142
+ from?: string;
143
+ days?: number[];
144
+ days_of_month?: number[];
145
+ ranges?: Array<{
146
+ from: string;
147
+ to: string;
148
+ }>;
149
+ };
150
+ highlighted_dates?: {
151
+ dates?: string[];
152
+ to?: string;
153
+ from?: string;
154
+ days?: number[];
155
+ days_of_month?: number[];
156
+ ranges?: Array<{
157
+ from: string;
158
+ to: string;
159
+ }>;
160
+ include_disabled?: boolean;
161
+ };
162
+ };
163
+ selectables?: {
164
+ items?: any[];
165
+ multiple?: boolean;
166
+ range?: {
167
+ from: number;
168
+ to: number;
169
+ };
170
+ custom?: boolean;
171
+ };
172
+ table?: {
173
+ search?: boolean;
174
+ per_page?: number;
175
+ save_on_create?: boolean;
176
+ fields?: SettingsField[];
177
+ };
178
+ relation?: {
179
+ label?: string;
180
+ searchOn?: string[];
181
+ };
182
+ };
183
+ type SettingsField = {
184
+ name: string;
185
+ label: Record<string, any>;
186
+ key: string;
187
+ type: string;
188
+ description?: Record<string, any>;
189
+ module?: string;
190
+ group?: string;
191
+ sortOrder?: number;
192
+ visible?: boolean;
193
+ protected?: boolean;
194
+ roles?: FieldRoles;
195
+ context?: Context[];
196
+ constraints?: FieldConstraints;
197
+ relation?: {
198
+ foreign?: string;
199
+ key?: string[];
200
+ type?: string;
201
+ foreign_uuid?: string | null;
202
+ };
203
+ mutators?: {
204
+ get?: string;
205
+ set?: string;
206
+ };
207
+ provided_template?: boolean;
208
+ provided_template_component?: string;
209
+ component_template?: string;
210
+ template?: string;
211
+ permissions?: string[];
212
+ };
213
+ type Filters = {
214
+ filter?: string;
215
+ filterOn?: string[];
216
+ dateField?: string;
217
+ dateFrom?: string;
218
+ dateTo?: string;
219
+ $adv?: Record<string, any>;
220
+ };
221
+ type PresetContext = {
222
+ filters?: Filters;
223
+ default?: boolean;
224
+ locked?: boolean;
225
+ expr?: string;
226
+ };
227
+ type Preset = {
228
+ name: string;
229
+ roles: string[];
230
+ context: PresetContext;
231
+ };
232
+ type Function = {
233
+ name: string;
234
+ expr: string;
235
+ };
236
+ type TemplatesDist = {
237
+ sdk_version: number;
238
+ sdk_engine: string;
239
+ dist: Record<string, any>;
240
+ };
241
+ type Settings = {
242
+ version?: string;
243
+ appearance?: {
244
+ list_entrypoint?: string;
245
+ create_entrypoint?: string;
246
+ edit_entrypoint?: string;
247
+ };
248
+ list?: {
249
+ quick_actions?: boolean;
250
+ perPage?: number;
251
+ fields?: Array<{
252
+ key: string;
253
+ label: Record<string, any>;
254
+ name?: string;
255
+ sortOrder?: number;
256
+ sortable?: boolean;
257
+ filterable?: boolean;
258
+ sortDirection?: string;
259
+ sortByFormatted?: boolean;
260
+ filterByFormatted?: boolean;
261
+ formatterEditor?: string;
262
+ variant?: string;
263
+ formatter?: string;
264
+ provided_template_component?: string;
265
+ component_template?: string;
266
+ }>;
267
+ };
268
+ fields?: SettingsField[];
269
+ model?: {
270
+ events?: Record<string, any>[];
271
+ unique_indexes_combinations?: string[][];
272
+ };
273
+ presets?: Preset[];
274
+ templates?: Record<string, any>[];
275
+ templates_dist?: TemplatesDist;
276
+ config?: Record<string, any>;
277
+ functions?: Function[];
278
+ };
279
+ type SetupData = {
280
+ name: string;
281
+ label?: Record<string, any>;
282
+ tag: string;
283
+ scope?: string;
284
+ public_version?: string;
285
+ dev_version?: string;
286
+ project_uuid?: string;
287
+ workspaces?: string[];
288
+ roles?: string[];
289
+ settings?: Settings;
290
+ env?: string;
291
+ is_active?: boolean;
292
+ is_public?: boolean;
293
+ icon?: string;
294
+ template_component_id?: string;
295
+ integrator?: string;
296
+ };
297
+ type ComponentCreateResponse = ComponentListItem;
298
+ export { FindParams, FindOptions, FindResponse, FindAdvancedParams, FindAggregateParams, Model, UpdateOptions, ModifyOptions, ComponentOptions, ComponentListResponse, ComponentListItem, ComponentLabel, ComponentWorkspace, StreamCallback, StreamHandler, AggregateChainable, UpdateManyOptions, CreateManyOptions, Settings, SettingsField, FieldRoles, FieldConstraints, Context, Preset, PresetContext, Filters, Function, TemplatesDist, SetupData, ComponentCreateResponse, };
@@ -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
+ }
@@ -0,0 +1,6 @@
1
+ import { AxiosInstance } from "axios";
2
+ export default class BaseClient {
3
+ client: AxiosInstance;
4
+ constructor(client: AxiosInstance);
5
+ setClient(client: AxiosInstance): this;
6
+ }