@botpress/api 0.7.0 → 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/src/gen/state.ts CHANGED
@@ -1279,6 +1279,131 @@ export const state = {
1279
1279
  },
1280
1280
  parameters: {},
1281
1281
  },
1282
+ listPersonalAccessTokens: {
1283
+ name: "listPersonalAccessTokens",
1284
+ description: "List PATs (Personal Access Tokens) of account.",
1285
+ method: "get",
1286
+ path: "/v1/admin/account/pats",
1287
+ section: "account",
1288
+ disableDefaultParameters: {
1289
+ "x-workspace-id": true,
1290
+ },
1291
+ response: {
1292
+ description: "Success",
1293
+ schema: {
1294
+ type: "object",
1295
+ properties: {
1296
+ pats: {
1297
+ type: "array",
1298
+ items: {
1299
+ type: "object",
1300
+ properties: {
1301
+ id: {
1302
+ type: "string",
1303
+ },
1304
+ createdAt: {
1305
+ type: "string",
1306
+ format: "date-time",
1307
+ },
1308
+ note: {
1309
+ type: "string",
1310
+ },
1311
+ },
1312
+ required: ["id", "createdAt", "note"],
1313
+ },
1314
+ },
1315
+ },
1316
+ required: ["pats"],
1317
+ title: "listPersonalAccessTokensResponse",
1318
+ additionalProperties: false,
1319
+ },
1320
+ },
1321
+ parameters: {},
1322
+ },
1323
+ createPersonalAccessToken: {
1324
+ name: "createPersonalAccessToken",
1325
+ description: "Create a PAT",
1326
+ method: "post",
1327
+ path: "/v1/admin/account/pats",
1328
+ section: "account",
1329
+ disableDefaultParameters: {
1330
+ "x-workspace-id": true,
1331
+ },
1332
+ requestBody: {
1333
+ description: "",
1334
+ schema: {
1335
+ type: "object",
1336
+ properties: {
1337
+ note: {
1338
+ type: "string",
1339
+ description: "Note to identify the PAT",
1340
+ },
1341
+ },
1342
+ required: ["note"],
1343
+ title: "createPersonalAccessTokenBody",
1344
+ additionalProperties: false,
1345
+ },
1346
+ },
1347
+ response: {
1348
+ description: "Success",
1349
+ schema: {
1350
+ type: "object",
1351
+ properties: {
1352
+ pat: {
1353
+ type: "object",
1354
+ properties: {
1355
+ id: {
1356
+ type: "string",
1357
+ },
1358
+ createdAt: {
1359
+ type: "string",
1360
+ format: "date-time",
1361
+ },
1362
+ note: {
1363
+ type: "string",
1364
+ },
1365
+ value: {
1366
+ type: "string",
1367
+ description:
1368
+ "The PAT value. This will only be returned here when created and cannot be retrieved later.",
1369
+ },
1370
+ },
1371
+ required: ["id", "createdAt", "note", "value"],
1372
+ additionalProperties: false,
1373
+ },
1374
+ },
1375
+ required: ["pat"],
1376
+ title: "createPersonalAccessTokenResponse",
1377
+ additionalProperties: false,
1378
+ },
1379
+ },
1380
+ parameters: {},
1381
+ },
1382
+ deletePersonalAccessToken: {
1383
+ name: "deletePersonalAccessToken",
1384
+ description: "Delete a PAT",
1385
+ method: "delete",
1386
+ path: "/v1/admin/account/pats/{id}",
1387
+ section: "account",
1388
+ disableDefaultParameters: {
1389
+ "x-workspace-id": true,
1390
+ },
1391
+ parameters: {
1392
+ id: {
1393
+ type: "string",
1394
+ description: "ID of Personal Access Token",
1395
+ in: "path",
1396
+ },
1397
+ },
1398
+ response: {
1399
+ description: "Success",
1400
+ schema: {
1401
+ type: "object",
1402
+ title: "deletePersonalAccessTokenResponse",
1403
+ additionalProperties: false,
1404
+ },
1405
+ },
1406
+ },
1282
1407
  listPublicIntegrations: {
1283
1408
  name: "listPublicIntegrations",
1284
1409
  description: "List public integration",
@@ -2462,6 +2587,206 @@ export const state = {
2462
2587
  },
2463
2588
  },
