mitra-interactions-sdk 1.0.70 → 1.0.71
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 +791 -791
- package/dist/index.d.mts +18 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +52 -52
package/dist/index.d.mts
CHANGED
|
@@ -417,6 +417,19 @@ interface CallIntegrationOptions {
|
|
|
417
417
|
params?: Record<string, unknown>;
|
|
418
418
|
/** Body da requisição (para POST/PUT) */
|
|
419
419
|
body?: Record<string, unknown>;
|
|
420
|
+
/**
|
|
421
|
+
* Headers só desta chamada. Use apenas quando a API externa exigir um header específico.
|
|
422
|
+
*
|
|
423
|
+
* Se a API exigir corpo `application/x-www-form-urlencoded` (comum em endpoints OAuth como
|
|
424
|
+
* introspect, revoke e token), passe `{ 'Content-Type': 'application/x-www-form-urlencoded' }`
|
|
425
|
+
* e monte o `body` como objeto plano de campos texto, número ou booleano: objeto ou lista dentro
|
|
426
|
+
* do `body` é recusado com 400. Sem esse header, o corpo vai em JSON.
|
|
427
|
+
*
|
|
428
|
+
* A autenticação da integração continua sendo aplicada; um header com o mesmo nome de um da
|
|
429
|
+
* integração (ex.: `Authorization`) substitui o da integração nesta chamada. Valores são texto
|
|
430
|
+
* literal. Quando omitido, nenhum header é enviado.
|
|
431
|
+
*/
|
|
432
|
+
headers?: Record<string, string>;
|
|
420
433
|
}
|
|
421
434
|
interface CallIntegrationResponse {
|
|
422
435
|
/** HTTP status retornado pelo serviço externo */
|
|
@@ -1332,6 +1345,11 @@ declare function listIntegrationsMitra(options?: ListIntegrationsOptions): Promi
|
|
|
1332
1345
|
* POST /interactions/integrations/call
|
|
1333
1346
|
* Chama uma API externa via serviço de integrações
|
|
1334
1347
|
* Mapeia connection → integrationSlug no body
|
|
1348
|
+
*
|
|
1349
|
+
* `headers` é opcional e vale só para esta chamada. Com
|
|
1350
|
+
* `headers: { 'Content-Type': 'application/x-www-form-urlencoded' }` o `body` sai como formulário
|
|
1351
|
+
* (`campo=valor&campo=valor`), o que endpoints OAuth como introspect, revoke e token exigem; o
|
|
1352
|
+
* `body` precisa então ser um objeto plano. Sem esse header, o corpo vai em JSON.
|
|
1335
1353
|
*/
|
|
1336
1354
|
declare function callIntegrationMitra(options: CallIntegrationOptions): Promise<CallIntegrationResponse>;
|
|
1337
1355
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -417,6 +417,19 @@ interface CallIntegrationOptions {
|
|
|
417
417
|
params?: Record<string, unknown>;
|
|
418
418
|
/** Body da requisição (para POST/PUT) */
|
|
419
419
|
body?: Record<string, unknown>;
|
|
420
|
+
/**
|
|
421
|
+
* Headers só desta chamada. Use apenas quando a API externa exigir um header específico.
|
|
422
|
+
*
|
|
423
|
+
* Se a API exigir corpo `application/x-www-form-urlencoded` (comum em endpoints OAuth como
|
|
424
|
+
* introspect, revoke e token), passe `{ 'Content-Type': 'application/x-www-form-urlencoded' }`
|
|
425
|
+
* e monte o `body` como objeto plano de campos texto, número ou booleano: objeto ou lista dentro
|
|
426
|
+
* do `body` é recusado com 400. Sem esse header, o corpo vai em JSON.
|
|
427
|
+
*
|
|
428
|
+
* A autenticação da integração continua sendo aplicada; um header com o mesmo nome de um da
|
|
429
|
+
* integração (ex.: `Authorization`) substitui o da integração nesta chamada. Valores são texto
|
|
430
|
+
* literal. Quando omitido, nenhum header é enviado.
|
|
431
|
+
*/
|
|
432
|
+
headers?: Record<string, string>;
|
|
420
433
|
}
|
|
421
434
|
interface CallIntegrationResponse {
|
|
422
435
|
/** HTTP status retornado pelo serviço externo */
|
|
@@ -1332,6 +1345,11 @@ declare function listIntegrationsMitra(options?: ListIntegrationsOptions): Promi
|
|
|
1332
1345
|
* POST /interactions/integrations/call
|
|
1333
1346
|
* Chama uma API externa via serviço de integrações
|
|
1334
1347
|
* Mapeia connection → integrationSlug no body
|
|
1348
|
+
*
|
|
1349
|
+
* `headers` é opcional e vale só para esta chamada. Com
|
|
1350
|
+
* `headers: { 'Content-Type': 'application/x-www-form-urlencoded' }` o `body` sai como formulário
|
|
1351
|
+
* (`campo=valor&campo=valor`), o que endpoints OAuth como introspect, revoke e token exigem; o
|
|
1352
|
+
* `body` precisa então ser um objeto plano. Sem esse header, o corpo vai em JSON.
|
|
1335
1353
|
*/
|
|
1336
1354
|
declare function callIntegrationMitra(options: CallIntegrationOptions): Promise<CallIntegrationResponse>;
|
|
1337
1355
|
/**
|
package/dist/index.js
CHANGED
|
@@ -823,6 +823,9 @@ async function callIntegrationMitra(options) {
|
|
|
823
823
|
if (options.body !== void 0) {
|
|
824
824
|
body.body = options.body;
|
|
825
825
|
}
|
|
826
|
+
if (options.headers !== void 0) {
|
|
827
|
+
body.headers = options.headers;
|
|
828
|
+
}
|
|
826
829
|
return http.post("/interactions/integrations/call", body);
|
|
827
830
|
}
|
|
828
831
|
async function stopServerFunctionExecutionMitra(options) {
|
|
@@ -2240,6 +2243,7 @@ function createMitraInstance(initialConfig) {
|
|
|
2240
2243
|
if (options.endpoint !== void 0) body.endpoint = options.endpoint;
|
|
2241
2244
|
if (options.params !== void 0) body.params = options.params;
|
|
2242
2245
|
if (options.body !== void 0) body.body = options.body;
|
|
2246
|
+
if (options.headers !== void 0) body.headers = options.headers;
|
|
2243
2247
|
return request("POST", "/interactions/integrations/call", { body });
|
|
2244
2248
|
},
|
|
2245
2249
|
// Dynamic Schema CRUD
|