@squidcloud/client 1.0.179 → 1.0.180

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/cjs/index.js CHANGED
@@ -51476,7 +51476,7 @@ class ApiClient {
51476
51476
  * In case of error (status code >= 400 or other error), the promise will be rejected with an RpcError.
51477
51477
  */
51478
51478
  async request(integrationId, endpointId, body, options, method) {
51479
- const optionsToSend = Object.assign(Object.assign({}, DEFAULT_OPTIONS), (options || {}));
51479
+ const optionsToSend = Object.assign(Object.assign({}, DEFAULT_OPTIONS), this.convertOptionsToStrings(options || {}));
51480
51480
  const apiRequest = {
51481
51481
  integrationId,
51482
51482
  endpointId,
@@ -51486,6 +51486,21 @@ class ApiClient {
51486
51486
  };
51487
51487
  return await this.rpcManager.rawPost('api/callApi', apiRequest, undefined, undefined, false);
51488
51488
  }
51489
+ convertOptionsToStrings(apiOptions) {
51490
+ return {
51491
+ headers: this.convertToStrings(apiOptions.headers),
51492
+ queryParams: this.convertToStrings(apiOptions.queryParams),
51493
+ pathParams: this.convertToStrings(apiOptions.pathParams),
51494
+ };
51495
+ }
51496
+ convertToStrings(items) {
51497
+ if (!items)
51498
+ return {};
51499
+ const entries = Object.entries(items)
51500
+ .filter(([, value]) => value !== undefined)
51501
+ .map(([key, value]) => [key, String(value)]);
51502
+ return Object.fromEntries(entries);
51503
+ }
51489
51504
  }
51490
51505
 
51491
51506
  ;// CONCATENATED MODULE: ./src/squid.ts
@@ -1,7 +1,7 @@
1
1
  import { ApiEndpointId, HttpMethod } from './integrations/api.public-types';
2
2
  import { IntegrationId } from './communication.public-types';
3
3
  /** The headers of an API call. */
4
- export type ApiHeaders = Record<string, string>;
4
+ export type ApiHeaders = Record<string, string | number | boolean>;
5
5
  /** The context of an API call. */
6
6
  export declare class ApiCallContext {
7
7
  readonly integrationId: IntegrationId;
@@ -12,9 +12,9 @@ export declare class ApiCallContext {
12
12
  readonly options: ApiOptions;
13
13
  }
14
14
  export interface ApiOptions {
15
- headers?: ApiHeaders;
16
- queryParams?: Record<string, string>;
17
- pathParams?: Record<string, string>;
15
+ headers?: Record<string, string | number | boolean>;
16
+ queryParams?: Record<string, string | number | boolean>;
17
+ pathParams?: Record<string, string | number | boolean>;
18
18
  }
19
19
  /** The options for calling an API. */
20
20
  export interface CallApiOptions {
@@ -36,6 +36,6 @@ export interface CallApiRequest {
36
36
  /** A native API call response. */
37
37
  export interface NativeApiCallResponse<T = unknown> {
38
38
  body: T;
39
- headers: ApiHeaders;
39
+ headers: Record<string, string>;
40
40
  status: number;
41
41
  }
@@ -15,4 +15,6 @@ export declare class ApiClient {
15
15
  * In case of error (status code >= 400 or other error), the promise will be rejected with an RpcError.
16
16
  */
17
17
  request<T = unknown>(integrationId: IntegrationId, endpointId: ApiEndpointId, body?: unknown, options?: ApiOptions, method?: HttpMethod): Promise<HttpResponse<T>>;
18
+ private convertOptionsToStrings;
19
+ private convertToStrings;
18
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squidcloud/client",
3
- "version": "1.0.179",
3
+ "version": "1.0.180",
4
4
  "description": "A typescript implementation of the Squid client",
5
5
  "main": "dist/cjs/index.js",
6
6
  "types": "dist/typescript-client/src/index.d.ts",