@unito/integrations-platform-client 0.48.2 → 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 +18 -11
- package/dist/src/api.js +13 -0
- package/dist/src/index.cjs +14 -0
- package/package.json +1 -1
package/dist/src/api.d.ts
CHANGED
|
@@ -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
|
*/
|
package/dist/src/api.js
CHANGED
|
@@ -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
|
*/
|
package/dist/src/index.cjs
CHANGED
|
@@ -196,6 +196,19 @@ function deleteCredential(credentialId, opts) {
|
|
|
196
196
|
method: 'DELETE',
|
|
197
197
|
}));
|
|
198
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
|
+
}
|
|
199
212
|
/**
|
|
200
213
|
* Used by the frontend to send analytics data
|
|
201
214
|
*/
|
|
@@ -415,6 +428,7 @@ var api = {
|
|
|
415
428
|
deleteIntegration: deleteIntegration,
|
|
416
429
|
deleteProxyGraph: deleteProxyGraph,
|
|
417
430
|
encryptData: encryptData,
|
|
431
|
+
getCredentialAccount: getCredentialAccount,
|
|
418
432
|
getCredentialById: getCredentialById,
|
|
419
433
|
getCredentials: getCredentials,
|
|
420
434
|
getIntegrationById: getIntegrationById,
|