@botpress/client 1.49.0 → 2.0.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
@@ -1,12 +1,83 @@
1
- import { AxiosRequestConfig, AxiosInstance, AxiosError } from 'axios';
2
- import * as axios from 'axios';
3
- export { axios };
4
- import { IAxiosRetryConfig } from 'axios-retry';
5
- import * as axiosRetry from 'axios-retry';
6
- export { axiosRetry };
1
+ type HttpHeaders = Record<string, string | string[] | undefined>;
2
+ type HttpResponseHeaders = Record<string, string>;
3
+ type HttpRequestConfig<D = any> = {
4
+ url?: string;
5
+ method?: string;
6
+ baseURL?: string;
7
+ headers?: HttpHeaders;
8
+ data?: D;
9
+ timeout?: number;
10
+ signal?: AbortSignal;
11
+ responseType?: 'json' | 'text' | 'arraybuffer' | 'stream';
12
+ withCredentials?: boolean;
13
+ };
14
+ type HttpResponse$6<T = any> = {
15
+ data: T;
16
+ status: number;
17
+ statusText: string;
18
+ headers: HttpResponseHeaders;
19
+ config: HttpRequestConfig;
20
+ };
21
+ declare class HttpError<T = any> extends Error {
22
+ readonly config: HttpRequestConfig;
23
+ readonly code?: string | undefined;
24
+ readonly response?: HttpResponse$6<T> | undefined;
25
+ readonly isHttpError = true;
26
+ constructor(message: string, config: HttpRequestConfig, code?: string | undefined, response?: HttpResponse$6<T> | undefined, cause?: unknown);
27
+ }
28
+ declare const isHttpError: (err: unknown) => err is HttpError;
29
+ declare const isNetworkError: (error: unknown) => boolean;
30
+ declare const isNetworkOrIdempotentRequestError: (error: unknown) => boolean;
31
+ type RetryConfig = {
32
+ retries?: number;
33
+ retryCondition?: (error: HttpError) => boolean | Promise<boolean>;
34
+ retryDelay?: (retryCount: number, error: HttpError) => number;
35
+ };
36
+ type HttpClientDefaults = {
37
+ baseURL?: string;
38
+ headers: HttpHeaders;
39
+ timeout?: number;
40
+ withCredentials?: boolean;
41
+ signal?: AbortSignal;
42
+ debug?: boolean;
43
+ };
44
+ type HttpClientConfig = {
45
+ apiUrl: string;
46
+ headers: HttpHeaders;
47
+ withCredentials: boolean;
48
+ timeout: number;
49
+ debug: boolean;
50
+ };
51
+ declare const createHttpClient: (config: HttpClientConfig) => HttpClient$6;
52
+ declare class HttpClient$6 {
53
+ defaults: HttpClientDefaults;
54
+ retry?: RetryConfig;
55
+ constructor(defaults?: Partial<HttpClientDefaults>);
56
+ request<T = any, D = any>(config: HttpRequestConfig<D>): Promise<HttpResponse$6<T>>;
57
+ get<T = any>(url: string, config?: HttpRequestConfig): Promise<HttpResponse$6<T>>;
58
+ delete<T = any>(url: string, config?: HttpRequestConfig): Promise<HttpResponse$6<T>>;
59
+ post<T = any, D = any>(url: string, data?: D, config?: HttpRequestConfig<D>): Promise<HttpResponse$6<T>>;
60
+ put<T = any, D = any>(url: string, data?: D, config?: HttpRequestConfig<D>): Promise<HttpResponse$6<T>>;
61
+ private _requestOnce;
62
+ }
63
+
64
+ type http_HttpClientDefaults = HttpClientDefaults;
65
+ type http_HttpError<T = any> = HttpError<T>;
66
+ declare const http_HttpError: typeof HttpError;
67
+ type http_HttpHeaders = HttpHeaders;
68
+ type http_HttpRequestConfig<D = any> = HttpRequestConfig<D>;
69
+ type http_HttpResponseHeaders = HttpResponseHeaders;
70
+ type http_RetryConfig = RetryConfig;
71
+ declare const http_createHttpClient: typeof createHttpClient;
72
+ declare const http_isHttpError: typeof isHttpError;
73
+ declare const http_isNetworkError: typeof isNetworkError;
74
+ declare const http_isNetworkOrIdempotentRequestError: typeof isNetworkOrIdempotentRequestError;
75
+ declare namespace http {
76
+ export { HttpClient$6 as HttpClient, http_HttpError as HttpError, http_createHttpClient as createHttpClient, http_isHttpError as isHttpError, http_isNetworkError as isNetworkError, http_isNetworkOrIdempotentRequestError as isNetworkOrIdempotentRequestError };
77
+ export type { http_HttpClientDefaults as HttpClientDefaults, http_HttpHeaders as HttpHeaders, http_HttpRequestConfig as HttpRequestConfig, HttpResponse$6 as HttpResponse, http_HttpResponseHeaders as HttpResponseHeaders, http_RetryConfig as RetryConfig };
78
+ }
7
79
 
8
80
  type Headers = Record<string, string | string[]>;
