@botpress/api 0.10.0 → 0.11.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.
package/src/gen/state.ts CHANGED
@@ -2418,16 +2418,32 @@ export const state = {
2418
2418
  "ISO 8601 date string of the end (exclusive) of the period",
2419
2419
  },
2420
2420
  returningUsers: {
2421
- type: "number",
2421
+ type: "integer",
2422
2422
  },
2423
2423
  newUsers: {
2424
- type: "number",
2424
+ type: "integer",
2425
2425
  },
2426
2426
  sessions: {
2427
- type: "number",
2427
+ type: "integer",
2428
2428
  },
2429
2429
  messages: {
2430
- type: "number",
2430
+ type: "integer",
2431
+ description: "Deprecated. Use `userMessages` instead.",
2432
+ },
2433
+ userMessages: {
2434
+ type: "integer",
2435
+ },
2436
+ botMessages: {
2437
+ type: "integer",
2438
+ },
2439
+ events: {
2440
+ type: "integer",
2441
+ },
2442
+ eventTypes: {
2443
+ type: "object",
2444
+ additionalProperties: {
2445
+ type: "number",
2446
+ },
2431
2447
  },
2432
2448
  },
2433
2449
  required: [
@@ -2437,6 +2453,10 @@ export const state = {
2437
2453
  "newUsers",
2438
2454
  "sessions",
2439
2455
  "messages",
2456
+ "userMessages",
2457
+ "botMessages",
2458
+ "events",
2459
+ "eventTypes",
2440
2460
  ],
2441
2461
  },
2442
2462
  },
@@ -2621,6 +2641,363 @@ export const state = {
2621
2641
  },
2622
2642
  },
2623
2643
  },
