@botpress/client 0.11.6 → 0.11.7

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/index.d.ts CHANGED
@@ -1,9 +1,20 @@
1
1
  import { ClientProps, ClientConfig } from './config';
2
2
  import { ApiClient as AutoGeneratedClient } from './gen/client';
3
+ export { isApiError } from './gen/errors';
3
4
  export * as axios from 'axios';
4
- export type { Message, Conversation, User, State, Event, ModelFile as File, Bot, Integration, Issue, IssueEvent, } from './gen';
5
+ export type { Message, Conversation, User, State, Event, ModelFile as File, Bot, Integration, Issue, IssueEvent, Account, Workspace, Usage, } from './gen';
5
6
  export * from './gen/errors';
6
7
  export declare class Client extends AutoGeneratedClient {
7
8
  readonly config: Readonly<ClientConfig>;
8
9
  constructor(clientProps?: ClientProps);
9
10
  }
11
+ type Simplify<T> = {
12
+ [KeyType in keyof T]: Simplify<T[KeyType]>;
13
+ } & {};
14
+ type PickMatching<T, V> = {
15
+ [K in keyof T as T[K] extends V ? K : never]: T[K];
16
+ };
17
+ type ExtractMethods<T> = PickMatching<T, (...rest: any[]) => any>;
18
+ type FunctionNames = keyof ExtractMethods<Client>;
19
+ export type ClientParams<T extends FunctionNames> = Simplify<Parameters<Client[T]>[0]>;
20
+ export type ClientReturn<T extends FunctionNames> = Simplify<Awaited<ReturnType<Client[T]>>>;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import ke from"axios";import{isBrowser as te,isNode as ne}from"browser-or-node";var ie="https://api.botpress.cloud",le=6e4,ce="BP_API_URL",pe="BP_BOT_ID",ue="BP_INTEGRATION_ID",de="BP_WORKSPACE_ID",ge="BP_TOKEN";function se(n){let t=ye(n),e={};t.workspaceId&&(e["x-workspace-id"]=t.workspaceId),t.botId&&(e["x-bot-id"]=t.botId),t.integrationId&&(e["x-integration-id"]=t.integrationId),t.token&&(e.Authorization=`Bearer ${t.token}`),e={...e,...t.headers};let s=t.apiUrl??ie,o=t.timeout??le;return{apiUrl:s,timeout:o,withCredentials:te,headers:e}}function ye(n){return te?n:ne?he(n):n}function he(n){let t={...n,apiUrl:n.apiUrl??process.env[ce],botId:n.botId??process.env[pe],integrationId:n.integrationId??process.env[ue],workspaceId:n.workspaceId??process.env[de]},e=t.token??process.env[ge];return e&&(t.token=e),t}import Be from"axios";import A from"axios";import Ae from"axios";var u="https://api.botpress.cloud".replace(/\/+$/,"");var T=class{constructor(t,e=u,s=Ae){this.basePath=e;this.axios=s;t&&(this.configuration=t,this.basePath=t.basePath||this.basePath)}configuration},q=class extends Error{constructor(e,s){super(s);this.field=e;this.name="RequiredError"}};var d="https://example.com",f=function(n,t,e){if(e==null)throw new q(t,`Required parameter ${t} was null or undefined when calling ${n}.`)};function v(n,t,e=""){t!=null&&(typeof t=="object"?Array.isArray(t)?t.forEach(s=>v(n,s,e)):Object.keys(t).forEach(s=>v(n,t[s],`${e}${e!==""?".":""}${s}`)):n.has(e)?n.append(e,t):n.set(e,t))}var g=function(n,...t){let e=new URLSearchParams(n.search);v(e,t),n.search=e.toString()},x=function(n,t,e){let s=typeof n!="string";return(s&&e&&e.isJsonMime?e.isJsonMime(t.headers["Content-Type"]):s)?JSON.stringify(n!==void 0?n:{}):n||""},y=function(n){return n.pathname+n.search+n.hash},h=function(n,t,e,s){return(o=t,a=e)=>{let r={...n.options,url:(s?.basePath||a)+n.url};return o.request(r)}};var Re=function(n){return{addParticipant:async(t,e,s={})=>{f("addParticipant","id",t);let o="/v1/chat/conversations/{id}/participants".replace("{id}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"POST",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=x(e,i,n),{url:y(a),options:i}},breakDownWorkspaceUsageByBot:async(t,e,s,o={})=>{f("breakDownWorkspaceUsageByBot","id",t),f("breakDownWorkspaceUsageByBot","type",e);let a="/v1/admin/workspaces/{id}/usages/by-bot".replace("{id}",encodeURIComponent(String(t))),r=new URL(a,d),i;n&&(i=n.baseOptions);let l={method:"GET",...i,...o},c={},p={};e!==void 0&&(p.type=e),s!==void 0&&(p.period=s),g(r,p);let b=i&&i.headers?i.headers:{};return l.headers={...c,...b,...o.headers},{url:y(r),options:l}},callAction:async(t,e={})=>{let s="/v1/chat/actions",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=x(t,r,n),{url:y(o),options:r}},changeAISpendQuota:async(t,e={})=>{let s="/v1/admin/quotas/ai-spend",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"PUT",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=x(t,r,n),{url:y(o),options:r}},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),r;n&&(r=n.baseOptions);let i={method:"PUT",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=x(e,i,n),{url:y(a),options:i}},chargeWorkspaceUnpaidInvoices:async(t,e,s={})=>{f("chargeWorkspaceUnpaidInvoices","id",t);let o="/v1/admin/workspaces/{id}/billing/invoices/charge-unpaid".replace("{id}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"POST",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=x(e,i,n),{url:y(a),options:i}},checkHandleAvailability:async(t,e={})=>{let s="/v1/admin/workspaces/handle-availability",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"PUT",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=x(t,r,n),{url:y(o),options:r}},configureIntegration:async(t,e={})=>{let s="/v1/chat/integrations/configure",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=x(t,r,n),{url:y(o),options:r}},createBot:async(t,e={})=>{let s="/v1/admin/bots",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=x(t,r,n),{url:y(o),options:r}},createConversation:async(t,e={})=>{let s="/v1/chat/conversations",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=x(t,r,n),{url:y(o),options:r}},createEvent:async(t,e={})=>{let s="/v1/chat/events",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=x(t,r,n),{url:y(o),options:r}},createFile:async(t,e={})=>{let s="/v1/storage/files",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=x(t,r,n),{url:y(o),options:r}},createIntegration:async(t,e={})=>{let s="/v1/admin/integrations",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=x(t,r,n),{url:y(o),options:r}},createMessage:async(t,e={})=>{let s="/v1/chat/messages",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=x(t,r,n),{url:y(o),options:r}},createPersonalAccessToken:async(t,e={})=>{let s="/v1/admin/account/pats",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=x(t,r,n),{url:y(o),options:r}},createTable:async(t,e={})=>{let s="/v1/tables",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=x(t,r,n),{url:y(o),options:r}},createTableRows:async(t,e,s={})=>{f("createTableRows","table",t);let o="/v1/tables/{table}/rows".replace("{table}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"POST",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=x(e,i,n),{url:y(a),options:i}},createTask:async(t,e={})=>{let s="/v1/chat/tasks",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=x(t,r,n),{url:y(o),options:r}},createUser:async(t,e={})=>{let s="/v1/chat/users",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=x(t,r,n),{url:y(o),options:r}},createWorkspace:async(t,e={})=>{let s="/v1/admin/workspaces",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=x(t,r,n),{url:y(o),options:r}},createWorkspaceMember:async(t,e={})=>{let s="/v1/admin/workspace-members",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=x(t,r,n),{url:y(o),options:r}},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;n&&(a=n.baseOptions);let r={method:"DELETE",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},deleteBotIssue:async(t,e,s={})=>{f("deleteBotIssue","id",t),f("deleteBotIssue","issueId",e);let o="/v1/admin/bots/{id}/issues/{issueId}".replace("{id}",encodeURIComponent(String(t))).replace("{issueId}",encodeURIComponent(String(e))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"DELETE",...r,...s},l={};g(a,{});let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},{url:y(a),options:i}},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;n&&(a=n.baseOptions);let r={method:"DELETE",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},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;n&&(a=n.baseOptions);let r={method:"DELETE",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},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;n&&(a=n.baseOptions);let r={method:"DELETE",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},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;n&&(a=n.baseOptions);let r={method:"DELETE",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},deletePersonalAccessToken:async(t,e={})=>{f("deletePersonalAccessToken","id",t);let s="/v1/admin/account/pats/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"DELETE",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},deleteTable:async(t,e={})=>{f("deleteTable","table",t);let s="/v1/tables/{table}".replace("{table}",encodeURIComponent(String(t))),o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"DELETE",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},deleteTableRows:async(t,e,s={})=>{f("deleteTableRows","table",t);let o="/v1/tables/{table}/rows/delete".replace("{table}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"POST",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=x(e,i,n),{url:y(a),options:i}},deleteTask:async(t,e={})=>{f("deleteTask","id",t);let s="/v1/chat/tasks/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"DELETE",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},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;n&&(a=n.baseOptions);let r={method:"DELETE",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},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;n&&(a=n.baseOptions);let r={method:"DELETE",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},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;n&&(a=n.baseOptions);let r={method:"DELETE",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},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;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},findTableRows:async(t,e,s={})=>{f("findTableRows","table",t);let o="/v1/tables/{table}/rows/find".replace("{table}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"POST",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=x(e,i,n),{url:y(a),options:i}},getAccount:async(t={})=>{let e="/v1/admin/account/me",s=new URL(e,d),o;n&&(o=n.baseOptions);let a={method:"GET",...o,...t},r={};g(s,{});let l=o&&o.headers?o.headers:{};return a.headers={...r,...l,...t.headers},{url:y(s),options:a}},getAccountPreference:async(t,e={})=>{f("getAccountPreference","key",t);let s="/v1/admin/account/preferences/{key}".replace("{key}",encodeURIComponent(String(t))),o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},getAllWorkspaceQuotaCompletion:async(t={})=>{let e="/v1/admin/workspaces/usages/quota-completion",s=new URL(e,d),o;n&&(o=n.baseOptions);let a={method:"GET",...o,...t},r={};g(s,{});let l=o&&o.headers?o.headers:{};return a.headers={...r,...l,...t.headers},{url:y(s),options:a}},getAuditRecords:async(t,e,s={})=>{f("getAuditRecords","id",t);let o="/v1/admin/workspaces/{id}/audit-records".replace("{id}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"GET",...r,...s},l={},c={};e!==void 0&&(c.nextToken=e),g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},{url:y(a),options:i}},getBot:async(t,e={})=>{f("getBot","id",t);let s="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},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))),r=new URL(a,d),i;n&&(i=n.baseOptions);let l={method:"GET",...i,...o},c={},p={};e!==void 0&&(p.startDate=e),s!==void 0&&(p.endDate=s),g(r,p);let b=i&&i.headers?i.headers:{};return l.headers={...c,...b,...o.headers},{url:y(r),options:l}},getBotLogs:async(t,e,s,o,a={})=>{f("getBotLogs","id",t),f("getBotLogs","timeStart",e),f("getBotLogs","timeEnd",s);let r="/v1/admin/bots/{id}/logs".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,d),l;n&&(l=n.baseOptions);let c={method:"GET",...l,...a},p={},b={};e!==void 0&&(b.timeStart=e),s!==void 0&&(b.timeEnd=s),o!==void 0&&(b.nextToken=o),g(i,b);let P=l&&l.headers?l.headers:{};return c.headers={...p,...P,...a.headers},{url:y(i),options:c}},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),r;n&&(r=n.baseOptions);let i={method:"GET",...r,...s},l={},c={};e!==void 0&&(c.type=e),g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...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;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},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;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},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;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},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;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},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),r;n&&(r=n.baseOptions);let i={method:"GET",...r,...s},l={};g(a,{});let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},{url:y(a),options:i}},getIntegrationLogs:async(t,e,s,o,a={})=>{f("getIntegrationLogs","id",t),f("getIntegrationLogs","timeStart",e),f("getIntegrationLogs","timeEnd",s);let r="/v1/admin/integrations/{id}/logs".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,d),l;n&&(l=n.baseOptions);let c={method:"GET",...l,...a},p={},b={};e!==void 0&&(b.timeStart=e),s!==void 0&&(b.timeEnd=s),o!==void 0&&(b.nextToken=o),g(i,b);let P=l&&l.headers?l.headers:{};return c.headers={...p,...P,...a.headers},{url:y(i),options:c}},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;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},getOrCreateConversation:async(t,e={})=>{let s="/v1/chat/conversations/get-or-create",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=x(t,r,n),{url:y(o),options:r}},getOrCreateMessage:async(t,e={})=>{let s="/v1/chat/messages/get-or-create",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=x(t,r,n),{url:y(o),options:r}},getOrCreateUser:async(t,e={})=>{let s="/v1/chat/users/get-or-create",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=x(t,r,n),{url:y(o),options:r}},getOrSetState:async(t,e,s,o,a={})=>{f("getOrSetState","type",t),f("getOrSetState","id",e),f("getOrSetState","name",s);let r="/v1/chat/states/{type}/{id}/{name}/get-or-set".replace("{type}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(e))).replace("{name}",encodeURIComponent(String(s))),i=new URL(r,d),l;n&&(l=n.baseOptions);let c={method:"POST",...l,...a},p={},b={};p["Content-Type"]="application/json",g(i,b);let P=l&&l.headers?l.headers:{};return c.headers={...p,...P,...a.headers},c.data=x(o,c,n),{url:y(i),options:c}},getParticipant:async(t,e,s={})=>{f("getParticipant","id",t),f("getParticipant","userId",e);let o="/v1/chat/conversations/{id}/participants/{userId}".replace("{id}",encodeURIComponent(String(t))).replace("{userId}",encodeURIComponent(String(e))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"GET",...r,...s},l={};g(a,{});let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},{url:y(a),options:i}},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),r;n&&(r=n.baseOptions);let i={method:"GET",...r,...s},l={};g(a,{});let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...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;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},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))),r=new URL(a,d),i;n&&(i=n.baseOptions);let l={method:"GET",...i,...o},c={};g(r,{});let b=i&&i.headers?i.headers:{};return l.headers={...c,...b,...o.headers},{url:y(r),options:l}},getTable:async(t,e={})=>{f("getTable","table",t);let s="/v1/tables/{table}".replace("{table}",encodeURIComponent(String(t))),o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},getTableRow:async(t,e,s={})=>{f("getTableRow","table",t),f("getTableRow","id",e);let o="/v1/tables/{table}/row".replace("{table}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"GET",...r,...s},l={},c={};e!==void 0&&(c.id=e),g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},{url:y(a),options:i}},getTask:async(t,e={})=>{f("getTask","id",t);let s="/v1/chat/tasks/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},getUsage:async(t,e,s,o={})=>{f("getUsage","type",t),f("getUsage","id",e);let a="/v1/admin/usages/{id}".replace("{id}",encodeURIComponent(String(e))),r=new URL(a,d),i;n&&(i=n.baseOptions);let l={method:"GET",...i,...o},c={},p={};t!==void 0&&(p.type=t),s!==void 0&&(p.period=s),g(r,p);let b=i&&i.headers?i.headers:{};return l.headers={...c,...b,...o.headers},{url:y(r),options:l}},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;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},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;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},getWorkspaceBillingDetails:async(t,e={})=>{f("getWorkspaceBillingDetails","id",t);let s="/v1/admin/workspaces/{id}/billing/details".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},getWorkspaceQuota:async(t,e,s,o={})=>{f("getWorkspaceQuota","id",t),f("getWorkspaceQuota","type",e);let a="/v1/admin/workspaces/{id}/quota".replace("{id}",encodeURIComponent(String(t))),r=new URL(a,d),i;n&&(i=n.baseOptions);let l={method:"GET",...i,...o},c={},p={};e!==void 0&&(p.type=e),s!==void 0&&(p.period=s),g(r,p);let b=i&&i.headers?i.headers:{};return l.headers={...c,...b,...o.headers},{url:y(r),options:l}},introspect:async(t,e={})=>{let s="/v1/admin/introspect",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=x(t,r,n),{url:y(o),options:r}},listActivities:async(t,e,s,o={})=>{f("listActivities","taskId",t),f("listActivities","botId",e);let a="/v1/admin/activities",r=new URL(a,d),i;n&&(i=n.baseOptions);let l={method:"GET",...i,...o},c={},p={};s!==void 0&&(p.nextToken=s),t!==void 0&&(p.taskId=t),e!==void 0&&(p.botId=e),g(r,p);let b=i&&i.headers?i.headers:{};return l.headers={...c,...b,...o.headers},{url:y(r),options:l}},listBotIssueEvents:async(t,e,s={})=>{f("listBotIssueEvents","id",t),f("listBotIssueEvents","issueId",e);let o="/v1/admin/bots/{id}/issues/{issueId}/events".replace("{id}",encodeURIComponent(String(t))).replace("{issueId}",encodeURIComponent(String(e))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"GET",...r,...s},l={};g(a,{});let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},{url:y(a),options:i}},listBotIssues:async(t,e,s={})=>{f("listBotIssues","id",t);let o="/v1/admin/bots/{id}/issues".replace("{id}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"GET",...r,...s},l={},c={};e!==void 0&&(c.nextToken=e),g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},{url:y(a),options:i}},listBots:async(t,e,s={})=>{let o="/v1/admin/bots",a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"GET",...r,...s},l={},c={};t!==void 0&&(c.dev=t),e!==void 0&&(c.nextToken=e),g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},{url:y(a),options:i}},listConversations:async(t,e,s,o={})=>{let a="/v1/chat/conversations",r=new URL(a,d),i;n&&(i=n.baseOptions);let l={method:"GET",...i,...o},c={},p={};t!==void 0&&(p.nextToken=t),e!==void 0&&(p.tags=e),s&&(p.participantIds=s),g(r,p);let b=i&&i.headers?i.headers:{};return l.headers={...c,...b,...o.headers},{url:y(r),options:l}},listEvents:async(t,e,s,o,a,r={})=>{let i="/v1/chat/events",l=new URL(i,d),c;n&&(c=n.baseOptions);let p={method:"GET",...c,...r},b={},P={};t!==void 0&&(P.nextToken=t),e!==void 0&&(P.type=e),s!==void 0&&(P.conversationId=s),o!==void 0&&(P.userId=o),a!==void 0&&(P.messageId=a),g(l,P);let V=c&&c.headers?c.headers:{};return p.headers={...b,...V,...r.headers},{url:y(l),options:p}},listFiles:async(t,e,s={})=>{f("listFiles","botId",t);let o="/v1/storage/files",a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"GET",...r,...s},l={},c={};e!==void 0&&(c.nextToken=e),t!==void 0&&(c.botId=t),g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},{url:y(a),options:i}},listIntegrations:async(t,e,s,o,a={})=>{let r="/v1/admin/integrations",i=new URL(r,d),l;n&&(l=n.baseOptions);let c={method:"GET",...l,...a},p={},b={};t!==void 0&&(b.nextToken=t),e!==void 0&&(b.name=e),s!==void 0&&(b.version=s),o!==void 0&&(b.dev=o),g(i,b);let P=l&&l.headers?l.headers:{};return c.headers={...p,...P,...a.headers},{url:y(i),options:c}},listMessages:async(t,e,s,o={})=>{let a="/v1/chat/messages",r=new URL(a,d),i;n&&(i=n.baseOptions);let l={method:"GET",...i,...o},c={},p={};t!==void 0&&(p.nextToken=t),e!==void 0&&(p.conversationId=e),s!==void 0&&(p.tags=s),g(r,p);let b=i&&i.headers?i.headers:{};return l.headers={...c,...b,...o.headers},{url:y(r),options:l}},listParticipants:async(t,e,s={})=>{f("listParticipants","id",t);let o="/v1/chat/conversations/{id}/participants".replace("{id}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"GET",...r,...s},l={},c={};e!==void 0&&(c.nextToken=e),g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},{url:y(a),options:i}},listPersonalAccessTokens:async(t={})=>{let e="/v1/admin/account/pats",s=new URL(e,d),o;n&&(o=n.baseOptions);let a={method:"GET",...o,...t},r={};g(s,{});let l=o&&o.headers?o.headers:{};return a.headers={...r,...l,...t.headers},{url:y(s),options:a}},listPublicIntegrations:async(t,e,s,o={})=>{let a="/v1/admin/hub/integrations",r=new URL(a,d),i;n&&(i=n.baseOptions);let l={method:"GET",...i,...o},c={},p={};t!==void 0&&(p.nextToken=t),e!==void 0&&(p.name=e),s!==void 0&&(p.version=s),g(r,p);let b=i&&i.headers?i.headers:{};return l.headers={...c,...b,...o.headers},{url:y(r),options:l}},listTables:async(t,e={})=>{let s="/v1/tables",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={},l={};t!==void 0&&(l.tags=t),g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},listTasks:async(t,e,s,o,a,r,i,l={})=>{let c="/v1/chat/tasks",p=new URL(c,d),b;n&&(b=n.baseOptions);let P={method:"GET",...b,...l},V={},B={};t!==void 0&&(B.nextToken=t),e!==void 0&&(B.tags=e),s!==void 0&&(B.conversationId=s),o!==void 0&&(B.userId=o),a!==void 0&&(B.parentTaskId=a),r&&(B.status=r),i!==void 0&&(B.type=i),g(p,B);let re=b&&b.headers?b.headers:{};return P.headers={...V,...re,...l.headers},{url:y(p),options:P}},listUsageHistory:async(t,e,s={})=>{f("listUsageHistory","type",t),f("listUsageHistory","id",e);let o="/v1/admin/usages/{id}/history".replace("{id}",encodeURIComponent(String(e))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"GET",...r,...s},l={},c={};t!==void 0&&(c.type=t),g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},{url:y(a),options:i}},listUsers:async(t,e,s,o={})=>{let a="/v1/chat/users",r=new URL(a,d),i;n&&(i=n.baseOptions);let l={method:"GET",...i,...o},c={},p={};t!==void 0&&(p.nextToken=t),e!==void 0&&(p.conversationId=e),s!==void 0&&(p.tags=s),g(r,p);let b=i&&i.headers?i.headers:{};return l.headers={...c,...b,...o.headers},{url:y(r),options:l}},listWorkspaceInvoices:async(t,e={})=>{f("listWorkspaceInvoices","id",t);let s="/v1/admin/workspaces/{id}/billing/invoices".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},listWorkspaceMembers:async(t,e={})=>{let s="/v1/admin/workspace-members",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={},l={};t!==void 0&&(l.nextToken=t),g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},listWorkspaceQuotas:async(t,e,s={})=>{f("listWorkspaceQuotas","id",t);let o="/v1/admin/workspaces/{id}/quotas".replace("{id}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"GET",...r,...s},l={},c={};e!==void 0&&(c.period=e),g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},{url:y(a),options:i}},listWorkspaceUsages:async(t,e,s,o={})=>{f("listWorkspaceUsages","id",t),f("listWorkspaceUsages","type",e);let a="/v1/admin/workspaces/{id}/usages".replace("{id}",encodeURIComponent(String(t))),r=new URL(a,d),i;n&&(i=n.baseOptions);let l={method:"GET",...i,...o},c={},p={};e!==void 0&&(p.type=e),s!==void 0&&(p.period=s),g(r,p);let b=i&&i.headers?i.headers:{};return l.headers={...c,...b,...o.headers},{url:y(r),options:l}},listWorkspaces:async(t,e={})=>{let s="/v1/admin/workspaces",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={},l={};t!==void 0&&(l.nextToken=t),g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},patchState:async(t,e,s,o,a={})=>{f("patchState","type",t),f("patchState","id",e),f("patchState","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))),i=new URL(r,d),l;n&&(l=n.baseOptions);let c={method:"PATCH",...l,...a},p={},b={};p["Content-Type"]="application/json",g(i,b);let P=l&&l.headers?l.headers:{};return c.headers={...p,...P,...a.headers},c.data=x(o,c,n),{url:y(i),options:c}},removeParticipant:async(t,e,s={})=>{f("removeParticipant","id",t),f("removeParticipant","userId",e);let o="/v1/chat/conversations/{id}/participants/{userId}".replace("{id}",encodeURIComponent(String(t))).replace("{userId}",encodeURIComponent(String(e))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"DELETE",...r,...s},l={};g(a,{});let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},{url:y(a),options:i}},renameTableColumn:async(t,e,s={})=>{f("renameTableColumn","table",t);let o="/v1/tables/{table}/column".replace("{table}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"PUT",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=x(e,i,n),{url:y(a),options:i}},runVrl:async(t,e={})=>{let s="/v1/admin/helper/vrl",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=x(t,r,n),{url:y(o),options:r}},setAccountPreference:async(t,e,s={})=>{f("setAccountPreference","key",t);let o="/v1/admin/account/preferences/{key}".replace("{key}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"POST",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=x(e,i,n),{url:y(a),options:i}},setState:async(t,e,s,o,a={})=>{f("setState","type",t),f("setState","id",e),f("setState","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))),i=new URL(r,d),l;n&&(l=n.baseOptions);let c={method:"POST",...l,...a},p={},b={};p["Content-Type"]="application/json",g(i,b);let P=l&&l.headers?l.headers:{};return c.headers={...p,...P,...a.headers},c.data=x(o,c,n),{url:y(i),options:c}},setWorkspacePaymentMethod:async(t,e,s={})=>{f("setWorkspacePaymentMethod","id",t);let o="/v1/admin/workspaces/{id}/billing/payment-method".replace("{id}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"PUT",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=x(e,i,n),{url:y(a),options:i}},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),r;n&&(r=n.baseOptions);let i={method:"POST",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=x(e,i,n),{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),r;n&&(r=n.baseOptions);let i={method:"PUT",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=x(e,i,n),{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),r;n&&(r=n.baseOptions);let i={method:"PUT",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=x(e,i,n),{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),r;n&&(r=n.baseOptions);let i={method:"PUT",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=x(e,i,n),{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),r;n&&(r=n.baseOptions);let i={method:"PUT",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=x(e,i,n),{url:y(a),options:i}},updateTable:async(t,e,s={})=>{f("updateTable","table",t);let o="/v1/tables/{table}".replace("{table}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"PUT",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=x(e,i,n),{url:y(a),options:i}},updateTableRows:async(t,e,s={})=>{f("updateTableRows","table",t);let o="/v1/tables/{table}/rows".replace("{table}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"PUT",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=x(e,i,n),{url:y(a),options:i}},updateTask:async(t,e,s={})=>{f("updateTask","id",t);let o="/v1/chat/tasks/{id}".replace("{id}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"PUT",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=x(e,i,n),{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),r;n&&(r=n.baseOptions);let i={method:"PUT",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=x(e,i,n),{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),r;n&&(r=n.baseOptions);let i={method:"PUT",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=x(e,i,n),{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),r;n&&(r=n.baseOptions);let i={method:"PUT",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=x(e,i,n),{url:y(a),options:i}},upsertTableRows:async(t,e,s={})=>{f("upsertTableRows","table",t);let o="/v1/tables/{table}/rows/upsert".replace("{table}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"POST",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=x(e,i,n),{url:y(a),options:i}}}},R=function(n){let t=Re(n);return{async addParticipant(e,s,o){let a=await t.addParticipant(e,s,o);return h(a,A,u,n)},async breakDownWorkspaceUsageByBot(e,s,o,a){let r=await t.breakDownWorkspaceUsageByBot(e,s,o,a);return h(r,A,u,n)},async callAction(e,s){let o=await t.callAction(e,s);return h(o,A,u,n)},async changeAISpendQuota(e,s){let o=await t.changeAISpendQuota(e,s);return h(o,A,u,n)},async changeWorkspacePlan(e,s,o){let a=await t.changeWorkspacePlan(e,s,o);return h(a,A,u,n)},async chargeWorkspaceUnpaidInvoices(e,s,o){let a=await t.chargeWorkspaceUnpaidInvoices(e,s,o);return h(a,A,u,n)},async checkHandleAvailability(e,s){let o=await t.checkHandleAvailability(e,s);return h(o,A,u,n)},async configureIntegration(e,s){let o=await t.configureIntegration(e,s);return h(o,A,u,n)},async createBot(e,s){let o=await t.createBot(e,s);return h(o,A,u,n)},async createConversation(e,s){let o=await t.createConversation(e,s);return h(o,A,u,n)},async createEvent(e,s){let o=await t.createEvent(e,s);return h(o,A,u,n)},async createFile(e,s){let o=await t.createFile(e,s);return h(o,A,u,n)},async createIntegration(e,s){let o=await t.createIntegration(e,s);return h(o,A,u,n)},async createMessage(e,s){let o=await t.createMessage(e,s);return h(o,A,u,n)},async createPersonalAccessToken(e,s){let o=await t.createPersonalAccessToken(e,s);return h(o,A,u,n)},async createTable(e,s){let o=await t.createTable(e,s);return h(o,A,u,n)},async createTableRows(e,s,o){let a=await t.createTableRows(e,s,o);return h(a,A,u,n)},async createTask(e,s){let o=await t.createTask(e,s);return h(o,A,u,n)},async createUser(e,s){let o=await t.createUser(e,s);return h(o,A,u,n)},async createWorkspace(e,s){let o=await t.createWorkspace(e,s);return h(o,A,u,n)},async createWorkspaceMember(e,s){let o=await t.createWorkspaceMember(e,s);return h(o,A,u,n)},async deleteBot(e,s){let o=await t.deleteBot(e,s);return h(o,A,u,n)},async deleteBotIssue(e,s,o){let a=await t.deleteBotIssue(e,s,o);return h(a,A,u,n)},async deleteConversation(e,s){let o=await t.deleteConversation(e,s);return h(o,A,u,n)},async deleteFile(e,s){let o=await t.deleteFile(e,s);return h(o,A,u,n)},async deleteIntegration(e,s){let o=await t.deleteIntegration(e,s);return h(o,A,u,n)},async deleteMessage(e,s){let o=await t.deleteMessage(e,s);return h(o,A,u,n)},async deletePersonalAccessToken(e,s){let o=await t.deletePersonalAccessToken(e,s);return h(o,A,u,n)},async deleteTable(e,s){let o=await t.deleteTable(e,s);return h(o,A,u,n)},async deleteTableRows(e,s,o){let a=await t.deleteTableRows(e,s,o);return h(a,A,u,n)},async deleteTask(e,s){let o=await t.deleteTask(e,s);return h(o,A,u,n)},async deleteUser(e,s){let o=await t.deleteUser(e,s);return h(o,A,u,n)},async deleteWorkspace(e,s){let o=await t.deleteWorkspace(e,s);return h(o,A,u,n)},async deleteWorkspaceMember(e,s){let o=await t.deleteWorkspaceMember(e,s);return h(o,A,u,n)},async downloadFile(e,s){let o=await t.downloadFile(e,s);return h(o,A,u,n)},async findTableRows(e,s,o){let a=await t.findTableRows(e,s,o);return h(a,A,u,n)},async getAccount(e){let s=await t.getAccount(e);return h(s,A,u,n)},async getAccountPreference(e,s){let o=await t.getAccountPreference(e,s);return h(o,A,u,n)},async getAllWorkspaceQuotaCompletion(e){let s=await t.getAllWorkspaceQuotaCompletion(e);return h(s,A,u,n)},async getAuditRecords(e,s,o){let a=await t.getAuditRecords(e,s,o);return h(a,A,u,n)},async getBot(e,s){let o=await t.getBot(e,s);return h(o,A,u,n)},async getBotAnalytics(e,s,o,a){let r=await t.getBotAnalytics(e,s,o,a);return h(r,A,u,n)},async getBotLogs(e,s,o,a,r){let i=await t.getBotLogs(e,s,o,a,r);return h(i,A,u,n)},async getBotWebchat(e,s,o){let a=await t.getBotWebchat(e,s,o);return h(a,A,u,n)},async getConversation(e,s){let o=await t.getConversation(e,s);return h(o,A,u,n)},async getEvent(e,s){let o=await t.getEvent(e,s);return h(o,A,u,n)},async getFile(e,s){let o=await t.getFile(e,s);return h(o,A,u,n)},async getIntegration(e,s){let o=await t.getIntegration(e,s);return h(o,A,u,n)},async getIntegrationByName(e,s,o){let a=await t.getIntegrationByName(e,s,o);return h(a,A,u,n)},async getIntegrationLogs(e,s,o,a,r){let i=await t.getIntegrationLogs(e,s,o,a,r);return h(i,A,u,n)},async getMessage(e,s){let o=await t.getMessage(e,s);return h(o,A,u,n)},async getOrCreateConversation(e,s){let o=await t.getOrCreateConversation(e,s);return h(o,A,u,n)},async getOrCreateMessage(e,s){let o=await t.getOrCreateMessage(e,s);return h(o,A,u,n)},async getOrCreateUser(e,s){let o=await t.getOrCreateUser(e,s);return h(o,A,u,n)},async getOrSetState(e,s,o,a,r){let i=await t.getOrSetState(e,s,o,a,r);return h(i,A,u,n)},async getParticipant(e,s,o){let a=await t.getParticipant(e,s,o);return h(a,A,u,n)},async getPublicIntegration(e,s,o){let a=await t.getPublicIntegration(e,s,o);return h(a,A,u,n)},async getPublicIntegrationById(e,s){let o=await t.getPublicIntegrationById(e,s);return h(o,A,u,n)},async getState(e,s,o,a){let r=await t.getState(e,s,o,a);return h(r,A,u,n)},async getTable(e,s){let o=await t.getTable(e,s);return h(o,A,u,n)},async getTableRow(e,s,o){let a=await t.getTableRow(e,s,o);return h(a,A,u,n)},async getTask(e,s){let o=await t.getTask(e,s);return h(o,A,u,n)},async getUsage(e,s,o,a){let r=await t.getUsage(e,s,o,a);return h(r,A,u,n)},async getUser(e,s){let o=await t.getUser(e,s);return h(o,A,u,n)},async getWorkspace(e,s){let o=await t.getWorkspace(e,s);return h(o,A,u,n)},async getWorkspaceBillingDetails(e,s){let o=await t.getWorkspaceBillingDetails(e,s);return h(o,A,u,n)},async getWorkspaceQuota(e,s,o,a){let r=await t.getWorkspaceQuota(e,s,o,a);return h(r,A,u,n)},async introspect(e,s){let o=await t.introspect(e,s);return h(o,A,u,n)},async listActivities(e,s,o,a){let r=await t.listActivities(e,s,o,a);return h(r,A,u,n)},async listBotIssueEvents(e,s,o){let a=await t.listBotIssueEvents(e,s,o);return h(a,A,u,n)},async listBotIssues(e,s,o){let a=await t.listBotIssues(e,s,o);return h(a,A,u,n)},async listBots(e,s,o){let a=await t.listBots(e,s,o);return h(a,A,u,n)},async listConversations(e,s,o,a){let r=await t.listConversations(e,s,o,a);return h(r,A,u,n)},async listEvents(e,s,o,a,r,i){let l=await t.listEvents(e,s,o,a,r,i);return h(l,A,u,n)},async listFiles(e,s,o){let a=await t.listFiles(e,s,o);return h(a,A,u,n)},async listIntegrations(e,s,o,a,r){let i=await t.listIntegrations(e,s,o,a,r);return h(i,A,u,n)},async listMessages(e,s,o,a){let r=await t.listMessages(e,s,o,a);return h(r,A,u,n)},async listParticipants(e,s,o){let a=await t.listParticipants(e,s,o);return h(a,A,u,n)},async listPersonalAccessTokens(e){let s=await t.listPersonalAccessTokens(e);return h(s,A,u,n)},async listPublicIntegrations(e,s,o,a){let r=await t.listPublicIntegrations(e,s,o,a);return h(r,A,u,n)},async listTables(e,s){let o=await t.listTables(e,s);return h(o,A,u,n)},async listTasks(e,s,o,a,r,i,l,c){let p=await t.listTasks(e,s,o,a,r,i,l,c);return h(p,A,u,n)},async listUsageHistory(e,s,o){let a=await t.listUsageHistory(e,s,o);return h(a,A,u,n)},async listUsers(e,s,o,a){let r=await t.listUsers(e,s,o,a);return h(r,A,u,n)},async listWorkspaceInvoices(e,s){let o=await t.listWorkspaceInvoices(e,s);return h(o,A,u,n)},async listWorkspaceMembers(e,s){let o=await t.listWorkspaceMembers(e,s);return h(o,A,u,n)},async listWorkspaceQuotas(e,s,o){let a=await t.listWorkspaceQuotas(e,s,o);return h(a,A,u,n)},async listWorkspaceUsages(e,s,o,a){let r=await t.listWorkspaceUsages(e,s,o,a);return h(r,A,u,n)},async listWorkspaces(e,s){let o=await t.listWorkspaces(e,s);return h(o,A,u,n)},async patchState(e,s,o,a,r){let i=await t.patchState(e,s,o,a,r);return h(i,A,u,n)},async removeParticipant(e,s,o){let a=await t.removeParticipant(e,s,o);return h(a,A,u,n)},async renameTableColumn(e,s,o){let a=await t.renameTableColumn(e,s,o);return h(a,A,u,n)},async runVrl(e,s){let o=await t.runVrl(e,s);return h(o,A,u,n)},async setAccountPreference(e,s,o){let a=await t.setAccountPreference(e,s,o);return h(a,A,u,n)},async setState(e,s,o,a,r){let i=await t.setState(e,s,o,a,r);return h(i,A,u,n)},async setWorkspacePaymentMethod(e,s,o){let a=await t.setWorkspacePaymentMethod(e,s,o);return h(a,A,u,n)},async transferBot(e,s,o){let a=await t.transferBot(e,s,o);return h(a,A,u,n)},async updateBot(e,s,o){let a=await t.updateBot(e,s,o);return h(a,A,u,n)},async updateConversation(e,s,o){let a=await t.updateConversation(e,s,o);return h(a,A,u,n)},async updateIntegration(e,s,o){let a=await t.updateIntegration(e,s,o);return h(a,A,u,n)},async updateMessage(e,s,o){let a=await t.updateMessage(e,s,o);return h(a,A,u,n)},async updateTable(e,s,o){let a=await t.updateTable(e,s,o);return h(a,A,u,n)},async updateTableRows(e,s,o){let a=await t.updateTableRows(e,s,o);return h(a,A,u,n)},async updateTask(e,s,o){let a=await t.updateTask(e,s,o);return h(a,A,u,n)},async updateUser(e,s,o){let a=await t.updateUser(e,s,o);return h(a,A,u,n)},async updateWorkspace(e,s,o){let a=await t.updateWorkspace(e,s,o);return h(a,A,u,n)},async updateWorkspaceMember(e,s,o){let a=await t.updateWorkspaceMember(e,s,o);return h(a,A,u,n)},async upsertTableRows(e,s,o){let a=await t.upsertTableRows(e,s,o);return h(a,A,u,n)}}};var I=class extends T{addParticipant(t,e){return R(this.configuration).addParticipant(t.id,t.addParticipantBody,e).then(s=>s(this.axios,this.basePath))}breakDownWorkspaceUsageByBot(t,e){return R(this.configuration).breakDownWorkspaceUsageByBot(t.id,t.type,t.period,e).then(s=>s(this.axios,this.basePath))}callAction(t={},e){return R(this.configuration).callAction(t.callActionBody,e).then(s=>s(this.axios,this.basePath))}changeAISpendQuota(t={},e){return R(this.configuration).changeAISpendQuota(t.changeAISpendQuotaBody,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))}chargeWorkspaceUnpaidInvoices(t,e){return R(this.configuration).chargeWorkspaceUnpaidInvoices(t.id,t.chargeWorkspaceUnpaidInvoicesBody,e).then(s=>s(this.axios,this.basePath))}checkHandleAvailability(t={},e){return R(this.configuration).checkHandleAvailability(t.checkHandleAvailabilityBody,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))}createPersonalAccessToken(t={},e){return R(this.configuration).createPersonalAccessToken(t.createPersonalAccessTokenBody,e).then(s=>s(this.axios,this.basePath))}createTable(t={},e){return R(this.configuration).createTable(t.createTableBody,e).then(s=>s(this.axios,this.basePath))}createTableRows(t,e){return R(this.configuration).createTableRows(t.table,t.createTableRowsBody,e).then(s=>s(this.axios,this.basePath))}createTask(t={},e){return R(this.configuration).createTask(t.createTaskBody,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))}deleteBotIssue(t,e){return R(this.configuration).deleteBotIssue(t.id,t.issueId,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))}deletePersonalAccessToken(t,e){return R(this.configuration).deletePersonalAccessToken(t.id,e).then(s=>s(this.axios,this.basePath))}deleteTable(t,e){return R(this.configuration).deleteTable(t.table,e).then(s=>s(this.axios,this.basePath))}deleteTableRows(t,e){return R(this.configuration).deleteTableRows(t.table,t.deleteTableRowsBody,e).then(s=>s(this.axios,this.basePath))}deleteTask(t,e){return R(this.configuration).deleteTask(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))}findTableRows(t,e){return R(this.configuration).findTableRows(t.table,t.findTableRowsBody,e).then(s=>s(this.axios,this.basePath))}getAccount(t){return R(this.configuration).getAccount(t).then(e=>e(this.axios,this.basePath))}getAccountPreference(t,e){return R(this.configuration).getAccountPreference(t.key,e).then(s=>s(this.axios,this.basePath))}getAllWorkspaceQuotaCompletion(t){return R(this.configuration).getAllWorkspaceQuotaCompletion(t).then(e=>e(this.axios,this.basePath))}getAuditRecords(t,e){return R(this.configuration).getAuditRecords(t.id,t.nextToken,e).then(s=>s(this.axios,this.basePath))}getBot(t,e){return R(this.configuration).getBot(t.id,e).then(s=>s(this.axios,this.basePath))}getBotAnalytics(t,e){return R(this.configuration).getBotAnalytics(t.id,t.startDate,t.endDate,e).then(s=>s(this.axios,this.basePath))}getBotLogs(t,e){return R(this.configuration).getBotLogs(t.id,t.timeStart,t.timeEnd,t.nextToken,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,t.timeStart,t.timeEnd,t.nextToken,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))}getOrSetState(t,e){return R(this.configuration).getOrSetState(t.type,t.id,t.name,t.getOrSetStateBody,e).then(s=>s(this.axios,this.basePath))}getParticipant(t,e){return R(this.configuration).getParticipant(t.id,t.userId,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))}getTable(t,e){return R(this.configuration).getTable(t.table,e).then(s=>s(this.axios,this.basePath))}getTableRow(t,e){return R(this.configuration).getTableRow(t.table,t.id,e).then(s=>s(this.axios,this.basePath))}getTask(t,e){return R(this.configuration).getTask(t.id,e).then(s=>s(this.axios,this.basePath))}getUsage(t,e){return R(this.configuration).getUsage(t.type,t.id,t.period,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))}getWorkspaceBillingDetails(t,e){return R(this.configuration).getWorkspaceBillingDetails(t.id,e).then(s=>s(this.axios,this.basePath))}getWorkspaceQuota(t,e){return R(this.configuration).getWorkspaceQuota(t.id,t.type,t.period,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))}listActivities(t,e){return R(this.configuration).listActivities(t.taskId,t.botId,t.nextToken,e).then(s=>s(this.axios,this.basePath))}listBotIssueEvents(t,e){return R(this.configuration).listBotIssueEvents(t.id,t.issueId,e).then(s=>s(this.axios,this.basePath))}listBotIssues(t,e){return R(this.configuration).listBotIssues(t.id,t.nextToken,e).then(s=>s(this.axios,this.basePath))}listBots(t={},e){return R(this.configuration).listBots(t.dev,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,t.conversationId,t.userId,t.messageId,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,t.dev,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))}listParticipants(t,e){return R(this.configuration).listParticipants(t.id,t.nextToken,e).then(s=>s(this.axios,this.basePath))}listPersonalAccessTokens(t){return R(this.configuration).listPersonalAccessTokens(t).then(e=>e(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))}listTables(t={},e){return R(this.configuration).listTables(t.tags,e).then(s=>s(this.axios,this.basePath))}listTasks(t={},e){return R(this.configuration).listTasks(t.nextToken,t.tags,t.conversationId,t.userId,t.parentTaskId,t.status,t.type,e).then(s=>s(this.axios,this.basePath))}listUsageHistory(t,e){return R(this.configuration).listUsageHistory(t.type,t.id,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))}listWorkspaceInvoices(t,e){return R(this.configuration).listWorkspaceInvoices(t.id,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))}listWorkspaceQuotas(t,e){return R(this.configuration).listWorkspaceQuotas(t.id,t.period,e).then(s=>s(this.axios,this.basePath))}listWorkspaceUsages(t,e){return R(this.configuration).listWorkspaceUsages(t.id,t.type,t.period,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))}removeParticipant(t,e){return R(this.configuration).removeParticipant(t.id,t.userId,e).then(s=>s(this.axios,this.basePath))}renameTableColumn(t,e){return R(this.configuration).renameTableColumn(t.table,t.renameTableColumnBody,e).then(s=>s(this.axios,this.basePath))}runVrl(t={},e){return R(this.configuration).runVrl(t.runVrlBody,e).then(s=>s(this.axios,this.basePath))}setAccountPreference(t,e){return R(this.configuration).setAccountPreference(t.key,t.setAccountPreferenceBody,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))}setWorkspacePaymentMethod(t,e){return R(this.configuration).setWorkspacePaymentMethod(t.id,t.setWorkspacePaymentMethodBody,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))}updateTable(t,e){return R(this.configuration).updateTable(t.table,t.updateTableBody,e).then(s=>s(this.axios,this.basePath))}updateTableRows(t,e){return R(this.configuration).updateTableRows(t.table,t.updateTableRowsBody,e).then(s=>s(this.axios,this.basePath))}updateTask(t,e){return R(this.configuration).updateTask(t.id,t.updateTaskBody,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))}upsertTableRows(t,e){return R(this.configuration).upsertTableRows(t.table,t.upsertTableRowsBody,e).then(s=>s(this.axios,this.basePath))}};import me from"crypto";var fe={getRandomValues:n=>new Uint8Array(n.map(()=>Math.floor(Math.random()*256)))},D=typeof window<"u"&&typeof window.document<"u"?window.crypto:me;D.getRandomValues||(D=fe);var C=class extends Error{constructor(e,s,o,a,r,i){super(a);this.code=e;this.description=s;this.type=o;this.message=a;this.error=r;this.id=i;this.id||(this.id=C.generateId())}isApiError=!0;format(){return`[${this.type}] ${this.message} (Error ID: ${this.id})`}toJSON(){return{id:this.id,code:this.code,type:this.type,message:this.message}}static generateId(){let e=this.getPrefix(),s=new Date().toISOString().replace(/[\-:TZ]/g,"").split(".")[0],o=4,a=Array.from(D.getRandomValues(new Uint8Array(o))).map(r=>r.toString(16).padStart(2,"0")).join("").toUpperCase();return`${e}_${s}x${a}`}static getPrefix(){return typeof window<"u"&&typeof window.document<"u"?"err_bwsr":"err"}},be=n=>typeof n=="object"&&!Array.isArray(n)&&n!==null,xe=n=>n instanceof C||be(n)&&n.isApiError===!0,k=class extends C{constructor(t,e,s){super(500,"An unknown error occurred","Unknown",t,e,s)}},w=class extends C{constructor(t,e,s){super(500,"An internal error occurred","Internal",t,e,s)}},O=class extends C{constructor(t,e,s){super(401,"The request requires to be authenticated.","Unauthorized",t,e,s)}},E=class extends C{constructor(t,e,s){super(403,"The requested action can't be peform by this resource.","Forbidden",t,e,s)}},W=class extends C{constructor(t,e,s){super(413,"The request payload is too large.","PayloadTooLarge",t,e,s)}},S=class extends C{constructor(t,e,s){super(400,"The request payload is invalid.","InvalidPayload",t,e,s)}},M=class extends C{constructor(t,e,s){super(415,"The request is invalid because the content-type is not supported.","UnsupportedMediaType",t,e,s)}},L=class extends C{constructor(t,e,s){super(405,"The requested method does not exist.","MethodNotFound",t,e,s)}},G=class extends C{constructor(t,e,s){super(404,"The requested resource does not exist.","ResourceNotFound",t,e,s)}},_=class extends C{constructor(t,e,s){super(400,"The provided JSON schema is invalid.","InvalidJsonSchema",t,e,s)}},F=class extends C{constructor(t,e,s){super(400,"The provided data doesn't respect the provided JSON schema.","InvalidDataFormat",t,e,s)}},Q=class extends C{constructor(t,e,s){super(400,"The provided identifier is not valid. An identifier must start with a lowercase letter, be between 2 and 100 characters long and use only alphanumeric characters.","InvalidIdentifier",t,e,s)}},j=class extends C{constructor(t,e,s){super(409,"The resource is related with a different resource that the one referenced in the request. This is usually caused when providing two resource identifiers that aren't linked together.","RelationConflict",t,e,s)}},H=class extends C{constructor(t,e,s){super(409,"The resource cannot be deleted because it's referenced by another resource","ReferenceConstraint",t,e,s)}},N=class extends C{constructor(t,e,s){super(400,"The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request.","ReferenceNotFound",t,e,s)}},$=class extends C{constructor(t,e,s){super(400,"The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource.","InvalidQuery",t,e,s)}},K=class extends C{constructor(t,e,s){super(400,"An error happened during the execution of a runtime (bot or integration).","Runtime",t,e,s)}},J=class extends C{constructor(t,e,s){super(409,"The record attempted to be created already exists.","AlreadyExists",t,e,s)}},z=class extends C{constructor(t,e,s){super(429,"The request has been rate limited.","RateLimited",t,e,s)}},Y=class extends C{constructor(t,e,s){super(402,"A payment is required to perform this request.","PaymentRequired",t,e,s)}},Z=class extends C{constructor(t,e,s){super(403,"The request exceeds the allowed quota. Quotas are a soft limit that can be increased.","QuotaExceeded",t,e,s)}},X=class extends C{constructor(t,e,s){super(413,"The request exceeds the allowed limit. Limits are a hard limit that cannot be increased.","LimitExceeded",t,e,s)}},Ce={Unknown:k,Internal:w,Unauthorized:O,Forbidden:E,PayloadTooLarge:W,InvalidPayload:S,UnsupportedMediaType:M,MethodNotFound:L,ResourceNotFound:G,InvalidJsonSchema:_,InvalidDataFormat:F,InvalidIdentifier:Q,RelationConflict:j,ReferenceConstraint:H,ReferenceNotFound:N,InvalidQuery:$,Runtime:K,AlreadyExists:J,RateLimited:z,PaymentRequired:Y,QuotaExceeded:Z,LimitExceeded:X},ee=n=>xe(n)?n:n instanceof Error?new k(n.message,n):typeof n=="string"?new k(n):Pe(n);function Pe(n){if(typeof n=="object"&&"code"in n&&"type"in n&&"id"in n&&"message"in n&&typeof n.type=="string"&&typeof n.message=="string"){let t=Ce[n.type];return t?new t(n.message,void 0,n.id||"UNKNOWN"):new k(`An unclassified API error occurred: ${n.message} (Type: ${n.type}, Code: ${n.code})`)}return new k("An invalid error occurred: "+JSON.stringify(n))}var U=class{_innerClient;constructor(t,e,s){this._innerClient=new I(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)});listParticipants=t=>this._innerClient.listParticipants(t).then(e=>e.data).catch(e=>{throw m(e)});addParticipant=({id:t,...e})=>this._innerClient.addParticipant({id:t,addParticipantBody:e}).then(s=>s.data).catch(s=>{throw m(s)});getParticipant=t=>this._innerClient.getParticipant(t).then(e=>e.data).catch(e=>{throw m(e)});removeParticipant=t=>this._innerClient.removeParticipant(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(a=>a.data).catch(a=>{throw m(a)});getOrSetState=({type:t,id:e,name:s,...o})=>this._innerClient.getOrSetState({type:t,id:e,name:s,getOrSetStateBody:o}).then(a=>a.data).catch(a=>{throw m(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 m(a)});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)});getTask=t=>this._innerClient.getTask(t).then(e=>e.data).catch(e=>{throw m(e)});createTask=t=>this._innerClient.createTask({createTaskBody:t}).then(e=>e.data).catch(e=>{throw m(e)});updateTask=({id:t,...e})=>this._innerClient.updateTask({id:t,updateTaskBody:e}).then(s=>s.data).catch(s=>{throw m(s)});deleteTask=t=>this._innerClient.deleteTask(t).then(e=>e.data).catch(e=>{throw m(e)});listTasks=t=>this._innerClient.listTasks(t).then(e=>e.data).catch(e=>{throw m(e)});runVrl=t=>this._innerClient.runVrl({runVrlBody:t}).then(e=>e.data).catch(e=>{throw m(e)});getAccount=()=>this._innerClient.getAccount().then(t=>t.data).catch(t=>{throw m(t)});listPersonalAccessTokens=()=>this._innerClient.listPersonalAccessTokens().then(t=>t.data).catch(t=>{throw m(t)});createPersonalAccessToken=t=>this._innerClient.createPersonalAccessToken({createPersonalAccessTokenBody:t}).then(e=>e.data).catch(e=>{throw m(e)});deletePersonalAccessToken=t=>this._innerClient.deletePersonalAccessToken(t).then(e=>e.data).catch(e=>{throw m(e)});setAccountPreference=({key:t,...e})=>this._innerClient.setAccountPreference({key:t,setAccountPreferenceBody:e}).then(s=>s.data).catch(s=>{throw m(s)});getAccountPreference=t=>this._innerClient.getAccountPreference(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)});listBotIssues=t=>this._innerClient.listBotIssues(t).then(e=>e.data).catch(e=>{throw m(e)});deleteBotIssue=t=>this._innerClient.deleteBotIssue(t).then(e=>e.data).catch(e=>{throw m(e)});listBotIssueEvents=t=>this._innerClient.listBotIssueEvents(t).then(e=>e.data).catch(e=>{throw m(e)});getWorkspaceBillingDetails=t=>this._innerClient.getWorkspaceBillingDetails(t).then(e=>e.data).catch(e=>{throw m(e)});setWorkspacePaymentMethod=({id:t,...e})=>this._innerClient.setWorkspacePaymentMethod({id:t,setWorkspacePaymentMethodBody:e}).then(s=>s.data).catch(s=>{throw m(s)});listWorkspaceInvoices=t=>this._innerClient.listWorkspaceInvoices(t).then(e=>e.data).catch(e=>{throw m(e)});chargeWorkspaceUnpaidInvoices=({id:t,...e})=>this._innerClient.chargeWorkspaceUnpaidInvoices({id:t,chargeWorkspaceUnpaidInvoicesBody:e}).then(s=>s.data).catch(s=>{throw m(s)});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)});listWorkspaceUsages=t=>this._innerClient.listWorkspaceUsages(t).then(e=>e.data).catch(e=>{throw m(e)});breakDownWorkspaceUsageByBot=t=>this._innerClient.breakDownWorkspaceUsageByBot(t).then(e=>e.data).catch(e=>{throw m(e)});getAllWorkspaceQuotaCompletion=()=>this._innerClient.getAllWorkspaceQuotaCompletion().then(t=>t.data).catch(t=>{throw m(t)});getWorkspaceQuota=t=>this._innerClient.getWorkspaceQuota(t).then(e=>e.data).catch(e=>{throw m(e)});listWorkspaceQuotas=t=>this._innerClient.listWorkspaceQuotas(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)});checkHandleAvailability=t=>this._innerClient.checkHandleAvailability({checkHandleAvailabilityBody:t}).then(e=>e.data).catch(e=>{throw m(e)});listWorkspaces=t=>this._innerClient.listWorkspaces(t).then(e=>e.data).catch(e=>{throw m(e)});changeWorkspacePlan=({id:t,...e})=>this._innerClient.changeWorkspacePlan({id:t,changeWorkspacePlanBody:e}).then(s=>s.data).catch(s=>{throw m(s)});deleteWorkspace=t=>this._innerClient.deleteWorkspace(t).then(e=>e.data).catch(e=>{throw m(e)});getAuditRecords=t=>this._innerClient.getAuditRecords(t).then(e=>e.data).catch(e=>{throw m(e)});listWorkspaceMembers=t=>this._innerClient.listWorkspaceMembers(t).then(e=>e.data).catch(e=>{throw m(e)});deleteWorkspaceMember=t=>this._innerClient.deleteWorkspaceMember(t).then(e=>e.data).catch(e=>{throw m(e)});createWorkspaceMember=t=>this._innerClient.createWorkspaceMember({createWorkspaceMemberBody:t}).then(e=>e.data).catch(e=>{throw m(e)});updateWorkspaceMember=({id:t,...e})=>this._innerClient.updateWorkspaceMember({id:t,updateWorkspaceMemberBody:e}).then(s=>s.data).catch(s=>{throw m(s)});createIntegration=t=>this._innerClient.createIntegration({createIntegrationBody:t}).then(e=>e.data).catch(e=>{throw m(e)});updateIntegration=({id:t,...e})=>this._innerClient.updateIntegration({id:t,updateIntegrationBody:e}).then(s=>s.data).catch(s=>{throw m(s)});listIntegrations=t=>this._innerClient.listIntegrations(t).then(e=>e.data).catch(e=>{throw m(e)});getIntegration=t=>this._innerClient.getIntegration(t).then(e=>e.data).catch(e=>{throw m(e)});getIntegrationLogs=t=>this._innerClient.getIntegrationLogs(t).then(e=>e.data).catch(e=>{throw m(e)});getIntegrationByName=t=>this._innerClient.getIntegrationByName(t).then(e=>e.data).catch(e=>{throw m(e)});deleteIntegration=t=>this._innerClient.deleteIntegration(t).then(e=>e.data).catch(e=>{throw m(e)});getUsage=t=>this._innerClient.getUsage(t).then(e=>e.data).catch(e=>{throw m(e)});listUsageHistory=t=>this._innerClient.listUsageHistory(t).then(e=>e.data).catch(e=>{throw m(e)});changeAISpendQuota=t=>this._innerClient.changeAISpendQuota({changeAISpendQuotaBody:t}).then(e=>e.data).catch(e=>{throw m(e)});listActivities=t=>this._innerClient.listActivities(t).then(e=>e.data).catch(e=>{throw m(e)});introspect=t=>this._innerClient.introspect({introspectBody:t}).then(e=>e.data).catch(e=>{throw m(e)});createFile=t=>this._innerClient.createFile({createFileBody:t}).then(e=>e.data).catch(e=>{throw m(e)});getFile=t=>this._innerClient.getFile(t).then(e=>e.data).catch(e=>{throw m(e)});downloadFile=t=>this._innerClient.downloadFile(t).then(e=>e.data).catch(e=>{throw m(e)});deleteFile=t=>this._innerClient.deleteFile(t).then(e=>e.data).catch(e=>{throw m(e)});listFiles=t=>this._innerClient.listFiles(t).then(e=>e.data).catch(e=>{throw m(e)});listTables=t=>this._innerClient.listTables(t).then(e=>e.data).catch(e=>{throw m(e)});getTable=t=>this._innerClient.getTable(t).then(e=>e.data).catch(e=>{throw m(e)});createTable=t=>this._innerClient.createTable({createTableBody:t}).then(e=>e.data).catch(e=>{throw m(e)});updateTable=({table:t,...e})=>this._innerClient.updateTable({table:t,updateTableBody:e}).then(s=>s.data).catch(s=>{throw m(s)});renameTableColumn=({table:t,...e})=>this._innerClient.renameTableColumn({table:t,renameTableColumnBody:e}).then(s=>s.data).catch(s=>{throw m(s)});deleteTable=t=>this._innerClient.deleteTable(t).then(e=>e.data).catch(e=>{throw m(e)});getTableRow=t=>this._innerClient.getTableRow(t).then(e=>e.data).catch(e=>{throw m(e)});findTableRows=({table:t,...e})=>this._innerClient.findTableRows({table:t,findTableRowsBody:e}).then(s=>s.data).catch(s=>{throw m(s)});createTableRows=({table:t,...e})=>this._innerClient.createTableRows({table:t,createTableRowsBody:e}).then(s=>s.data).catch(s=>{throw m(s)});deleteTableRows=({table:t,...e})=>this._innerClient.deleteTableRows({table:t,deleteTableRowsBody:e}).then(s=>s.data).catch(s=>{throw m(s)});updateTableRows=({table:t,...e})=>this._innerClient.updateTableRows({table:t,updateTableRowsBody:e}).then(s=>s.data).catch(s=>{throw m(s)});upsertTableRows=({table:t,...e})=>this._innerClient.upsertTableRows({table:t,upsertTableRowsBody:e}).then(s=>s.data).catch(s=>{throw m(s)})};function m(n){return Be.isAxiosError(n)&&n.response?.data?ee(n.response.data):ee(n)}import*as ra from"axios";var oe=100*1024*1024,Te=oe,qe=oe,ae=class extends U{config;constructor(t={}){let e=se(t),{apiUrl:s,headers:o,withCredentials:a,timeout:r}=e,i=ke.create({headers:o,withCredentials:a,timeout:r,maxBodyLength:Te,maxContentLength:qe});super(void 0,s,i),this.config=e}};export{J as AlreadyExistsError,ae as Client,E as ForbiddenError,w as InternalError,F as InvalidDataFormatError,Q as InvalidIdentifierError,_ as InvalidJsonSchemaError,S as InvalidPayloadError,$ as InvalidQueryError,X as LimitExceededError,L as MethodNotFoundError,W as PayloadTooLargeError,Y as PaymentRequiredError,Z as QuotaExceededError,z as RateLimitedError,H as ReferenceConstraintError,N as ReferenceNotFoundError,j as RelationConflictError,G as ResourceNotFoundError,K as RuntimeError,O as UnauthorizedError,k as UnknownError,M as UnsupportedMediaTypeError,ra as axios,ee as errorFrom,xe as isApiError};
1
+ var he=Object.create;var te=Object.defineProperty;var Ae=Object.getOwnPropertyDescriptor;var Re=Object.getOwnPropertyNames;var me=Object.getPrototypeOf,fe=Object.prototype.hasOwnProperty;var se=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var xe=(n,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Re(t))!fe.call(n,o)&&o!==e&&te(n,o,{get:()=>t[o],enumerable:!(s=Ae(t,o))||s.enumerable});return n};var ae=(n,t,e)=>(e=n!=null?he(me(n)):{},xe(t||!n||!n.__esModule?te(e,"default",{value:n,enumerable:!0}):e,n));var oe=se(()=>{});var re=se(()=>{});var ue=ae(oe()),de=ae(re());import Le from"axios";import{isBrowser as ne,isNode as be}from"browser-or-node";var Ce="https://api.botpress.cloud",Pe=6e4,ke="BP_API_URL",Be="BP_BOT_ID",Te="BP_INTEGRATION_ID",qe="BP_WORKSPACE_ID",Ie="BP_TOKEN";function ie(n){let t=Ue(n),e={};t.workspaceId&&(e["x-workspace-id"]=t.workspaceId),t.botId&&(e["x-bot-id"]=t.botId),t.integrationId&&(e["x-integration-id"]=t.integrationId),t.token&&(e.Authorization=`Bearer ${t.token}`),e={...e,...t.headers};let s=t.apiUrl??Ce,o=t.timeout??Pe;return{apiUrl:s,timeout:o,withCredentials:ne,headers:e}}function Ue(n){return ne?n:be?Ve(n):n}function Ve(n){let t={...n,apiUrl:n.apiUrl??process.env[ke],botId:n.botId??process.env[Be],integrationId:n.integrationId??process.env[Te],workspaceId:n.workspaceId??process.env[qe]},e=t.token??process.env[Ie];return e&&(t.token=e),t}import Me from"axios";import A from"axios";import ve from"axios";var u="https://api.botpress.cloud".replace(/\/+$/,"");var T=class{constructor(t,e=u,s=ve){this.basePath=e;this.axios=s;t&&(this.configuration=t,this.basePath=t.basePath||this.basePath)}configuration},q=class extends Error{constructor(e,s){super(s);this.field=e;this.name="RequiredError"}};var d="https://example.com",f=function(n,t,e){if(e==null)throw new q(t,`Required parameter ${t} was null or undefined when calling ${n}.`)};function v(n,t,e=""){t!=null&&(typeof t=="object"?Array.isArray(t)?t.forEach(s=>v(n,s,e)):Object.keys(t).forEach(s=>v(n,t[s],`${e}${e!==""?".":""}${s}`)):n.has(e)?n.append(e,t):n.set(e,t))}var g=function(n,...t){let e=new URLSearchParams(n.search);v(e,t),n.search=e.toString()},b=function(n,t,e){let s=typeof n!="string";return(s&&e&&e.isJsonMime?e.isJsonMime(t.headers["Content-Type"]):s)?JSON.stringify(n!==void 0?n:{}):n||""},y=function(n){return n.pathname+n.search+n.hash},h=function(n,t,e,s){return(o=t,a=e)=>{let r={...n.options,url:(s?.basePath||a)+n.url};return o.request(r)}};var De=function(n){return{addParticipant:async(t,e,s={})=>{f("addParticipant","id",t);let o="/v1/chat/conversations/{id}/participants".replace("{id}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"POST",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=b(e,i,n),{url:y(a),options:i}},breakDownWorkspaceUsageByBot:async(t,e,s,o={})=>{f("breakDownWorkspaceUsageByBot","id",t),f("breakDownWorkspaceUsageByBot","type",e);let a="/v1/admin/workspaces/{id}/usages/by-bot".replace("{id}",encodeURIComponent(String(t))),r=new URL(a,d),i;n&&(i=n.baseOptions);let l={method:"GET",...i,...o},c={},p={};e!==void 0&&(p.type=e),s!==void 0&&(p.period=s),g(r,p);let x=i&&i.headers?i.headers:{};return l.headers={...c,...x,...o.headers},{url:y(r),options:l}},callAction:async(t,e={})=>{let s="/v1/chat/actions",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=b(t,r,n),{url:y(o),options:r}},changeAISpendQuota:async(t,e={})=>{let s="/v1/admin/quotas/ai-spend",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"PUT",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=b(t,r,n),{url:y(o),options:r}},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),r;n&&(r=n.baseOptions);let i={method:"PUT",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=b(e,i,n),{url:y(a),options:i}},chargeWorkspaceUnpaidInvoices:async(t,e,s={})=>{f("chargeWorkspaceUnpaidInvoices","id",t);let o="/v1/admin/workspaces/{id}/billing/invoices/charge-unpaid".replace("{id}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"POST",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=b(e,i,n),{url:y(a),options:i}},checkHandleAvailability:async(t,e={})=>{let s="/v1/admin/workspaces/handle-availability",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"PUT",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=b(t,r,n),{url:y(o),options:r}},configureIntegration:async(t,e={})=>{let s="/v1/chat/integrations/configure",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=b(t,r,n),{url:y(o),options:r}},createBot:async(t,e={})=>{let s="/v1/admin/bots",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=b(t,r,n),{url:y(o),options:r}},createConversation:async(t,e={})=>{let s="/v1/chat/conversations",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=b(t,r,n),{url:y(o),options:r}},createEvent:async(t,e={})=>{let s="/v1/chat/events",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=b(t,r,n),{url:y(o),options:r}},createFile:async(t,e={})=>{let s="/v1/storage/files",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=b(t,r,n),{url:y(o),options:r}},createIntegration:async(t,e={})=>{let s="/v1/admin/integrations",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=b(t,r,n),{url:y(o),options:r}},createMessage:async(t,e={})=>{let s="/v1/chat/messages",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=b(t,r,n),{url:y(o),options:r}},createPersonalAccessToken:async(t,e={})=>{let s="/v1/admin/account/pats",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=b(t,r,n),{url:y(o),options:r}},createTable:async(t,e={})=>{let s="/v1/tables",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=b(t,r,n),{url:y(o),options:r}},createTableRows:async(t,e,s={})=>{f("createTableRows","table",t);let o="/v1/tables/{table}/rows".replace("{table}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"POST",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=b(e,i,n),{url:y(a),options:i}},createTask:async(t,e={})=>{let s="/v1/chat/tasks",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=b(t,r,n),{url:y(o),options:r}},createUser:async(t,e={})=>{let s="/v1/chat/users",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=b(t,r,n),{url:y(o),options:r}},createWorkspace:async(t,e={})=>{let s="/v1/admin/workspaces",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=b(t,r,n),{url:y(o),options:r}},createWorkspaceMember:async(t,e={})=>{let s="/v1/admin/workspace-members",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=b(t,r,n),{url:y(o),options:r}},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;n&&(a=n.baseOptions);let r={method:"DELETE",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},deleteBotIssue:async(t,e,s={})=>{f("deleteBotIssue","id",t),f("deleteBotIssue","issueId",e);let o="/v1/admin/bots/{id}/issues/{issueId}".replace("{id}",encodeURIComponent(String(t))).replace("{issueId}",encodeURIComponent(String(e))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"DELETE",...r,...s},l={};g(a,{});let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},{url:y(a),options:i}},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;n&&(a=n.baseOptions);let r={method:"DELETE",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},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;n&&(a=n.baseOptions);let r={method:"DELETE",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},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;n&&(a=n.baseOptions);let r={method:"DELETE",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},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;n&&(a=n.baseOptions);let r={method:"DELETE",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},deletePersonalAccessToken:async(t,e={})=>{f("deletePersonalAccessToken","id",t);let s="/v1/admin/account/pats/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"DELETE",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},deleteTable:async(t,e={})=>{f("deleteTable","table",t);let s="/v1/tables/{table}".replace("{table}",encodeURIComponent(String(t))),o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"DELETE",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},deleteTableRows:async(t,e,s={})=>{f("deleteTableRows","table",t);let o="/v1/tables/{table}/rows/delete".replace("{table}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"POST",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=b(e,i,n),{url:y(a),options:i}},deleteTask:async(t,e={})=>{f("deleteTask","id",t);let s="/v1/chat/tasks/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"DELETE",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},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;n&&(a=n.baseOptions);let r={method:"DELETE",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},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;n&&(a=n.baseOptions);let r={method:"DELETE",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},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;n&&(a=n.baseOptions);let r={method:"DELETE",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},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;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},findTableRows:async(t,e,s={})=>{f("findTableRows","table",t);let o="/v1/tables/{table}/rows/find".replace("{table}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"POST",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=b(e,i,n),{url:y(a),options:i}},getAccount:async(t={})=>{let e="/v1/admin/account/me",s=new URL(e,d),o;n&&(o=n.baseOptions);let a={method:"GET",...o,...t},r={};g(s,{});let l=o&&o.headers?o.headers:{};return a.headers={...r,...l,...t.headers},{url:y(s),options:a}},getAccountPreference:async(t,e={})=>{f("getAccountPreference","key",t);let s="/v1/admin/account/preferences/{key}".replace("{key}",encodeURIComponent(String(t))),o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},getAllWorkspaceQuotaCompletion:async(t={})=>{let e="/v1/admin/workspaces/usages/quota-completion",s=new URL(e,d),o;n&&(o=n.baseOptions);let a={method:"GET",...o,...t},r={};g(s,{});let l=o&&o.headers?o.headers:{};return a.headers={...r,...l,...t.headers},{url:y(s),options:a}},getAuditRecords:async(t,e,s={})=>{f("getAuditRecords","id",t);let o="/v1/admin/workspaces/{id}/audit-records".replace("{id}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"GET",...r,...s},l={},c={};e!==void 0&&(c.nextToken=e),g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},{url:y(a),options:i}},getBot:async(t,e={})=>{f("getBot","id",t);let s="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},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))),r=new URL(a,d),i;n&&(i=n.baseOptions);let l={method:"GET",...i,...o},c={},p={};e!==void 0&&(p.startDate=e),s!==void 0&&(p.endDate=s),g(r,p);let x=i&&i.headers?i.headers:{};return l.headers={...c,...x,...o.headers},{url:y(r),options:l}},getBotLogs:async(t,e,s,o,a={})=>{f("getBotLogs","id",t),f("getBotLogs","timeStart",e),f("getBotLogs","timeEnd",s);let r="/v1/admin/bots/{id}/logs".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,d),l;n&&(l=n.baseOptions);let c={method:"GET",...l,...a},p={},x={};e!==void 0&&(x.timeStart=e),s!==void 0&&(x.timeEnd=s),o!==void 0&&(x.nextToken=o),g(i,x);let P=l&&l.headers?l.headers:{};return c.headers={...p,...P,...a.headers},{url:y(i),options:c}},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),r;n&&(r=n.baseOptions);let i={method:"GET",...r,...s},l={},c={};e!==void 0&&(c.type=e),g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...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;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},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;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},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;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},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;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},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),r;n&&(r=n.baseOptions);let i={method:"GET",...r,...s},l={};g(a,{});let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},{url:y(a),options:i}},getIntegrationLogs:async(t,e,s,o,a={})=>{f("getIntegrationLogs","id",t),f("getIntegrationLogs","timeStart",e),f("getIntegrationLogs","timeEnd",s);let r="/v1/admin/integrations/{id}/logs".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,d),l;n&&(l=n.baseOptions);let c={method:"GET",...l,...a},p={},x={};e!==void 0&&(x.timeStart=e),s!==void 0&&(x.timeEnd=s),o!==void 0&&(x.nextToken=o),g(i,x);let P=l&&l.headers?l.headers:{};return c.headers={...p,...P,...a.headers},{url:y(i),options:c}},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;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},getOrCreateConversation:async(t,e={})=>{let s="/v1/chat/conversations/get-or-create",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=b(t,r,n),{url:y(o),options:r}},getOrCreateMessage:async(t,e={})=>{let s="/v1/chat/messages/get-or-create",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=b(t,r,n),{url:y(o),options:r}},getOrCreateUser:async(t,e={})=>{let s="/v1/chat/users/get-or-create",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=b(t,r,n),{url:y(o),options:r}},getOrSetState:async(t,e,s,o,a={})=>{f("getOrSetState","type",t),f("getOrSetState","id",e),f("getOrSetState","name",s);let r="/v1/chat/states/{type}/{id}/{name}/get-or-set".replace("{type}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(e))).replace("{name}",encodeURIComponent(String(s))),i=new URL(r,d),l;n&&(l=n.baseOptions);let c={method:"POST",...l,...a},p={},x={};p["Content-Type"]="application/json",g(i,x);let P=l&&l.headers?l.headers:{};return c.headers={...p,...P,...a.headers},c.data=b(o,c,n),{url:y(i),options:c}},getParticipant:async(t,e,s={})=>{f("getParticipant","id",t),f("getParticipant","userId",e);let o="/v1/chat/conversations/{id}/participants/{userId}".replace("{id}",encodeURIComponent(String(t))).replace("{userId}",encodeURIComponent(String(e))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"GET",...r,...s},l={};g(a,{});let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},{url:y(a),options:i}},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),r;n&&(r=n.baseOptions);let i={method:"GET",...r,...s},l={};g(a,{});let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...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;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},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))),r=new URL(a,d),i;n&&(i=n.baseOptions);let l={method:"GET",...i,...o},c={};g(r,{});let x=i&&i.headers?i.headers:{};return l.headers={...c,...x,...o.headers},{url:y(r),options:l}},getTable:async(t,e={})=>{f("getTable","table",t);let s="/v1/tables/{table}".replace("{table}",encodeURIComponent(String(t))),o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},getTableRow:async(t,e,s={})=>{f("getTableRow","table",t),f("getTableRow","id",e);let o="/v1/tables/{table}/row".replace("{table}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"GET",...r,...s},l={},c={};e!==void 0&&(c.id=e),g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},{url:y(a),options:i}},getTask:async(t,e={})=>{f("getTask","id",t);let s="/v1/chat/tasks/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},getUsage:async(t,e,s,o={})=>{f("getUsage","type",t),f("getUsage","id",e);let a="/v1/admin/usages/{id}".replace("{id}",encodeURIComponent(String(e))),r=new URL(a,d),i;n&&(i=n.baseOptions);let l={method:"GET",...i,...o},c={},p={};t!==void 0&&(p.type=t),s!==void 0&&(p.period=s),g(r,p);let x=i&&i.headers?i.headers:{};return l.headers={...c,...x,...o.headers},{url:y(r),options:l}},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;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},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;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},getWorkspaceBillingDetails:async(t,e={})=>{f("getWorkspaceBillingDetails","id",t);let s="/v1/admin/workspaces/{id}/billing/details".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},getWorkspaceQuota:async(t,e,s,o={})=>{f("getWorkspaceQuota","id",t),f("getWorkspaceQuota","type",e);let a="/v1/admin/workspaces/{id}/quota".replace("{id}",encodeURIComponent(String(t))),r=new URL(a,d),i;n&&(i=n.baseOptions);let l={method:"GET",...i,...o},c={},p={};e!==void 0&&(p.type=e),s!==void 0&&(p.period=s),g(r,p);let x=i&&i.headers?i.headers:{};return l.headers={...c,...x,...o.headers},{url:y(r),options:l}},introspect:async(t,e={})=>{let s="/v1/admin/introspect",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=b(t,r,n),{url:y(o),options:r}},listActivities:async(t,e,s,o={})=>{f("listActivities","taskId",t),f("listActivities","botId",e);let a="/v1/admin/activities",r=new URL(a,d),i;n&&(i=n.baseOptions);let l={method:"GET",...i,...o},c={},p={};s!==void 0&&(p.nextToken=s),t!==void 0&&(p.taskId=t),e!==void 0&&(p.botId=e),g(r,p);let x=i&&i.headers?i.headers:{};return l.headers={...c,...x,...o.headers},{url:y(r),options:l}},listBotIssueEvents:async(t,e,s={})=>{f("listBotIssueEvents","id",t),f("listBotIssueEvents","issueId",e);let o="/v1/admin/bots/{id}/issues/{issueId}/events".replace("{id}",encodeURIComponent(String(t))).replace("{issueId}",encodeURIComponent(String(e))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"GET",...r,...s},l={};g(a,{});let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},{url:y(a),options:i}},listBotIssues:async(t,e,s={})=>{f("listBotIssues","id",t);let o="/v1/admin/bots/{id}/issues".replace("{id}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"GET",...r,...s},l={},c={};e!==void 0&&(c.nextToken=e),g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},{url:y(a),options:i}},listBots:async(t,e,s={})=>{let o="/v1/admin/bots",a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"GET",...r,...s},l={},c={};t!==void 0&&(c.dev=t),e!==void 0&&(c.nextToken=e),g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},{url:y(a),options:i}},listConversations:async(t,e,s,o={})=>{let a="/v1/chat/conversations",r=new URL(a,d),i;n&&(i=n.baseOptions);let l={method:"GET",...i,...o},c={},p={};t!==void 0&&(p.nextToken=t),e!==void 0&&(p.tags=e),s&&(p.participantIds=s),g(r,p);let x=i&&i.headers?i.headers:{};return l.headers={...c,...x,...o.headers},{url:y(r),options:l}},listEvents:async(t,e,s,o,a,r={})=>{let i="/v1/chat/events",l=new URL(i,d),c;n&&(c=n.baseOptions);let p={method:"GET",...c,...r},x={},P={};t!==void 0&&(P.nextToken=t),e!==void 0&&(P.type=e),s!==void 0&&(P.conversationId=s),o!==void 0&&(P.userId=o),a!==void 0&&(P.messageId=a),g(l,P);let V=c&&c.headers?c.headers:{};return p.headers={...x,...V,...r.headers},{url:y(l),options:p}},listFiles:async(t,e,s={})=>{f("listFiles","botId",t);let o="/v1/storage/files",a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"GET",...r,...s},l={},c={};e!==void 0&&(c.nextToken=e),t!==void 0&&(c.botId=t),g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},{url:y(a),options:i}},listIntegrations:async(t,e,s,o,a={})=>{let r="/v1/admin/integrations",i=new URL(r,d),l;n&&(l=n.baseOptions);let c={method:"GET",...l,...a},p={},x={};t!==void 0&&(x.nextToken=t),e!==void 0&&(x.name=e),s!==void 0&&(x.version=s),o!==void 0&&(x.dev=o),g(i,x);let P=l&&l.headers?l.headers:{};return c.headers={...p,...P,...a.headers},{url:y(i),options:c}},listMessages:async(t,e,s,o={})=>{let a="/v1/chat/messages",r=new URL(a,d),i;n&&(i=n.baseOptions);let l={method:"GET",...i,...o},c={},p={};t!==void 0&&(p.nextToken=t),e!==void 0&&(p.conversationId=e),s!==void 0&&(p.tags=s),g(r,p);let x=i&&i.headers?i.headers:{};return l.headers={...c,...x,...o.headers},{url:y(r),options:l}},listParticipants:async(t,e,s={})=>{f("listParticipants","id",t);let o="/v1/chat/conversations/{id}/participants".replace("{id}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"GET",...r,...s},l={},c={};e!==void 0&&(c.nextToken=e),g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},{url:y(a),options:i}},listPersonalAccessTokens:async(t={})=>{let e="/v1/admin/account/pats",s=new URL(e,d),o;n&&(o=n.baseOptions);let a={method:"GET",...o,...t},r={};g(s,{});let l=o&&o.headers?o.headers:{};return a.headers={...r,...l,...t.headers},{url:y(s),options:a}},listPublicIntegrations:async(t,e,s,o={})=>{let a="/v1/admin/hub/integrations",r=new URL(a,d),i;n&&(i=n.baseOptions);let l={method:"GET",...i,...o},c={},p={};t!==void 0&&(p.nextToken=t),e!==void 0&&(p.name=e),s!==void 0&&(p.version=s),g(r,p);let x=i&&i.headers?i.headers:{};return l.headers={...c,...x,...o.headers},{url:y(r),options:l}},listTables:async(t,e={})=>{let s="/v1/tables",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={},l={};t!==void 0&&(l.tags=t),g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},listTasks:async(t,e,s,o,a,r,i,l={})=>{let c="/v1/chat/tasks",p=new URL(c,d),x;n&&(x=n.baseOptions);let P={method:"GET",...x,...l},V={},k={};t!==void 0&&(k.nextToken=t),e!==void 0&&(k.tags=e),s!==void 0&&(k.conversationId=s),o!==void 0&&(k.userId=o),a!==void 0&&(k.parentTaskId=a),r&&(k.status=r),i!==void 0&&(k.type=i),g(p,k);let ye=x&&x.headers?x.headers:{};return P.headers={...V,...ye,...l.headers},{url:y(p),options:P}},listUsageHistory:async(t,e,s={})=>{f("listUsageHistory","type",t),f("listUsageHistory","id",e);let o="/v1/admin/usages/{id}/history".replace("{id}",encodeURIComponent(String(e))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"GET",...r,...s},l={},c={};t!==void 0&&(c.type=t),g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},{url:y(a),options:i}},listUsers:async(t,e,s,o={})=>{let a="/v1/chat/users",r=new URL(a,d),i;n&&(i=n.baseOptions);let l={method:"GET",...i,...o},c={},p={};t!==void 0&&(p.nextToken=t),e!==void 0&&(p.conversationId=e),s!==void 0&&(p.tags=s),g(r,p);let x=i&&i.headers?i.headers:{};return l.headers={...c,...x,...o.headers},{url:y(r),options:l}},listWorkspaceInvoices:async(t,e={})=>{f("listWorkspaceInvoices","id",t);let s="/v1/admin/workspaces/{id}/billing/invoices".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={};g(o,{});let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},listWorkspaceMembers:async(t,e={})=>{let s="/v1/admin/workspace-members",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={},l={};t!==void 0&&(l.nextToken=t),g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},listWorkspaceQuotas:async(t,e,s={})=>{f("listWorkspaceQuotas","id",t);let o="/v1/admin/workspaces/{id}/quotas".replace("{id}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"GET",...r,...s},l={},c={};e!==void 0&&(c.period=e),g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},{url:y(a),options:i}},listWorkspaceUsages:async(t,e,s,o={})=>{f("listWorkspaceUsages","id",t),f("listWorkspaceUsages","type",e);let a="/v1/admin/workspaces/{id}/usages".replace("{id}",encodeURIComponent(String(t))),r=new URL(a,d),i;n&&(i=n.baseOptions);let l={method:"GET",...i,...o},c={},p={};e!==void 0&&(p.type=e),s!==void 0&&(p.period=s),g(r,p);let x=i&&i.headers?i.headers:{};return l.headers={...c,...x,...o.headers},{url:y(r),options:l}},listWorkspaces:async(t,e={})=>{let s="/v1/admin/workspaces",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"GET",...a,...e},i={},l={};t!==void 0&&(l.nextToken=t),g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},{url:y(o),options:r}},patchState:async(t,e,s,o,a={})=>{f("patchState","type",t),f("patchState","id",e),f("patchState","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))),i=new URL(r,d),l;n&&(l=n.baseOptions);let c={method:"PATCH",...l,...a},p={},x={};p["Content-Type"]="application/json",g(i,x);let P=l&&l.headers?l.headers:{};return c.headers={...p,...P,...a.headers},c.data=b(o,c,n),{url:y(i),options:c}},removeParticipant:async(t,e,s={})=>{f("removeParticipant","id",t),f("removeParticipant","userId",e);let o="/v1/chat/conversations/{id}/participants/{userId}".replace("{id}",encodeURIComponent(String(t))).replace("{userId}",encodeURIComponent(String(e))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"DELETE",...r,...s},l={};g(a,{});let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},{url:y(a),options:i}},renameTableColumn:async(t,e,s={})=>{f("renameTableColumn","table",t);let o="/v1/tables/{table}/column".replace("{table}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"PUT",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=b(e,i,n),{url:y(a),options:i}},runVrl:async(t,e={})=>{let s="/v1/admin/helper/vrl",o=new URL(s,d),a;n&&(a=n.baseOptions);let r={method:"POST",...a,...e},i={},l={};i["Content-Type"]="application/json",g(o,l);let c=a&&a.headers?a.headers:{};return r.headers={...i,...c,...e.headers},r.data=b(t,r,n),{url:y(o),options:r}},setAccountPreference:async(t,e,s={})=>{f("setAccountPreference","key",t);let o="/v1/admin/account/preferences/{key}".replace("{key}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"POST",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=b(e,i,n),{url:y(a),options:i}},setState:async(t,e,s,o,a={})=>{f("setState","type",t),f("setState","id",e),f("setState","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))),i=new URL(r,d),l;n&&(l=n.baseOptions);let c={method:"POST",...l,...a},p={},x={};p["Content-Type"]="application/json",g(i,x);let P=l&&l.headers?l.headers:{};return c.headers={...p,...P,...a.headers},c.data=b(o,c,n),{url:y(i),options:c}},setWorkspacePaymentMethod:async(t,e,s={})=>{f("setWorkspacePaymentMethod","id",t);let o="/v1/admin/workspaces/{id}/billing/payment-method".replace("{id}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"PUT",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=b(e,i,n),{url:y(a),options:i}},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),r;n&&(r=n.baseOptions);let i={method:"POST",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=b(e,i,n),{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),r;n&&(r=n.baseOptions);let i={method:"PUT",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=b(e,i,n),{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),r;n&&(r=n.baseOptions);let i={method:"PUT",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=b(e,i,n),{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),r;n&&(r=n.baseOptions);let i={method:"PUT",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=b(e,i,n),{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),r;n&&(r=n.baseOptions);let i={method:"PUT",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=b(e,i,n),{url:y(a),options:i}},updateTable:async(t,e,s={})=>{f("updateTable","table",t);let o="/v1/tables/{table}".replace("{table}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"PUT",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=b(e,i,n),{url:y(a),options:i}},updateTableRows:async(t,e,s={})=>{f("updateTableRows","table",t);let o="/v1/tables/{table}/rows".replace("{table}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"PUT",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=b(e,i,n),{url:y(a),options:i}},updateTask:async(t,e,s={})=>{f("updateTask","id",t);let o="/v1/chat/tasks/{id}".replace("{id}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"PUT",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=b(e,i,n),{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),r;n&&(r=n.baseOptions);let i={method:"PUT",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=b(e,i,n),{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),r;n&&(r=n.baseOptions);let i={method:"PUT",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=b(e,i,n),{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),r;n&&(r=n.baseOptions);let i={method:"PUT",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=b(e,i,n),{url:y(a),options:i}},upsertTableRows:async(t,e,s={})=>{f("upsertTableRows","table",t);let o="/v1/tables/{table}/rows/upsert".replace("{table}",encodeURIComponent(String(t))),a=new URL(o,d),r;n&&(r=n.baseOptions);let i={method:"POST",...r,...s},l={},c={};l["Content-Type"]="application/json",g(a,c);let p=r&&r.headers?r.headers:{};return i.headers={...l,...p,...s.headers},i.data=b(e,i,n),{url:y(a),options:i}}}},R=function(n){let t=De(n);return{async addParticipant(e,s,o){let a=await t.addParticipant(e,s,o);return h(a,A,u,n)},async breakDownWorkspaceUsageByBot(e,s,o,a){let r=await t.breakDownWorkspaceUsageByBot(e,s,o,a);return h(r,A,u,n)},async callAction(e,s){let o=await t.callAction(e,s);return h(o,A,u,n)},async changeAISpendQuota(e,s){let o=await t.changeAISpendQuota(e,s);return h(o,A,u,n)},async changeWorkspacePlan(e,s,o){let a=await t.changeWorkspacePlan(e,s,o);return h(a,A,u,n)},async chargeWorkspaceUnpaidInvoices(e,s,o){let a=await t.chargeWorkspaceUnpaidInvoices(e,s,o);return h(a,A,u,n)},async checkHandleAvailability(e,s){let o=await t.checkHandleAvailability(e,s);return h(o,A,u,n)},async configureIntegration(e,s){let o=await t.configureIntegration(e,s);return h(o,A,u,n)},async createBot(e,s){let o=await t.createBot(e,s);return h(o,A,u,n)},async createConversation(e,s){let o=await t.createConversation(e,s);return h(o,A,u,n)},async createEvent(e,s){let o=await t.createEvent(e,s);return h(o,A,u,n)},async createFile(e,s){let o=await t.createFile(e,s);return h(o,A,u,n)},async createIntegration(e,s){let o=await t.createIntegration(e,s);return h(o,A,u,n)},async createMessage(e,s){let o=await t.createMessage(e,s);return h(o,A,u,n)},async createPersonalAccessToken(e,s){let o=await t.createPersonalAccessToken(e,s);return h(o,A,u,n)},async createTable(e,s){let o=await t.createTable(e,s);return h(o,A,u,n)},async createTableRows(e,s,o){let a=await t.createTableRows(e,s,o);return h(a,A,u,n)},async createTask(e,s){let o=await t.createTask(e,s);return h(o,A,u,n)},async createUser(e,s){let o=await t.createUser(e,s);return h(o,A,u,n)},async createWorkspace(e,s){let o=await t.createWorkspace(e,s);return h(o,A,u,n)},async createWorkspaceMember(e,s){let o=await t.createWorkspaceMember(e,s);return h(o,A,u,n)},async deleteBot(e,s){let o=await t.deleteBot(e,s);return h(o,A,u,n)},async deleteBotIssue(e,s,o){let a=await t.deleteBotIssue(e,s,o);return h(a,A,u,n)},async deleteConversation(e,s){let o=await t.deleteConversation(e,s);return h(o,A,u,n)},async deleteFile(e,s){let o=await t.deleteFile(e,s);return h(o,A,u,n)},async deleteIntegration(e,s){let o=await t.deleteIntegration(e,s);return h(o,A,u,n)},async deleteMessage(e,s){let o=await t.deleteMessage(e,s);return h(o,A,u,n)},async deletePersonalAccessToken(e,s){let o=await t.deletePersonalAccessToken(e,s);return h(o,A,u,n)},async deleteTable(e,s){let o=await t.deleteTable(e,s);return h(o,A,u,n)},async deleteTableRows(e,s,o){let a=await t.deleteTableRows(e,s,o);return h(a,A,u,n)},async deleteTask(e,s){let o=await t.deleteTask(e,s);return h(o,A,u,n)},async deleteUser(e,s){let o=await t.deleteUser(e,s);return h(o,A,u,n)},async deleteWorkspace(e,s){let o=await t.deleteWorkspace(e,s);return h(o,A,u,n)},async deleteWorkspaceMember(e,s){let o=await t.deleteWorkspaceMember(e,s);return h(o,A,u,n)},async downloadFile(e,s){let o=await t.downloadFile(e,s);return h(o,A,u,n)},async findTableRows(e,s,o){let a=await t.findTableRows(e,s,o);return h(a,A,u,n)},async getAccount(e){let s=await t.getAccount(e);return h(s,A,u,n)},async getAccountPreference(e,s){let o=await t.getAccountPreference(e,s);return h(o,A,u,n)},async getAllWorkspaceQuotaCompletion(e){let s=await t.getAllWorkspaceQuotaCompletion(e);return h(s,A,u,n)},async getAuditRecords(e,s,o){let a=await t.getAuditRecords(e,s,o);return h(a,A,u,n)},async getBot(e,s){let o=await t.getBot(e,s);return h(o,A,u,n)},async getBotAnalytics(e,s,o,a){let r=await t.getBotAnalytics(e,s,o,a);return h(r,A,u,n)},async getBotLogs(e,s,o,a,r){let i=await t.getBotLogs(e,s,o,a,r);return h(i,A,u,n)},async getBotWebchat(e,s,o){let a=await t.getBotWebchat(e,s,o);return h(a,A,u,n)},async getConversation(e,s){let o=await t.getConversation(e,s);return h(o,A,u,n)},async getEvent(e,s){let o=await t.getEvent(e,s);return h(o,A,u,n)},async getFile(e,s){let o=await t.getFile(e,s);return h(o,A,u,n)},async getIntegration(e,s){let o=await t.getIntegration(e,s);return h(o,A,u,n)},async getIntegrationByName(e,s,o){let a=await t.getIntegrationByName(e,s,o);return h(a,A,u,n)},async getIntegrationLogs(e,s,o,a,r){let i=await t.getIntegrationLogs(e,s,o,a,r);return h(i,A,u,n)},async getMessage(e,s){let o=await t.getMessage(e,s);return h(o,A,u,n)},async getOrCreateConversation(e,s){let o=await t.getOrCreateConversation(e,s);return h(o,A,u,n)},async getOrCreateMessage(e,s){let o=await t.getOrCreateMessage(e,s);return h(o,A,u,n)},async getOrCreateUser(e,s){let o=await t.getOrCreateUser(e,s);return h(o,A,u,n)},async getOrSetState(e,s,o,a,r){let i=await t.getOrSetState(e,s,o,a,r);return h(i,A,u,n)},async getParticipant(e,s,o){let a=await t.getParticipant(e,s,o);return h(a,A,u,n)},async getPublicIntegration(e,s,o){let a=await t.getPublicIntegration(e,s,o);return h(a,A,u,n)},async getPublicIntegrationById(e,s){let o=await t.getPublicIntegrationById(e,s);return h(o,A,u,n)},async getState(e,s,o,a){let r=await t.getState(e,s,o,a);return h(r,A,u,n)},async getTable(e,s){let o=await t.getTable(e,s);return h(o,A,u,n)},async getTableRow(e,s,o){let a=await t.getTableRow(e,s,o);return h(a,A,u,n)},async getTask(e,s){let o=await t.getTask(e,s);return h(o,A,u,n)},async getUsage(e,s,o,a){let r=await t.getUsage(e,s,o,a);return h(r,A,u,n)},async getUser(e,s){let o=await t.getUser(e,s);return h(o,A,u,n)},async getWorkspace(e,s){let o=await t.getWorkspace(e,s);return h(o,A,u,n)},async getWorkspaceBillingDetails(e,s){let o=await t.getWorkspaceBillingDetails(e,s);return h(o,A,u,n)},async getWorkspaceQuota(e,s,o,a){let r=await t.getWorkspaceQuota(e,s,o,a);return h(r,A,u,n)},async introspect(e,s){let o=await t.introspect(e,s);return h(o,A,u,n)},async listActivities(e,s,o,a){let r=await t.listActivities(e,s,o,a);return h(r,A,u,n)},async listBotIssueEvents(e,s,o){let a=await t.listBotIssueEvents(e,s,o);return h(a,A,u,n)},async listBotIssues(e,s,o){let a=await t.listBotIssues(e,s,o);return h(a,A,u,n)},async listBots(e,s,o){let a=await t.listBots(e,s,o);return h(a,A,u,n)},async listConversations(e,s,o,a){let r=await t.listConversations(e,s,o,a);return h(r,A,u,n)},async listEvents(e,s,o,a,r,i){let l=await t.listEvents(e,s,o,a,r,i);return h(l,A,u,n)},async listFiles(e,s,o){let a=await t.listFiles(e,s,o);return h(a,A,u,n)},async listIntegrations(e,s,o,a,r){let i=await t.listIntegrations(e,s,o,a,r);return h(i,A,u,n)},async listMessages(e,s,o,a){let r=await t.listMessages(e,s,o,a);return h(r,A,u,n)},async listParticipants(e,s,o){let a=await t.listParticipants(e,s,o);return h(a,A,u,n)},async listPersonalAccessTokens(e){let s=await t.listPersonalAccessTokens(e);return h(s,A,u,n)},async listPublicIntegrations(e,s,o,a){let r=await t.listPublicIntegrations(e,s,o,a);return h(r,A,u,n)},async listTables(e,s){let o=await t.listTables(e,s);return h(o,A,u,n)},async listTasks(e,s,o,a,r,i,l,c){let p=await t.listTasks(e,s,o,a,r,i,l,c);return h(p,A,u,n)},async listUsageHistory(e,s,o){let a=await t.listUsageHistory(e,s,o);return h(a,A,u,n)},async listUsers(e,s,o,a){let r=await t.listUsers(e,s,o,a);return h(r,A,u,n)},async listWorkspaceInvoices(e,s){let o=await t.listWorkspaceInvoices(e,s);return h(o,A,u,n)},async listWorkspaceMembers(e,s){let o=await t.listWorkspaceMembers(e,s);return h(o,A,u,n)},async listWorkspaceQuotas(e,s,o){let a=await t.listWorkspaceQuotas(e,s,o);return h(a,A,u,n)},async listWorkspaceUsages(e,s,o,a){let r=await t.listWorkspaceUsages(e,s,o,a);return h(r,A,u,n)},async listWorkspaces(e,s){let o=await t.listWorkspaces(e,s);return h(o,A,u,n)},async patchState(e,s,o,a,r){let i=await t.patchState(e,s,o,a,r);return h(i,A,u,n)},async removeParticipant(e,s,o){let a=await t.removeParticipant(e,s,o);return h(a,A,u,n)},async renameTableColumn(e,s,o){let a=await t.renameTableColumn(e,s,o);return h(a,A,u,n)},async runVrl(e,s){let o=await t.runVrl(e,s);return h(o,A,u,n)},async setAccountPreference(e,s,o){let a=await t.setAccountPreference(e,s,o);return h(a,A,u,n)},async setState(e,s,o,a,r){let i=await t.setState(e,s,o,a,r);return h(i,A,u,n)},async setWorkspacePaymentMethod(e,s,o){let a=await t.setWorkspacePaymentMethod(e,s,o);return h(a,A,u,n)},async transferBot(e,s,o){let a=await t.transferBot(e,s,o);return h(a,A,u,n)},async updateBot(e,s,o){let a=await t.updateBot(e,s,o);return h(a,A,u,n)},async updateConversation(e,s,o){let a=await t.updateConversation(e,s,o);return h(a,A,u,n)},async updateIntegration(e,s,o){let a=await t.updateIntegration(e,s,o);return h(a,A,u,n)},async updateMessage(e,s,o){let a=await t.updateMessage(e,s,o);return h(a,A,u,n)},async updateTable(e,s,o){let a=await t.updateTable(e,s,o);return h(a,A,u,n)},async updateTableRows(e,s,o){let a=await t.updateTableRows(e,s,o);return h(a,A,u,n)},async updateTask(e,s,o){let a=await t.updateTask(e,s,o);return h(a,A,u,n)},async updateUser(e,s,o){let a=await t.updateUser(e,s,o);return h(a,A,u,n)},async updateWorkspace(e,s,o){let a=await t.updateWorkspace(e,s,o);return h(a,A,u,n)},async updateWorkspaceMember(e,s,o){let a=await t.updateWorkspaceMember(e,s,o);return h(a,A,u,n)},async upsertTableRows(e,s,o){let a=await t.upsertTableRows(e,s,o);return h(a,A,u,n)}}};var I=class extends T{addParticipant(t,e){return R(this.configuration).addParticipant(t.id,t.addParticipantBody,e).then(s=>s(this.axios,this.basePath))}breakDownWorkspaceUsageByBot(t,e){return R(this.configuration).breakDownWorkspaceUsageByBot(t.id,t.type,t.period,e).then(s=>s(this.axios,this.basePath))}callAction(t={},e){return R(this.configuration).callAction(t.callActionBody,e).then(s=>s(this.axios,this.basePath))}changeAISpendQuota(t={},e){return R(this.configuration).changeAISpendQuota(t.changeAISpendQuotaBody,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))}chargeWorkspaceUnpaidInvoices(t,e){return R(this.configuration).chargeWorkspaceUnpaidInvoices(t.id,t.chargeWorkspaceUnpaidInvoicesBody,e).then(s=>s(this.axios,this.basePath))}checkHandleAvailability(t={},e){return R(this.configuration).checkHandleAvailability(t.checkHandleAvailabilityBody,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))}createPersonalAccessToken(t={},e){return R(this.configuration).createPersonalAccessToken(t.createPersonalAccessTokenBody,e).then(s=>s(this.axios,this.basePath))}createTable(t={},e){return R(this.configuration).createTable(t.createTableBody,e).then(s=>s(this.axios,this.basePath))}createTableRows(t,e){return R(this.configuration).createTableRows(t.table,t.createTableRowsBody,e).then(s=>s(this.axios,this.basePath))}createTask(t={},e){return R(this.configuration).createTask(t.createTaskBody,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))}deleteBotIssue(t,e){return R(this.configuration).deleteBotIssue(t.id,t.issueId,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))}deletePersonalAccessToken(t,e){return R(this.configuration).deletePersonalAccessToken(t.id,e).then(s=>s(this.axios,this.basePath))}deleteTable(t,e){return R(this.configuration).deleteTable(t.table,e).then(s=>s(this.axios,this.basePath))}deleteTableRows(t,e){return R(this.configuration).deleteTableRows(t.table,t.deleteTableRowsBody,e).then(s=>s(this.axios,this.basePath))}deleteTask(t,e){return R(this.configuration).deleteTask(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))}findTableRows(t,e){return R(this.configuration).findTableRows(t.table,t.findTableRowsBody,e).then(s=>s(this.axios,this.basePath))}getAccount(t){return R(this.configuration).getAccount(t).then(e=>e(this.axios,this.basePath))}getAccountPreference(t,e){return R(this.configuration).getAccountPreference(t.key,e).then(s=>s(this.axios,this.basePath))}getAllWorkspaceQuotaCompletion(t){return R(this.configuration).getAllWorkspaceQuotaCompletion(t).then(e=>e(this.axios,this.basePath))}getAuditRecords(t,e){return R(this.configuration).getAuditRecords(t.id,t.nextToken,e).then(s=>s(this.axios,this.basePath))}getBot(t,e){return R(this.configuration).getBot(t.id,e).then(s=>s(this.axios,this.basePath))}getBotAnalytics(t,e){return R(this.configuration).getBotAnalytics(t.id,t.startDate,t.endDate,e).then(s=>s(this.axios,this.basePath))}getBotLogs(t,e){return R(this.configuration).getBotLogs(t.id,t.timeStart,t.timeEnd,t.nextToken,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,t.timeStart,t.timeEnd,t.nextToken,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))}getOrSetState(t,e){return R(this.configuration).getOrSetState(t.type,t.id,t.name,t.getOrSetStateBody,e).then(s=>s(this.axios,this.basePath))}getParticipant(t,e){return R(this.configuration).getParticipant(t.id,t.userId,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))}getTable(t,e){return R(this.configuration).getTable(t.table,e).then(s=>s(this.axios,this.basePath))}getTableRow(t,e){return R(this.configuration).getTableRow(t.table,t.id,e).then(s=>s(this.axios,this.basePath))}getTask(t,e){return R(this.configuration).getTask(t.id,e).then(s=>s(this.axios,this.basePath))}getUsage(t,e){return R(this.configuration).getUsage(t.type,t.id,t.period,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))}getWorkspaceBillingDetails(t,e){return R(this.configuration).getWorkspaceBillingDetails(t.id,e).then(s=>s(this.axios,this.basePath))}getWorkspaceQuota(t,e){return R(this.configuration).getWorkspaceQuota(t.id,t.type,t.period,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))}listActivities(t,e){return R(this.configuration).listActivities(t.taskId,t.botId,t.nextToken,e).then(s=>s(this.axios,this.basePath))}listBotIssueEvents(t,e){return R(this.configuration).listBotIssueEvents(t.id,t.issueId,e).then(s=>s(this.axios,this.basePath))}listBotIssues(t,e){return R(this.configuration).listBotIssues(t.id,t.nextToken,e).then(s=>s(this.axios,this.basePath))}listBots(t={},e){return R(this.configuration).listBots(t.dev,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,t.conversationId,t.userId,t.messageId,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,t.dev,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))}listParticipants(t,e){return R(this.configuration).listParticipants(t.id,t.nextToken,e).then(s=>s(this.axios,this.basePath))}listPersonalAccessTokens(t){return R(this.configuration).listPersonalAccessTokens(t).then(e=>e(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))}listTables(t={},e){return R(this.configuration).listTables(t.tags,e).then(s=>s(this.axios,this.basePath))}listTasks(t={},e){return R(this.configuration).listTasks(t.nextToken,t.tags,t.conversationId,t.userId,t.parentTaskId,t.status,t.type,e).then(s=>s(this.axios,this.basePath))}listUsageHistory(t,e){return R(this.configuration).listUsageHistory(t.type,t.id,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))}listWorkspaceInvoices(t,e){return R(this.configuration).listWorkspaceInvoices(t.id,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))}listWorkspaceQuotas(t,e){return R(this.configuration).listWorkspaceQuotas(t.id,t.period,e).then(s=>s(this.axios,this.basePath))}listWorkspaceUsages(t,e){return R(this.configuration).listWorkspaceUsages(t.id,t.type,t.period,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))}removeParticipant(t,e){return R(this.configuration).removeParticipant(t.id,t.userId,e).then(s=>s(this.axios,this.basePath))}renameTableColumn(t,e){return R(this.configuration).renameTableColumn(t.table,t.renameTableColumnBody,e).then(s=>s(this.axios,this.basePath))}runVrl(t={},e){return R(this.configuration).runVrl(t.runVrlBody,e).then(s=>s(this.axios,this.basePath))}setAccountPreference(t,e){return R(this.configuration).setAccountPreference(t.key,t.setAccountPreferenceBody,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))}setWorkspacePaymentMethod(t,e){return R(this.configuration).setWorkspacePaymentMethod(t.id,t.setWorkspacePaymentMethodBody,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))}updateTable(t,e){return R(this.configuration).updateTable(t.table,t.updateTableBody,e).then(s=>s(this.axios,this.basePath))}updateTableRows(t,e){return R(this.configuration).updateTableRows(t.table,t.updateTableRowsBody,e).then(s=>s(this.axios,this.basePath))}updateTask(t,e){return R(this.configuration).updateTask(t.id,t.updateTaskBody,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))}upsertTableRows(t,e){return R(this.configuration).upsertTableRows(t.table,t.upsertTableRowsBody,e).then(s=>s(this.axios,this.basePath))}};import we from"crypto";var Oe={getRandomValues:n=>new Uint8Array(n.map(()=>Math.floor(Math.random()*256)))},D=typeof window<"u"&&typeof window.document<"u"?window.crypto:we;D.getRandomValues||(D=Oe);var C=class extends Error{constructor(e,s,o,a,r,i){super(a);this.code=e;this.description=s;this.type=o;this.message=a;this.error=r;this.id=i;this.id||(this.id=C.generateId())}isApiError=!0;format(){return`[${this.type}] ${this.message} (Error ID: ${this.id})`}toJSON(){return{id:this.id,code:this.code,type:this.type,message:this.message}}static generateId(){let e=this.getPrefix(),s=new Date().toISOString().replace(/[\-:TZ]/g,"").split(".")[0],o=4,a=Array.from(D.getRandomValues(new Uint8Array(o))).map(r=>r.toString(16).padStart(2,"0")).join("").toUpperCase();return`${e}_${s}x${a}`}static getPrefix(){return typeof window<"u"&&typeof window.document<"u"?"err_bwsr":"err"}},Ee=n=>typeof n=="object"&&!Array.isArray(n)&&n!==null,le=n=>n instanceof C||Ee(n)&&n.isApiError===!0,B=class extends C{constructor(t,e,s){super(500,"An unknown error occurred","Unknown",t,e,s)}},w=class extends C{constructor(t,e,s){super(500,"An internal error occurred","Internal",t,e,s)}},O=class extends C{constructor(t,e,s){super(401,"The request requires to be authenticated.","Unauthorized",t,e,s)}},E=class extends C{constructor(t,e,s){super(403,"The requested action can't be peform by this resource.","Forbidden",t,e,s)}},W=class extends C{constructor(t,e,s){super(413,"The request payload is too large.","PayloadTooLarge",t,e,s)}},S=class extends C{constructor(t,e,s){super(400,"The request payload is invalid.","InvalidPayload",t,e,s)}},M=class extends C{constructor(t,e,s){super(415,"The request is invalid because the content-type is not supported.","UnsupportedMediaType",t,e,s)}},L=class extends C{constructor(t,e,s){super(405,"The requested method does not exist.","MethodNotFound",t,e,s)}},G=class extends C{constructor(t,e,s){super(404,"The requested resource does not exist.","ResourceNotFound",t,e,s)}},_=class extends C{constructor(t,e,s){super(400,"The provided JSON schema is invalid.","InvalidJsonSchema",t,e,s)}},F=class extends C{constructor(t,e,s){super(400,"The provided data doesn't respect the provided JSON schema.","InvalidDataFormat",t,e,s)}},Q=class extends C{constructor(t,e,s){super(400,"The provided identifier is not valid. An identifier must start with a lowercase letter, be between 2 and 100 characters long and use only alphanumeric characters.","InvalidIdentifier",t,e,s)}},j=class extends C{constructor(t,e,s){super(409,"The resource is related with a different resource that the one referenced in the request. This is usually caused when providing two resource identifiers that aren't linked together.","RelationConflict",t,e,s)}},H=class extends C{constructor(t,e,s){super(409,"The resource cannot be deleted because it's referenced by another resource","ReferenceConstraint",t,e,s)}},N=class extends C{constructor(t,e,s){super(400,"The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request.","ReferenceNotFound",t,e,s)}},$=class extends C{constructor(t,e,s){super(400,"The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource.","InvalidQuery",t,e,s)}},K=class extends C{constructor(t,e,s){super(400,"An error happened during the execution of a runtime (bot or integration).","Runtime",t,e,s)}},J=class extends C{constructor(t,e,s){super(409,"The record attempted to be created already exists.","AlreadyExists",t,e,s)}},z=class extends C{constructor(t,e,s){super(429,"The request has been rate limited.","RateLimited",t,e,s)}},Y=class extends C{constructor(t,e,s){super(402,"A payment is required to perform this request.","PaymentRequired",t,e,s)}},Z=class extends C{constructor(t,e,s){super(403,"The request exceeds the allowed quota. Quotas are a soft limit that can be increased.","QuotaExceeded",t,e,s)}},X=class extends C{constructor(t,e,s){super(413,"The request exceeds the allowed limit. Limits are a hard limit that cannot be increased.","LimitExceeded",t,e,s)}},We={Unknown:B,Internal:w,Unauthorized:O,Forbidden:E,PayloadTooLarge:W,InvalidPayload:S,UnsupportedMediaType:M,MethodNotFound:L,ResourceNotFound:G,InvalidJsonSchema:_,InvalidDataFormat:F,InvalidIdentifier:Q,RelationConflict:j,ReferenceConstraint:H,ReferenceNotFound:N,InvalidQuery:$,Runtime:K,AlreadyExists:J,RateLimited:z,PaymentRequired:Y,QuotaExceeded:Z,LimitExceeded:X},ee=n=>le(n)?n:n instanceof Error?new B(n.message,n):typeof n=="string"?new B(n):Se(n);function Se(n){if(typeof n=="object"&&"code"in n&&"type"in n&&"id"in n&&"message"in n&&typeof n.type=="string"&&typeof n.message=="string"){let t=We[n.type];return t?new t(n.message,void 0,n.id||"UNKNOWN"):new B(`An unclassified API error occurred: ${n.message} (Type: ${n.type}, Code: ${n.code})`)}return new B("An invalid error occurred: "+JSON.stringify(n))}var U=class{_innerClient;constructor(t,e,s){this._innerClient=new I(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)});listParticipants=t=>this._innerClient.listParticipants(t).then(e=>e.data).catch(e=>{throw m(e)});addParticipant=({id:t,...e})=>this._innerClient.addParticipant({id:t,addParticipantBody:e}).then(s=>s.data).catch(s=>{throw m(s)});getParticipant=t=>this._innerClient.getParticipant(t).then(e=>e.data).catch(e=>{throw m(e)});removeParticipant=t=>this._innerClient.removeParticipant(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(a=>a.data).catch(a=>{throw m(a)});getOrSetState=({type:t,id:e,name:s,...o})=>this._innerClient.getOrSetState({type:t,id:e,name:s,getOrSetStateBody:o}).then(a=>a.data).catch(a=>{throw m(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 m(a)});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)});getTask=t=>this._innerClient.getTask(t).then(e=>e.data).catch(e=>{throw m(e)});createTask=t=>this._innerClient.createTask({createTaskBody:t}).then(e=>e.data).catch(e=>{throw m(e)});updateTask=({id:t,...e})=>this._innerClient.updateTask({id:t,updateTaskBody:e}).then(s=>s.data).catch(s=>{throw m(s)});deleteTask=t=>this._innerClient.deleteTask(t).then(e=>e.data).catch(e=>{throw m(e)});listTasks=t=>this._innerClient.listTasks(t).then(e=>e.data).catch(e=>{throw m(e)});runVrl=t=>this._innerClient.runVrl({runVrlBody:t}).then(e=>e.data).catch(e=>{throw m(e)});getAccount=()=>this._innerClient.getAccount().then(t=>t.data).catch(t=>{throw m(t)});listPersonalAccessTokens=()=>this._innerClient.listPersonalAccessTokens().then(t=>t.data).catch(t=>{throw m(t)});createPersonalAccessToken=t=>this._innerClient.createPersonalAccessToken({createPersonalAccessTokenBody:t}).then(e=>e.data).catch(e=>{throw m(e)});deletePersonalAccessToken=t=>this._innerClient.deletePersonalAccessToken(t).then(e=>e.data).catch(e=>{throw m(e)});setAccountPreference=({key:t,...e})=>this._innerClient.setAccountPreference({key:t,setAccountPreferenceBody:e}).then(s=>s.data).catch(s=>{throw m(s)});getAccountPreference=t=>this._innerClient.getAccountPreference(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)});listBotIssues=t=>this._innerClient.listBotIssues(t).then(e=>e.data).catch(e=>{throw m(e)});deleteBotIssue=t=>this._innerClient.deleteBotIssue(t).then(e=>e.data).catch(e=>{throw m(e)});listBotIssueEvents=t=>this._innerClient.listBotIssueEvents(t).then(e=>e.data).catch(e=>{throw m(e)});getWorkspaceBillingDetails=t=>this._innerClient.getWorkspaceBillingDetails(t).then(e=>e.data).catch(e=>{throw m(e)});setWorkspacePaymentMethod=({id:t,...e})=>this._innerClient.setWorkspacePaymentMethod({id:t,setWorkspacePaymentMethodBody:e}).then(s=>s.data).catch(s=>{throw m(s)});listWorkspaceInvoices=t=>this._innerClient.listWorkspaceInvoices(t).then(e=>e.data).catch(e=>{throw m(e)});chargeWorkspaceUnpaidInvoices=({id:t,...e})=>this._innerClient.chargeWorkspaceUnpaidInvoices({id:t,chargeWorkspaceUnpaidInvoicesBody:e}).then(s=>s.data).catch(s=>{throw m(s)});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)});listWorkspaceUsages=t=>this._innerClient.listWorkspaceUsages(t).then(e=>e.data).catch(e=>{throw m(e)});breakDownWorkspaceUsageByBot=t=>this._innerClient.breakDownWorkspaceUsageByBot(t).then(e=>e.data).catch(e=>{throw m(e)});getAllWorkspaceQuotaCompletion=()=>this._innerClient.getAllWorkspaceQuotaCompletion().then(t=>t.data).catch(t=>{throw m(t)});getWorkspaceQuota=t=>this._innerClient.getWorkspaceQuota(t).then(e=>e.data).catch(e=>{throw m(e)});listWorkspaceQuotas=t=>this._innerClient.listWorkspaceQuotas(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)});checkHandleAvailability=t=>this._innerClient.checkHandleAvailability({checkHandleAvailabilityBody:t}).then(e=>e.data).catch(e=>{throw m(e)});listWorkspaces=t=>this._innerClient.listWorkspaces(t).then(e=>e.data).catch(e=>{throw m(e)});changeWorkspacePlan=({id:t,...e})=>this._innerClient.changeWorkspacePlan({id:t,changeWorkspacePlanBody:e}).then(s=>s.data).catch(s=>{throw m(s)});deleteWorkspace=t=>this._innerClient.deleteWorkspace(t).then(e=>e.data).catch(e=>{throw m(e)});getAuditRecords=t=>this._innerClient.getAuditRecords(t).then(e=>e.data).catch(e=>{throw m(e)});listWorkspaceMembers=t=>this._innerClient.listWorkspaceMembers(t).then(e=>e.data).catch(e=>{throw m(e)});deleteWorkspaceMember=t=>this._innerClient.deleteWorkspaceMember(t).then(e=>e.data).catch(e=>{throw m(e)});createWorkspaceMember=t=>this._innerClient.createWorkspaceMember({createWorkspaceMemberBody:t}).then(e=>e.data).catch(e=>{throw m(e)});updateWorkspaceMember=({id:t,...e})=>this._innerClient.updateWorkspaceMember({id:t,updateWorkspaceMemberBody:e}).then(s=>s.data).catch(s=>{throw m(s)});createIntegration=t=>this._innerClient.createIntegration({createIntegrationBody:t}).then(e=>e.data).catch(e=>{throw m(e)});updateIntegration=({id:t,...e})=>this._innerClient.updateIntegration({id:t,updateIntegrationBody:e}).then(s=>s.data).catch(s=>{throw m(s)});listIntegrations=t=>this._innerClient.listIntegrations(t).then(e=>e.data).catch(e=>{throw m(e)});getIntegration=t=>this._innerClient.getIntegration(t).then(e=>e.data).catch(e=>{throw m(e)});getIntegrationLogs=t=>this._innerClient.getIntegrationLogs(t).then(e=>e.data).catch(e=>{throw m(e)});getIntegrationByName=t=>this._innerClient.getIntegrationByName(t).then(e=>e.data).catch(e=>{throw m(e)});deleteIntegration=t=>this._innerClient.deleteIntegration(t).then(e=>e.data).catch(e=>{throw m(e)});getUsage=t=>this._innerClient.getUsage(t).then(e=>e.data).catch(e=>{throw m(e)});listUsageHistory=t=>this._innerClient.listUsageHistory(t).then(e=>e.data).catch(e=>{throw m(e)});changeAISpendQuota=t=>this._innerClient.changeAISpendQuota({changeAISpendQuotaBody:t}).then(e=>e.data).catch(e=>{throw m(e)});listActivities=t=>this._innerClient.listActivities(t).then(e=>e.data).catch(e=>{throw m(e)});introspect=t=>this._innerClient.introspect({introspectBody:t}).then(e=>e.data).catch(e=>{throw m(e)});createFile=t=>this._innerClient.createFile({createFileBody:t}).then(e=>e.data).catch(e=>{throw m(e)});getFile=t=>this._innerClient.getFile(t).then(e=>e.data).catch(e=>{throw m(e)});downloadFile=t=>this._innerClient.downloadFile(t).then(e=>e.data).catch(e=>{throw m(e)});deleteFile=t=>this._innerClient.deleteFile(t).then(e=>e.data).catch(e=>{throw m(e)});listFiles=t=>this._innerClient.listFiles(t).then(e=>e.data).catch(e=>{throw m(e)});listTables=t=>this._innerClient.listTables(t).then(e=>e.data).catch(e=>{throw m(e)});getTable=t=>this._innerClient.getTable(t).then(e=>e.data).catch(e=>{throw m(e)});createTable=t=>this._innerClient.createTable({createTableBody:t}).then(e=>e.data).catch(e=>{throw m(e)});updateTable=({table:t,...e})=>this._innerClient.updateTable({table:t,updateTableBody:e}).then(s=>s.data).catch(s=>{throw m(s)});renameTableColumn=({table:t,...e})=>this._innerClient.renameTableColumn({table:t,renameTableColumnBody:e}).then(s=>s.data).catch(s=>{throw m(s)});deleteTable=t=>this._innerClient.deleteTable(t).then(e=>e.data).catch(e=>{throw m(e)});getTableRow=t=>this._innerClient.getTableRow(t).then(e=>e.data).catch(e=>{throw m(e)});findTableRows=({table:t,...e})=>this._innerClient.findTableRows({table:t,findTableRowsBody:e}).then(s=>s.data).catch(s=>{throw m(s)});createTableRows=({table:t,...e})=>this._innerClient.createTableRows({table:t,createTableRowsBody:e}).then(s=>s.data).catch(s=>{throw m(s)});deleteTableRows=({table:t,...e})=>this._innerClient.deleteTableRows({table:t,deleteTableRowsBody:e}).then(s=>s.data).catch(s=>{throw m(s)});updateTableRows=({table:t,...e})=>this._innerClient.updateTableRows({table:t,updateTableRowsBody:e}).then(s=>s.data).catch(s=>{throw m(s)});upsertTableRows=({table:t,...e})=>this._innerClient.upsertTableRows({table:t,upsertTableRowsBody:e}).then(s=>s.data).catch(s=>{throw m(s)})};function m(n){return Me.isAxiosError(n)&&n.response?.data?ee(n.response.data):ee(n)}import{isNode as ce}from"browser-or-node";import*as Ta from"axios";var ge=100*1024*1024,Ge=ge,_e=ge,pe=class extends U{config;constructor(t={}){let e=ie(t),{apiUrl:s,headers:o,withCredentials:a,timeout:r}=e,i=Le.create({headers:o,withCredentials:a,timeout:r,maxBodyLength:Ge,maxContentLength:_e,httpAgent:ce?new ue.default.Agent({keepAlive:!0}):void 0,httpsAgent:ce?new de.default.Agent({keepAlive:!0}):void 0});super(void 0,s,i),this.config=e}};export{J as AlreadyExistsError,pe as Client,E as ForbiddenError,w as InternalError,F as InvalidDataFormatError,Q as InvalidIdentifierError,_ as InvalidJsonSchemaError,S as InvalidPayloadError,$ as InvalidQueryError,X as LimitExceededError,L as MethodNotFoundError,W as PayloadTooLargeError,Y as PaymentRequiredError,Z as QuotaExceededError,z as RateLimitedError,H as ReferenceConstraintError,N as ReferenceNotFoundError,j as RelationConflictError,G as ResourceNotFoundError,K as RuntimeError,O as UnauthorizedError,B as UnknownError,M as UnsupportedMediaTypeError,Ta as axios,ee as errorFrom,le as isApiError};
@@ -0,0 +1,70 @@
1
+ import esbuild from 'esbuild'
2
+ import fs from 'fs'
3
+ import pathlib from 'path'
4
+ import puppeteer from 'puppeteer'
5
+ import * as consts from '../consts'
6
+
7
+ const readTsScript = () => {
8
+ const filePath = pathlib.join(__dirname, 'script.ts')
9
+ return fs.readFileSync(filePath, 'utf8')
10
+ }
11
+
12
+ const toJs = async (tsScript: string): Promise<string> => {
13
+ const buildResult = await esbuild.build({
14
+ stdin: {
15
+ contents: tsScript,
16
+ resolveDir: __dirname,
17
+ loader: 'ts',
18
+ },
19
+ bundle: true,
20
+ write: false,
21
+ format: 'esm',
22
+ platform: 'browser',
23
+ target: 'es2017',
24
+ })
25
+ const jsScript = buildResult.outputFiles[0]!.text
26
+ return jsScript
27
+ }
28
+
29
+ const launchBrowser = async (jsScript: string) => {
30
+ const browser = await puppeteer.launch({ headless: true })
31
+ const page = await browser.newPage()
32
+ await page.setRequestInterception(false)
33
+
34
+ try {
35
+ await new Promise<typeof browser>((resolve, reject) => {
36
+ page.on('console', (msg) => {
37
+ const txt = msg.text()
38
+ if (txt === consts.successMessage) {
39
+ resolve(browser)
40
+ return
41
+ }
42
+ if (txt === consts.failureMessage) {
43
+ reject(new Error('Failure'))
44
+ return
45
+ }
46
+ console.log(`>>> ${txt}`)
47
+ })
48
+ page.evaluate(jsScript).catch(reject)
49
+ return browser
50
+ })
51
+ } finally {
52
+ await browser.close()
53
+ }
54
+ }
55
+
56
+ const main = async () => {
57
+ const tsScript = readTsScript()
58
+ const jsScript = await toJs(tsScript)
59
+ await launchBrowser(jsScript)
60
+ }
61
+
62
+ void main()
63
+ .then(() => {
64
+ console.error('Browser Done')
65
+ process.exit(0)
66
+ })
67
+ .catch((err) => {
68
+ console.error(err)
69
+ process.exit(1)
70
+ })
@@ -0,0 +1,33 @@
1
+ import { Client, errorFrom } from '../../src'
2
+ import * as consts from '../consts'
3
+
4
+ const exit = (code: 0 | 1) => {
5
+ if (code === 0) {
6
+ console.log(consts.successMessage)
7
+ } else {
8
+ console.log(consts.failureMessage)
9
+ }
10
+ }
11
+
12
+ const main = async () => {
13
+ const client = new Client()
14
+ await client
15
+ .getAccount()
16
+ .then(() => {
17
+ throw new Error('Expected to reject')
18
+ })
19
+ .catch((err) => {
20
+ if (errorFrom(err).type !== 'Unauthorized') {
21
+ throw Error()
22
+ }
23
+ })
24
+ }
25
+
26
+ void main()
27
+ .then(() => {
28
+ exit(0)
29
+ })
30
+ .catch((err) => {
31
+ console.error(err)
32
+ exit(1)
33
+ })
package/e2e/consts.ts ADDED
@@ -0,0 +1,2 @@
1
+ export const successMessage = '__SUCCESS__'
2
+ export const failureMessage = '__FAIL__'
package/e2e/node.ts ADDED
@@ -0,0 +1,25 @@
1
+ import { Client, errorFrom } from '../src'
2
+
3
+ const main = async () => {
4
+ const client = new Client()
5
+ await client
6
+ .getAccount()
7
+ .then(() => {
8
+ throw new Error('Expected to reject')
9
+ })
10
+ .catch((err) => {
11
+ if (errorFrom(err).type !== 'Unauthorized') {
12
+ throw Error()
13
+ }
14
+ })
15
+ }
16
+
17
+ void main()
18
+ .then(() => {
19
+ console.error('Node Done')
20
+ process.exit(0)
21
+ })
22
+ .catch((err) => {
23
+ console.error(err)
24
+ process.exit(1)
25
+ })