9
- type RetryConfig = IAxiosRetryConfig;
10
81
  type ClientConfig = {
11
82
  apiUrl: string;
12
83
  headers: Headers;
@@ -72,7 +143,13 @@ type ParsedRequest$5 = {
72
143
  headers: AnyHeaderParams$5;
73
144
  body: AnyBodyParams$5;
74
145
  };
75
- declare const toAxiosRequest$5: (req: ParsedRequest$5) => AxiosRequestConfig;
146
+ type RequestConfig$5 = {
147
+ method: string;
148
+ url: string;
149
+ headers: Record<string, string>;
150
+ data?: any;
151
+ };
152
+ declare const toRequest$5: (req: ParsedRequest$5) => RequestConfig$5;
76
153
 
77
154
  interface CreateConversationRequestHeaders$1 {
78
155
  }
@@ -3125,14 +3202,26 @@ type CaptureObservationInput$1 = CaptureObservationRequestBody$1 & CaptureObserv
3125
3202
  interface CaptureObservationResponse$1 {
3126
3203
  }
3127
3204
 
3205
+ type HttpResponse$5<T> = {
3206
+ data: T;
3207
+ };
3208
+ /**
3209
+ * Minimal http transport the generated client depends on. Implementations
3210
+ * MUST reject (throw) on unsuccessful http statuses — exposing the parsed
3211
+ * error body under `response.data` on the thrown error so it can be mapped
3212
+ * to an api error — and resolve with the parsed response body under `data`.
3213
+ */
3214
+ type HttpClient$5 = {
3215
+ request: <T>(config: RequestConfig$5) => Promise<HttpResponse$5<T>>;
3216
+ };
3128
3217
  type ClientProps$b = {
3129
- toAxiosRequest: typeof toAxiosRequest$5;
3218
+ toRequest: typeof toRequest$5;
3130
3219
  toApiError: typeof toApiError$5;
3131
3220
  };
3132
3221
  declare class Client$b {
3133
- private axiosInstance;
3222
+ private httpClient;
3134
3223
  private props;
3135
- constructor(axiosInstance: AxiosInstance, props?: Partial<ClientProps$b>);
3224
+ constructor(httpClient: HttpClient$5, props?: Partial<ClientProps$b>);
3136
3225
  readonly createConversation: (input: CreateConversationInput$1) => Promise<CreateConversationResponse$1>;
3137
3226
  readonly getConversation: (input: GetConversationInput$1) => Promise<GetConversationResponse$1>;
3138
3227
  readonly listConversations: (input: ListConversationsInput$1) => Promise<ListConversationsResponse$1>;
@@ -3197,14 +3286,14 @@ declare class Client$a extends Client$b {
3197
3286
  constructor(clientProps: ClientProps$a);
3198
3287
  get list(): {
3199
3288
  conversations: (props: {
3200
- channel?: string | undefined;
3289
+ pageSize?: number | undefined;
3201
3290
  tags?: {
3202
3291
  [x: string]: string;
3203
3292
  } | undefined;
3204
- integrationName?: string | undefined;
3205
- pageSize?: number | undefined;
3206
3293
  sortField?: "createdAt" | "updatedAt" | undefined;
3207
3294
  sortDirection?: "asc" | "desc" | undefined;
3295
+ integrationName?: string | undefined;
3296
+ channel?: string | undefined;
3208
3297
  participantIds?: string[] | undefined;
3209
3298
  afterDate?: string | undefined;
3210
3299
  beforeDate?: string | undefined;
@@ -3226,8 +3315,8 @@ declare class Client$a extends Client$b {
3226
3315
  };
3227
3316
  }>;
3228
3317
  participants: (props: {
3229
- id: string;
3230
3318
  pageSize?: number | undefined;
3319
+ id: string;
3231
3320
  }) => AsyncCollection<{
3232
3321
  id: string;
3233
3322
  createdAt: string;
@@ -3246,10 +3335,10 @@ declare class Client$a extends Client$b {
3246
3335
  }>;
3247
3336
  events: (props: {
3248
3337
  pageSize?: number | undefined;
3249
- userId?: string | undefined;
3250
3338
  type?: string | undefined;
3251
- conversationId?: string | undefined;
3339
+ userId?: string | undefined;
3252
3340
  workflowId?: string | undefined;
3341
+ conversationId?: string | undefined;
3253
3342
  messageId?: string | undefined;
3254
3343
  status?: "pending" | "ignored" | "processed" | "failed" | "scheduled" | undefined;
3255
3344
  }) => AsyncCollection<{
@@ -3266,13 +3355,13 @@ declare class Client$a extends Client$b {
3266
3355
  failureReason: string | null;
3267
3356
  }>;
3268
3357
  messages: (props: {
3358
+ pageSize?: number | undefined;
3269
3359
  tags?: {
3270
3360
  [x: string]: string;
3271
3361
  } | undefined;
3272
- pageSize?: number | undefined;
3362
+ conversationId?: string | undefined;
3273
3363
  afterDate?: string | undefined;
3274
3364
  beforeDate?: string | undefined;
3275
- conversationId?: string | undefined;
3276
3365
  }) => AsyncCollection<{
3277
3366
  id: string;
3278
3367
  createdAt: string;
@@ -3290,15 +3379,15 @@ declare class Client$a extends Client$b {
3290
3379
  origin?: "synthetic";
3291
3380
  }>;
3292
3381
  users: (props: {
3382
+ pageSize?: number | undefined;
3293
3383
  tags?: {
3294
3384
  [x: string]: string;
3295
3385
  } | undefined;
3296
- pageSize?: number | undefined;
3297
3386
  sortField?: "updatedAt" | "createdAt" | undefined;
3298
3387
  sortDirection?: "asc" | "desc" | undefined;
3388
+ conversationId?: string | undefined;
3299
3389
  afterDate?: string | undefined;
3300
3390
  beforeDate?: string | undefined;
3301
- conversationId?: string | undefined;
3302
3391
  rangeField?: "updatedAt" | "createdAt" | undefined;
3303
3392
  }) => AsyncCollection<{
3304
3393
  id: string;
@@ -3338,7 +3427,13 @@ type ParsedRequest$4 = {
3338
3427
  headers: AnyHeaderParams$4;
3339
3428
  body: AnyBodyParams$4;
3340
3429
  };
3341
- declare const toAxiosRequest$4: (req: ParsedRequest$4) => AxiosRequestConfig;
3430
+ type RequestConfig$4 = {
3431
+ method: string;
3432
+ url: string;
3433
+ headers: Record<string, string>;
3434
+ data?: any;
3435
+ };
3436
+ declare const toRequest$4: (req: ParsedRequest$4) => RequestConfig$4;
3342
3437
 
3343
3438
  interface RunVrlRequestHeaders$1 {
3344
3439
  }
@@ -15222,14 +15317,26 @@ interface IntrospectResponse$1 {
15222
15317
  userId: string;
15223
15318
  }
15224
15319
 
15320
+ type HttpResponse$4<T> = {
15321
+ data: T;
15322
+ };
15323
+ /**
15324
+ * Minimal http transport the generated client depends on. Implementations
15325
+ * MUST reject (throw) on unsuccessful http statuses — exposing the parsed
15326
+ * error body under `response.data` on the thrown error so it can be mapped
15327
+ * to an api error — and resolve with the parsed response body under `data`.
15328
+ */
15329
+ type HttpClient$4 = {
15330
+ request: <T>(config: RequestConfig$4) => Promise<HttpResponse$4<T>>;
15331
+ };
15225
15332
  type ClientProps$9 = {
15226
- toAxiosRequest: typeof toAxiosRequest$4;
15333
+ toRequest: typeof toRequest$4;
15227
15334
  toApiError: typeof toApiError$4;
15228
15335
  };
15229
15336
  declare class Client$9 {
15230
- private axiosInstance;
15337
+ private httpClient;
15231
15338
  private props;
15232
- constructor(axiosInstance: AxiosInstance, props?: Partial<ClientProps$9>);
15339
+ constructor(httpClient: HttpClient$4, props?: Partial<ClientProps$9>);
15233
15340
  readonly runVrl: (input: RunVrlInput$1) => Promise<RunVrlResponse$1>;
15234
15341
  readonly getAccount: (input: GetAccountInput$1) => Promise<GetAccountResponse$1>;
15235
15342
  readonly updateAccount: (input: UpdateAccountInput$1) => Promise<UpdateAccountResponse$1>;
@@ -15357,8 +15464,8 @@ declare class Client$8 extends Client$9 {
15357
15464
  constructor(clientProps: ClientProps$8);
15358
15465
  get list(): {
15359
15466
  publicIntegrations: (props: {
15360
- pageSize?: number | undefined;
15361
15467
  name?: string | undefined;
15468
+ pageSize?: number | undefined;
15362
15469
  limit?: number | undefined;
15363
15470
  version?: string | undefined;
15364
15471
  interfaceId?: string | undefined;
@@ -15402,15 +15509,15 @@ declare class Client$8 extends Client$9 {
15402
15509
  };
15403
15510
  }>;
15404
15511
  bots: (props: {
15512
+ pageSize?: number | undefined;
15405
15513
  tags?: {
15406
15514
  [x: string]: string;
15407
15515
  } | undefined;
15408
- pageSize?: number | undefined;
15409
- sortField?: "createdAt" | "updatedAt" | undefined;
15410
- sortDirection?: "asc" | "desc" | undefined;
15411
15516
  dev?: boolean | undefined;
15412
15517
  integrationNames?: string[] | undefined;
15413
15518
  pluginNames?: string[] | undefined;
15519
+ sortField?: "createdAt" | "updatedAt" | undefined;
15520
+ sortDirection?: "asc" | "desc" | undefined;
15414
15521
  }) => AsyncCollection<{
15415
15522
  id: string;
15416
15523
  createdAt: string;
@@ -15423,8 +15530,8 @@ declare class Client$8 extends Client$9 {
15423
15530
  type: "studio" | "adk" | "desk";
15424
15531
  }>;
15425
15532
  botIssues: (props: {
15426
- id: string;
15427
15533
  pageSize?: number | undefined;
15534
+ id: string;
15428
15535
  }) => AsyncCollection<{
15429
15536
  id: string;
15430
15537
  code: string;
@@ -15463,8 +15570,8 @@ declare class Client$8 extends Client$9 {
15463
15570
  displayName?: string;
15464
15571
  }>;
15465
15572
  integrations: (props: {
15466
- pageSize?: number | undefined;
15467
15573
  name?: string | undefined;
15574
+ pageSize?: number | undefined;
15468
15575
  limit?: number | undefined;
15469
15576
  version?: string | undefined;
15470
15577
  interfaceId?: string | undefined;
@@ -15506,8 +15613,8 @@ declare class Client$8 extends Client$9 {
15506
15613
  };
15507
15614
  }>;
15508
15615
  interfaces: (props: {
15509
- pageSize?: number | undefined;
15510
15616
  name?: string | undefined;
15617
+ pageSize?: number | undefined;
15511
15618
  version?: string | undefined;
15512
15619
  }) => AsyncCollection<{
15513
15620
  id: string;
@@ -15536,8 +15643,8 @@ declare class Client$8 extends Client$9 {
15536
15643
  createdAt: string;
15537
15644
  }>;
15538
15645
  usageActivity: (props: {
15539
- id: string;
15540
15646
  pageSize?: number | undefined;
15647
+ id: string;
15541
15648
  type: "invocation_timeout" | "invocation_calls" | "storage_count" | "bot_count" | "knowledgebase_vector_storage" | "workspace_ratelimit" | "table_row_count" | "workspace_member_count" | "integrations_owned_count" | "ai_spend" | "openai_spend" | "bing_search_spend" | "always_alive" | "indexed_file_count" | "file_max_size_bytes";
15542
15649
  timestampFrom?: string | undefined;
15543
15650
  timestampUntil?: string | undefined;
@@ -15550,8 +15657,8 @@ declare class Client$8 extends Client$9 {
15550
15657
  };
15551
15658
  }>;
15552
15659
  usageActivityDaily: (props: {
15553
- id: string;
15554
15660
  pageSize?: number | undefined;
15661
+ id: string;
15555
15662
  type: "invocation_timeout" | "invocation_calls" | "storage_count" | "bot_count" | "knowledgebase_vector_storage" | "workspace_ratelimit" | "table_row_count" | "workspace_member_count" | "integrations_owned_count" | "ai_spend" | "openai_spend" | "bing_search_spend" | "always_alive" | "indexed_file_count" | "file_max_size_bytes";
15556
15663
  dateFrom?: string | undefined;
15557
15664
  dateUntil?: string | undefined;
@@ -15588,7 +15695,13 @@ type ParsedRequest$3 = {
15588
15695
  headers: AnyHeaderParams$3;
15589
15696
  body: AnyBodyParams$3;
15590
15697
  };
15591
- declare const toAxiosRequest$3: (req: ParsedRequest$3) => AxiosRequestConfig;
15698
+ type RequestConfig$3 = {
15699
+ method: string;
15700
+ url: string;
15701
+ headers: Record<string, string>;
15702
+ data?: any;
15703
+ };
15704
+ declare const toRequest$3: (req: ParsedRequest$3) => RequestConfig$3;
15592
15705
 
15593
15706
  interface GetBillingReadonlyRequestHeaders {
15594
15707
  }
@@ -16560,14 +16673,26 @@ interface ListFeatureGatesResponse {
16560
16673
  };
16561
16674
  }
16562
16675
 
16676
+ type HttpResponse$3<T> = {
16677
+ data: T;
16678
+ };
16679
+ /**
16680
+ * Minimal http transport the generated client depends on. Implementations
16681
+ * MUST reject (throw) on unsuccessful http statuses — exposing the parsed
16682
+ * error body under `response.data` on the thrown error so it can be mapped
16683
+ * to an api error — and resolve with the parsed response body under `data`.
16684
+ */
16685
+ type HttpClient$3 = {
16686
+ request: <T>(config: RequestConfig$3) => Promise<HttpResponse$3<T>>;
16687
+ };
16563
16688
  type ClientProps$7 = {
16564
- toAxiosRequest: typeof toAxiosRequest$3;
16689
+ toRequest: typeof toRequest$3;
16565
16690
  toApiError: typeof toApiError$3;
16566
16691
  };
16567
16692
  declare class Client$7 {
16568
- private axiosInstance;
16693
+ private httpClient;
16569
16694
  private props;
16570
- constructor(axiosInstance: AxiosInstance, props?: Partial<ClientProps$7>);
16695
+ constructor(httpClient: HttpClient$3, props?: Partial<ClientProps$7>);
16571
16696
  readonly getBillingReadonly: (input: GetBillingReadonlyInput) => Promise<GetBillingReadonlyResponse>;
16572
16697
  readonly getBillingAddress: (input: GetBillingAddressInput) => Promise<GetBillingAddressResponse>;
16573
16698
  readonly setBillingAddress: (input: SetBillingAddressInput) => Promise<SetBillingAddressResponse>;
@@ -16647,7 +16772,13 @@ type ParsedRequest$2 = {
16647
16772
  headers: AnyHeaderParams$2;
16648
16773
  body: AnyBodyParams$2;
16649
16774
  };
16650
- declare const toAxiosRequest$2: (req: ParsedRequest$2) => AxiosRequestConfig;
16775
+ type RequestConfig$2 = {
16776
+ method: string;
16777
+ url: string;
16778
+ headers: Record<string, string>;
16779
+ data?: any;
16780
+ };
16781
+ declare const toRequest$2: (req: ParsedRequest$2) => RequestConfig$2;
16651
16782
 
16652
16783
  interface UpsertFileRequestHeaders$1 {
16653
16784
  }
@@ -17760,14 +17891,26 @@ interface ListKnowledgeBasesResponse$1 {
17760
17891
  };
17761
17892
  }
17762
17893
 
17894
+ type HttpResponse$2<T> = {
17895
+ data: T;
17896
+ };
17897
+ /**
17898
+ * Minimal http transport the generated client depends on. Implementations
17899
+ * MUST reject (throw) on unsuccessful http statuses — exposing the parsed
17900
+ * error body under `response.data` on the thrown error so it can be mapped
17901
+ * to an api error — and resolve with the parsed response body under `data`.
17902
+ */
17903
+ type HttpClient$2 = {
17904
+ request: <T>(config: RequestConfig$2) => Promise<HttpResponse$2<T>>;
17905
+ };
17763
17906
  type ClientProps$5 = {
17764
- toAxiosRequest: typeof toAxiosRequest$2;
17907
+ toRequest: typeof toRequest$2;
17765
17908
  toApiError: typeof toApiError$2;
17766
17909
  };
17767
17910
  declare class Client$5 {
17768
- private axiosInstance;
17911
+ private httpClient;
17769
17912
  private props;
17770
- constructor(axiosInstance: AxiosInstance, props?: Partial<ClientProps$5>);
17913
+ constructor(httpClient: HttpClient$2, props?: Partial<ClientProps$5>);
17771
17914
  readonly upsertFile: (input: UpsertFileInput$1) => Promise<UpsertFileResponse$1>;
17772
17915
  readonly deleteFile: (input: DeleteFileInput$1) => Promise<DeleteFileResponse$1>;
17773
17916
  readonly listFiles: (input: ListFilesInput$1) => Promise<ListFilesResponse$1>;
@@ -17809,8 +17952,8 @@ declare class Client$4 extends Client$5 implements IClient$2 {
17809
17952
  constructor(clientProps: ClientProps$4);
17810
17953
  get list(): {
17811
17954
  files: (props: {
17812
- tags?: any;
17813
17955
  pageSize?: number | undefined;
17956
+ tags?: any;
17814
17957
  sortField?: "key" | "size" | "createdAt" | "updatedAt" | "status" | undefined;
17815
17958
  sortDirection?: "asc" | "desc" | undefined;
17816
17959
  ids?: string[] | undefined;
@@ -17844,8 +17987,8 @@ declare class Client$4 extends Client$5 implements IClient$2 {
17844
17987
  indexingStack?: "v1" | "v2";
17845
17988
  }>;
17846
17989
  filePassages: (props: {
17847
- id: string;
17848
17990
  pageSize?: number | undefined;
17991
+ id: string;
17849
17992
  limit?: number | undefined;
17850
17993
  }) => AsyncCollection<{
17851
17994
  id: string;
@@ -17866,8 +18009,8 @@ declare class Client$4 extends Client$5 implements IClient$2 {
17866
18009
  tag: string;
17867
18010
  }) => AsyncCollection<string>;
17868
18011
  knowledgeBases: (props: {
17869
- tags?: any;
17870
18012
  pageSize?: number | undefined;
18013
+ tags?: any;
17871
18014
  }) => AsyncCollection<{
17872
18015
  id: string;
17873
18016
  name: string;
@@ -17903,7 +18046,13 @@ type ParsedRequest$1 = {
17903
18046
  headers: AnyHeaderParams$1;
17904
18047
  body: AnyBodyParams$1;
17905
18048
  };
17906
- declare const toAxiosRequest$1: (req: ParsedRequest$1) => AxiosRequestConfig;
18049
+ type RequestConfig$1 = {
18050
+ method: string;
18051
+ url: string;
18052
+ headers: Record<string, string>;
18053
+ data?: any;
18054
+ };
18055
+ declare const toRequest$1: (req: ParsedRequest$1) => RequestConfig$1;
17907
18056
 
17908
18057
  interface ListTablesRequestHeaders$1 {
17909
18058
  }
@@ -19587,14 +19736,26 @@ interface UpsertTableRowsResponse$1 {
19587
19736
  errors?: string[];
19588
19737
  }
19589
19738
 
19739
+ type HttpResponse$1<T> = {
19740
+ data: T;
19741
+ };
19742
+ /**
19743
+ * Minimal http transport the generated client depends on. Implementations
19744
+ * MUST reject (throw) on unsuccessful http statuses — exposing the parsed
19745
+ * error body under `response.data` on the thrown error so it can be mapped
19746
+ * to an api error — and resolve with the parsed response body under `data`.
19747
+ */
19748
+ type HttpClient$1 = {
19749
+ request: <T>(config: RequestConfig$1) => Promise<HttpResponse$1<T>>;
19750
+ };
19590
19751
  type ClientProps$3 = {
19591
- toAxiosRequest: typeof toAxiosRequest$1;
19752
+ toRequest: typeof toRequest$1;
19592
19753
  toApiError: typeof toApiError$1;
19593
19754
  };
19594
19755
  declare class Client$3 {
19595
- private axiosInstance;
19756
+ private httpClient;
19596
19757
  private props;
19597
- constructor(axiosInstance: AxiosInstance, props?: Partial<ClientProps$3>);
19758
+ constructor(httpClient: HttpClient$1, props?: Partial<ClientProps$3>);
19598
19759
  readonly listTables: (input: ListTablesInput$1) => Promise<ListTablesResponse$1>;
19599
19760
  readonly getTable: (input: GetTableInput$1) => Promise<GetTableResponse$1>;
19600
19761
  readonly getOrCreateTable: (input: GetOrCreateTableInput$1) => Promise<GetOrCreateTableResponse$1>;
@@ -19649,7 +19810,13 @@ type ParsedRequest = {
19649
19810
  headers: AnyHeaderParams;
19650
19811
  body: AnyBodyParams;
19651
19812
  };
19652
- declare const toAxiosRequest: (req: ParsedRequest) => AxiosRequestConfig;
19813
+ type RequestConfig = {
19814
+ method: string;
19815
+ url: string;
19816
+ headers: Record<string, string>;
19817
+ data?: any;
19818
+ };
19819
+ declare const toRequest: (req: ParsedRequest) => RequestConfig;
19653
19820
 
19654
19821
  interface CreateConversationRequestHeaders {
19655
19822
  }
@@ -39322,14 +39489,26 @@ interface File {
39322
39489
  indexingStack?: "v1" | "v2";
39323
39490
  }
39324
39491
 
39492
+ type HttpResponse<T> = {
39493
+ data: T;
39494
+ };
39495
+ /**
39496
+ * Minimal http transport the generated client depends on. Implementations
39497
+ * MUST reject (throw) on unsuccessful http statuses — exposing the parsed
39498
+ * error body under `response.data` on the thrown error so it can be mapped
39499
+ * to an api error — and resolve with the parsed response body under `data`.
39500
+ */
39501
+ type HttpClient = {
39502
+ request: <T>(config: RequestConfig) => Promise<HttpResponse<T>>;
39503
+ };
39325
39504
  type ClientProps$1 = {
39326
- toAxiosRequest: typeof toAxiosRequest;
39505
+ toRequest: typeof toRequest;
39327
39506
  toApiError: typeof toApiError;
39328
39507
  };
39329
39508
  declare class Client$1 {
39330
- private axiosInstance;
39509
+ private httpClient;
39331
39510
  private props;
39332
- constructor(axiosInstance: AxiosInstance, props?: Partial<ClientProps$1>);
39511
+ constructor(httpClient: HttpClient, props?: Partial<ClientProps$1>);
39333
39512
  readonly createConversation: (input: CreateConversationInput) => Promise<CreateConversationResponse>;
39334
39513
  readonly getConversation: (input: GetConversationInput) => Promise<GetConversationResponse>;
39335
39514
  readonly listConversations: (input: ListConversationsInput) => Promise<ListConversationsResponse>;
@@ -39540,14 +39719,14 @@ declare class Client extends Client$1 implements IClient {
39540
39719
  constructor(clientProps?: ClientProps);
39541
39720
  get list(): {
39542
39721
  conversations: (props: {
39543
- channel?: string | undefined;
39722
+ pageSize?: number | undefined;
39544
39723
  tags?: {
39545
39724
  [x: string]: string;
39546
39725
  } | undefined;
39547
- integrationName?: string | undefined;
39548
- pageSize?: number | undefined;
39549
39726
  sortField?: "createdAt" | "updatedAt" | undefined;
39550
39727
  sortDirection?: "asc" | "desc" | undefined;
39728
+ integrationName?: string | undefined;
39729
+ channel?: string | undefined;
39551
39730
  participantIds?: string[] | undefined;
39552
39731
  afterDate?: string | undefined;
39553
39732
  beforeDate?: string | undefined;
@@ -39569,8 +39748,8 @@ declare class Client extends Client$1 implements IClient {
39569
39748
  };
39570
39749
  }>;
39571
39750
  participants: (props: {
39572
- id: string;
39573
39751
  pageSize?: number | undefined;
39752
+ id: string;
39574
39753
  }) => AsyncCollection<{
39575
39754
  id: string;
39576
39755
  createdAt: string;
@@ -39589,10 +39768,10 @@ declare class Client extends Client$1 implements IClient {
39589
39768
  }>;
39590
39769
  events: (props: {
39591
39770
  pageSize?: number | undefined;
39592
- userId?: string | undefined;
39593
39771
  type?: string | undefined;
39594
- conversationId?: string | undefined;
39772
+ userId?: string | undefined;
39595
39773
  workflowId?: string | undefined;
39774
+ conversationId?: string | undefined;
39596
39775
  messageId?: string | undefined;
39597
39776
  status?: "pending" | "ignored" | "processed" | "failed" | "scheduled" | undefined;
39598
39777
  }) => AsyncCollection<{
@@ -39609,13 +39788,13 @@ declare class Client extends Client$1 implements IClient {
39609
39788
  failureReason: string | null;
39610
39789
  }>;
39611
39790
  messages: (props: {
39791
+ pageSize?: number | undefined;
39612
39792
  tags?: {
39613
39793
  [x: string]: string;
39614
39794
  } | undefined;
39615
- pageSize?: number | undefined;
39795
+ conversationId?: string | undefined;
39616
39796
  afterDate?: string | undefined;
39617
39797
  beforeDate?: string | undefined;
39618
- conversationId?: string | undefined;
39619
39798
  }) => AsyncCollection<{
39620
39799
  id: string;
39621
39800
  createdAt: string;
@@ -39633,15 +39812,15 @@ declare class Client extends Client$1 implements IClient {
39633
39812
  origin?: "synthetic";
39634
39813
  }>;
39635
39814
  users: (props: {
39815
+ pageSize?: number | undefined;
39636
39816
  tags?: {
39637
39817
  [x: string]: string;
39638
39818
  } | undefined;
39639
- pageSize?: number | undefined;
39640
39819
  sortField?: "updatedAt" | "createdAt" | undefined;
39641
39820
  sortDirection?: "asc" | "desc" | undefined;
39821
+ conversationId?: string | undefined;
39642
39822
  afterDate?: string | undefined;
39643
39823
  beforeDate?: string | undefined;
39644
- conversationId?: string | undefined;
39645
39824
  rangeField?: "updatedAt" | "createdAt" | undefined;
39646
39825
  }) => AsyncCollection<{
39647
39826
  id: string;
@@ -39660,8 +39839,8 @@ declare class Client extends Client$1 implements IClient {
39660
39839
  };
39661
39840
  }>;
39662
39841
  publicIntegrations: (props: {
39663
- pageSize?: number | undefined;
39664
39842
  name?: string | undefined;
39843
+ pageSize?: number | undefined;
39665
39844
  limit?: number | undefined;
39666
39845
  version?: string | undefined;
39667
39846
  interfaceId?: string | undefined;
@@ -39705,15 +39884,15 @@ declare class Client extends Client$1 implements IClient {
39705
39884
  };
39706
39885
  }>;
39707
39886
  bots: (props: {
39887
+ pageSize?: number | undefined;
39708
39888
  tags?: {
39709
39889
  [x: string]: string;
39710
39890
  } | undefined;
39711
- pageSize?: number | undefined;
39712
- sortField?: "createdAt" | "updatedAt" | undefined;
39713
- sortDirection?: "asc" | "desc" | undefined;
39714
39891
  dev?: boolean | undefined;
39715
39892
  integrationNames?: string[] | undefined;
39716
39893
  pluginNames?: string[] | undefined;
39894
+ sortField?: "createdAt" | "updatedAt" | undefined;
39895
+ sortDirection?: "asc" | "desc" | undefined;
39717
39896
  }) => AsyncCollection<{
39718
39897
  id: string;
39719
39898
  createdAt: string;
@@ -39726,8 +39905,8 @@ declare class Client extends Client$1 implements IClient {
39726
39905
  type: "studio" | "adk" | "desk";
39727
39906
  }>;
39728
39907
  botIssues: (props: {
39729
- id: string;
39730
39908
  pageSize?: number | undefined;
39909
+ id: string;
39731
39910
  }) => AsyncCollection<{
39732
39911
  id: string;
39733
39912
  code: string;
@@ -39758,8 +39937,8 @@ declare class Client extends Client$1 implements IClient {
39758
39937
  pageSize?: number | undefined;
39759
39938
  }) => AsyncCollection<UpdateWorkspaceMemberResponse$1>;
39760
39939
  integrations: (props: {
39761
- pageSize?: number | undefined;
39762
39940
  name?: string | undefined;
39941
+ pageSize?: number | undefined;
39763
39942
  limit?: number | undefined;
39764
39943
  version?: string | undefined;
39765
39944
  interfaceId?: string | undefined;
@@ -39801,8 +39980,8 @@ declare class Client extends Client$1 implements IClient {
39801
39980
  };
39802
39981
  }>;
39803
39982
  interfaces: (props: {
39804
- pageSize?: number | undefined;
39805
39983
  name?: string | undefined;
39984
+ pageSize?: number | undefined;
39806
39985
  version?: string | undefined;
39807
39986
  }) => AsyncCollection<{
39808
39987
  id: string;
@@ -39817,8 +39996,8 @@ declare class Client extends Client$1 implements IClient {
39817
39996
  public: boolean;
39818
39997
  }>;
39819
39998
  publicInterfaces: (props: {
39820
- pageSize?: number | undefined;
39821
39999
  name?: string | undefined;
40000
+ pageSize?: number | undefined;
39822
40001
  version?: string | undefined;
39823
40002
  }) => AsyncCollection<{
39824
40003
  id: string;
@@ -39833,8 +40012,8 @@ declare class Client extends Client$1 implements IClient {
39833
40012
  public: boolean;
39834
40013
  }>;
39835
40014
  plugins: (props: {
39836
- pageSize?: number | undefined;
39837
40015
  name?: string | undefined;
40016
+ pageSize?: number | undefined;
39838
40017
  version?: string | undefined;
39839
40018
  }) => AsyncCollection<{
39840
40019
  id: string;
@@ -39850,8 +40029,8 @@ declare class Client extends Client$1 implements IClient {
39850
40029
  lifecycleStatus: "published" | "deprecated";
39851
40030
  }>;
39852
40031
  publicPlugins: (props: {
39853
- pageSize?: number | undefined;
39854
40032
  name?: string | undefined;
40033
+ pageSize?: number | undefined;
39855
40034
  version?: string | undefined;
39856
40035
  }) => AsyncCollection<{
39857
40036
  id: string;
@@ -39881,8 +40060,8 @@ declare class Client extends Client$1 implements IClient {
39881
40060
  createdAt: string;
39882
40061
  }>;
39883
40062
  files: (props: {
39884
- tags?: any;
39885
40063
  pageSize?: number | undefined;
40064
+ tags?: any;
39886
40065
  sortField?: "key" | "size" | "createdAt" | "updatedAt" | "status" | undefined;
39887
40066
  sortDirection?: "asc" | "desc" | undefined;
39888
40067
  ids?: string[] | undefined;
@@ -39916,8 +40095,8 @@ declare class Client extends Client$1 implements IClient {
39916
40095
  indexingStack?: "v1" | "v2";
39917
40096
  }>;
39918
40097
  filePassages: (props: {
39919
- id: string;
39920
40098
  pageSize?: number | undefined;
40099
+ id: string;
39921
40100
  limit?: number | undefined;
39922
40101
  }) => AsyncCollection<{
39923
40102
  id: string;
@@ -39938,8 +40117,8 @@ declare class Client extends Client$1 implements IClient {
39938
40117
  tag: string;
39939
40118
  }) => AsyncCollection<string>;
39940
40119
  knowledgeBases: (props: {
39941
- tags?: any;
39942
40120
  pageSize?: number | undefined;
40121
+ tags?: any;
39943
40122
  }) => AsyncCollection<{
39944
40123
  id: string;
39945
40124
  name: string;
@@ -39950,8 +40129,8 @@ declare class Client extends Client$1 implements IClient {
39950
40129
  };
39951
40130
  }>;
39952
40131
  usageActivity: (props: {
39953
- id: string;
39954
40132
  pageSize?: number | undefined;
40133
+ id: string;
39955
40134
  type: "invocation_timeout" | "invocation_calls" | "storage_count" | "bot_count" | "knowledgebase_vector_storage" | "workspace_ratelimit" | "table_row_count" | "workspace_member_count" | "integrations_owned_count" | "ai_spend" | "openai_spend" | "bing_search_spend" | "always_alive" | "indexed_file_count" | "file_max_size_bytes";
39956
40135
  timestampFrom?: string | undefined;
39957
40136
  timestampUntil?: string | undefined;
@@ -39964,8 +40143,8 @@ declare class Client extends Client$1 implements IClient {
39964
40143
  };
39965
40144
  }>;
39966
40145
  usageActivityDaily: (props: {
39967
- id: string;
39968
40146
  pageSize?: number | undefined;
40147
+ id: string;
39969
40148
  type: "invocation_timeout" | "invocation_calls" | "storage_count" | "bot_count" | "knowledgebase_vector_storage" | "workspace_ratelimit" | "table_row_count" | "workspace_member_count" | "integrations_owned_count" | "ai_spend" | "openai_spend" | "bing_search_spend" | "always_alive" | "indexed_file_count" | "file_max_size_bytes";
39970
40149
  dateFrom?: string | undefined;
39971
40150
  dateUntil?: string | undefined;
@@ -39981,13 +40160,13 @@ declare class Client extends Client$1 implements IClient {
39981
40160
  };
39982
40161
  }>;
39983
40162
  workflows: (props: {
40163
+ name?: string | undefined;
40164
+ pageSize?: number | undefined;
39984
40165
  tags?: {
39985
40166
  [x: string]: string;
39986
40167
  } | undefined;
39987
- pageSize?: number | undefined;
39988
40168
  userId?: string | undefined;
39989
40169
  conversationId?: string | undefined;
39990
- name?: string | undefined;
39991
40170
  parentWorkflowId?: string | undefined;
39992
40171
  statuses?: ("pending" | "failed" | "in_progress" | "completed" | "listening" | "paused" | "timedout" | "cancelled")[] | undefined;
39993
40172
  }) => AsyncCollection<{
@@ -40249,10 +40428,10 @@ type ApiError = UnknownError | InternalError | UnauthorizedError | ForbiddenErro
40249
40428
  declare const errorFrom: (err: unknown) => ApiError;
40250
40429
 
40251
40430
  declare class UploadFileError extends Error {
40252
- readonly innerError?: AxiosError | undefined;
40431
+ readonly innerError?: Error | undefined;
40253
40432
  readonly file?: UpsertFileResponse["file"] | undefined;
40254
- constructor(message: string, innerError?: AxiosError | undefined, file?: UpsertFileResponse["file"] | undefined);
40433
+ constructor(message: string, innerError?: Error | undefined, file?: UpsertFileResponse["file"] | undefined);
40255
40434
  }
40256
40435
 
40257
- export { AlreadyExistsError, BreakingChangesError, Client, ForbiddenError, InternalError, InvalidDataFormatError, InvalidIdentifierError, InvalidJsonSchemaError, InvalidPayloadError, InvalidQueryError, LimitExceededError, MethodNotFoundError, OperationTimeoutError, PayloadTooLargeError, PaymentRequiredError, QuotaExceededError, RateLimitedError, ReferenceConstraintError, ReferenceNotFoundError, RelationConflictError, ResourceGoneError, ResourceLockedConflictError, ResourceNotFoundError, RuntimeError, UnauthorizedError, UnknownError, UnsupportedMediaTypeError, UploadFileError, index$3 as admin, index$2 as billing, errorFrom, index$1 as files, isApiError, index$4 as runtime, index as tables };
40436
+ export { AlreadyExistsError, BreakingChangesError, Client, ForbiddenError, InternalError, InvalidDataFormatError, InvalidIdentifierError, InvalidJsonSchemaError, InvalidPayloadError, InvalidQueryError, LimitExceededError, MethodNotFoundError, OperationTimeoutError, PayloadTooLargeError, PaymentRequiredError, QuotaExceededError, RateLimitedError, ReferenceConstraintError, ReferenceNotFoundError, RelationConflictError, ResourceGoneError, ResourceLockedConflictError, ResourceNotFoundError, RuntimeError, UnauthorizedError, UnknownError, UnsupportedMediaTypeError, UploadFileError, index$3 as admin, index$2 as billing, errorFrom, index$1 as files, http, isApiError, index$4 as runtime, index as tables };
40258
40437
  export type { Account, Activity, ApiError, Bot, ClientConfig, ClientInputs, ClientOutputs, ClientProps, Column, Conversation, ErrorType, Event, File, Headers, Integration, Interface, Issue, IssueEvent, Message, Operation, Plugin, RetryConfig, Row, State, Table, Usage, User, Version, Workflow, Workspace, WorkspaceMember };