@spyglasshq/sdk 0.1.6 → 0.1.7

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.
Files changed (250) hide show
  1. package/dist/cjs/BaseClient.d.ts +4 -4
  2. package/dist/cjs/BaseClient.js +7 -7
  3. package/dist/cjs/Client.d.ts +5 -5
  4. package/dist/cjs/Client.js +56 -38
  5. package/dist/cjs/api/client/index.d.ts +1 -1
  6. package/dist/cjs/api/client/requests/SearchBrandsRequest.js +6 -6
  7. package/dist/cjs/api/client/requests/SearchCreatorsRequest.js +174 -174
  8. package/dist/cjs/api/client/requests/SearchMediaRequest.js +223 -223
  9. package/dist/cjs/api/client/requests/index.d.ts +5 -5
  10. package/dist/cjs/api/errors/BadRequestError.d.ts +3 -3
  11. package/dist/cjs/api/errors/BadRequestError.js +2 -2
  12. package/dist/cjs/api/errors/ContentTooLargeError.d.ts +3 -3
  13. package/dist/cjs/api/errors/ContentTooLargeError.js +2 -2
  14. package/dist/cjs/api/errors/ForbiddenError.d.ts +3 -3
  15. package/dist/cjs/api/errors/ForbiddenError.js +2 -2
  16. package/dist/cjs/api/errors/InternalServerError.d.ts +3 -3
  17. package/dist/cjs/api/errors/InternalServerError.js +2 -2
  18. package/dist/cjs/api/errors/MethodNotAllowedError.d.ts +3 -3
  19. package/dist/cjs/api/errors/MethodNotAllowedError.js +2 -2
  20. package/dist/cjs/api/errors/NotFoundError.d.ts +3 -3
  21. package/dist/cjs/api/errors/NotFoundError.js +2 -2
  22. package/dist/cjs/api/errors/PaymentRequiredError.d.ts +3 -3
  23. package/dist/cjs/api/errors/PaymentRequiredError.js +2 -2
  24. package/dist/cjs/api/errors/TooManyRequestsError.d.ts +3 -3
  25. package/dist/cjs/api/errors/TooManyRequestsError.js +2 -2
  26. package/dist/cjs/api/errors/UnauthorizedError.d.ts +3 -3
  27. package/dist/cjs/api/errors/UnauthorizedError.js +2 -2
  28. package/dist/cjs/api/errors/index.d.ts +9 -9
  29. package/dist/cjs/api/index.d.ts +4 -4
  30. package/dist/cjs/api/resources/account/client/Client.d.ts +4 -4
  31. package/dist/cjs/api/resources/account/client/Client.js +38 -23
  32. package/dist/cjs/api/resources/account/client/index.d.ts +1 -1
  33. package/dist/cjs/api/resources/account/client/requests/InsightsAccountRequest.d.ts +1 -1
  34. package/dist/cjs/api/resources/account/client/requests/LandingPagesAccountRequest.d.ts +1 -1
  35. package/dist/cjs/api/resources/account/client/requests/index.d.ts +5 -5
  36. package/dist/cjs/api/resources/account/exports.d.ts +2 -2
  37. package/dist/cjs/api/resources/account/index.d.ts +2 -2
  38. package/dist/cjs/api/resources/account/types/GetAccountResponse.d.ts +3 -3
  39. package/dist/cjs/api/resources/account/types/IndexAccountResponse.js +2 -2
  40. package/dist/cjs/api/resources/account/types/IndexStatusAccountResponse.js +2 -2
  41. package/dist/cjs/api/resources/account/types/InsightsAccountRequestType.js +4 -4
  42. package/dist/cjs/api/resources/account/types/InsightsAccountResponse.d.ts +2 -2
  43. package/dist/cjs/api/resources/account/types/LandingPagesAccountRequestShowInactive.js +2 -2
  44. package/dist/cjs/api/resources/account/types/index.d.ts +7 -7
  45. package/dist/cjs/api/resources/index.d.ts +3 -3
  46. package/dist/cjs/api/types/Error_.js +11 -11
  47. package/dist/cjs/api/types/SearchBrandsResponse.js +1 -1
  48. package/dist/cjs/api/types/SearchCreatorsResponse.js +1 -1
  49. package/dist/cjs/api/types/SearchMediaResponse.js +26 -26
  50. package/dist/cjs/api/types/index.d.ts +7 -7
  51. package/dist/cjs/auth/BearerAuthProvider.d.ts +1 -1
  52. package/dist/cjs/auth/BearerAuthProvider.js +2 -2
  53. package/dist/cjs/auth/index.d.ts +1 -1
  54. package/dist/cjs/core/auth/AuthProvider.d.ts +2 -2
  55. package/dist/cjs/core/auth/AuthProvider.js +3 -3
  56. package/dist/cjs/core/auth/BasicAuth.js +7 -7
  57. package/dist/cjs/core/auth/BearerToken.js +1 -1
  58. package/dist/cjs/core/auth/NoOpAuthProvider.d.ts +2 -2
  59. package/dist/cjs/core/auth/index.d.ts +5 -5
  60. package/dist/cjs/core/base64.js +4 -4
  61. package/dist/cjs/core/exports.d.ts +1 -1
  62. package/dist/cjs/core/fetcher/APIResponse.d.ts +1 -1
  63. package/dist/cjs/core/fetcher/BinaryResponse.d.ts +4 -4
  64. package/dist/cjs/core/fetcher/BinaryResponse.js +1 -1
  65. package/dist/cjs/core/fetcher/EndpointSupplier.d.ts +2 -2
  66. package/dist/cjs/core/fetcher/EndpointSupplier.js +1 -1
  67. package/dist/cjs/core/fetcher/Fetcher.d.ts +11 -11
  68. package/dist/cjs/core/fetcher/Fetcher.js +56 -50
  69. package/dist/cjs/core/fetcher/Headers.js +10 -10
  70. package/dist/cjs/core/fetcher/HttpResponsePromise.d.ts +2 -2
  71. package/dist/cjs/core/fetcher/RawResponse.d.ts +1 -1
  72. package/dist/cjs/core/fetcher/RawResponse.js +6 -6
  73. package/dist/cjs/core/fetcher/Supplier.js +1 -1
  74. package/dist/cjs/core/fetcher/createRequestUrl.js +1 -1
  75. package/dist/cjs/core/fetcher/getErrorResponseBody.js +11 -11
  76. package/dist/cjs/core/fetcher/getRequestBody.d.ts +2 -2
  77. package/dist/cjs/core/fetcher/getRequestBody.js +4 -4
  78. package/dist/cjs/core/fetcher/getResponseBody.d.ts +2 -2
  79. package/dist/cjs/core/fetcher/getResponseBody.js +11 -11
  80. package/dist/cjs/core/fetcher/index.d.ts +13 -13
  81. package/dist/cjs/core/fetcher/makePassthroughRequest.d.ts +2 -2
  82. package/dist/cjs/core/fetcher/makePassthroughRequest.js +7 -7
  83. package/dist/cjs/core/fetcher/makeRequest.js +3 -3
  84. package/dist/cjs/core/fetcher/redactUrl.js +36 -36
  85. package/dist/cjs/core/fetcher/requestWithRetries.js +4 -4
  86. package/dist/cjs/core/fetcher/signals.js +2 -2
  87. package/dist/cjs/core/index.d.ts +6 -6
  88. package/dist/cjs/core/logging/exports.d.ts +1 -1
  89. package/dist/cjs/core/logging/index.d.ts +1 -1
  90. package/dist/cjs/core/logging/logger.js +4 -4
  91. package/dist/cjs/core/requestBody.js +1 -1
  92. package/dist/cjs/core/runtime/index.d.ts +1 -1
  93. package/dist/cjs/core/runtime/runtime.d.ts +1 -1
  94. package/dist/cjs/core/runtime/runtime.js +37 -35
  95. package/dist/cjs/core/url/QueryStringBuilder.d.ts +1 -1
  96. package/dist/cjs/core/url/QueryStringBuilder.js +3 -3
  97. package/dist/cjs/core/url/encodePathParam.js +10 -8
  98. package/dist/cjs/core/url/index.d.ts +4 -4
  99. package/dist/cjs/core/url/join.js +11 -11
  100. package/dist/cjs/core/url/qs.d.ts +1 -1
  101. package/dist/cjs/core/url/qs.js +14 -14
  102. package/dist/cjs/environments.js +1 -1
  103. package/dist/cjs/errors/SpyglassError.d.ts +1 -1
  104. package/dist/cjs/errors/SpyglassError.js +3 -3
  105. package/dist/cjs/errors/SpyglassTimeoutError.d.ts +1 -1
  106. package/dist/cjs/errors/SpyglassTimeoutError.js +1 -1
  107. package/dist/cjs/errors/handleNonStatusCodeError.d.ts +1 -1
  108. package/dist/cjs/errors/handleNonStatusCodeError.js +5 -5
  109. package/dist/cjs/errors/index.d.ts +2 -2
  110. package/dist/cjs/exports.d.ts +1 -1
  111. package/dist/cjs/index.d.ts +6 -6
  112. package/dist/cjs/version.d.ts +1 -1
  113. package/dist/cjs/version.js +1 -1
  114. package/dist/esm/BaseClient.d.mts +4 -4
  115. package/dist/esm/BaseClient.mjs +10 -10
  116. package/dist/esm/Client.d.mts +5 -5
  117. package/dist/esm/Client.mjs +65 -47
  118. package/dist/esm/api/client/index.d.mts +1 -1
  119. package/dist/esm/api/client/index.mjs +1 -1
  120. package/dist/esm/api/client/requests/SearchBrandsRequest.mjs +6 -6
  121. package/dist/esm/api/client/requests/SearchCreatorsRequest.mjs +174 -174
  122. package/dist/esm/api/client/requests/SearchMediaRequest.mjs +223 -223
  123. package/dist/esm/api/client/requests/index.d.mts +5 -5
  124. package/dist/esm/api/client/requests/index.mjs +3 -3
  125. package/dist/esm/api/errors/BadRequestError.d.mts +3 -3
  126. package/dist/esm/api/errors/BadRequestError.mjs +3 -3
  127. package/dist/esm/api/errors/ContentTooLargeError.d.mts +3 -3
  128. package/dist/esm/api/errors/ContentTooLargeError.mjs +3 -3
  129. package/dist/esm/api/errors/ForbiddenError.d.mts +3 -3
  130. package/dist/esm/api/errors/ForbiddenError.mjs +3 -3
  131. package/dist/esm/api/errors/InternalServerError.d.mts +3 -3
  132. package/dist/esm/api/errors/InternalServerError.mjs +3 -3
  133. package/dist/esm/api/errors/MethodNotAllowedError.d.mts +3 -3
  134. package/dist/esm/api/errors/MethodNotAllowedError.mjs +3 -3
  135. package/dist/esm/api/errors/NotFoundError.d.mts +3 -3
  136. package/dist/esm/api/errors/NotFoundError.mjs +3 -3
  137. package/dist/esm/api/errors/PaymentRequiredError.d.mts +3 -3
  138. package/dist/esm/api/errors/PaymentRequiredError.mjs +3 -3
  139. package/dist/esm/api/errors/TooManyRequestsError.d.mts +3 -3
  140. package/dist/esm/api/errors/TooManyRequestsError.mjs +3 -3
  141. package/dist/esm/api/errors/UnauthorizedError.d.mts +3 -3
  142. package/dist/esm/api/errors/UnauthorizedError.mjs +3 -3
  143. package/dist/esm/api/errors/index.d.mts +9 -9
  144. package/dist/esm/api/errors/index.mjs +9 -9
  145. package/dist/esm/api/index.d.mts +4 -4
  146. package/dist/esm/api/index.mjs +4 -4
  147. package/dist/esm/api/resources/account/client/Client.d.mts +4 -4
  148. package/dist/esm/api/resources/account/client/Client.mjs +46 -31
  149. package/dist/esm/api/resources/account/client/index.d.mts +1 -1
  150. package/dist/esm/api/resources/account/client/index.mjs +1 -1
  151. package/dist/esm/api/resources/account/client/requests/InsightsAccountRequest.d.mts +1 -1
  152. package/dist/esm/api/resources/account/client/requests/LandingPagesAccountRequest.d.mts +1 -1
  153. package/dist/esm/api/resources/account/client/requests/index.d.mts +5 -5
  154. package/dist/esm/api/resources/account/exports.d.mts +2 -2
  155. package/dist/esm/api/resources/account/exports.mjs +2 -2
  156. package/dist/esm/api/resources/account/index.d.mts +2 -2
  157. package/dist/esm/api/resources/account/index.mjs +2 -2
  158. package/dist/esm/api/resources/account/types/GetAccountResponse.d.mts +3 -3
  159. package/dist/esm/api/resources/account/types/IndexAccountResponse.mjs +2 -2
  160. package/dist/esm/api/resources/account/types/IndexStatusAccountResponse.mjs +2 -2
  161. package/dist/esm/api/resources/account/types/InsightsAccountRequestType.mjs +4 -4
  162. package/dist/esm/api/resources/account/types/InsightsAccountResponse.d.mts +2 -2
  163. package/dist/esm/api/resources/account/types/LandingPagesAccountRequestShowInactive.mjs +2 -2
  164. package/dist/esm/api/resources/account/types/index.d.mts +7 -7
  165. package/dist/esm/api/resources/account/types/index.mjs +7 -7
  166. package/dist/esm/api/resources/index.d.mts +3 -3
  167. package/dist/esm/api/resources/index.mjs +3 -3
  168. package/dist/esm/api/types/Error_.mjs +11 -11
  169. package/dist/esm/api/types/SearchBrandsResponse.mjs +1 -1
  170. package/dist/esm/api/types/SearchCreatorsResponse.mjs +1 -1
  171. package/dist/esm/api/types/SearchMediaResponse.mjs +26 -26
  172. package/dist/esm/api/types/index.d.mts +7 -7
  173. package/dist/esm/api/types/index.mjs +7 -7
  174. package/dist/esm/auth/BearerAuthProvider.d.mts +1 -1
  175. package/dist/esm/auth/BearerAuthProvider.mjs +4 -4
  176. package/dist/esm/auth/index.d.mts +1 -1
  177. package/dist/esm/auth/index.mjs +1 -1
  178. package/dist/esm/core/auth/AuthProvider.d.mts +2 -2
  179. package/dist/esm/core/auth/AuthProvider.mjs +3 -3
  180. package/dist/esm/core/auth/BasicAuth.mjs +8 -8
  181. package/dist/esm/core/auth/BearerToken.mjs +1 -1
  182. package/dist/esm/core/auth/NoOpAuthProvider.d.mts +2 -2
  183. package/dist/esm/core/auth/index.d.mts +5 -5
  184. package/dist/esm/core/auth/index.mjs +4 -4
  185. package/dist/esm/core/base64.mjs +4 -4
  186. package/dist/esm/core/exports.d.mts +1 -1
  187. package/dist/esm/core/exports.mjs +1 -1
  188. package/dist/esm/core/fetcher/APIResponse.d.mts +1 -1
  189. package/dist/esm/core/fetcher/BinaryResponse.d.mts +4 -4
  190. package/dist/esm/core/fetcher/BinaryResponse.mjs +1 -1
  191. package/dist/esm/core/fetcher/EndpointSupplier.d.mts +2 -2
  192. package/dist/esm/core/fetcher/EndpointSupplier.mjs +1 -1
  193. package/dist/esm/core/fetcher/Fetcher.d.mts +11 -11
  194. package/dist/esm/core/fetcher/Fetcher.mjs +70 -64
  195. package/dist/esm/core/fetcher/Headers.mjs +10 -10
  196. package/dist/esm/core/fetcher/HttpResponsePromise.d.mts +2 -2
  197. package/dist/esm/core/fetcher/RawResponse.d.mts +1 -1
  198. package/dist/esm/core/fetcher/RawResponse.mjs +7 -7
  199. package/dist/esm/core/fetcher/Supplier.mjs +1 -1
  200. package/dist/esm/core/fetcher/createRequestUrl.mjs +2 -2
  201. package/dist/esm/core/fetcher/getErrorResponseBody.mjs +13 -13
  202. package/dist/esm/core/fetcher/getRequestBody.d.mts +2 -2
  203. package/dist/esm/core/fetcher/getRequestBody.mjs +6 -6
  204. package/dist/esm/core/fetcher/getResponseBody.d.mts +2 -2
  205. package/dist/esm/core/fetcher/getResponseBody.mjs +13 -13
  206. package/dist/esm/core/fetcher/index.d.mts +13 -13
  207. package/dist/esm/core/fetcher/index.mjs +7 -7
  208. package/dist/esm/core/fetcher/makePassthroughRequest.d.mts +2 -2
  209. package/dist/esm/core/fetcher/makePassthroughRequest.mjs +16 -16
  210. package/dist/esm/core/fetcher/makeRequest.mjs +4 -4
  211. package/dist/esm/core/fetcher/redactUrl.mjs +36 -36
  212. package/dist/esm/core/fetcher/requestWithRetries.mjs +4 -4
  213. package/dist/esm/core/fetcher/signals.mjs +2 -2
  214. package/dist/esm/core/index.d.mts +6 -6
  215. package/dist/esm/core/index.mjs +6 -6
  216. package/dist/esm/core/logging/exports.d.mts +1 -1
  217. package/dist/esm/core/logging/exports.mjs +1 -1
  218. package/dist/esm/core/logging/index.d.mts +1 -1
  219. package/dist/esm/core/logging/index.mjs +1 -1
  220. package/dist/esm/core/logging/logger.mjs +4 -4
  221. package/dist/esm/core/requestBody.mjs +1 -1
  222. package/dist/esm/core/runtime/index.d.mts +1 -1
  223. package/dist/esm/core/runtime/index.mjs +1 -1
  224. package/dist/esm/core/runtime/runtime.d.mts +1 -1
  225. package/dist/esm/core/runtime/runtime.mjs +37 -35
  226. package/dist/esm/core/url/QueryStringBuilder.d.mts +1 -1
  227. package/dist/esm/core/url/QueryStringBuilder.mjs +4 -4
  228. package/dist/esm/core/url/encodePathParam.mjs +10 -8
  229. package/dist/esm/core/url/index.d.mts +4 -4
  230. package/dist/esm/core/url/index.mjs +4 -4
  231. package/dist/esm/core/url/join.mjs +11 -11
  232. package/dist/esm/core/url/qs.d.mts +1 -1
  233. package/dist/esm/core/url/qs.mjs +14 -14
  234. package/dist/esm/environments.mjs +1 -1
  235. package/dist/esm/errors/SpyglassError.d.mts +1 -1
  236. package/dist/esm/errors/SpyglassError.mjs +4 -4
  237. package/dist/esm/errors/SpyglassTimeoutError.d.mts +1 -1
  238. package/dist/esm/errors/SpyglassTimeoutError.mjs +2 -2
  239. package/dist/esm/errors/handleNonStatusCodeError.d.mts +1 -1
  240. package/dist/esm/errors/handleNonStatusCodeError.mjs +6 -6
  241. package/dist/esm/errors/index.d.mts +2 -2
  242. package/dist/esm/errors/index.mjs +2 -2
  243. package/dist/esm/exports.d.mts +1 -1
  244. package/dist/esm/exports.mjs +1 -1
  245. package/dist/esm/index.d.mts +6 -6
  246. package/dist/esm/index.mjs +5 -5
  247. package/dist/esm/version.d.mts +1 -1
  248. package/dist/esm/version.mjs +1 -1
  249. package/package.json +91 -91
  250. package/reference.md +83 -82
