@botpress/client 0.2.0 → 0.3.1

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/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.4.0
5
+ * The version of the OpenAPI document: 0.5.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -1546,6 +1546,96 @@ export interface Event {
1546
1546
  [key: string]: any;
1547
1547
  };
1548
1548
  }
1549
+ /**
1550
+ *
1551
+ * @export
1552
+ * @interface GetAuditRecordsResponse
1553
+ */
1554
+ export interface GetAuditRecordsResponse {
1555
+ /**
1556
+ *
1557
+ * @type {Array<GetAuditRecordsResponseRecordsInner>}
1558
+ * @memberof GetAuditRecordsResponse
1559
+ */
1560
+ 'records': Array<GetAuditRecordsResponseRecordsInner>;
1561
+ /**
1562
+ *
1563
+ * @type {ListConversationsResponseMeta}
1564
+ * @memberof GetAuditRecordsResponse
1565
+ */
1566
+ 'meta': ListConversationsResponseMeta;
1567
+ }
1568
+ /**
1569
+ *
1570
+ * @export
1571
+ * @interface GetAuditRecordsResponseRecordsInner
1572
+ */
1573
+ export interface GetAuditRecordsResponseRecordsInner {
1574
+ /**
1575
+ *
1576
+ * @type {string}
1577
+ * @memberof GetAuditRecordsResponseRecordsInner
1578
+ */
1579
+ 'id': string;
1580
+ /**
1581
+ *
1582
+ * @type {string}
1583
+ * @memberof GetAuditRecordsResponseRecordsInner
1584
+ */
1585
+ 'recordedAt': string;
1586
+ /**
1587
+ *
1588
+ * @type {string}
1589
+ * @memberof GetAuditRecordsResponseRecordsInner
1590
+ */
1591
+ 'userId': string | null;
1592
+ /**
1593
+ *
1594
+ * @type {string}
1595
+ * @memberof GetAuditRecordsResponseRecordsInner
1596
+ */
1597
+ 'userEmail'?: string | null;
1598
+ /**
1599
+ *
1600
+ * @type {string}
1601
+ * @memberof GetAuditRecordsResponseRecordsInner
1602
+ */
1603
+ 'resourceId': string | null;
1604
+ /**
1605
+ *
1606
+ * @type {string}
1607
+ * @memberof GetAuditRecordsResponseRecordsInner
1608
+ */
1609
+ 'resourceName'?: string | null;
1610
+ /**
1611
+ *
1612
+ * @type {string}
1613
+ * @memberof GetAuditRecordsResponseRecordsInner
1614
+ */
1615
+ 'action': GetAuditRecordsResponseRecordsInnerActionEnum;
1616
+ }
1617
+ export declare const GetAuditRecordsResponseRecordsInnerActionEnum: {
1618
+ readonly Unknown: "UNKNOWN";
1619
+ readonly AddCollaborator: "ADD_COLLABORATOR";
1620
+ readonly RemoveCollaborator: "REMOVE_COLLABORATOR";
1621
+ readonly UpdateWorkspaceMember: "UPDATE_WORKSPACE_MEMBER";
1622
+ readonly CloseWorkspace: "CLOSE_WORKSPACE";
1623
+ readonly CreateBot: "CREATE_BOT";
1624
+ readonly CreateWorkspace: "CREATE_WORKSPACE";
1625
+ readonly DeleteBot: "DELETE_BOT";
1626
+ readonly DeployBot: "DEPLOY_BOT";
1627
+ readonly TransferBot: "TRANSFER_BOT";
1628
+ readonly DowngradeWorkspacePlan: "DOWNGRADE_WORKSPACE_PLAN";
1629
+ readonly DownloadBotArchive: "DOWNLOAD_BOT_ARCHIVE";
1630
+ readonly UpdateBot: "UPDATE_BOT";
1631
+ readonly UpdateBotChannel: "UPDATE_BOT_CHANNEL";
1632
+ readonly UpdateBotConfig: "UPDATE_BOT_CONFIG";
1633
+ readonly UpdatePaymentMethod: "UPDATE_PAYMENT_METHOD";
1634
+ readonly UpdateWorkspace: "UPDATE_WORKSPACE";
1635
+ readonly UpgradeWorkspacePlan: "UPGRADE_WORKSPACE_PLAN";
1636
+ readonly SetSpendingLimit: "SET_SPENDING_LIMIT";
1637
+ };
1638
+ export type GetAuditRecordsResponseRecordsInnerActionEnum = typeof GetAuditRecordsResponseRecordsInnerActionEnum[keyof typeof GetAuditRecordsResponseRecordsInnerActionEnum];
1549
1639
  /**
1550
1640
  *
1551
1641
  * @export
@@ -3904,6 +3994,13 @@ export declare const DefaultApiAxiosParamCreator: (configuration?: Configuration
3904
3994
  * @throws {RequiredError}
3905
3995
  */
