@botpress/api 0.7.1 → 0.7.2

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.js CHANGED
@@ -428322,6 +428322,206 @@ var state = {
428322
428322
  }
428323
428323
  }
428324
428324
  },
428325
+ listWorkspaceUsages: {
428326
+ name: "listWorkspaceUsages",
428327
+ description: "List workspace usages",
428328
+ section: "workspace",
428329
+ method: "get",
428330
+ path: "/v1/admin/workspaces/{id}/usages",
428331
+ disableDefaultParameters: {
428332
+ "x-workspace-id": true
428333
+ },
428334
+ parameters: {
428335
+ id: {
428336
+ type: "string",
428337
+ description: "Workspace ID",
428338
+ in: "path"
428339
+ },
428340
+ type: {
428341
+ in: "query",
428342
+ description: "Type of usage",
428343
+ type: "string",
428344
+ enum: [
428345
+ "invocation_timeout",
428346
+ "invocation_calls",
428347
+ "storage_count",
428348
+ "bot_count",
428349
+ "knowledgebase_vector_count",
428350
+ "bot_ratelimit",
428351
+ "table_row_count",
428352
+ "workspace_member_count"
428353
+ ],
428354
+ required: true
428355
+ },
428356
+ period: {
428357
+ in: "query",
428358
+ description: "Period to get",
428359
+ type: "string",
428360
+ required: false
428361
+ }
428362
+ },
428363
+ response: {
428364
+ description: "Success",
428365
+ schema: {
428366
+ type: "object",
428367
+ properties: {
428368
+ usages: {
428369
+ type: "array",
428370
+ items: {
428371
+ $ref: "#/components/schemas/Usage"
428372
+ }
428373
+ }
428374
+ },
428375
+ required: ["usages"],
428376
+ title: "listWorkspaceUsagesResponse",
428377
+ additionalProperties: false
428378
+ }
428379
+ }
428380
+ },
428381
+ getWorkspaceQuota: {
428382
+ name: "getWorkspaceQuota",
428383
+ description: "Get workspace quota",
428384
+ section: "workspace",
428385
+ method: "get",
428386
+ path: "/v1/admin/workspaces/{id}/quota",
428387
+ disableDefaultParameters: {
428388
+ "x-workspace-id": true
428389
+ },
428390
+ parameters: {
428391
+ id: {
428392
+ type: "string",
428393
+ description: "Workspace ID",
428394
+ in: "path"
428395
+ },
428396
+ type: {
428397
+ in: "query",
428398
+ description: "Type of usage",
428399
+ type: "string",
428400
+ enum: [
428401
+ "invocation_timeout",
428402
+ "invocation_calls",
428403
+ "storage_count",
428404
+ "bot_count",
428405
+ "knowledgebase_vector_count",
428406
+ "bot_ratelimit",
428407
+ "table_row_count",
428408
+ "workspace_member_count"
428409
+ ],
428410
+ required: true
428411
+ },
428412
+ period: {
428413
+ in: "query",
428414
+ description: "Period to get",
428415
+ type: "string",
428416
+ required: false
428417
+ }
428418
+ },
428419
+ response: {
428420
+ description: "Success",
428421
+ schema: {
428422
+ type: "object",
428423
+ properties: {
428424
+ quota: {
428425
+ type: "object",
428426
+ properties: {
428427
+ period: {
428428
+ type: "string",
428429
+ description: "Period of the quota that it is applied to"
428430
+ },
428431
+ value: {
428432
+ type: "number",
428433
+ description: "Value of the quota that is used"
428434
+ },
428435
+ type: {
428436
+ type: "string",
428437
+ enum: [
428438
+ "invocation_timeout",
428439
+ "invocation_calls",
428440
+ "storage_count",
428441
+ "bot_count",
428442
+ "knowledgebase_vector_count",
428443
+ "bot_ratelimit",
428444
+ "table_row_count",
428445
+ "workspace_member_count"
428446
+ ],
428447
+ description: "Usage type that can be used"
428448
+ }
428449
+ },
428450
+ required: ["period", "value", "type"],
428451
+ additionalProperties: false
428452
+ }
428453
+ },
428454
+ required: ["quota"],
428455
+ title: "getWorkspaceQuotaResponse",
428456
+ additionalProperties: false
428457
+ }
428458
+ }
428459
+ },
428460
+ listWorkspaceQuotas: {
428461
+ name: "listWorkspaceQuotas",
428462
+ description: "List workspace quotas",
428463
+ section: "workspace",
428464
+ method: "get",
428465
+ path: "/v1/admin/workspaces/{id}/quotas",
428466
+ disableDefaultParameters: {
428467
+ "x-workspace-id": true
428468
+ },
428469
+ parameters: {
428470
+ id: {
428471
+ type: "string",
428472
+ description: "Workspace ID",
428473
+ in: "path"
428474
+ },
428475
+ period: {
428476
+ in: "query",
428477
+ description: "Period to get",
428478
+ type: "string",
428479
+ required: false
428480
+ }
428481
+ },
428482
+ response: {
428483
+ description: "Success",
428484
+ schema: {
428485
+ type: "object",
428486
+ properties: {
428487
+ quotas: {
428488
+ type: "array",
428489
+ items: {
428490
+ type: "object",
428491
+ properties: {
428492
+ period: {
428493
+ type: "string",
428494
+ description: "Period of the quota that it is applied to"
428495
+ },
428496
+ value: {
428497
+ type: "number",
428498
+ description: "Value of the quota that is used"
428499
+ },
428500
+ type: {
428501
+ type: "string",
428502
+ enum: [
428503
+ "invocation_timeout",
428504
+ "invocation_calls",
428505
+ "storage_count",
428506
+ "bot_count",
428507
+ "knowledgebase_vector_count",
428508
+ "bot_ratelimit",
428509
+ "table_row_count",
428510
+ "workspace_member_count"
428511
+ ],
428512
+ description: "Usage type that can be used"
428513
+ }
428514
+ },
428515
+ required: ["period", "value", "type"]
428516
+ }
428517
+ }
428518
+ },
428519
+ required: ["quotas"],
428520
+ title: "listWorkspaceQuotasResponse",
428521
+ additionalProperties: false
428522
+ }
428523
+ }
428524
+ },
428325
428525
  updateWorkspace: {
428326
428526
  name: "updateWorkspace",
428327
428527
  description: "Update workspace",
@@ -429825,6 +430025,102 @@ var state = {
429825
430025
  }
429826
430026
  }