2644
+ getWorkspaceBillingDetails: {
2645
+ name: "getWorkspaceBillingDetails",
2646
+ description: "Get billing details of workspace",
2647
+ method: "get",
2648
+ path: "/v1/admin/workspaces/{id}/billing/details",
2649
+ disableDefaultParameters: {
2650
+ "x-workspace-id": true,
2651
+ },
2652
+ parameters: {
2653
+ id: {
2654
+ type: "string",
2655
+ description: "Workspace ID",
2656
+ in: "path",
2657
+ },
2658
+ },
2659
+ section: "workspace",
2660
+ response: {
2661
+ description: "Success",
2662
+ schema: {
2663
+ type: "object",
2664
+ properties: {
2665
+ currentPeriod: {
2666
+ type: "object",
2667
+ properties: {
2668
+ start: {
2669
+ type: "string",
2670
+ },
2671
+ end: {
2672
+ type: "string",
2673
+ },
2674
+ usage: {
2675
+ type: "object",
2676
+ properties: {
2677
+ userMessages: {
2678
+ type: "object",
2679
+ properties: {
2680
+ status: {
2681
+ type: "string",
2682
+ enum: ["OK", "Warning", "LimitReached"],
2683
+ },
2684
+ quantity: {
2685
+ type: "number",
2686
+ },
2687
+ price: {
2688
+ type: "number",
2689
+ },
2690
+ minimum: {
2691
+ type: "number",
2692
+ },
2693
+ maximum: {
2694
+ type: "number",
2695
+ },
2696
+ },
2697
+ required: [
2698
+ "status",
2699
+ "quantity",
2700
+ "price",
2701
+ "minimum",
2702
+ "maximum",
2703
+ ],
2704
+ additionalProperties: false,
2705
+ },
2706
+ },
2707
+ required: ["userMessages"],
2708
+ additionalProperties: false,
2709
+ },
2710
+ },
2711
+ required: ["start", "end", "usage"],
2712
+ additionalProperties: false,
2713
+ },
2714
+ paymentMethod: {
2715
+ type: "object",
2716
+ properties: {
2717
+ type: {
2718
+ type: "string",
2719
+ },
2720
+ lastDigits: {
2721
+ type: "string",
2722
+ },
2723
+ },
2724
+ required: ["type", "lastDigits"],
2725
+ nullable: true,
2726
+ additionalProperties: false,
2727
+ },
2728
+ },
2729
+ required: ["currentPeriod", "paymentMethod"],
2730
+ title: "getWorkspaceBillingDetailsResponse",
2731
+ additionalProperties: false,
2732
+ },
2733
+ },
2734
+ },
2735
+ setWorkspacePaymentMethod: {
2736
+ name: "setWorkspacePaymentMethod",
2737
+ description:
2738
+ "Set the Stripe PaymentMethod to use for billing the workspace. To create a PaymentMethod, use the Stripe API or SDK with our Stripe Publishable Key which is listed in this documentation.",
2739
+ method: "put",
2740
+ path: "/v1/admin/workspaces/{id}/billing/payment-method",
2741
+ disableDefaultParameters: {
2742
+ "x-workspace-id": true,
2743
+ },
2744
+ parameters: {
2745
+ id: {
2746
+ type: "string",
2747
+ description: "Workspace ID",
2748
+ in: "path",
2749
+ },
2750
+ },
2751
+ section: "workspace",
2752
+ requestBody: {
2753
+ description: "",
2754
+ schema: {
2755
+ type: "object",
2756
+ properties: {
2757
+ stripePaymentMethodId: {
2758
+ type: "string",
2759
+ description:
2760
+ "ID of the Stripe PaymentMethod to attach to the workspace.",
2761
+ },
2762
+ },
2763
+ required: ["stripePaymentMethodId"],
2764
+ title: "setWorkspacePaymentMethodBody",
2765
+ additionalProperties: false,
2766
+ },
2767
+ },
2768
+ response: {
2769
+ description: "Success",
2770
+ schema: {
2771
+ type: "object",
2772
+ properties: {
2773
+ stripePaymentMethodId: {
2774
+ type: "string",
2775
+ },
2776
+ paymentMethod: {
2777
+ type: "object",
2778
+ properties: {
2779
+ type: {
2780
+ type: "string",
2781
+ },
2782
+ lastDigits: {
2783
+ type: "string",
2784
+ },
2785
+ },
2786
+ required: ["type", "lastDigits"],
2787
+ nullable: true,
2788
+ additionalProperties: false,
2789
+ },
2790
+ status: {
2791
+ type: "string",
2792
+ enum: [
2793
+ "succeeded",
2794
+ "processing",
2795
+ "canceled",
2796
+ "requires_confirmation",
2797
+ "requires_action",
2798
+ "requires_payment_method",
2799
+ ],
2800
+ },
2801
+ nextAction: {
2802
+ type: "object",
2803
+ properties: {
2804
+ redirectToUrl: {
2805
+ type: "string",
2806
+ format: "uri",
2807
+ },
2808
+ },
2809
+ required: ["redirectToUrl"],
2810
+ description:
2811
+ "If the payment needs to be confirmed, this will contain a URL to redirect the user to so they can complete the verification process to confirm it.",
2812
+ additionalProperties: false,
2813
+ },
2814
+ },
2815
+ required: ["stripePaymentMethodId", "paymentMethod", "status"],
2816
+ title: "setWorkspacePaymentMethodResponse",
2817
+ additionalProperties: false,
2818
+ },
2819
+ },
2820
+ },
2821
+ listWorkspaceInvoices: {
2822
+ name: "listWorkspaceInvoices",
2823
+ description: "List invoices billed to workspace",
2824
+ method: "get",
2825
+ path: "/v1/admin/workspaces/{id}/billing/invoices",
2826
+ disableDefaultParameters: {
2827
+ "x-workspace-id": true,
2828
+ },
2829
+ parameters: {
2830
+ id: {
2831
+ type: "string",
2832
+ description: "Workspace ID",
2833
+ in: "path",
2834
+ },
2835
+ },
2836
+ section: "workspace",
2837
+ response: {
2838
+ description: "Success",
2839
+ schema: {
2840
+ type: "object",
2841
+ properties: {
2842
+ invoices: {
2843
+ type: "array",
2844
+ items: {
2845
+ type: "object",
2846
+ properties: {
2847
+ id: {
2848
+ type: "string",
2849
+ },
2850
+ period: {
2851
+ type: "object",
2852
+ properties: {
2853
+ month: {
2854
+ type: "number",
2855
+ },
2856
+ year: {
2857
+ type: "number",
2858
+ },
2859
+ },
2860
+ required: ["month", "year"],
2861
+ },
2862
+ date: {
2863
+ type: "string",
2864
+ format: "date-time",
2865
+ description: "Date on which the invoice was generated.",
2866
+ },
2867
+ amount: {
2868
+ type: "number",
2869
+ description: "Total amount to pay of the invoice.",
2870
+ },
2871
+ currency: {
2872
+ type: "string",
2873
+ maxLength: 3,
2874
+ description: "Currency of the invoice amount.",
2875
+ },
2876
+ paymentStatus: {
2877
+ type: "string",
2878
+ enum: ["paid", "unpaid"],
2879
+ },
2880
+ paymentAttemptCount: {
2881
+ type: "number",
2882
+ description:
2883
+ "Number of times payment has been unsuccessfully attempted on the invoice.",
2884
+ nullable: true,
2885
+ },
2886
+ nextPaymentAttemptDate: {
2887
+ type: "string",
2888
+ format: "date-time",
2889
+ description:
2890
+ "Date on which the next payment attempt will be made.",
2891
+ nullable: true,
2892
+ },
2893
+ pdfUrl: {
2894
+ type: "string",
2895
+ format: "uri",
2896
+ description: "URL to download the PDF file of the invoice.",
2897
+ },
2898
+ },
2899
+ required: [
2900
+ "id",
2901
+ "period",
2902
+ "date",
2903
+ "amount",
2904
+ "currency",
2905
+ "paymentStatus",
2906
+ "paymentAttemptCount",
2907
+ "nextPaymentAttemptDate",
2908
+ "pdfUrl",
2909
+ ],
2910
+ },
2911
+ },
2912
+ },
2913
+ required: ["invoices"],
2914
+ title: "listWorkspaceInvoicesResponse",
2915
+ additionalProperties: false,
2916
+ },
2917
+ },
2918
+ },
2919
+ chargeWorkspaceUnpaidInvoices: {
2920
+ name: "chargeWorkspaceUnpaidInvoices",
2921
+ description: "Charge unpaid invoices of a workspace.",
2922
+ method: "post",
2923
+ path: "/v1/admin/workspaces/{id}/billing/invoices/charge-unpaid",
2924
+ disableDefaultParameters: {
2925
+ "x-workspace-id": true,
2926
+ },
2927
+ parameters: {
2928
+ id: {
2929
+ type: "string",
2930
+ description: "Workspace ID",
2931
+ in: "path",
2932
+ },
2933
+ },
2934
+ section: "workspace",
2935
+ requestBody: {
2936
+ description: "",
2937
+ schema: {
2938
+ type: "object",
2939
+ properties: {
2940
+ invoiceIds: {
2941
+ type: "array",
2942
+ items: {
2943
+ type: "string",
2944
+ },
2945
+ minItems: 1,
2946
+ },
2947
+ },
2948
+ title: "chargeWorkspaceUnpaidInvoicesBody",
2949
+ additionalProperties: false,
2950
+ },
2951
+ },
2952
+ response: {
2953
+ description: "Success",
2954
+ schema: {
2955
+ type: "object",
2956
+ properties: {
2957
+ chargedInvoices: {
2958
+ type: "array",
2959
+ items: {
2960
+ type: "object",
2961
+ properties: {
2962
+ id: {
2963
+ type: "string",
2964
+ },
2965
+ amount: {
2966
+ type: "number",
2967
+ },
2968
+ },
2969
+ required: ["id", "amount"],
2970
+ },
2971
+ description:
2972
+ "Invoices that were successfully charged by this request.",
2973
+ },
2974
+ failedInvoices: {
2975
+ type: "array",
2976
+ items: {
2977
+ type: "object",
2978
+ properties: {
2979
+ id: {
2980
+ type: "string",
2981
+ },
2982
+ amount: {
2983
+ type: "number",
2984
+ },
2985
+ failedReason: {
2986
+ type: "string",
2987
+ },
2988
+ },
2989
+ required: ["id", "amount", "failedReason"],
2990
+ },
2991
+ description:
2992
+ "Invoices that failed to be charged by this request.",
2993
+ },
2994
+ },
2995
+ required: ["chargedInvoices", "failedInvoices"],
2996
+ title: "chargeWorkspaceUnpaidInvoicesResponse",
2997
+ additionalProperties: false,
2998
+ },
2999
+ },
3000
+ },
2624
3001
  createWorkspace: {
2625
3002
  name: "createWorkspace",
2626
3003
  description: "Create workspace",
@@ -2790,6 +3167,8 @@ export const state = {
2790
3167
  "table_row_count",
2791
3168
  "workspace_member_count",
2792
3169
  "integrations_owned_count",
3170
+ "cognitive_calls",
3171
+ "model_credit",
2793
3172
  ],
2794
3173
  required: true,
2795
3174
  },
