@botpress/api 0.14.0 → 0.15.0

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.
@@ -4936,6 +4936,36 @@ export declare const state: {
4936
4936
  };
4937
4937
  };
4938
4938
  };
4939
+ changeAISpendQuota: {
4940
+ name: string;
4941
+ path: string;
4942
+ description: string;
4943
+ method: "put";
4944
+ section: "quotas";
4945
+ requestBody: {
4946
+ description: string;
4947
+ schema: {
4948
+ type: "object";
4949
+ properties: {
4950
+ monthlySpendingLimit: {
4951
+ type: "number";
4952
+ };
4953
+ };
4954
+ required: string[];
4955
+ title: string;
4956
+ additionalProperties: false;
4957
+ };
4958
+ };
4959
+ response: {
4960
+ description: string;
4961
+ schema: {
4962
+ type: "object";
4963
+ title: string;
4964
+ additionalProperties: false;
4965
+ };
4966
+ };
4967
+ parameters: {};
4968
+ };
4939
4969
  introspect: {
4940
4970
  name: string;
4941
4971
  description: string;
@@ -5233,6 +5263,7 @@ export declare const state: {
5233
5263
  updateWorkspaceMemberBody: true;
5234
5264
  createIntegrationBody: true;
5235
5265
  updateIntegrationBody: true;
5266
+ changeAISpendQuotaBody: true;
5236
5267
  introspectBody: true;
5237
5268
  createFileBody: true;
5238
5269
  };
@@ -5313,6 +5344,7 @@ export declare const state: {
5313
5344
  deleteIntegrationResponse: true;
5314
5345
  getUsageResponse: true;
5315
5346
  listUsageHistoryResponse: true;
5347
+ changeAISpendQuotaResponse: true;
5316
5348
  introspectResponse: true;
5317
5349
  createFileResponse: true;
5318
5350
  getFileResponse: true;
@@ -6564,8 +6596,8 @@ export declare const state: {
6564
6596
  operations: string[];
6565
6597
  schema: string;
6566
6598
  } | {
6567
- description: string;
6568
6599
  title: string;
6600
+ description: string;
6569
6601
  name: "hub";
6570
6602
  operations: string[];
6571
6603
  schema?: undefined;
@@ -6576,41 +6608,47 @@ export declare const state: {
6576
6608
  operations: string[];
6577
6609
  schema?: undefined;
6578
6610
  } | {
6579
- description: string;
6580
6611
  title: string;
6612
+ description: string;
6581
6613
  name: "bot";
6582
6614
  operations: string[];
6583
6615
  schema: string;
6584
6616
  } | {
6585
- description: string;
6586
6617
  title: string;
6618
+ description: string;
6587
6619
  name: "integration";
6588
6620
  operations: string[];
6589
6621
  schema: string;
6590
6622
  } | {
6591
- description: string;
6592
6623
  title: string;
6624
+ description: string;
6593
6625
  name: "workspace";
6594
6626
  operations: string[];
6595
6627
  schema: string;
6596
6628
  } | {
6597
- description: string;
6598
6629
  title: string;
6630
+ description: string;
6599
6631
  name: "workspaceMember";
6600
6632
  operations: string[];
6601
6633
  schema: string;
6602
6634
  } | {
6603
- description: string;
6604
6635
  title: string;
6636
+ description: string;
6605
6637
  name: "account";
6606
6638
  operations: string[];
6607
6639
  schema: string;
6608
6640
  } | {
6609
- description: string;
6610
6641
  title: string;
6642
+ description: string;
6611
6643
  name: "usage";
6612
6644
  operations: string[];
6613
6645
  schema: string;
6646
+ } | {
6647
+ title: string;
6648
+ description: string;
6649
+ name: "quotas";
6650
+ operations: string[];
6651
+ schema?: undefined;
6614
6652
  })[];
6615
6653
  options: {
6616
6654
  allowUnions: false;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export declare const api: {
2
- getState: () => import("@bpinternal/opapi").State<"Bot" | "Integration" | "Workspace" | "WorkspaceMember" | "Account" | "Usage" | "Issue" | "IssueEvent" | "User" | "Conversation" | "Event" | "Message" | "State" | "File", "x-workspace-id", "user" | "conversation" | "event" | "message" | "file" | "state" | "hub" | "action" | "bot" | "integration" | "workspace" | "workspaceMember" | "account" | "usage">;
2
+ getState: () => import("@bpinternal/opapi").State<"Bot" | "Integration" | "Workspace" | "WorkspaceMember" | "Account" | "Usage" | "Issue" | "IssueEvent" | "User" | "Conversation" | "Event" | "Message" | "State" | "File", "x-workspace-id", "user" | "conversation" | "event" | "message" | "file" | "state" | "hub" | "action" | "bot" | "integration" | "workspace" | "workspaceMember" | "account" | "usage" | "quotas">;
3
3
  getModelRef: (name: "Bot" | "Integration" | "Workspace" | "WorkspaceMember" | "Account" | "Usage" | "Issue" | "IssueEvent" | "User" | "Conversation" | "Event" | "Message" | "State" | "File") => import("@bpinternal/opapi").OpenApiZodAny;
4
- addOperation: <Path extends string>(operationProps: import("@bpinternal/opapi").Operation<"x-workspace-id", "user" | "conversation" | "event" | "message" | "file" | "state" | "hub" | "action" | "bot" | "integration" | "workspace" | "workspaceMember" | "account" | "usage", Path, "zod-schema">) => void;
4
+ addOperation: <Path extends string>(operationProps: import("@bpinternal/opapi").Operation<"x-workspace-id", "user" | "conversation" | "event" | "message" | "file" | "state" | "hub" | "action" | "bot" | "integration" | "workspace" | "workspaceMember" | "account" | "usage" | "quotas", Path, "zod-schema">) => void;
5
5
  exportClient: (dir: string | undefined, openapiGeneratorEndpoint: string, postProcessors?: import("@bpinternal/opapi").OpenApiPostProcessors | undefined) => Promise<void>;
6
6
  exportTypesBySection: (dir?: string | undefined) => Promise<void>;
7
7
  exportServer: (dir: string | undefined, useExpressTypes: boolean) => Promise<void>;
package/dist/index.js CHANGED
@@ -430021,7 +430021,9 @@ var state = {
430021
430021
  "table_row_count",
430022
430022
  "workspace_member_count",
430023
430023
  "integrations_owned_count",
430024
- "ai_spend"
430024
+ "ai_spend",
430025
+ "openai_spend",
430026
+ "bing_search_spend"
430025
430027
  ],
430026
430028
  required: true
430027
430029
  },
@@ -430079,7 +430081,9 @@ var state = {
430079
430081
  "table_row_count",
430080
430082
  "workspace_member_count",
430081
430083
  "integrations_owned_count",
430082
- "ai_spend"
430084
+ "ai_spend",
430085
+ "openai_spend",
430086
+ "bing_search_spend"
430083
430087
  ],
430084
430088
  required: true
430085
430089
  },
@@ -430118,7 +430122,9 @@ var state = {
430118
430122
  "table_row_count",
430119
430123
  "workspace_member_count",
430120
430124
  "integrations_owned_count",
430121
- "ai_spend"
430125
+ "ai_spend",
430126
+ "openai_spend",
430127
+ "bing_search_spend"
430122
430128
  ],
430123
430129
  description: "Usage type that can be used"
430124
430130
  }
@@ -430185,7 +430191,9 @@ var state = {
430185
430191
  "table_row_count",
430186
430192
  "workspace_member_count",
430187
430193
  "integrations_owned_count",
430188
- "ai_spend"
430194
+ "ai_spend",
430195
+ "openai_spend",
430196
+ "bing_search_spend"
430189
430197
  ],
430190
430198
  description: "Usage type that can be used"
430191
430199
  }
