@botpress/client 0.3.7 → 0.3.8
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/bundle.cjs +7 -7
- package/dist/bundle.cjs.map +3 -3
- package/dist/gen/api.d.ts +107 -19
- package/dist/gen/base.d.ts +1 -1
- package/dist/gen/client.d.ts +1 -0
- package/dist/gen/common.d.ts +1 -1
- package/dist/gen/configuration.d.ts +1 -1
- package/dist/gen/index.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +3 -3
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
package/dist/gen/api.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Botpress API
|
|
3
3
|
* API for Botpress Cloud
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 0.5.
|
|
5
|
+
* The version of the OpenAPI document: 0.5.7
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -13,6 +13,31 @@ import type { Configuration } from './configuration';
|
|
|
13
13
|
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
14
14
|
import type { RequestArgs } from './base';
|
|
15
15
|
import { BaseAPI } from './base';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface Account
|
|
20
|
+
*/
|
|
21
|
+
export interface Account {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof Account
|
|
26
|
+
*/
|
|
27
|
+
'id': string;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof Account
|
|
32
|
+
*/
|
|
33
|
+
'email': string;
|
|
34
|
+
/**
|
|
35
|
+
* Creation date of the [Account](#schema_account) in ISO 8601 format
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof Account
|
|
38
|
+
*/
|
|
39
|
+
'createdAt': string;
|
|
40
|
+
}
|
|
16
41
|
/**
|
|
17
42
|
*
|
|
18
43
|
* @export
|
|
@@ -26,13 +51,13 @@ export interface Bot {
|
|
|
26
51
|
*/
|
|
27
52
|
'id': string;
|
|
28
53
|
/**
|
|
29
|
-
* Creation date of the [Bot](#schema_bot) in
|
|
54
|
+
* Creation date of the [Bot](#schema_bot) in ISO 8601 format
|
|
30
55
|
* @type {string}
|
|
31
56
|
* @memberof Bot
|
|
32
57
|
*/
|
|
33
58
|
'createdAt': string;
|
|
34
59
|
/**
|
|
35
|
-
* Updating date of the [Bot](#schema_bot) in
|
|
60
|
+
* Updating date of the [Bot](#schema_bot) in ISO 8601 format
|
|
36
61
|
* @type {string}
|
|
37
62
|
* @memberof Bot
|
|
38
63
|
*/
|
|
@@ -225,13 +250,13 @@ export interface BotIntegrationsValue {
|
|
|
225
250
|
*/
|
|
226
251
|
'id': string;
|
|
227
252
|
/**
|
|
228
|
-
* Creation date of the [Integration](#schema_integration) in
|
|
253
|
+
* Creation date of the [Integration](#schema_integration) in ISO 8601 format
|
|
229
254
|
* @type {string}
|
|
230
255
|
* @memberof BotIntegrationsValue
|
|
231
256
|
*/
|
|
232
257
|
'createdAt': string;
|
|
233
258
|
/**
|
|
234
|
-
* Updating date of the [Integration](#schema_integration) in
|
|
259
|
+
* Updating date of the [Integration](#schema_integration) in ISO 8601 format
|
|
235
260
|
* @type {string}
|
|
236
261
|
* @memberof BotIntegrationsValue
|
|
237
262
|
*/
|
|
@@ -459,13 +484,13 @@ export interface Conversation {
|
|
|
459
484
|
*/
|
|
460
485
|
'id': string;
|
|
461
486
|
/**
|
|
462
|
-
* Creation date of the [Conversation](#schema_conversation) in
|
|
487
|
+
* Creation date of the [Conversation](#schema_conversation) in ISO 8601 format
|
|
463
488
|
* @type {string}
|
|
464
489
|
* @memberof Conversation
|
|
465
490
|
*/
|
|
466
491
|
'createdAt': string;
|
|
467
492
|
/**
|
|
468
|
-
* Updating date of the [Conversation](#schema_conversation) in
|
|
493
|
+
* Updating date of the [Conversation](#schema_conversation) in ISO 8601 format
|
|
469
494
|
* @type {string}
|
|
470
495
|
* @memberof Conversation
|
|
471
496
|
*/
|
|
@@ -1526,7 +1551,7 @@ export interface Event {
|
|
|
1526
1551
|
*/
|
|
1527
1552
|
'id': string;
|
|
1528
1553
|
/**
|
|
1529
|
-
* Creation date of the [Event](#schema_event) in
|
|
1554
|
+
* Creation date of the [Event](#schema_event) in ISO 8601 format
|
|
1530
1555
|
* @type {string}
|
|
1531
1556
|
* @memberof Event
|
|
1532
1557
|
*/
|
|
@@ -1546,6 +1571,44 @@ export interface Event {
|
|
|
1546
1571
|
[key: string]: any;
|
|
1547
1572
|
};
|
|
1548
1573
|
}
|
|
1574
|
+
/**
|
|
1575
|
+
*
|
|
1576
|
+
* @export
|
|
1577
|
+
* @interface GetAccountResponse
|
|
1578
|
+
*/
|
|
1579
|
+
export interface GetAccountResponse {
|
|
1580
|
+
/**
|
|
1581
|
+
*
|
|
1582
|
+
* @type {GetAccountResponseAccount}
|
|
1583
|
+
* @memberof GetAccountResponse
|
|
1584
|
+
*/
|
|
1585
|
+
'account': GetAccountResponseAccount;
|
|
1586
|
+
}
|
|
1587
|
+
/**
|
|
1588
|
+
*
|
|
1589
|
+
* @export
|
|
1590
|
+
* @interface GetAccountResponseAccount
|
|
1591
|
+
*/
|
|
1592
|
+
export interface GetAccountResponseAccount {
|
|
1593
|
+
/**
|
|
1594
|
+
*
|
|
1595
|
+
* @type {string}
|
|
1596
|
+
* @memberof GetAccountResponseAccount
|
|
1597
|
+
*/
|
|
1598
|
+
'id': string;
|
|
1599
|
+
/**
|
|
1600
|
+
*
|
|
1601
|
+
* @type {string}
|
|
1602
|
+
* @memberof GetAccountResponseAccount
|
|
1603
|
+
*/
|
|
1604
|
+
'email': string;
|
|
1605
|
+
/**
|
|
1606
|
+
* Creation date of the [Account](#schema_account) in ISO 8601 format
|
|
1607
|
+
* @type {string}
|
|
1608
|
+
* @memberof GetAccountResponseAccount
|
|
1609
|
+
*/
|
|
1610
|
+
'createdAt': string;
|
|
1611
|
+
}
|
|
1549
1612
|
/**
|
|
1550
1613
|
*
|
|
1551
1614
|
* @export
|
|
@@ -2112,13 +2175,13 @@ export interface Integration {
|
|
|
2112
2175
|
*/
|
|
2113
2176
|
'id': string;
|
|
2114
2177
|
/**
|
|
2115
|
-
* Creation date of the [Integration](#schema_integration) in
|
|
2178
|
+
* Creation date of the [Integration](#schema_integration) in ISO 8601 format
|
|
2116
2179
|
* @type {string}
|
|
2117
2180
|
* @memberof Integration
|
|
2118
2181
|
*/
|
|
2119
2182
|
'createdAt': string;
|
|
2120
2183
|
/**
|
|
2121
|
-
* Updating date of the [Integration](#schema_integration) in
|
|
2184
|
+
* Updating date of the [Integration](#schema_integration) in ISO 8601 format
|
|
2122
2185
|
* @type {string}
|
|
2123
2186
|
* @memberof Integration
|
|
2124
2187
|
*/
|
|
@@ -2361,13 +2424,13 @@ export interface ListBotsResponseBotsInner {
|
|
|
2361
2424
|
*/
|
|
2362
2425
|
'id': string;
|
|
2363
2426
|
/**
|
|
2364
|
-
* Creation date of the [Bot](#schema_bot) in
|
|
2427
|
+
* Creation date of the [Bot](#schema_bot) in ISO 8601 format
|
|
2365
2428
|
* @type {string}
|
|
2366
2429
|
* @memberof ListBotsResponseBotsInner
|
|
2367
2430
|
*/
|
|
2368
2431
|
'createdAt': string;
|
|
2369
2432
|
/**
|
|
2370
|
-
* Updating date of the [Bot](#schema_bot) in
|
|
2433
|
+
* Updating date of the [Bot](#schema_bot) in ISO 8601 format
|
|
2371
2434
|
* @type {string}
|
|
2372
2435
|
* @memberof ListBotsResponseBotsInner
|
|
2373
2436
|
*/
|
|
@@ -2537,13 +2600,13 @@ export interface ListPublicIntegrationsResponseIntegrationsInner {
|
|
|
2537
2600
|
*/
|
|
2538
2601
|
'version': string;
|
|
2539
2602
|
/**
|
|
2540
|
-
* Creation date of the [Integration](#schema_integration) in
|
|
2603
|
+
* Creation date of the [Integration](#schema_integration) in ISO 8601 format
|
|
2541
2604
|
* @type {string}
|
|
2542
2605
|
* @memberof ListPublicIntegrationsResponseIntegrationsInner
|
|
2543
2606
|
*/
|
|
2544
2607
|
'createdAt': string;
|
|
2545
2608
|
/**
|
|
2546
|
-
* Updating date of the [Integration](#schema_integration) in
|
|
2609
|
+
* Updating date of the [Integration](#schema_integration) in ISO 8601 format
|
|
2547
2610
|
* @type {string}
|
|
2548
2611
|
* @memberof ListPublicIntegrationsResponseIntegrationsInner
|
|
2549
2612
|
*/
|
|
@@ -2677,7 +2740,7 @@ export interface Message {
|
|
|
2677
2740
|
*/
|
|
2678
2741
|
'id': string;
|
|
2679
2742
|
/**
|
|
2680
|
-
* Creation date of the [Message](#schema_message) in
|
|
2743
|
+
* Creation date of the [Message](#schema_message) in ISO 8601 format
|
|
2681
2744
|
* @type {string}
|
|
2682
2745
|
* @memberof Message
|
|
2683
2746
|
*/
|
|
@@ -2857,13 +2920,13 @@ export interface State {
|
|
|
2857
2920
|
*/
|
|
2858
2921
|
'id': string;
|
|
2859
2922
|
/**
|
|
2860
|
-
* Creation date of the [State](#schema_state) in
|
|
2923
|
+
* Creation date of the [State](#schema_state) in ISO 8601 format
|
|
2861
2924
|
* @type {string}
|
|
2862
2925
|
* @memberof State
|
|
2863
2926
|
*/
|
|
2864
2927
|
'createdAt': string;
|
|
2865
2928
|
/**
|
|
2866
|
-
* Updating date of the [State](#schema_state) in
|
|
2929
|
+
* Updating date of the [State](#schema_state) in ISO 8601 format
|
|
2867
2930
|
* @type {string}
|
|
2868
2931
|
* @memberof State
|
|
2869
2932
|
*/
|
|
@@ -3749,13 +3812,13 @@ export interface User {
|
|
|
3749
3812
|
*/
|
|
3750
3813
|
'id': string;
|
|
3751
3814
|
/**
|
|
3752
|
-
* Creation date of the [User](#schema_user) in
|
|
3815
|
+
* Creation date of the [User](#schema_user) in ISO 8601 format
|
|
3753
3816
|
* @type {string}
|
|
3754
3817
|
* @memberof User
|
|
3755
3818
|
*/
|
|
3756
3819
|
'createdAt': string;
|
|
3757
3820
|
/**
|
|
3758
|
-
* Updating date of the [User](#schema_user) in
|
|
3821
|
+
* Updating date of the [User](#schema_user) in ISO 8601 format
|
|
3759
3822
|
* @type {string}
|
|
3760
3823
|
* @memberof User
|
|
3761
3824
|
*/
|
|
@@ -4028,6 +4091,12 @@ export declare const DefaultApiAxiosParamCreator: (configuration?: Configuration
|
|
|
4028
4091
|
* @throws {RequiredError}
|
|
4029
4092
|
*/
|
|
4030
4093
|
downloadFile: (id: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
4094
|
+
/**
|
|
4095
|
+
* Get details of the account authenticating with this endpoint.
|
|
4096
|
+
* @param {*} [options] Override http request option.
|
|
4097
|
+
* @throws {RequiredError}
|
|
4098
|
+
*/
|
|
4099
|
+
getAccount: (options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
4031
4100
|
/**
|
|
4032
4101
|
* Get the audit records of a workspace, sorted from most recent to oldest.
|
|
4033
4102
|
* @param {string} id Workspace ID
|
|
@@ -4509,6 +4578,12 @@ export declare const DefaultApiFp: (configuration?: Configuration) => {
|
|
|
4509
4578
|
* @throws {RequiredError}
|
|
4510
4579
|
*/
|
|
4511
4580
|
downloadFile(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<any>>;
|
|
4581
|
+
/**
|
|
4582
|
+
* Get details of the account authenticating with this endpoint.
|
|
4583
|
+
* @param {*} [options] Override http request option.
|
|
4584
|
+
* @throws {RequiredError}
|
|
4585
|
+
*/
|
|
4586
|
+
getAccount(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetAccountResponse>>;
|
|
4512
4587
|
/**
|
|
4513
4588
|
* Get the audit records of a workspace, sorted from most recent to oldest.
|
|
4514
4589
|
* @param {string} id Workspace ID
|
|
@@ -4989,6 +5064,12 @@ export declare const DefaultApiFactory: (configuration?: Configuration, basePath
|
|
|
4989
5064
|
* @throws {RequiredError}
|
|
4990
5065
|
*/
|
|
4991
5066
|
downloadFile(requestParameters: DefaultApiDownloadFileRequest, options?: AxiosRequestConfig): AxiosPromise<any>;
|
|
5067
|
+
/**
|
|
5068
|
+
* Get details of the account authenticating with this endpoint.
|
|
5069
|
+
* @param {*} [options] Override http request option.
|
|
5070
|
+
* @throws {RequiredError}
|
|
5071
|
+
*/
|
|
5072
|
+
getAccount(options?: AxiosRequestConfig): AxiosPromise<GetAccountResponse>;
|
|
4992
5073
|
/**
|
|
4993
5074
|
* Get the audit records of a workspace, sorted from most recent to oldest.
|
|
4994
5075
|
* @param {DefaultApiGetAuditRecordsRequest} requestParameters Request parameters.
|
|
@@ -6474,6 +6555,13 @@ export declare class DefaultApi extends BaseAPI {
|
|
|
6474
6555
|
* @memberof DefaultApi
|
|
6475
6556
|
*/
|
|
6476
6557
|
downloadFile(requestParameters: DefaultApiDownloadFileRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<any, any>>;
|
|
6558
|
+
/**
|
|
6559
|
+
* Get details of the account authenticating with this endpoint.
|
|
6560
|
+
* @param {*} [options] Override http request option.
|
|
6561
|
+
* @throws {RequiredError}
|
|
6562
|
+
* @memberof DefaultApi
|
|
6563
|
+
*/
|
|
6564
|
+
getAccount(options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<GetAccountResponse, any>>;
|
|
6477
6565
|
/**
|
|
6478
6566
|
* Get the audit records of a workspace, sorted from most recent to oldest.
|
|
6479
6567
|
* @param {DefaultApiGetAuditRecordsRequest} requestParameters Request parameters.
|
package/dist/gen/base.d.ts
CHANGED
package/dist/gen/client.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export declare class ApiClient {
|
|
|
30
30
|
patchState: ({ type, id, name, ...patchStateBody }: PatchStateProps) => Promise<import("./api").PatchStateResponse>;
|
|
31
31
|
callAction: (callActionBody: CallActionProps) => Promise<import("./api").CallActionResponse>;
|
|
32
32
|
configureIntegration: (configureIntegrationBody: ConfigureIntegrationProps) => Promise<object>;
|
|
33
|
+
getAccount: () => Promise<import("./api").GetAccountResponse>;
|
|
33
34
|
listPublicIntegrations: (props: ListPublicIntegrationsProps) => Promise<import("./api").ListPublicIntegrationsResponse>;
|
|
34
35
|
getPublicIntegrationById: (props: GetPublicIntegrationByIdProps) => Promise<import("./api").GetPublicIntegrationByIdResponse>;
|
|
35
36
|
getPublicIntegration: (props: GetPublicIntegrationProps) => Promise<import("./api").GetPublicIntegrationResponse>;
|
package/dist/gen/common.d.ts
CHANGED
package/dist/gen/index.d.ts
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var ie=Object.create;var I=Object.defineProperty;var le=Object.getOwnPropertyDescriptor;var pe=Object.getOwnPropertyNames;var ce=Object.getPrototypeOf,ue=Object.prototype.hasOwnProperty;var de=(a,t)=>{for(var e in t)I(a,e,{get:t[e],enumerable:!0})},X=(a,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of pe(t))!ue.call(a,o)&&o!==e&&I(a,o,{get:()=>t[o],enumerable:!(s=le(t,o))||s.enumerable});return a};var b=(a,t,e)=>(e=a!=null?ie(ce(a)):{},X(t||!a||!a.__esModule?I(e,"default",{value:a,enumerable:!0}):e,a)),ge=a=>X(I({},"__esModule",{value:!0}),a);var ve={};de(ve,{AlreadyExistsError:()=>Q,Client:()=>Z,ForbiddenError:()=>T,InternalError:()=>v,InvalidDataFormatError:()=>L,InvalidIdentifierError:()=>G,InvalidJsonSchemaError:()=>S,InvalidPayloadError:()=>E,InvalidQueryError:()=>N,MethodNotFoundError:()=>W,PayloadTooLargeError:()=>D,PaymentRequiredError:()=>$,RateLimitedError:()=>H,ReferenceNotFoundError:()=>_,RelationConflictError:()=>F,ResourceNotFoundError:()=>w,RuntimeError:()=>j,UnauthorizedError:()=>O,UnknownError:()=>B,UnsupportedMediaTypeError:()=>M,axios:()=>Oe,errorFrom:()=>K,isApiError:()=>re});module.exports=ge(ve);var oe=b(require("axios"));var q=require("browser-or-node"),ye="https://api.botpress.cloud",he=6e4,Ae="BP_API_URL",Re="BP_BOT_ID",me="BP_INTEGRATION_ID",fe="BP_WORKSPACE_ID",Ce="BP_TOKEN";function ee(a){let t=xe(a),e={};t.workspaceId&&(e["x-workspace-id"]=t.workspaceId),t.botId&&(e["x-bot-id"]=t.botId),t.integrationId&&(e["x-integration-id"]=t.integrationId),t.token&&(e.Authorization=`Bearer ${t.token}`),e={...e,...t.headers};let s=t.apiUrl??ye,o=t.timeout??he;return{apiUrl:s,timeout:o,withCredentials:q.isBrowser,headers:e}}function xe(a){return q.isBrowser?a:q.isNode?Pe(a):a}function Pe(a){let t={...a,apiUrl:a.apiUrl??process.env[Ae],botId:a.botId??process.env[Re],integrationId:a.integrationId??process.env[me],workspaceId:a.workspaceId??process.env[fe]},e=t.token??process.env[Ce];return e&&(t.token=e),t}var ae=b(require("axios"));var A=b(require("axios"));var te=b(require("axios")),u="https://api.botpress.cloud".replace(/\/+$/,"");var U=class{constructor(t,e=u,s=te.default){this.basePath=e;this.axios=s;t&&(this.configuration=t,this.basePath=t.basePath||this.basePath)}configuration},k=class extends Error{constructor(e,s){super(s);this.field=e;this.name="RequiredError"}};var d="https://example.com",f=function(a,t,e){if(e==null)throw new k(t,`Required parameter ${t} was null or undefined when calling ${a}.`)};function Y(a,t,e=""){t!=null&&(typeof t=="object"?Array.isArray(t)?t.forEach(s=>Y(a,s,e)):Object.keys(t).forEach(s=>Y(a,t[s],`${e}${e!==""?".":""}${s}`)):a.has(e)?a.append(e,t):a.set(e,t))}var g=function(a,...t){let e=new URLSearchParams(a.search);Y(e,t),a.search=e.toString()},C=function(a,t,e){let s=typeof a!="string";return(s&&e&&e.isJsonMime?e.isJsonMime(t.headers["Content-Type"]):s)?JSON.stringify(a!==void 0?a:{}):a||""},y=function(a){return a.pathname+a.search+a.hash},h=function(a,t,e,s){return(o=t,r=e)=>{let n={...a.options,url:(s?.basePath||r)+a.url};return o.request(n)}};var Be=function(a){return{callAction:async(t,e={})=>{let s="/v1/chat/actions",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"POST",...r,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,a),{url:y(o),options:n}},changeWorkspacePlan:async(t,e,s={})=>{f("changeWorkspacePlan","id",t);let o="/v1/admin/workspaces/{id}/change-plan".replace("{id}",encodeURIComponent(String(t))),r=new URL(o,d),n;a&&(n=a.baseOptions);let i={method:"PUT",...n,...s},p={},l={};p["Content-Type"]="application/json",g(r,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},i.data=C(e,i,a),{url:y(r),options:i}},configureIntegration:async(t,e={})=>{let s="/v1/chat/integrations/configure",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"POST",...r,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,a),{url:y(o),options:n}},createBot:async(t,e={})=>{let s="/v1/admin/bots",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"POST",...r,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,a),{url:y(o),options:n}},createConversation:async(t,e={})=>{let s="/v1/chat/conversations",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"POST",...r,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,a),{url:y(o),options:n}},createEvent:async(t,e={})=>{let s="/v1/chat/events",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"POST",...r,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,a),{url:y(o),options:n}},createFile:async(t,e={})=>{let s="/v1/storage/files",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"POST",...r,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,a),{url:y(o),options:n}},createIntegration:async(t,e={})=>{let s="/v1/admin/integrations",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"POST",...r,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,a),{url:y(o),options:n}},createMessage:async(t,e={})=>{let s="/v1/chat/messages",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"POST",...r,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,a),{url:y(o),options:n}},createUser:async(t,e={})=>{let s="/v1/chat/users",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"POST",...r,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,a),{url:y(o),options:n}},createWorkspace:async(t,e={})=>{let s="/v1/admin/workspaces",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"POST",...r,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,a),{url:y(o),options:n}},createWorkspaceMember:async(t,e={})=>{let s="/v1/admin/workspace-members",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"POST",...r,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,a),{url:y(o),options:n}},deleteBot:async(t,e={})=>{f("deleteBot","id",t);let s="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"DELETE",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},deleteConversation:async(t,e={})=>{f("deleteConversation","id",t);let s="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"DELETE",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},deleteFile:async(t,e={})=>{f("deleteFile","id",t);let s="/v1/storage/files/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"DELETE",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},deleteIntegration:async(t,e={})=>{f("deleteIntegration","id",t);let s="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"DELETE",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},deleteMessage:async(t,e={})=>{f("deleteMessage","id",t);let s="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"DELETE",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},deleteUser:async(t,e={})=>{f("deleteUser","id",t);let s="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"DELETE",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},deleteWorkspace:async(t,e={})=>{f("deleteWorkspace","id",t);let s="/v1/admin/workspaces/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"DELETE",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},deleteWorkspaceMember:async(t,e={})=>{f("deleteWorkspaceMember","id",t);let s="/v1/admin/workspace-members/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"DELETE",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},downloadFile:async(t,e={})=>{f("downloadFile","id",t);let s="/v1/storage/files/{id}/download".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"GET",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},getAuditRecords:async(t,e,s={})=>{f("getAuditRecords","id",t);let o="/v1/admin/workspaces/{id}/audit-records".replace("{id}",encodeURIComponent(String(t))),r=new URL(o,d),n;a&&(n=a.baseOptions);let i={method:"GET",...n,...s},p={},l={};e!==void 0&&(l.nextToken=e),g(r,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},{url:y(r),options:i}},getBot:async(t,e={})=>{f("getBot","id",t);let s="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"GET",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},getBotAnalytics:async(t,e,s,o={})=>{f("getBotAnalytics","id",t),f("getBotAnalytics","startDate",e),f("getBotAnalytics","endDate",s);let r="/v1/admin/bots/{id}/analytics".replace("{id}",encodeURIComponent(String(t))),n=new URL(r,d),i;a&&(i=a.baseOptions);let p={method:"GET",...i,...o},l={},c={};e!==void 0&&(c.startDate=e),s!==void 0&&(c.endDate=s),g(n,c);let P=i&&i.headers?i.headers:{};return p.headers={...l,...P,...o.headers},{url:y(n),options:p}},getBotLogs:async(t,e={})=>{f("getBotLogs","id",t);let s="/v1/admin/bots/{id}/logs".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"GET",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},getBotWebchat:async(t,e,s={})=>{f("getBotWebchat","id",t),f("getBotWebchat","type",e);let o="/v1/admin/bots/{id}/webchat".replace("{id}",encodeURIComponent(String(t))),r=new URL(o,d),n;a&&(n=a.baseOptions);let i={method:"GET",...n,...s},p={},l={};e!==void 0&&(l.type=e),g(r,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},{url:y(r),options:i}},getConversation:async(t,e={})=>{f("getConversation","id",t);let s="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"GET",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},getEvent:async(t,e={})=>{f("getEvent","id",t);let s="/v1/chat/events/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"GET",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},getFile:async(t,e={})=>{f("getFile","id",t);let s="/v1/storage/files/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"GET",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},getIntegration:async(t,e={})=>{f("getIntegration","id",t);let s="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"GET",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},getIntegrationByName:async(t,e,s={})=>{f("getIntegrationByName","name",t),f("getIntegrationByName","version",e);let o="/v1/admin/integrations/{name}/{version}".replace("{name}",encodeURIComponent(String(t))).replace("{version}",encodeURIComponent(String(e))),r=new URL(o,d),n;a&&(n=a.baseOptions);let i={method:"GET",...n,...s},p={};g(r,{});let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},{url:y(r),options:i}},getIntegrationLogs:async(t,e={})=>{f("getIntegrationLogs","id",t);let s="/v1/admin/integrations/{id}/logs".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"GET",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},getMessage:async(t,e={})=>{f("getMessage","id",t);let s="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"GET",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},getOrCreateConversation:async(t,e={})=>{let s="/v1/chat/conversations/get-or-create",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"POST",...r,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,a),{url:y(o),options:n}},getOrCreateMessage:async(t,e={})=>{let s="/v1/chat/messages/get-or-create",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"POST",...r,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,a),{url:y(o),options:n}},getOrCreateUser:async(t,e={})=>{let s="/v1/chat/users/get-or-create",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"POST",...r,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,a),{url:y(o),options:n}},getPublicIntegration:async(t,e,s={})=>{f("getPublicIntegration","name",t),f("getPublicIntegration","version",e);let o="/v1/admin/hub/integrations/{name}/{version}".replace("{name}",encodeURIComponent(String(t))).replace("{version}",encodeURIComponent(String(e))),r=new URL(o,d),n;a&&(n=a.baseOptions);let i={method:"GET",...n,...s},p={};g(r,{});let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},{url:y(r),options:i}},getPublicIntegrationById:async(t,e={})=>{f("getPublicIntegrationById","id",t);let s="/v1/admin/hub/integrations/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"GET",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},getState:async(t,e,s,o={})=>{f("getState","type",t),f("getState","id",e),f("getState","name",s);let r="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(e))).replace("{name}",encodeURIComponent(String(s))),n=new URL(r,d),i;a&&(i=a.baseOptions);let p={method:"GET",...i,...o},l={};g(n,{});let P=i&&i.headers?i.headers:{};return p.headers={...l,...P,...o.headers},{url:y(n),options:p}},getUser:async(t,e={})=>{f("getUser","id",t);let s="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"GET",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},getWorkspace:async(t,e={})=>{f("getWorkspace","id",t);let s="/v1/admin/workspaces/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"GET",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},introspect:async(t,e={})=>{let s="/v1/admin/introspect",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"POST",...r,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,a),{url:y(o),options:n}},listBots:async(t,e={})=>{let s="/v1/admin/bots",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"GET",...r,...e},i={},p={};t!==void 0&&(p.nextToken=t),g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},listConversations:async(t,e,s,o={})=>{let r="/v1/chat/conversations",n=new URL(r,d),i;a&&(i=a.baseOptions);let p={method:"GET",...i,...o},l={},c={};t!==void 0&&(c.nextToken=t),e!==void 0&&(c.tags=e),s&&(c.participantIds=s),g(n,c);let P=i&&i.headers?i.headers:{};return p.headers={...l,...P,...o.headers},{url:y(n),options:p}},listEvents:async(t,e,s={})=>{let o="/v1/chat/events",r=new URL(o,d),n;a&&(n=a.baseOptions);let i={method:"GET",...n,...s},p={},l={};t!==void 0&&(l.nextToken=t),e!==void 0&&(l.type=e),g(r,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},{url:y(r),options:i}},listFiles:async(t,e,s={})=>{f("listFiles","botId",t);let o="/v1/storage/files",r=new URL(o,d),n;a&&(n=a.baseOptions);let i={method:"GET",...n,...s},p={},l={};e!==void 0&&(l.nextToken=e),t!==void 0&&(l.botId=t),g(r,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},{url:y(r),options:i}},listIntegrations:async(t,e,s,o={})=>{let r="/v1/admin/integrations",n=new URL(r,d),i;a&&(i=a.baseOptions);let p={method:"GET",...i,...o},l={},c={};t!==void 0&&(c.nextToken=t),e!==void 0&&(c.name=e),s!==void 0&&(c.version=s),g(n,c);let P=i&&i.headers?i.headers:{};return p.headers={...l,...P,...o.headers},{url:y(n),options:p}},listMessages:async(t,e,s,o={})=>{let r="/v1/chat/messages",n=new URL(r,d),i;a&&(i=a.baseOptions);let p={method:"GET",...i,...o},l={},c={};t!==void 0&&(c.nextToken=t),e!==void 0&&(c.conversationId=e),s!==void 0&&(c.tags=s),g(n,c);let P=i&&i.headers?i.headers:{};return p.headers={...l,...P,...o.headers},{url:y(n),options:p}},listPublicIntegrations:async(t,e,s,o={})=>{let r="/v1/admin/hub/integrations",n=new URL(r,d),i;a&&(i=a.baseOptions);let p={method:"GET",...i,...o},l={},c={};t!==void 0&&(c.nextToken=t),e!==void 0&&(c.name=e),s!==void 0&&(c.version=s),g(n,c);let P=i&&i.headers?i.headers:{};return p.headers={...l,...P,...o.headers},{url:y(n),options:p}},listUsers:async(t,e,s,o={})=>{let r="/v1/chat/users",n=new URL(r,d),i;a&&(i=a.baseOptions);let p={method:"GET",...i,...o},l={},c={};t!==void 0&&(c.nextToken=t),e!==void 0&&(c.conversationId=e),s!==void 0&&(c.tags=s),g(n,c);let P=i&&i.headers?i.headers:{};return p.headers={...l,...P,...o.headers},{url:y(n),options:p}},listWorkspaceMembers:async(t,e={})=>{let s="/v1/admin/workspace-members",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"GET",...r,...e},i={},p={};t!==void 0&&(p.nextToken=t),g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},listWorkspaces:async(t,e={})=>{let s="/v1/admin/workspaces",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"GET",...r,...e},i={},p={};t!==void 0&&(p.nextToken=t),g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},patchState:async(t,e,s,o,r={})=>{f("patchState","type",t),f("patchState","id",e),f("patchState","name",s);let n="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(e))).replace("{name}",encodeURIComponent(String(s))),i=new URL(n,d),p;a&&(p=a.baseOptions);let l={method:"PATCH",...p,...r},c={},P={};c["Content-Type"]="application/json",g(i,P);let z=p&&p.headers?p.headers:{};return l.headers={...c,...z,...r.headers},l.data=C(o,l,a),{url:y(i),options:l}},setState:async(t,e,s,o,r={})=>{f("setState","type",t),f("setState","id",e),f("setState","name",s);let n="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(e))).replace("{name}",encodeURIComponent(String(s))),i=new URL(n,d),p;a&&(p=a.baseOptions);let l={method:"POST",...p,...r},c={},P={};c["Content-Type"]="application/json",g(i,P);let z=p&&p.headers?p.headers:{};return l.headers={...c,...z,...r.headers},l.data=C(o,l,a),{url:y(i),options:l}},transferBot:async(t,e,s={})=>{f("transferBot","id",t);let o="/v1/admin/bots/{id}/transfer".replace("{id}",encodeURIComponent(String(t))),r=new URL(o,d),n;a&&(n=a.baseOptions);let i={method:"POST",...n,...s},p={},l={};p["Content-Type"]="application/json",g(r,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},i.data=C(e,i,a),{url:y(r),options:i}},updateBot:async(t,e,s={})=>{f("updateBot","id",t);let o="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(t))),r=new URL(o,d),n;a&&(n=a.baseOptions);let i={method:"PUT",...n,...s},p={},l={};p["Content-Type"]="application/json",g(r,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},i.data=C(e,i,a),{url:y(r),options:i}},updateConversation:async(t,e,s={})=>{f("updateConversation","id",t);let o="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(t))),r=new URL(o,d),n;a&&(n=a.baseOptions);let i={method:"PUT",...n,...s},p={},l={};p["Content-Type"]="application/json",g(r,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},i.data=C(e,i,a),{url:y(r),options:i}},updateIntegration:async(t,e,s={})=>{f("updateIntegration","id",t);let o="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(t))),r=new URL(o,d),n;a&&(n=a.baseOptions);let i={method:"PUT",...n,...s},p={},l={};p["Content-Type"]="application/json",g(r,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},i.data=C(e,i,a),{url:y(r),options:i}},updateMessage:async(t,e,s={})=>{f("updateMessage","id",t);let o="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(t))),r=new URL(o,d),n;a&&(n=a.baseOptions);let i={method:"PUT",...n,...s},p={},l={};p["Content-Type"]="application/json",g(r,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},i.data=C(e,i,a),{url:y(r),options:i}},updateUser:async(t,e,s={})=>{f("updateUser","id",t);let o="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(t))),r=new URL(o,d),n;a&&(n=a.baseOptions);let i={method:"PUT",...n,...s},p={},l={};p["Content-Type"]="application/json",g(r,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},i.data=C(e,i,a),{url:y(r),options:i}},updateWorkspace:async(t,e,s={})=>{f("updateWorkspace","id",t);let o="/v1/admin/workspaces/{id}".replace("{id}",encodeURIComponent(String(t))),r=new URL(o,d),n;a&&(n=a.baseOptions);let i={method:"PUT",...n,...s},p={},l={};p["Content-Type"]="application/json",g(r,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},i.data=C(e,i,a),{url:y(r),options:i}},updateWorkspaceMember:async(t,e,s={})=>{f("updateWorkspaceMember","id",t);let o="/v1/admin/workspace-members/{id}".replace("{id}",encodeURIComponent(String(t))),r=new URL(o,d),n;a&&(n=a.baseOptions);let i={method:"PUT",...n,...s},p={},l={};p["Content-Type"]="application/json",g(r,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},i.data=C(e,i,a),{url:y(r),options:i}}}},R=function(a){let t=Be(a);return{async callAction(e,s){let o=await t.callAction(e,s);return h(o,A.default,u,a)},async changeWorkspacePlan(e,s,o){let r=await t.changeWorkspacePlan(e,s,o);return h(r,A.default,u,a)},async configureIntegration(e,s){let o=await t.configureIntegration(e,s);return h(o,A.default,u,a)},async createBot(e,s){let o=await t.createBot(e,s);return h(o,A.default,u,a)},async createConversation(e,s){let o=await t.createConversation(e,s);return h(o,A.default,u,a)},async createEvent(e,s){let o=await t.createEvent(e,s);return h(o,A.default,u,a)},async createFile(e,s){let o=await t.createFile(e,s);return h(o,A.default,u,a)},async createIntegration(e,s){let o=await t.createIntegration(e,s);return h(o,A.default,u,a)},async createMessage(e,s){let o=await t.createMessage(e,s);return h(o,A.default,u,a)},async createUser(e,s){let o=await t.createUser(e,s);return h(o,A.default,u,a)},async createWorkspace(e,s){let o=await t.createWorkspace(e,s);return h(o,A.default,u,a)},async createWorkspaceMember(e,s){let o=await t.createWorkspaceMember(e,s);return h(o,A.default,u,a)},async deleteBot(e,s){let o=await t.deleteBot(e,s);return h(o,A.default,u,a)},async deleteConversation(e,s){let o=await t.deleteConversation(e,s);return h(o,A.default,u,a)},async deleteFile(e,s){let o=await t.deleteFile(e,s);return h(o,A.default,u,a)},async deleteIntegration(e,s){let o=await t.deleteIntegration(e,s);return h(o,A.default,u,a)},async deleteMessage(e,s){let o=await t.deleteMessage(e,s);return h(o,A.default,u,a)},async deleteUser(e,s){let o=await t.deleteUser(e,s);return h(o,A.default,u,a)},async deleteWorkspace(e,s){let o=await t.deleteWorkspace(e,s);return h(o,A.default,u,a)},async deleteWorkspaceMember(e,s){let o=await t.deleteWorkspaceMember(e,s);return h(o,A.default,u,a)},async downloadFile(e,s){let o=await t.downloadFile(e,s);return h(o,A.default,u,a)},async getAuditRecords(e,s,o){let r=await t.getAuditRecords(e,s,o);return h(r,A.default,u,a)},async getBot(e,s){let o=await t.getBot(e,s);return h(o,A.default,u,a)},async getBotAnalytics(e,s,o,r){let n=await t.getBotAnalytics(e,s,o,r);return h(n,A.default,u,a)},async getBotLogs(e,s){let o=await t.getBotLogs(e,s);return h(o,A.default,u,a)},async getBotWebchat(e,s,o){let r=await t.getBotWebchat(e,s,o);return h(r,A.default,u,a)},async getConversation(e,s){let o=await t.getConversation(e,s);return h(o,A.default,u,a)},async getEvent(e,s){let o=await t.getEvent(e,s);return h(o,A.default,u,a)},async getFile(e,s){let o=await t.getFile(e,s);return h(o,A.default,u,a)},async getIntegration(e,s){let o=await t.getIntegration(e,s);return h(o,A.default,u,a)},async getIntegrationByName(e,s,o){let r=await t.getIntegrationByName(e,s,o);return h(r,A.default,u,a)},async getIntegrationLogs(e,s){let o=await t.getIntegrationLogs(e,s);return h(o,A.default,u,a)},async getMessage(e,s){let o=await t.getMessage(e,s);return h(o,A.default,u,a)},async getOrCreateConversation(e,s){let o=await t.getOrCreateConversation(e,s);return h(o,A.default,u,a)},async getOrCreateMessage(e,s){let o=await t.getOrCreateMessage(e,s);return h(o,A.default,u,a)},async getOrCreateUser(e,s){let o=await t.getOrCreateUser(e,s);return h(o,A.default,u,a)},async getPublicIntegration(e,s,o){let r=await t.getPublicIntegration(e,s,o);return h(r,A.default,u,a)},async getPublicIntegrationById(e,s){let o=await t.getPublicIntegrationById(e,s);return h(o,A.default,u,a)},async getState(e,s,o,r){let n=await t.getState(e,s,o,r);return h(n,A.default,u,a)},async getUser(e,s){let o=await t.getUser(e,s);return h(o,A.default,u,a)},async getWorkspace(e,s){let o=await t.getWorkspace(e,s);return h(o,A.default,u,a)},async introspect(e,s){let o=await t.introspect(e,s);return h(o,A.default,u,a)},async listBots(e,s){let o=await t.listBots(e,s);return h(o,A.default,u,a)},async listConversations(e,s,o,r){let n=await t.listConversations(e,s,o,r);return h(n,A.default,u,a)},async listEvents(e,s,o){let r=await t.listEvents(e,s,o);return h(r,A.default,u,a)},async listFiles(e,s,o){let r=await t.listFiles(e,s,o);return h(r,A.default,u,a)},async listIntegrations(e,s,o,r){let n=await t.listIntegrations(e,s,o,r);return h(n,A.default,u,a)},async listMessages(e,s,o,r){let n=await t.listMessages(e,s,o,r);return h(n,A.default,u,a)},async listPublicIntegrations(e,s,o,r){let n=await t.listPublicIntegrations(e,s,o,r);return h(n,A.default,u,a)},async listUsers(e,s,o,r){let n=await t.listUsers(e,s,o,r);return h(n,A.default,u,a)},async listWorkspaceMembers(e,s){let o=await t.listWorkspaceMembers(e,s);return h(o,A.default,u,a)},async listWorkspaces(e,s){let o=await t.listWorkspaces(e,s);return h(o,A.default,u,a)},async patchState(e,s,o,r,n){let i=await t.patchState(e,s,o,r,n);return h(i,A.default,u,a)},async setState(e,s,o,r,n){let i=await t.setState(e,s,o,r,n);return h(i,A.default,u,a)},async transferBot(e,s,o){let r=await t.transferBot(e,s,o);return h(r,A.default,u,a)},async updateBot(e,s,o){let r=await t.updateBot(e,s,o);return h(r,A.default,u,a)},async updateConversation(e,s,o){let r=await t.updateConversation(e,s,o);return h(r,A.default,u,a)},async updateIntegration(e,s,o){let r=await t.updateIntegration(e,s,o);return h(r,A.default,u,a)},async updateMessage(e,s,o){let r=await t.updateMessage(e,s,o);return h(r,A.default,u,a)},async updateUser(e,s,o){let r=await t.updateUser(e,s,o);return h(r,A.default,u,a)},async updateWorkspace(e,s,o){let r=await t.updateWorkspace(e,s,o);return h(r,A.default,u,a)},async updateWorkspaceMember(e,s,o){let r=await t.updateWorkspaceMember(e,s,o);return h(r,A.default,u,a)}}};var V=class extends U{callAction(t={},e){return R(this.configuration).callAction(t.callActionBody,e).then(s=>s(this.axios,this.basePath))}changeWorkspacePlan(t,e){return R(this.configuration).changeWorkspacePlan(t.id,t.changeWorkspacePlanBody,e).then(s=>s(this.axios,this.basePath))}configureIntegration(t={},e){return R(this.configuration).configureIntegration(t.configureIntegrationBody,e).then(s=>s(this.axios,this.basePath))}createBot(t={},e){return R(this.configuration).createBot(t.createBotBody,e).then(s=>s(this.axios,this.basePath))}createConversation(t={},e){return R(this.configuration).createConversation(t.createConversationBody,e).then(s=>s(this.axios,this.basePath))}createEvent(t={},e){return R(this.configuration).createEvent(t.createEventBody,e).then(s=>s(this.axios,this.basePath))}createFile(t={},e){return R(this.configuration).createFile(t.createFileBody,e).then(s=>s(this.axios,this.basePath))}createIntegration(t={},e){return R(this.configuration).createIntegration(t.createIntegrationBody,e).then(s=>s(this.axios,this.basePath))}createMessage(t={},e){return R(this.configuration).createMessage(t.createMessageBody,e).then(s=>s(this.axios,this.basePath))}createUser(t={},e){return R(this.configuration).createUser(t.createUserBody,e).then(s=>s(this.axios,this.basePath))}createWorkspace(t={},e){return R(this.configuration).createWorkspace(t.createWorkspaceBody,e).then(s=>s(this.axios,this.basePath))}createWorkspaceMember(t={},e){return R(this.configuration).createWorkspaceMember(t.createWorkspaceMemberBody,e).then(s=>s(this.axios,this.basePath))}deleteBot(t,e){return R(this.configuration).deleteBot(t.id,e).then(s=>s(this.axios,this.basePath))}deleteConversation(t,e){return R(this.configuration).deleteConversation(t.id,e).then(s=>s(this.axios,this.basePath))}deleteFile(t,e){return R(this.configuration).deleteFile(t.id,e).then(s=>s(this.axios,this.basePath))}deleteIntegration(t,e){return R(this.configuration).deleteIntegration(t.id,e).then(s=>s(this.axios,this.basePath))}deleteMessage(t,e){return R(this.configuration).deleteMessage(t.id,e).then(s=>s(this.axios,this.basePath))}deleteUser(t,e){return R(this.configuration).deleteUser(t.id,e).then(s=>s(this.axios,this.basePath))}deleteWorkspace(t,e){return R(this.configuration).deleteWorkspace(t.id,e).then(s=>s(this.axios,this.basePath))}deleteWorkspaceMember(t,e){return R(this.configuration).deleteWorkspaceMember(t.id,e).then(s=>s(this.axios,this.basePath))}downloadFile(t,e){return R(this.configuration).downloadFile(t.id,e).then(s=>s(this.axios,this.basePath))}getAuditRecords(t,e){return R(this.configuration).getAuditRecords(t.id,t.nextToken,e).then(s=>s(this.axios,this.basePath))}getBot(t,e){return R(this.configuration).getBot(t.id,e).then(s=>s(this.axios,this.basePath))}getBotAnalytics(t,e){return R(this.configuration).getBotAnalytics(t.id,t.startDate,t.endDate,e).then(s=>s(this.axios,this.basePath))}getBotLogs(t,e){return R(this.configuration).getBotLogs(t.id,e).then(s=>s(this.axios,this.basePath))}getBotWebchat(t,e){return R(this.configuration).getBotWebchat(t.id,t.type,e).then(s=>s(this.axios,this.basePath))}getConversation(t,e){return R(this.configuration).getConversation(t.id,e).then(s=>s(this.axios,this.basePath))}getEvent(t,e){return R(this.configuration).getEvent(t.id,e).then(s=>s(this.axios,this.basePath))}getFile(t,e){return R(this.configuration).getFile(t.id,e).then(s=>s(this.axios,this.basePath))}getIntegration(t,e){return R(this.configuration).getIntegration(t.id,e).then(s=>s(this.axios,this.basePath))}getIntegrationByName(t,e){return R(this.configuration).getIntegrationByName(t.name,t.version,e).then(s=>s(this.axios,this.basePath))}getIntegrationLogs(t,e){return R(this.configuration).getIntegrationLogs(t.id,e).then(s=>s(this.axios,this.basePath))}getMessage(t,e){return R(this.configuration).getMessage(t.id,e).then(s=>s(this.axios,this.basePath))}getOrCreateConversation(t={},e){return R(this.configuration).getOrCreateConversation(t.getOrCreateConversationBody,e).then(s=>s(this.axios,this.basePath))}getOrCreateMessage(t={},e){return R(this.configuration).getOrCreateMessage(t.getOrCreateMessageBody,e).then(s=>s(this.axios,this.basePath))}getOrCreateUser(t={},e){return R(this.configuration).getOrCreateUser(t.getOrCreateUserBody,e).then(s=>s(this.axios,this.basePath))}getPublicIntegration(t,e){return R(this.configuration).getPublicIntegration(t.name,t.version,e).then(s=>s(this.axios,this.basePath))}getPublicIntegrationById(t,e){return R(this.configuration).getPublicIntegrationById(t.id,e).then(s=>s(this.axios,this.basePath))}getState(t,e){return R(this.configuration).getState(t.type,t.id,t.name,e).then(s=>s(this.axios,this.basePath))}getUser(t,e){return R(this.configuration).getUser(t.id,e).then(s=>s(this.axios,this.basePath))}getWorkspace(t,e){return R(this.configuration).getWorkspace(t.id,e).then(s=>s(this.axios,this.basePath))}introspect(t={},e){return R(this.configuration).introspect(t.introspectBody,e).then(s=>s(this.axios,this.basePath))}listBots(t={},e){return R(this.configuration).listBots(t.nextToken,e).then(s=>s(this.axios,this.basePath))}listConversations(t={},e){return R(this.configuration).listConversations(t.nextToken,t.tags,t.participantIds,e).then(s=>s(this.axios,this.basePath))}listEvents(t={},e){return R(this.configuration).listEvents(t.nextToken,t.type,e).then(s=>s(this.axios,this.basePath))}listFiles(t,e){return R(this.configuration).listFiles(t.botId,t.nextToken,e).then(s=>s(this.axios,this.basePath))}listIntegrations(t={},e){return R(this.configuration).listIntegrations(t.nextToken,t.name,t.version,e).then(s=>s(this.axios,this.basePath))}listMessages(t={},e){return R(this.configuration).listMessages(t.nextToken,t.conversationId,t.tags,e).then(s=>s(this.axios,this.basePath))}listPublicIntegrations(t={},e){return R(this.configuration).listPublicIntegrations(t.nextToken,t.name,t.version,e).then(s=>s(this.axios,this.basePath))}listUsers(t={},e){return R(this.configuration).listUsers(t.nextToken,t.conversationId,t.tags,e).then(s=>s(this.axios,this.basePath))}listWorkspaceMembers(t={},e){return R(this.configuration).listWorkspaceMembers(t.nextToken,e).then(s=>s(this.axios,this.basePath))}listWorkspaces(t={},e){return R(this.configuration).listWorkspaces(t.nextToken,e).then(s=>s(this.axios,this.basePath))}patchState(t,e){return R(this.configuration).patchState(t.type,t.id,t.name,t.patchStateBody,e).then(s=>s(this.axios,this.basePath))}setState(t,e){return R(this.configuration).setState(t.type,t.id,t.name,t.setStateBody,e).then(s=>s(this.axios,this.basePath))}transferBot(t,e){return R(this.configuration).transferBot(t.id,t.transferBotBody,e).then(s=>s(this.axios,this.basePath))}updateBot(t,e){return R(this.configuration).updateBot(t.id,t.updateBotBody,e).then(s=>s(this.axios,this.basePath))}updateConversation(t,e){return R(this.configuration).updateConversation(t.id,t.updateConversationBody,e).then(s=>s(this.axios,this.basePath))}updateIntegration(t,e){return R(this.configuration).updateIntegration(t.id,t.updateIntegrationBody,e).then(s=>s(this.axios,this.basePath))}updateMessage(t,e){return R(this.configuration).updateMessage(t.id,t.updateMessageBody,e).then(s=>s(this.axios,this.basePath))}updateUser(t,e){return R(this.configuration).updateUser(t.id,t.updateUserBody,e).then(s=>s(this.axios,this.basePath))}updateWorkspace(t,e){return R(this.configuration).updateWorkspace(t.id,t.updateWorkspaceBody,e).then(s=>s(this.axios,this.basePath))}updateWorkspaceMember(t,e){return R(this.configuration).updateWorkspaceMember(t.id,t.updateWorkspaceMemberBody,e).then(s=>s(this.axios,this.basePath))}};var se=b(require("crypto"));var be=typeof window<"u"&&typeof window.document<"u"?window.crypto?window.crypto:{getRandomValues:a=>new Uint8Array(a.map(()=>Math.floor(Math.random()*256)))}:se.default,x=class extends Error{constructor(e,s,o,r,n,i){super(r);this.code=e;this.description=s;this.type=o;this.message=r;this.error=n;this.id=i;this.id||(this.id=x.generateId())}isApiError=!0;toJSON(){return{id:this.id,code:this.code,type:this.type,message:this.message}}static generateId(){let s=Array.from(be.getRandomValues(new Uint8Array(4))).map(o=>o.toString(16).padStart(2,"0")).join("").toUpperCase();return`err_${Date.now()}x${s}`}},qe=a=>typeof a=="object"&&!Array.isArray(a)&&a!==null,re=a=>a instanceof x||qe(a)&&a.isApiError===!0,B=class extends x{constructor(t,e,s){super(500,"An unknown error occurred","Unknown",t,e,s)}},v=class extends x{constructor(t,e,s){super(500,"An internal error occurred","Internal",t,e,s)}},O=class extends x{constructor(t,e,s){super(401,"The request requires to be authenticated.","Unauthorized",t,e,s)}},T=class extends x{constructor(t,e,s){super(403,"The requested action can't be peform by this resource.","Forbidden",t,e,s)}},D=class extends x{constructor(t,e,s){super(413,"The request payload is too large.","PayloadTooLarge",t,e,s)}},E=class extends x{constructor(t,e,s){super(400,"The request payload is invalid.","InvalidPayload",t,e,s)}},M=class extends x{constructor(t,e,s){super(415,"The request is invalid because the content-type is not supported.","UnsupportedMediaType",t,e,s)}},W=class extends x{constructor(t,e,s){super(405,"The requested method does not exist.","MethodNotFound",t,e,s)}},w=class extends x{constructor(t,e,s){super(404,"The requested resource does not exist.","ResourceNotFound",t,e,s)}},S=class extends x{constructor(t,e,s){super(400,"The provided JSON schema is invalid.","InvalidJsonSchema",t,e,s)}},L=class extends x{constructor(t,e,s){super(400,"The provided data doesn't respect the provided JSON schema.","InvalidDataFormat",t,e,s)}},G=class extends x{constructor(t,e,s){super(400,"The provided identifier is not valid. An identifier must start with a lowercase letter, be between 2 and 100 characters long and use only alphanumeric characters.","InvalidIdentifier",t,e,s)}},F=class extends x{constructor(t,e,s){super(409,"The resource is not related with another resource. This is usually caused when providing two resources that aren't linked together.","RelationConflict",t,e,s)}},_=class extends x{constructor(t,e,s){super(400,"The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request.","ReferenceNotFound",t,e,s)}},N=class extends x{constructor(t,e,s){super(400,"The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource.","InvalidQuery",t,e,s)}},j=class extends x{constructor(t,e,s){super(400,"An error happened during the execution of a runtime (bot or integration).","Runtime",t,e,s)}},Q=class extends x{constructor(t,e,s){super(409,"The record attempted to be created already exists.","AlreadyExists",t,e,s)}},H=class extends x{constructor(t,e,s){super(429,"The request has been rate limited.","RateLimited",t,e,s)}},$=class extends x{constructor(t,e,s){super(402,"A payment is required to perform this request.","PaymentRequired",t,e,s)}},Ie={Unknown:B,Internal:v,Unauthorized:O,Forbidden:T,PayloadTooLarge:D,InvalidPayload:E,UnsupportedMediaType:M,MethodNotFound:W,ResourceNotFound:w,InvalidJsonSchema:S,InvalidDataFormat:L,InvalidIdentifier:G,RelationConflict:F,ReferenceNotFound:_,InvalidQuery:N,Runtime:j,AlreadyExists:Q,RateLimited:H,PaymentRequired:$},K=a=>re(a)?a:a instanceof Error?new B(a.message,a):typeof a=="string"?new B(a):Ue(a);function Ue(a){if(typeof a=="object"&&"code"in a&&"type"in a&&"id"in a&&"message"in a&&typeof a.type=="string"&&typeof a.message=="string"){let t=Ie[a.type];return t?new t(a.message,void 0,a.id||"UNKNOWN"):new B(`An unclassified API error occurred: ${a.message} (Type: ${a.type}, Code: ${a.code})`)}return new B("An invalid error occurred: "+JSON.stringify(a))}var J=class{_innerClient;constructor(t,e,s){this._innerClient=new V(t,e,s)}createConversation=t=>this._innerClient.createConversation({createConversationBody:t}).then(e=>e.data).catch(e=>{throw m(e)});getConversation=t=>this._innerClient.getConversation(t).then(e=>e.data).catch(e=>{throw m(e)});listConversations=t=>this._innerClient.listConversations(t).then(e=>e.data).catch(e=>{throw m(e)});getOrCreateConversation=t=>this._innerClient.getOrCreateConversation({getOrCreateConversationBody:t}).then(e=>e.data).catch(e=>{throw m(e)});updateConversation=({id:t,...e})=>this._innerClient.updateConversation({id:t,updateConversationBody:e}).then(s=>s.data).catch(s=>{throw m(s)});deleteConversation=t=>this._innerClient.deleteConversation(t).then(e=>e.data).catch(e=>{throw m(e)});createEvent=t=>this._innerClient.createEvent({createEventBody:t}).then(e=>e.data).catch(e=>{throw m(e)});getEvent=t=>this._innerClient.getEvent(t).then(e=>e.data).catch(e=>{throw m(e)});listEvents=t=>this._innerClient.listEvents(t).then(e=>e.data).catch(e=>{throw m(e)});createMessage=t=>this._innerClient.createMessage({createMessageBody:t}).then(e=>e.data).catch(e=>{throw m(e)});getOrCreateMessage=t=>this._innerClient.getOrCreateMessage({getOrCreateMessageBody:t}).then(e=>e.data).catch(e=>{throw m(e)});getMessage=t=>this._innerClient.getMessage(t).then(e=>e.data).catch(e=>{throw m(e)});updateMessage=({id:t,...e})=>this._innerClient.updateMessage({id:t,updateMessageBody:e}).then(s=>s.data).catch(s=>{throw m(s)});listMessages=t=>this._innerClient.listMessages(t).then(e=>e.data).catch(e=>{throw m(e)});deleteMessage=t=>this._innerClient.deleteMessage(t).then(e=>e.data).catch(e=>{throw m(e)});createUser=t=>this._innerClient.createUser({createUserBody:t}).then(e=>e.data).catch(e=>{throw m(e)});getUser=t=>this._innerClient.getUser(t).then(e=>e.data).catch(e=>{throw m(e)});listUsers=t=>this._innerClient.listUsers(t).then(e=>e.data).catch(e=>{throw m(e)});getOrCreateUser=t=>this._innerClient.getOrCreateUser({getOrCreateUserBody:t}).then(e=>e.data).catch(e=>{throw m(e)});updateUser=({id:t,...e})=>this._innerClient.updateUser({id:t,updateUserBody:e}).then(s=>s.data).catch(s=>{throw m(s)});deleteUser=t=>this._innerClient.deleteUser(t).then(e=>e.data).catch(e=>{throw m(e)});getState=t=>this._innerClient.getState(t).then(e=>e.data).catch(e=>{throw m(e)});setState=({type:t,id:e,name:s,...o})=>this._innerClient.setState({type:t,id:e,name:s,setStateBody:o}).then(r=>r.data).catch(r=>{throw m(r)});patchState=({type:t,id:e,name:s,...o})=>this._innerClient.patchState({type:t,id:e,name:s,patchStateBody:o}).then(r=>r.data).catch(r=>{throw m(r)});callAction=t=>this._innerClient.callAction({callActionBody:t}).then(e=>e.data).catch(e=>{throw m(e)});configureIntegration=t=>this._innerClient.configureIntegration({configureIntegrationBody:t}).then(e=>e.data).catch(e=>{throw m(e)});listPublicIntegrations=t=>this._innerClient.listPublicIntegrations(t).then(e=>e.data).catch(e=>{throw m(e)});getPublicIntegrationById=t=>this._innerClient.getPublicIntegrationById(t).then(e=>e.data).catch(e=>{throw m(e)});getPublicIntegration=t=>this._innerClient.getPublicIntegration(t).then(e=>e.data).catch(e=>{throw m(e)});createBot=t=>this._innerClient.createBot({createBotBody:t}).then(e=>e.data).catch(e=>{throw m(e)});updateBot=({id:t,...e})=>this._innerClient.updateBot({id:t,updateBotBody:e}).then(s=>s.data).catch(s=>{throw m(s)});transferBot=({id:t,...e})=>this._innerClient.transferBot({id:t,transferBotBody:e}).then(s=>s.data).catch(s=>{throw m(s)});listBots=t=>this._innerClient.listBots(t).then(e=>e.data).catch(e=>{throw m(e)});getBot=t=>this._innerClient.getBot(t).then(e=>e.data).catch(e=>{throw m(e)});deleteBot=t=>this._innerClient.deleteBot(t).then(e=>e.data).catch(e=>{throw m(e)});getBotLogs=t=>this._innerClient.getBotLogs(t).then(e=>e.data).catch(e=>{throw m(e)});getBotWebchat=t=>this._innerClient.getBotWebchat(t).then(e=>e.data).catch(e=>{throw m(e)});getBotAnalytics=t=>this._innerClient.getBotAnalytics(t).then(e=>e.data).catch(e=>{throw m(e)});createWorkspace=t=>this._innerClient.createWorkspace({createWorkspaceBody:t}).then(e=>e.data).catch(e=>{throw m(e)});getWorkspace=t=>this._innerClient.getWorkspace(t).then(e=>e.data).catch(e=>{throw m(e)});updateWorkspace=({id:t,...e})=>this._innerClient.updateWorkspace({id:t,updateWorkspaceBody:e}).then(s=>s.data).catch(s=>{throw m(s)});listWorkspaces=t=>this._innerClient.listWorkspaces(t).then(e=>e.data).catch(e=>{throw m(e)});changeWorkspacePlan=({id:t,...e})=>this._innerClient.changeWorkspacePlan({id:t,changeWorkspacePlanBody:e}).then(s=>s.data).catch(s=>{throw m(s)});deleteWorkspace=t=>this._innerClient.deleteWorkspace(t).then(e=>e.data).catch(e=>{throw m(e)});getAuditRecords=t=>this._innerClient.getAuditRecords(t).then(e=>e.data).catch(e=>{throw m(e)});listWorkspaceMembers=t=>this._innerClient.listWorkspaceMembers(t).then(e=>e.data).catch(e=>{throw m(e)});deleteWorkspaceMember=t=>this._innerClient.deleteWorkspaceMember(t).then(e=>e.data).catch(e=>{throw m(e)});createWorkspaceMember=t=>this._innerClient.createWorkspaceMember({createWorkspaceMemberBody:t}).then(e=>e.data).catch(e=>{throw m(e)});updateWorkspaceMember=({id:t,...e})=>this._innerClient.updateWorkspaceMember({id:t,updateWorkspaceMemberBody:e}).then(s=>s.data).catch(s=>{throw m(s)});createIntegration=t=>this._innerClient.createIntegration({createIntegrationBody:t}).then(e=>e.data).catch(e=>{throw m(e)});updateIntegration=({id:t,...e})=>this._innerClient.updateIntegration({id:t,updateIntegrationBody:e}).then(s=>s.data).catch(s=>{throw m(s)});listIntegrations=t=>this._innerClient.listIntegrations(t).then(e=>e.data).catch(e=>{throw m(e)});getIntegration=t=>this._innerClient.getIntegration(t).then(e=>e.data).catch(e=>{throw m(e)});getIntegrationLogs=t=>this._innerClient.getIntegrationLogs(t).then(e=>e.data).catch(e=>{throw m(e)});getIntegrationByName=t=>this._innerClient.getIntegrationByName(t).then(e=>e.data).catch(e=>{throw m(e)});deleteIntegration=t=>this._innerClient.deleteIntegration(t).then(e=>e.data).catch(e=>{throw m(e)});introspect=t=>this._innerClient.introspect({introspectBody:t}).then(e=>e.data).catch(e=>{throw m(e)});createFile=t=>this._innerClient.createFile({createFileBody:t}).then(e=>e.data).catch(e=>{throw m(e)});getFile=t=>this._innerClient.getFile(t).then(e=>e.data).catch(e=>{throw m(e)});downloadFile=t=>this._innerClient.downloadFile(t).then(e=>e.data).catch(e=>{throw m(e)});deleteFile=t=>this._innerClient.deleteFile(t).then(e=>e.data).catch(e=>{throw m(e)});listFiles=t=>this._innerClient.listFiles(t).then(e=>e.data).catch(e=>{throw m(e)})};function m(a){return ae.default.isAxiosError(a)&&a.response?.data?K(a.response.data):K(a)}var Oe=b(require("axios")),ne=100*1024*1024,ke=ne,Ve=ne,Z=class extends J{config;constructor(t={}){let e=ee(t),{apiUrl:s,headers:o,withCredentials:r,timeout:n}=e,i=oe.default.create({headers:o,withCredentials:r,timeout:n,maxBodyLength:ke,maxContentLength:Ve});super(void 0,s,i),this.config=e}};0&&(module.exports={AlreadyExistsError,Client,ForbiddenError,InternalError,InvalidDataFormatError,InvalidIdentifierError,InvalidJsonSchemaError,InvalidPayloadError,InvalidQueryError,MethodNotFoundError,PayloadTooLargeError,PaymentRequiredError,RateLimitedError,ReferenceNotFoundError,RelationConflictError,ResourceNotFoundError,RuntimeError,UnauthorizedError,UnknownError,UnsupportedMediaTypeError,axios,errorFrom,isApiError});
|
|
1
|
+
"use strict";var le=Object.create;var I=Object.defineProperty;var pe=Object.getOwnPropertyDescriptor;var ce=Object.getOwnPropertyNames;var ue=Object.getPrototypeOf,de=Object.prototype.hasOwnProperty;var ge=(a,t)=>{for(var e in t)I(a,e,{get:t[e],enumerable:!0})},ee=(a,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ce(t))!de.call(a,o)&&o!==e&&I(a,o,{get:()=>t[o],enumerable:!(s=pe(t,o))||s.enumerable});return a};var b=(a,t,e)=>(e=a!=null?le(ue(a)):{},ee(t||!a||!a.__esModule?I(e,"default",{value:a,enumerable:!0}):e,a)),ye=a=>ee(I({},"__esModule",{value:!0}),a);var Oe={};ge(Oe,{AlreadyExistsError:()=>Q,Client:()=>X,ForbiddenError:()=>T,InternalError:()=>v,InvalidDataFormatError:()=>L,InvalidIdentifierError:()=>G,InvalidJsonSchemaError:()=>S,InvalidPayloadError:()=>E,InvalidQueryError:()=>N,MethodNotFoundError:()=>W,PayloadTooLargeError:()=>D,PaymentRequiredError:()=>$,RateLimitedError:()=>H,ReferenceNotFoundError:()=>_,RelationConflictError:()=>F,ResourceNotFoundError:()=>w,RuntimeError:()=>j,UnauthorizedError:()=>O,UnknownError:()=>B,UnsupportedMediaTypeError:()=>M,axios:()=>Te,errorFrom:()=>K,isApiError:()=>ae});module.exports=ye(Oe);var ne=b(require("axios"));var q=require("browser-or-node"),he="https://api.botpress.cloud",Ae=6e4,Re="BP_API_URL",me="BP_BOT_ID",fe="BP_INTEGRATION_ID",Ce="BP_WORKSPACE_ID",xe="BP_TOKEN";function te(a){let t=Pe(a),e={};t.workspaceId&&(e["x-workspace-id"]=t.workspaceId),t.botId&&(e["x-bot-id"]=t.botId),t.integrationId&&(e["x-integration-id"]=t.integrationId),t.token&&(e.Authorization=`Bearer ${t.token}`),e={...e,...t.headers};let s=t.apiUrl??he,o=t.timeout??Ae;return{apiUrl:s,timeout:o,withCredentials:q.isBrowser,headers:e}}function Pe(a){return q.isBrowser?a:q.isNode?Be(a):a}function Be(a){let t={...a,apiUrl:a.apiUrl??process.env[Re],botId:a.botId??process.env[me],integrationId:a.integrationId??process.env[fe],workspaceId:a.workspaceId??process.env[Ce]},e=t.token??process.env[xe];return e&&(t.token=e),t}var oe=b(require("axios"));var A=b(require("axios"));var se=b(require("axios")),u="https://api.botpress.cloud".replace(/\/+$/,"");var U=class{constructor(t,e=u,s=se.default){this.basePath=e;this.axios=s;t&&(this.configuration=t,this.basePath=t.basePath||this.basePath)}configuration},k=class extends Error{constructor(e,s){super(s);this.field=e;this.name="RequiredError"}};var d="https://example.com",f=function(a,t,e){if(e==null)throw new k(t,`Required parameter ${t} was null or undefined when calling ${a}.`)};function Y(a,t,e=""){t!=null&&(typeof t=="object"?Array.isArray(t)?t.forEach(s=>Y(a,s,e)):Object.keys(t).forEach(s=>Y(a,t[s],`${e}${e!==""?".":""}${s}`)):a.has(e)?a.append(e,t):a.set(e,t))}var g=function(a,...t){let e=new URLSearchParams(a.search);Y(e,t),a.search=e.toString()},C=function(a,t,e){let s=typeof a!="string";return(s&&e&&e.isJsonMime?e.isJsonMime(t.headers["Content-Type"]):s)?JSON.stringify(a!==void 0?a:{}):a||""},y=function(a){return a.pathname+a.search+a.hash},h=function(a,t,e,s){return(o=t,r=e)=>{let n={...a.options,url:(s?.basePath||r)+a.url};return o.request(n)}};var be=function(a){return{callAction:async(t,e={})=>{let s="/v1/chat/actions",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"POST",...r,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,a),{url:y(o),options:n}},changeWorkspacePlan:async(t,e,s={})=>{f("changeWorkspacePlan","id",t);let o="/v1/admin/workspaces/{id}/change-plan".replace("{id}",encodeURIComponent(String(t))),r=new URL(o,d),n;a&&(n=a.baseOptions);let i={method:"PUT",...n,...s},p={},l={};p["Content-Type"]="application/json",g(r,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},i.data=C(e,i,a),{url:y(r),options:i}},configureIntegration:async(t,e={})=>{let s="/v1/chat/integrations/configure",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"POST",...r,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,a),{url:y(o),options:n}},createBot:async(t,e={})=>{let s="/v1/admin/bots",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"POST",...r,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,a),{url:y(o),options:n}},createConversation:async(t,e={})=>{let s="/v1/chat/conversations",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"POST",...r,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,a),{url:y(o),options:n}},createEvent:async(t,e={})=>{let s="/v1/chat/events",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"POST",...r,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,a),{url:y(o),options:n}},createFile:async(t,e={})=>{let s="/v1/storage/files",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"POST",...r,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,a),{url:y(o),options:n}},createIntegration:async(t,e={})=>{let s="/v1/admin/integrations",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"POST",...r,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,a),{url:y(o),options:n}},createMessage:async(t,e={})=>{let s="/v1/chat/messages",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"POST",...r,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,a),{url:y(o),options:n}},createUser:async(t,e={})=>{let s="/v1/chat/users",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"POST",...r,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,a),{url:y(o),options:n}},createWorkspace:async(t,e={})=>{let s="/v1/admin/workspaces",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"POST",...r,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,a),{url:y(o),options:n}},createWorkspaceMember:async(t,e={})=>{let s="/v1/admin/workspace-members",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"POST",...r,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,a),{url:y(o),options:n}},deleteBot:async(t,e={})=>{f("deleteBot","id",t);let s="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"DELETE",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},deleteConversation:async(t,e={})=>{f("deleteConversation","id",t);let s="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"DELETE",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},deleteFile:async(t,e={})=>{f("deleteFile","id",t);let s="/v1/storage/files/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"DELETE",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},deleteIntegration:async(t,e={})=>{f("deleteIntegration","id",t);let s="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"DELETE",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},deleteMessage:async(t,e={})=>{f("deleteMessage","id",t);let s="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"DELETE",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},deleteUser:async(t,e={})=>{f("deleteUser","id",t);let s="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"DELETE",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},deleteWorkspace:async(t,e={})=>{f("deleteWorkspace","id",t);let s="/v1/admin/workspaces/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"DELETE",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},deleteWorkspaceMember:async(t,e={})=>{f("deleteWorkspaceMember","id",t);let s="/v1/admin/workspace-members/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"DELETE",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},downloadFile:async(t,e={})=>{f("downloadFile","id",t);let s="/v1/storage/files/{id}/download".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"GET",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},getAccount:async(t={})=>{let e="/v1/admin/account/me",s=new URL(e,d),o;a&&(o=a.baseOptions);let r={method:"GET",...o,...t},n={};g(s,{});let p=o&&o.headers?o.headers:{};return r.headers={...n,...p,...t.headers},{url:y(s),options:r}},getAuditRecords:async(t,e,s={})=>{f("getAuditRecords","id",t);let o="/v1/admin/workspaces/{id}/audit-records".replace("{id}",encodeURIComponent(String(t))),r=new URL(o,d),n;a&&(n=a.baseOptions);let i={method:"GET",...n,...s},p={},l={};e!==void 0&&(l.nextToken=e),g(r,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},{url:y(r),options:i}},getBot:async(t,e={})=>{f("getBot","id",t);let s="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"GET",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},getBotAnalytics:async(t,e,s,o={})=>{f("getBotAnalytics","id",t),f("getBotAnalytics","startDate",e),f("getBotAnalytics","endDate",s);let r="/v1/admin/bots/{id}/analytics".replace("{id}",encodeURIComponent(String(t))),n=new URL(r,d),i;a&&(i=a.baseOptions);let p={method:"GET",...i,...o},l={},c={};e!==void 0&&(c.startDate=e),s!==void 0&&(c.endDate=s),g(n,c);let P=i&&i.headers?i.headers:{};return p.headers={...l,...P,...o.headers},{url:y(n),options:p}},getBotLogs:async(t,e={})=>{f("getBotLogs","id",t);let s="/v1/admin/bots/{id}/logs".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"GET",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},getBotWebchat:async(t,e,s={})=>{f("getBotWebchat","id",t),f("getBotWebchat","type",e);let o="/v1/admin/bots/{id}/webchat".replace("{id}",encodeURIComponent(String(t))),r=new URL(o,d),n;a&&(n=a.baseOptions);let i={method:"GET",...n,...s},p={},l={};e!==void 0&&(l.type=e),g(r,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},{url:y(r),options:i}},getConversation:async(t,e={})=>{f("getConversation","id",t);let s="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"GET",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},getEvent:async(t,e={})=>{f("getEvent","id",t);let s="/v1/chat/events/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"GET",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},getFile:async(t,e={})=>{f("getFile","id",t);let s="/v1/storage/files/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"GET",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},getIntegration:async(t,e={})=>{f("getIntegration","id",t);let s="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"GET",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},getIntegrationByName:async(t,e,s={})=>{f("getIntegrationByName","name",t),f("getIntegrationByName","version",e);let o="/v1/admin/integrations/{name}/{version}".replace("{name}",encodeURIComponent(String(t))).replace("{version}",encodeURIComponent(String(e))),r=new URL(o,d),n;a&&(n=a.baseOptions);let i={method:"GET",...n,...s},p={};g(r,{});let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},{url:y(r),options:i}},getIntegrationLogs:async(t,e={})=>{f("getIntegrationLogs","id",t);let s="/v1/admin/integrations/{id}/logs".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"GET",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},getMessage:async(t,e={})=>{f("getMessage","id",t);let s="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"GET",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},getOrCreateConversation:async(t,e={})=>{let s="/v1/chat/conversations/get-or-create",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"POST",...r,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,a),{url:y(o),options:n}},getOrCreateMessage:async(t,e={})=>{let s="/v1/chat/messages/get-or-create",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"POST",...r,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,a),{url:y(o),options:n}},getOrCreateUser:async(t,e={})=>{let s="/v1/chat/users/get-or-create",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"POST",...r,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,a),{url:y(o),options:n}},getPublicIntegration:async(t,e,s={})=>{f("getPublicIntegration","name",t),f("getPublicIntegration","version",e);let o="/v1/admin/hub/integrations/{name}/{version}".replace("{name}",encodeURIComponent(String(t))).replace("{version}",encodeURIComponent(String(e))),r=new URL(o,d),n;a&&(n=a.baseOptions);let i={method:"GET",...n,...s},p={};g(r,{});let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},{url:y(r),options:i}},getPublicIntegrationById:async(t,e={})=>{f("getPublicIntegrationById","id",t);let s="/v1/admin/hub/integrations/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"GET",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},getState:async(t,e,s,o={})=>{f("getState","type",t),f("getState","id",e),f("getState","name",s);let r="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(e))).replace("{name}",encodeURIComponent(String(s))),n=new URL(r,d),i;a&&(i=a.baseOptions);let p={method:"GET",...i,...o},l={};g(n,{});let P=i&&i.headers?i.headers:{};return p.headers={...l,...P,...o.headers},{url:y(n),options:p}},getUser:async(t,e={})=>{f("getUser","id",t);let s="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"GET",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},getWorkspace:async(t,e={})=>{f("getWorkspace","id",t);let s="/v1/admin/workspaces/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"GET",...r,...e},i={};g(o,{});let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},introspect:async(t,e={})=>{let s="/v1/admin/introspect",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"POST",...r,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,a),{url:y(o),options:n}},listBots:async(t,e={})=>{let s="/v1/admin/bots",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"GET",...r,...e},i={},p={};t!==void 0&&(p.nextToken=t),g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},listConversations:async(t,e,s,o={})=>{let r="/v1/chat/conversations",n=new URL(r,d),i;a&&(i=a.baseOptions);let p={method:"GET",...i,...o},l={},c={};t!==void 0&&(c.nextToken=t),e!==void 0&&(c.tags=e),s&&(c.participantIds=s),g(n,c);let P=i&&i.headers?i.headers:{};return p.headers={...l,...P,...o.headers},{url:y(n),options:p}},listEvents:async(t,e,s={})=>{let o="/v1/chat/events",r=new URL(o,d),n;a&&(n=a.baseOptions);let i={method:"GET",...n,...s},p={},l={};t!==void 0&&(l.nextToken=t),e!==void 0&&(l.type=e),g(r,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},{url:y(r),options:i}},listFiles:async(t,e,s={})=>{f("listFiles","botId",t);let o="/v1/storage/files",r=new URL(o,d),n;a&&(n=a.baseOptions);let i={method:"GET",...n,...s},p={},l={};e!==void 0&&(l.nextToken=e),t!==void 0&&(l.botId=t),g(r,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},{url:y(r),options:i}},listIntegrations:async(t,e,s,o={})=>{let r="/v1/admin/integrations",n=new URL(r,d),i;a&&(i=a.baseOptions);let p={method:"GET",...i,...o},l={},c={};t!==void 0&&(c.nextToken=t),e!==void 0&&(c.name=e),s!==void 0&&(c.version=s),g(n,c);let P=i&&i.headers?i.headers:{};return p.headers={...l,...P,...o.headers},{url:y(n),options:p}},listMessages:async(t,e,s,o={})=>{let r="/v1/chat/messages",n=new URL(r,d),i;a&&(i=a.baseOptions);let p={method:"GET",...i,...o},l={},c={};t!==void 0&&(c.nextToken=t),e!==void 0&&(c.conversationId=e),s!==void 0&&(c.tags=s),g(n,c);let P=i&&i.headers?i.headers:{};return p.headers={...l,...P,...o.headers},{url:y(n),options:p}},listPublicIntegrations:async(t,e,s,o={})=>{let r="/v1/admin/hub/integrations",n=new URL(r,d),i;a&&(i=a.baseOptions);let p={method:"GET",...i,...o},l={},c={};t!==void 0&&(c.nextToken=t),e!==void 0&&(c.name=e),s!==void 0&&(c.version=s),g(n,c);let P=i&&i.headers?i.headers:{};return p.headers={...l,...P,...o.headers},{url:y(n),options:p}},listUsers:async(t,e,s,o={})=>{let r="/v1/chat/users",n=new URL(r,d),i;a&&(i=a.baseOptions);let p={method:"GET",...i,...o},l={},c={};t!==void 0&&(c.nextToken=t),e!==void 0&&(c.conversationId=e),s!==void 0&&(c.tags=s),g(n,c);let P=i&&i.headers?i.headers:{};return p.headers={...l,...P,...o.headers},{url:y(n),options:p}},listWorkspaceMembers:async(t,e={})=>{let s="/v1/admin/workspace-members",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"GET",...r,...e},i={},p={};t!==void 0&&(p.nextToken=t),g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},listWorkspaces:async(t,e={})=>{let s="/v1/admin/workspaces",o=new URL(s,d),r;a&&(r=a.baseOptions);let n={method:"GET",...r,...e},i={},p={};t!==void 0&&(p.nextToken=t),g(o,p);let l=r&&r.headers?r.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},patchState:async(t,e,s,o,r={})=>{f("patchState","type",t),f("patchState","id",e),f("patchState","name",s);let n="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(e))).replace("{name}",encodeURIComponent(String(s))),i=new URL(n,d),p;a&&(p=a.baseOptions);let l={method:"PATCH",...p,...r},c={},P={};c["Content-Type"]="application/json",g(i,P);let z=p&&p.headers?p.headers:{};return l.headers={...c,...z,...r.headers},l.data=C(o,l,a),{url:y(i),options:l}},setState:async(t,e,s,o,r={})=>{f("setState","type",t),f("setState","id",e),f("setState","name",s);let n="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(e))).replace("{name}",encodeURIComponent(String(s))),i=new URL(n,d),p;a&&(p=a.baseOptions);let l={method:"POST",...p,...r},c={},P={};c["Content-Type"]="application/json",g(i,P);let z=p&&p.headers?p.headers:{};return l.headers={...c,...z,...r.headers},l.data=C(o,l,a),{url:y(i),options:l}},transferBot:async(t,e,s={})=>{f("transferBot","id",t);let o="/v1/admin/bots/{id}/transfer".replace("{id}",encodeURIComponent(String(t))),r=new URL(o,d),n;a&&(n=a.baseOptions);let i={method:"POST",...n,...s},p={},l={};p["Content-Type"]="application/json",g(r,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},i.data=C(e,i,a),{url:y(r),options:i}},updateBot:async(t,e,s={})=>{f("updateBot","id",t);let o="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(t))),r=new URL(o,d),n;a&&(n=a.baseOptions);let i={method:"PUT",...n,...s},p={},l={};p["Content-Type"]="application/json",g(r,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},i.data=C(e,i,a),{url:y(r),options:i}},updateConversation:async(t,e,s={})=>{f("updateConversation","id",t);let o="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(t))),r=new URL(o,d),n;a&&(n=a.baseOptions);let i={method:"PUT",...n,...s},p={},l={};p["Content-Type"]="application/json",g(r,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},i.data=C(e,i,a),{url:y(r),options:i}},updateIntegration:async(t,e,s={})=>{f("updateIntegration","id",t);let o="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(t))),r=new URL(o,d),n;a&&(n=a.baseOptions);let i={method:"PUT",...n,...s},p={},l={};p["Content-Type"]="application/json",g(r,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},i.data=C(e,i,a),{url:y(r),options:i}},updateMessage:async(t,e,s={})=>{f("updateMessage","id",t);let o="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(t))),r=new URL(o,d),n;a&&(n=a.baseOptions);let i={method:"PUT",...n,...s},p={},l={};p["Content-Type"]="application/json",g(r,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},i.data=C(e,i,a),{url:y(r),options:i}},updateUser:async(t,e,s={})=>{f("updateUser","id",t);let o="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(t))),r=new URL(o,d),n;a&&(n=a.baseOptions);let i={method:"PUT",...n,...s},p={},l={};p["Content-Type"]="application/json",g(r,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},i.data=C(e,i,a),{url:y(r),options:i}},updateWorkspace:async(t,e,s={})=>{f("updateWorkspace","id",t);let o="/v1/admin/workspaces/{id}".replace("{id}",encodeURIComponent(String(t))),r=new URL(o,d),n;a&&(n=a.baseOptions);let i={method:"PUT",...n,...s},p={},l={};p["Content-Type"]="application/json",g(r,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},i.data=C(e,i,a),{url:y(r),options:i}},updateWorkspaceMember:async(t,e,s={})=>{f("updateWorkspaceMember","id",t);let o="/v1/admin/workspace-members/{id}".replace("{id}",encodeURIComponent(String(t))),r=new URL(o,d),n;a&&(n=a.baseOptions);let i={method:"PUT",...n,...s},p={},l={};p["Content-Type"]="application/json",g(r,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},i.data=C(e,i,a),{url:y(r),options:i}}}},R=function(a){let t=be(a);return{async callAction(e,s){let o=await t.callAction(e,s);return h(o,A.default,u,a)},async changeWorkspacePlan(e,s,o){let r=await t.changeWorkspacePlan(e,s,o);return h(r,A.default,u,a)},async configureIntegration(e,s){let o=await t.configureIntegration(e,s);return h(o,A.default,u,a)},async createBot(e,s){let o=await t.createBot(e,s);return h(o,A.default,u,a)},async createConversation(e,s){let o=await t.createConversation(e,s);return h(o,A.default,u,a)},async createEvent(e,s){let o=await t.createEvent(e,s);return h(o,A.default,u,a)},async createFile(e,s){let o=await t.createFile(e,s);return h(o,A.default,u,a)},async createIntegration(e,s){let o=await t.createIntegration(e,s);return h(o,A.default,u,a)},async createMessage(e,s){let o=await t.createMessage(e,s);return h(o,A.default,u,a)},async createUser(e,s){let o=await t.createUser(e,s);return h(o,A.default,u,a)},async createWorkspace(e,s){let o=await t.createWorkspace(e,s);return h(o,A.default,u,a)},async createWorkspaceMember(e,s){let o=await t.createWorkspaceMember(e,s);return h(o,A.default,u,a)},async deleteBot(e,s){let o=await t.deleteBot(e,s);return h(o,A.default,u,a)},async deleteConversation(e,s){let o=await t.deleteConversation(e,s);return h(o,A.default,u,a)},async deleteFile(e,s){let o=await t.deleteFile(e,s);return h(o,A.default,u,a)},async deleteIntegration(e,s){let o=await t.deleteIntegration(e,s);return h(o,A.default,u,a)},async deleteMessage(e,s){let o=await t.deleteMessage(e,s);return h(o,A.default,u,a)},async deleteUser(e,s){let o=await t.deleteUser(e,s);return h(o,A.default,u,a)},async deleteWorkspace(e,s){let o=await t.deleteWorkspace(e,s);return h(o,A.default,u,a)},async deleteWorkspaceMember(e,s){let o=await t.deleteWorkspaceMember(e,s);return h(o,A.default,u,a)},async downloadFile(e,s){let o=await t.downloadFile(e,s);return h(o,A.default,u,a)},async getAccount(e){let s=await t.getAccount(e);return h(s,A.default,u,a)},async getAuditRecords(e,s,o){let r=await t.getAuditRecords(e,s,o);return h(r,A.default,u,a)},async getBot(e,s){let o=await t.getBot(e,s);return h(o,A.default,u,a)},async getBotAnalytics(e,s,o,r){let n=await t.getBotAnalytics(e,s,o,r);return h(n,A.default,u,a)},async getBotLogs(e,s){let o=await t.getBotLogs(e,s);return h(o,A.default,u,a)},async getBotWebchat(e,s,o){let r=await t.getBotWebchat(e,s,o);return h(r,A.default,u,a)},async getConversation(e,s){let o=await t.getConversation(e,s);return h(o,A.default,u,a)},async getEvent(e,s){let o=await t.getEvent(e,s);return h(o,A.default,u,a)},async getFile(e,s){let o=await t.getFile(e,s);return h(o,A.default,u,a)},async getIntegration(e,s){let o=await t.getIntegration(e,s);return h(o,A.default,u,a)},async getIntegrationByName(e,s,o){let r=await t.getIntegrationByName(e,s,o);return h(r,A.default,u,a)},async getIntegrationLogs(e,s){let o=await t.getIntegrationLogs(e,s);return h(o,A.default,u,a)},async getMessage(e,s){let o=await t.getMessage(e,s);return h(o,A.default,u,a)},async getOrCreateConversation(e,s){let o=await t.getOrCreateConversation(e,s);return h(o,A.default,u,a)},async getOrCreateMessage(e,s){let o=await t.getOrCreateMessage(e,s);return h(o,A.default,u,a)},async getOrCreateUser(e,s){let o=await t.getOrCreateUser(e,s);return h(o,A.default,u,a)},async getPublicIntegration(e,s,o){let r=await t.getPublicIntegration(e,s,o);return h(r,A.default,u,a)},async getPublicIntegrationById(e,s){let o=await t.getPublicIntegrationById(e,s);return h(o,A.default,u,a)},async getState(e,s,o,r){let n=await t.getState(e,s,o,r);return h(n,A.default,u,a)},async getUser(e,s){let o=await t.getUser(e,s);return h(o,A.default,u,a)},async getWorkspace(e,s){let o=await t.getWorkspace(e,s);return h(o,A.default,u,a)},async introspect(e,s){let o=await t.introspect(e,s);return h(o,A.default,u,a)},async listBots(e,s){let o=await t.listBots(e,s);return h(o,A.default,u,a)},async listConversations(e,s,o,r){let n=await t.listConversations(e,s,o,r);return h(n,A.default,u,a)},async listEvents(e,s,o){let r=await t.listEvents(e,s,o);return h(r,A.default,u,a)},async listFiles(e,s,o){let r=await t.listFiles(e,s,o);return h(r,A.default,u,a)},async listIntegrations(e,s,o,r){let n=await t.listIntegrations(e,s,o,r);return h(n,A.default,u,a)},async listMessages(e,s,o,r){let n=await t.listMessages(e,s,o,r);return h(n,A.default,u,a)},async listPublicIntegrations(e,s,o,r){let n=await t.listPublicIntegrations(e,s,o,r);return h(n,A.default,u,a)},async listUsers(e,s,o,r){let n=await t.listUsers(e,s,o,r);return h(n,A.default,u,a)},async listWorkspaceMembers(e,s){let o=await t.listWorkspaceMembers(e,s);return h(o,A.default,u,a)},async listWorkspaces(e,s){let o=await t.listWorkspaces(e,s);return h(o,A.default,u,a)},async patchState(e,s,o,r,n){let i=await t.patchState(e,s,o,r,n);return h(i,A.default,u,a)},async setState(e,s,o,r,n){let i=await t.setState(e,s,o,r,n);return h(i,A.default,u,a)},async transferBot(e,s,o){let r=await t.transferBot(e,s,o);return h(r,A.default,u,a)},async updateBot(e,s,o){let r=await t.updateBot(e,s,o);return h(r,A.default,u,a)},async updateConversation(e,s,o){let r=await t.updateConversation(e,s,o);return h(r,A.default,u,a)},async updateIntegration(e,s,o){let r=await t.updateIntegration(e,s,o);return h(r,A.default,u,a)},async updateMessage(e,s,o){let r=await t.updateMessage(e,s,o);return h(r,A.default,u,a)},async updateUser(e,s,o){let r=await t.updateUser(e,s,o);return h(r,A.default,u,a)},async updateWorkspace(e,s,o){let r=await t.updateWorkspace(e,s,o);return h(r,A.default,u,a)},async updateWorkspaceMember(e,s,o){let r=await t.updateWorkspaceMember(e,s,o);return h(r,A.default,u,a)}}};var V=class extends U{callAction(t={},e){return R(this.configuration).callAction(t.callActionBody,e).then(s=>s(this.axios,this.basePath))}changeWorkspacePlan(t,e){return R(this.configuration).changeWorkspacePlan(t.id,t.changeWorkspacePlanBody,e).then(s=>s(this.axios,this.basePath))}configureIntegration(t={},e){return R(this.configuration).configureIntegration(t.configureIntegrationBody,e).then(s=>s(this.axios,this.basePath))}createBot(t={},e){return R(this.configuration).createBot(t.createBotBody,e).then(s=>s(this.axios,this.basePath))}createConversation(t={},e){return R(this.configuration).createConversation(t.createConversationBody,e).then(s=>s(this.axios,this.basePath))}createEvent(t={},e){return R(this.configuration).createEvent(t.createEventBody,e).then(s=>s(this.axios,this.basePath))}createFile(t={},e){return R(this.configuration).createFile(t.createFileBody,e).then(s=>s(this.axios,this.basePath))}createIntegration(t={},e){return R(this.configuration).createIntegration(t.createIntegrationBody,e).then(s=>s(this.axios,this.basePath))}createMessage(t={},e){return R(this.configuration).createMessage(t.createMessageBody,e).then(s=>s(this.axios,this.basePath))}createUser(t={},e){return R(this.configuration).createUser(t.createUserBody,e).then(s=>s(this.axios,this.basePath))}createWorkspace(t={},e){return R(this.configuration).createWorkspace(t.createWorkspaceBody,e).then(s=>s(this.axios,this.basePath))}createWorkspaceMember(t={},e){return R(this.configuration).createWorkspaceMember(t.createWorkspaceMemberBody,e).then(s=>s(this.axios,this.basePath))}deleteBot(t,e){return R(this.configuration).deleteBot(t.id,e).then(s=>s(this.axios,this.basePath))}deleteConversation(t,e){return R(this.configuration).deleteConversation(t.id,e).then(s=>s(this.axios,this.basePath))}deleteFile(t,e){return R(this.configuration).deleteFile(t.id,e).then(s=>s(this.axios,this.basePath))}deleteIntegration(t,e){return R(this.configuration).deleteIntegration(t.id,e).then(s=>s(this.axios,this.basePath))}deleteMessage(t,e){return R(this.configuration).deleteMessage(t.id,e).then(s=>s(this.axios,this.basePath))}deleteUser(t,e){return R(this.configuration).deleteUser(t.id,e).then(s=>s(this.axios,this.basePath))}deleteWorkspace(t,e){return R(this.configuration).deleteWorkspace(t.id,e).then(s=>s(this.axios,this.basePath))}deleteWorkspaceMember(t,e){return R(this.configuration).deleteWorkspaceMember(t.id,e).then(s=>s(this.axios,this.basePath))}downloadFile(t,e){return R(this.configuration).downloadFile(t.id,e).then(s=>s(this.axios,this.basePath))}getAccount(t){return R(this.configuration).getAccount(t).then(e=>e(this.axios,this.basePath))}getAuditRecords(t,e){return R(this.configuration).getAuditRecords(t.id,t.nextToken,e).then(s=>s(this.axios,this.basePath))}getBot(t,e){return R(this.configuration).getBot(t.id,e).then(s=>s(this.axios,this.basePath))}getBotAnalytics(t,e){return R(this.configuration).getBotAnalytics(t.id,t.startDate,t.endDate,e).then(s=>s(this.axios,this.basePath))}getBotLogs(t,e){return R(this.configuration).getBotLogs(t.id,e).then(s=>s(this.axios,this.basePath))}getBotWebchat(t,e){return R(this.configuration).getBotWebchat(t.id,t.type,e).then(s=>s(this.axios,this.basePath))}getConversation(t,e){return R(this.configuration).getConversation(t.id,e).then(s=>s(this.axios,this.basePath))}getEvent(t,e){return R(this.configuration).getEvent(t.id,e).then(s=>s(this.axios,this.basePath))}getFile(t,e){return R(this.configuration).getFile(t.id,e).then(s=>s(this.axios,this.basePath))}getIntegration(t,e){return R(this.configuration).getIntegration(t.id,e).then(s=>s(this.axios,this.basePath))}getIntegrationByName(t,e){return R(this.configuration).getIntegrationByName(t.name,t.version,e).then(s=>s(this.axios,this.basePath))}getIntegrationLogs(t,e){return R(this.configuration).getIntegrationLogs(t.id,e).then(s=>s(this.axios,this.basePath))}getMessage(t,e){return R(this.configuration).getMessage(t.id,e).then(s=>s(this.axios,this.basePath))}getOrCreateConversation(t={},e){return R(this.configuration).getOrCreateConversation(t.getOrCreateConversationBody,e).then(s=>s(this.axios,this.basePath))}getOrCreateMessage(t={},e){return R(this.configuration).getOrCreateMessage(t.getOrCreateMessageBody,e).then(s=>s(this.axios,this.basePath))}getOrCreateUser(t={},e){return R(this.configuration).getOrCreateUser(t.getOrCreateUserBody,e).then(s=>s(this.axios,this.basePath))}getPublicIntegration(t,e){return R(this.configuration).getPublicIntegration(t.name,t.version,e).then(s=>s(this.axios,this.basePath))}getPublicIntegrationById(t,e){return R(this.configuration).getPublicIntegrationById(t.id,e).then(s=>s(this.axios,this.basePath))}getState(t,e){return R(this.configuration).getState(t.type,t.id,t.name,e).then(s=>s(this.axios,this.basePath))}getUser(t,e){return R(this.configuration).getUser(t.id,e).then(s=>s(this.axios,this.basePath))}getWorkspace(t,e){return R(this.configuration).getWorkspace(t.id,e).then(s=>s(this.axios,this.basePath))}introspect(t={},e){return R(this.configuration).introspect(t.introspectBody,e).then(s=>s(this.axios,this.basePath))}listBots(t={},e){return R(this.configuration).listBots(t.nextToken,e).then(s=>s(this.axios,this.basePath))}listConversations(t={},e){return R(this.configuration).listConversations(t.nextToken,t.tags,t.participantIds,e).then(s=>s(this.axios,this.basePath))}listEvents(t={},e){return R(this.configuration).listEvents(t.nextToken,t.type,e).then(s=>s(this.axios,this.basePath))}listFiles(t,e){return R(this.configuration).listFiles(t.botId,t.nextToken,e).then(s=>s(this.axios,this.basePath))}listIntegrations(t={},e){return R(this.configuration).listIntegrations(t.nextToken,t.name,t.version,e).then(s=>s(this.axios,this.basePath))}listMessages(t={},e){return R(this.configuration).listMessages(t.nextToken,t.conversationId,t.tags,e).then(s=>s(this.axios,this.basePath))}listPublicIntegrations(t={},e){return R(this.configuration).listPublicIntegrations(t.nextToken,t.name,t.version,e).then(s=>s(this.axios,this.basePath))}listUsers(t={},e){return R(this.configuration).listUsers(t.nextToken,t.conversationId,t.tags,e).then(s=>s(this.axios,this.basePath))}listWorkspaceMembers(t={},e){return R(this.configuration).listWorkspaceMembers(t.nextToken,e).then(s=>s(this.axios,this.basePath))}listWorkspaces(t={},e){return R(this.configuration).listWorkspaces(t.nextToken,e).then(s=>s(this.axios,this.basePath))}patchState(t,e){return R(this.configuration).patchState(t.type,t.id,t.name,t.patchStateBody,e).then(s=>s(this.axios,this.basePath))}setState(t,e){return R(this.configuration).setState(t.type,t.id,t.name,t.setStateBody,e).then(s=>s(this.axios,this.basePath))}transferBot(t,e){return R(this.configuration).transferBot(t.id,t.transferBotBody,e).then(s=>s(this.axios,this.basePath))}updateBot(t,e){return R(this.configuration).updateBot(t.id,t.updateBotBody,e).then(s=>s(this.axios,this.basePath))}updateConversation(t,e){return R(this.configuration).updateConversation(t.id,t.updateConversationBody,e).then(s=>s(this.axios,this.basePath))}updateIntegration(t,e){return R(this.configuration).updateIntegration(t.id,t.updateIntegrationBody,e).then(s=>s(this.axios,this.basePath))}updateMessage(t,e){return R(this.configuration).updateMessage(t.id,t.updateMessageBody,e).then(s=>s(this.axios,this.basePath))}updateUser(t,e){return R(this.configuration).updateUser(t.id,t.updateUserBody,e).then(s=>s(this.axios,this.basePath))}updateWorkspace(t,e){return R(this.configuration).updateWorkspace(t.id,t.updateWorkspaceBody,e).then(s=>s(this.axios,this.basePath))}updateWorkspaceMember(t,e){return R(this.configuration).updateWorkspaceMember(t.id,t.updateWorkspaceMemberBody,e).then(s=>s(this.axios,this.basePath))}};var re=b(require("crypto"));var qe={getRandomValues:a=>new Uint8Array(a.map(()=>Math.floor(Math.random()*256)))},Z=typeof window<"u"&&typeof window.document<"u"?window.crypto:re.default;Z.getRandomValues||(Z=qe);var x=class extends Error{constructor(e,s,o,r,n,i){super(r);this.code=e;this.description=s;this.type=o;this.message=r;this.error=n;this.id=i;this.id||(this.id=x.generateId())}isApiError=!0;toJSON(){return{id:this.id,code:this.code,type:this.type,message:this.message}}static generateId(){let s=Array.from(Z.getRandomValues(new Uint8Array(4))).map(o=>o.toString(16).padStart(2,"0")).join("").toUpperCase();return`err_${Date.now()}x${s}`}},Ie=a=>typeof a=="object"&&!Array.isArray(a)&&a!==null,ae=a=>a instanceof x||Ie(a)&&a.isApiError===!0,B=class extends x{constructor(t,e,s){super(500,"An unknown error occurred","Unknown",t,e,s)}},v=class extends x{constructor(t,e,s){super(500,"An internal error occurred","Internal",t,e,s)}},O=class extends x{constructor(t,e,s){super(401,"The request requires to be authenticated.","Unauthorized",t,e,s)}},T=class extends x{constructor(t,e,s){super(403,"The requested action can't be peform by this resource.","Forbidden",t,e,s)}},D=class extends x{constructor(t,e,s){super(413,"The request payload is too large.","PayloadTooLarge",t,e,s)}},E=class extends x{constructor(t,e,s){super(400,"The request payload is invalid.","InvalidPayload",t,e,s)}},M=class extends x{constructor(t,e,s){super(415,"The request is invalid because the content-type is not supported.","UnsupportedMediaType",t,e,s)}},W=class extends x{constructor(t,e,s){super(405,"The requested method does not exist.","MethodNotFound",t,e,s)}},w=class extends x{constructor(t,e,s){super(404,"The requested resource does not exist.","ResourceNotFound",t,e,s)}},S=class extends x{constructor(t,e,s){super(400,"The provided JSON schema is invalid.","InvalidJsonSchema",t,e,s)}},L=class extends x{constructor(t,e,s){super(400,"The provided data doesn't respect the provided JSON schema.","InvalidDataFormat",t,e,s)}},G=class extends x{constructor(t,e,s){super(400,"The provided identifier is not valid. An identifier must start with a lowercase letter, be between 2 and 100 characters long and use only alphanumeric characters.","InvalidIdentifier",t,e,s)}},F=class extends x{constructor(t,e,s){super(409,"The resource is not related with another resource. This is usually caused when providing two resources that aren't linked together.","RelationConflict",t,e,s)}},_=class extends x{constructor(t,e,s){super(400,"The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request.","ReferenceNotFound",t,e,s)}},N=class extends x{constructor(t,e,s){super(400,"The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource.","InvalidQuery",t,e,s)}},j=class extends x{constructor(t,e,s){super(400,"An error happened during the execution of a runtime (bot or integration).","Runtime",t,e,s)}},Q=class extends x{constructor(t,e,s){super(409,"The record attempted to be created already exists.","AlreadyExists",t,e,s)}},H=class extends x{constructor(t,e,s){super(429,"The request has been rate limited.","RateLimited",t,e,s)}},$=class extends x{constructor(t,e,s){super(402,"A payment is required to perform this request.","PaymentRequired",t,e,s)}},Ue={Unknown:B,Internal:v,Unauthorized:O,Forbidden:T,PayloadTooLarge:D,InvalidPayload:E,UnsupportedMediaType:M,MethodNotFound:W,ResourceNotFound:w,InvalidJsonSchema:S,InvalidDataFormat:L,InvalidIdentifier:G,RelationConflict:F,ReferenceNotFound:_,InvalidQuery:N,Runtime:j,AlreadyExists:Q,RateLimited:H,PaymentRequired:$},K=a=>ae(a)?a:a instanceof Error?new B(a.message,a):typeof a=="string"?new B(a):ke(a);function ke(a){if(typeof a=="object"&&"code"in a&&"type"in a&&"id"in a&&"message"in a&&typeof a.type=="string"&&typeof a.message=="string"){let t=Ue[a.type];return t?new t(a.message,void 0,a.id||"UNKNOWN"):new B(`An unclassified API error occurred: ${a.message} (Type: ${a.type}, Code: ${a.code})`)}return new B("An invalid error occurred: "+JSON.stringify(a))}var J=class{_innerClient;constructor(t,e,s){this._innerClient=new V(t,e,s)}createConversation=t=>this._innerClient.createConversation({createConversationBody:t}).then(e=>e.data).catch(e=>{throw m(e)});getConversation=t=>this._innerClient.getConversation(t).then(e=>e.data).catch(e=>{throw m(e)});listConversations=t=>this._innerClient.listConversations(t).then(e=>e.data).catch(e=>{throw m(e)});getOrCreateConversation=t=>this._innerClient.getOrCreateConversation({getOrCreateConversationBody:t}).then(e=>e.data).catch(e=>{throw m(e)});updateConversation=({id:t,...e})=>this._innerClient.updateConversation({id:t,updateConversationBody:e}).then(s=>s.data).catch(s=>{throw m(s)});deleteConversation=t=>this._innerClient.deleteConversation(t).then(e=>e.data).catch(e=>{throw m(e)});createEvent=t=>this._innerClient.createEvent({createEventBody:t}).then(e=>e.data).catch(e=>{throw m(e)});getEvent=t=>this._innerClient.getEvent(t).then(e=>e.data).catch(e=>{throw m(e)});listEvents=t=>this._innerClient.listEvents(t).then(e=>e.data).catch(e=>{throw m(e)});createMessage=t=>this._innerClient.createMessage({createMessageBody:t}).then(e=>e.data).catch(e=>{throw m(e)});getOrCreateMessage=t=>this._innerClient.getOrCreateMessage({getOrCreateMessageBody:t}).then(e=>e.data).catch(e=>{throw m(e)});getMessage=t=>this._innerClient.getMessage(t).then(e=>e.data).catch(e=>{throw m(e)});updateMessage=({id:t,...e})=>this._innerClient.updateMessage({id:t,updateMessageBody:e}).then(s=>s.data).catch(s=>{throw m(s)});listMessages=t=>this._innerClient.listMessages(t).then(e=>e.data).catch(e=>{throw m(e)});deleteMessage=t=>this._innerClient.deleteMessage(t).then(e=>e.data).catch(e=>{throw m(e)});createUser=t=>this._innerClient.createUser({createUserBody:t}).then(e=>e.data).catch(e=>{throw m(e)});getUser=t=>this._innerClient.getUser(t).then(e=>e.data).catch(e=>{throw m(e)});listUsers=t=>this._innerClient.listUsers(t).then(e=>e.data).catch(e=>{throw m(e)});getOrCreateUser=t=>this._innerClient.getOrCreateUser({getOrCreateUserBody:t}).then(e=>e.data).catch(e=>{throw m(e)});updateUser=({id:t,...e})=>this._innerClient.updateUser({id:t,updateUserBody:e}).then(s=>s.data).catch(s=>{throw m(s)});deleteUser=t=>this._innerClient.deleteUser(t).then(e=>e.data).catch(e=>{throw m(e)});getState=t=>this._innerClient.getState(t).then(e=>e.data).catch(e=>{throw m(e)});setState=({type:t,id:e,name:s,...o})=>this._innerClient.setState({type:t,id:e,name:s,setStateBody:o}).then(r=>r.data).catch(r=>{throw m(r)});patchState=({type:t,id:e,name:s,...o})=>this._innerClient.patchState({type:t,id:e,name:s,patchStateBody:o}).then(r=>r.data).catch(r=>{throw m(r)});callAction=t=>this._innerClient.callAction({callActionBody:t}).then(e=>e.data).catch(e=>{throw m(e)});configureIntegration=t=>this._innerClient.configureIntegration({configureIntegrationBody:t}).then(e=>e.data).catch(e=>{throw m(e)});getAccount=()=>this._innerClient.getAccount().then(t=>t.data).catch(t=>{throw m(t)});listPublicIntegrations=t=>this._innerClient.listPublicIntegrations(t).then(e=>e.data).catch(e=>{throw m(e)});getPublicIntegrationById=t=>this._innerClient.getPublicIntegrationById(t).then(e=>e.data).catch(e=>{throw m(e)});getPublicIntegration=t=>this._innerClient.getPublicIntegration(t).then(e=>e.data).catch(e=>{throw m(e)});createBot=t=>this._innerClient.createBot({createBotBody:t}).then(e=>e.data).catch(e=>{throw m(e)});updateBot=({id:t,...e})=>this._innerClient.updateBot({id:t,updateBotBody:e}).then(s=>s.data).catch(s=>{throw m(s)});transferBot=({id:t,...e})=>this._innerClient.transferBot({id:t,transferBotBody:e}).then(s=>s.data).catch(s=>{throw m(s)});listBots=t=>this._innerClient.listBots(t).then(e=>e.data).catch(e=>{throw m(e)});getBot=t=>this._innerClient.getBot(t).then(e=>e.data).catch(e=>{throw m(e)});deleteBot=t=>this._innerClient.deleteBot(t).then(e=>e.data).catch(e=>{throw m(e)});getBotLogs=t=>this._innerClient.getBotLogs(t).then(e=>e.data).catch(e=>{throw m(e)});getBotWebchat=t=>this._innerClient.getBotWebchat(t).then(e=>e.data).catch(e=>{throw m(e)});getBotAnalytics=t=>this._innerClient.getBotAnalytics(t).then(e=>e.data).catch(e=>{throw m(e)});createWorkspace=t=>this._innerClient.createWorkspace({createWorkspaceBody:t}).then(e=>e.data).catch(e=>{throw m(e)});getWorkspace=t=>this._innerClient.getWorkspace(t).then(e=>e.data).catch(e=>{throw m(e)});updateWorkspace=({id:t,...e})=>this._innerClient.updateWorkspace({id:t,updateWorkspaceBody:e}).then(s=>s.data).catch(s=>{throw m(s)});listWorkspaces=t=>this._innerClient.listWorkspaces(t).then(e=>e.data).catch(e=>{throw m(e)});changeWorkspacePlan=({id:t,...e})=>this._innerClient.changeWorkspacePlan({id:t,changeWorkspacePlanBody:e}).then(s=>s.data).catch(s=>{throw m(s)});deleteWorkspace=t=>this._innerClient.deleteWorkspace(t).then(e=>e.data).catch(e=>{throw m(e)});getAuditRecords=t=>this._innerClient.getAuditRecords(t).then(e=>e.data).catch(e=>{throw m(e)});listWorkspaceMembers=t=>this._innerClient.listWorkspaceMembers(t).then(e=>e.data).catch(e=>{throw m(e)});deleteWorkspaceMember=t=>this._innerClient.deleteWorkspaceMember(t).then(e=>e.data).catch(e=>{throw m(e)});createWorkspaceMember=t=>this._innerClient.createWorkspaceMember({createWorkspaceMemberBody:t}).then(e=>e.data).catch(e=>{throw m(e)});updateWorkspaceMember=({id:t,...e})=>this._innerClient.updateWorkspaceMember({id:t,updateWorkspaceMemberBody:e}).then(s=>s.data).catch(s=>{throw m(s)});createIntegration=t=>this._innerClient.createIntegration({createIntegrationBody:t}).then(e=>e.data).catch(e=>{throw m(e)});updateIntegration=({id:t,...e})=>this._innerClient.updateIntegration({id:t,updateIntegrationBody:e}).then(s=>s.data).catch(s=>{throw m(s)});listIntegrations=t=>this._innerClient.listIntegrations(t).then(e=>e.data).catch(e=>{throw m(e)});getIntegration=t=>this._innerClient.getIntegration(t).then(e=>e.data).catch(e=>{throw m(e)});getIntegrationLogs=t=>this._innerClient.getIntegrationLogs(t).then(e=>e.data).catch(e=>{throw m(e)});getIntegrationByName=t=>this._innerClient.getIntegrationByName(t).then(e=>e.data).catch(e=>{throw m(e)});deleteIntegration=t=>this._innerClient.deleteIntegration(t).then(e=>e.data).catch(e=>{throw m(e)});introspect=t=>this._innerClient.introspect({introspectBody:t}).then(e=>e.data).catch(e=>{throw m(e)});createFile=t=>this._innerClient.createFile({createFileBody:t}).then(e=>e.data).catch(e=>{throw m(e)});getFile=t=>this._innerClient.getFile(t).then(e=>e.data).catch(e=>{throw m(e)});downloadFile=t=>this._innerClient.downloadFile(t).then(e=>e.data).catch(e=>{throw m(e)});deleteFile=t=>this._innerClient.deleteFile(t).then(e=>e.data).catch(e=>{throw m(e)});listFiles=t=>this._innerClient.listFiles(t).then(e=>e.data).catch(e=>{throw m(e)})};function m(a){return oe.default.isAxiosError(a)&&a.response?.data?K(a.response.data):K(a)}var Te=b(require("axios")),ie=100*1024*1024,Ve=ie,ve=ie,X=class extends J{config;constructor(t={}){let e=te(t),{apiUrl:s,headers:o,withCredentials:r,timeout:n}=e,i=ne.default.create({headers:o,withCredentials:r,timeout:n,maxBodyLength:Ve,maxContentLength:ve});super(void 0,s,i),this.config=e}};0&&(module.exports={AlreadyExistsError,Client,ForbiddenError,InternalError,InvalidDataFormatError,InvalidIdentifierError,InvalidJsonSchemaError,InvalidPayloadError,InvalidQueryError,MethodNotFoundError,PayloadTooLargeError,PaymentRequiredError,RateLimitedError,ReferenceNotFoundError,RelationConflictError,ResourceNotFoundError,RuntimeError,UnauthorizedError,UnknownError,UnsupportedMediaTypeError,axios,errorFrom,isApiError});
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|