@@ -7,15 +7,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { createLogger } from "../logging/logger.mjs";
11
- import { join } from "../url/join.mjs";
12
- import { EndpointSupplier } from "./EndpointSupplier.mjs";
13
- import { getFetchFn } from "./getFetchFn.mjs";
14
- import { makeRequest } from "./makeRequest.mjs";
15
- import { redactUrl } from "./redactUrl.mjs";
16
- import { requestWithRetries } from "./requestWithRetries.mjs";
17
- import { Supplier } from "./Supplier.mjs";
18
- import { TIMEOUT } from "./signals.mjs";
10
+ import { createLogger } from '../logging/logger.mjs';
11
+ import { join } from '../url/join.mjs';
12
+ import { EndpointSupplier } from './EndpointSupplier.mjs';
13
+ import { getFetchFn } from './getFetchFn.mjs';
14
+ import { makeRequest } from './makeRequest.mjs';
15
+ import { redactUrl } from './redactUrl.mjs';
16
+ import { requestWithRetries } from './requestWithRetries.mjs';
17
+ import { Supplier } from './Supplier.mjs';
18
+ import { TIMEOUT } from './signals.mjs';
19
19
  /**
20
20
  * Makes a passthrough HTTP request using the SDK's configuration (auth, retry, logging, etc.)
21
21
  * while mimicking the standard `fetch` API.
@@ -58,7 +58,7 @@ export function makePassthroughRequest(input, init, clientOptions, requestOption
58
58
  const baseUrl = (_a = (clientOptions.baseUrl != null ? yield Supplier.get(clientOptions.baseUrl) : undefined)) !== null && _a !== void 0 ? _a : (clientOptions.environment != null ? yield Supplier.get(clientOptions.environment) : undefined);
59
59
  // Determine the full URL
60
60
  let fullUrl;
61
- if (url.startsWith("http://") || url.startsWith("https://")) {
61
+ if (url.startsWith('http://') || url.startsWith('https://')) {
62
62
  fullUrl = url;
63
63
  }
64
64
  else if (baseUrl != null) {
@@ -106,7 +106,7 @@ export function makePassthroughRequest(input, init, clientOptions, requestOption
106
106
  mergedHeaders[key.toLowerCase()] = value;
107
107
  }
108
108
  }
109
- const method = (_b = effectiveInit === null || effectiveInit === void 0 ? void 0 : effectiveInit.method) !== null && _b !== void 0 ? _b : "GET";
109
+ const method = (_b = effectiveInit === null || effectiveInit === void 0 ? void 0 : effectiveInit.method) !== null && _b !== void 0 ? _b : 'GET';
110
110
  const body = effectiveInit === null || effectiveInit === void 0 ? void 0 : effectiveInit.body;
111
111
  const timeoutInSeconds = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _c !== void 0 ? _c : clientOptions.timeoutInSeconds;
112
112
  const timeoutMs = timeoutInSeconds != null ? timeoutInSeconds * 1000 : undefined;
@@ -114,7 +114,7 @@ export function makePassthroughRequest(input, init, clientOptions, requestOption
114
114
  const abortSignal = (_f = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal) !== null && _e !== void 0 ? _e : effectiveInit === null || effectiveInit === void 0 ? void 0 : effectiveInit.signal) !== null && _f !== void 0 ? _f : undefined;
115
115
  const fetchFn = (_g = clientOptions.fetch) !== null && _g !== void 0 ? _g : (yield getFetchFn());
116
116
  if (logger.isDebug()) {
117
- logger.debug("Making passthrough HTTP request", {
117
+ logger.debug('Making passthrough HTTP request', {
118
118
  method,
119
119
  url: redactUrl(fullUrl),
120
120
  hasBody: body != null,
@@ -123,7 +123,7 @@ export function makePassthroughRequest(input, init, clientOptions, requestOption
123
123
  let response;
124
124
  try {
125
125
  response = yield requestWithRetries(() => __awaiter(this, void 0, void 0, function* () {
126
- return makeRequest(fetchFn, fullUrl, method, mergedHeaders, body !== null && body !== void 0 ? body : undefined, timeoutMs, abortSignal, (effectiveInit === null || effectiveInit === void 0 ? void 0 : effectiveInit.credentials) === "include", undefined, // duplex
126
+ return makeRequest(fetchFn, fullUrl, method, mergedHeaders, body !== null && body !== void 0 ? body : undefined, timeoutMs, abortSignal, (effectiveInit === null || effectiveInit === void 0 ? void 0 : effectiveInit.credentials) === 'include', undefined, // duplex
127
127
  false);
128
128
  }), maxRetries, abortSignal);
129
129
  }
@@ -135,7 +135,7 @@ export function makePassthroughRequest(input, init, clientOptions, requestOption
135
135
  throw error;
136
136
  }
137
137
  if (logger.isDebug()) {
138
- logger.debug("Passthrough HTTP request completed", {
138
+ logger.debug('Passthrough HTTP request completed', {
139
139
  method,
140
140
  url: redactUrl(fullUrl),
141
141
  statusCode: response.status,
@@ -145,8 +145,8 @@ export function makePassthroughRequest(input, init, clientOptions, requestOption
145
145
  });
146
146
  }
147
147
  function createTimeoutError() {
148
- const error = new Error("The request timed out.");
149
- error.name = "TimeoutError";
148
+ const error = new Error('The request timed out.');
149
+ error.name = 'TimeoutError';
150
150
  return error;
151
151
  }
152
152
  /**
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { anySignal, getTimeoutSignal, TIMEOUT } from "./signals.mjs";
10
+ import { anySignal, getTimeoutSignal, TIMEOUT } from './signals.mjs';
11
11
  /**
12
12
  * Cached result of checking whether the current runtime supports
13
13
  * the `cache` option in `Request`. Some runtimes (e.g. Cloudflare Workers)
@@ -19,7 +19,7 @@ export function isCacheNoStoreSupported() {
19
19
  return _cacheNoStoreSupported;
20
20
  }
21
21
  try {
22
- new Request("http://localhost", { cache: "no-store" });
22
+ new Request('http://localhost', { cache: 'no-store' });
23
23
  _cacheNoStoreSupported = true;
24
24
  }
25
25
  catch (_a) {
@@ -61,9 +61,9 @@ export const makeRequest = (fetchFn, url, method, headers, requestBody, timeoutM
61
61
  const newSignals = anySignal(signals);
62
62
  let response;
63
63
  try {
64
- response = yield fetchFn(url, Object.assign({ method: method, headers, body: requestBody, signal: newSignals, credentials: withCredentials ? "include" : undefined,
64
+ response = yield fetchFn(url, Object.assign({ method: method, headers, body: requestBody, signal: newSignals, credentials: withCredentials ? 'include' : undefined,
65
65
  // @ts-ignore
66
- duplex }, (disableCache && isCacheNoStoreSupported() ? { cache: "no-store" } : {})));
66
+ duplex }, (disableCache && isCacheNoStoreSupported() ? { cache: 'no-store' } : {})));
67
67
  }
68
68
  catch (error) {
69
69
  if (timeoutAbortId != null) {
@@ -1,37 +1,37 @@
1
1
  export const SENSITIVE_QUERY_PARAMS = new Set([
2
- "api_key",
3
- "api-key",
4
- "apikey",
5
- "token",
6
- "access_token",
7
- "access-token",
8
- "auth_token",
9
- "auth-token",
10
- "password",
11
- "passwd",
12
- "secret",
13
- "api_secret",
14
- "api-secret",
15
- "apisecret",
16
- "key",
17
- "session",
18
- "session_id",
19
- "session-id",
2
+ 'api_key',
3
+ 'api-key',
4
+ 'apikey',
5
+ 'token',
6
+ 'access_token',
7
+ 'access-token',
8
+ 'auth_token',
9
+ 'auth-token',
10
+ 'password',
11
+ 'passwd',
12
+ 'secret',
13
+ 'api_secret',
14
+ 'api-secret',
15
+ 'apisecret',
16
+ 'key',
17
+ 'session',
18
+ 'session_id',
19
+ 'session-id',
20
20
  ]);
21
21
  export function redactUrl(url) {
22
- const protocolIndex = url.indexOf("://");
22
+ const protocolIndex = url.indexOf('://');
23
23
  if (protocolIndex === -1)
24
24
  return url;
25
25
  const afterProtocol = protocolIndex + 3;
26
26
  // Find the first delimiter that marks the end of the authority section
27
- const pathStart = url.indexOf("/", afterProtocol);
28
- let queryStart = url.indexOf("?", afterProtocol);
29
- let fragmentStart = url.indexOf("#", afterProtocol);
27
+ const pathStart = url.indexOf('/', afterProtocol);
28
+ let queryStart = url.indexOf('?', afterProtocol);
29
+ let fragmentStart = url.indexOf('#', afterProtocol);
30
30
  const firstDelimiter = Math.min(pathStart === -1 ? url.length : pathStart, queryStart === -1 ? url.length : queryStart, fragmentStart === -1 ? url.length : fragmentStart);
31
31
  // Find the LAST @ before the delimiter (handles multiple @ in credentials)
32
32
  let atIndex = -1;
33
33
  for (let i = afterProtocol; i < firstDelimiter; i++) {
34
- if (url[i] === "@") {
34
+ if (url[i] === '@') {
35
35
  atIndex = i;
36
36
  }
37
37
  }
@@ -39,10 +39,10 @@ export function redactUrl(url) {
39
39
  url = `${url.slice(0, afterProtocol)}[REDACTED]@${url.slice(atIndex + 1)}`;
40
40
  }
41
41
  // Recalculate queryStart since url might have changed
42
- queryStart = url.indexOf("?");
42
+ queryStart = url.indexOf('?');
43
43
  if (queryStart === -1)
44
44
  return url;
45
- fragmentStart = url.indexOf("#", queryStart);
45
+ fragmentStart = url.indexOf('#', queryStart);
46
46
  const queryEnd = fragmentStart !== -1 ? fragmentStart : url.length;
47
47
  const queryString = url.slice(queryStart + 1, queryEnd);
48
48
  if (queryString.length === 0)
@@ -50,28 +50,28 @@ export function redactUrl(url) {
50
50
  // FAST PATH: Quick check if any sensitive keywords present
51
51
  // Using indexOf is faster than regex for simple substring matching
52
52
  const lower = queryString.toLowerCase();
53
- const hasSensitive = lower.includes("token") ||
54
- lower.includes("key") ||
55
- lower.includes("password") ||
56
- lower.includes("passwd") ||
57
- lower.includes("secret") ||
58
- lower.includes("session") ||
59
- lower.includes("auth");
53
+ const hasSensitive = lower.includes('token') ||
54
+ lower.includes('key') ||
55
+ lower.includes('password') ||
56
+ lower.includes('passwd') ||
57
+ lower.includes('secret') ||
58
+ lower.includes('session') ||
59
+ lower.includes('auth');
60
60
  if (!hasSensitive) {
61
61
  return url;
62
62
  }
63
63
  // SLOW PATH: Parse and redact
64
64
  const redactedParams = [];
65
- const params = queryString.split("&");
65
+ const params = queryString.split('&');
66
66
  for (const param of params) {
67
- const equalIndex = param.indexOf("=");
67
+ const equalIndex = param.indexOf('=');
68
68
  if (equalIndex === -1) {
69
69
  redactedParams.push(param);
70
70
  continue;
71
71
  }
72
72
  const key = param.slice(0, equalIndex);
73
73
  let shouldRedact = SENSITIVE_QUERY_PARAMS.has(key.toLowerCase());
74
- if (!shouldRedact && key.includes("%")) {
74
+ if (!shouldRedact && key.includes('%')) {
75
75
  try {
76
76
  const decodedKey = decodeURIComponent(key);
77
77
  shouldRedact = SENSITIVE_QUERY_PARAMS.has(decodedKey.toLowerCase());
@@ -80,5 +80,5 @@ export function redactUrl(url) {
80
80
  }
81
81
  redactedParams.push(shouldRedact ? `${key}=[REDACTED]` : param);
82
82
  }
83
- return url.slice(0, queryStart + 1) + redactedParams.join("&") + url.slice(queryEnd);
83
+ return url.slice(0, queryStart + 1) + redactedParams.join('&') + url.slice(queryEnd);
84
84
  }
@@ -23,7 +23,7 @@ function addSymmetricJitter(delay) {
23
23
  return delay * jitterMultiplier;
24
24
  }
25
25
  function getRetryDelayFromHeaders(response, retryAttempt) {
26
- const retryAfter = response.headers.get("Retry-After");
26
+ const retryAfter = response.headers.get('Retry-After');
27
27
  if (retryAfter) {
28
28
  const retryAfterSeconds = parseInt(retryAfter, 10);
29
29
  if (!Number.isNaN(retryAfterSeconds) && retryAfterSeconds > 0) {
@@ -37,7 +37,7 @@ function getRetryDelayFromHeaders(response, retryAttempt) {
37
37
  }
38
38
  }
39
39
  }
40
- const rateLimitReset = response.headers.get("X-RateLimit-Reset");
40
+ const rateLimitReset = response.headers.get('X-RateLimit-Reset');
41
41
  if (rateLimitReset) {
42
42
  const resetTime = parseInt(rateLimitReset, 10);
43
43
  if (!Number.isNaN(resetTime)) {
@@ -64,10 +64,10 @@ function sleep(ms, abortSignal) {
64
64
  reject(abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.reason);
65
65
  };
66
66
  const timeoutId = setTimeout(() => {
67
- abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.removeEventListener("abort", onAbort);
67
+ abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.removeEventListener('abort', onAbort);
68
68
  resolve();
69
69
  }, ms);
70
- abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.addEventListener("abort", onAbort, { once: true });
70
+ abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.addEventListener('abort', onAbort, { once: true });
71
71
  });
72
72
  }
73
73
  export function requestWithRetries(requestFn_1) {
@@ -1,4 +1,4 @@
1
- export const TIMEOUT = "timeout";
1
+ export const TIMEOUT = 'timeout';
2
2
  export function getTimeoutSignal(timeoutMs) {
3
3
  const controller = new AbortController();
4
4
  const abortId = setTimeout(() => controller.abort(TIMEOUT), timeoutMs);
@@ -12,7 +12,7 @@ export function anySignal(...args) {
12
12
  controller.abort(signal === null || signal === void 0 ? void 0 : signal.reason);
13
13
  return controller.signal;
14
14
  }
15
- signal.addEventListener("abort", () => controller.abort(signal === null || signal === void 0 ? void 0 : signal.reason), {
15
+ signal.addEventListener('abort', () => controller.abort(signal === null || signal === void 0 ? void 0 : signal.reason), {
16
16
  signal: controller.signal,
17
17
  });
18
18
  // Re-check after adding listener: the signal may have aborted
@@ -1,6 +1,6 @@
1
- export * from "./auth/index.mjs";
2
- export * from "./base64.mjs";
3
- export * from "./fetcher/index.mjs";
4
- export * as logging from "./logging/index.mjs";
5
- export * from "./runtime/index.mjs";
6
- export * as url from "./url/index.mjs";
1
+ export * from './auth/index.mjs';
2
+ export * from './base64.mjs';
3
+ export * from './fetcher/index.mjs';
4
+ export * as logging from './logging/index.mjs';
5
+ export * from './runtime/index.mjs';
6
+ export * as url from './url/index.mjs';
@@ -1,6 +1,6 @@
1
- export * from "./auth/index.mjs";
2
- export * from "./base64.mjs";
3
- export * from "./fetcher/index.mjs";
4
- export * as logging from "./logging/index.mjs";
5
- export * from "./runtime/index.mjs";
6
- export * as url from "./url/index.mjs";
1
+ export * from './auth/index.mjs';
2
+ export * from './base64.mjs';
3
+ export * from './fetcher/index.mjs';
4
+ export * as logging from './logging/index.mjs';
5
+ export * from './runtime/index.mjs';
6
+ export * as url from './url/index.mjs';
@@ -1,4 +1,4 @@
1
- import * as logger from "./logger.mjs";
1
+ import * as logger from './logger.mjs';
2
2
  export declare namespace logging {
3
3
  /**
4
4
  * Configuration for logger instances.
@@ -1,4 +1,4 @@
1
- import * as logger from "./logger.mjs";
1
+ import * as logger from './logger.mjs';
2
2
  export var logging;
3
3
  (function (logging) {
4
4
  logging.LogLevel = logger.LogLevel;
@@ -1 +1 @@
1
- export * from "./logger.mjs";
1
+ export * from './logger.mjs';
@@ -1 +1 @@
1
- export * from "./logger.mjs";
1
+ export * from './logger.mjs';
@@ -1,8 +1,8 @@
1
1
  export const LogLevel = {
2
- Debug: "debug",
3
- Info: "info",
4
- Warn: "warn",
5
- Error: "error",
2
+ Debug: 'debug',
3
+ Info: 'info',
4
+ Warn: 'warn',
5
+ Error: 'error',
6
6
  };
7
7
  const logLevelMap = {
8
8
  [LogLevel.Debug]: 1,
@@ -16,7 +16,7 @@ export function mergeAdditionalBodyParameters(body, additionalBodyParameters) {
16
16
  if (body == null) {
17
17
  return Object.assign({}, additionalBodyParameters);
18
18
  }
19
- if (typeof body === "object" && !Array.isArray(body)) {
19
+ if (typeof body === 'object' && !Array.isArray(body)) {
20
20
  return Object.assign(Object.assign({}, body), additionalBodyParameters);
21
21
  }
22
22
  return body;
@@ -1 +1 @@
1
- export { getUserAgent, RUNTIME } from "./runtime.mjs";
1
+ export { getUserAgent, RUNTIME } from './runtime.mjs';
@@ -1 +1 @@
1
- export { getUserAgent, RUNTIME } from "./runtime.mjs";
1
+ export { getUserAgent, RUNTIME } from './runtime.mjs';
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export declare const RUNTIME: Runtime;
5
5
  export interface Runtime {
6
- type: "browser" | "web-worker" | "deno" | "bun" | "node" | "react-native" | "unknown" | "workerd" | "edge-runtime";
6
+ type: 'browser' | 'web-worker' | 'deno' | 'bun' | 'node' | 'react-native' | 'unknown' | 'workerd' | 'edge-runtime';
7
7
  version?: string;
8
8
  parsedVersion?: number;
9
9
  /**
@@ -7,10 +7,10 @@ function evaluateRuntime() {
7
7
  /**
8
8
  * A constant that indicates whether the environment the code is running is a Web Browser.
9
9
  */