@@ -431802,7 +431810,9 @@ var state = {
431802
431810
  "table_row_count",
431803
431811
  "workspace_member_count",
431804
431812
  "integrations_owned_count",
431805
- "ai_spend"
431813
+ "ai_spend",
431814
+ "openai_spend",
431815
+ "bing_search_spend"
431806
431816
  ],
431807
431817
  required: true
431808
431818
  },
@@ -431814,7 +431824,7 @@ var state = {
431814
431824
  },
431815
431825
  id: {
431816
431826
  type: "string",
431817
- description: "id of a bot or a workspace depending on the usage type",
431827
+ description: 'ID of a bot or a workspace, depending on the "type" parameter',
431818
431828
  in: "path"
431819
431829
  }
431820
431830
  },
@@ -431853,13 +431863,15 @@ var state = {
431853
431863
  "table_row_count",
431854
431864
  "workspace_member_count",
431855
431865
  "integrations_owned_count",
431856
- "ai_spend"
431866
+ "ai_spend",
431867
+ "openai_spend",
431868
+ "bing_search_spend"
431857
431869
  ],
431858
431870
  required: true
431859
431871
  },
431860
431872
  id: {
431861
431873
  type: "string",
431862
- description: "id of a bot or a workspace depending on the usage type",
431874
+ description: 'ID of a bot or a workspace, depending on the "type" parameter',
431863
431875
  in: "path"
431864
431876
  }