3906
3996
  downloadFile: (id: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
3997
+ /**
3998
+ * Get the audit records of a workspace
3999
+ * @param {string} id Workspace ID
4000
+ * @param {*} [options] Override http request option.
4001
+ * @throws {RequiredError}
4002
+ */
4003
+ getAuditRecords: (id: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
3907
4004
  /**
3908
4005
  * Get bot details
3909
4006
  * @param {string} id Bot ID
@@ -4377,6 +4474,13 @@ export declare const DefaultApiFp: (configuration?: Configuration) => {
4377
4474
  * @throws {RequiredError}
4378
4475
  */
4379
4476
  downloadFile(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<any>>;
4477
+ /**
4478
+ * Get the audit records of a workspace
4479
+ * @param {string} id Workspace ID
4480
+ * @param {*} [options] Override http request option.
4481
+ * @throws {RequiredError}
4482
+ */
4483
+ getAuditRecords(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetAuditRecordsResponse>>;
4380
4484
  /**
4381
4485
  * Get bot details
4382
4486
  * @param {string} id Bot ID
@@ -4849,6 +4953,13 @@ export declare const DefaultApiFactory: (configuration?: Configuration, basePath
4849
4953
  * @throws {RequiredError}
4850
4954
  */
4851
4955
  downloadFile(requestParameters: DefaultApiDownloadFileRequest, options?: AxiosRequestConfig): AxiosPromise<any>;
4956
+ /**
4957
+ * Get the audit records of a workspace
4958
+ * @param {DefaultApiGetAuditRecordsRequest} requestParameters Request parameters.
4959
+ * @param {*} [options] Override http request option.
4960
+ * @throws {RequiredError}
4961
+ */
4962
+ getAuditRecords(requestParameters: DefaultApiGetAuditRecordsRequest, options?: AxiosRequestConfig): AxiosPromise<GetAuditRecordsResponse>;
4852
4963
  /**
4853
4964
  * Get bot details
4854
4965
  * @param {DefaultApiGetBotRequest} requestParameters Request parameters.
@@ -5409,6 +5520,19 @@ export interface DefaultApiDownloadFileRequest {
5409
5520
  */
5410
5521
  readonly id: string;
5411
5522
  }
5523
+ /**
5524
+ * Request parameters for getAuditRecords operation in DefaultApi.
5525
+ * @export
5526
+ * @interface DefaultApiGetAuditRecordsRequest
5527
+ */
5528
+ export interface DefaultApiGetAuditRecordsRequest {
5529
+ /**
5530
+ * Workspace ID
5531
+ * @type {string}
5532
+ * @memberof DefaultApiGetAuditRecords
5533
+ */
5534
+ readonly id: string;
5535
+ }
5412
5536
  /**
5413
5537
  * Request parameters for getBot operation in DefaultApi.
5414
5538
  * @export
@@ -6308,6 +6432,14 @@ export declare class DefaultApi extends BaseAPI {
6308
6432
  * @memberof DefaultApi
6309
6433
  */
6310
6434
  downloadFile(requestParameters: DefaultApiDownloadFileRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<any, any>>;
6435
+ /**
6436
+ * Get the audit records of a workspace
6437
+ * @param {DefaultApiGetAuditRecordsRequest} requestParameters Request parameters.
6438
+ * @param {*} [options] Override http request option.
6439
+ * @throws {RequiredError}
6440
+ * @memberof DefaultApi
6441
+ */
6442
+ getAuditRecords(requestParameters: DefaultApiGetAuditRecordsRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<GetAuditRecordsResponse, any>>;
6311
6443
  /**
6312
6444
  * Get bot details
6313
6445
  * @param {DefaultApiGetBotRequest} requestParameters Request parameters.
@@ -2,7 +2,7 @@
2
2
  * Botpress API
3
3
  * API for Botpress Cloud
4
4
  *
5
- * The version of the OpenAPI document: 0.4.0
5
+ * The version of the OpenAPI document: 0.5.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -1,6 +1,6 @@
1
1
  import { AxiosInstance } from 'axios';
2
2
  import type { Merge, Except } from 'type-fest';
3
- import { Configuration, DefaultApiCreateConversationRequest, DefaultApiGetConversationRequest, DefaultApiListConversationsRequest, DefaultApiGetOrCreateConversationRequest, DefaultApiUpdateConversationRequest, DefaultApiDeleteConversationRequest, DefaultApiCreateEventRequest, DefaultApiGetEventRequest, DefaultApiListEventsRequest, DefaultApiCreateMessageRequest, DefaultApiGetOrCreateMessageRequest, DefaultApiGetMessageRequest, DefaultApiUpdateMessageRequest, DefaultApiListMessagesRequest, DefaultApiDeleteMessageRequest, DefaultApiCreateUserRequest, DefaultApiGetUserRequest, DefaultApiListUsersRequest, DefaultApiGetOrCreateUserRequest, DefaultApiUpdateUserRequest, DefaultApiDeleteUserRequest, DefaultApiGetStateRequest, DefaultApiSetStateRequest, DefaultApiPatchStateRequest, DefaultApiCallActionRequest, DefaultApiConfigureIntegrationRequest, DefaultApiListPublicIntegrationsRequest, DefaultApiGetPublicIntegrationByIdRequest, DefaultApiGetPublicIntegrationRequest, DefaultApiCreateBotRequest, DefaultApiUpdateBotRequest, DefaultApiTransferBotRequest, DefaultApiListBotsRequest, DefaultApiGetBotRequest, DefaultApiDeleteBotRequest, DefaultApiGetBotLogsRequest, DefaultApiGetBotWebchatRequest, DefaultApiGetBotAnalyticsRequest, DefaultApiCreateWorkspaceRequest, DefaultApiGetWorkspaceRequest, DefaultApiUpdateWorkspaceRequest, DefaultApiListWorkspacesRequest, DefaultApiChangeWorkspacePlanRequest, DefaultApiDeleteWorkspaceRequest, DefaultApiCreateIntegrationRequest, DefaultApiUpdateIntegrationRequest, DefaultApiListIntegrationsRequest, DefaultApiGetIntegrationRequest, DefaultApiGetIntegrationLogsRequest, DefaultApiGetIntegrationByNameRequest, DefaultApiDeleteIntegrationRequest, DefaultApiListWorkspaceMembersRequest, DefaultApiDeleteWorkspaceMemberRequest, DefaultApiCreateWorkspaceMemberRequest, DefaultApiUpdateWorkspaceMemberRequest, DefaultApiIntrospectRequest, DefaultApiCreateFileRequest, DefaultApiGetFileRequest, DefaultApiDownloadFileRequest, DefaultApiDeleteFileRequest, DefaultApiListFilesRequest } from '.';
3
+ import { Configuration, DefaultApiCreateConversationRequest, DefaultApiGetConversationRequest, DefaultApiListConversationsRequest, DefaultApiGetOrCreateConversationRequest, DefaultApiUpdateConversationRequest, DefaultApiDeleteConversationRequest, DefaultApiCreateEventRequest, DefaultApiGetEventRequest, DefaultApiListEventsRequest, DefaultApiCreateMessageRequest, DefaultApiGetOrCreateMessageRequest, DefaultApiGetMessageRequest, DefaultApiUpdateMessageRequest, DefaultApiListMessagesRequest, DefaultApiDeleteMessageRequest, DefaultApiCreateUserRequest, DefaultApiGetUserRequest, DefaultApiListUsersRequest, DefaultApiGetOrCreateUserRequest, DefaultApiUpdateUserRequest, DefaultApiDeleteUserRequest, DefaultApiGetStateRequest, DefaultApiSetStateRequest, DefaultApiPatchStateRequest, DefaultApiCallActionRequest, DefaultApiConfigureIntegrationRequest, DefaultApiListPublicIntegrationsRequest, DefaultApiGetPublicIntegrationByIdRequest, DefaultApiGetPublicIntegrationRequest, DefaultApiCreateBotRequest, DefaultApiUpdateBotRequest, DefaultApiTransferBotRequest, DefaultApiListBotsRequest, DefaultApiGetBotRequest, DefaultApiDeleteBotRequest, DefaultApiGetBotLogsRequest, DefaultApiGetBotWebchatRequest, DefaultApiGetBotAnalyticsRequest, DefaultApiCreateWorkspaceRequest, DefaultApiGetWorkspaceRequest, DefaultApiUpdateWorkspaceRequest, DefaultApiListWorkspacesRequest, DefaultApiChangeWorkspacePlanRequest, DefaultApiDeleteWorkspaceRequest, DefaultApiGetAuditRecordsRequest, DefaultApiCreateIntegrationRequest, DefaultApiUpdateIntegrationRequest, DefaultApiListIntegrationsRequest, DefaultApiGetIntegrationRequest, DefaultApiGetIntegrationLogsRequest, DefaultApiGetIntegrationByNameRequest, DefaultApiDeleteIntegrationRequest, DefaultApiListWorkspaceMembersRequest, DefaultApiDeleteWorkspaceMemberRequest, DefaultApiCreateWorkspaceMemberRequest, DefaultApiUpdateWorkspaceMemberRequest, DefaultApiIntrospectRequest, DefaultApiCreateFileRequest, DefaultApiGetFileRequest, DefaultApiDownloadFileRequest, DefaultApiDeleteFileRequest, DefaultApiListFilesRequest } from '.';
4
4
  export declare class ApiClient {
5
5
  private _innerClient;
6
6
  constructor(configuration?: Configuration, basePath?: string, axiosInstance?: AxiosInstance);
@@ -48,6 +48,7 @@ export declare class ApiClient {
48
48
  listWorkspaces: (props: ListWorkspacesProps) => Promise<import("./api").ListWorkspacesResponse>;
49
49
  changeWorkspacePlan: ({ id, ...changeWorkspacePlanBody }: ChangeWorkspacePlanProps) => Promise<import("./api").ChangeWorkspacePlanResponse>;
50
50
  deleteWorkspace: (props: DeleteWorkspaceProps) => Promise<object>;
51
+ getAuditRecords: (props: GetAuditRecordsProps) => Promise<import("./api").GetAuditRecordsResponse>;
51
52
  createIntegration: (createIntegrationBody: CreateIntegrationProps) => Promise<import("./api").CreateIntegrationResponse>;
52
53
  updateIntegration: ({ id, ...updateIntegrationBody }: UpdateIntegrationProps) => Promise<import("./api").UpdateIntegrationResponse>;
53
54
  listIntegrations: (props: ListIntegrationsProps) => Promise<import("./api").ListIntegrationsResponse>;
@@ -110,6 +111,7 @@ export type UpdateWorkspaceProps = Merge<Except<DefaultApiUpdateWorkspaceRequest
110
111
  export type ListWorkspacesProps = Merge<DefaultApiListWorkspacesRequest, {}>;
111
112
  export type ChangeWorkspacePlanProps = Merge<Except<DefaultApiChangeWorkspacePlanRequest, 'changeWorkspacePlanBody'>, NonNullable<DefaultApiChangeWorkspacePlanRequest['changeWorkspacePlanBody']>>;
112
113
  export type DeleteWorkspaceProps = Merge<DefaultApiDeleteWorkspaceRequest, {}>;
114
+ export type GetAuditRecordsProps = Merge<DefaultApiGetAuditRecordsRequest, {}>;
113
115
  export type CreateIntegrationProps = Merge<Except<DefaultApiCreateIntegrationRequest, 'createIntegrationBody'>, NonNullable<DefaultApiCreateIntegrationRequest['createIntegrationBody']>>;
114
116
  export type UpdateIntegrationProps = Merge<Except<DefaultApiUpdateIntegrationRequest, 'updateIntegrationBody'>, NonNullable<DefaultApiUpdateIntegrationRequest['updateIntegrationBody']>>;
115
117
  export type ListIntegrationsProps = Merge<DefaultApiListIntegrationsRequest, {}>;
@@ -3,7 +3,7 @@
3
3
  * Botpress API
4
4
  * API for Botpress Cloud
5
5
  *
6
- * The version of the OpenAPI document: 0.4.0
6
+ * The version of the OpenAPI document: 0.5.0
7
7
  *
8
8
  *
9
9
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -2,7 +2,7 @@
2
2
  * Botpress API
3
3
  * API for Botpress Cloud
4
4
  *
5
- * The version of the OpenAPI document: 0.4.0
5
+ * The version of the OpenAPI document: 0.5.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -158,7 +158,14 @@ type RateLimitedType = 'RateLimited';
158
158
  export declare class RateLimitedError extends BaseApiError<429, RateLimitedType, 'The request has been rate limited.'> {
159
159
  constructor(message: string, error?: Error);
160
160
  }
161
- export type ErrorType = 'Unknown' | 'Internal' | 'Unauthorized' | 'Forbidden' | 'PayloadTooLarge' | 'InvalidPayload' | 'UnsupportedMediaType' | 'MethodNotFound' | 'ResourceNotFound' | 'InvalidJsonSchema' | 'InvalidDataFormat' | 'InvalidIdentifier' | 'RelationConflict' | 'ReferenceNotFound' | 'InvalidQuery' | 'Runtime' | 'AlreadyExists' | 'RateLimited';
162
- export type ApiError = UnknownError | InternalError | UnauthorizedError | ForbiddenError | PayloadTooLargeError | InvalidPayloadError | UnsupportedMediaTypeError | MethodNotFoundError | ResourceNotFoundError | InvalidJsonSchemaError | InvalidDataFormatError | InvalidIdentifierError | RelationConflictError | ReferenceNotFoundError | InvalidQueryError | RuntimeError | AlreadyExistsError | RateLimitedError;
161
+ type PaymentRequiredType = 'PaymentRequired';
162
+ /**
163
+ * A payment is required to perform this request.
164
+ */
165
+ export declare class PaymentRequiredError extends BaseApiError<402, PaymentRequiredType, 'A payment is required to perform this request.'> {
166
+ constructor(message: string, error?: Error);
167
+ }
168
+ export type ErrorType = 'Unknown' | 'Internal' | 'Unauthorized' | 'Forbidden' | 'PayloadTooLarge' | 'InvalidPayload' | 'UnsupportedMediaType' | 'MethodNotFound' | 'ResourceNotFound' | 'InvalidJsonSchema' | 'InvalidDataFormat' | 'InvalidIdentifier' | 'RelationConflict' | 'ReferenceNotFound' | 'InvalidQuery' | 'Runtime' | 'AlreadyExists' | 'RateLimited' | 'PaymentRequired';
169
+ export type ApiError = UnknownError | InternalError | UnauthorizedError | ForbiddenError | PayloadTooLargeError | InvalidPayloadError | UnsupportedMediaTypeError | MethodNotFoundError | ResourceNotFoundError | InvalidJsonSchemaError | InvalidDataFormatError | InvalidIdentifierError | RelationConflictError | ReferenceNotFoundError | InvalidQueryError | RuntimeError | AlreadyExistsError | RateLimitedError | PaymentRequiredError;
163
170
  export declare const errorFrom: (err: unknown) => ApiError;
164
171
  export {};
@@ -2,7 +2,7 @@
2
2
  * Botpress API
3
3
  * API for Botpress Cloud
4
4
  *
5
- * The version of the OpenAPI document: 0.4.0
5
+ * The version of the OpenAPI document: 0.5.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var oe=Object.create;var I=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var ie=Object.getOwnPropertyNames;var le=Object.getPrototypeOf,pe=Object.prototype.hasOwnProperty;var ce=(r,t)=>{for(var e in t)I(r,e,{get:t[e],enumerable:!0})},Z=(r,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ie(t))!pe.call(r,o)&&o!==e&&I(r,o,{get:()=>t[o],enumerable:!(s=ne(t,o))||s.enumerable});return r};var P=(r,t,e)=>(e=r!=null?oe(le(r)):{},Z(t||!r||!r.__esModule?I(e,"default",{value:r,enumerable:!0}):e,r)),ue=r=>Z(I({},"__esModule",{value:!0}),r);var be={};ce(be,{AlreadyExistsError:()=>_,Client:()=>Y,ForbiddenError:()=>V,InternalError:()=>U,InvalidDataFormatError:()=>W,InvalidIdentifierError:()=>w,InvalidJsonSchemaError:()=>E,InvalidPayloadError:()=>O,InvalidQueryError:()=>G,MethodNotFoundError:()=>D,PayloadTooLargeError:()=>v,RateLimitedError:()=>j,ReferenceNotFoundError:()=>L,RelationConflictError:()=>S,ResourceNotFoundError:()=>M,RuntimeError:()=>F,UnauthorizedError:()=>k,UnknownError:()=>b,UnsupportedMediaTypeError:()=>T,axios:()=>Pe,errorFrom:()=>N,isApiError:()=>te});module.exports=ue(be);var re=P(require("axios")),Pe=P(require("axios"));var q=require("browser-or-node"),X="https://api.botpress.cloud",de="BP_API_URL",ge="BP_BOT_ID",ye="BP_INTEGRATION_ID",he="BP_WORKSPACE_ID",Ae="BP_TOKEN";function ee(r){let t=me(r),e={};return 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}`),{host:t.host??X,withCredentials:q.isBrowser,headers:e,timeout:t.timeout}}function me(r){return q.isBrowser?r:q.isNode?Re(r):r}function Re(r){let t={...r,host:r.host??process.env[de]??X,botId:r.botId??process.env[ge],integrationId:r.integrationId??process.env[ye],workspaceId:r.workspaceId??process.env[he]},e=t.token??process.env[Ae];return e&&(t.token=e),t}var x=class extends Error{constructor(e,s,o,a,n){super(a);this.code=e;this.description=s;this.type=o;this.message=a;this.error=n}isApiError=!0;toJSON(){return{code:this.code,type:this.type,message:this.message}}},fe=r=>typeof r=="object"&&!Array.isArray(r)&&r!==null,te=r=>r instanceof x||fe(r)&&r.isApiError===!0,b=class extends x{constructor(t,e){super(500,"An unknown error occurred","Unknown",t,e)}},U=class extends x{constructor(t,e){super(500,"An internal error occurred","Internal",t,e)}},k=class extends x{constructor(t,e){super(401,"The request requires to be authenticated.","Unauthorized",t,e)}},V=class extends x{constructor(t,e){super(403,"The requested action can't be peform by this resource.","Forbidden",t,e)}},v=class extends x{constructor(t,e){super(413,"The request payload is too large.","PayloadTooLarge",t,e)}},O=class extends x{constructor(t,e){super(400,"The request payload is invalid.","InvalidPayload",t,e)}},T=class extends x{constructor(t,e){super(415,"The request is invalid because the content-type is not supported.","UnsupportedMediaType",t,e)}},D=class extends x{constructor(t,e){super(405,"The requested method does not exist.","MethodNotFound",t,e)}},M=class extends x{constructor(t,e){super(404,"The requested resource does not exist.","ResourceNotFound",t,e)}},E=class extends x{constructor(t,e){super(400,"The provided JSON schema is invalid.","InvalidJsonSchema",t,e)}},W=class extends x{constructor(t,e){super(400,"The provided data doesn't respect the provided JSON schema.","InvalidDataFormat",t,e)}},w=class extends x{constructor(t,e){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=class extends x{constructor(t,e){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)}},L=class extends x{constructor(t,e){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)}},G=class extends x{constructor(t,e){super(400,"The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource.","InvalidQuery",t,e)}},F=class extends x{constructor(t,e){super(400,"An error happened during the execution of a runtime (bot or integration).","Runtime",t,e)}},_=class extends x{constructor(t,e){super(409,"The record attempted to be created already exists.","AlreadyExists",t,e)}},j=class extends x{constructor(t,e){super(429,"The request has been rate limited.","RateLimited",t,e)}},Ce={Unknown:b,Internal:U,Unauthorized:k,Forbidden:V,PayloadTooLarge:v,InvalidPayload:O,UnsupportedMediaType:T,MethodNotFound:D,ResourceNotFound:M,InvalidJsonSchema:E,InvalidDataFormat:W,InvalidIdentifier:w,RelationConflict:S,ReferenceNotFound:L,InvalidQuery:G,Runtime:F,AlreadyExists:_,RateLimited:j},N=r=>te(r)?r:r instanceof Error?new b(r.message,r):r===null?new b("An unknown error occurred"):typeof r=="string"?new b(r):typeof r!="object"?new b("An unknown error occurred"):xe(r);function xe(r){if("code"in r&&"type"in r&&"message"in r){if(typeof r.message!="string")return new b("An unknown error occurred");if(typeof r.type!="string")return new b(r.message);let t=Ce[r.type];return t?new t(r.message):new b(r.message)}return new b("An unknown error occurred")}var ae=P(require("axios"));var A=P(require("axios"));var se=P(require("axios")),u="https://api.botpress.cloud".replace(/\/+$/,"");var Q=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},H=class extends Error{constructor(e,s){super(s);this.field=e;this.name="RequiredError"}};var d="https://example.com",f=function(r,t,e){if(e==null)throw new H(t,`Required parameter ${t} was null or undefined when calling ${r}.`)};function K(r,t,e=""){t!=null&&(typeof t=="object"?Array.isArray(t)?t.forEach(s=>K(r,s,e)):Object.keys(t).forEach(s=>K(r,t[s],`${e}${e!==""?".":""}${s}`)):r.has(e)?r.append(e,t):r.set(e,t))}var g=function(r,...t){let e=new URLSearchParams(r.search);K(e,t),r.search=e.toString()},C=function(r,t,e){let s=typeof r!="string";return(s&&e&&e.isJsonMime?e.isJsonMime(t.headers["Content-Type"]):s)?JSON.stringify(r!==void 0?r:{}):r||""},y=function(r){return r.pathname+r.search+r.hash},h=function(r,t,e,s){return(o=t,a=e)=>{let n={...r.options,url:(s?.basePath||a)+r.url};return o.request(n)}};var Be=function(r){return{callAction:async(t,e={})=>{let s="/v1/chat/actions",o=new URL(s,d),a;r&&(a=r.baseOptions);let n={method:"POST",...a,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=a&&a.headers?a.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,r),{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))),a=new URL(o,d),n;r&&(n=r.baseOptions);let i={method:"PUT",...n,...s},p={},l={};p["Content-Type"]="application/json",g(a,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},i.data=C(e,i,r),{url:y(a),options:i}},configureIntegration:async(t,e={})=>{let s="/v1/chat/integrations/configure",o=new URL(s,d),a;r&&(a=r.baseOptions);let n={method:"POST",...a,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=a&&a.headers?a.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,r),{url:y(o),options:n}},createBot:async(t,e={})=>{let s="/v1/admin/bots",o=new URL(s,d),a;r&&(a=r.baseOptions);let n={method:"POST",...a,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=a&&a.headers?a.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,r),{url:y(o),options:n}},createConversation:async(t,e={})=>{let s="/v1/chat/conversations",o=new URL(s,d),a;r&&(a=r.baseOptions);let n={method:"POST",...a,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=a&&a.headers?a.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,r),{url:y(o),options:n}},createEvent:async(t,e={})=>{let s="/v1/chat/events",o=new URL(s,d),a;r&&(a=r.baseOptions);let n={method:"POST",...a,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=a&&a.headers?a.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,r),{url:y(o),options:n}},createFile:async(t,e={})=>{let s="/v1/storage/files",o=new URL(s,d),a;r&&(a=r.baseOptions);let n={method:"POST",...a,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=a&&a.headers?a.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,r),{url:y(o),options:n}},createIntegration:async(t,e={})=>{let s="/v1/admin/integrations",o=new URL(s,d),a;r&&(a=r.baseOptions);let n={method:"POST",...a,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=a&&a.headers?a.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,r),{url:y(o),options:n}},createMessage:async(t,e={})=>{let s="/v1/chat/messages",o=new URL(s,d),a;r&&(a=r.baseOptions);let n={method:"POST",...a,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=a&&a.headers?a.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,r),{url:y(o),options:n}},createUser:async(t,e={})=>{let s="/v1/chat/users",o=new URL(s,d),a;r&&(a=r.baseOptions);let n={method:"POST",...a,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=a&&a.headers?a.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,r),{url:y(o),options:n}},createWorkspace:async(t,e={})=>{let s="/v1/admin/workspaces",o=new URL(s,d),a;r&&(a=r.baseOptions);let n={method:"POST",...a,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=a&&a.headers?a.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,r),{url:y(o),options:n}},createWorkspaceMember:async(t,e={})=>{let s="/v1/admin/workspace-members",o=new URL(s,d),a;r&&(a=r.baseOptions);let n={method:"POST",...a,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=a&&a.headers?a.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,r),{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),a;r&&(a=r.baseOptions);let n={method:"DELETE",...a,...e},i={};g(o,{});let l=a&&a.headers?a.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),a;r&&(a=r.baseOptions);let n={method:"DELETE",...a,...e},i={};g(o,{});let l=a&&a.headers?a.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),a;r&&(a=r.baseOptions);let n={method:"DELETE",...a,...e},i={};g(o,{});let l=a&&a.headers?a.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),a;r&&(a=r.baseOptions);let n={method:"DELETE",...a,...e},i={};g(o,{});let l=a&&a.headers?a.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),a;r&&(a=r.baseOptions);let n={method:"DELETE",...a,...e},i={};g(o,{});let l=a&&a.headers?a.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),a;r&&(a=r.baseOptions);let n={method:"DELETE",...a,...e},i={};g(o,{});let l=a&&a.headers?a.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),a;r&&(a=r.baseOptions);let n={method:"DELETE",...a,...e},i={};g(o,{});let l=a&&a.headers?a.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),a;r&&(a=r.baseOptions);let n={method:"DELETE",...a,...e},i={};g(o,{});let l=a&&a.headers?a.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),a;r&&(a=r.baseOptions);let n={method:"GET",...a,...e},i={};g(o,{});let l=a&&a.headers?a.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},getBot:async(t,e={})=>{f("getBot","id",t);let s="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),a;r&&(a=r.baseOptions);let n={method:"GET",...a,...e},i={};g(o,{});let l=a&&a.headers?a.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 a="/v1/admin/bots/{id}/analytics".replace("{id}",encodeURIComponent(String(t))),n=new URL(a,d),i;r&&(i=r.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 B=i&&i.headers?i.headers:{};return p.headers={...l,...B,...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),a;r&&(a=r.baseOptions);let n={method:"GET",...a,...e},i={};g(o,{});let l=a&&a.headers?a.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))),a=new URL(o,d),n;r&&(n=r.baseOptions);let i={method:"GET",...n,...s},p={},l={};e!==void 0&&(l.type=e),g(a,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},{url:y(a),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),a;r&&(a=r.baseOptions);let n={method:"GET",...a,...e},i={};g(o,{});let l=a&&a.headers?a.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),a;r&&(a=r.baseOptions);let n={method:"GET",...a,...e},i={};g(o,{});let l=a&&a.headers?a.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),a;r&&(a=r.baseOptions);let n={method:"GET",...a,...e},i={};g(o,{});let l=a&&a.headers?a.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),a;r&&(a=r.baseOptions);let n={method:"GET",...a,...e},i={};g(o,{});let l=a&&a.headers?a.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))),a=new URL(o,d),n;r&&(n=r.baseOptions);let i={method:"GET",...n,...s},p={};g(a,{});let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},{url:y(a),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),a;r&&(a=r.baseOptions);let n={method:"GET",...a,...e},i={};g(o,{});let l=a&&a.headers?a.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),a;r&&(a=r.baseOptions);let n={method:"GET",...a,...e},i={};g(o,{});let l=a&&a.headers?a.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),a;r&&(a=r.baseOptions);let n={method:"POST",...a,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=a&&a.headers?a.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,r),{url:y(o),options:n}},getOrCreateMessage:async(t,e={})=>{let s="/v1/chat/messages/get-or-create",o=new URL(s,d),a;r&&(a=r.baseOptions);let n={method:"POST",...a,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=a&&a.headers?a.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,r),{url:y(o),options:n}},getOrCreateUser:async(t,e={})=>{let s="/v1/chat/users/get-or-create",o=new URL(s,d),a;r&&(a=r.baseOptions);let n={method:"POST",...a,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=a&&a.headers?a.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,r),{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))),a=new URL(o,d),n;r&&(n=r.baseOptions);let i={method:"GET",...n,...s},p={};g(a,{});let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},{url:y(a),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),a;r&&(a=r.baseOptions);let n={method:"GET",...a,...e},i={};g(o,{});let l=a&&a.headers?a.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 a="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(e))).replace("{name}",encodeURIComponent(String(s))),n=new URL(a,d),i;r&&(i=r.baseOptions);let p={method:"GET",...i,...o},l={};g(n,{});let B=i&&i.headers?i.headers:{};return p.headers={...l,...B,...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),a;r&&(a=r.baseOptions);let n={method:"GET",...a,...e},i={};g(o,{});let l=a&&a.headers?a.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),a;r&&(a=r.baseOptions);let n={method:"GET",...a,...e},i={};g(o,{});let l=a&&a.headers?a.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),a;r&&(a=r.baseOptions);let n={method:"POST",...a,...e},i={},p={};i["Content-Type"]="application/json",g(o,p);let l=a&&a.headers?a.headers:{};return n.headers={...i,...l,...e.headers},n.data=C(t,n,r),{url:y(o),options:n}},listBots:async(t,e={})=>{let s="/v1/admin/bots",o=new URL(s,d),a;r&&(a=r.baseOptions);let n={method:"GET",...a,...e},i={},p={};t!==void 0&&(p.nextToken=t),g(o,p);let l=a&&a.headers?a.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},listConversations:async(t,e,s,o={})=>{let a="/v1/chat/conversations",n=new URL(a,d),i;r&&(i=r.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 B=i&&i.headers?i.headers:{};return p.headers={...l,...B,...o.headers},{url:y(n),options:p}},listEvents:async(t,e,s={})=>{let o="/v1/chat/events",a=new URL(o,d),n;r&&(n=r.baseOptions);let i={method:"GET",...n,...s},p={},l={};t!==void 0&&(l.nextToken=t),e!==void 0&&(l.type=e),g(a,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},{url:y(a),options:i}},listFiles:async(t,e,s={})=>{f("listFiles","botId",t);let o="/v1/storage/files",a=new URL(o,d),n;r&&(n=r.baseOptions);let i={method:"GET",...n,...s},p={},l={};e!==void 0&&(l.nextToken=e),t!==void 0&&(l.botId=t),g(a,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},{url:y(a),options:i}},listIntegrations:async(t,e,s,o={})=>{let a="/v1/admin/integrations",n=new URL(a,d),i;r&&(i=r.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 B=i&&i.headers?i.headers:{};return p.headers={...l,...B,...o.headers},{url:y(n),options:p}},listMessages:async(t,e,s,o={})=>{let a="/v1/chat/messages",n=new URL(a,d),i;r&&(i=r.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 B=i&&i.headers?i.headers:{};return p.headers={...l,...B,...o.headers},{url:y(n),options:p}},listPublicIntegrations:async(t,e,s,o={})=>{let a="/v1/admin/hub/integrations",n=new URL(a,d),i;r&&(i=r.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 B=i&&i.headers?i.headers:{};return p.headers={...l,...B,...o.headers},{url:y(n),options:p}},listUsers:async(t,e,s,o={})=>{let a="/v1/chat/users",n=new URL(a,d),i;r&&(i=r.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 B=i&&i.headers?i.headers:{};return p.headers={...l,...B,...o.headers},{url:y(n),options:p}},listWorkspaceMembers:async(t,e={})=>{let s="/v1/admin/workspace-members",o=new URL(s,d),a;r&&(a=r.baseOptions);let n={method:"GET",...a,...e},i={},p={};t!==void 0&&(p.nextToken=t),g(o,p);let l=a&&a.headers?a.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),a;r&&(a=r.baseOptions);let n={method:"GET",...a,...e},i={},p={};t!==void 0&&(p.nextToken=t),g(o,p);let l=a&&a.headers?a.headers:{};return n.headers={...i,...l,...e.headers},{url:y(o),options:n}},patchState:async(t,e,s,o,a={})=>{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;r&&(p=r.baseOptions);let l={method:"PATCH",...p,...a},c={},B={};c["Content-Type"]="application/json",g(i,B);let z=p&&p.headers?p.headers:{};return l.headers={...c,...z,...a.headers},l.data=C(o,l,r),{url:y(i),options:l}},setState:async(t,e,s,o,a={})=>{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;r&&(p=r.baseOptions);let l={method:"POST",...p,...a},c={},B={};c["Content-Type"]="application/json",g(i,B);let z=p&&p.headers?p.headers:{};return l.headers={...c,...z,...a.headers},l.data=C(o,l,r),{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))),a=new URL(o,d),n;r&&(n=r.baseOptions);let i={method:"POST",...n,...s},p={},l={};p["Content-Type"]="application/json",g(a,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},i.data=C(e,i,r),{url:y(a),options:i}},updateBot:async(t,e,s={})=>{f("updateBot","id",t);let o="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(t))),a=new URL(o,d),n;r&&(n=r.baseOptions);let i={method:"PUT",...n,...s},p={},l={};p["Content-Type"]="application/json",g(a,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},i.data=C(e,i,r),{url:y(a),options:i}},updateConversation:async(t,e,s={})=>{f("updateConversation","id",t);let o="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(t))),a=new URL(o,d),n;r&&(n=r.baseOptions);let i={method:"PUT",...n,...s},p={},l={};p["Content-Type"]="application/json",g(a,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},i.data=C(e,i,r),{url:y(a),options:i}},updateIntegration:async(t,e,s={})=>{f("updateIntegration","id",t);let o="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(t))),a=new URL(o,d),n;r&&(n=r.baseOptions);let i={method:"PUT",...n,...s},p={},l={};p["Content-Type"]="application/json",g(a,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},i.data=C(e,i,r),{url:y(a),options:i}},updateMessage:async(t,e,s={})=>{f("updateMessage","id",t);let o="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(t))),a=new URL(o,d),n;r&&(n=r.baseOptions);let i={method:"PUT",...n,...s},p={},l={};p["Content-Type"]="application/json",g(a,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},i.data=C(e,i,r),{url:y(a),options:i}},updateUser:async(t,e,s={})=>{f("updateUser","id",t);let o="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(t))),a=new URL(o,d),n;r&&(n=r.baseOptions);let i={method:"PUT",...n,...s},p={},l={};p["Content-Type"]="application/json",g(a,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},i.data=C(e,i,r),{url:y(a),options:i}},updateWorkspace:async(t,e,s={})=>{f("updateWorkspace","id",t);let o="/v1/admin/workspaces/{id}".replace("{id}",encodeURIComponent(String(t))),a=new URL(o,d),n;r&&(n=r.baseOptions);let i={method:"PUT",...n,...s},p={},l={};p["Content-Type"]="application/json",g(a,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},i.data=C(e,i,r),{url:y(a),options:i}},updateWorkspaceMember:async(t,e,s={})=>{f("updateWorkspaceMember","id",t);let o="/v1/admin/workspace-members/{id}".replace("{id}",encodeURIComponent(String(t))),a=new URL(o,d),n;r&&(n=r.baseOptions);let i={method:"PUT",...n,...s},p={},l={};p["Content-Type"]="application/json",g(a,l);let c=n&&n.headers?n.headers:{};return i.headers={...p,...c,...s.headers},i.data=C(e,i,r),{url:y(a),options:i}}}},m=function(r){let t=Be(r);return{async callAction(e,s){let o=await t.callAction(e,s);return h(o,A.default,u,r)},async changeWorkspacePlan(e,s,o){let a=await t.changeWorkspacePlan(e,s,o);return h(a,A.default,u,r)},async configureIntegration(e,s){let o=await t.configureIntegration(e,s);return h(o,A.default,u,r)},async createBot(e,s){let o=await t.createBot(e,s);return h(o,A.default,u,r)},async createConversation(e,s){let o=await t.createConversation(e,s);return h(o,A.default,u,r)},async createEvent(e,s){let o=await t.createEvent(e,s);return h(o,A.default,u,r)},async createFile(e,s){let o=await t.createFile(e,s);return h(o,A.default,u,r)},async createIntegration(e,s){let o=await t.createIntegration(e,s);return h(o,A.default,u,r)},async createMessage(e,s){let o=await t.createMessage(e,s);return h(o,A.default,u,r)},async createUser(e,s){let o=await t.createUser(e,s);return h(o,A.default,u,r)},async createWorkspace(e,s){let o=await t.createWorkspace(e,s);return h(o,A.default,u,r)},async createWorkspaceMember(e,s){let o=await t.createWorkspaceMember(e,s);return h(o,A.default,u,r)},async deleteBot(e,s){let o=await t.deleteBot(e,s);return h(o,A.default,u,r)},async deleteConversation(e,s){let o=await t.deleteConversation(e,s);return h(o,A.default,u,r)},async deleteFile(e,s){let o=await t.deleteFile(e,s);return h(o,A.default,u,r)},async deleteIntegration(e,s){let o=await t.deleteIntegration(e,s);return h(o,A.default,u,r)},async deleteMessage(e,s){let o=await t.deleteMessage(e,s);return h(o,A.default,u,r)},async deleteUser(e,s){let o=await t.deleteUser(e,s);return h(o,A.default,u,r)},async deleteWorkspace(e,s){let o=await t.deleteWorkspace(e,s);return h(o,A.default,u,r)},async deleteWorkspaceMember(e,s){let o=await t.deleteWorkspaceMember(e,s);return h(o,A.default,u,r)},async downloadFile(e,s){let o=await t.downloadFile(e,s);return h(o,A.default,u,r)},async getBot(e,s){let o=await t.getBot(e,s);return h(o,A.default,u,r)},async getBotAnalytics(e,s,o,a){let n=await t.getBotAnalytics(e,s,o,a);return h(n,A.default,u,r)},async getBotLogs(e,s){let o=await t.getBotLogs(e,s);return h(o,A.default,u,r)},async getBotWebchat(e,s,o){let a=await t.getBotWebchat(e,s,o);return h(a,A.default,u,r)},async getConversation(e,s){let o=await t.getConversation(e,s);return h(o,A.default,u,r)},async getEvent(e,s){let o=await t.getEvent(e,s);return h(o,A.default,u,r)},async getFile(e,s){let o=await t.getFile(e,s);return h(o,A.default,u,r)},async getIntegration(e,s){let o=await t.getIntegration(e,s);return h(o,A.default,u,r)},async getIntegrationByName(e,s,o){let a=await t.getIntegrationByName(e,s,o);return h(a,A.default,u,r)},async getIntegrationLogs(e,s){let o=await t.getIntegrationLogs(e,s);return h(o,A.default,u,r)},async getMessage(e,s){let o=await t.getMessage(e,s);return h(o,A.default,u,r)},async getOrCreateConversation(e,s){let o=await t.getOrCreateConversation(e,s);return h(o,A.default,u,r)},async getOrCreateMessage(e,s){let o=await t.getOrCreateMessage(e,s);return h(o,A.default,u,r)},async getOrCreateUser(e,s){let o=await t.getOrCreateUser(e,s);return h(o,A.default,u,r)},async getPublicIntegration(e,s,o){let a=await t.getPublicIntegration(e,s,o);return h(a,A.default,u,r)},async getPublicIntegrationById(e,s){let o=await t.getPublicIntegrationById(e,s);return h(o,A.default,u,r)},async getState(e,s,o,a){let n=await t.getState(e,s,o,a);return h(n,A.default,u,r)},async getUser(e,s){let o=await t.getUser(e,s);return h(o,A.default,u,r)},async getWorkspace(e,s){let o=await t.getWorkspace(e,s);return h(o,A.default,u,r)},async introspect(e,s){let o=await t.introspect(e,s);return h(o,A.default,u,r)},async listBots(e,s){let o=await t.listBots(e,s);return h(o,A.default,u,r)},async listConversations(e,s,o,a){let n=await t.listConversations(e,s,o,a);return h(n,A.default,u,r)},async listEvents(e,s,o){let a=await t.listEvents(e,s,o);return h(a,A.default,u,r)},async listFiles(e,s,o){let a=await t.listFiles(e,s,o);return h(a,A.default,u,r)},async listIntegrations(e,s,o,a){let n=await t.listIntegrations(e,s,o,a);return h(n,A.default,u,r)},async listMessages(e,s,o,a){let n=await t.listMessages(e,s,o,a);return h(n,A.default,u,r)},async listPublicIntegrations(e,s,o,a){let n=await t.listPublicIntegrations(e,s,o,a);return h(n,A.default,u,r)},async listUsers(e,s,o,a){let n=await t.listUsers(e,s,o,a);return h(n,A.default,u,r)},async listWorkspaceMembers(e,s){let o=await t.listWorkspaceMembers(e,s);return h(o,A.default,u,r)},async listWorkspaces(e,s){let o=await t.listWorkspaces(e,s);return h(o,A.default,u,r)},async patchState(e,s,o,a,n){let i=await t.patchState(e,s,o,a,n);return h(i,A.default,u,r)},async setState(e,s,o,a,n){let i=await t.setState(e,s,o,a,n);return h(i,A.default,u,r)},async transferBot(e,s,o){let a=await t.transferBot(e,s,o);return h(a,A.default,u,r)},async updateBot(e,s,o){let a=await t.updateBot(e,s,o);return h(a,A.default,u,r)},async updateConversation(e,s,o){let a=await t.updateConversation(e,s,o);return h(a,A.default,u,r)},async updateIntegration(e,s,o){let a=await t.updateIntegration(e,s,o);return h(a,A.default,u,r)},async updateMessage(e,s,o){let a=await t.updateMessage(e,s,o);return h(a,A.default,u,r)},async updateUser(e,s,o){let a=await t.updateUser(e,s,o);return h(a,A.default,u,r)},async updateWorkspace(e,s,o){let a=await t.updateWorkspace(e,s,o);return h(a,A.default,u,r)},async updateWorkspaceMember(e,s,o){let a=await t.updateWorkspaceMember(e,s,o);return h(a,A.default,u,r)}}};var $=class extends Q{callAction(t={},e){return m(this.configuration).callAction(t.callActionBody,e).then(s=>s(this.axios,this.basePath))}changeWorkspacePlan(t,e){return m(this.configuration).changeWorkspacePlan(t.id,t.changeWorkspacePlanBody,e).then(s=>s(this.axios,this.basePath))}configureIntegration(t={},e){return m(this.configuration).configureIntegration(t.configureIntegrationBody,e).then(s=>s(this.axios,this.basePath))}createBot(t={},e){return m(this.configuration).createBot(t.createBotBody,e).then(s=>s(this.axios,this.basePath))}createConversation(t={},e){return m(this.configuration).createConversation(t.createConversationBody,e).then(s=>s(this.axios,this.basePath))}createEvent(t={},e){return m(this.configuration).createEvent(t.createEventBody,e).then(s=>s(this.axios,this.basePath))}createFile(t={},e){return m(this.configuration).createFile(t.createFileBody,e).then(s=>s(this.axios,this.basePath))}createIntegration(t={},e){return m(this.configuration).createIntegration(t.createIntegrationBody,e).then(s=>s(this.axios,this.basePath))}createMessage(t={},e){return m(this.configuration).createMessage(t.createMessageBody,e).then(s=>s(this.axios,this.basePath))}createUser(t={},e){return m(this.configuration).createUser(t.createUserBody,e).then(s=>s(this.axios,this.basePath))}createWorkspace(t={},e){return m(this.configuration).createWorkspace(t.createWorkspaceBody,e).then(s=>s(this.axios,this.basePath))}createWorkspaceMember(t={},e){return m(this.configuration).createWorkspaceMember(t.createWorkspaceMemberBody,e).then(s=>s(this.axios,this.basePath))}deleteBot(t,e){return m(this.configuration).deleteBot(t.id,e).then(s=>s(this.axios,this.basePath))}deleteConversation(t,e){return m(this.configuration).deleteConversation(t.id,e).then(s=>s(this.axios,this.basePath))}deleteFile(t,e){return m(this.configuration).deleteFile(t.id,e).then(s=>s(this.axios,this.basePath))}deleteIntegration(t,e){return m(this.configuration).deleteIntegration(t.id,e).then(s=>s(this.axios,this.basePath))}deleteMessage(t,e){return m(this.configuration).deleteMessage(t.id,e).then(s=>s(this.axios,this.basePath))}deleteUser(t,e){return m(this.configuration).deleteUser(t.id,e).then(s=>s(this.axios,this.basePath))}deleteWorkspace(t,e){return m(this.configuration).deleteWorkspace(t.id,e).then(s=>s(this.axios,this.basePath))}deleteWorkspaceMember(t,e){return m(this.configuration).deleteWorkspaceMember(t.id,e).then(s=>s(this.axios,this.basePath))}downloadFile(t,e){return m(this.configuration).downloadFile(t.id,e).then(s=>s(this.axios,this.basePath))}getBot(t,e){return m(this.configuration).getBot(t.id,e).then(s=>s(this.axios,this.basePath))}getBotAnalytics(t,e){return m(this.configuration).getBotAnalytics(t.id,t.startDate,t.endDate,e).then(s=>s(this.axios,this.basePath))}getBotLogs(t,e){return m(this.configuration).getBotLogs(t.id,e).then(s=>s(this.axios,this.basePath))}getBotWebchat(t,e){return m(this.configuration).getBotWebchat(t.id,t.type,e).then(s=>s(this.axios,this.basePath))}getConversation(t,e){return m(this.configuration).getConversation(t.id,e).then(s=>s(this.axios,this.basePath))}getEvent(t,e){return m(this.configuration).getEvent(t.id,e).then(s=>s(this.axios,this.basePath))}getFile(t,e){return m(this.configuration).getFile(t.id,e).then(s=>s(this.axios,this.basePath))}getIntegration(t,e){return m(this.configuration).getIntegration(t.id,e).then(s=>s(this.axios,this.basePath))}getIntegrationByName(t,e){return m(this.configuration).getIntegrationByName(t.name,t.version,e).then(s=>s(this.axios,this.basePath))}getIntegrationLogs(t,e){return m(this.configuration).getIntegrationLogs(t.id,e).then(s=>s(this.axios,this.basePath))}getMessage(t,e){return m(this.configuration).getMessage(t.id,e).then(s=>s(this.axios,this.basePath))}getOrCreateConversation(t={},e){return m(this.configuration).getOrCreateConversation(t.getOrCreateConversationBody,e).then(s=>s(this.axios,this.basePath))}getOrCreateMessage(t={},e){return m(this.configuration).getOrCreateMessage(t.getOrCreateMessageBody,e).then(s=>s(this.axios,this.basePath))}getOrCreateUser(t={},e){return m(this.configuration).getOrCreateUser(t.getOrCreateUserBody,e).then(s=>s(this.axios,this.basePath))}getPublicIntegration(t,e){return m(this.configuration).getPublicIntegration(t.name,t.version,e).then(s=>s(this.axios,this.basePath))}getPublicIntegrationById(t,e){return m(this.configuration).getPublicIntegrationById(t.id,e).then(s=>s(this.axios,this.basePath))}getState(t,e){return m(this.configuration).getState(t.type,t.id,t.name,e).then(s=>s(this.axios,this.basePath))}getUser(t,e){return m(this.configuration).getUser(t.id,e).then(s=>s(this.axios,this.basePath))}getWorkspace(t,e){return m(this.configuration).getWorkspace(t.id,e).then(s=>s(this.axios,this.basePath))}introspect(t={},e){return m(this.configuration).introspect(t.introspectBody,e).then(s=>s(this.axios,this.basePath))}listBots(t={},e){return m(this.configuration).listBots(t.nextToken,e).then(s=>s(this.axios,this.basePath))}listConversations(t={},e){return m(this.configuration).listConversations(t.nextToken,t.tags,t.participantIds,e).then(s=>s(this.axios,this.basePath))}listEvents(t={},e){return m(this.configuration).listEvents(t.nextToken,t.type,e).then(s=>s(this.axios,this.basePath))}listFiles(t,e){return m(this.configuration).listFiles(t.botId,t.nextToken,e).then(s=>s(this.axios,this.basePath))}listIntegrations(t={},e){return m(this.configuration).listIntegrations(t.nextToken,t.name,t.version,e).then(s=>s(this.axios,this.basePath))}listMessages(t={},e){return m(this.configuration).listMessages(t.nextToken,t.conversationId,t.tags,e).then(s=>s(this.axios,this.basePath))}listPublicIntegrations(t={},e){return m(this.configuration).listPublicIntegrations(t.nextToken,t.name,t.version,e).then(s=>s(this.axios,this.basePath))}listUsers(t={},e){return m(this.configuration).listUsers(t.nextToken,t.conversationId,t.tags,e).then(s=>s(this.axios,this.basePath))}listWorkspaceMembers(t={},e){return m(this.configuration).listWorkspaceMembers(t.nextToken,e).then(s=>s(this.axios,this.basePath))}listWorkspaces(t={},e){return m(this.configuration).listWorkspaces(t.nextToken,e).then(s=>s(this.axios,this.basePath))}patchState(t,e){return m(this.configuration).patchState(t.type,t.id,t.name,t.patchStateBody,e).then(s=>s(this.axios,this.basePath))}setState(t,e){return m(this.configuration).setState(t.type,t.id,t.name,t.setStateBody,e).then(s=>s(this.axios,this.basePath))}transferBot(t,e){return m(this.configuration).transferBot(t.id,t.transferBotBody,e).then(s=>s(this.axios,this.basePath))}updateBot(t,e){return m(this.configuration).updateBot(t.id,t.updateBotBody,e).then(s=>s(this.axios,this.basePath))}updateConversation(t,e){return m(this.configuration).updateConversation(t.id,t.updateConversationBody,e).then(s=>s(this.axios,this.basePath))}updateIntegration(t,e){return m(this.configuration).updateIntegration(t.id,t.updateIntegrationBody,e).then(s=>s(this.axios,this.basePath))}updateMessage(t,e){return m(this.configuration).updateMessage(t.id,t.updateMessageBody,e).then(s=>s(this.axios,this.basePath))}updateUser(t,e){return m(this.configuration).updateUser(t.id,t.updateUserBody,e).then(s=>s(this.axios,this.basePath))}updateWorkspace(t,e){return m(this.configuration).updateWorkspace(t.id,t.updateWorkspaceBody,e).then(s=>s(this.axios,this.basePath))}updateWorkspaceMember(t,e){return m(this.configuration).updateWorkspaceMember(t.id,t.updateWorkspaceMemberBody,e).then(s=>s(this.axios,this.basePath))}};var J=class{_innerClient;constructor(t,e,s){this._innerClient=new $(t,e,s)}createConversation=t=>this._innerClient.createConversation({createConversationBody:t}).then(e=>e.data).catch(e=>{throw R(e)});getConversation=t=>this._innerClient.getConversation(t).then(e=>e.data).catch(e=>{throw R(e)});listConversations=t=>this._innerClient.listConversations(t).then(e=>e.data).catch(e=>{throw R(e)});getOrCreateConversation=t=>this._innerClient.getOrCreateConversation({getOrCreateConversationBody:t}).then(e=>e.data).catch(e=>{throw R(e)});updateConversation=({id:t,...e})=>this._innerClient.updateConversation({id:t,updateConversationBody:e}).then(s=>s.data).catch(s=>{throw R(s)});deleteConversation=t=>this._innerClient.deleteConversation(t).then(e=>e.data).catch(e=>{throw R(e)});createEvent=t=>this._innerClient.createEvent({createEventBody:t}).then(e=>e.data).catch(e=>{throw R(e)});getEvent=t=>this._innerClient.getEvent(t).then(e=>e.data).catch(e=>{throw R(e)});listEvents=t=>this._innerClient.listEvents(t).then(e=>e.data).catch(e=>{throw R(e)});createMessage=t=>this._innerClient.createMessage({createMessageBody:t}).then(e=>e.data).catch(e=>{throw R(e)});getOrCreateMessage=t=>this._innerClient.getOrCreateMessage({getOrCreateMessageBody:t}).then(e=>e.data).catch(e=>{throw R(e)});getMessage=t=>this._innerClient.getMessage(t).then(e=>e.data).catch(e=>{throw R(e)});updateMessage=({id:t,...e})=>this._innerClient.updateMessage({id:t,updateMessageBody:e}).then(s=>s.data).catch(s=>{throw R(s)});listMessages=t=>this._innerClient.listMessages(t).then(e=>e.data).catch(e=>{throw R(e)});deleteMessage=t=>this._innerClient.deleteMessage(t).then(e=>e.data).catch(e=>{throw R(e)});createUser=t=>this._innerClient.createUser({createUserBody:t}).then(e=>e.data).catch(e=>{throw R(e)});getUser=t=>this._innerClient.getUser(t).then(e=>e.data).catch(e=>{throw R(e)});listUsers=t=>this._innerClient.listUsers(t).then(e=>e.data).catch(e=>{throw R(e)});getOrCreateUser=t=>this._innerClient.getOrCreateUser({getOrCreateUserBody:t}).then(e=>e.data).catch(e=>{throw R(e)});updateUser=({id:t,...e})=>this._innerClient.updateUser({id:t,updateUserBody:e}).then(s=>s.data).catch(s=>{throw R(s)});deleteUser=t=>this._innerClient.deleteUser(t).then(e=>e.data).catch(e=>{throw R(e)});getState=t=>this._innerClient.getState(t).then(e=>e.data).catch(e=>{throw R(e)});setState=({type:t,id:e,name:s,...o})=>this._innerClient.setState({type:t,id:e,name:s,setStateBody:o}).then(a=>a.data).catch(a=>{throw R(a)});patchState=({type:t,id:e,name:s,...o})=>this._innerClient.patchState({type:t,id:e,name:s,patchStateBody:o}).then(a=>a.data).catch(a=>{throw R(a)});callAction=t=>this._innerClient.callAction({callActionBody:t}).then(e=>e.data).catch(e=>{throw R(e)});configureIntegration=t=>this._innerClient.configureIntegration({configureIntegrationBody:t}).then(e=>e.data).catch(e=>{throw R(e)});listPublicIntegrations=t=>this._innerClient.listPublicIntegrations(t).then(e=>e.data).catch(e=>{throw R(e)});getPublicIntegrationById=t=>this._innerClient.getPublicIntegrationById(t).then(e=>e.data).catch(e=>{throw R(e)});getPublicIntegration=t=>this._innerClient.getPublicIntegration(t).then(e=>e.data).catch(e=>{throw R(e)});createBot=t=>this._innerClient.createBot({createBotBody:t}).then(e=>e.data).catch(e=>{throw R(e)});updateBot=({id:t,...e})=>this._innerClient.updateBot({id:t,updateBotBody:e}).then(s=>s.data).catch(s=>{throw R(s)});transferBot=({id:t,...e})=>this._innerClient.transferBot({id:t,transferBotBody:e}).then(s=>s.data).catch(s=>{throw R(s)});listBots=t=>this._innerClient.listBots(t).then(e=>e.data).catch(e=>{throw R(e)});getBot=t=>this._innerClient.getBot(t).then(e=>e.data).catch(e=>{throw R(e)});deleteBot=t=>this._innerClient.deleteBot(t).then(e=>e.data).catch(e=>{throw R(e)});getBotLogs=t=>this._innerClient.getBotLogs(t).then(e=>e.data).catch(e=>{throw R(e)});getBotWebchat=t=>this._innerClient.getBotWebchat(t).then(e=>e.data).catch(e=>{throw R(e)});getBotAnalytics=t=>this._innerClient.getBotAnalytics(t).then(e=>e.data).catch(e=>{throw R(e)});createWorkspace=t=>this._innerClient.createWorkspace({createWorkspaceBody:t}).then(e=>e.data).catch(e=>{throw R(e)});getWorkspace=t=>this._innerClient.getWorkspace(t).then(e=>e.data).catch(e=>{throw R(e)});updateWorkspace=({id:t,...e})=>this._innerClient.updateWorkspace({id:t,updateWorkspaceBody:e}).then(s=>s.data).catch(s=>{throw R(s)});listWorkspaces=t=>this._innerClient.listWorkspaces(t).then(e=>e.data).catch(e=>{throw R(e)});changeWorkspacePlan=({id:t,...e})=>this._innerClient.changeWorkspacePlan({id:t,changeWorkspacePlanBody:e}).then(s=>s.data).catch(s=>{throw R(s)});deleteWorkspace=t=>this._innerClient.deleteWorkspace(t).then(e=>e.data).catch(e=>{throw R(e)});createIntegration=t=>this._innerClient.createIntegration({createIntegrationBody:t}).then(e=>e.data).catch(e=>{throw R(e)});updateIntegration=({id:t,...e})=>this._innerClient.updateIntegration({id:t,updateIntegrationBody:e}).then(s=>s.data).catch(s=>{throw R(s)});listIntegrations=t=>this._innerClient.listIntegrations(t).then(e=>e.data).catch(e=>{throw R(e)});getIntegration=t=>this._innerClient.getIntegration(t).then(e=>e.data).catch(e=>{throw R(e)});getIntegrationLogs=t=>this._innerClient.getIntegrationLogs(t).then(e=>e.data).catch(e=>{throw R(e)});getIntegrationByName=t=>this._innerClient.getIntegrationByName(t).then(e=>e.data).catch(e=>{throw R(e)});deleteIntegration=t=>this._innerClient.deleteIntegration(t).then(e=>e.data).catch(e=>{throw R(e)});listWorkspaceMembers=t=>this._innerClient.listWorkspaceMembers(t).then(e=>e.data).catch(e=>{throw R(e)});deleteWorkspaceMember=t=>this._innerClient.deleteWorkspaceMember(t).then(e=>e.data).catch(e=>{throw R(e)});createWorkspaceMember=t=>this._innerClient.createWorkspaceMember({createWorkspaceMemberBody:t}).then(e=>e.data).catch(e=>{throw R(e)});updateWorkspaceMember=({id:t,...e})=>this._innerClient.updateWorkspaceMember({id:t,updateWorkspaceMemberBody:e}).then(s=>s.data).catch(s=>{throw R(s)});introspect=t=>this._innerClient.introspect({introspectBody:t}).then(e=>e.data).catch(e=>{throw R(e)});createFile=t=>this._innerClient.createFile({createFileBody:t}).then(e=>e.data).catch(e=>{throw R(e)});getFile=t=>this._innerClient.getFile(t).then(e=>e.data).catch(e=>{throw R(e)});downloadFile=t=>this._innerClient.downloadFile(t).then(e=>e.data).catch(e=>{throw R(e)});deleteFile=t=>this._innerClient.deleteFile(t).then(e=>e.data).catch(e=>{throw R(e)});listFiles=t=>this._innerClient.listFiles(t).then(e=>e.data).catch(e=>{throw R(e)})};function R(r){return ae.default.isAxiosError(r)?N(r.response?.data):N(r)}var Y=class extends J{config;constructor(t={}){let e=ee(t),{host:s,headers:o,withCredentials:a,timeout:n}=e,i=re.default.create({maxBodyLength:100*1024*1024,maxContentLength:1024*1024*1024,timeout:n??6e4,withCredentials:a,headers:o});super(void 0,s,i),this.config=e}};0&&(module.exports={AlreadyExistsError,Client,ForbiddenError,InternalError,InvalidDataFormatError,InvalidIdentifierError,InvalidJsonSchemaError,InvalidPayloadError,InvalidQueryError,MethodNotFoundError,PayloadTooLargeError,RateLimitedError,ReferenceNotFoundError,RelationConflictError,ResourceNotFoundError,RuntimeError,UnauthorizedError,UnknownError,UnsupportedMediaTypeError,axios,errorFrom,isApiError});
1
+ "use strict";var ne=Object.create;var I=Object.defineProperty;var ie=Object.getOwnPropertyDescriptor;var le=Object.getOwnPropertyNames;var pe=Object.getPrototypeOf,ce=Object.prototype.hasOwnProperty;var ue=(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 le(t))!ce.call(a,o)&&o!==e&&I(a,o,{get:()=>t[o],enumerable:!(s=ie(t,o))||s.enumerable});return a};var b=(a,t,e)=>(e=a!=null?ne(pe(a)):{},X(t||!a||!a.__esModule?I(e,"default",{value:a,enumerable:!0}):e,a)),de=a=>X(I({},"__esModule",{value:!0}),a);var be={};ue(be,{AlreadyExistsError:()=>_,Client:()=>Z,ForbiddenError:()=>V,InternalError:()=>U,InvalidDataFormatError:()=>W,InvalidIdentifierError:()=>w,InvalidJsonSchemaError:()=>M,InvalidPayloadError:()=>O,InvalidQueryError:()=>G,MethodNotFoundError:()=>D,PayloadTooLargeError:()=>v,PaymentRequiredError:()=>j,RateLimitedError:()=>N,ReferenceNotFoundError:()=>L,RelationConflictError:()=>S,ResourceNotFoundError:()=>E,RuntimeError:()=>F,UnauthorizedError:()=>k,UnknownError:()=>B,UnsupportedMediaTypeError:()=>T,axios:()=>qe,errorFrom:()=>Q,isApiError:()=>se});module.exports=de(be);var oe=b(require("axios")),qe=b(require("axios"));var q=require("browser-or-node"),ee="https://api.botpress.cloud",ge="BP_API_URL",ye="BP_BOT_ID",he="BP_INTEGRATION_ID",Ae="BP_WORKSPACE_ID",Re="BP_TOKEN";function te(a){let t=me(a),e={};return 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}`),{host:t.host??ee,withCredentials:q.isBrowser,headers:e,timeout:t.timeout}}function me(a){return q.isBrowser?a:q.isNode?fe(a):a}function fe(a){let t={...a,host:a.host??process.env[ge]??ee,botId:a.botId??process.env[ye],integrationId:a.integrationId??process.env[he],workspaceId:a.workspaceId??process.env[Ae]},e=t.token??process.env[Re];return e&&(t.token=e),t}var x=class extends Error{constructor(e,s,o,r,n){super(r);this.code=e;this.description=s;this.type=o;this.message=r;this.error=n}isApiError=!0;toJSON(){return{code:this.code,type:this.type,message:this.message}}},Ce=a=>typeof a=="object"&&!Array.isArray(a)&&a!==null,se=a=>a instanceof x||Ce(a)&&a.isApiError===!0,B=class extends x{constructor(t,e){super(500,"An unknown error occurred","Unknown",t,e)}},U=class extends x{constructor(t,e){super(500,"An internal error occurred","Internal",t,e)}},k=class extends x{constructor(t,e){super(401,"The request requires to be authenticated.","Unauthorized",t,e)}},V=class extends x{constructor(t,e){super(403,"The requested action can't be peform by this resource.","Forbidden",t,e)}},v=class extends x{constructor(t,e){super(413,"The request payload is too large.","PayloadTooLarge",t,e)}},O=class extends x{constructor(t,e){super(400,"The request payload is invalid.","InvalidPayload",t,e)}},T=class extends x{constructor(t,e){super(415,"The request is invalid because the content-type is not supported.","UnsupportedMediaType",t,e)}},D=class extends x{constructor(t,e){super(405,"The requested method does not exist.","MethodNotFound",t,e)}},E=class extends x{constructor(t,e){super(404,"The requested resource does not exist.","ResourceNotFound",t,e)}},M=class extends x{constructor(t,e){super(400,"The provided JSON schema is invalid.","InvalidJsonSchema",t,e)}},W=class extends x{constructor(t,e){super(400,"The provided data doesn't respect the provided JSON schema.","InvalidDataFormat",t,e)}},w=class extends x{constructor(t,e){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=class extends x{constructor(t,e){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)}},L=class extends x{constructor(t,e){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)}},G=class extends x{constructor(t,e){super(400,"The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource.","InvalidQuery",t,e)}},F=class extends x{constructor(t,e){super(400,"An error happened during the execution of a runtime (bot or integration).","Runtime",t,e)}},_=class extends x{constructor(t,e){super(409,"The record attempted to be created already exists.","AlreadyExists",t,e)}},N=class extends x{constructor(t,e){super(429,"The request has been rate limited.","RateLimited",t,e)}},j=class extends x{constructor(t,e){super(402,"A payment is required to perform this request.","PaymentRequired",t,e)}},xe={Unknown:B,Internal:U,Unauthorized:k,Forbidden:V,PayloadTooLarge:v,InvalidPayload:O,UnsupportedMediaType:T,MethodNotFound:D,ResourceNotFound:E,InvalidJsonSchema:M,InvalidDataFormat:W,InvalidIdentifier:w,RelationConflict:S,ReferenceNotFound:L,InvalidQuery:G,Runtime:F,AlreadyExists:_,RateLimited:N,PaymentRequired:j},Q=a=>se(a)?a:a instanceof Error?new B(a.message,a):a===null?new B("An unknown error occurred"):typeof a=="string"?new B(a):typeof a!="object"?new B("An unknown error occurred"):Pe(a);function Pe(a){if("code"in a&&"type"in a&&"message"in a){if(typeof a.message!="string")return new B("An unknown error occurred");if(typeof a.type!="string")return new B(a.message);let t=xe[a.type];return t?new t(a.message):new B(a.message)}return new B("An unknown error occurred")}var ae=b(require("axios"));var A=b(require("axios"));var re=b(require("axios")),c="https://api.botpress.cloud".replace(/\/+$/,"");var H=class{constructor(t,e=c,s=re.default){this.basePath=e;this.axios=s;t&&(this.configuration=t,this.basePath=t.basePath||this.basePath)}configuration},$=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 $(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 u=n&&n.headers?n.headers:{};return i.headers={...p,...u,...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={})=>{f("getAuditRecords","id",t);let s="/v1/admin/workspaces/{id}/audit-records".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}},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={},u={};e!==void 0&&(u.startDate=e),s!==void 0&&(u.endDate=s),g(n,u);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 u=n&&n.headers?n.headers:{};return i.headers={...p,...u,...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 u=n&&n.headers?n.headers:{};return i.headers={...p,...u,...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 u=n&&n.headers?n.headers:{};return i.headers={...p,...u,...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={},u={};t!==void 0&&(u.nextToken=t),e!==void 0&&(u.tags=e),s&&(u.participantIds=s),g(n,u);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 u=n&&n.headers?n.headers:{};return i.headers={...p,...u,...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 u=n&&n.headers?n.headers:{};return i.headers={...p,...u,...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={},u={};t!==void 0&&(u.nextToken=t),e!==void 0&&(u.name=e),s!==void 0&&(u.version=s),g(n,u);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={},u={};t!==void 0&&(u.nextToken=t),e!==void 0&&(u.conversationId=e),s!==void 0&&(u.tags=s),g(n,u);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={},u={};t!==void 0&&(u.nextToken=t),e!==void 0&&(u.name=e),s!==void 0&&(u.version=s),g(n,u);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={},u={};t!==void 0&&(u.nextToken=t),e!==void 0&&(u.conversationId=e),s!==void 0&&(u.tags=s),g(n,u);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},u={},P={};u["Content-Type"]="application/json",g(i,P);let z=p&&p.headers?p.headers:{};return l.headers={...u,...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},u={},P={};u["Content-Type"]="application/json",g(i,P);let z=p&&p.headers?p.headers:{};return l.headers={...u,...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 u=n&&n.headers?n.headers:{};return i.headers={...p,...u,...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 u=n&&n.headers?n.headers:{};return i.headers={...p,...u,...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 u=n&&n.headers?n.headers:{};return i.headers={...p,...u,...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 u=n&&n.headers?n.headers:{};return i.headers={...p,...u,...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 u=n&&n.headers?n.headers:{};return i.headers={...p,...u,...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 u=n&&n.headers?n.headers:{};return i.headers={...p,...u,...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 u=n&&n.headers?n.headers:{};return i.headers={...p,...u,...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 u=n&&n.headers?n.headers:{};return i.headers={...p,...u,...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,c,a)},async changeWorkspacePlan(e,s,o){let r=await t.changeWorkspacePlan(e,s,o);return h(r,A.default,c,a)},async configureIntegration(e,s){let o=await t.configureIntegration(e,s);return h(o,A.default,c,a)},async createBot(e,s){let o=await t.createBot(e,s);return h(o,A.default,c,a)},async createConversation(e,s){let o=await t.createConversation(e,s);return h(o,A.default,c,a)},async createEvent(e,s){let o=await t.createEvent(e,s);return h(o,A.default,c,a)},async createFile(e,s){let o=await t.createFile(e,s);return h(o,A.default,c,a)},async createIntegration(e,s){let o=await t.createIntegration(e,s);return h(o,A.default,c,a)},async createMessage(e,s){let o=await t.createMessage(e,s);return h(o,A.default,c,a)},async createUser(e,s){let o=await t.createUser(e,s);return h(o,A.default,c,a)},async createWorkspace(e,s){let o=await t.createWorkspace(e,s);return h(o,A.default,c,a)},async createWorkspaceMember(e,s){let o=await t.createWorkspaceMember(e,s);return h(o,A.default,c,a)},async deleteBot(e,s){let o=await t.deleteBot(e,s);return h(o,A.default,c,a)},async deleteConversation(e,s){let o=await t.deleteConversation(e,s);return h(o,A.default,c,a)},async deleteFile(e,s){let o=await t.deleteFile(e,s);return h(o,A.default,c,a)},async deleteIntegration(e,s){let o=await t.deleteIntegration(e,s);return h(o,A.default,c,a)},async deleteMessage(e,s){let o=await t.deleteMessage(e,s);return h(o,A.default,c,a)},async deleteUser(e,s){let o=await t.deleteUser(e,s);return h(o,A.default,c,a)},async deleteWorkspace(e,s){let o=await t.deleteWorkspace(e,s);return h(o,A.default,c,a)},async deleteWorkspaceMember(e,s){let o=await t.deleteWorkspaceMember(e,s);return h(o,A.default,c,a)},async downloadFile(e,s){let o=await t.downloadFile(e,s);return h(o,A.default,c,a)},async getAuditRecords(e,s){let o=await t.getAuditRecords(e,s);return h(o,A.default,c,a)},async getBot(e,s){let o=await t.getBot(e,s);return h(o,A.default,c,a)},async getBotAnalytics(e,s,o,r){let n=await t.getBotAnalytics(e,s,o,r);return h(n,A.default,c,a)},async getBotLogs(e,s){let o=await t.getBotLogs(e,s);return h(o,A.default,c,a)},async getBotWebchat(e,s,o){let r=await t.getBotWebchat(e,s,o);return h(r,A.default,c,a)},async getConversation(e,s){let o=await t.getConversation(e,s);return h(o,A.default,c,a)},async getEvent(e,s){let o=await t.getEvent(e,s);return h(o,A.default,c,a)},async getFile(e,s){let o=await t.getFile(e,s);return h(o,A.default,c,a)},async getIntegration(e,s){let o=await t.getIntegration(e,s);return h(o,A.default,c,a)},async getIntegrationByName(e,s,o){let r=await t.getIntegrationByName(e,s,o);return h(r,A.default,c,a)},async getIntegrationLogs(e,s){let o=await t.getIntegrationLogs(e,s);return h(o,A.default,c,a)},async getMessage(e,s){let o=await t.getMessage(e,s);return h(o,A.default,c,a)},async getOrCreateConversation(e,s){let o=await t.getOrCreateConversation(e,s);return h(o,A.default,c,a)},async getOrCreateMessage(e,s){let o=await t.getOrCreateMessage(e,s);return h(o,A.default,c,a)},async getOrCreateUser(e,s){let o=await t.getOrCreateUser(e,s);return h(o,A.default,c,a)},async getPublicIntegration(e,s,o){let r=await t.getPublicIntegration(e,s,o);return h(r,A.default,c,a)},async getPublicIntegrationById(e,s){let o=await t.getPublicIntegrationById(e,s);return h(o,A.default,c,a)},async getState(e,s,o,r){let n=await t.getState(e,s,o,r);return h(n,A.default,c,a)},async getUser(e,s){let o=await t.getUser(e,s);return h(o,A.default,c,a)},async getWorkspace(e,s){let o=await t.getWorkspace(e,s);return h(o,A.default,c,a)},async introspect(e,s){let o=await t.introspect(e,s);return h(o,A.default,c,a)},async listBots(e,s){let o=await t.listBots(e,s);return h(o,A.default,c,a)},async listConversations(e,s,o,r){let n=await t.listConversations(e,s,o,r);return h(n,A.default,c,a)},async listEvents(e,s,o){let r=await t.listEvents(e,s,o);return h(r,A.default,c,a)},async listFiles(e,s,o){let r=await t.listFiles(e,s,o);return h(r,A.default,c,a)},async listIntegrations(e,s,o,r){let n=await t.listIntegrations(e,s,o,r);return h(n,A.default,c,a)},async listMessages(e,s,o,r){let n=await t.listMessages(e,s,o,r);return h(n,A.default,c,a)},async listPublicIntegrations(e,s,o,r){let n=await t.listPublicIntegrations(e,s,o,r);return h(n,A.default,c,a)},async listUsers(e,s,o,r){let n=await t.listUsers(e,s,o,r);return h(n,A.default,c,a)},async listWorkspaceMembers(e,s){let o=await t.listWorkspaceMembers(e,s);return h(o,A.default,c,a)},async listWorkspaces(e,s){let o=await t.listWorkspaces(e,s);return h(o,A.default,c,a)},async patchState(e,s,o,r,n){let i=await t.patchState(e,s,o,r,n);return h(i,A.default,c,a)},async setState(e,s,o,r,n){let i=await t.setState(e,s,o,r,n);return h(i,A.default,c,a)},async transferBot(e,s,o){let r=await t.transferBot(e,s,o);return h(r,A.default,c,a)},async updateBot(e,s,o){let r=await t.updateBot(e,s,o);return h(r,A.default,c,a)},async updateConversation(e,s,o){let r=await t.updateConversation(e,s,o);return h(r,A.default,c,a)},async updateIntegration(e,s,o){let r=await t.updateIntegration(e,s,o);return h(r,A.default,c,a)},async updateMessage(e,s,o){let r=await t.updateMessage(e,s,o);return h(r,A.default,c,a)},async updateUser(e,s,o){let r=await t.updateUser(e,s,o);return h(r,A.default,c,a)},async updateWorkspace(e,s,o){let r=await t.updateWorkspace(e,s,o);return h(r,A.default,c,a)},async updateWorkspaceMember(e,s,o){let r=await t.updateWorkspaceMember(e,s,o);return h(r,A.default,c,a)}}};var K=class extends H{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,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 J=class{_innerClient;constructor(t,e,s){this._innerClient=new K(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)});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)});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)});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)?Q(a.response?.data):Q(a)}var Z=class extends J{config;constructor(t={}){let e=te(t),{host:s,headers:o,withCredentials:r,timeout:n}=e,i=oe.default.create({maxBodyLength:100*1024*1024,maxContentLength:1024*1024*1024,timeout:n??6e4,withCredentials:r,headers:o});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