@botpress/api 0.7.1 → 0.7.3

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
@@ -2587,6 +2587,206 @@ export const state = {
2587
2587
  },
2588
2588
  },
2589
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
+ },
2590
2790
  updateWorkspace: {
2591
2791
  name: "updateWorkspace",
2592
2792
  description: "Update workspace",
@@ -4139,6 +4339,102 @@ export const state = {
4139
4339
  },
4140
4340
  },
4141
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
+ },
4142
4438
  introspect: {
4143
4439
  name: "introspect",
4144
4440
  description: "Introspect the API",
@@ -4360,7 +4656,7 @@ export const state = {
4360
4656
  title: "Botpress API",
4361
4657
  description: "API for Botpress Cloud",
4362
4658
  server: "https://api.botpress.cloud",
4363
- version: "0.7.1",
4659
+ version: "0.7.3",
4364
4660
  prefix: "v1",
4365
4661
  },
4366
4662
  errors: [
@@ -4467,7 +4763,7 @@ export const state = {
4467
4763
  description: "A payment is required to perform this request.",
4468
4764
  },
4469
4765
  {
4470
- status: 429,
4766
+ status: 403,
4471
4767
  type: "QuotaExceeded",
4472
4768
  description:
4473
4769
  "The request exceeds the allowed quota. Quotas are a soft limit that can be increased.",
@@ -4555,6 +4851,9 @@ export const state = {
4555
4851
  getBotAnalyticsResponse: true,
4556
4852
  createWorkspaceResponse: true,
4557
4853
  getWorkspaceResponse: true,
4854
+ listWorkspaceUsagesResponse: true,
4855
+ getWorkspaceQuotaResponse: true,
4856
+ listWorkspaceQuotasResponse: true,
4558
4857
  updateWorkspaceResponse: true,
4559
4858
  listWorkspacesResponse: true,
4560
4859
  changeWorkspacePlanResponse: true,
@@ -4571,6 +4870,8 @@ export const state = {
4571
4870
  getIntegrationLogsResponse: true,
4572
4871
  getIntegrationByNameResponse: true,
4573
4872
  deleteIntegrationResponse: true,
4873
+ getUsageResponse: true,
4874
+ listUsageHistoryResponse: true,
4574
4875
  introspectResponse: true,
4575
4876
  createFileResponse: true,
4576
4877
  getFileResponse: true,
@@ -4584,6 +4885,7 @@ export const state = {
4584
4885
  Workspace: true,
4585
4886
  WorkspaceMember: true,
4586
4887
  Account: true,
4888
+ Usage: true,
4587
4889
  User: true,
4588
4890
  Conversation: true,
4589
4891
  Event: true,
@@ -5409,6 +5711,47 @@ export const state = {
5409
5711
  additionalProperties: false,
5410
5712
  },
5411
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
+ },
5412
5755
  User: {
5413
5756
  section: "user",
5414
5757
  schema: {
@@ -5826,6 +6169,9 @@ export const state = {
5826
6169
  operations: [
5827
6170
  "createWorkspace",
5828
6171
  "getWorkspace",
6172
+ "listWorkspaceUsages",
6173
+ "getWorkspaceQuota",
6174
+ "listWorkspaceQuotas",
5829
6175
  "updateWorkspace",
5830
6176
  "listWorkspaces",
5831
6177
  "changeWorkspacePlan",
@@ -5858,13 +6204,24 @@ export const state = {
5858
6204
  ],
5859
6205
  schema: "Account",
5860
6206
  },
6207
+ {
6208
+ description: "",
6209
+ title: "Usage",
6210
+ name: "usage",
6211
+ operations: ["getUsage"],
6212
+ schema: "Usage",
6213
+ },
5861
6214
  ],
6215
+ options: {
6216
+ allowUnions: false,
6217
+ },
5862
6218
  } satisfies State<
5863
6219
  | "Bot"
5864
6220
  | "Integration"
5865
6221
  | "Workspace"
5866
6222
  | "WorkspaceMember"
5867
6223
  | "Account"
6224
+ | "Usage"
5868
6225
  | "User"
5869
6226
  | "Conversation"
5870
6227
  | "Event"
@@ -5885,4 +6242,5 @@ export const state = {
5885
6242
  | "workspace"
5886
6243
  | "workspaceMember"
5887
6244
  | "account"
6245
+ | "usage"
5888
6246
  >;