2464
2589
  },
2590
+ listWorkspaceUsages: {
2591
+ name: "listWorkspaceUsages",
2592
+ description: "List workspace usages",
2593
+ section: "workspace",
2594
+ method: "get",
2595
+ path: "/v1/admin/workspaces/{id}/usages",
2596
+ disableDefaultParameters: {
2597
+ "x-workspace-id": true,
2598
+ },
2599
+ parameters: {
2600
+ id: {
2601
+ type: "string",
2602
+ description: "Workspace ID",
2603
+ in: "path",
2604
+ },
2605
+ type: {
2606
+ in: "query",
2607
+ description: "Type of usage",
2608
+ type: "string",
2609
+ enum: [
2610
+ "invocation_timeout",
2611
+ "invocation_calls",
2612
+ "storage_count",
2613
+ "bot_count",
2614
+ "knowledgebase_vector_count",
2615
+ "bot_ratelimit",
2616
+ "table_row_count",
2617
+ "workspace_member_count",
2618
+ ],
2619
+ required: true,
2620
+ },
2621
+ period: {
2622
+ in: "query",
2623
+ description: "Period to get",
2624
+ type: "string",
2625
+ required: false,
2626
+ },
2627
+ },
2628
+ response: {
2629
+ description: "Success",
2630
+ schema: {
2631
+ type: "object",
2632
+ properties: {
2633
+ usages: {
2634
+ type: "array",
2635
+ items: {
2636
+ $ref: "#/components/schemas/Usage",
2637
+ },
2638
+ },
2639
+ },
2640
+ required: ["usages"],
2641
+ title: "listWorkspaceUsagesResponse",
2642
+ additionalProperties: false,
2643
+ },
2644
+ },
2645
+ },
2646
+ getWorkspaceQuota: {
2647
+ name: "getWorkspaceQuota",
2648
+ description: "Get workspace quota",
2649
+ section: "workspace",
2650
+ method: "get",
2651
+ path: "/v1/admin/workspaces/{id}/quota",
2652
+ disableDefaultParameters: {
2653
+ "x-workspace-id": true,
2654
+ },
2655
+ parameters: {
2656
+ id: {
2657
+ type: "string",
2658
+ description: "Workspace ID",
2659
+ in: "path",
2660
+ },
2661
+ type: {
2662
+ in: "query",
2663
+ description: "Type of usage",
2664
+ type: "string",
2665
+ enum: [
2666
+ "invocation_timeout",
2667
+ "invocation_calls",
2668
+ "storage_count",
2669
+ "bot_count",
2670
+ "knowledgebase_vector_count",
2671
+ "bot_ratelimit",
2672
+ "table_row_count",
2673
+ "workspace_member_count",
2674
+ ],
2675
+ required: true,
2676
+ },
2677
+ period: {
2678
+ in: "query",
2679
+ description: "Period to get",
2680
+ type: "string",
2681
+ required: false,
2682
+ },
2683
+ },
2684
+ response: {
2685
+ description: "Success",
2686
+ schema: {
2687
+ type: "object",
2688
+ properties: {
2689
+ quota: {
2690
+ type: "object",
2691
+ properties: {
2692
+ period: {
2693
+ type: "string",
2694
+ description: "Period of the quota that it is applied to",
2695
+ },
2696
+ value: {
2697
+ type: "number",
2698
+ description: "Value of the quota that is used",
2699
+ },
2700
+ type: {
2701
+ type: "string",
2702
+ enum: [
2703
+ "invocation_timeout",
2704
+ "invocation_calls",
2705
+ "storage_count",
2706
+ "bot_count",
2707
+ "knowledgebase_vector_count",
2708
+ "bot_ratelimit",
2709
+ "table_row_count",
2710
+ "workspace_member_count",
2711
+ ],
2712
+ description: "Usage type that can be used",
2713
+ },
2714
+ },
2715
+ required: ["period", "value", "type"],
2716
+ additionalProperties: false,
2717
+ },
2718
+ },
2719
+ required: ["quota"],
2720
+ title: "getWorkspaceQuotaResponse",
2721
+ additionalProperties: false,
2722
+ },
2723
+ },
2724
+ },
2725
+ listWorkspaceQuotas: {
2726
+ name: "listWorkspaceQuotas",
2727
+ description: "List workspace quotas",
2728
+ section: "workspace",
2729
+ method: "get",
2730
+ path: "/v1/admin/workspaces/{id}/quotas",
2731
+ disableDefaultParameters: {
2732
+ "x-workspace-id": true,
2733
+ },
2734
+ parameters: {
2735
+ id: {
2736
+ type: "string",
2737
+ description: "Workspace ID",
2738
+ in: "path",
2739
+ },
2740
+ period: {
2741
+ in: "query",
2742
+ description: "Period to get",
2743
+ type: "string",
2744
+ required: false,
2745
+ },
2746
+ },
2747
+ response: {
2748
+ description: "Success",
2749
+ schema: {
2750
+ type: "object",
2751
+ properties: {
2752
+ quotas: {
2753
+ type: "array",
2754
+ items: {
2755
+ type: "object",
2756
+ properties: {
2757
+ period: {
2758
+ type: "string",
2759
+ description: "Period of the quota that it is applied to",
2760
+ },
2761
+ value: {
2762
+ type: "number",
2763
+ description: "Value of the quota that is used",
2764
+ },
2765
+ type: {
2766
+ type: "string",
2767
+ enum: [
2768
+ "invocation_timeout",
2769
+ "invocation_calls",
2770
+ "storage_count",
2771
+ "bot_count",
2772
+ "knowledgebase_vector_count",
2773
+ "bot_ratelimit",
2774
+ "table_row_count",
2775
+ "workspace_member_count",
2776
+ ],
2777
+ description: "Usage type that can be used",
2778
+ },
2779
+ },
2780
+ required: ["period", "value", "type"],
2781
+ },
2782
+ },
2783
+ },
2784
+ required: ["quotas"],
2785
+ title: "listWorkspaceQuotasResponse",
2786
+ additionalProperties: false,
2787
+ },
2788
+ },
2789
+ },
2465
2790
  updateWorkspace: {
2466
2791
  name: "updateWorkspace",
2467
2792
  description: "Update workspace",
@@ -4014,6 +4339,102 @@ export const state = {
4014
4339
  },
4015
4340
  },