431865
431877
  },
@@ -431881,6 +431893,36 @@ var state = {
431881
431893
  }
431882
431894
  }
431883
431895
  },
431896
+ changeAISpendQuota: {
431897
+ name: "changeAISpendQuota",
431898
+ path: "/v1/admin/quotas/ai-spend",
431899
+ description: "Change AI Spend quota",
431900
+ method: "put",
431901
+ section: "quotas",
431902
+ requestBody: {
431903
+ description: "New AI Spend quota",
431904
+ schema: {
431905
+ type: "object",
431906
+ properties: {
431907
+ monthlySpendingLimit: {
431908
+ type: "number"
431909
+ }
431910
+ },
431911
+ required: ["monthlySpendingLimit"],
431912
+ title: "changeAISpendQuotaBody",
431913
+ additionalProperties: false
431914
+ }
431915
+ },
431916
+ response: {
431917
+ description: "Success",
431918
+ schema: {
431919
+ type: "object",
431920
+ title: "changeAISpendQuotaResponse",
431921
+ additionalProperties: false
431922
+ }
431923
+ },
431924
+ parameters: {}
431925
+ },
431884
431926
  introspect: {
431885
431927
  name: "introspect",
431886
431928
  description: "Introspect the API",
@@ -432099,7 +432141,7 @@ var state = {
432099
432141
  title: "Botpress API",
432100
432142
  description: "API for Botpress Cloud",
432101
432143
  server: "https://api.botpress.cloud",
432102
- version: "0.14.0",
432144
+ version: "0.15.0",
432103
432145
  prefix: "v1"
432104
432146
  },
432105
432147
  errors: [
@@ -432240,6 +432282,7 @@ var state = {
432240
432282
  updateWorkspaceMemberBody: true,
432241
432283
  createIntegrationBody: true,
432242
432284
  updateIntegrationBody: true,
432285
+ changeAISpendQuotaBody: true,
432243
432286
  introspectBody: true,
432244
432287
  createFileBody: true
432245
432288
  },
@@ -432320,6 +432363,7 @@ var state = {
432320
432363
  deleteIntegrationResponse: true,
432321
432364
  getUsageResponse: true,
432322
432365
  listUsageHistoryResponse: true,
432366
+ changeAISpendQuotaResponse: true,
432323
432367
  introspectResponse: true,
432324
432368
  createFileResponse: true,
432325
432369
  getFileResponse: true,
@@ -433227,7 +433271,9 @@ var state = {
433227
433271
  "table_row_count",
433228
433272
  "workspace_member_count",
433229
433273
  "integrations_owned_count",
433230
- "ai_spend"
433274
+ "ai_spend",
433275
+ "openai_spend",
433276
+ "bing_search_spend"
433231
433277
  ],
433232
433278
  description: "Usage type that can be used"
433233
433279
  }
@@ -433729,8 +433775,8 @@ var state = {
433729
433775
  schema: "State"
433730
433776
  },
433731
433777
  {
433732
- description: "",
433733
433778
  title: "Hub",
433779
+ description: "",
433734
433780
  name: "hub",
433735
433781
  operations: [
433736
433782
  "listPublicIntegrations",
@@ -433745,8 +433791,8 @@ var state = {
433745
433791
  operations: ["callAction"]
433746
433792
  },
433747
433793
  {
433748
- description: "",
433749
433794
  title: "Bot",
433795
+ description: "",
433750
433796
  name: "bot",
433751
433797
  operations: [
433752
433798
  "createBot",
@@ -433765,8 +433811,8 @@ var state = {
433765
433811
  schema: "Bot"
433766
433812
  },
433767
433813
  {
433768
- description: "",
433769
433814
  title: "Integration",
433815
+ description: "",
433770
433816
  name: "integration",
433771
433817
  operations: [
433772
433818
  "createIntegration",
@@ -433780,8 +433826,8 @@ var state = {
433780
433826
  schema: "Integration"
433781
433827
  },
433782
433828
  {
433783
- description: "",
433784
433829
  title: "Workspace",
433830
+ description: "",
433785
433831
  name: "workspace",
433786
433832
  operations: [
433787
433833
  "getWorkspaceBillingDetails",
@@ -433802,8 +433848,8 @@ var state = {
433802
433848
  schema: "Workspace"
433803
433849
  },
433804
433850
  {
433805
- description: "",
433806
433851
  title: "Workspace Member",
433852
+ description: "",
433807
433853
  name: "workspaceMember",
433808
433854
  operations: [
433809
433855
  "listWorkspaceMembers",
@@ -433814,8 +433860,8 @@ var state = {
433814
433860
  schema: "WorkspaceMember"
433815
433861
  },
433816
433862
  {
433817
- description: "",
433818
433863
  title: "Account",
433864
+ description: "",
433819
433865
  name: "account",
433820
433866
  operations: [
433821
433867
  "getAccount",
@@ -433826,11 +433872,17 @@ var state = {
433826
433872
  schema: "Account"
433827
433873
  },
433828
433874
  {
433829
- description: "",
433830
433875
  title: "Usage",
433876
+ description: "",
433831
433877
  name: "usage",
433832
433878
  operations: ["getUsage"],
433833
433879
  schema: "Usage"
433880
+ },
433881
+ {
433882
+ title: "Quotas",
433883
+ description: "",
433884
+ name: "quotas",
433885
+ operations: ["changeAISpendQuota"]
433834
433886
  }
433835
433887
  ],
433836
433888
  options: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botpress/api",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -1 +1 @@
1
- {"sections":[{"description":"","title":"User","name":"user","operations":["createUser","getUser","listUsers","getOrCreateUser","updateUser","deleteUser"],"schema":"User"},{"description":"","title":"Conversation","name":"conversation","operations":["createConversation","getConversation","listConversations","getOrCreateConversation","updateConversation","deleteConversation","listParticipants","addParticipant","getParticipant","removeParticipant"],"schema":"Conversation"},{"description":"","title":"Event","name":"event","operations":["createEvent","getEvent","listEvents"],"schema":"Event"},{"description":"","title":"Message","name":"message","operations":["createMessage","getOrCreateMessage","getMessage","updateMessage","listMessages","deleteMessage"],"schema":"Message"},{"description":"","title":"File","name":"file","operations":["createFile","getFile","downloadFile","deleteFile","listFiles"],"schema":"File"},{"description":"","title":"State","name":"state","operations":["getState","setState","patchState"],"schema":"State"},{"description":"","title":"Hub","name":"hub","operations":["listPublicIntegrations","getPublicIntegrationById","getPublicIntegration"]},{"description":"","title":"Action","name":"action","operations":["callAction"]},{"description":"","title":"Bot","name":"bot","operations":["createBot","updateBot","transferBot","listBots","getBot","deleteBot","getBotLogs","getBotWebchat","getBotAnalytics","listBotIssues","deleteBotIssue","listBotIssueEvents"],"schema":"Bot"},{"description":"","title":"Integration","name":"integration","operations":["createIntegration","updateIntegration","listIntegrations","getIntegration","getIntegrationLogs","getIntegrationByName","deleteIntegration"],"schema":"Integration"},{"description":"","title":"Workspace","name":"workspace","operations":["getWorkspaceBillingDetails","setWorkspacePaymentMethod","listWorkspaceInvoices","chargeWorkspaceUnpaidInvoices","createWorkspace","getWorkspace","listWorkspaceUsages","getWorkspaceQuota","listWorkspaceQuotas","updateWorkspace","listWorkspaces","changeWorkspacePlan","deleteWorkspace","getAuditRecords"],"schema":"Workspace"},{"description":"","title":"Workspace Member","name":"workspaceMember","operations":["listWorkspaceMembers","deleteWorkspaceMember","createWorkspaceMember","updateWorkspaceMember"],"schema":"WorkspaceMember"},{"description":"","title":"Account","name":"account","operations":["getAccount","listPersonalAccessTokens","createPersonalAccessToken","deletePersonalAccessToken"],"schema":"Account"},{"description":"","title":"Usage","name":"usage","operations":["getUsage"],"schema":"Usage"}],"errors":[{"status":500,"type":"Unknown","description":"An unknown error occurred"},{"status":500,"type":"Internal","description":"An internal error occurred"},{"status":401,"type":"Unauthorized","description":"The request requires to be authenticated."},{"status":403,"type":"Forbidden","description":"The requested action can't be peform by this resource."},{"status":413,"type":"PayloadTooLarge","description":"The request payload is too large."},{"status":400,"type":"InvalidPayload","description":"The request payload is invalid."},{"status":415,"type":"UnsupportedMediaType","description":"The request is invalid because the content-type is not supported."},{"status":405,"type":"MethodNotFound","description":"The requested method does not exist."},{"status":404,"type":"ResourceNotFound","description":"The requested resource does not exist."},{"status":400,"type":"InvalidJsonSchema","description":"The provided JSON schema is invalid."},{"status":400,"type":"InvalidDataFormat","description":"The provided data doesn't respect the provided JSON schema."},{"status":400,"type":"InvalidIdentifier","description":"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."},{"status":409,"type":"RelationConflict","description":"The resource is not related with another resource. This is usually caused when providing two resources that aren't linked together."},{"status":400,"type":"ReferenceNotFound","description":"The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request."},{"status":400,"type":"InvalidQuery","description":"The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource."},{"status":400,"type":"Runtime","description":"An error happened during the execution of a runtime (bot or integration)."},{"status":409,"type":"AlreadyExists","description":"The record attempted to be created already exists."},{"status":429,"type":"RateLimited","description":"The request has been rate limited."},{"status":402,"type":"PaymentRequired","description":"A payment is required to perform this request."},{"status":403,"type":"QuotaExceeded","description":"The request exceeds the allowed quota. Quotas are a soft limit that can be increased."},{"status":413,"type":"LimitExceeded","description":"The request exceeds the allowed limit. Limits are a hard limit that cannot be increased."}]}
1
+ {"sections":[{"description":"","title":"User","name":"user","operations":["createUser","getUser","listUsers","getOrCreateUser","updateUser","deleteUser"],"schema":"User"},{"description":"","title":"Conversation","name":"conversation","operations":["createConversation","getConversation","listConversations","getOrCreateConversation","updateConversation","deleteConversation","listParticipants","addParticipant","getParticipant","removeParticipant"],"schema":"Conversation"},{"description":"","title":"Event","name":"event","operations":["createEvent","getEvent","listEvents"],"schema":"Event"},{"description":"","title":"Message","name":"message","operations":["createMessage","getOrCreateMessage","getMessage","updateMessage","listMessages","deleteMessage"],"schema":"Message"},{"description":"","title":"File","name":"file","operations":["createFile","getFile","downloadFile","deleteFile","listFiles"],"schema":"File"},{"description":"","title":"State","name":"state","operations":["getState","setState","patchState"],"schema":"State"},{"title":"Hub","description":"","name":"hub","operations":["listPublicIntegrations","getPublicIntegrationById","getPublicIntegration"]},{"description":"","title":"Action","name":"action","operations":["callAction"]},{"title":"Bot","description":"","name":"bot","operations":["createBot","updateBot","transferBot","listBots","getBot","deleteBot","getBotLogs","getBotWebchat","getBotAnalytics","listBotIssues","deleteBotIssue","listBotIssueEvents"],"schema":"Bot"},{"title":"Integration","description":"","name":"integration","operations":["createIntegration","updateIntegration","listIntegrations","getIntegration","getIntegrationLogs","getIntegrationByName","deleteIntegration"],"schema":"Integration"},{"title":"Workspace","description":"","name":"workspace","operations":["getWorkspaceBillingDetails","setWorkspacePaymentMethod","listWorkspaceInvoices","chargeWorkspaceUnpaidInvoices","createWorkspace","getWorkspace","listWorkspaceUsages","getWorkspaceQuota","listWorkspaceQuotas","updateWorkspace","listWorkspaces","changeWorkspacePlan","deleteWorkspace","getAuditRecords"],"schema":"Workspace"},{"title":"Workspace Member","description":"","name":"workspaceMember","operations":["listWorkspaceMembers","deleteWorkspaceMember","createWorkspaceMember","updateWorkspaceMember"],"schema":"WorkspaceMember"},{"title":"Account","description":"","name":"account","operations":["getAccount","listPersonalAccessTokens","createPersonalAccessToken","deletePersonalAccessToken"],"schema":"Account"},{"title":"Usage","description":"","name":"usage","operations":["getUsage"],"schema":"Usage"},{"title":"Quotas","description":"","name":"quotas","operations":["changeAISpendQuota"]}],"errors":[{"status":500,"type":"Unknown","description":"An unknown error occurred"},{"status":500,"type":"Internal","description":"An internal error occurred"},{"status":401,"type":"Unauthorized","description":"The request requires to be authenticated."},{"status":403,"type":"Forbidden","description":"The requested action can't be peform by this resource."},{"status":413,"type":"PayloadTooLarge","description":"The request payload is too large."},{"status":400,"type":"InvalidPayload","description":"The request payload is invalid."},{"status":415,"type":"UnsupportedMediaType","description":"The request is invalid because the content-type is not supported."},{"status":405,"type":"MethodNotFound","description":"The requested method does not exist."},{"status":404,"type":"ResourceNotFound","description":"The requested resource does not exist."},{"status":400,"type":"InvalidJsonSchema","description":"The provided JSON schema is invalid."},{"status":400,"type":"InvalidDataFormat","description":"The provided data doesn't respect the provided JSON schema."},{"status":400,"type":"InvalidIdentifier","description":"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."},{"status":409,"type":"RelationConflict","description":"The resource is not related with another resource. This is usually caused when providing two resources that aren't linked together."},{"status":400,"type":"ReferenceNotFound","description":"The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request."},{"status":400,"type":"InvalidQuery","description":"The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource."},{"status":400,"type":"Runtime","description":"An error happened during the execution of a runtime (bot or integration)."},{"status":409,"type":"AlreadyExists","description":"The record attempted to be created already exists."},{"status":429,"type":"RateLimited","description":"The request has been rate limited."},{"status":402,"type":"PaymentRequired","description":"A payment is required to perform this request."},{"status":403,"type":"QuotaExceeded","description":"The request exceeds the allowed quota. Quotas are a soft limit that can be increased."},{"status":413,"type":"LimitExceeded","description":"The request exceeds the allowed limit. Limits are a hard limit that cannot be increased."}]}