@@ -2847,6 +3226,8 @@ export const state = {
2847
3226
  "table_row_count",
2848
3227
  "workspace_member_count",
2849
3228
  "integrations_owned_count",
3229
+ "cognitive_calls",
3230
+ "model_credit",
2850
3231
  ],
2851
3232
  required: true,
2852
3233
  },
@@ -2885,6 +3266,8 @@ export const state = {
2885
3266
  "table_row_count",
2886
3267
  "workspace_member_count",
2887
3268
  "integrations_owned_count",
3269
+ "cognitive_calls",
3270
+ "model_credit",
2888
3271
  ],
2889
3272
  description: "Usage type that can be used",
2890
3273
  },
@@ -2951,6 +3334,8 @@ export const state = {
2951
3334
  "table_row_count",
2952
3335
  "workspace_member_count",
2953
3336
  "integrations_owned_count",
3337
+ "cognitive_calls",
3338
+ "model_credit",
2954
3339
  ],
2955
3340
  description: "Usage type that can be used",
2956
3341
  },
@@ -4536,6 +4921,8 @@ export const state = {
4536
4921
  "table_row_count",
4537
4922
  "workspace_member_count",
4538
4923
  "integrations_owned_count",
4924
+ "cognitive_calls",
4925
+ "model_credit",
4539
4926
  ],