10
- const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
10
+ const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
11
11
  if (isBrowser) {
12
12
  return {
13
- type: "browser",
13
+ type: 'browser',
14
14
  version: window.navigator.userAgent,
15
15
  };
16
16
  }
@@ -18,43 +18,45 @@ function evaluateRuntime() {
18
18
  * A constant that indicates whether the environment the code is running is Cloudflare.
19
19
  * https://developers.cloudflare.com/workers/runtime-apis/web-standards/#navigatoruseragent
20
20
  */
21
- const isCloudflare = typeof globalThis !== "undefined" && ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.navigator) === null || _a === void 0 ? void 0 : _a.userAgent) === "Cloudflare-Workers";
21
+ const isCloudflare = typeof globalThis !== 'undefined' && ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.navigator) === null || _a === void 0 ? void 0 : _a.userAgent) === 'Cloudflare-Workers';
22
22
  if (isCloudflare) {
23
23
  return {
24
- type: "workerd",
24
+ type: 'workerd',
25
25
  };
26
26
  }
27
27
  /**
28
28
  * A constant that indicates whether the environment the code is running is Edge Runtime.
29
29
  * https://vercel.com/docs/functions/runtimes/edge-runtime#check-if-you're-running-on-the-edge-runtime
30
30
  */
31
- const isEdgeRuntime = typeof EdgeRuntime === "string";
31
+ const isEdgeRuntime = typeof EdgeRuntime === 'string';
32
32
  if (isEdgeRuntime) {
33
33
  return {
34
- type: "edge-runtime",
34
+ type: 'edge-runtime',
35
35
  };
36
36
  }