4016
4341
  },
4342
+ getUsage: {
4343
+ name: "getUsage",
4344
+ path: "/v1/admin/usages/{id}",
4345
+ description: "Get usage",
4346
+ method: "get",
4347
+ section: "usage",
4348
+ parameters: {
4349
+ type: {
4350
+ in: "query",
4351
+ description: "Type of usage",
4352
+ type: "string",
4353
+ enum: [
4354
+ "invocation_timeout",
4355
+ "invocation_calls",
4356
+ "storage_count",
4357
+ "bot_count",
4358
+ "knowledgebase_vector_count",
4359
+ "bot_ratelimit",
4360
+ "table_row_count",
4361
+ "workspace_member_count",
4362
+ ],
4363
+ required: true,
4364
+ },
4365
+ period: {
4366
+ in: "query",
4367
+ description: "Period to get",
4368
+ type: "string",
4369
+ required: false,
4370
+ },
4371
+ id: {
4372
+ type: "string",
4373
+ description: "id of a bot or a workspace depending on the usage type",
4374
+ in: "path",
4375
+ },
4376
+ },
4377
+ response: {
4378
+ description: "Success",
4379
+ schema: {
4380
+ type: "object",
4381
+ properties: {
4382
+ usage: {
4383
+ $ref: "#/components/schemas/Usage",
4384
+ },
4385
+ },
4386
+ required: ["usage"],
4387
+ title: "getUsageResponse",
4388
+ additionalProperties: false,
4389
+ },
4390
+ },
4391
+ },
4392
+ listUsageHistory: {
4393
+ name: "listUsageHistory",
4394
+ path: "/v1/admin/usages/{id}/history",
4395
+ method: "get",
4396
+ description: "Get usage history",
4397
+ parameters: {
4398
+ type: {
4399
+ in: "query",
4400
+ description: "Type of usage",
4401
+ type: "string",
4402
+ enum: [
4403
+ "invocation_timeout",
4404
+ "invocation_calls",
4405
+ "storage_count",
4406
+ "bot_count",
4407
+ "knowledgebase_vector_count",
4408
+ "bot_ratelimit",
4409
+ "table_row_count",
4410
+ "workspace_member_count",
4411
+ ],
4412
+ required: true,
4413
+ },
4414
+ id: {
4415
+ type: "string",
4416
+ description: "id of a bot or a workspace depending on the usage type",
4417
+ in: "path",
4418
+ },
4419
+ },
4420
+ response: {
4421
+ description: "Success",
4422
+ schema: {
4423
+ type: "object",
4424
+ properties: {
4425
+ usages: {
4426
+ type: "array",
4427
+ items: {
4428
+ $ref: "#/components/schemas/Usage",
4429
+ },
4430
+ },
4431
+ },
4432
+ required: ["usages"],
4433
+ title: "listUsageHistoryResponse",
4434
+ additionalProperties: false,
4435
+ },
4436
+ },
4437
+ },
4017
4438
  introspect: {
4018
4439
  name: "introspect",
4019
4440
  description: "Introspect the API",
@@ -4235,7 +4656,7 @@ export const state = {
4235
4656
  title: "Botpress API",
4236
4657
  description: "API for Botpress Cloud",
4237
4658
  server: "https://api.botpress.cloud",
4238
- version: "0.7.0",
4659
+ version: "0.7.2",
4239
4660
  prefix: "v1",
4240
4661
  },
4241
4662
  errors: [
@@ -4341,6 +4762,18 @@ export const state = {
4341
4762
  type: "PaymentRequired",
4342
4763
  description: "A payment is required to perform this request.",
4343
4764
  },
4765
+ {
4766
+ status: 403,
4767
+ type: "QuotaExceeded",
4768
+ description:
4769
+ "The request exceeds the allowed quota. Quotas are a soft limit that can be increased.",
4770
+ },
4771
+ {
4772
+ status: 413,
4773
+ type: "LimitExceeded",
4774
+ description:
4775
+ "The request exceeds the allowed limit. Limits are a hard limit that cannot be increased.",
4776
+ },
4344
4777
  ],
4345
4778
  refs: {
4346
4779
  parameters: {},
@@ -4359,6 +4792,7 @@ export const state = {
4359
4792
  patchStateBody: true,
4360
4793
  callActionBody: true,
4361
4794
  configureIntegrationBody: true,
4795
+ createPersonalAccessTokenBody: true,
4362
4796
  createBotBody: true,
4363
4797
  updateBotBody: true,
4364
4798
  transferBotBody: true,
@@ -4400,6 +4834,9 @@ export const state = {
4400
4834
  callActionResponse: true,
4401
4835
  configureIntegrationResponse: true,
4402
4836
  getAccountResponse: true,
4837
+ listPersonalAccessTokensResponse: true,
4838
+ createPersonalAccessTokenResponse: true,
4839
+ deletePersonalAccessTokenResponse: true,
4403
4840
  listPublicIntegrationsResponse: true,
4404
4841
  getPublicIntegrationByIdResponse: true,
4405
4842
  getPublicIntegrationResponse: true,
@@ -4414,6 +4851,9 @@ export const state = {
4414
4851
  getBotAnalyticsResponse: true,
4415
4852
  createWorkspaceResponse: true,
4416
4853
  getWorkspaceResponse: true,
4854
+ listWorkspaceUsagesResponse: true,
4855
+ getWorkspaceQuotaResponse: true,
4856
+ listWorkspaceQuotasResponse: true,
4417
4857
  updateWorkspaceResponse: true,
4418
4858
  listWorkspacesResponse: true,
4419
4859
  changeWorkspacePlanResponse: true,
@@ -4430,6 +4870,8 @@ export const state = {
4430
4870
  getIntegrationLogsResponse: true,
4431
4871
  getIntegrationByNameResponse: true,
4432
4872
  deleteIntegrationResponse: true,
4873
+ getUsageResponse: true,
4874
+ listUsageHistoryResponse: true,
4433
4875
  introspectResponse: true,
4434
4876
  createFileResponse: true,
4435
4877
  getFileResponse: true,
@@ -4443,6 +4885,7 @@ export const state = {
4443
4885
  Workspace: true,
4444
4886
  WorkspaceMember: true,
4445
4887
  Account: true,
4888
+ Usage: true,
4446
4889
  User: true,
4447
4890
  Conversation: true,
4448
4891
  Event: true,
@@ -5268,6 +5711,47 @@ export const state = {
5268
5711
  additionalProperties: false,
5269
5712
  },
5270
5713
  },
5714
+ Usage: {
5715
+ section: "usage",
5716
+ schema: {
5717
+ type: "object",
5718
+ properties: {
5719
+ id: {
5720
+ type: "string",
5721
+ description:
5722
+ "Id of the usage that it is linked to. It can either be a workspace id or a bot id",
5723
+ },
5724
+ period: {
5725
+ type: "string",
5726
+ description: "Period of the quota that it is applied to",
5727
+ },
5728
+ value: {
5729
+ type: "number",
5730
+ description: "Value of the current usage",
5731
+ },
5732
+ quota: {
5733
+ type: "number",
5734
+ description: "Quota of the current usage",
5735
+ },
5736
+ type: {
5737
+ type: "string",
5738
+ enum: [
5739
+ "invocation_timeout",
5740
+ "invocation_calls",
5741
+ "storage_count",
5742
+ "bot_count",
5743
+ "knowledgebase_vector_count",
5744
+ "bot_ratelimit",
5745
+ "table_row_count",
5746
+ "workspace_member_count",
5747
+ ],
5748
+ description: "Usage type that can be used",
5749
+ },
5750
+ },
5751
+ required: ["id", "period", "value", "quota", "type"],
5752
+ additionalProperties: false,
5753
+ },
5754
+ },
5271
5755
  User: {
5272
5756
  section: "user",
5273
5757
  schema: {
@@ -5685,6 +6169,9 @@ export const state = {
5685
6169
  operations: [
5686
6170
  "createWorkspace",
5687
6171
  "getWorkspace",
6172
+ "listWorkspaceUsages",
6173
+ "getWorkspaceQuota",
6174
+ "listWorkspaceQuotas",
5688
6175
  "updateWorkspace",
5689
6176
  "listWorkspaces",
5690
6177
  "changeWorkspacePlan",
@@ -5709,9 +6196,21 @@ export const state = {
5709
6196
  description: "",
5710
6197
  title: "Account",
5711
6198
  name: "account",
5712
- operations: ["getAccount"],
6199
+ operations: [
6200
+ "getAccount",
6201
+ "listPersonalAccessTokens",
6202
+ "createPersonalAccessToken",
6203
+ "deletePersonalAccessToken",
6204
+ ],
5713
6205
  schema: "Account",
5714
6206
  },
6207
+ {
6208
+ description: "",
6209
+ title: "Usage",
6210
+ name: "usage",
6211
+ operations: ["getUsage"],
6212
+ schema: "Usage",
6213
+ },
5715
6214
  ],
5716
6215
  } satisfies State<
5717
6216
  | "Bot"
@@ -5719,6 +6218,7 @@ export const state = {
5719
6218
  | "Workspace"
5720
6219
  | "WorkspaceMember"
5721
6220
  | "Account"
6221
+ | "Usage"
5722
6222
  | "User"
5723
6223
  | "Conversation"
5724
6224
  | "Event"
@@ -5739,4 +6239,5 @@ export const state = {
5739
6239
  | "workspace"
5740
6240
  | "workspaceMember"
5741
6241
  | "account"
6242
+ | "usage"
5742
6243
  >;