@unito/integrations-platform-client 0.48.1 → 0.48.3
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/src/api.d.ts +21 -13
- package/dist/src/api.js +16 -3
- package/dist/src/index.cjs +17 -4
- package/package.json +4 -4
package/dist/src/api.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* DO NOT MODIFY - This file has been generated using oazapfts.
|
|
5
5
|
* See https://www.npmjs.com/package/oazapfts
|
|
6
6
|
*/
|
|
7
|
-
import * as Oazapfts from 'oazapfts/
|
|
7
|
+
import * as Oazapfts from '@oazapfts/runtime';
|
|
8
8
|
export declare const defaults: Oazapfts.Defaults<Oazapfts.CustomHeaders>;
|
|
9
9
|
export declare const servers: {
|
|
10
10
|
local: string;
|
|
@@ -66,7 +66,7 @@ export type Error = {
|
|
|
66
66
|
stack?: string[];
|
|
67
67
|
};
|
|
68
68
|
export type AuthorizationMethod = 'custom' | 'oauth2';
|
|
69
|
-
export type AuthorizationGrantType = 'authorization_code' | 'password';
|
|
69
|
+
export type AuthorizationGrantType = 'authorization_code' | 'password' | 'client_credentials';
|
|
70
70
|
export type AuthorizationScope = {
|
|
71
71
|
/** The name of the scope. */
|
|
72
72
|
name: string;
|
|
@@ -161,6 +161,16 @@ export type Credential = Base & {
|
|
|
161
161
|
/** The partition used to divide data into different buckets. */
|
|
162
162
|
partitionKey?: string | null;
|
|
163
163
|
};
|
|
164
|
+
export type CredentialAccount = {
|
|
165
|
+
/** The native id of the provider account. */
|
|
166
|
+
id: string;
|
|
167
|
+
/** The display name of the provider account. */
|
|
168
|
+
displayName: string;
|
|
169
|
+
/** The emails associated with the provider account. */
|
|
170
|
+
emails: string[];
|
|
171
|
+
/** The partition used to divide data into different buckets. */
|
|
172
|
+
partition?: string;
|
|
173
|
+
};
|
|
164
174
|
export type UserRole = 'unitoAdministrator' | 'unitoService' | 'developer';
|
|
165
175
|
export type UserSummary = Base & {
|
|
166
176
|
/** The id of the user. */
|
|
@@ -177,16 +187,6 @@ export type User = UserSummary & {
|
|
|
177
187
|
/** The API key of the user. */
|
|
178
188
|
apiKey: string;
|
|
179
189
|
};
|
|
180
|
-
export type CredentialAccount = {
|
|
181
|
-
/** The native id of the provider account. */
|
|
182
|
-
id: string;
|
|
183
|
-
/** The display name of the provider account. */
|
|
184
|
-
displayName: string;
|
|
185
|
-
/** The emails associated with the provider account. */
|
|
186
|
-
emails: string[];
|
|
187
|
-
/** The partition used to divide data into different buckets. */
|
|
188
|
-
partition?: string;
|
|
189
|
-
};
|
|
190
190
|
/**
|
|
191
191
|
* Get all the integrations
|
|
192
192
|
*/
|
|
@@ -353,6 +353,13 @@ export declare function updateCredential(credentialId: number, body?: {
|
|
|
353
353
|
* Delete a credential
|
|
354
354
|
*/
|
|
355
355
|
export declare function deleteCredential(credentialId: number, opts?: Oazapfts.RequestOpts): Promise<unknown>;
|
|
356
|
+
/**
|
|
357
|
+
* Returns the credentialAccount either from the integration's /me endpoint, if available, or the credential's latestCredentialAccount
|
|
358
|
+
*/
|
|
359
|
+
export declare function getCredentialAccount(xUnitoCredentialId: string, { xUnitoCorrelationId, xUnitoAdditionalLoggingContext, }?: {
|
|
360
|
+
xUnitoCorrelationId?: string;
|
|
361
|
+
xUnitoAdditionalLoggingContext?: string;
|
|
362
|
+
}, opts?: Oazapfts.RequestOpts): Promise<CredentialAccount>;
|
|
356
363
|
/**
|
|
357
364
|
* Used by the frontend to send analytics data
|
|
358
365
|
*/
|
|
@@ -369,6 +376,7 @@ export declare function postTrack(body: {
|
|
|
369
376
|
export declare function encryptData(body: {
|
|
370
377
|
data: string;
|
|
371
378
|
integrationName: string;
|
|
379
|
+
sensitive?: boolean;
|
|
372
380
|
}, opts?: Oazapfts.RequestOpts): Promise<{
|
|
373
381
|
encryptedData: string;
|
|
374
382
|
}>;
|
|
@@ -490,5 +498,5 @@ export declare function regenerateApiKey(userId: number, opts?: Oazapfts.Request
|
|
|
490
498
|
* Get a user by its email address
|
|
491
499
|
*/
|
|
492
500
|
export declare function getUserByEmail(email: string, opts?: Oazapfts.RequestOpts): Promise<User>;
|
|
493
|
-
import { HttpError } from 'oazapfts';
|
|
501
|
+
import { HttpError } from '@oazapfts/runtime';
|
|
494
502
|
export { HttpError };
|
package/dist/src/api.js
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* DO NOT MODIFY - This file has been generated using oazapfts.
|
|
5
5
|
* See https://www.npmjs.com/package/oazapfts
|
|
6
6
|
*/
|
|
7
|
-
import * as Oazapfts from 'oazapfts/
|
|
8
|
-
import * as QS from 'oazapfts/
|
|
7
|
+
import * as Oazapfts from '@oazapfts/runtime';
|
|
8
|
+
import * as QS from '@oazapfts/runtime/query';
|
|
9
9
|
export const defaults = {
|
|
10
10
|
headers: {},
|
|
11
11
|
baseUrl: 'http://localhost:9000',
|
|
@@ -173,6 +173,19 @@ export function deleteCredential(credentialId, opts) {
|
|
|
173
173
|
method: 'DELETE',
|
|
174
174
|
}));
|
|
175
175
|
}
|
|
176
|
+
/**
|
|
177
|
+
* Returns the credentialAccount either from the integration's /me endpoint, if available, or the credential's latestCredentialAccount
|
|
178
|
+
*/
|
|
179
|
+
export function getCredentialAccount(xUnitoCredentialId, { xUnitoCorrelationId, xUnitoAdditionalLoggingContext, } = {}, opts) {
|
|
180
|
+
return oazapfts.ok(oazapfts.fetchJson('/credentialAccount', {
|
|
181
|
+
...opts,
|
|
182
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
183
|
+
'X-Unito-Credential-Id': xUnitoCredentialId,
|
|
184
|
+
'X-Unito-Correlation-Id': xUnitoCorrelationId,
|
|
185
|
+
'X-Unito-Additional-Logging-Context': xUnitoAdditionalLoggingContext,
|
|
186
|
+
}),
|
|
187
|
+
}));
|
|
188
|
+
}
|
|
176
189
|
/**
|
|
177
190
|
* Used by the frontend to send analytics data
|
|
178
191
|
*/
|
|
@@ -379,5 +392,5 @@ export function getUserByEmail(email, opts) {
|
|
|
379
392
|
...opts,
|
|
380
393
|
}));
|
|
381
394
|
}
|
|
382
|
-
import { HttpError } from 'oazapfts';
|
|
395
|
+
import { HttpError } from '@oazapfts/runtime';
|
|
383
396
|
export { HttpError };
|
package/dist/src/index.cjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var Oazapfts = require('oazapfts/
|
|
4
|
-
var QS = require('oazapfts/
|
|
5
|
-
var oazapfts$1 = require('oazapfts');
|
|
3
|
+
var Oazapfts = require('@oazapfts/runtime');
|
|
4
|
+
var QS = require('@oazapfts/runtime/query');
|
|
6
5
|
|
|
7
6
|
function _interopNamespaceDefault(e) {
|
|
8
7
|
var n = Object.create(null);
|
|
@@ -197,6 +196,19 @@ function deleteCredential(credentialId, opts) {
|
|
|
197
196
|
method: 'DELETE',
|
|
198
197
|
}));
|
|
199
198
|
}
|
|
199
|
+
/**
|
|
200
|
+
* Returns the credentialAccount either from the integration's /me endpoint, if available, or the credential's latestCredentialAccount
|
|
201
|
+
*/
|
|
202
|
+
function getCredentialAccount(xUnitoCredentialId, { xUnitoCorrelationId, xUnitoAdditionalLoggingContext, } = {}, opts) {
|
|
203
|
+
return oazapfts.ok(oazapfts.fetchJson('/credentialAccount', {
|
|
204
|
+
...opts,
|
|
205
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
206
|
+
'X-Unito-Credential-Id': xUnitoCredentialId,
|
|
207
|
+
'X-Unito-Correlation-Id': xUnitoCorrelationId,
|
|
208
|
+
'X-Unito-Additional-Logging-Context': xUnitoAdditionalLoggingContext,
|
|
209
|
+
}),
|
|
210
|
+
}));
|
|
211
|
+
}
|
|
200
212
|
/**
|
|
201
213
|
* Used by the frontend to send analytics data
|
|
202
214
|
*/
|
|
@@ -406,7 +418,7 @@ function getUserByEmail(email, opts) {
|
|
|
406
418
|
|
|
407
419
|
var api = {
|
|
408
420
|
__proto__: null,
|
|
409
|
-
HttpError:
|
|
421
|
+
HttpError: Oazapfts.HttpError,
|
|
410
422
|
createCredential: createCredential,
|
|
411
423
|
createIntegration: createIntegration,
|
|
412
424
|
createUser: createUser,
|
|
@@ -416,6 +428,7 @@ var api = {
|
|
|
416
428
|
deleteIntegration: deleteIntegration,
|
|
417
429
|
deleteProxyGraph: deleteProxyGraph,
|
|
418
430
|
encryptData: encryptData,
|
|
431
|
+
getCredentialAccount: getCredentialAccount,
|
|
419
432
|
getCredentialById: getCredentialById,
|
|
420
433
|
getCredentials: getCredentials,
|
|
421
434
|
getIntegrationById: getIntegrationById,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unito/integrations-platform-client",
|
|
3
|
-
"version": "0.48.
|
|
3
|
+
"version": "0.48.3",
|
|
4
4
|
"description": "The Unito Integrations Platform Client",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/src/index.d.ts",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/node": "18.x",
|
|
39
39
|
"@types/sinon": "17.x",
|
|
40
|
-
"@typescript-eslint/eslint-plugin": "
|
|
41
|
-
"@typescript-eslint/parser": "
|
|
40
|
+
"@typescript-eslint/eslint-plugin": "7.x",
|
|
41
|
+
"@typescript-eslint/parser": "7.x",
|
|
42
42
|
"c8": "9.x",
|
|
43
43
|
"eslint": "8.x",
|
|
44
44
|
"prettier": "3.x",
|
|
@@ -48,6 +48,6 @@
|
|
|
48
48
|
"typescript": "5.x"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"oazapfts": "
|
|
51
|
+
"@oazapfts/runtime": "1.x"
|
|
52
52
|
}
|
|
53
53
|
}
|