37
37
  /**
38
38
  * A constant that indicates whether the environment the code is running is a Web Worker.
39
39
  */
40
- const isWebWorker = typeof self === "object" &&
41
- typeof (self === null || self === void 0 ? void 0 : self.importScripts) === "function" &&
42
- (((_b = self.constructor) === null || _b === void 0 ? void 0 : _b.name) === "DedicatedWorkerGlobalScope" ||
43
- ((_c = self.constructor) === null || _c === void 0 ? void 0 : _c.name) === "ServiceWorkerGlobalScope" ||
44
- ((_d = self.constructor) === null || _d === void 0 ? void 0 : _d.name) === "SharedWorkerGlobalScope");
40
+ const isWebWorker = typeof self === 'object' &&
41
+ typeof (self === null || self === void 0 ? void 0 : self.importScripts) === 'function' &&
42
+ (((_b = self.constructor) === null || _b === void 0 ? void 0 : _b.name) === 'DedicatedWorkerGlobalScope' ||
43
+ ((_c = self.constructor) === null || _c === void 0 ? void 0 : _c.name) === 'ServiceWorkerGlobalScope' ||
44
+ ((_d = self.constructor) === null || _d === void 0 ? void 0 : _d.name) === 'SharedWorkerGlobalScope');
45
45
  if (isWebWorker) {
46
46
  return {
47
- type: "web-worker",
47
+ type: 'web-worker',
48
48
  };
49
49
  }
