mitra-interactions-sdk 1.0.20 → 1.0.22
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/README.md +18 -3
- package/dist/index.d.mts +68 -37
- package/dist/index.d.ts +68 -37
- package/dist/index.js +102 -53
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +101 -54
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -177,12 +177,25 @@ const result = await stopServerFunctionExecutionMitra({
|
|
|
177
177
|
// result: { status, result: { executionId, executionStatus: "CANCELLED" | "ALREADY_FINISHED" } }
|
|
178
178
|
```
|
|
179
179
|
|
|
180
|
-
###
|
|
181
|
-
|
|
182
|
-
Chama uma API externa via serviço de integrações do Mitra. O serviço de integrações roda em uma URL separada (ex: porta 1003) e cuida de autenticação, tokens e refresh automaticamente.
|
|
180
|
+
### Integrações
|
|
183
181
|
|
|
184
182
|
> **Requisito:** A `integrationURL` deve ser configurada via `configureSdkMitra({ ..., integrationURL: 'https://api0.mitraecp.com:1003' })` ou via query param `integrationURL` (auto-config com `configureMitra()`).
|
|
185
183
|
|
|
184
|
+
#### listIntegrationsMitra
|
|
185
|
+
|
|
186
|
+
Lista as integrações configuradas no projeto.
|
|
187
|
+
|
|
188
|
+
```typescript
|
|
189
|
+
import { listIntegrationsMitra } from 'mitra-interactions-sdk';
|
|
190
|
+
|
|
191
|
+
const integrations = await listIntegrationsMitra({ projectId: 123 });
|
|
192
|
+
// result: IntegrationRecord[] — [{ id, projectId, name, slug, blueprintId, blueprintType, authType, credentials, status, lastCheckedAt, createdAt, updatedAt }]
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
#### callIntegrationMitra
|
|
196
|
+
|
|
197
|
+
Chama uma API externa via serviço de integrações do Mitra. O serviço cuida de autenticação, tokens e refresh automaticamente.
|
|
198
|
+
|
|
186
199
|
```typescript
|
|
187
200
|
import { callIntegrationMitra } from 'mitra-interactions-sdk';
|
|
188
201
|
|
|
@@ -315,6 +328,7 @@ import type {
|
|
|
315
328
|
ExecuteDbActionOptions,
|
|
316
329
|
ExecuteServerFunctionOptions,
|
|
317
330
|
ExecuteServerFunctionAsyncOptions,
|
|
331
|
+
ListIntegrationsOptions,
|
|
318
332
|
CallIntegrationOptions,
|
|
319
333
|
StopServerFunctionExecutionOptions,
|
|
320
334
|
SetFileStatusOptions,
|
|
@@ -333,6 +347,7 @@ import type {
|
|
|
333
347
|
SetVariableResponse,
|
|
334
348
|
ExecuteServerFunctionResponse,
|
|
335
349
|
ExecuteServerFunctionAsyncResponse,
|
|
350
|
+
IntegrationRecord,
|
|
336
351
|
CallIntegrationResponse,
|
|
337
352
|
StopServerFunctionExecutionResponse,
|
|
338
353
|
ListRecordsResponse
|
package/dist/index.d.mts
CHANGED
|
@@ -8,6 +8,10 @@ interface MitraConfig {
|
|
|
8
8
|
token: string;
|
|
9
9
|
/** URL base do serviço de integrações (ex: https://api0.mitraecp.com:1003) */
|
|
10
10
|
integrationURL?: string;
|
|
11
|
+
/** URL da página de autenticação Mitra (ex: https://coder.mitralab.io/auth/) */
|
|
12
|
+
authUrl?: string;
|
|
13
|
+
/** ID do projeto (usado como fallback nos métodos de login e serviços) */
|
|
14
|
+
projectId?: number;
|
|
11
15
|
}
|
|
12
16
|
/**
|
|
13
17
|
* Configura o SDK globalmente e persiste no localStorage.
|
|
@@ -17,6 +21,10 @@ declare function configureSdkMitra(config: MitraConfig): void;
|
|
|
17
21
|
* Obtém a configuração atual
|
|
18
22
|
*/
|
|
19
23
|
declare function getConfig(): MitraConfig;
|
|
24
|
+
/**
|
|
25
|
+
* Resolve projectId: usa o valor passado, senão pega do config salvo.
|
|
26
|
+
*/
|
|
27
|
+
declare function resolveProjectId(projectId?: number): number;
|
|
20
28
|
/**
|
|
21
29
|
* Auto-configura o SDK.
|
|
22
30
|
* 1. Verifica query params (token + backURL) — se encontrar, salva no store e configura.
|
|
@@ -31,10 +39,10 @@ declare function configureMitra(): {
|
|
|
31
39
|
* Mitra Interactions SDK - Types
|
|
32
40
|
*/
|
|
33
41
|
interface LoginOptions {
|
|
34
|
-
/** URL da página de autenticação Mitra (ex: https://validacao.mitralab.io/auth/) */
|
|
35
|
-
authUrl
|
|
36
|
-
/** ID do projeto */
|
|
37
|
-
projectId
|
|
42
|
+
/** URL da página de autenticação Mitra (ex: https://validacao.mitralab.io/auth/). Opcional se já configurado via configureSdkMitra. */
|
|
43
|
+
authUrl?: string;
|
|
44
|
+
/** ID do projeto. Opcional se já configurado via configureSdkMitra. */
|
|
45
|
+
projectId?: number;
|
|
38
46
|
}
|
|
39
47
|
interface LoginResponse {
|
|
40
48
|
/** Token JWT (já com prefixo Bearer) */
|
|
@@ -45,8 +53,8 @@ interface LoginResponse {
|
|
|
45
53
|
integrationURL?: string;
|
|
46
54
|
}
|
|
47
55
|
interface RunQueryOptions {
|
|
48
|
-
/** ID do projeto */
|
|
49
|
-
projectId
|
|
56
|
+
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
57
|
+
projectId?: number;
|
|
50
58
|
/** Query SQL (apenas SELECT) */
|
|
51
59
|
sql: string;
|
|
52
60
|
/** ID da conexão JDBC (opcional, usa autoConnect se não informado) */
|
|
@@ -61,8 +69,8 @@ interface RunQueryResponse {
|
|
|
61
69
|
};
|
|
62
70
|
}
|
|
63
71
|
interface ExecuteDbActionOptions {
|
|
64
|
-
/** ID do projeto */
|
|
65
|
-
projectId
|
|
72
|
+
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
73
|
+
projectId?: number;
|
|
66
74
|
/** ID da DBAction cadastrada */
|
|
67
75
|
dbActionId: number;
|
|
68
76
|
/** Variáveis para o statement (opcional) */
|
|
@@ -75,8 +83,8 @@ interface ExecuteDbActionResponse {
|
|
|
75
83
|
};
|
|
76
84
|
}
|
|
77
85
|
interface SetFileStatusOptions {
|
|
78
|
-
/** ID do projeto */
|
|
79
|
-
projectId
|
|
86
|
+
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
87
|
+
projectId?: number;
|
|
80
88
|
/** Nome do arquivo */
|
|
81
89
|
fileName: string;
|
|
82
90
|
/** Caminho de destino: "PUBLIC" ou "LOADABLE" */
|
|
@@ -92,8 +100,8 @@ interface SetFileStatusResponse {
|
|
|
92
100
|
};
|
|
93
101
|
}
|
|
94
102
|
interface SetVariableOptions {
|
|
95
|
-
/** ID do projeto */
|
|
96
|
-
projectId
|
|
103
|
+
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
104
|
+
projectId?: number;
|
|
97
105
|
/** Nome da variável (key) */
|
|
98
106
|
key: string;
|
|
99
107
|
/** Valor da variável (opcional) */
|
|
@@ -107,8 +115,8 @@ interface SetVariableResponse {
|
|
|
107
115
|
};
|
|
108
116
|
}
|
|
109
117
|
interface ExecuteServerFunctionOptions {
|
|
110
|
-
/** ID do projeto */
|
|
111
|
-
projectId
|
|
118
|
+
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
119
|
+
projectId?: number;
|
|
112
120
|
/** ID da Server Function cadastrada */
|
|
113
121
|
serverFunctionId: number;
|
|
114
122
|
/** Objeto de entrada para a função (opcional) */
|
|
@@ -126,8 +134,8 @@ interface ExecuteServerFunctionResponse {
|
|
|
126
134
|
};
|
|
127
135
|
}
|
|
128
136
|
interface ExecuteServerFunctionAsyncOptions {
|
|
129
|
-
/** ID do projeto */
|
|
130
|
-
projectId
|
|
137
|
+
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
138
|
+
projectId?: number;
|
|
131
139
|
/** ID da Server Function cadastrada */
|
|
132
140
|
serverFunctionId: number;
|
|
133
141
|
/** Objeto de entrada para a função (opcional) */
|
|
@@ -148,7 +156,7 @@ interface ListRecordsResponse {
|
|
|
148
156
|
totalPages: number;
|
|
149
157
|
}
|
|
150
158
|
interface ListRecordsOptions {
|
|
151
|
-
projectId
|
|
159
|
+
projectId?: number;
|
|
152
160
|
tableName: string;
|
|
153
161
|
page?: number;
|
|
154
162
|
size?: number;
|
|
@@ -156,46 +164,46 @@ interface ListRecordsOptions {
|
|
|
156
164
|
jdbcConnectionConfigId?: number;
|
|
157
165
|
}
|
|
158
166
|
interface GetRecordOptions {
|
|
159
|
-
projectId
|
|
167
|
+
projectId?: number;
|
|
160
168
|
tableName: string;
|
|
161
169
|
id: number;
|
|
162
170
|
jdbcConnectionConfigId?: number;
|
|
163
171
|
}
|
|
164
172
|
interface CreateRecordOptions {
|
|
165
|
-
projectId
|
|
173
|
+
projectId?: number;
|
|
166
174
|
tableName: string;
|
|
167
175
|
data: Record<string, unknown>;
|
|
168
176
|
jdbcConnectionConfigId?: number;
|
|
169
177
|
}
|
|
170
178
|
interface UpdateRecordOptions {
|
|
171
|
-
projectId
|
|
179
|
+
projectId?: number;
|
|
172
180
|
tableName: string;
|
|
173
181
|
id: number;
|
|
174
182
|
data: Record<string, unknown>;
|
|
175
183
|
jdbcConnectionConfigId?: number;
|
|
176
184
|
}
|
|
177
185
|
interface PatchRecordOptions {
|
|
178
|
-
projectId
|
|
186
|
+
projectId?: number;
|
|
179
187
|
tableName: string;
|
|
180
188
|
id: number;
|
|
181
189
|
data: Record<string, unknown>;
|
|
182
190
|
jdbcConnectionConfigId?: number;
|
|
183
191
|
}
|
|
184
192
|
interface DeleteRecordOptions {
|
|
185
|
-
projectId
|
|
193
|
+
projectId?: number;
|
|
186
194
|
tableName: string;
|
|
187
195
|
id: number;
|
|
188
196
|
jdbcConnectionConfigId?: number;
|
|
189
197
|
}
|
|
190
198
|
interface CreateRecordsBatchOptions {
|
|
191
|
-
projectId
|
|
199
|
+
projectId?: number;
|
|
192
200
|
tableName: string;
|
|
193
201
|
records: Record<string, unknown>[];
|
|
194
202
|
jdbcConnectionConfigId?: number;
|
|
195
203
|
}
|
|
196
204
|
interface CallIntegrationOptions {
|
|
197
|
-
/** ID do projeto */
|
|
198
|
-
projectId
|
|
205
|
+
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
206
|
+
projectId?: number;
|
|
199
207
|
/** Slug da integração configurada no painel */
|
|
200
208
|
connection: string;
|
|
201
209
|
/** Método HTTP: GET, POST, PUT, DELETE */
|
|
@@ -213,9 +221,27 @@ interface CallIntegrationResponse {
|
|
|
213
221
|
/** Resposta crua do serviço externo */
|
|
214
222
|
body: any;
|
|
215
223
|
}
|
|
216
|
-
interface
|
|
217
|
-
/** ID do projeto */
|
|
224
|
+
interface ListIntegrationsOptions {
|
|
225
|
+
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
226
|
+
projectId?: number;
|
|
227
|
+
}
|
|
228
|
+
interface IntegrationRecord {
|
|
229
|
+
id: number;
|
|
218
230
|
projectId: number;
|
|
231
|
+
name: string;
|
|
232
|
+
slug: string;
|
|
233
|
+
blueprintId: string;
|
|
234
|
+
blueprintType: string;
|
|
235
|
+
authType: string;
|
|
236
|
+
credentials: Record<string, unknown>;
|
|
237
|
+
status: string;
|
|
238
|
+
lastCheckedAt: string | null;
|
|
239
|
+
createdAt: string;
|
|
240
|
+
updatedAt: string;
|
|
241
|
+
}
|
|
242
|
+
interface StopServerFunctionExecutionOptions {
|
|
243
|
+
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
244
|
+
projectId?: number;
|
|
219
245
|
/** ID da execução a ser parada */
|
|
220
246
|
executionId: string;
|
|
221
247
|
}
|
|
@@ -237,24 +263,24 @@ interface StopServerFunctionExecutionResponse {
|
|
|
237
263
|
/**
|
|
238
264
|
* Login com email e senha via popup seguro Mitra.
|
|
239
265
|
*
|
|
240
|
-
*
|
|
241
|
-
*
|
|
266
|
+
* authUrl e projectId são opcionais se já configurados via configureSdkMitra().
|
|
267
|
+
* Se passados, sobrescrevem os valores salvos.
|
|
242
268
|
*/
|
|
243
|
-
declare function loginWithEmailMitra(options
|
|
269
|
+
declare function loginWithEmailMitra(options?: LoginOptions): Promise<LoginResponse>;
|
|
244
270
|
/**
|
|
245
271
|
* Login com Google via popup seguro Mitra.
|
|
246
272
|
*
|
|
247
|
-
*
|
|
248
|
-
*
|
|
273
|
+
* authUrl e projectId são opcionais se já configurados via configureSdkMitra().
|
|
274
|
+
* Se passados, sobrescrevem os valores salvos.
|
|
249
275
|
*/
|
|
250
|
-
declare function loginWithGoogleMitra(options
|
|
276
|
+
declare function loginWithGoogleMitra(options?: LoginOptions): Promise<LoginResponse>;
|
|
251
277
|
/**
|
|
252
278
|
* Login com Microsoft via popup seguro Mitra.
|
|
253
279
|
*
|
|
254
|
-
*
|
|
255
|
-
*
|
|
280
|
+
* authUrl e projectId são opcionais se já configurados via configureSdkMitra().
|
|
281
|
+
* Se passados, sobrescrevem os valores salvos.
|
|
256
282
|
*/
|
|
257
|
-
declare function loginWithMicrosoftMitra(options
|
|
283
|
+
declare function loginWithMicrosoftMitra(options?: LoginOptions): Promise<LoginResponse>;
|
|
258
284
|
|
|
259
285
|
/**
|
|
260
286
|
* Mitra Interactions SDK - Services
|
|
@@ -290,6 +316,11 @@ declare function executeServerFunctionMitra(options: ExecuteServerFunctionOption
|
|
|
290
316
|
* Executa uma Server Function de forma ASSÍNCRONA (retorna executionId imediatamente)
|
|
291
317
|
*/
|
|
292
318
|
declare function executeServerFunctionAsyncMitra(options: ExecuteServerFunctionAsyncOptions): Promise<ExecuteServerFunctionAsyncResponse>;
|
|
319
|
+
/**
|
|
320
|
+
* GET /integration?projectId=X
|
|
321
|
+
* Lista integrações configuradas no projeto
|
|
322
|
+
*/
|
|
323
|
+
declare function listIntegrationsMitra(options?: ListIntegrationsOptions): Promise<IntegrationRecord[]>;
|
|
293
324
|
/**
|
|
294
325
|
* POST /integration/call
|
|
295
326
|
* Chama uma API externa via serviço de integrações (porta separada)
|
|
@@ -315,4 +346,4 @@ declare function createRecordsBatchMitra(options: CreateRecordsBatchOptions): Pr
|
|
|
315
346
|
*/
|
|
316
347
|
declare function logoutMitra(redirectPath?: string): void;
|
|
317
348
|
|
|
318
|
-
export { type CallIntegrationOptions, type CallIntegrationResponse, type CreateRecordOptions, type CreateRecordsBatchOptions, type DeleteRecordOptions, type ExecuteDbActionOptions, type ExecuteDbActionResponse, type ExecuteServerFunctionAsyncOptions, type ExecuteServerFunctionAsyncResponse, type ExecuteServerFunctionOptions, type ExecuteServerFunctionResponse, type GetRecordOptions, type ListRecordsOptions, type ListRecordsResponse, type LoginOptions, type LoginResponse, type MitraConfig, type PatchRecordOptions, type RunQueryOptions, type RunQueryResponse, type SetFileStatusOptions, type SetFileStatusResponse, type SetVariableOptions, type SetVariableResponse, type StopServerFunctionExecutionOptions, type StopServerFunctionExecutionResponse, type UpdateRecordOptions, callIntegrationMitra, configureMitra, configureSdkMitra, createRecordMitra, createRecordsBatchMitra, deleteRecordMitra, executeDbActionMitra, executeServerFunctionAsyncMitra, executeServerFunctionMitra, getConfig, getRecordMitra, listRecordsMitra, loginWithEmailMitra, loginWithGoogleMitra, loginWithMicrosoftMitra, logoutMitra, patchRecordMitra, runQueryMitra, setFileStatusMitra, setVariableMitra, stopServerFunctionExecutionMitra, updateRecordMitra };
|
|
349
|
+
export { type CallIntegrationOptions, type CallIntegrationResponse, type CreateRecordOptions, type CreateRecordsBatchOptions, type DeleteRecordOptions, type ExecuteDbActionOptions, type ExecuteDbActionResponse, type ExecuteServerFunctionAsyncOptions, type ExecuteServerFunctionAsyncResponse, type ExecuteServerFunctionOptions, type ExecuteServerFunctionResponse, type GetRecordOptions, type IntegrationRecord, type ListIntegrationsOptions, type ListRecordsOptions, type ListRecordsResponse, type LoginOptions, type LoginResponse, type MitraConfig, type PatchRecordOptions, type RunQueryOptions, type RunQueryResponse, type SetFileStatusOptions, type SetFileStatusResponse, type SetVariableOptions, type SetVariableResponse, type StopServerFunctionExecutionOptions, type StopServerFunctionExecutionResponse, type UpdateRecordOptions, callIntegrationMitra, configureMitra, configureSdkMitra, createRecordMitra, createRecordsBatchMitra, deleteRecordMitra, executeDbActionMitra, executeServerFunctionAsyncMitra, executeServerFunctionMitra, getConfig, getRecordMitra, listIntegrationsMitra, listRecordsMitra, loginWithEmailMitra, loginWithGoogleMitra, loginWithMicrosoftMitra, logoutMitra, patchRecordMitra, resolveProjectId, runQueryMitra, setFileStatusMitra, setVariableMitra, stopServerFunctionExecutionMitra, updateRecordMitra };
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,10 @@ interface MitraConfig {
|
|
|
8
8
|
token: string;
|
|
9
9
|
/** URL base do serviço de integrações (ex: https://api0.mitraecp.com:1003) */
|
|
10
10
|
integrationURL?: string;
|
|
11
|
+
/** URL da página de autenticação Mitra (ex: https://coder.mitralab.io/auth/) */
|
|
12
|
+
authUrl?: string;
|
|
13
|
+
/** ID do projeto (usado como fallback nos métodos de login e serviços) */
|
|
14
|
+
projectId?: number;
|
|
11
15
|
}
|
|
12
16
|
/**
|
|
13
17
|
* Configura o SDK globalmente e persiste no localStorage.
|
|
@@ -17,6 +21,10 @@ declare function configureSdkMitra(config: MitraConfig): void;
|
|
|
17
21
|
* Obtém a configuração atual
|
|
18
22
|
*/
|
|
19
23
|
declare function getConfig(): MitraConfig;
|
|
24
|
+
/**
|
|
25
|
+
* Resolve projectId: usa o valor passado, senão pega do config salvo.
|
|
26
|
+
*/
|
|
27
|
+
declare function resolveProjectId(projectId?: number): number;
|
|
20
28
|
/**
|
|
21
29
|
* Auto-configura o SDK.
|
|
22
30
|
* 1. Verifica query params (token + backURL) — se encontrar, salva no store e configura.
|
|
@@ -31,10 +39,10 @@ declare function configureMitra(): {
|
|
|
31
39
|
* Mitra Interactions SDK - Types
|
|
32
40
|
*/
|
|
33
41
|
interface LoginOptions {
|
|
34
|
-
/** URL da página de autenticação Mitra (ex: https://validacao.mitralab.io/auth/) */
|
|
35
|
-
authUrl
|
|
36
|
-
/** ID do projeto */
|
|
37
|
-
projectId
|
|
42
|
+
/** URL da página de autenticação Mitra (ex: https://validacao.mitralab.io/auth/). Opcional se já configurado via configureSdkMitra. */
|
|
43
|
+
authUrl?: string;
|
|
44
|
+
/** ID do projeto. Opcional se já configurado via configureSdkMitra. */
|
|
45
|
+
projectId?: number;
|
|
38
46
|
}
|
|
39
47
|
interface LoginResponse {
|
|
40
48
|
/** Token JWT (já com prefixo Bearer) */
|
|
@@ -45,8 +53,8 @@ interface LoginResponse {
|
|
|
45
53
|
integrationURL?: string;
|
|
46
54
|
}
|
|
47
55
|
interface RunQueryOptions {
|
|
48
|
-
/** ID do projeto */
|
|
49
|
-
projectId
|
|
56
|
+
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
57
|
+
projectId?: number;
|
|
50
58
|
/** Query SQL (apenas SELECT) */
|
|
51
59
|
sql: string;
|
|
52
60
|
/** ID da conexão JDBC (opcional, usa autoConnect se não informado) */
|
|
@@ -61,8 +69,8 @@ interface RunQueryResponse {
|
|
|
61
69
|
};
|
|
62
70
|
}
|
|
63
71
|
interface ExecuteDbActionOptions {
|
|
64
|
-
/** ID do projeto */
|
|
65
|
-
projectId
|
|
72
|
+
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
73
|
+
projectId?: number;
|
|
66
74
|
/** ID da DBAction cadastrada */
|
|
67
75
|
dbActionId: number;
|
|
68
76
|
/** Variáveis para o statement (opcional) */
|
|
@@ -75,8 +83,8 @@ interface ExecuteDbActionResponse {
|
|
|
75
83
|
};
|
|
76
84
|
}
|
|
77
85
|
interface SetFileStatusOptions {
|
|
78
|
-
/** ID do projeto */
|
|
79
|
-
projectId
|
|
86
|
+
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
87
|
+
projectId?: number;
|
|
80
88
|
/** Nome do arquivo */
|
|
81
89
|
fileName: string;
|
|
82
90
|
/** Caminho de destino: "PUBLIC" ou "LOADABLE" */
|
|
@@ -92,8 +100,8 @@ interface SetFileStatusResponse {
|
|
|
92
100
|
};
|
|
93
101
|
}
|
|
94
102
|
interface SetVariableOptions {
|
|
95
|
-
/** ID do projeto */
|
|
96
|
-
projectId
|
|
103
|
+
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
104
|
+
projectId?: number;
|
|
97
105
|
/** Nome da variável (key) */
|
|
98
106
|
key: string;
|
|
99
107
|
/** Valor da variável (opcional) */
|
|
@@ -107,8 +115,8 @@ interface SetVariableResponse {
|
|
|
107
115
|
};
|
|
108
116
|
}
|
|
109
117
|
interface ExecuteServerFunctionOptions {
|
|
110
|
-
/** ID do projeto */
|
|
111
|
-
projectId
|
|
118
|
+
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
119
|
+
projectId?: number;
|
|
112
120
|
/** ID da Server Function cadastrada */
|
|
113
121
|
serverFunctionId: number;
|
|
114
122
|
/** Objeto de entrada para a função (opcional) */
|
|
@@ -126,8 +134,8 @@ interface ExecuteServerFunctionResponse {
|
|
|
126
134
|
};
|
|
127
135
|
}
|
|
128
136
|
interface ExecuteServerFunctionAsyncOptions {
|
|
129
|
-
/** ID do projeto */
|
|
130
|
-
projectId
|
|
137
|
+
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
138
|
+
projectId?: number;
|
|
131
139
|
/** ID da Server Function cadastrada */
|
|
132
140
|
serverFunctionId: number;
|
|
133
141
|
/** Objeto de entrada para a função (opcional) */
|
|
@@ -148,7 +156,7 @@ interface ListRecordsResponse {
|
|
|
148
156
|
totalPages: number;
|
|
149
157
|
}
|
|
150
158
|
interface ListRecordsOptions {
|
|
151
|
-
projectId
|
|
159
|
+
projectId?: number;
|
|
152
160
|
tableName: string;
|
|
153
161
|
page?: number;
|
|
154
162
|
size?: number;
|
|
@@ -156,46 +164,46 @@ interface ListRecordsOptions {
|
|
|
156
164
|
jdbcConnectionConfigId?: number;
|
|
157
165
|
}
|
|
158
166
|
interface GetRecordOptions {
|
|
159
|
-
projectId
|
|
167
|
+
projectId?: number;
|
|
160
168
|
tableName: string;
|
|
161
169
|
id: number;
|
|
162
170
|
jdbcConnectionConfigId?: number;
|
|
163
171
|
}
|
|
164
172
|
interface CreateRecordOptions {
|
|
165
|
-
projectId
|
|
173
|
+
projectId?: number;
|
|
166
174
|
tableName: string;
|
|
167
175
|
data: Record<string, unknown>;
|
|
168
176
|
jdbcConnectionConfigId?: number;
|
|
169
177
|
}
|
|
170
178
|
interface UpdateRecordOptions {
|
|
171
|
-
projectId
|
|
179
|
+
projectId?: number;
|
|
172
180
|
tableName: string;
|
|
173
181
|
id: number;
|
|
174
182
|
data: Record<string, unknown>;
|
|
175
183
|
jdbcConnectionConfigId?: number;
|
|
176
184
|
}
|
|
177
185
|
interface PatchRecordOptions {
|
|
178
|
-
projectId
|
|
186
|
+
projectId?: number;
|
|
179
187
|
tableName: string;
|
|
180
188
|
id: number;
|
|
181
189
|
data: Record<string, unknown>;
|
|
182
190
|
jdbcConnectionConfigId?: number;
|
|
183
191
|
}
|
|
184
192
|
interface DeleteRecordOptions {
|
|
185
|
-
projectId
|
|
193
|
+
projectId?: number;
|
|
186
194
|
tableName: string;
|
|
187
195
|
id: number;
|
|
188
196
|
jdbcConnectionConfigId?: number;
|
|
189
197
|
}
|
|
190
198
|
interface CreateRecordsBatchOptions {
|
|
191
|
-
projectId
|
|
199
|
+
projectId?: number;
|
|
192
200
|
tableName: string;
|
|
193
201
|
records: Record<string, unknown>[];
|
|
194
202
|
jdbcConnectionConfigId?: number;
|
|
195
203
|
}
|
|
196
204
|
interface CallIntegrationOptions {
|
|
197
|
-
/** ID do projeto */
|
|
198
|
-
projectId
|
|
205
|
+
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
206
|
+
projectId?: number;
|
|
199
207
|
/** Slug da integração configurada no painel */
|
|
200
208
|
connection: string;
|
|
201
209
|
/** Método HTTP: GET, POST, PUT, DELETE */
|
|
@@ -213,9 +221,27 @@ interface CallIntegrationResponse {
|
|
|
213
221
|
/** Resposta crua do serviço externo */
|
|
214
222
|
body: any;
|
|
215
223
|
}
|
|
216
|
-
interface
|
|
217
|
-
/** ID do projeto */
|
|
224
|
+
interface ListIntegrationsOptions {
|
|
225
|
+
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
226
|
+
projectId?: number;
|
|
227
|
+
}
|
|
228
|
+
interface IntegrationRecord {
|
|
229
|
+
id: number;
|
|
218
230
|
projectId: number;
|
|
231
|
+
name: string;
|
|
232
|
+
slug: string;
|
|
233
|
+
blueprintId: string;
|
|
234
|
+
blueprintType: string;
|
|
235
|
+
authType: string;
|
|
236
|
+
credentials: Record<string, unknown>;
|
|
237
|
+
status: string;
|
|
238
|
+
lastCheckedAt: string | null;
|
|
239
|
+
createdAt: string;
|
|
240
|
+
updatedAt: string;
|
|
241
|
+
}
|
|
242
|
+
interface StopServerFunctionExecutionOptions {
|
|
243
|
+
/** ID do projeto (opcional se já configurado via configureSdkMitra) */
|
|
244
|
+
projectId?: number;
|
|
219
245
|
/** ID da execução a ser parada */
|
|
220
246
|
executionId: string;
|
|
221
247
|
}
|
|
@@ -237,24 +263,24 @@ interface StopServerFunctionExecutionResponse {
|
|
|
237
263
|
/**
|
|
238
264
|
* Login com email e senha via popup seguro Mitra.
|
|
239
265
|
*
|
|
240
|
-
*
|
|
241
|
-
*
|
|
266
|
+
* authUrl e projectId são opcionais se já configurados via configureSdkMitra().
|
|
267
|
+
* Se passados, sobrescrevem os valores salvos.
|
|
242
268
|
*/
|
|
243
|
-
declare function loginWithEmailMitra(options
|
|
269
|
+
declare function loginWithEmailMitra(options?: LoginOptions): Promise<LoginResponse>;
|
|
244
270
|
/**
|
|
245
271
|
* Login com Google via popup seguro Mitra.
|
|
246
272
|
*
|
|
247
|
-
*
|
|
248
|
-
*
|
|
273
|
+
* authUrl e projectId são opcionais se já configurados via configureSdkMitra().
|
|
274
|
+
* Se passados, sobrescrevem os valores salvos.
|
|
249
275
|
*/
|
|
250
|
-
declare function loginWithGoogleMitra(options
|
|
276
|
+
declare function loginWithGoogleMitra(options?: LoginOptions): Promise<LoginResponse>;
|
|
251
277
|
/**
|
|
252
278
|
* Login com Microsoft via popup seguro Mitra.
|
|
253
279
|
*
|
|
254
|
-
*
|
|
255
|
-
*
|
|
280
|
+
* authUrl e projectId são opcionais se já configurados via configureSdkMitra().
|
|
281
|
+
* Se passados, sobrescrevem os valores salvos.
|
|
256
282
|
*/
|
|
257
|
-
declare function loginWithMicrosoftMitra(options
|
|
283
|
+
declare function loginWithMicrosoftMitra(options?: LoginOptions): Promise<LoginResponse>;
|
|
258
284
|
|
|
259
285
|
/**
|
|
260
286
|
* Mitra Interactions SDK - Services
|
|
@@ -290,6 +316,11 @@ declare function executeServerFunctionMitra(options: ExecuteServerFunctionOption
|
|
|
290
316
|
* Executa uma Server Function de forma ASSÍNCRONA (retorna executionId imediatamente)
|
|
291
317
|
*/
|
|
292
318
|
declare function executeServerFunctionAsyncMitra(options: ExecuteServerFunctionAsyncOptions): Promise<ExecuteServerFunctionAsyncResponse>;
|
|
319
|
+
/**
|
|
320
|
+
* GET /integration?projectId=X
|
|
321
|
+
* Lista integrações configuradas no projeto
|
|
322
|
+
*/
|
|
323
|
+
declare function listIntegrationsMitra(options?: ListIntegrationsOptions): Promise<IntegrationRecord[]>;
|
|
293
324
|
/**
|
|
294
325
|
* POST /integration/call
|
|
295
326
|
* Chama uma API externa via serviço de integrações (porta separada)
|
|
@@ -315,4 +346,4 @@ declare function createRecordsBatchMitra(options: CreateRecordsBatchOptions): Pr
|
|
|
315
346
|
*/
|
|
316
347
|
declare function logoutMitra(redirectPath?: string): void;
|
|
317
348
|
|
|
318
|
-
export { type CallIntegrationOptions, type CallIntegrationResponse, type CreateRecordOptions, type CreateRecordsBatchOptions, type DeleteRecordOptions, type ExecuteDbActionOptions, type ExecuteDbActionResponse, type ExecuteServerFunctionAsyncOptions, type ExecuteServerFunctionAsyncResponse, type ExecuteServerFunctionOptions, type ExecuteServerFunctionResponse, type GetRecordOptions, type ListRecordsOptions, type ListRecordsResponse, type LoginOptions, type LoginResponse, type MitraConfig, type PatchRecordOptions, type RunQueryOptions, type RunQueryResponse, type SetFileStatusOptions, type SetFileStatusResponse, type SetVariableOptions, type SetVariableResponse, type StopServerFunctionExecutionOptions, type StopServerFunctionExecutionResponse, type UpdateRecordOptions, callIntegrationMitra, configureMitra, configureSdkMitra, createRecordMitra, createRecordsBatchMitra, deleteRecordMitra, executeDbActionMitra, executeServerFunctionAsyncMitra, executeServerFunctionMitra, getConfig, getRecordMitra, listRecordsMitra, loginWithEmailMitra, loginWithGoogleMitra, loginWithMicrosoftMitra, logoutMitra, patchRecordMitra, runQueryMitra, setFileStatusMitra, setVariableMitra, stopServerFunctionExecutionMitra, updateRecordMitra };
|
|
349
|
+
export { type CallIntegrationOptions, type CallIntegrationResponse, type CreateRecordOptions, type CreateRecordsBatchOptions, type DeleteRecordOptions, type ExecuteDbActionOptions, type ExecuteDbActionResponse, type ExecuteServerFunctionAsyncOptions, type ExecuteServerFunctionAsyncResponse, type ExecuteServerFunctionOptions, type ExecuteServerFunctionResponse, type GetRecordOptions, type IntegrationRecord, type ListIntegrationsOptions, type ListRecordsOptions, type ListRecordsResponse, type LoginOptions, type LoginResponse, type MitraConfig, type PatchRecordOptions, type RunQueryOptions, type RunQueryResponse, type SetFileStatusOptions, type SetFileStatusResponse, type SetVariableOptions, type SetVariableResponse, type StopServerFunctionExecutionOptions, type StopServerFunctionExecutionResponse, type UpdateRecordOptions, callIntegrationMitra, configureMitra, configureSdkMitra, createRecordMitra, createRecordsBatchMitra, deleteRecordMitra, executeDbActionMitra, executeServerFunctionAsyncMitra, executeServerFunctionMitra, getConfig, getRecordMitra, listIntegrationsMitra, listRecordsMitra, loginWithEmailMitra, loginWithGoogleMitra, loginWithMicrosoftMitra, logoutMitra, patchRecordMitra, resolveProjectId, runQueryMitra, setFileStatusMitra, setVariableMitra, stopServerFunctionExecutionMitra, updateRecordMitra };
|