429827
430027
  },
430028
+ getUsage: {
430029
+ name: "getUsage",
430030
+ path: "/v1/admin/usages/{id}",
430031
+ description: "Get usage",
430032
+ method: "get",
430033
+ section: "usage",
430034
+ parameters: {
430035
+ type: {
430036
+ in: "query",
430037
+ description: "Type of usage",
430038
+ type: "string",
430039
+ enum: [
430040
+ "invocation_timeout",
430041
+ "invocation_calls",
430042
+ "storage_count",
430043
+ "bot_count",
430044
+ "knowledgebase_vector_count",
430045
+ "bot_ratelimit",
430046
+ "table_row_count",
430047
+ "workspace_member_count"
430048
+ ],
430049
+ required: true
430050
+ },
430051
+ period: {
430052
+ in: "query",
430053
+ description: "Period to get",
430054
+ type: "string",
430055
+ required: false
430056
+ },
430057
+ id: {
430058
+ type: "string",
430059
+ description: "id of a bot or a workspace depending on the usage type",
430060
+ in: "path"
430061
+ }
430062
+ },
430063
+ response: {
430064
+ description: "Success",
430065
+ schema: {
430066
+ type: "object",
430067
+ properties: {
430068
+ usage: {
430069
+ $ref: "#/components/schemas/Usage"
430070
+ }
430071
+ },
430072
+ required: ["usage"],
430073
+ title: "getUsageResponse",
430074
+ additionalProperties: false
430075
+ }
430076
+ }
430077
+ },
430078
+ listUsageHistory: {
430079
+ name: "listUsageHistory",
430080
+ path: "/v1/admin/usages/{id}/history",
430081
+ method: "get",
430082
+ description: "Get usage history",
430083
+ parameters: {
430084
+ type: {
430085
+ in: "query",
430086
+ description: "Type of usage",
430087
+ type: "string",
430088
+ enum: [
430089
+ "invocation_timeout",
430090
+ "invocation_calls",
430091
+ "storage_count",
430092
+ "bot_count",
430093
+ "knowledgebase_vector_count",
430094
+ "bot_ratelimit",
430095
+ "table_row_count",
430096
+ "workspace_member_count"
430097
+ ],
430098
+ required: true
430099
+ },
430100
+ id: {
430101
+ type: "string",
430102
+ description: "id of a bot or a workspace depending on the usage type",
430103
+ in: "path"
430104
+ }
430105
+ },
430106
+ response: {
430107
+ description: "Success",
430108
+ schema: {
430109
+ type: "object",
430110
+ properties: {
430111
+ usages: {
430112
+ type: "array",
430113
+ items: {
430114
+ $ref: "#/components/schemas/Usage"
430115
+ }
430116
+ }
430117
+ },
430118
+ required: ["usages"],
430119
+ title: "listUsageHistoryResponse",
430120
+ additionalProperties: false
430121
+ }
430122
+ }
430123
+ },
429828
430124
  introspect: {
429829
430125
  name: "introspect",
429830
430126
  description: "Introspect the API",
@@ -430043,7 +430339,7 @@ var state = {
430043
430339
  title: "Botpress API",
430044
430340
  description: "API for Botpress Cloud",
430045
430341
  server: "https://api.botpress.cloud",
430046
- version: "0.7.1",
430342
+ version: "0.7.2",
430047
430343
  prefix: "v1"
430048
430344
  },
430049
430345
  errors: [
@@ -430143,7 +430439,7 @@ var state = {
430143
430439
  description: "A payment is required to perform this request."
430144
430440
  },
430145
430441
  {
430146
- status: 429,
430442
+ status: 403,
430147
430443
  type: "QuotaExceeded",
430148
430444
  description: "The request exceeds the allowed quota. Quotas are a soft limit that can be increased."
430149
430445
  },
@@ -430229,6 +430525,9 @@ var state = {
430229
430525
  getBotAnalyticsResponse: true,
430230
430526
  createWorkspaceResponse: true,
430231
430527
  getWorkspaceResponse: true,
430528
+ listWorkspaceUsagesResponse: true,
430529
+ getWorkspaceQuotaResponse: true,
430530
+ listWorkspaceQuotasResponse: true,
430232
430531
  updateWorkspaceResponse: true,
430233
430532
  listWorkspacesResponse: true,
430234
430533
  changeWorkspacePlanResponse: true,
@@ -430245,6 +430544,8 @@ var state = {
430245
430544
  getIntegrationLogsResponse: true,
430246
430545
  getIntegrationByNameResponse: true,
430247
430546
  deleteIntegrationResponse: true,
430547
+ getUsageResponse: true,
430548
+ listUsageHistoryResponse: true,
430248
430549
  introspectResponse: true,
430249
430550
  createFileResponse: true,
430250
430551
  getFileResponse: true,
@@ -430258,6 +430559,7 @@ var state = {
430258
430559
  Workspace: true,
430259
430560
  WorkspaceMember: true,
430260
430561
  Account: true,
430562
+ Usage: true,
430261
430563
  User: true,
430262
430564
  Conversation: true,
430263
430565
  Event: true,
@@ -431048,6 +431350,46 @@ var state = {
431048
431350
  additionalProperties: false
431049
431351
  }
431050
431352
  },
431353
+ Usage: {
431354
+ section: "usage",
431355
+ schema: {
431356
+ type: "object",
431357
+ properties: {
431358
+ id: {
431359
+ type: "string",
431360
+ description: "Id of the usage that it is linked to. It can either be a workspace id or a bot id"
431361
+ },
431362
+ period: {
431363
+ type: "string",
431364
+ description: "Period of the quota that it is applied to"
431365
+ },
431366
+ value: {
431367
+ type: "number",
431368
+ description: "Value of the current usage"
431369
+ },
431370
+ quota: {
431371
+ type: "number",
431372
+ description: "Quota of the current usage"
431373
+ },
431374
+ type: {
431375
+ type: "string",
431376
+ enum: [
431377
+ "invocation_timeout",
431378
+ "invocation_calls",
431379
+ "storage_count",
431380
+ "bot_count",
431381
+ "knowledgebase_vector_count",
431382
+ "bot_ratelimit",
431383
+ "table_row_count",
431384
+ "workspace_member_count"
431385
+ ],
431386
+ description: "Usage type that can be used"
431387
+ }
431388
+ },
431389
+ required: ["id", "period", "value", "quota", "type"],
431390
+ additionalProperties: false
431391
+ }
431392
+ },
431051
431393
  User: {
431052
431394
  section: "user",
431053
431395
  schema: {
@@ -431439,6 +431781,9 @@ var state = {
431439
431781
  operations: [
431440
431782
  "createWorkspace",
431441
431783
  "getWorkspace",
431784
+ "listWorkspaceUsages",
431785
+ "getWorkspaceQuota",
431786
+ "listWorkspaceQuotas",
431442
431787
  "updateWorkspace",
431443
431788
  "listWorkspaces",
431444
431789
  "changeWorkspacePlan",
@@ -431470,6 +431815,13 @@ var state = {
431470
431815
  "deletePersonalAccessToken"
431471
431816
  ],
431472
431817
  schema: "Account"
431818
+ },
431819
+ {
431820
+ description: "",
431821
+ title: "Usage",
431822
+ name: "usage",
431823
+ operations: ["getUsage"],
431824
+ schema: "Usage"
431473
431825
  }
431474
431826
  ]
431475
431827
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botpress/api",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
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"],"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"],"schema":"Bot"},{"description":"","title":"Integration","name":"integration","operations":["createIntegration","updateIntegration","listIntegrations","getIntegration","getIntegrationLogs","getIntegrationByName","deleteIntegration"],"schema":"Integration"},{"description":"","title":"Workspace","name":"workspace","operations":["createWorkspace","getWorkspace","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"}],"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":429,"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"],"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"],"schema":"Bot"},{"description":"","title":"Integration","name":"integration","operations":["createIntegration","updateIntegration","listIntegrations","getIntegration","getIntegrationLogs","getIntegrationByName","deleteIntegration"],"schema":"Integration"},{"description":"","title":"Workspace","name":"workspace","operations":["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."}]}