50
50
  /**
51
51
  * A constant that indicates whether the environment the code is running is Deno.
52
52
  * FYI Deno spoofs process.versions.node, see https://deno.land/std@0.177.0/node/process.ts?s=versions
53
53
  */
54
- const isDeno = typeof Deno !== "undefined" && typeof Deno.version !== "undefined" && typeof Deno.version.deno !== "undefined";
54
+ const isDeno = typeof Deno !== 'undefined' &&
55
+ typeof Deno.version !== 'undefined' &&
56
+ typeof Deno.version.deno !== 'undefined';
55
57
  if (isDeno) {
56
58
  return {
57
- type: "deno",
59
+ type: 'deno',
58
60
  version: Deno.version.deno,
59
61
  os: (_e = Deno.build) === null || _e === void 0 ? void 0 : _e.os,
60
62
  arch: (_f = Deno.build) === null || _f === void 0 ? void 0 : _f.arch,
@@ -63,13 +65,13 @@ function evaluateRuntime() {
63
65
  /**
64
66
  * A constant that indicates whether the environment the code is running is Bun.sh.
65
67
  */
66
- const isBun = typeof Bun !== "undefined" && typeof Bun.version !== "undefined";
68
+ const isBun = typeof Bun !== 'undefined' && typeof Bun.version !== 'undefined';
67
69
  if (isBun) {
68
70
  return {
69
- type: "bun",
71
+ type: 'bun',
70
72
  version: Bun.version,
71
- os: typeof process !== "undefined" ? process.platform : undefined,
72
- arch: typeof process !== "undefined" ? process.arch : undefined,
73
+ os: typeof process !== 'undefined' ? process.platform : undefined,
74
+ arch: typeof process !== 'undefined' ? process.arch : undefined,
73
75
  };
74
76
  }
75
77
  /**
@@ -77,10 +79,10 @@ function evaluateRuntime() {
77
79
  * This check should come before Node.js detection since React Native may have a process polyfill.
78
80
  * https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/setUpNavigator.js
79
81
  */
80
- const isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative";
82
+ const isReactNative = typeof navigator !== 'undefined' && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === 'ReactNative';
81
83
  if (isReactNative) {
82
84
  return {
83
- type: "react-native",
85
+ type: 'react-native',
84
86
  };
85
87
  }
86
88
  /**
@@ -90,19 +92,19 @@ function evaluateRuntime() {
90
92
  * bundlers that perform static analysis on `process.versions` (e.g. Next.js
91
93
  * Edge Runtime warns about Node.js APIs even when they are guarded).
92
94
  */
93
- const _process = typeof process !== "undefined" ? process : undefined;
94
- const isNode = typeof _process !== "undefined" && typeof ((_g = _process.versions) === null || _g === void 0 ? void 0 : _g.node) === "string";
95
+ const _process = typeof process !== 'undefined' ? process : undefined;
96
+ const isNode = typeof _process !== 'undefined' && typeof ((_g = _process.versions) === null || _g === void 0 ? void 0 : _g.node) === 'string';
95
97
  if (isNode) {
96
98
  return {
97
- type: "node",
99
+ type: 'node',
98
100
  version: _process.versions.node,
99
- parsedVersion: Number(_process.versions.node.split(".")[0]),
101
+ parsedVersion: Number(_process.versions.node.split('.')[0]),
100
102
  os: _process.platform,
101
103
  arch: _process.arch,
102
104
  };
103
105
  }
104
106
  return {
105
- type: "unknown",
107
+ type: 'unknown',
106
108
  };
107
109
  }
108
110
  /**
@@ -112,14 +114,14 @@ function evaluateRuntime() {
112
114
  * to `undefined` so they are omitted from the User-Agent.
113
115
  */
114
116
  const RUNTIME_DISPLAY_NAMES = {
115
- node: "Node",
116
- deno: "Deno",
117
- bun: "Bun",
117
+ node: 'Node',
118
+ deno: 'Deno',
119
+ bun: 'Bun',
118
120
  browser: undefined,
119
- "web-worker": undefined,
120
- "react-native": undefined,
121
+ 'web-worker': undefined,
122
+ 'react-native': undefined,
121
123
  workerd: undefined,
122
- "edge-runtime": undefined,
124
+ 'edge-runtime': undefined,
123
125
  unknown: undefined,
124
126
  };
125
127
  /**
@@ -128,7 +130,7 @@ const RUNTIME_DISPLAY_NAMES = {
128
130
  * consistent regardless of which runtime reports it (Node reports `x64`, others
129
131
  * report `amd64` or `x86_64`).
130
132
  */
131
- const X86_64_ARCH_ALIASES = new Set(["x64", "amd64", "x86_64"]);
133
+ const X86_64_ARCH_ALIASES = new Set(['x64', 'amd64', 'x86_64']);
132
134
  /**
133
135
  * Normalizes a CPU architecture token, collapsing the 64-bit x86 aliases
134
136
  * (`x64`, `amd64`, `x86_64`) to `x86_64`. Other architectures are returned
@@ -138,7 +140,7 @@ function normalizeArch(arch) {
138
140
  if (arch == null) {
139
141
  return arch;
140
142
  }
141
- return X86_64_ARCH_ALIASES.has(arch.toLowerCase()) ? "x86_64" : arch;
143
+ return X86_64_ARCH_ALIASES.has(arch.toLowerCase()) ? 'x86_64' : arch;
142
144
  }
143
145
  /**
144
146
  * Percent-encodes the `@` and `/` characters in an npm package name so the
@@ -147,7 +149,7 @@ function normalizeArch(arch) {
147
149
  * `@dummy/sdk` becomes `%40dummy%2Fsdk`).
148
150
  */
149
151
  function encodeProductName(sdkName) {
150
- return sdkName.replace(/@/g, "%40").replace(/\//g, "%2F");
152
+ return sdkName.replace(/@/g, '%40').replace(/\//g, '%2F');
151
153
  }
152
154
  /**
153
155
  * Builds a structured User-Agent string of the form
@@ -159,7 +161,7 @@ export function getUserAgent(sdkName, sdkVersion) {
159
161
  let userAgent = `${encodeProductName(sdkName)}/${sdkVersion}`;
160
162
  const platform = [RUNTIME.os, normalizeArch(RUNTIME.arch)].filter((part) => part != null && part.length > 0);
161
163
  if (platform.length > 0) {
162
- userAgent += ` (${platform.join("; ")})`;
164
+ userAgent += ` (${platform.join('; ')})`;
163
165
  }
164
166
  const runtimeName = RUNTIME_DISPLAY_NAMES[RUNTIME.type];
165
167
  if (runtimeName != null) {
@@ -25,7 +25,7 @@ declare class QueryStringBuilder {
25
25
  * Null / undefined values are silently skipped.
26
26
  */
27
27
  add(key: string, value: unknown, options?: {
28
- style?: "comma";
28
+ style?: 'comma';
29
29
  }): this;
30
30
  /**
31
31
  * Adds multiple query parameters at once from a record.
@@ -1,4 +1,4 @@
1
- import { toQueryString } from "./qs.mjs";
1
+ import { toQueryString } from './qs.mjs';
2
2
  /**
3
3
  * Creates a fluent builder for constructing URL query strings.
4
4
  *
@@ -33,7 +33,7 @@ class QueryStringBuilder {
33
33
  if (value === undefined || value === null) {
34
34
  return this;
35
35
  }
36
- const serialized = toQueryString({ [key]: value }, { arrayFormat: (options === null || options === void 0 ? void 0 : options.style) === "comma" ? "comma" : "repeat" });
36
+ const serialized = toQueryString({ [key]: value }, { arrayFormat: (options === null || options === void 0 ? void 0 : options.style) === 'comma' ? 'comma' : 'repeat' });
37
37
  if (serialized.length > 0) {
38
38
  this.parts.set(key, serialized);
39
39
  }
@@ -62,7 +62,7 @@ class QueryStringBuilder {
62
62
  if (value === undefined || value === null) {
63
63
  continue;
64
64
  }
65
- const serialized = toQueryString({ [key]: value }, { arrayFormat: "repeat" });
65
+ const serialized = toQueryString({ [key]: value }, { arrayFormat: 'repeat' });
66
66
  if (serialized.length > 0) {
67
67
  this.parts.set(key, serialized);
68
68
  }
@@ -75,6 +75,6 @@ class QueryStringBuilder {
75
75
  * Returns an empty string when no parameters were added.
76
76
  */
77
77
  build() {
78
- return [...this.parts.values()].join("&");
78
+ return [...this.parts.values()].join('&');
79
79
  }
80
80
  }
@@ -1,14 +1,14 @@
1
1
  export function encodePathParam(param, InvalidPathParameterError) {
2
2
  if (param === null) {
3
- return "null";
3
+ return 'null';
4
4
  }
5
5
  const typeofParam = typeof param;
6
6
  switch (typeofParam) {
7
- case "undefined":
8
- return "undefined";
9
- case "string":
10
- case "number":
11
- case "boolean":
7
+ case 'undefined':
8
+ return 'undefined';
9
+ case 'string':
10
+ case 'number':
11
+ case 'boolean':
12
12
  break;
13
13
  default:
14
14
  param = String(param);
@@ -16,9 +16,11 @@ export function encodePathParam(param, InvalidPathParameterError) {
16
16
  }
17
17
  const encoded = encodeURIComponent(param);
18
18
  // "." and ".." are dot segments: URL resolution would remove them and send the request to a different path.
19
- if (encoded === "." || encoded === "..") {
19
+ if (encoded === '.' || encoded === '..') {
20
20
  const message = `Invalid path parameter "${encoded}": "." and ".." are not allowed because they change the request path.`;
21
- throw InvalidPathParameterError != null ? new InvalidPathParameterError({ message }) : new Error(message);
21
+ throw InvalidPathParameterError != null
22
+ ? new InvalidPathParameterError({ message })
23
+ : new Error(message);
22
24
  }
23
25
  return encoded;
24
26
  }