4540
4927
  required: true,
4541
4928
  },
@@ -4586,6 +4973,8 @@ export const state = {
4586
4973
  "table_row_count",
4587
4974
  "workspace_member_count",
4588
4975
  "integrations_owned_count",
4976
+ "cognitive_calls",
4977
+ "model_credit",
4589
4978
  ],
4590
4979
  required: true,
4591
4980
  },
@@ -4834,7 +5223,7 @@ export const state = {
4834
5223
  title: "Botpress API",
4835
5224
  description: "API for Botpress Cloud",
4836
5225
  server: "https://api.botpress.cloud",
4837
- version: "0.10.0",
5226
+ version: "0.11.0",
4838
5227
  prefix: "v1",
4839
5228
  },
4840
5229
  errors: [
@@ -4974,6 +5363,8 @@ export const state = {
4974
5363
  createBotBody: true,
4975
5364
  updateBotBody: true,
4976
5365
  transferBotBody: true,
5366
+ setWorkspacePaymentMethodBody: true,
5367
+ chargeWorkspaceUnpaidInvoicesBody: true,
4977
5368
  createWorkspaceBody: true,
4978
5369
  updateWorkspaceBody: true,
4979
5370
  changeWorkspacePlanBody: true,
@@ -5030,6 +5421,10 @@ export const state = {
5030
5421
  listBotIssuesResponse: true,
5031
5422
  deleteBotIssueResponse: true,
5032
5423
  listBotIssueEventsResponse: true,
5424
+ getWorkspaceBillingDetailsResponse: true,
5425
+ setWorkspacePaymentMethodResponse: true,
5426
+ listWorkspaceInvoicesResponse: true,
5427
+ chargeWorkspaceUnpaidInvoicesResponse: true,
5033
5428
  createWorkspaceResponse: true,
5034
5429
  getWorkspaceResponse: true,
5035
5430
  listWorkspaceUsagesResponse: true,
@@ -5124,6 +5519,9 @@ export const state = {
5124
5519
  webhookUrl: {
5125
5520
  type: "string",
5126
5521
  },
5522
+ webhookId: {
5523
+ type: "string",
5524
+ },
5127
5525
  configuration: {
5128
5526
  type: "object",
5129
5527
  additionalProperties: true,
@@ -5183,6 +5581,7 @@ export const state = {
5183
5581
  "name",
5184
5582
  "version",
5185
5583
  "webhookUrl",
5584
+ "webhookId",
5186
5585
  "configuration",
5187
5586
  "status",
5188
5587
  "statusReason",
@@ -5928,6 +6327,8 @@ export const state = {
5928
6327
  "table_row_count",
5929
6328
  "workspace_member_count",
5930
6329
  "integrations_owned_count",
6330
+ "cognitive_calls",
6331
+ "model_credit",
5931
6332
  ],
5932
6333
  description: "Usage type that can be used",
5933
6334
  },
@@ -6431,6 +6832,10 @@ export const state = {
6431
6832
  title: "Workspace",
6432
6833
  name: "workspace",
6433
6834
  operations: [
6835
+ "getWorkspaceBillingDetails",
6836
+ "setWorkspacePaymentMethod",
6837
+ "listWorkspaceInvoices",
6838
+ "chargeWorkspaceUnpaidInvoices",
6434
6839
  "createWorkspace",
6435
6840
  "getWorkspace",
6436
6841
  "listWorkspaceUsages",