@botpress/client 1.31.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
@@ -3149,6 +3149,52 @@ type TrackAnalyticsInput$1 = TrackAnalyticsRequestBody$1 & TrackAnalyticsRequest
3149
3149
  interface TrackAnalyticsResponse$1 {
3150
3150
  }
3151
3151
 
3152
+ interface CaptureObservationRequestHeaders$1 {
3153
+ }
3154
+ interface CaptureObservationRequestQuery$1 {
3155
+ }
3156
+ interface CaptureObservationRequestParams$1 {
3157
+ }
3158
+ interface CaptureObservationRequestBody$1 {
3159
+ /**
3160
+ * Name of the observation
3161
+ */
3162
+ name: string;
3163
+ /**
3164
+ * Data of the observation
3165
+ */
3166
+ data: {
3167
+ [k: string]: any;
3168
+ };
3169
+ /**
3170
+ * ID of the message associated with the observation
3171
+ */
3172
+ messageId?: string;
3173
+ /**
3174
+ * ID of the event associated with the observation
3175
+ */
3176
+ eventId?: string;
3177
+ /**
3178
+ * ID of the conversation associated with the observation
3179
+ */
3180
+ conversationId?: string;
3181
+ /**
3182
+ * ID of the user associated with the observation
3183
+ */
3184
+ userId?: string;
3185
+ /**
3186
+ * ID of the error associated with the observation
3187
+ */
3188
+ errorId?: string;
3189
+ /**
3190
+ * ID of the trace associated with the observation
3191
+ */
3192
+ traceId?: string;
3193
+ }
3194
+ type CaptureObservationInput$1 = CaptureObservationRequestBody$1 & CaptureObservationRequestHeaders$1 & CaptureObservationRequestQuery$1 & CaptureObservationRequestParams$1;
3195
+ interface CaptureObservationResponse$1 {
3196
+ }
3197
+
3152
3198
  type ClientProps$b = {
3153
3199
  toAxiosRequest: typeof toAxiosRequest$5;
3154
3200
  toApiError: typeof toApiError$5;
@@ -3205,6 +3251,7 @@ declare class Client$b {
3205
3251
  readonly getOrCreateWorkflow: (input: GetOrCreateWorkflowInput$1) => Promise<GetOrCreateWorkflowResponse$1>;
3206
3252
  readonly listTagValues: (input: ListTagValuesInput$1) => Promise<ListTagValuesResponse$1>;
3207
3253
  readonly trackAnalytics: (input: TrackAnalyticsInput$1) => Promise<TrackAnalyticsResponse$1>;
3254
+ readonly captureObservation: (input: CaptureObservationInput$1) => Promise<CaptureObservationResponse$1>;
3208
3255
  }
3209
3256
  declare function toApiError$5(err: unknown): Error;
3210
3257
 
@@ -15066,24 +15113,22 @@ interface GetPlanRequestParams {
15066
15113
  interface GetPlanRequestBody {
15067
15114
  }
15068
15115
  type GetPlanInput = GetPlanRequestBody & GetPlanRequestHeaders & GetPlanRequestQuery & GetPlanRequestParams;
15069
- interface GetPlanResponse {
15116
+ interface GetPlanResponse$1 {
15070
15117
  id: string;
15071
15118
  name: string;
15072
15119
  description: string;
15073
- providerProductId: string;
15074
15120
  prices: {
15075
- [k: string]: {
15076
- providerPriceId: string;
15121
+ month?: {
15077
15122
  amount: number;
15078
- currency: "usd";
15079
- interval: "month" | "year";
15080
- metadata?: {
15081
- [k: string]: string;
15082
- };
15123
+ currency: string;
15124
+ };
15125
+ year?: {
15126
+ amount: number;
15127
+ currency: string;
15083
15128
  };
15084
15129
  };
15085
15130
  features: {
15086
- [k: string]: any;
15131
+ [k: string]: number;
15087
15132
  };
15088
15133
  metadata?: {
15089
15134
  [k: string]: string;
@@ -15099,29 +15144,28 @@ interface ListPlansRequestParams {
15099
15144
  interface ListPlansRequestBody {
15100
15145
  }
15101
15146
  type ListPlansInput = ListPlansRequestBody & ListPlansRequestHeaders & ListPlansRequestQuery & ListPlansRequestParams;
15102
- type ListPlansResponse = {
15147
+ type ListPlansResponse = GetPlanResponse[];
15148
+ interface GetPlanResponse {
15103
15149
  id: string;
15104
15150
  name: string;
15105
15151
  description: string;
15106
- providerProductId: string;
15107
15152
  prices: {
15108
- [k: string]: {
15109
- providerPriceId: string;
15153
+ month?: {
15110
15154
  amount: number;
15111
- currency: "usd";
15112
- interval: "month" | "year";
15113
- metadata?: {
15114
- [k: string]: string;
15115
- };
15155
+ currency: string;
15156
+ };
15157
+ year?: {
15158
+ amount: number;
15159
+ currency: string;
15116
15160
  };
15117
15161
  };
15118
15162
  features: {
15119
- [k: string]: any | null;
15163
+ [k: string]: number;
15120
15164
  };
15121
15165
  metadata?: {
15122
15166
  [k: string]: string;
15123
15167
  };
15124
- }[];
15168
+ }
15125
15169
 
15126
15170
  interface GetAddonRequestHeaders {
15127
15171
  }
@@ -15133,22 +15177,11 @@ interface GetAddonRequestParams {
15133
15177
  interface GetAddonRequestBody {
15134
15178
  }
15135
15179
  type GetAddonInput = GetAddonRequestBody & GetAddonRequestHeaders & GetAddonRequestQuery & GetAddonRequestParams;
15136
- interface GetAddonResponse {
15180
+ interface GetAddonResponse$1 {
15137
15181
  id: string;
15138
15182
  name: string;
15139
15183
  description: string;
15140
- providerProductId: string;
15141
- prices: {
15142
- [k: string]: {
15143
- providerPriceId: string;
15144
- amount: number;
15145
- currency: "usd";
15146
- interval: "month" | "year";
15147
- metadata?: {
15148
- [k: string]: string;
15149
- };
15150
- };
15151
- };
15184
+ price: number;
15152
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";
15153
15186
  increment: number;
15154
15187
  metadata?: {
@@ -15165,28 +15198,307 @@ interface ListAddonsRequestParams {
15165
15198
  interface ListAddonsRequestBody {
15166
15199
  }
15167
15200
  type ListAddonsInput = ListAddonsRequestBody & ListAddonsRequestHeaders & ListAddonsRequestQuery & ListAddonsRequestParams;
15168
- type ListAddonsResponse = {
15201
+ type ListAddonsResponse = GetAddonResponse[];
15202
+ interface GetAddonResponse {
15169
15203
  id: string;
15170
15204
  name: string;
15171
15205
  description: string;
15172
- providerProductId: string;
15173
- 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: {
15174
15242
  [k: string]: {
15175
- providerPriceId: string;
15176
- amount: number;
15177
- 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;
15178
15274
  interval: "month" | "year";
15179
- metadata?: {
15180
- [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;
15181
15345
  };
15182
15346
  };
15183
15347
  };
15184
- 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";
15185
- increment: number;
15186
- metadata?: {
15187
- [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
+ };
15442
+ };
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;
15188
15483
  };
15189
- }[];
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
+ }
15190
15502
 
15191
15503
  interface ListInvoicesRequestHeaders {
15192
15504
  }
@@ -15198,9 +15510,6 @@ interface ListInvoicesRequestParams {
15198
15510
  interface ListInvoicesRequestBody {
15199
15511
  }
15200
15512
  type ListInvoicesInput = ListInvoicesRequestBody & ListInvoicesRequestHeaders & ListInvoicesRequestQuery & ListInvoicesRequestParams;
15201
- /**
15202
- * List of invoices with pagination.
15203
- */
15204
15513
  interface ListInvoicesResponse {
15205
15514
  invoices: {
15206
15515
  id: string;
@@ -15303,6 +15612,19 @@ interface CreatePaymentMethodIntentResponse {
15303
15612
  clientSecret: string;
15304
15613
  }
15305
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
+
15306
15628
  type ClientProps$7 = {
15307
15629
  toAxiosRequest: typeof toAxiosRequest$3;
15308
15630
  toApiError: typeof toApiError$3;
@@ -15312,15 +15634,21 @@ declare class Client$7 {
15312
15634
  private props;
15313
15635
  constructor(axiosInstance: AxiosInstance, props?: Partial<ClientProps$7>);
15314
15636
  readonly getBillingReadonly: (input: GetBillingReadonlyInput) => Promise<GetBillingReadonlyResponse>;
15315
- readonly getPlan: (input: GetPlanInput) => Promise<GetPlanResponse>;
15637
+ readonly getPlan: (input: GetPlanInput) => Promise<GetPlanResponse$1>;
15316
15638
  readonly listPlans: (input: ListPlansInput) => Promise<ListPlansResponse>;
15317
- readonly getAddon: (input: GetAddonInput) => Promise<GetAddonResponse>;
15639
+ readonly getAddon: (input: GetAddonInput) => Promise<GetAddonResponse$1>;
15318
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>;
15319
15646
  readonly listInvoices: (input: ListInvoicesInput) => Promise<ListInvoicesResponse>;
15320
15647
  readonly payInvoice: (input: PayInvoiceInput) => Promise<PayInvoiceResponse>;
15321
15648
  readonly getPaymentMethod: (input: GetPaymentMethodInput) => Promise<GetPaymentMethodResponse>;
15322
15649
  readonly setPaymentMethod: (input: SetPaymentMethodInput) => Promise<SetPaymentMethodResponse>;
15323
15650
  readonly createPaymentMethodIntent: (input: CreatePaymentMethodIntentInput) => Promise<CreatePaymentMethodIntentResponse>;
15651
+ readonly getQuotas: (input: GetQuotasInput) => Promise<GetQuotasResponse>;
15324
15652
  }
15325
15653
  declare function toApiError$3(err: unknown): Error;
15326
15654
 
@@ -21405,6 +21733,52 @@ type TrackAnalyticsInput = TrackAnalyticsRequestBody & TrackAnalyticsRequestHead
21405
21733
  interface TrackAnalyticsResponse {
21406
21734
  }
21407
21735
 
21736
+ interface CaptureObservationRequestHeaders {
21737
+ }
21738
+ interface CaptureObservationRequestQuery {
21739
+ }
21740
+ interface CaptureObservationRequestParams {
21741
+ }
21742
+ interface CaptureObservationRequestBody {
21743
+ /**
21744
+ * Name of the observation
21745
+ */
21746
+ name: string;
21747
+ /**
21748
+ * Data of the observation
21749
+ */
21750
+ data: {
21751
+ [k: string]: any;
21752
+ };
21753
+ /**
21754
+ * ID of the message associated with the observation
21755
+ */
21756
+ messageId?: string;
21757
+ /**
21758
+ * ID of the event associated with the observation
21759
+ */
21760
+ eventId?: string;
21761
+ /**
21762
+ * ID of the conversation associated with the observation
21763
+ */
21764
+ conversationId?: string;
21765
+ /**
21766
+ * ID of the user associated with the observation
21767
+ */
21768
+ userId?: string;
21769
+ /**
21770
+ * ID of the error associated with the observation
21771
+ */
21772
+ errorId?: string;
21773
+ /**
21774
+ * ID of the trace associated with the observation
21775
+ */
21776
+ traceId?: string;
21777
+ }
21778
+ type CaptureObservationInput = CaptureObservationRequestBody & CaptureObservationRequestHeaders & CaptureObservationRequestQuery & CaptureObservationRequestParams;
21779
+ interface CaptureObservationResponse {
21780
+ }
21781
+
21408
21782
  interface RunVrlRequestHeaders {
21409
21783
  }
21410
21784
  interface RunVrlRequestQuery {
@@ -37467,6 +37841,7 @@ declare class Client$1 {
37467
37841
  readonly getOrCreateWorkflow: (input: GetOrCreateWorkflowInput) => Promise<GetOrCreateWorkflowResponse>;
37468
37842
  readonly listTagValues: (input: ListTagValuesInput) => Promise<ListTagValuesResponse>;
37469
37843
  readonly trackAnalytics: (input: TrackAnalyticsInput) => Promise<TrackAnalyticsResponse>;
37844
+ readonly captureObservation: (input: CaptureObservationInput) => Promise<CaptureObservationResponse>;
37470
37845
  readonly runVrl: (input: RunVrlInput) => Promise<RunVrlResponse>;
37471
37846
  readonly getAccount: (input: GetAccountInput) => Promise<GetAccountResponse>;
37472
37847
  readonly updateAccount: (input: UpdateAccountInput) => Promise<UpdateAccountResponse>;