@botpress/client 1.32.0 → 1.33.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/dist/index.d.ts CHANGED
@@ -15113,24 +15113,22 @@ interface GetPlanRequestParams {
15113
15113
  interface GetPlanRequestBody {
15114
15114
  }
15115
15115
  type GetPlanInput = GetPlanRequestBody & GetPlanRequestHeaders & GetPlanRequestQuery & GetPlanRequestParams;
15116
- interface GetPlanResponse {
15116
+ interface GetPlanResponse$1 {
15117
15117
  id: string;
15118
15118
  name: string;
15119
15119
  description: string;
15120
- providerProductId: string;
15121
15120
  prices: {
15122
- [k: string]: {
15123
- providerPriceId: string;
15121
+ month?: {
15124
15122
  amount: number;
15125
- currency: "usd";
15126
- interval: "month" | "year";
15127
- metadata?: {
15128
- [k: string]: string;
15129
- };
15123
+ currency: string;
15124
+ };
15125
+ year?: {
15126
+ amount: number;
15127
+ currency: string;
15130
15128
  };
15131
15129
  };
15132
15130
  features: {
15133
- [k: string]: any;
15131
+ [k: string]: number;
15134
15132
  };
15135
15133
  metadata?: {
15136
15134
  [k: string]: string;
@@ -15146,29 +15144,28 @@ interface ListPlansRequestParams {
15146
15144
  interface ListPlansRequestBody {
15147
15145
  }
15148
15146
  type ListPlansInput = ListPlansRequestBody & ListPlansRequestHeaders & ListPlansRequestQuery & ListPlansRequestParams;
15149
- type ListPlansResponse = {
15147
+ type ListPlansResponse = GetPlanResponse[];
15148
+ interface GetPlanResponse {
15150
15149
  id: string;
15151
15150
  name: string;
15152
15151
  description: string;
15153
- providerProductId: string;
15154
15152
  prices: {
15155
- [k: string]: {
15156
- providerPriceId: string;
15153
+ month?: {
15157
15154
  amount: number;
15158
- currency: "usd";
15159
- interval: "month" | "year";
15160
- metadata?: {
15161
- [k: string]: string;
15162
- };
15155
+ currency: string;
15156
+ };
15157
+ year?: {
15158
+ amount: number;
15159
+ currency: string;
15163
15160
  };
15164
15161
  };
15165
15162
  features: {
15166
- [k: string]: any | null;
15163
+ [k: string]: number;
15167
15164
  };
15168
15165
  metadata?: {
15169
15166
  [k: string]: string;
15170
15167
  };
15171
- }[];
15168
+ }
15172
15169
 
15173
15170
  interface GetAddonRequestHeaders {
15174
15171
  }
@@ -15180,22 +15177,11 @@ interface GetAddonRequestParams {
15180
15177
  interface GetAddonRequestBody {
15181
15178
  }
15182
15179
  type GetAddonInput = GetAddonRequestBody & GetAddonRequestHeaders & GetAddonRequestQuery & GetAddonRequestParams;
15183
- interface GetAddonResponse {
15180
+ interface GetAddonResponse$1 {
15184
15181
  id: string;
15185
15182
  name: string;
15186
15183
  description: string;
15187
- providerProductId: string;
15188
- prices: {
15189
- [k: string]: {
15190
- providerPriceId: string;
15191
- amount: number;
15192
- currency: "usd";
15193
- interval: "month" | "year";
15194
- metadata?: {
15195
- [k: string]: string;
15196
- };
15197
- };
15198
- };
15184
+ price: number;
15199
15185
  feature: "human_in_the_loop" | "ratelimit" | "incoming_messages_events" | "integration_spend" | "integration_subscription" | "table_rows" | "bot_count" | "always_alive_count" | "always_alive_concurrency" | "collaborator_count" | "file_storage" | "vector_db_storage" | "saved_versions";
15200
15186
  increment: number;
15201
15187
  metadata?: {
@@ -15212,28 +15198,307 @@ interface ListAddonsRequestParams {
15212
15198
  interface ListAddonsRequestBody {
15213
15199
  }
15214
15200
  type ListAddonsInput = ListAddonsRequestBody & ListAddonsRequestHeaders & ListAddonsRequestQuery & ListAddonsRequestParams;
15215
- type ListAddonsResponse = {
15201
+ type ListAddonsResponse = GetAddonResponse[];
15202
+ interface GetAddonResponse {
15216
15203
  id: string;
15217
15204
  name: string;
15218
15205
  description: string;
15219
- providerProductId: string;
15220
- prices: {
15206
+ price: number;
15207
+ feature: "human_in_the_loop" | "ratelimit" | "incoming_messages_events" | "integration_spend" | "integration_subscription" | "table_rows" | "bot_count" | "always_alive_count" | "always_alive_concurrency" | "collaborator_count" | "file_storage" | "vector_db_storage" | "saved_versions";
15208
+ increment: number;
15209
+ metadata?: {
15210
+ [k: string]: string;
15211
+ };
15212
+ }
15213
+
15214
+ interface GetCurrentSubscriptionRequestHeaders {
15215
+ }
15216
+ interface GetCurrentSubscriptionRequestQuery {
15217
+ }
15218
+ interface GetCurrentSubscriptionRequestParams {
15219
+ }
15220
+ interface GetCurrentSubscriptionRequestBody {
15221
+ }
15222
+ type GetCurrentSubscriptionInput = GetCurrentSubscriptionRequestBody & GetCurrentSubscriptionRequestHeaders & GetCurrentSubscriptionRequestQuery & GetCurrentSubscriptionRequestParams;
15223
+ interface GetCurrentSubscriptionResponse {
15224
+ plan: {
15225
+ current: {
15226
+ status: "active" | "canceled" | "past_due" | "action_required" | "grace_period";
15227
+ planId: string;
15228
+ interval: "month" | "year";
15229
+ price: number;
15230
+ proratedPrice?: number;
15231
+ cancelAtPeriodEnd: boolean;
15232
+ periodEnd: string;
15233
+ };
15234
+ next: {
15235
+ planId: string;
15236
+ interval: "month" | "year";
15237
+ price: number | null;
15238
+ effectiveDate: string;
15239
+ } | null;
15240
+ };
15241
+ addons: {
15221
15242
  [k: string]: {
15222
- providerPriceId: string;
15223
- amount: number;
15224
- currency: "usd";
15243
+ current: {
15244
+ quantity: number;
15245
+ price: number;
15246
+ proratedPrice?: number;
15247
+ };
15248
+ next: {
15249
+ quantity: number;
15250
+ price: number;
15251
+ effectiveDate: string;
15252
+ } | null;
15253
+ };
15254
+ };
15255
+ yearlyTotal: number;
15256
+ monthlyTotal: number;
15257
+ proratedTotal: number;
15258
+ }
15259
+
15260
+ interface GetNextSubscriptionRequestHeaders {
15261
+ }
15262
+ interface GetNextSubscriptionRequestQuery {
15263
+ }
15264
+ interface GetNextSubscriptionRequestParams {
15265
+ }
15266
+ interface GetNextSubscriptionRequestBody {
15267
+ }
15268
+ type GetNextSubscriptionInput = GetNextSubscriptionRequestBody & GetNextSubscriptionRequestHeaders & GetNextSubscriptionRequestQuery & GetNextSubscriptionRequestParams;
15269
+ interface GetNextSubscriptionResponse {
15270
+ plan: {
15271
+ current: {
15272
+ status: "active" | "canceled" | "past_due" | "action_required" | "grace_period";
15273
+ planId: string;
15225
15274
  interval: "month" | "year";
15226
- metadata?: {
15227
- [k: string]: string;
15275
+ price: number;
15276
+ proratedPrice?: number;
15277
+ cancelAtPeriodEnd: boolean;
15278
+ periodEnd: string;
15279
+ };
15280
+ next: {
15281
+ planId: string;
15282
+ interval: "month" | "year";
15283
+ price: number | null;
15284
+ effectiveDate: string;
15285
+ } | null;
15286
+ };
15287
+ addons: {
15288
+ [k: string]: {
15289
+ current: {
15290
+ quantity: number;
15291
+ price: number;
15292
+ proratedPrice?: number;
15293
+ };
15294
+ next: {
15295
+ quantity: number;
15296
+ price: number;
15297
+ effectiveDate: string;
15298
+ } | null;
15299
+ };
15300
+ };
15301
+ yearlyTotal: number;
15302
+ monthlyTotal: number;
15303
+ proratedTotal: number;
15304
+ }
15305
+
15306
+ interface PreviewSubscriptionUpdateRequestHeaders {
15307
+ }
15308
+ interface PreviewSubscriptionUpdateRequestQuery {
15309
+ }
15310
+ interface PreviewSubscriptionUpdateRequestParams {
15311
+ }
15312
+ interface PreviewSubscriptionUpdateRequestBody {
15313
+ plan: {
15314
+ /**
15315
+ * New plan ID (optional)
15316
+ */
15317
+ planId: string;
15318
+ /**
15319
+ * New billing interval (optional)
15320
+ */
15321
+ interval: "month" | "year";
15322
+ };
15323
+ /**
15324
+ * Map of addon IDs to quantities (optional). Set quantity to 0 to remove addon.
15325
+ */
15326
+ addons?: {
15327
+ [k: string]: number;
15328
+ };
15329
+ }
15330
+ type PreviewSubscriptionUpdateInput = PreviewSubscriptionUpdateRequestBody & PreviewSubscriptionUpdateRequestHeaders & PreviewSubscriptionUpdateRequestQuery & PreviewSubscriptionUpdateRequestParams;
15331
+ /**
15332
+ * Preview of subscription update costs
15333
+ */
15334
+ interface PreviewSubscriptionUpdateResponse {
15335
+ subscription: {
15336
+ plan: {
15337
+ planId: string;
15338
+ interval: "month" | "year";
15339
+ effectiveDate: string;
15340
+ };
15341
+ addons: {
15342
+ [k: string]: {
15343
+ quantity: number;
15344
+ effectiveDate: string;
15228
15345
  };
15229
15346
  };
15230
15347
  };
15231
- feature: "human_in_the_loop" | "ratelimit" | "incoming_messages_events" | "integration_spend" | "integration_subscription" | "table_rows" | "bot_count" | "always_alive_count" | "always_alive_concurrency" | "collaborator_count" | "file_storage" | "vector_db_storage" | "saved_versions";
15232
- increment: number;
15233
- metadata?: {
15234
- [k: string]: string;
15348
+ changeType: "upgrade" | "downgrade" | "same";
15349
+ costs: {
15350
+ /**
15351
+ * Prorated charges due immediately (0 for downgrades)
15352
+ */
15353
+ immediate: {
15354
+ total: number;
15355
+ lineItems: {
15356
+ type: "plan" | "addon" | "proration_credit";
15357
+ id: string;
15358
+ description: string;
15359
+ amount: number;
15360
+ quantity?: number;
15361
+ }[];
15362
+ };
15363
+ /**
15364
+ * Monthly recurring cost (addons, or plan if monthly interval)
15365
+ */
15366
+ monthly: {
15367
+ total: number;
15368
+ lineItems: {
15369
+ type: "plan" | "addon" | "proration_credit";
15370
+ id: string;
15371
+ description: string;
15372
+ amount: number;
15373
+ quantity?: number;
15374
+ }[];
15375
+ };
15376
+ /**
15377
+ * Yearly recurring cost (plan if yearly interval)
15378
+ */
15379
+ yearly: {
15380
+ total: number;
15381
+ lineItems: {
15382
+ type: "plan" | "addon" | "proration_credit";
15383
+ id: string;
15384
+ description: string;
15385
+ amount: number;
15386
+ quantity?: number;
15387
+ }[];
15388
+ };
15389
+ };
15390
+ currentPeriodEnd: string;
15391
+ }
15392
+
15393
+ interface SetPlanRequestHeaders {
15394
+ }
15395
+ interface SetPlanRequestQuery {
15396
+ }
15397
+ interface SetPlanRequestParams {
15398
+ }
15399
+ /**
15400
+ * Plan update parameters
15401
+ */
15402
+ interface SetPlanRequestBody {
15403
+ planId: string;
15404
+ interval: "month" | "year";
15405
+ testReferenceTime?: number;
15406
+ }
15407
+ type SetPlanInput = SetPlanRequestBody & SetPlanRequestHeaders & SetPlanRequestQuery & SetPlanRequestParams;
15408
+ /**
15409
+ * Subscription details including current plan, addons, and costs
15410
+ */
15411
+ interface SetPlanResponse {
15412
+ plan: {
15413
+ current: {
15414
+ status: "active" | "canceled" | "past_due" | "action_required" | "grace_period";
15415
+ planId: string;
15416
+ interval: "month" | "year";
15417
+ price: number;
15418
+ proratedPrice?: number;
15419
+ cancelAtPeriodEnd: boolean;
15420
+ periodEnd: string;
15421
+ };
15422
+ next: {
15423
+ planId: string;
15424
+ interval: "month" | "year";
15425
+ price: number | null;
15426
+ effectiveDate: string;
15427
+ } | null;
15428
+ };
15429
+ addons: {
15430
+ [k: string]: {
15431
+ current: {
15432
+ quantity: number;
15433
+ price: number;
15434
+ proratedPrice?: number;
15435
+ };
15436
+ next: {
15437
+ quantity: number;
15438
+ price: number;
15439
+ effectiveDate: string;
15440
+ } | null;
15441
+ };
15235
15442
  };
15236
- }[];
15443
+ yearlyTotal: number;
15444
+ monthlyTotal: number;
15445
+ proratedTotal: number;
15446
+ }
15447
+
15448
+ interface SetAddonsRequestHeaders {
15449
+ }
15450
+ interface SetAddonsRequestQuery {
15451
+ }
15452
+ interface SetAddonsRequestParams {
15453
+ }
15454
+ /**
15455
+ * Addons update parameters. Set quantity to 0 to remove an addon.
15456
+ */
15457
+ interface SetAddonsRequestBody {
15458
+ addons: {
15459
+ [k: string]: number;
15460
+ };
15461
+ }
15462
+ type SetAddonsInput = SetAddonsRequestBody & SetAddonsRequestHeaders & SetAddonsRequestQuery & SetAddonsRequestParams;
15463
+ /**
15464
+ * Subscription details including current plan, addons, and costs
15465
+ */
15466
+ interface SetAddonsResponse {
15467
+ plan: {
15468
+ current: {
15469
+ status: "active" | "canceled" | "past_due" | "action_required" | "grace_period";
15470
+ planId: string;
15471
+ interval: "month" | "year";
15472
+ price: number;
15473
+ proratedPrice?: number;
15474
+ cancelAtPeriodEnd: boolean;
15475
+ periodEnd: string;
15476
+ };
15477
+ next: {
15478
+ planId: string;
15479
+ interval: "month" | "year";
15480
+ price: number | null;
15481
+ effectiveDate: string;
15482
+ } | null;
15483
+ };
15484
+ addons: {
15485
+ [k: string]: {
15486
+ current: {
15487
+ quantity: number;
15488
+ price: number;
15489
+ proratedPrice?: number;
15490
+ };
15491
+ next: {
15492
+ quantity: number;
15493
+ price: number;
15494
+ effectiveDate: string;
15495
+ } | null;
15496
+ };
15497
+ };
15498
+ yearlyTotal: number;
15499
+ monthlyTotal: number;
15500
+ proratedTotal: number;
15501
+ }
15237
15502
 
15238
15503
  interface ListInvoicesRequestHeaders {
15239
15504
  }
@@ -15245,9 +15510,6 @@ interface ListInvoicesRequestParams {
15245
15510
  interface ListInvoicesRequestBody {
15246
15511
  }
15247
15512
  type ListInvoicesInput = ListInvoicesRequestBody & ListInvoicesRequestHeaders & ListInvoicesRequestQuery & ListInvoicesRequestParams;
15248
- /**
15249
- * List of invoices with pagination.
15250
- */
15251
15513
  interface ListInvoicesResponse {
15252
15514
  invoices: {
15253
15515
  id: string;
@@ -15350,6 +15612,19 @@ interface CreatePaymentMethodIntentResponse {
15350
15612
  clientSecret: string;
15351
15613
  }
15352
15614
 
15615
+ interface GetQuotasRequestHeaders {
15616
+ }
15617
+ interface GetQuotasRequestQuery {
15618
+ }
15619
+ interface GetQuotasRequestParams {
15620
+ }
15621
+ interface GetQuotasRequestBody {
15622
+ }
15623
+ type GetQuotasInput = GetQuotasRequestBody & GetQuotasRequestHeaders & GetQuotasRequestQuery & GetQuotasRequestParams;
15624
+ interface GetQuotasResponse {
15625
+ [k: string]: number;
15626
+ }
15627
+
15353
15628
  type ClientProps$7 = {
15354
15629
  toAxiosRequest: typeof toAxiosRequest$3;
15355
15630
  toApiError: typeof toApiError$3;
@@ -15359,15 +15634,21 @@ declare class Client$7 {
15359
15634
  private props;
15360
15635
  constructor(axiosInstance: AxiosInstance, props?: Partial<ClientProps$7>);
15361
15636
  readonly getBillingReadonly: (input: GetBillingReadonlyInput) => Promise<GetBillingReadonlyResponse>;
15362
- readonly getPlan: (input: GetPlanInput) => Promise<GetPlanResponse>;
15637
+ readonly getPlan: (input: GetPlanInput) => Promise<GetPlanResponse$1>;
15363
15638
  readonly listPlans: (input: ListPlansInput) => Promise<ListPlansResponse>;
15364
- readonly getAddon: (input: GetAddonInput) => Promise<GetAddonResponse>;
15639
+ readonly getAddon: (input: GetAddonInput) => Promise<GetAddonResponse$1>;
15365
15640
  readonly listAddons: (input: ListAddonsInput) => Promise<ListAddonsResponse>;
15641
+ readonly getCurrentSubscription: (input: GetCurrentSubscriptionInput) => Promise<GetCurrentSubscriptionResponse>;
15642
+ readonly getNextSubscription: (input: GetNextSubscriptionInput) => Promise<GetNextSubscriptionResponse>;
15643
+ readonly previewSubscriptionUpdate: (input: PreviewSubscriptionUpdateInput) => Promise<PreviewSubscriptionUpdateResponse>;
15644
+ readonly setPlan: (input: SetPlanInput) => Promise<SetPlanResponse>;
15645
+ readonly setAddons: (input: SetAddonsInput) => Promise<SetAddonsResponse>;
15366
15646
  readonly listInvoices: (input: ListInvoicesInput) => Promise<ListInvoicesResponse>;
15367
15647
  readonly payInvoice: (input: PayInvoiceInput) => Promise<PayInvoiceResponse>;
15368
15648
  readonly getPaymentMethod: (input: GetPaymentMethodInput) => Promise<GetPaymentMethodResponse>;
15369
15649
  readonly setPaymentMethod: (input: SetPaymentMethodInput) => Promise<SetPaymentMethodResponse>;
15370
15650
  readonly createPaymentMethodIntent: (input: CreatePaymentMethodIntentInput) => Promise<CreatePaymentMethodIntentResponse>;
15651
+ readonly getQuotas: (input: GetQuotasInput) => Promise<GetQuotasResponse>;
15371
15652
  }
15372
15653
  declare function toApiError$3(err: unknown): Error;
15373
15654