@contio/partner-sdk 1.4.5 → 1.4.6
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/client/_http.d.ts +12 -0
- package/dist/client/_http.d.ts.map +1 -0
- package/dist/client/_http.js +3 -0
- package/dist/client/_http.js.map +1 -0
- package/dist/client/admin/app.d.ts +6 -0
- package/dist/client/admin/app.d.ts.map +1 -0
- package/dist/client/admin/app.js +15 -0
- package/dist/client/admin/app.js.map +1 -0
- package/dist/client/admin/connections.d.ts +6 -0
- package/dist/client/admin/connections.d.ts.map +1 -0
- package/dist/client/admin/connections.js +15 -0
- package/dist/client/admin/connections.js.map +1 -0
- package/dist/client/admin/credentials.d.ts +9 -0
- package/dist/client/admin/credentials.d.ts.map +1 -0
- package/dist/client/admin/credentials.js +27 -0
- package/dist/client/admin/credentials.js.map +1 -0
- package/dist/client/admin/idp.d.ts +7 -0
- package/dist/client/admin/idp.d.ts.map +1 -0
- package/dist/client/admin/idp.js +19 -0
- package/dist/client/admin/idp.js.map +1 -0
- package/dist/client/{admin.d.ts → admin/index.d.ts} +5 -4
- package/dist/client/admin/index.d.ts.map +1 -0
- package/dist/client/admin/index.js +151 -0
- package/dist/client/admin/index.js.map +1 -0
- package/dist/client/admin/webhooks.d.ts +12 -0
- package/dist/client/admin/webhooks.d.ts.map +1 -0
- package/dist/client/admin/webhooks.js +27 -0
- package/dist/client/admin/webhooks.js.map +1 -0
- package/dist/client/admin/workflows.d.ts +8 -0
- package/dist/client/admin/workflows.d.ts.map +1 -0
- package/dist/client/admin/workflows.js +23 -0
- package/dist/client/admin/workflows.js.map +1 -0
- package/dist/client/base.d.ts +5 -2
- package/dist/client/base.d.ts.map +1 -1
- package/dist/client/base.js +25 -13
- package/dist/client/base.js.map +1 -1
- package/dist/client/user/actionItems.d.ts +10 -0
- package/dist/client/user/actionItems.d.ts.map +1 -0
- package/dist/client/user/actionItems.js +37 -0
- package/dist/client/user/actionItems.js.map +1 -0
- package/dist/client/user/calendar.d.ts +9 -0
- package/dist/client/user/calendar.d.ts.map +1 -0
- package/dist/client/user/calendar.js +36 -0
- package/dist/client/user/calendar.js.map +1 -0
- package/dist/client/user/context.d.ts +11 -0
- package/dist/client/user/context.d.ts.map +1 -0
- package/dist/client/user/context.js +68 -0
- package/dist/client/user/context.js.map +1 -0
- package/dist/client/{user.d.ts → user/index.d.ts} +22 -15
- package/dist/client/user/index.d.ts.map +1 -0
- package/dist/client/user/index.js +175 -0
- package/dist/client/user/index.js.map +1 -0
- package/dist/client/user/meetings.d.ts +20 -0
- package/dist/client/user/meetings.d.ts.map +1 -0
- package/dist/client/user/meetings.js +65 -0
- package/dist/client/user/meetings.js.map +1 -0
- package/dist/client/user/profile.d.ts +5 -0
- package/dist/client/user/profile.d.ts.map +1 -0
- package/dist/client/user/profile.js +7 -0
- package/dist/client/user/profile.js.map +1 -0
- package/dist/esm/client/_http.js +2 -0
- package/dist/esm/client/_http.js.map +1 -0
- package/dist/esm/client/admin/app.js +10 -0
- package/dist/esm/client/admin/app.js.map +1 -0
- package/dist/esm/client/admin/connections.js +10 -0
- package/dist/esm/client/admin/connections.js.map +1 -0
- package/dist/esm/client/admin/credentials.js +19 -0
- package/dist/esm/client/admin/credentials.js.map +1 -0
- package/dist/esm/client/admin/idp.js +13 -0
- package/dist/esm/client/admin/idp.js.map +1 -0
- package/dist/esm/client/admin/index.js +114 -0
- package/dist/esm/client/admin/index.js.map +1 -0
- package/dist/esm/client/admin/webhooks.js +19 -0
- package/dist/esm/client/admin/webhooks.js.map +1 -0
- package/dist/esm/client/admin/workflows.js +16 -0
- package/dist/esm/client/admin/workflows.js.map +1 -0
- package/dist/esm/client/base.js +25 -13
- package/dist/esm/client/base.js.map +1 -1
- package/dist/esm/client/user/actionItems.js +29 -0
- package/dist/esm/client/user/actionItems.js.map +1 -0
- package/dist/esm/client/user/calendar.js +29 -0
- package/dist/esm/client/user/calendar.js.map +1 -0
- package/dist/esm/client/user/context.js +59 -0
- package/dist/esm/client/user/context.js.map +1 -0
- package/dist/esm/client/user/index.js +138 -0
- package/dist/esm/client/user/index.js.map +1 -0
- package/dist/esm/client/user/meetings.js +51 -0
- package/dist/esm/client/user/meetings.js.map +1 -0
- package/dist/esm/client/user/profile.js +4 -0
- package/dist/esm/client/user/profile.js.map +1 -0
- package/dist/esm/models/context.js +2 -0
- package/dist/esm/models/context.js.map +1 -0
- package/dist/esm/models/index.js +1 -0
- package/dist/esm/models/index.js.map +1 -1
- package/dist/generated/api-types.d.ts +433 -227
- package/dist/generated/api-types.d.ts.map +1 -1
- package/dist/generated/index.d.ts +12 -12
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/models/calendar.d.ts +2 -2
- package/dist/models/calendar.d.ts.map +1 -1
- package/dist/models/context.d.ts +40 -0
- package/dist/models/context.d.ts.map +1 -0
- package/dist/models/context.js +3 -0
- package/dist/models/context.js.map +1 -0
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +1 -0
- package/dist/models/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/client/admin.d.ts.map +0 -1
- package/dist/client/admin.js +0 -103
- package/dist/client/admin.js.map +0 -1
- package/dist/client/user.d.ts.map +0 -1
- package/dist/client/user.js +0 -147
- package/dist/client/user.js.map +0 -1
- package/dist/esm/client/admin.js +0 -99
- package/dist/esm/client/admin.js.map +0 -1
- package/dist/esm/client/user.js +0 -143
- package/dist/esm/client/user.js.map +0 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import { RequestOptions } from './base';
|
|
3
|
+
export interface HttpTransport {
|
|
4
|
+
get<T>(path: string, params?: object, options?: RequestOptions): Promise<T>;
|
|
5
|
+
post<T>(path: string, data?: unknown, options?: RequestOptions): Promise<T>;
|
|
6
|
+
put<T>(path: string, data?: unknown, options?: RequestOptions): Promise<T>;
|
|
7
|
+
patch<T>(path: string, data?: unknown, options?: RequestOptions): Promise<T>;
|
|
8
|
+
delete<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
9
|
+
postForm<T>(path: string, formData: FormData, options?: RequestOptions): Promise<T>;
|
|
10
|
+
getRaw(path: string, params?: object, options?: RequestOptions, responseType?: 'arraybuffer' | 'blob' | 'stream'): Promise<AxiosResponse>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=_http.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_http.d.ts","sourceRoot":"","sources":["../../src/client/_http.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAUxC,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAC5E,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAC5E,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3E,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAC7E,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAC9D,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACpF,MAAM,CACJ,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,cAAc,EACxB,YAAY,CAAC,EAAE,aAAa,GAAG,MAAM,GAAG,QAAQ,GAC/C,OAAO,CAAC,aAAa,CAAC,CAAC;CAC3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_http.js","sourceRoot":"","sources":["../../src/client/_http.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HttpTransport } from '../_http';
|
|
2
|
+
import { PartnerApp, UpdatePartnerAppRequest, UpdatePartnerAppStatusRequest } from '../../models';
|
|
3
|
+
export declare function getApp(http: HttpTransport): Promise<PartnerApp>;
|
|
4
|
+
export declare function updateApp(http: HttpTransport, data: UpdatePartnerAppRequest): Promise<PartnerApp>;
|
|
5
|
+
export declare function updateAppStatus(http: HttpTransport, data: UpdatePartnerAppStatusRequest): Promise<PartnerApp>;
|
|
6
|
+
//# sourceMappingURL=app.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/client/admin/app.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EACL,UAAU,EACV,uBAAuB,EACvB,6BAA6B,EAC9B,MAAM,cAAc,CAAC;AAEtB,wBAAsB,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,CAErE;AAED,wBAAsB,SAAS,CAC7B,IAAI,EAAE,aAAa,EACnB,IAAI,EAAE,uBAAuB,GAC5B,OAAO,CAAC,UAAU,CAAC,CAErB;AAED,wBAAsB,eAAe,CACnC,IAAI,EAAE,aAAa,EACnB,IAAI,EAAE,6BAA6B,GAClC,OAAO,CAAC,UAAU,CAAC,CAErB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getApp = getApp;
|
|
4
|
+
exports.updateApp = updateApp;
|
|
5
|
+
exports.updateAppStatus = updateAppStatus;
|
|
6
|
+
async function getApp(http) {
|
|
7
|
+
return http.get('/app');
|
|
8
|
+
}
|
|
9
|
+
async function updateApp(http, data) {
|
|
10
|
+
return http.put('/app', data);
|
|
11
|
+
}
|
|
12
|
+
async function updateAppStatus(http, data) {
|
|
13
|
+
return http.put('/app/status', data);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=app.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/client/admin/app.ts"],"names":[],"mappings":";;AAcA,wBAEC;AAED,8BAKC;AAED,0CAKC;AAhBM,KAAK,UAAU,MAAM,CAAC,IAAmB;IAC9C,OAAO,IAAI,CAAC,GAAG,CAAa,MAAM,CAAC,CAAC;AACtC,CAAC;AAEM,KAAK,UAAU,SAAS,CAC7B,IAAmB,EACnB,IAA6B;IAE7B,OAAO,IAAI,CAAC,GAAG,CAAa,MAAM,EAAE,IAAI,CAAC,CAAC;AAC5C,CAAC;AAEM,KAAK,UAAU,eAAe,CACnC,IAAmB,EACnB,IAAmC;IAEnC,OAAO,IAAI,CAAC,GAAG,CAAa,aAAa,EAAE,IAAI,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HttpTransport } from '../_http';
|
|
2
|
+
import { UserConnection, UserConnectionListParams, UserConnectionListResponse } from '../../models';
|
|
3
|
+
export declare function getUserConnections(http: HttpTransport, params?: UserConnectionListParams): Promise<UserConnectionListResponse>;
|
|
4
|
+
export declare function getUserConnection(http: HttpTransport, connectionId: string): Promise<UserConnection>;
|
|
5
|
+
export declare function revokeUserConnection(http: HttpTransport, connectionId: string): Promise<void>;
|
|
6
|
+
//# sourceMappingURL=connections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connections.d.ts","sourceRoot":"","sources":["../../../src/client/admin/connections.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EACL,cAAc,EACd,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,cAAc,CAAC;AAEtB,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,aAAa,EACnB,MAAM,CAAC,EAAE,wBAAwB,GAChC,OAAO,CAAC,0BAA0B,CAAC,CAErC;AAED,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,aAAa,EACnB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,cAAc,CAAC,CAEzB;AAED,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,aAAa,EACnB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC,CAEf"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getUserConnections = getUserConnections;
|
|
4
|
+
exports.getUserConnection = getUserConnection;
|
|
5
|
+
exports.revokeUserConnection = revokeUserConnection;
|
|
6
|
+
async function getUserConnections(http, params) {
|
|
7
|
+
return http.get('/connections', params);
|
|
8
|
+
}
|
|
9
|
+
async function getUserConnection(http, connectionId) {
|
|
10
|
+
return http.get(`/connections/${connectionId}`);
|
|
11
|
+
}
|
|
12
|
+
async function revokeUserConnection(http, connectionId) {
|
|
13
|
+
await http.delete(`/connections/${connectionId}`);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=connections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connections.js","sourceRoot":"","sources":["../../../src/client/admin/connections.ts"],"names":[],"mappings":";;AAcA,gDAKC;AAED,8CAKC;AAED,oDAKC;AAnBM,KAAK,UAAU,kBAAkB,CACtC,IAAmB,EACnB,MAAiC;IAEjC,OAAO,IAAI,CAAC,GAAG,CAA6B,cAAc,EAAE,MAAM,CAAC,CAAC;AACtE,CAAC;AAEM,KAAK,UAAU,iBAAiB,CACrC,IAAmB,EACnB,YAAoB;IAEpB,OAAO,IAAI,CAAC,GAAG,CAAiB,gBAAgB,YAAY,EAAE,CAAC,CAAC;AAClE,CAAC;AAEM,KAAK,UAAU,oBAAoB,CACxC,IAAmB,EACnB,YAAoB;IAEpB,MAAM,IAAI,CAAC,MAAM,CAAC,gBAAgB,YAAY,EAAE,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HttpTransport } from '../_http';
|
|
2
|
+
import { CredentialStatusResponse, CredentialRotationRequest, CredentialRotationResponse, CredentialRollbackRequest, CredentialAuditHistoryParams, CredentialAuditHistoryResponse } from '../../models';
|
|
3
|
+
export declare function getCredentialStatus(http: HttpTransport): Promise<CredentialStatusResponse>;
|
|
4
|
+
export declare function rotateAPIKey(http: HttpTransport, request: CredentialRotationRequest): Promise<CredentialRotationResponse>;
|
|
5
|
+
export declare function rotateWebhookSecret(http: HttpTransport, request: CredentialRotationRequest): Promise<CredentialRotationResponse>;
|
|
6
|
+
export declare function rotateClientSecret(http: HttpTransport, request: CredentialRotationRequest): Promise<CredentialRotationResponse>;
|
|
7
|
+
export declare function rollbackCredential(http: HttpTransport, credentialType: 'api-key' | 'client-secret', request: CredentialRollbackRequest): Promise<void>;
|
|
8
|
+
export declare function getCredentialHistory(http: HttpTransport, params?: CredentialAuditHistoryParams): Promise<CredentialAuditHistoryResponse>;
|
|
9
|
+
//# sourceMappingURL=credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../src/client/admin/credentials.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,EAC1B,yBAAyB,EACzB,4BAA4B,EAC5B,8BAA8B,EAC/B,MAAM,cAAc,CAAC;AAEtB,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,wBAAwB,CAAC,CAEnC;AAED,wBAAsB,YAAY,CAChC,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,0BAA0B,CAAC,CAErC;AAED,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,0BAA0B,CAAC,CAErC;AAED,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,0BAA0B,CAAC,CAErC;AAED,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,aAAa,EACnB,cAAc,EAAE,SAAS,GAAG,eAAe,EAC3C,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,IAAI,CAAC,CAEf;AAED,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,aAAa,EACnB,MAAM,CAAC,EAAE,4BAA4B,GACpC,OAAO,CAAC,8BAA8B,CAAC,CAEzC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCredentialStatus = getCredentialStatus;
|
|
4
|
+
exports.rotateAPIKey = rotateAPIKey;
|
|
5
|
+
exports.rotateWebhookSecret = rotateWebhookSecret;
|
|
6
|
+
exports.rotateClientSecret = rotateClientSecret;
|
|
7
|
+
exports.rollbackCredential = rollbackCredential;
|
|
8
|
+
exports.getCredentialHistory = getCredentialHistory;
|
|
9
|
+
async function getCredentialStatus(http) {
|
|
10
|
+
return http.get('/credentials');
|
|
11
|
+
}
|
|
12
|
+
async function rotateAPIKey(http, request) {
|
|
13
|
+
return http.post('/credentials/api-key/rotate', request);
|
|
14
|
+
}
|
|
15
|
+
async function rotateWebhookSecret(http, request) {
|
|
16
|
+
return http.post('/credentials/webhook-secret/rotate', request);
|
|
17
|
+
}
|
|
18
|
+
async function rotateClientSecret(http, request) {
|
|
19
|
+
return http.post('/credentials/client-secret/rotate', request);
|
|
20
|
+
}
|
|
21
|
+
async function rollbackCredential(http, credentialType, request) {
|
|
22
|
+
await http.post(`/credentials/${credentialType}/rollback`, request);
|
|
23
|
+
}
|
|
24
|
+
async function getCredentialHistory(http, params) {
|
|
25
|
+
return http.get('/credentials/history', params);
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../../src/client/admin/credentials.ts"],"names":[],"mappings":";;AAiBA,kDAIC;AAED,oCAKC;AAED,kDAKC;AAED,gDAKC;AAED,gDAMC;AAED,oDAKC;AAxCM,KAAK,UAAU,mBAAmB,CACvC,IAAmB;IAEnB,OAAO,IAAI,CAAC,GAAG,CAA2B,cAAc,CAAC,CAAC;AAC5D,CAAC;AAEM,KAAK,UAAU,YAAY,CAChC,IAAmB,EACnB,OAAkC;IAElC,OAAO,IAAI,CAAC,IAAI,CAA6B,6BAA6B,EAAE,OAAO,CAAC,CAAC;AACvF,CAAC;AAEM,KAAK,UAAU,mBAAmB,CACvC,IAAmB,EACnB,OAAkC;IAElC,OAAO,IAAI,CAAC,IAAI,CAA6B,oCAAoC,EAAE,OAAO,CAAC,CAAC;AAC9F,CAAC;AAEM,KAAK,UAAU,kBAAkB,CACtC,IAAmB,EACnB,OAAkC;IAElC,OAAO,IAAI,CAAC,IAAI,CAA6B,mCAAmC,EAAE,OAAO,CAAC,CAAC;AAC7F,CAAC;AAEM,KAAK,UAAU,kBAAkB,CACtC,IAAmB,EACnB,cAA2C,EAC3C,OAAkC;IAElC,MAAM,IAAI,CAAC,IAAI,CAAC,gBAAgB,cAAc,WAAW,EAAE,OAAO,CAAC,CAAC;AACtE,CAAC;AAEM,KAAK,UAAU,oBAAoB,CACxC,IAAmB,EACnB,MAAqC;IAErC,OAAO,IAAI,CAAC,GAAG,CAAiC,sBAAsB,EAAE,MAAM,CAAC,CAAC;AAClF,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HttpTransport } from '../_http';
|
|
2
|
+
import { PartnerIdPConfig, CreateIdPConfigRequest, UpdateIdPConfigRequest } from '../../models';
|
|
3
|
+
export declare function createIdPConfig(http: HttpTransport, data: CreateIdPConfigRequest): Promise<PartnerIdPConfig>;
|
|
4
|
+
export declare function getIdPConfig(http: HttpTransport): Promise<PartnerIdPConfig>;
|
|
5
|
+
export declare function updateIdPConfig(http: HttpTransport, data: UpdateIdPConfigRequest): Promise<PartnerIdPConfig>;
|
|
6
|
+
export declare function deleteIdPConfig(http: HttpTransport): Promise<void>;
|
|
7
|
+
//# sourceMappingURL=idp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"idp.d.ts","sourceRoot":"","sources":["../../../src/client/admin/idp.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,cAAc,CAAC;AAEtB,wBAAsB,eAAe,CACnC,IAAI,EAAE,aAAa,EACnB,IAAI,EAAE,sBAAsB,GAC3B,OAAO,CAAC,gBAAgB,CAAC,CAE3B;AAED,wBAAsB,YAAY,CAChC,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,gBAAgB,CAAC,CAE3B;AAED,wBAAsB,eAAe,CACnC,IAAI,EAAE,aAAa,EACnB,IAAI,EAAE,sBAAsB,GAC3B,OAAO,CAAC,gBAAgB,CAAC,CAE3B;AAED,wBAAsB,eAAe,CACnC,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,IAAI,CAAC,CAEf"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createIdPConfig = createIdPConfig;
|
|
4
|
+
exports.getIdPConfig = getIdPConfig;
|
|
5
|
+
exports.updateIdPConfig = updateIdPConfig;
|
|
6
|
+
exports.deleteIdPConfig = deleteIdPConfig;
|
|
7
|
+
async function createIdPConfig(http, data) {
|
|
8
|
+
return http.post('/idp', data);
|
|
9
|
+
}
|
|
10
|
+
async function getIdPConfig(http) {
|
|
11
|
+
return http.get('/idp');
|
|
12
|
+
}
|
|
13
|
+
async function updateIdPConfig(http, data) {
|
|
14
|
+
return http.put('/idp', data);
|
|
15
|
+
}
|
|
16
|
+
async function deleteIdPConfig(http) {
|
|
17
|
+
await http.delete('/idp');
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=idp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"idp.js","sourceRoot":"","sources":["../../../src/client/admin/idp.ts"],"names":[],"mappings":";;AAcA,0CAKC;AAED,oCAIC;AAED,0CAKC;AAED,0CAIC;AAxBM,KAAK,UAAU,eAAe,CACnC,IAAmB,EACnB,IAA4B;IAE5B,OAAO,IAAI,CAAC,IAAI,CAAmB,MAAM,EAAE,IAAI,CAAC,CAAC;AACnD,CAAC;AAEM,KAAK,UAAU,YAAY,CAChC,IAAmB;IAEnB,OAAO,IAAI,CAAC,GAAG,CAAmB,MAAM,CAAC,CAAC;AAC5C,CAAC;AAEM,KAAK,UAAU,eAAe,CACnC,IAAmB,EACnB,IAA4B;IAE5B,OAAO,IAAI,CAAC,GAAG,CAAmB,MAAM,EAAE,IAAI,CAAC,CAAC;AAClD,CAAC;AAEM,KAAK,UAAU,eAAe,CACnC,IAAmB;IAEnB,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { InternalAxiosRequestConfig } from 'axios';
|
|
2
|
-
import { BaseClient, ClientConfig } from '
|
|
3
|
-
import { ApiKeyClient } from '
|
|
4
|
-
import { Workflow, WorkflowListParams, WorkflowListResponse, CreateWorkflowRequest, UpdateWorkflowRequest, WebhookDelivery, WebhookDeliveryListParams, WebhookDeliveryListResponse, PartnerApp, UpdatePartnerAppRequest, UpdatePartnerAppStatusRequest, UpdateWebhookStatusRequest, SetWebhookFilterRequest, UserConnection, UserConnectionListParams, UserConnectionListResponse, CredentialStatusResponse, CredentialRotationRequest, CredentialRotationResponse, CredentialRollbackRequest, CredentialAuditHistoryParams, CredentialAuditHistoryResponse, PartnerIdPConfig, CreateIdPConfigRequest, UpdateIdPConfigRequest } from '
|
|
2
|
+
import { BaseClient, ClientConfig } from '../base';
|
|
3
|
+
import { ApiKeyClient } from '../../auth/apiKey';
|
|
4
|
+
import { Workflow, WorkflowListParams, WorkflowListResponse, CreateWorkflowRequest, UpdateWorkflowRequest, WebhookDelivery, WebhookDeliveryListParams, WebhookDeliveryListResponse, PartnerApp, UpdatePartnerAppRequest, UpdatePartnerAppStatusRequest, UpdateWebhookStatusRequest, SetWebhookFilterRequest, UserConnection, UserConnectionListParams, UserConnectionListResponse, CredentialStatusResponse, CredentialRotationRequest, CredentialRotationResponse, CredentialRollbackRequest, CredentialAuditHistoryParams, CredentialAuditHistoryResponse, PartnerIdPConfig, CreateIdPConfigRequest, UpdateIdPConfigRequest } from '../../models';
|
|
5
5
|
export declare class PartnerAdminClient extends BaseClient {
|
|
6
6
|
private apiKeyClient;
|
|
7
|
+
private readonly http;
|
|
7
8
|
constructor(apiKeyClient: ApiKeyClient, config?: ClientConfig);
|
|
8
9
|
protected addAuthHeaders(config: InternalAxiosRequestConfig): InternalAxiosRequestConfig | Promise<InternalAxiosRequestConfig>;
|
|
9
10
|
createWorkflow(data: CreateWorkflowRequest): Promise<Workflow>;
|
|
@@ -37,4 +38,4 @@ export declare class PartnerAdminClient extends BaseClient {
|
|
|
37
38
|
updateIdPConfig(data: UpdateIdPConfigRequest): Promise<PartnerIdPConfig>;
|
|
38
39
|
deleteIdPConfig(): Promise<void>;
|
|
39
40
|
}
|
|
40
|
-
//# sourceMappingURL=
|
|
41
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/admin/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,0BAA0B,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAkB,MAAM,SAAS,CAAC;AAEnE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EACL,QAAQ,EACR,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EACf,yBAAyB,EACzB,2BAA2B,EAC3B,UAAU,EACV,uBAAuB,EACvB,6BAA6B,EAC7B,0BAA0B,EAC1B,uBAAuB,EACvB,cAAc,EACd,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,EAC1B,yBAAyB,EACzB,4BAA4B,EAC5B,8BAA8B,EAC9B,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,cAAc,CAAC;AA0BtB,qBAAa,kBAAmB,SAAQ,UAAU;IAChD,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAgB;gBAQzB,YAAY,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,YAAY;IAsB7D,SAAS,CAAC,cAAc,CAAC,MAAM,EAAE,0BAA0B,GAAG,0BAA0B,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAuBxH,cAAc,CAAC,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAa9D,YAAY,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG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,OAAO,CAAC,0BAA0B,CAAC;IAiCrF,mBAAmB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,0BAA0B,CAAC;IA8B5F,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAyB3F,kBAAkB,CACtB,cAAc,EAAE,SAAS,GAAG,eAAe,EAC3C,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,IAAI,CAAC;IAoCV,oBAAoB,CAAC,MAAM,CAAC,EAAE,4BAA4B,GAAG,OAAO,CAAC,8BAA8B,CAAC;IA0BpG,eAAe,CAAC,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAUxE,YAAY,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAWzC,eAAe,CAAC,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAYxE,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;CAGvC"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.PartnerAdminClient = void 0;
|
|
37
|
+
const base_1 = require("../base");
|
|
38
|
+
const workflows = __importStar(require("./workflows"));
|
|
39
|
+
const app = __importStar(require("./app"));
|
|
40
|
+
const webhooks = __importStar(require("./webhooks"));
|
|
41
|
+
const connections = __importStar(require("./connections"));
|
|
42
|
+
const credentials = __importStar(require("./credentials"));
|
|
43
|
+
const idp = __importStar(require("./idp"));
|
|
44
|
+
class PartnerAdminClient extends base_1.BaseClient {
|
|
45
|
+
constructor(apiKeyClient, config) {
|
|
46
|
+
const baseURL = config?.baseURL || 'https://api.contio.ai';
|
|
47
|
+
const finalURL = `${baseURL}/v1/partner/admin`;
|
|
48
|
+
super({
|
|
49
|
+
...config,
|
|
50
|
+
baseURL: finalURL,
|
|
51
|
+
});
|
|
52
|
+
this.apiKeyClient = apiKeyClient;
|
|
53
|
+
this.http = {
|
|
54
|
+
get: (...args) => this.get(...args),
|
|
55
|
+
post: (...args) => this.post(...args),
|
|
56
|
+
put: (...args) => this.put(...args),
|
|
57
|
+
patch: (...args) => this.patch(...args),
|
|
58
|
+
delete: (...args) => this.delete(...args),
|
|
59
|
+
postForm: (...args) => this.postForm(...args),
|
|
60
|
+
getRaw: (...args) => this.getRaw(...args),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
addAuthHeaders(config) {
|
|
64
|
+
config.headers = config.headers || {};
|
|
65
|
+
Object.assign(config.headers, this.apiKeyClient.getHeaders());
|
|
66
|
+
return config;
|
|
67
|
+
}
|
|
68
|
+
async createWorkflow(data) {
|
|
69
|
+
return workflows.createWorkflow(this.http, data);
|
|
70
|
+
}
|
|
71
|
+
async getWorkflows(params) {
|
|
72
|
+
return workflows.getWorkflows(this.http, params);
|
|
73
|
+
}
|
|
74
|
+
async getWorkflow(workflowId) {
|
|
75
|
+
return workflows.getWorkflow(this.http, workflowId);
|
|
76
|
+
}
|
|
77
|
+
async updateWorkflow(workflowId, data) {
|
|
78
|
+
return workflows.updateWorkflow(this.http, workflowId, data);
|
|
79
|
+
}
|
|
80
|
+
async deleteWorkflow(workflowId) {
|
|
81
|
+
return workflows.deleteWorkflow(this.http, workflowId);
|
|
82
|
+
}
|
|
83
|
+
async getApp() {
|
|
84
|
+
return app.getApp(this.http);
|
|
85
|
+
}
|
|
86
|
+
async updateApp(data) {
|
|
87
|
+
return app.updateApp(this.http, data);
|
|
88
|
+
}
|
|
89
|
+
async updateAppStatus(data) {
|
|
90
|
+
return app.updateAppStatus(this.http, data);
|
|
91
|
+
}
|
|
92
|
+
async getWebhookDeliveries(params) {
|
|
93
|
+
return webhooks.getWebhookDeliveries(this.http, params);
|
|
94
|
+
}
|
|
95
|
+
async getWebhookDelivery(deliveryId) {
|
|
96
|
+
return webhooks.getWebhookDelivery(this.http, deliveryId);
|
|
97
|
+
}
|
|
98
|
+
async retryWebhookDelivery(deliveryId) {
|
|
99
|
+
return webhooks.retryWebhookDelivery(this.http, deliveryId);
|
|
100
|
+
}
|
|
101
|
+
async updateWebhookStatus(data) {
|
|
102
|
+
return webhooks.updateWebhookStatus(this.http, data);
|
|
103
|
+
}
|
|
104
|
+
async setWebhookFilter(data) {
|
|
105
|
+
return webhooks.setWebhookFilter(this.http, data);
|
|
106
|
+
}
|
|
107
|
+
async removeWebhookFilter() {
|
|
108
|
+
return webhooks.removeWebhookFilter(this.http);
|
|
109
|
+
}
|
|
110
|
+
async getUserConnections(params) {
|
|
111
|
+
return connections.getUserConnections(this.http, params);
|
|
112
|
+
}
|
|
113
|
+
async getUserConnection(connectionId) {
|
|
114
|
+
return connections.getUserConnection(this.http, connectionId);
|
|
115
|
+
}
|
|
116
|
+
async revokeUserConnection(connectionId) {
|
|
117
|
+
return connections.revokeUserConnection(this.http, connectionId);
|
|
118
|
+
}
|
|
119
|
+
async getCredentialStatus() {
|
|
120
|
+
return credentials.getCredentialStatus(this.http);
|
|
121
|
+
}
|
|
122
|
+
async rotateAPIKey(request) {
|
|
123
|
+
return credentials.rotateAPIKey(this.http, request);
|
|
124
|
+
}
|
|
125
|
+
async rotateWebhookSecret(request) {
|
|
126
|
+
return credentials.rotateWebhookSecret(this.http, request);
|
|
127
|
+
}
|
|
128
|
+
async rotateClientSecret(request) {
|
|
129
|
+
return credentials.rotateClientSecret(this.http, request);
|
|
130
|
+
}
|
|
131
|
+
async rollbackCredential(credentialType, request) {
|
|
132
|
+
return credentials.rollbackCredential(this.http, credentialType, request);
|
|
133
|
+
}
|
|
134
|
+
async getCredentialHistory(params) {
|
|
135
|
+
return credentials.getCredentialHistory(this.http, params);
|
|
136
|
+
}
|
|
137
|
+
async createIdPConfig(data) {
|
|
138
|
+
return idp.createIdPConfig(this.http, data);
|
|
139
|
+
}
|
|
140
|
+
async getIdPConfig() {
|
|
141
|
+
return idp.getIdPConfig(this.http);
|
|
142
|
+
}
|
|
143
|
+
async updateIdPConfig(data) {
|
|
144
|
+
return idp.updateIdPConfig(this.http, data);
|
|
145
|
+
}
|
|
146
|
+
async deleteIdPConfig() {
|
|
147
|
+
return idp.deleteIdPConfig(this.http);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
exports.PartnerAdminClient = Part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;IAC9C,CAAC;IAUD,KAAK,CAAC,eAAe;QACnB,OAAO,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;CACF;AAtkBD,gDAskBC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HttpTransport } from '../_http';
|
|
2
|
+
import { PartnerApp, WebhookDelivery, WebhookDeliveryListParams, WebhookDeliveryListResponse, UpdateWebhookStatusRequest, SetWebhookFilterRequest } from '../../models';
|
|
3
|
+
export declare function getWebhookDeliveries(http: HttpTransport, params?: WebhookDeliveryListParams): Promise<WebhookDeliveryListResponse>;
|
|
4
|
+
export declare function getWebhookDelivery(http: HttpTransport, deliveryId: string): Promise<WebhookDelivery>;
|
|
5
|
+
export declare function retryWebhookDelivery(http: HttpTransport, deliveryId: string): Promise<{
|
|
6
|
+
message: string;
|
|
7
|
+
retry_scheduled: boolean;
|
|
8
|
+
}>;
|
|
9
|
+
export declare function updateWebhookStatus(http: HttpTransport, data: UpdateWebhookStatusRequest): Promise<PartnerApp>;
|
|
10
|
+
export declare function setWebhookFilter(http: HttpTransport, data: SetWebhookFilterRequest): Promise<PartnerApp>;
|
|
11
|
+
export declare function removeWebhookFilter(http: HttpTransport): Promise<PartnerApp>;
|
|
12
|
+
//# sourceMappingURL=webhooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../../src/client/admin/webhooks.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EACL,UAAU,EACV,eAAe,EACf,yBAAyB,EACzB,2BAA2B,EAC3B,0BAA0B,EAC1B,uBAAuB,EACxB,MAAM,cAAc,CAAC;AAItB,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,aAAa,EACnB,MAAM,CAAC,EAAE,yBAAyB,GACjC,OAAO,CAAC,2BAA2B,CAAC,CAEtC;AAED,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,aAAa,EACnB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,eAAe,CAAC,CAE1B;AAED,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,aAAa,EACnB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,OAAO,CAAA;CAAE,CAAC,CAExD;AAID,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,aAAa,EACnB,IAAI,EAAE,0BAA0B,GAC/B,OAAO,CAAC,UAAU,CAAC,CAErB;AAED,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,aAAa,EACnB,IAAI,EAAE,uBAAuB,GAC5B,OAAO,CAAC,UAAU,CAAC,CAErB;AAED,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,UAAU,CAAC,CAErB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getWebhookDeliveries = getWebhookDeliveries;
|
|
4
|
+
exports.getWebhookDelivery = getWebhookDelivery;
|
|
5
|
+
exports.retryWebhookDelivery = retryWebhookDelivery;
|
|
6
|
+
exports.updateWebhookStatus = updateWebhookStatus;
|
|
7
|
+
exports.setWebhookFilter = setWebhookFilter;
|
|
8
|
+
exports.removeWebhookFilter = removeWebhookFilter;
|
|
9
|
+
async function getWebhookDeliveries(http, params) {
|
|
10
|
+
return http.get('/webhook-deliveries', params);
|
|
11
|
+
}
|
|
12
|
+
async function getWebhookDelivery(http, deliveryId) {
|
|
13
|
+
return http.get(`/webhook-deliveries/${deliveryId}`);
|
|
14
|
+
}
|
|
15
|
+
async function retryWebhookDelivery(http, deliveryId) {
|
|
16
|
+
return http.post(`/webhook-deliveries/${deliveryId}/retry`);
|
|
17
|
+
}
|
|
18
|
+
async function updateWebhookStatus(http, data) {
|
|
19
|
+
return http.put('/app/webhook-status', data);
|
|
20
|
+
}
|
|
21
|
+
async function setWebhookFilter(http, data) {
|
|
22
|
+
return http.put('/app/webhook-filter', data);
|
|
23
|
+
}
|
|
24
|
+
async function removeWebhookFilter(http) {
|
|
25
|
+
return http.delete('/app/webhook-filter');
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=webhooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../../../src/client/admin/webhooks.ts"],"names":[],"mappings":";;AAsBA,oDAKC;AAED,gDAKC;AAED,oDAKC;AAID,kDAKC;AAED,4CAKC;AAED,kDAIC;AAzCM,KAAK,UAAU,oBAAoB,CACxC,IAAmB,EACnB,MAAkC;IAElC,OAAO,IAAI,CAAC,GAAG,CAA8B,qBAAqB,EAAE,MAAM,CAAC,CAAC;AAC9E,CAAC;AAEM,KAAK,UAAU,kBAAkB,CACtC,IAAmB,EACnB,UAAkB;IAElB,OAAO,IAAI,CAAC,GAAG,CAAkB,uBAAuB,UAAU,EAAE,CAAC,CAAC;AACxE,CAAC;AAEM,KAAK,UAAU,oBAAoB,CACxC,IAAmB,EACnB,UAAkB;IAElB,OAAO,IAAI,CAAC,IAAI,CAAC,uBAAuB,UAAU,QAAQ,CAAC,CAAC;AAC9D,CAAC;AAIM,KAAK,UAAU,mBAAmB,CACvC,IAAmB,EACnB,IAAgC;IAEhC,OAAO,IAAI,CAAC,GAAG,CAAa,qBAAqB,EAAE,IAAI,CAAC,CAAC;AAC3D,CAAC;AAEM,KAAK,UAAU,gBAAgB,CACpC,IAAmB,EACnB,IAA6B;IAE7B,OAAO,IAAI,CAAC,GAAG,CAAa,qBAAqB,EAAE,IAAI,CAAC,CAAC;AAC3D,CAAC;AAEM,KAAK,UAAU,mBAAmB,CACvC,IAAmB;IAEnB,OAAO,IAAI,CAAC,MAAM,CAAa,qBAAqB,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HttpTransport } from '../_http';
|
|
2
|
+
import { Workflow, WorkflowListParams, WorkflowListResponse, CreateWorkflowRequest, UpdateWorkflowRequest } from '../../models';
|
|
3
|
+
export declare function createWorkflow(http: HttpTransport, data: CreateWorkflowRequest): Promise<Workflow>;
|
|
4
|
+
export declare function getWorkflows(http: HttpTransport, params?: WorkflowListParams): Promise<WorkflowListResponse>;
|
|
5
|
+
export declare function getWorkflow(http: HttpTransport, workflowId: string): Promise<Workflow>;
|
|
6
|
+
export declare function updateWorkflow(http: HttpTransport, workflowId: string, data: UpdateWorkflowRequest): Promise<Workflow>;
|
|
7
|
+
export declare function deleteWorkflow(http: HttpTransport, workflowId: string): Promise<void>;
|
|
8
|
+
//# sourceMappingURL=workflows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../../src/client/admin/workflows.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EACL,QAAQ,EACR,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,cAAc,CAAC;AAEtB,wBAAsB,cAAc,CAClC,IAAI,EAAE,aAAa,EACnB,IAAI,EAAE,qBAAqB,GAC1B,OAAO,CAAC,QAAQ,CAAC,CAEnB;AAED,wBAAsB,YAAY,CAChC,IAAI,EAAE,aAAa,EACnB,MAAM,CAAC,EAAE,kBAAkB,GAC1B,OAAO,CAAC,oBAAoB,CAAC,CAE/B;AAED,wBAAsB,WAAW,CAC/B,IAAI,EAAE,aAAa,EACnB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,QAAQ,CAAC,CAEnB;AAED,wBAAsB,cAAc,CAClC,IAAI,EAAE,aAAa,EACnB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,qBAAqB,GAC1B,OAAO,CAAC,QAAQ,CAAC,CAEnB;AAED,wBAAsB,cAAc,CAClC,IAAI,EAAE,aAAa,EACnB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC,CAEf"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createWorkflow = createWorkflow;
|
|
4
|
+
exports.getWorkflows = getWorkflows;
|
|
5
|
+
exports.getWorkflow = getWorkflow;
|
|
6
|
+
exports.updateWorkflow = updateWorkflow;
|
|
7
|
+
exports.deleteWorkflow = deleteWorkflow;
|
|
8
|
+
async function createWorkflow(http, data) {
|
|
9
|
+
return http.post('/workflows', data);
|
|
10
|
+
}
|
|
11
|
+
async function getWorkflows(http, params) {
|
|
12
|
+
return http.get('/workflows', params);
|
|
13
|
+
}
|
|
14
|
+
async function getWorkflow(http, workflowId) {
|
|
15
|
+
return http.get(`/workflows/${workflowId}`);
|
|
16
|
+
}
|
|
17
|
+
async function updateWorkflow(http, workflowId, data) {
|
|
18
|
+
return http.put(`/workflows/${workflowId}`, data);
|
|
19
|
+
}
|
|
20
|
+
async function deleteWorkflow(http, workflowId) {
|
|
21
|
+
await http.delete(`/workflows/${workflowId}`);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=workflows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflows.js","sourceRoot":"","sources":["../../../src/client/admin/workflows.ts"],"names":[],"mappings":";;AAgBA,wCAKC;AAED,oCAKC;AAED,kCAKC;AAED,wCAMC;AAED,wCAKC;AAlCM,KAAK,UAAU,cAAc,CAClC,IAAmB,EACnB,IAA2B;IAE3B,OAAO,IAAI,CAAC,IAAI,CAAW,YAAY,EAAE,IAAI,CAAC,CAAC;AACjD,CAAC;AAEM,KAAK,UAAU,YAAY,CAChC,IAAmB,EACnB,MAA2B;IAE3B,OAAO,IAAI,CAAC,GAAG,CAAuB,YAAY,EAAE,MAAM,CAAC,CAAC;AAC9D,CAAC;AAEM,KAAK,UAAU,WAAW,CAC/B,IAAmB,EACnB,UAAkB;IAElB,OAAO,IAAI,CAAC,GAAG,CAAW,cAAc,UAAU,EAAE,CAAC,CAAC;AACxD,CAAC;AAEM,KAAK,UAAU,cAAc,CAClC,IAAmB,EACnB,UAAkB,EAClB,IAA2B;IAE3B,OAAO,IAAI,CAAC,GAAG,CAAW,cAAc,UAAU,EAAE,EAAE,IAAI,CAAC,CAAC;AAC9D,CAAC;AAEM,KAAK,UAAU,cAAc,CAClC,IAAmB,EACnB,UAAkB;IAElB,MAAM,IAAI,CAAC,MAAM,CAAC,cAAc,UAAU,EAAE,CAAC,CAAC;AAChD,CAAC"}
|
package/dist/client/base.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AxiosInstance, AxiosRequestConfig, InternalAxiosRequestConfig } from 'axios';
|
|
1
|
+
import { AxiosInstance, AxiosRequestConfig, AxiosResponse, InternalAxiosRequestConfig } from 'axios';
|
|
2
2
|
import { ErrorResponse } from '../models/auth';
|
|
3
3
|
export declare const SDK_VERSION = "1.4.5";
|
|
4
4
|
export interface ClientConfig {
|
|
@@ -17,7 +17,8 @@ export declare class ContioAPIError extends Error {
|
|
|
17
17
|
readonly statusCode?: number;
|
|
18
18
|
readonly response?: ErrorResponse;
|
|
19
19
|
readonly requestId?: string;
|
|
20
|
-
|
|
20
|
+
readonly retryAfter?: string;
|
|
21
|
+
constructor(message: string, code: string, statusCode?: number, response?: ErrorResponse, retryAfter?: string);
|
|
21
22
|
}
|
|
22
23
|
export declare abstract class BaseClient {
|
|
23
24
|
protected axiosInstance: AxiosInstance;
|
|
@@ -30,6 +31,8 @@ export declare abstract class BaseClient {
|
|
|
30
31
|
protected put<T>(path: string, data?: unknown, options?: RequestOptions): Promise<T>;
|
|
31
32
|
protected patch<T>(path: string, data?: unknown, options?: RequestOptions): Promise<T>;
|
|
32
33
|
protected delete<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
34
|
+
protected postForm<T>(path: string, formData: FormData, options?: RequestOptions): Promise<T>;
|
|
35
|
+
protected getRaw(path: string, params?: object, options?: RequestOptions, responseType?: 'arraybuffer' | 'blob' | 'stream'): Promise<AxiosResponse>;
|
|
33
36
|
private retryRequest;
|
|
34
37
|
private parseRetryAfter;
|
|
35
38
|
private delay;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/client/base.ts"],"names":[],"mappings":"AAIA,OAAc,EAAE,aAAa,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/client/base.ts"],"names":[],"mappings":"AAIA,OAAc,EAAE,aAAa,EAAE,kBAAkB,EAAE,aAAa,EAAc,0BAA0B,EAAE,MAAM,OAAO,CAAC;AAExH,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAM/C,eAAO,MAAM,WAAW,UAAU,CAAC;AAEnC,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IAMpB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAKD,MAAM,WAAW,cAAc;IAK7B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAKD,eAAO,MAAM,eAAe,sBAAsB,CAAC;AAEnD,qBAAa,cAAe,SAAQ,KAAK;IACvC,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,SAAgB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpC,SAAgB,QAAQ,CAAC,EAAE,aAAa,CAAC;IAEzC,SAAgB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnC,SAAgB,UAAU,CAAC,EAAE,MAAM,CAAC;gBAExB,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC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I,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,cAAc,EACxB,YAAY,GAAE,aAAa,GAAG,MAAM,GAAG,QAAwB,GAC9D,OAAO,CAAC,aAAa,CAAC;YAWX,YAAY;IAkD1B,OAAO,CAAC,eAAe;IAqBvB,OAAO,CAAC,KAAK;IAOb,OAAO,CAAC,WAAW;CA2BpB"}
|
package/dist/client/base.js
CHANGED
|
@@ -9,13 +9,14 @@ const https_1 = __importDefault(require("https"));
|
|
|
9
9
|
exports.SDK_VERSION = '1.4.5';
|
|
10
10
|
exports.TIMEZONE_HEADER = 'X-Client-Timezone';
|
|
11
11
|
class ContioAPIError extends Error {
|
|
12
|
-
constructor(message, code, statusCode, response) {
|
|
12
|
+
constructor(message, code, statusCode, response, retryAfter) {
|
|
13
13
|
super(message);
|
|
14
14
|
this.name = 'ContioAPIError';
|
|
15
15
|
this.code = code;
|
|
16
16
|
this.statusCode = statusCode;
|
|
17
17
|
this.response = response;
|
|
18
18
|
this.requestId = response?.request_id;
|
|
19
|
+
this.retryAfter = retryAfter;
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
22
|
exports.ContioAPIError = ContioAPIError;
|
|
@@ -86,35 +87,45 @@ class BaseClient {
|
|
|
86
87
|
const response = await this.retryRequest(() => this.axiosInstance.delete(path, config));
|
|
87
88
|
return response.data;
|
|
88
89
|
}
|
|
90
|
+
async postForm(path, formData, options) {
|
|
91
|
+
const config = this.buildRequestConfig(options, {
|
|
92
|
+
headers: { 'Content-Type': 'multipart/form-data' },
|
|
93
|
+
});
|
|
94
|
+
const response = await this.retryRequest(() => this.axiosInstance.post(path, formData, config));
|
|
95
|
+
return response.data;
|
|
96
|
+
}
|
|
97
|
+
async getRaw(path, params, options, responseType = 'arraybuffer') {
|
|
98
|
+
const config = this.buildRequestConfig(options, { params, responseType });
|
|
99
|
+
return this.retryRequest(() => this.axiosInstance.get(path, config));
|
|
100
|
+
}
|
|
89
101
|
async retryRequest(request) {
|
|
90
|
-
|
|
91
|
-
for (let i = 0; i <=
|
|
102
|
+
const maxRetries = this.config.retries ?? 3;
|
|
103
|
+
for (let i = 0; i <= maxRetries; i++) {
|
|
92
104
|
try {
|
|
93
105
|
return await request();
|
|
94
106
|
}
|
|
95
107
|
catch (error) {
|
|
96
|
-
|
|
97
|
-
if (
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
if (i === this.config.retries) {
|
|
108
|
+
const statusCode = error instanceof ContioAPIError ? error.statusCode : undefined;
|
|
109
|
+
if (statusCode) {
|
|
110
|
+
if (statusCode === 429) {
|
|
111
|
+
if (i === maxRetries) {
|
|
101
112
|
throw error;
|
|
102
113
|
}
|
|
103
|
-
const retryAfter = this.parseRetryAfter(error.
|
|
114
|
+
const retryAfter = this.parseRetryAfter(error.retryAfter);
|
|
104
115
|
await this.delay(retryAfter ?? ((this.config.retryDelay ?? 1000) * Math.pow(2, i)));
|
|
105
116
|
continue;
|
|
106
117
|
}
|
|
107
|
-
if (
|
|
118
|
+
if (statusCode >= 400 && statusCode < 500) {
|
|
108
119
|
throw error;
|
|
109
120
|
}
|
|
110
121
|
}
|
|
111
|
-
if (i ===
|
|
122
|
+
if (i === maxRetries) {
|
|
112
123
|
throw error;
|
|
113
124
|
}
|
|
114
125
|
await this.delay(((this.config.retryDelay ?? 1000)) * Math.pow(2, i));
|
|
115
126
|
}
|
|
116
127
|
}
|
|
117
|
-
throw
|
|
128
|
+
throw new ContioAPIError('Max retries exhausted', 'retry_exhausted');
|
|
118
129
|
}
|
|
119
130
|
parseRetryAfter(header) {
|
|
120
131
|
if (!header)
|
|
@@ -137,7 +148,8 @@ class BaseClient {
|
|
|
137
148
|
const errorData = error.response.data;
|
|
138
149
|
const message = errorData.error || errorData.message || 'An error occurred';
|
|
139
150
|
const code = errorData.code || 'unknown_error';
|
|
140
|
-
|
|
151
|
+
const retryAfter = error.response.headers?.['retry-after'];
|
|
152
|
+
throw new ContioAPIError(message, code, error.response.status, errorData, retryAfter);
|
|
141
153
|
}
|
|
142
154
|
else if (error.request) {
|
|
143
155
|
throw new ContioAPIError('No response received from server', 'network_error');
|