@osdk/cli 0.24.9 → 0.24.10

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 (48) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/build/browser/{chunk-3H567IY3.js → chunk-CDP3LF3Z.js} +6 -6
  3. package/build/{esm/chunk-3H567IY3.js.map → browser/chunk-CDP3LF3Z.js.map} +1 -1
  4. package/build/{esm/chunk-UT43C4BM.js → browser/chunk-E6TNVHMG.js} +22 -5
  5. package/build/browser/chunk-E6TNVHMG.js.map +1 -0
  6. package/build/browser/{handleGenerate-QY5GPZ7H.js → handleGenerate-2ISEGQIX.js} +8 -8
  7. package/build/browser/{handleGenerate-QY5GPZ7H.js.map → handleGenerate-2ISEGQIX.js.map} +1 -1
  8. package/build/browser/index.js +20 -12
  9. package/build/browser/index.js.map +1 -1
  10. package/build/browser/{siteDeployCommand-T34QFCR6.js → siteDeployCommand-MJLBRXU3.js} +4 -4
  11. package/build/browser/{siteDeployCommand-T34QFCR6.js.map → siteDeployCommand-MJLBRXU3.js.map} +1 -1
  12. package/build/browser/{versionDeleteCommand-VJQHB3Y7.js → versionDeleteCommand-JJ6M5RJ2.js} +4 -4
  13. package/build/browser/{versionDeleteCommand-VJQHB3Y7.js.map → versionDeleteCommand-JJ6M5RJ2.js.map} +1 -1
  14. package/build/{esm/versionGetCommand-SIKXTJAX.js → browser/versionGetCommand-Q2X33XNW.js} +4 -4
  15. package/build/browser/{versionGetCommand-SIKXTJAX.js.map → versionGetCommand-Q2X33XNW.js.map} +1 -1
  16. package/build/{esm/versionListCommand-RILPQSQH.js → browser/versionListCommand-DDLD4NNY.js} +4 -4
  17. package/build/browser/{versionListCommand-RILPQSQH.js.map → versionListCommand-DDLD4NNY.js.map} +1 -1
  18. package/build/{esm/versionSetCommand-GAGHJ2VU.js → browser/versionSetCommand-LXMFG2LH.js} +4 -4
  19. package/build/browser/{versionSetCommand-GAGHJ2VU.js.map → versionSetCommand-LXMFG2LH.js.map} +1 -1
  20. package/build/browser/{versionUnsetCommand-VETAWEOH.js → versionUnsetCommand-CTWDGYV6.js} +4 -4
  21. package/build/browser/{versionUnsetCommand-VETAWEOH.js.map → versionUnsetCommand-CTWDGYV6.js.map} +1 -1
  22. package/build/esm/{chunk-3H567IY3.js → chunk-CDP3LF3Z.js} +6 -6
  23. package/build/{browser/chunk-3H567IY3.js.map → esm/chunk-CDP3LF3Z.js.map} +1 -1
  24. package/build/{browser/chunk-UT43C4BM.js → esm/chunk-E6TNVHMG.js} +22 -5
  25. package/build/esm/chunk-E6TNVHMG.js.map +1 -0
  26. package/build/esm/commands/site/deploy/index.d.ts.map +1 -1
  27. package/build/esm/commands/site/deploy/logDeployCommandConfigFileOverride.d.ts.map +1 -1
  28. package/build/esm/{handleGenerate-QY5GPZ7H.js → handleGenerate-2ISEGQIX.js} +8 -8
  29. package/build/esm/{handleGenerate-QY5GPZ7H.js.map → handleGenerate-2ISEGQIX.js.map} +1 -1
  30. package/build/esm/index.js +20 -12
  31. package/build/esm/index.js.map +1 -1
  32. package/build/esm/{siteDeployCommand-T34QFCR6.js → siteDeployCommand-MJLBRXU3.js} +4 -4
  33. package/build/esm/{siteDeployCommand-T34QFCR6.js.map → siteDeployCommand-MJLBRXU3.js.map} +1 -1
  34. package/build/esm/util/config.d.ts +1 -0
  35. package/build/esm/util/config.d.ts.map +1 -1
  36. package/build/esm/{versionDeleteCommand-VJQHB3Y7.js → versionDeleteCommand-JJ6M5RJ2.js} +4 -4
  37. package/build/esm/{versionDeleteCommand-VJQHB3Y7.js.map → versionDeleteCommand-JJ6M5RJ2.js.map} +1 -1
  38. package/build/{browser/versionGetCommand-SIKXTJAX.js → esm/versionGetCommand-Q2X33XNW.js} +4 -4
  39. package/build/esm/{versionGetCommand-SIKXTJAX.js.map → versionGetCommand-Q2X33XNW.js.map} +1 -1
  40. package/build/{browser/versionListCommand-RILPQSQH.js → esm/versionListCommand-DDLD4NNY.js} +4 -4
  41. package/build/esm/{versionListCommand-RILPQSQH.js.map → versionListCommand-DDLD4NNY.js.map} +1 -1
  42. package/build/{browser/versionSetCommand-GAGHJ2VU.js → esm/versionSetCommand-LXMFG2LH.js} +4 -4
  43. package/build/esm/{versionSetCommand-GAGHJ2VU.js.map → versionSetCommand-LXMFG2LH.js.map} +1 -1
  44. package/build/esm/{versionUnsetCommand-VETAWEOH.js → versionUnsetCommand-CTWDGYV6.js} +4 -4
  45. package/build/esm/{versionUnsetCommand-VETAWEOH.js.map → versionUnsetCommand-CTWDGYV6.js.map} +1 -1
  46. package/package.json +5 -5
  47. package/build/browser/chunk-UT43C4BM.js.map +0 -1
  48. package/build/esm/chunk-UT43C4BM.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @osdk/cli
2
2
 
3
+ ## 0.24.10
4
+
5
+ ### Patch Changes
6
+
7
+ - ac00412: Include API error info in CLI error messages
8
+ - 4aa621a: Allow configuring uploadOnly through foundry.config.json
9
+
3
10
  ## 0.24.9
4
11
 
5
12
  ## 0.24.8
@@ -136,15 +136,15 @@ init_esm_shims();
136
136
  var PalantirApiError = class extends Error {
137
137
  message;
138
138
  errorName;
139
- errorType;
139
+ errorCode;
140
140
  statusCode;
141
141
  errorInstanceId;
142
142
  parameters;
143
- constructor(message, errorName, errorType, statusCode, errorInstanceId, parameters) {
143
+ constructor(message, errorName, errorCode, statusCode, errorInstanceId, parameters) {
144
144
  super(message);
145
145
  this.message = message;
146
146
  this.errorName = errorName;
147
- this.errorType = errorType;
147
+ this.errorCode = errorCode;
148
148
  this.statusCode = statusCode;
149
149
  this.errorInstanceId = errorInstanceId;
150
150
  this.parameters = parameters;
@@ -259,7 +259,7 @@ function createSharedClientContext(baseUrl, tokenProvider, userAgent, fetchFn =
259
259
  try {
260
260
  return await retryingFetchWithAuthOrThrow(input, init);
261
261
  } catch (e) {
262
- const betterError = e instanceof PalantirApiError ? new PalantirApiError(e.message, e.errorName, e.errorType, e.statusCode, e.errorInstanceId, e.parameters) : new Error("Captured stack trace for error: " + e.message);
262
+ const betterError = e instanceof PalantirApiError ? new PalantirApiError(e.message, e.errorName, e.errorCode, e.statusCode, e.errorInstanceId, e.parameters) : new Error("Captured stack trace for error: " + e.message);
263
263
  betterError.cause = e;
264
264
  throw betterError;
265
265
  }
@@ -292,5 +292,5 @@ init_esm_shims();
292
292
  init_esm_shims();
293
293
 
294
294
  export { PalantirApiError, createClientContext, createFetchHeaderMutator, createFetchOrThrow };
295
- //# sourceMappingURL=chunk-3H567IY3.js.map
296
- //# sourceMappingURL=chunk-3H567IY3.js.map
295
+ //# sourceMappingURL=chunk-CDP3LF3Z.js.map
296
+ //# sourceMappingURL=chunk-CDP3LF3Z.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../node_modules/.pnpm/fetch-retry@6.0.0/node_modules/fetch-retry/index.js","../../../shared.net/build/esm/createClientContext.js","../../../shared.client.impl/build/esm/index.js","../../../shared.client.impl/build/esm/createSharedClientContext.js","../../../shared.net.errors/build/esm/index.js","../../../shared.net.errors/build/esm/PalantirApiError.js","../../../shared.net.errors/build/esm/UnknownError.js","../../../shared.net.fetch/build/esm/index.js","../../../shared.net.fetch/build/esm/createFetchHeaderMutator.js","../../../shared.net.fetch/build/esm/createFetchOrThrow.js","../../../shared.net.fetch/build/esm/createRetryingFetch.js","../../../shared.net/build/esm/index.js","../../../shared.net/build/esm/ResultOrError.js","../../../shared.net/build/esm/util/replaceHttpIfNotLocalhost.js"],"names":["fetch","fetchRetry","error"],"mappings":";;;AAAA,IAAA,mBAAA,GAAA,UAAA,CAAA;AAAA,EAAA,8EAAA,CAAA,OAAA,EAAA,MAAA,EAAA;AAAA,IAAA,cAAA,EAAA,CAAA;AAEA,IAAO,MAAA,CAAA,OAAA,GAAU,SAAUA,MAAAA,EAAO,QAAU,EAAA;AAC1C,MAAA,QAAA,GAAW,YAAY,EAAC,CAAA;AACxB,MAAI,IAAA,OAAOA,WAAU,UAAY,EAAA;AAC/B,Q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lCA,cAAA,EAAA,CAAA;;;ACAA,cAAA,EAAA,CAAA;;;ACAA,cAAA,EAAA","file":"chunk-3H567IY3.js","sourcesContent":["'use strict';\n\nmodule.exports = function (fetch, defaults) {\n defaults = defaults || {};\n if (typeof fetch !== 'function') {\n throw new ArgumentError('fetch must be a function');\n }\n if (typeof defaults !== 'object') {\n throw new ArgumentError('defaults must be an object');\n }\n if (defaults.retries !== undefined && !isPositiveInteger(defaults.retries)) {\n throw new ArgumentError('retries must be a positive integer');\n }\n if (defaults.retryDelay !== undefined && !isPositiveInteger(defaults.retryDelay) && typeof defaults.retryDelay !== 'function') {\n throw new ArgumentError('retryDelay must be a positive integer or a function returning a positive integer');\n }\n if (defaults.retryOn !== undefined && !Array.isArray(defaults.retryOn) && typeof defaults.retryOn !== 'function') {\n throw new ArgumentError('retryOn property expects an array or function');\n }\n var baseDefaults = {\n retries: 3,\n retryDelay: 1000,\n retryOn: []\n };\n defaults = Object.assign(baseDefaults, defaults);\n return function fetchRetry(input, init) {\n var retries = defaults.retries;\n var retryDelay = defaults.retryDelay;\n var retryOn = defaults.retryOn;\n if (init && init.retries !== undefined) {\n if (isPositiveInteger(init.retries)) {\n retries = init.retries;\n } else {\n throw new ArgumentError('retries must be a positive integer');\n }\n }\n if (init && init.retryDelay !== undefined) {\n if (isPositiveInteger(init.retryDelay) || typeof init.retryDelay === 'function') {\n retryDelay = init.retryDelay;\n } else {\n throw new ArgumentError('retryDelay must be a positive integer or a function returning a positive integer');\n }\n }\n if (init && init.retryOn) {\n if (Array.isArray(init.retryOn) || typeof init.retryOn === 'function') {\n retryOn = init.retryOn;\n } else {\n throw new ArgumentError('retryOn property expects an array or function');\n }\n }\n\n // eslint-disable-next-line no-undef\n return new Promise(function (resolve, reject) {\n var wrappedFetch = function (attempt) {\n // As of node 18, this is no longer needed since node comes with native support for fetch:\n /* istanbul ignore next */\n var _input = typeof Request !== 'undefined' && input instanceof Request ? input.clone() : input;\n fetch(_input, init).then(function (response) {\n if (Array.isArray(retryOn) && retryOn.indexOf(response.status) === -1) {\n resolve(response);\n } else if (typeof retryOn === 'function') {\n try {\n // eslint-disable-next-line no-undef\n return Promise.resolve(retryOn(attempt, null, response)).then(function (retryOnResponse) {\n if (retryOnResponse) {\n retry(attempt, null, response);\n } else {\n resolve(response);\n }\n }).catch(reject);\n } catch (error) {\n reject(error);\n }\n } else {\n if (attempt < retries) {\n retry(attempt, null, response);\n } else {\n resolve(response);\n }\n }\n }).catch(function (error) {\n if (typeof retryOn === 'function') {\n try {\n // eslint-disable-next-line no-undef\n Promise.resolve(retryOn(attempt, error, null)).then(function (retryOnResponse) {\n if (retryOnResponse) {\n retry(attempt, error, null);\n } else {\n reject(error);\n }\n }).catch(function (error) {\n reject(error);\n });\n } catch (error) {\n reject(error);\n }\n } else if (attempt < retries) {\n retry(attempt, error, null);\n } else {\n reject(error);\n }\n });\n };\n function retry(attempt, error, response) {\n var delay = typeof retryDelay === 'function' ? retryDelay(attempt, error, response) : retryDelay;\n setTimeout(function () {\n wrappedFetch(++attempt);\n }, delay);\n }\n wrappedFetch(0);\n });\n };\n};\nfunction isPositiveInteger(value) {\n return Number.isInteger(value) && value >= 0;\n}\nfunction ArgumentError(message) {\n this.name = 'ArgumentError';\n this.message = message;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createSharedClientContext } from \"@osdk/shared.client.impl\";\nimport { PalantirApiError } from \"@osdk/shared.net.errors\";\nimport { createFetchHeaderMutator, createFetchOrThrow, createRetryingFetch } from \"@osdk/shared.net.fetch\";\n/**\n * The goal of the thin client is to provide a way to tree shake as much as possible.\n */\nexport function createClientContext(baseUrl, tokenProvider, userAgent, fetchFn = fetch) {\n if (baseUrl.length === 0) {\n throw new Error(\"baseUrl cannot be empty\");\n }\n const retryingFetchWithAuthOrThrow = createFetchHeaderMutator(createRetryingFetch(createFetchOrThrow(fetchFn)), async headers => {\n const token = await tokenProvider();\n headers.set(\"Authorization\", `Bearer ${token}`);\n headers.set(\"Fetch-User-Agent\", [headers.get(\"Fetch-User-Agent\"), userAgent].filter(x => x && x?.length > 0).join(\" \"));\n return headers;\n });\n // because this is async await it preserves stack traces, which the retrying fetch does not\n\n return createSharedClientContext(baseUrl, async () => await tokenProvider(), [userAgent].filter(x => x && x?.length > 0).join(\" \"), fetchFn);\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport { createSharedClientContext } from \"./createSharedClientContext.js\";","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { PalantirApiError } from \"@osdk/shared.net.errors\";\nimport { createFetchHeaderMutator, createFetchOrThrow, createRetryingFetch } from \"@osdk/shared.net.fetch\";\nexport function createSharedClientContext(baseUrl, tokenProvider, userAgent, fetchFn = fetch) {\n if (baseUrl.length === 0) {\n throw new Error(\"baseUrl cannot be empty\");\n }\n const retryingFetchWithAuthOrThrow = createFetchHeaderMutator(createRetryingFetch(createFetchOrThrow(fetchFn)), async headers => {\n const token = await tokenProvider();\n headers.set(\"Authorization\", `Bearer ${token}`);\n headers.set(\"Fetch-User-Agent\", [headers.get(\"Fetch-User-Agent\"), userAgent].filter(x => x && x?.length > 0).join(\" \"));\n return headers;\n });\n // because this is async await it preserves stack traces, which the retrying fetch does not\n\n return {\n baseUrl,\n fetch: async (input, init) => {\n try {\n return await retryingFetchWithAuthOrThrow(input, init);\n } catch (e) {\n const betterError = e instanceof PalantirApiError ? new PalantirApiError(e.message, e.errorName, e.errorType, e.statusCode, e.errorInstanceId, e.parameters) : new Error(\"Captured stack trace for error: \" + e.message ?? e);\n betterError.cause = e;\n throw betterError;\n }\n },\n tokenProvider\n };\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport { PalantirApiError } from \"./PalantirApiError.js\";\nexport { UnknownError } from \"./UnknownError.js\";","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class PalantirApiError extends Error {\n message;\n errorName;\n errorType;\n statusCode;\n errorInstanceId;\n parameters;\n constructor(message, errorName, errorType, statusCode, errorInstanceId, parameters) {\n super(message);\n this.message = message;\n this.errorName = errorName;\n this.errorType = errorType;\n this.statusCode = statusCode;\n this.errorInstanceId = errorInstanceId;\n this.parameters = parameters;\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { PalantirApiError } from \"./PalantirApiError.js\";\nexport class UnknownError extends PalantirApiError {\n originalError;\n constructor(message, errorType, originalError) {\n super(message, errorType);\n this.originalError = originalError;\n }\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport { createFetchHeaderMutator } from \"./createFetchHeaderMutator.js\";\nexport { createFetchOrThrow } from \"./createFetchOrThrow.js\";\nexport { createRetryingFetch } from \"./createRetryingFetch.js\";","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport function createFetchHeaderMutator(fetchFn = fetch, mutator) {\n return async function (url, requestInit) {\n if (!requestInit) {\n return fetchFn(url, {\n headers: await mutator(new Headers())\n });\n }\n return fetchFn(url, {\n ...requestInit,\n headers: await mutator(new Headers(requestInit.headers))\n });\n };\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { PalantirApiError, UnknownError } from \"@osdk/shared.net.errors\";\n/**\n * Wraps a fetch plugin so that all errors (including when statusCode is not in the 200s) are converted to either PalantirApiError or UnknownError.\n *\n * If the returned promise does not have an error state, you are free to immediately call `.json()` or equivalent.\n *\n * @param fetchFn\n * @returns\n */\nexport function createFetchOrThrow(fetchFn = fetch) {\n return async function (url, requestInit) {\n let response;\n try {\n response = await fetchFn(url, requestInit);\n } catch (e) {\n throw convertError(e, \"A network error occurred\");\n }\n if (!response.ok) {\n if (response.headers.get(\"Content-Type\") === \"text/plain\") {\n throw new PalantirApiError(await response.text());\n }\n let body;\n try {\n body = await response.json();\n } catch (e) {\n throw convertError(e, \"A network error occurred while reading response\");\n }\n throw new PalantirApiError(body?.message ?? `Failed to fetch ${response.status} ${response.statusText}`, body?.errorName, body?.errorCode, response.status, body?.errorInstanceId, body?.parameters);\n }\n return response;\n };\n}\nfunction convertError(e, msgIfNotError = \"An unknown error occurred\") {\n if (e instanceof Error) {\n return new UnknownError(e.message, \"UNKNOWN\", e);\n }\n return new UnknownError(msgIfNotError, \"UNKNOWN\");\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { PalantirApiError } from \"@osdk/shared.net.errors\";\nimport fetchRetry from \"fetch-retry\";\nconst INITIAL_DELAY = 1_000;\nconst JITTER_FACTOR = 0.5;\nconst MAX_RETRIES = 3;\nexport function createRetryingFetch(fetch) {\n return fetchRetry(fetch, {\n retryDelay(attempt) {\n const delay = INITIAL_DELAY * 2 ** attempt;\n const jitter = delay * JITTER_FACTOR * (Math.random() * 2 - 1);\n return delay + jitter;\n },\n retryOn(attempt, error, response) {\n const status = response?.status ?? 0;\n return !(status >= 200 && status < 300) && isRetryable(error) && attempt < MAX_RETRIES;\n }\n });\n}\nfunction isRetryable(e) {\n if (e instanceof PalantirApiError) {\n if (e.statusCode !== SERVICE_UNAVAILABLE && e.statusCode !== TOO_MANY_REQUESTS) {\n return false;\n }\n }\n return true; // I think this logic is flawed?\n}\nconst SERVICE_UNAVAILABLE = 503;\nconst TOO_MANY_REQUESTS = 429;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport { PalantirApiError, UnknownError } from \"@osdk/shared.net.errors\";\nexport { createFetchHeaderMutator, createFetchOrThrow } from \"@osdk/shared.net.fetch\";\nexport { createClientContext } from \"./createClientContext.js\";\nexport { isOk } from \"./ResultOrError.js\";\nexport { replaceHttpIfNotLocalhost } from \"./util/replaceHttpIfNotLocalhost.js\";","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport function isOk(result) {\n return result.type === \"ok\";\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport function replaceHttpIfNotLocalhost(url) {\n const parsed = new URL(url);\n if (parsed.protocol === \"http:\" && parsed.hostname === \"localhost\") {\n // Allow special case http for localhost CORS proxy during development\n return url;\n }\n parsed.protocol = \"https:\";\n return parsed.toString();\n}"]}
1
+ {"version":3,"sources":["../../../../node_modules/.pnpm/fetch-retry@6.0.0/node_modules/fetch-retry/index.js","../../../shared.net/build/esm/createClientContext.js","../../../shared.client.impl/build/esm/index.js","../../../shared.client.impl/build/esm/createSharedClientContext.js","../../../shared.net.errors/build/esm/index.js","../../../shared.net.errors/build/esm/PalantirApiError.js","../../../shared.net.errors/build/esm/UnknownError.js","../../../shared.net.fetch/build/esm/index.js","../../../shared.net.fetch/build/esm/createFetchHeaderMutator.js","../../../shared.net.fetch/build/esm/createFetchOrThrow.js","../../../shared.net.fetch/build/esm/createRetryingFetch.js","../../../shared.net/build/esm/index.js","../../../shared.net/build/esm/ResultOrError.js","../../../shared.net/build/esm/util/replaceHttpIfNotLocalhost.js"],"names":["fetch","fetchRetry","error"],"mappings":";;;AAAA,IAAA,mBAAA,GAAA,UAAA,CAAA;AAAA,EAAA,8EAAA,CAAA,OAAA,EAAA,MAAA,EAAA;AAAA,IAAA,cAAA,EAAA,CAAA;AAEA,IAAO,MAAA,CAAA,OAAA,GAAU,SAAUA,MAAAA,EAAO,QAAU,EAAA;AAC1C,MAAA,QAAA,GAAW,YAAY,EAAC,CAAA;AACxB,MAAI,IAAA,OAAOA,WAAU,UAAY,EAAA;AAC/B,QAAM,MAAA,IAAI,cAAc,0BAA0B,CAAA,CAAA;AAAA,OACpD;AACA,MAAI,IAAA,OAAO,aAAa,QAAU,EAAA;AAChC,QAAM,MAAA,IAAI,cAAc,4BAA4B,CAAA,CAAA;AAAA,OACtD;AACA,MAAA,IAAI,SAAS,OAAY,KAAA,KAAA,CAAA,IAAa,CAAC,iBAAkB,CAAA,QAAA,CAAS,OAAO,CAAG,EAAA;AAC1E,QAAM,MAAA,IAAI,cAAc,oCAAoC,CAAA,CAAA;AAAA,OAC9D;AACA,MAAI,IAAA,QAAA,CAAS,UAAe,KAAA,KAAA,CAAA,IAAa,CAAC,iBAAA,CAAkB,QAAS,CAAA,UAAU,CAAK,IAAA,OAAO,QAAS,CAAA,UAAA,KAAe,UAAY,EAAA;AAC7H,QAAM,MAAA,IAAI,cAAc,kFAAkF,CAAA,CAAA;AAAA,OAC5G;AACA,MAAA,IAAI,QAAS,CAAA,OAAA,KAAY,KAAa,CAAA,IAAA,CAAC,KAAM,CAAA,OAAA,CAAQ,QAAS,CAAA,OAAO,CAAK,IAAA,OAAO,QAAS,CAAA,OAAA,KAAY,UAAY,EAAA;AAChH,QAAM,MAAA,IAAI,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AAA,CAAA,CAAA;AAC9C,IAAA,OAAA,CAAQ,IAAI,kBAAoB,EAAA,CAAC,QAAQ,GAAI,CAAA,kBAAkB,GAAG,SAAS,CAAA,CAAE,MAAO,CAAA,CAAA,CAAA,KAAK,KAAK,CAAG,EAAA,MAAA,GAAS,CAAC,CAAE,CAAA,IAAA,CAAK,GAAG,CAAC,CAAA,CAAA;AACtH,IAAO,OAAA,OAAA,CAAA;AAAA,GACR,EAAA;AAGD,EAAA,OAAO,0BAA0B,OAAS,EAAA,YAAY,MAAM,aAAc,EAAA,EAAG,CAAC,SAAS,CAAA,CAAE,OAAO,CAAK,CAAA,KAAA,CAAA,IAAK,GAAG,MAAS,GAAA,CAAC,EAAE,IAAK,CAAA,GAAG,GAAG,OAAO,CAAA,CAAA;AAC7I,CAAA;;;AUlCA,cAAA,EAAA,CAAA;;;ACAA,cAAA,EAAA,CAAA;;;ACAA,cAAA,EAAA","file":"chunk-CDP3LF3Z.js","sourcesContent":["'use strict';\n\nmodule.exports = function (fetch, defaults) {\n defaults = defaults || {};\n if (typeof fetch !== 'function') {\n throw new ArgumentError('fetch must be a function');\n }\n if (typeof defaults !== 'object') {\n throw new ArgumentError('defaults must be an object');\n }\n if (defaults.retries !== undefined && !isPositiveInteger(defaults.retries)) {\n throw new ArgumentError('retries must be a positive integer');\n }\n if (defaults.retryDelay !== undefined && !isPositiveInteger(defaults.retryDelay) && typeof defaults.retryDelay !== 'function') {\n throw new ArgumentError('retryDelay must be a positive integer or a function returning a positive integer');\n }\n if (defaults.retryOn !== undefined && !Array.isArray(defaults.retryOn) && typeof defaults.retryOn !== 'function') {\n throw new ArgumentError('retryOn property expects an array or function');\n }\n var baseDefaults = {\n retries: 3,\n retryDelay: 1000,\n retryOn: []\n };\n defaults = Object.assign(baseDefaults, defaults);\n return function fetchRetry(input, init) {\n var retries = defaults.retries;\n var retryDelay = defaults.retryDelay;\n var retryOn = defaults.retryOn;\n if (init && init.retries !== undefined) {\n if (isPositiveInteger(init.retries)) {\n retries = init.retries;\n } else {\n throw new ArgumentError('retries must be a positive integer');\n }\n }\n if (init && init.retryDelay !== undefined) {\n if (isPositiveInteger(init.retryDelay) || typeof init.retryDelay === 'function') {\n retryDelay = init.retryDelay;\n } else {\n throw new ArgumentError('retryDelay must be a positive integer or a function returning a positive integer');\n }\n }\n if (init && init.retryOn) {\n if (Array.isArray(init.retryOn) || typeof init.retryOn === 'function') {\n retryOn = init.retryOn;\n } else {\n throw new ArgumentError('retryOn property expects an array or function');\n }\n }\n\n // eslint-disable-next-line no-undef\n return new Promise(function (resolve, reject) {\n var wrappedFetch = function (attempt) {\n // As of node 18, this is no longer needed since node comes with native support for fetch:\n /* istanbul ignore next */\n var _input = typeof Request !== 'undefined' && input instanceof Request ? input.clone() : input;\n fetch(_input, init).then(function (response) {\n if (Array.isArray(retryOn) && retryOn.indexOf(response.status) === -1) {\n resolve(response);\n } else if (typeof retryOn === 'function') {\n try {\n // eslint-disable-next-line no-undef\n return Promise.resolve(retryOn(attempt, null, response)).then(function (retryOnResponse) {\n if (retryOnResponse) {\n retry(attempt, null, response);\n } else {\n resolve(response);\n }\n }).catch(reject);\n } catch (error) {\n reject(error);\n }\n } else {\n if (attempt < retries) {\n retry(attempt, null, response);\n } else {\n resolve(response);\n }\n }\n }).catch(function (error) {\n if (typeof retryOn === 'function') {\n try {\n // eslint-disable-next-line no-undef\n Promise.resolve(retryOn(attempt, error, null)).then(function (retryOnResponse) {\n if (retryOnResponse) {\n retry(attempt, error, null);\n } else {\n reject(error);\n }\n }).catch(function (error) {\n reject(error);\n });\n } catch (error) {\n reject(error);\n }\n } else if (attempt < retries) {\n retry(attempt, error, null);\n } else {\n reject(error);\n }\n });\n };\n function retry(attempt, error, response) {\n var delay = typeof retryDelay === 'function' ? retryDelay(attempt, error, response) : retryDelay;\n setTimeout(function () {\n wrappedFetch(++attempt);\n }, delay);\n }\n wrappedFetch(0);\n });\n };\n};\nfunction isPositiveInteger(value) {\n return Number.isInteger(value) && value >= 0;\n}\nfunction ArgumentError(message) {\n this.name = 'ArgumentError';\n this.message = message;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createSharedClientContext } from \"@osdk/shared.client.impl\";\nimport { PalantirApiError } from \"@osdk/shared.net.errors\";\nimport { createFetchHeaderMutator, createFetchOrThrow, createRetryingFetch } from \"@osdk/shared.net.fetch\";\n/**\n * The goal of the thin client is to provide a way to tree shake as much as possible.\n */\nexport function createClientContext(baseUrl, tokenProvider, userAgent, fetchFn = fetch) {\n if (baseUrl.length === 0) {\n throw new Error(\"baseUrl cannot be empty\");\n }\n const retryingFetchWithAuthOrThrow = createFetchHeaderMutator(createRetryingFetch(createFetchOrThrow(fetchFn)), async headers => {\n const token = await tokenProvider();\n headers.set(\"Authorization\", `Bearer ${token}`);\n headers.set(\"Fetch-User-Agent\", [headers.get(\"Fetch-User-Agent\"), userAgent].filter(x => x && x?.length > 0).join(\" \"));\n return headers;\n });\n // because this is async await it preserves stack traces, which the retrying fetch does not\n\n return createSharedClientContext(baseUrl, async () => await tokenProvider(), [userAgent].filter(x => x && x?.length > 0).join(\" \"), fetchFn);\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport { createSharedClientContext } from \"./createSharedClientContext.js\";","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { PalantirApiError } from \"@osdk/shared.net.errors\";\nimport { createFetchHeaderMutator, createFetchOrThrow, createRetryingFetch } from \"@osdk/shared.net.fetch\";\nexport function createSharedClientContext(baseUrl, tokenProvider, userAgent, fetchFn = fetch) {\n if (baseUrl.length === 0) {\n throw new Error(\"baseUrl cannot be empty\");\n }\n const retryingFetchWithAuthOrThrow = createFetchHeaderMutator(createRetryingFetch(createFetchOrThrow(fetchFn)), async headers => {\n const token = await tokenProvider();\n headers.set(\"Authorization\", `Bearer ${token}`);\n headers.set(\"Fetch-User-Agent\", [headers.get(\"Fetch-User-Agent\"), userAgent].filter(x => x && x?.length > 0).join(\" \"));\n return headers;\n });\n // because this is async await it preserves stack traces, which the retrying fetch does not\n\n return {\n baseUrl,\n fetch: async (input, init) => {\n try {\n return await retryingFetchWithAuthOrThrow(input, init);\n } catch (e) {\n const betterError = e instanceof PalantirApiError ? new PalantirApiError(e.message, e.errorName, e.errorCode, e.statusCode, e.errorInstanceId, e.parameters) : new Error(\"Captured stack trace for error: \" + e.message ?? e);\n betterError.cause = e;\n throw betterError;\n }\n },\n tokenProvider\n };\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport { PalantirApiError } from \"./PalantirApiError.js\";\nexport { UnknownError } from \"./UnknownError.js\";","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class PalantirApiError extends Error {\n message;\n errorName;\n errorCode;\n statusCode;\n errorInstanceId;\n parameters;\n constructor(message, errorName, errorCode, statusCode, errorInstanceId, parameters) {\n super(message);\n this.message = message;\n this.errorName = errorName;\n this.errorCode = errorCode;\n this.statusCode = statusCode;\n this.errorInstanceId = errorInstanceId;\n this.parameters = parameters;\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { PalantirApiError } from \"./PalantirApiError.js\";\nexport class UnknownError extends PalantirApiError {\n originalError;\n constructor(message, errorType, originalError) {\n super(message, errorType);\n this.originalError = originalError;\n }\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport { createFetchHeaderMutator } from \"./createFetchHeaderMutator.js\";\nexport { createFetchOrThrow } from \"./createFetchOrThrow.js\";\nexport { createRetryingFetch } from \"./createRetryingFetch.js\";","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport function createFetchHeaderMutator(fetchFn = fetch, mutator) {\n return async function (url, requestInit) {\n if (!requestInit) {\n return fetchFn(url, {\n headers: await mutator(new Headers())\n });\n }\n return fetchFn(url, {\n ...requestInit,\n headers: await mutator(new Headers(requestInit.headers))\n });\n };\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { PalantirApiError, UnknownError } from \"@osdk/shared.net.errors\";\n/**\n * Wraps a fetch plugin so that all errors (including when statusCode is not in the 200s) are converted to either PalantirApiError or UnknownError.\n *\n * If the returned promise does not have an error state, you are free to immediately call `.json()` or equivalent.\n *\n * @param fetchFn\n * @returns\n */\nexport function createFetchOrThrow(fetchFn = fetch) {\n return async function (url, requestInit) {\n let response;\n try {\n response = await fetchFn(url, requestInit);\n } catch (e) {\n throw convertError(e, \"A network error occurred\");\n }\n if (!response.ok) {\n if (response.headers.get(\"Content-Type\") === \"text/plain\") {\n throw new PalantirApiError(await response.text());\n }\n let body;\n try {\n body = await response.json();\n } catch (e) {\n throw convertError(e, \"A network error occurred while reading response\");\n }\n throw new PalantirApiError(body?.message ?? `Failed to fetch ${response.status} ${response.statusText}`, body?.errorName, body?.errorCode, response.status, body?.errorInstanceId, body?.parameters);\n }\n return response;\n };\n}\nfunction convertError(e, msgIfNotError = \"An unknown error occurred\") {\n if (e instanceof Error) {\n return new UnknownError(e.message, \"UNKNOWN\", e);\n }\n return new UnknownError(msgIfNotError, \"UNKNOWN\");\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { PalantirApiError } from \"@osdk/shared.net.errors\";\nimport fetchRetry from \"fetch-retry\";\nconst INITIAL_DELAY = 1_000;\nconst JITTER_FACTOR = 0.5;\nconst MAX_RETRIES = 3;\nexport function createRetryingFetch(fetch) {\n return fetchRetry(fetch, {\n retryDelay(attempt) {\n const delay = INITIAL_DELAY * 2 ** attempt;\n const jitter = delay * JITTER_FACTOR * (Math.random() * 2 - 1);\n return delay + jitter;\n },\n retryOn(attempt, error, response) {\n const status = response?.status ?? 0;\n return !(status >= 200 && status < 300) && isRetryable(error) && attempt < MAX_RETRIES;\n }\n });\n}\nfunction isRetryable(e) {\n if (e instanceof PalantirApiError) {\n if (e.statusCode !== SERVICE_UNAVAILABLE && e.statusCode !== TOO_MANY_REQUESTS) {\n return false;\n }\n }\n return true; // I think this logic is flawed?\n}\nconst SERVICE_UNAVAILABLE = 503;\nconst TOO_MANY_REQUESTS = 429;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport { PalantirApiError, UnknownError } from \"@osdk/shared.net.errors\";\nexport { createFetchHeaderMutator, createFetchOrThrow } from \"@osdk/shared.net.fetch\";\nexport { createClientContext } from \"./createClientContext.js\";\nexport { isOk } from \"./ResultOrError.js\";\nexport { replaceHttpIfNotLocalhost } from \"./util/replaceHttpIfNotLocalhost.js\";","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport function isOk(result) {\n return result.type === \"ok\";\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport function replaceHttpIfNotLocalhost(url) {\n const parsed = new URL(url);\n if (parsed.protocol === \"http:\" && parsed.hostname === \"localhost\") {\n // Allow special case http for localhost CORS proxy during development\n return url;\n }\n parsed.protocol = \"https:\";\n return parsed.toString();\n}"]}
@@ -1,4 +1,4 @@
1
- import { PalantirApiError, createFetchHeaderMutator, createFetchOrThrow } from './chunk-3H567IY3.js';
1
+ import { PalantirApiError, createFetchHeaderMutator, createFetchOrThrow } from './chunk-CDP3LF3Z.js';
2
2
  import { ExitProcessError } from './chunk-G6CPJEWR.js';
3
3
  import { init_esm_shims, __export } from './chunk-TIWBVCHX.js';
4
4
  import { consola } from 'consola';
@@ -34,7 +34,7 @@ init_esm_shims();
34
34
 
35
35
  // src/net/UserAgent.ts
36
36
  init_esm_shims();
37
- var USER_AGENT = `osdk-cli/${"0.24.9"}`;
37
+ var USER_AGENT = `osdk-cli/${"0.24.10"}`;
38
38
 
39
39
  // src/net/createFetch.mts
40
40
  function createFetch(tokenProvider, fetchFn = fetch) {
@@ -59,8 +59,10 @@ function handleFetchError(e) {
59
59
  tip = "Check your token is valid and has not expired or been disabled";
60
60
  } else if (e.statusCode === 403) {
61
61
  tip = "Check your token has the required scopes for this operation";
62
+ } else if (e.statusCode === 404) {
63
+ tip = "The resource may not exist or your token may not have the required scopes to load it";
62
64
  }
63
- let message = e.message;
65
+ let message;
64
66
  if (e.errorName === "CannotDeleteDeployedVersion") {
65
67
  message = "The site version to delete is live and cannot be deleted";
66
68
  tip = "Run the `site version set` command to change the live site version";
@@ -70,6 +72,21 @@ function handleFetchError(e) {
70
72
  message = "The site version already exists";
71
73
  } else if (e.errorName === "VersionNotFound") {
72
74
  message = "The site version could not be found";
75
+ } else {
76
+ const {
77
+ errorCode,
78
+ errorName,
79
+ errorInstanceId,
80
+ parameters
81
+ } = e;
82
+ message = `${e.message}
83
+
84
+ ${JSON.stringify({
85
+ errorCode,
86
+ errorName,
87
+ errorInstanceId,
88
+ parameters
89
+ }, null, 2)}`;
73
90
  }
74
91
  throw new ExitProcessError(1, message, tip, e);
75
92
  }
@@ -217,5 +234,5 @@ function isJWT(token) {
217
234
  }
218
235
 
219
236
  export { createInternalClientContext, loadToken, third_party_applications_exports };
220
- //# sourceMappingURL=chunk-UT43C4BM.js.map
221
- //# sourceMappingURL=chunk-UT43C4BM.js.map
237
+ //# sourceMappingURL=chunk-E6TNVHMG.js.map
238
+ //# sourceMappingURL=chunk-E6TNVHMG.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/net/createInternalClientContext.mts","../../src/net/third-party-applications/index.mts","../../src/net/third-party-applications/deleteVersion.mts","../../src/net/createFetch.mts","../../src/net/UserAgent.ts","../../src/net/third-party-applications/deployWebsite.mts","../../src/net/third-party-applications/getWebsite.mts","../../src/net/third-party-applications/listVersions.mts","../../src/net/third-party-applications/undeployWebsite.mts","../../src/net/third-party-applications/uploadVersion.mts","../../src/net/index.mts","../../src/util/token.ts"],"names":["fetch","consola","fsPromises"],"mappings":";;;;;;;;AAAA,cAAA,EAAA,CAAA;AAgBO,SAAS,2BAAA,CAA4B,YAAY,aAAe,EAAA;AACrE,EAAO,OAAA;AAAA,IACL,aAAA;AAAA,IACA,UAAA;AAAA,GACF,CAAA;AACF,CAAA;;;ACrBA,IAAA,gCAAA,GAAA,GAAA;AAAA,QAAA,CAAA,gCAAA,EAAA;AAAA,EAAA,aAAA,EAAA,MAAA,aAAA;AAAA,EAAA,aAAA,EAAA,MAAA,aAAA;AAAA,EAAA,UAAA,EAAA,MAAA,UAAA;AAAA,EAAA,YAAA,EAAA,MAAA,YAAA;AAAA,EAAA,eAAA,EAAA,MAAA,eAAA;AAAA,EAAA,aAAA,EAAA,MAAA,aAAA;AAAA,CAAA,CAAA,CAAA;AAAA,cAAA,EAAA,CAAA;;;ACAA,cAAA,EAAA,CAAA;;;ACAA,cAAA,E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A,EAAc,MAAM,CAAA,CAAA;AACtD,IAAA,KAAA,GAAQ,MAAM,IAAK,EAAA,CAAA;AAAA,WACZ,KAAO,EAAA;AACd,IAAA,MAAM,IAAI,gBAAiB,CAAA,CAAA,EAAG,8BAA8B,QAAQ,CAAA,GAAA,EAAM,KAAK,CAAE,CAAA,CAAA,CAAA;AAAA,GACnF;AACA,EAAO,OAAA;AAAA,IACL,QAAU,EAAA,YAAA;AAAA,IACV,KAAA;AAAA,GACF,CAAA;AACF,CAAA;AACO,SAAS,SAAS,KAAO,EAAA;AAC9B,EAAI,IAAA,CAAC,KAAM,CAAA,KAAK,CAAG,EAAA;AACjB,IAAM,MAAA,IAAI,gBAAiB,CAAA,CAAA,EAAG,CAAmC,iCAAA,CAAA,CAAA,CAAA;AAAA,GACnE;AACF,CAAA;AACA,SAAS,MAAM,KAAO,EAAA;AAEpB,EAAA,MAAM,UAAa,GAAA,kDAAA,CAAA;AACnB,EAAO,OAAA,UAAA,CAAW,KAAK,KAAK,CAAA,CAAA;AAC9B","file":"chunk-E6TNVHMG.js","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function createInternalClientContext(foundryUrl, tokenProvider) {\n return {\n tokenProvider,\n foundryUrl\n };\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { deleteVersion } from \"./deleteVersion.mjs\";\nexport { deployWebsite } from \"./deployWebsite.mjs\";\nexport { getWebsite } from \"./getWebsite.mjs\";\nexport { listVersions } from \"./listVersions.mjs\";\nexport { undeployWebsite } from \"./undeployWebsite.mjs\";\nexport { uploadVersion } from \"./uploadVersion.mjs\";","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function deleteVersion(ctx, thirdPartyAppRid, version) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website/versions/${version}?preview=true`;\n await fetch(url, {\n method: \"DELETE\"\n });\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ExitProcessError } from \"@osdk/cli.common\";\nimport { createFetchHeaderMutator, createFetchOrThrow, PalantirApiError } from \"@osdk/shared.net\";\nimport { consola } from \"consola\";\nimport { USER_AGENT } from \"./UserAgent.js\";\nexport function createFetch(tokenProvider, fetchFn = fetch) {\n return createFetchHeaderMutator(createRequestLoggingFetch(createErrorExitingFetch(createFetchOrThrow(fetchFn))), async headers => {\n const token = await tokenProvider();\n headers.set(\"Authorization\", `Bearer ${token}`);\n headers.set(\"Fetch-User-Agent\", USER_AGENT);\n return headers;\n });\n}\nfunction createErrorExitingFetch(fetchFn = fetch) {\n return function errorExitingFetch(input, init) {\n return fetchFn(input, init).catch(handleFetchError);\n };\n}\nfunction handleFetchError(e) {\n if (!(e instanceof PalantirApiError)) {\n throw new ExitProcessError(1, \"Unexpected fetch error\");\n }\n let tip;\n if (e.statusCode === 401) {\n tip = \"Check your token is valid and has not expired or been disabled\";\n } else if (e.statusCode === 403) {\n tip = \"Check your token has the required scopes for this operation\";\n } else if (e.statusCode === 404) {\n tip = \"The resource may not exist or your token may not have the required scopes to load it\";\n }\n let message;\n if (e.errorName === \"CannotDeleteDeployedVersion\") {\n message = \"The site version to delete is live and cannot be deleted\";\n tip = \"Run the `site version set` command to change the live site version\";\n } else if (e.errorName === \"InvalidVersion\") {\n message = \"The site version is invalid and must be a valid SemVer string\";\n } else if (e.errorName === \"VersionAlreadyExists\") {\n message = \"The site version already exists\";\n } else if (e.errorName === \"VersionNotFound\") {\n message = \"The site version could not be found\";\n } else {\n const {\n errorCode,\n errorName,\n errorInstanceId,\n parameters\n } = e;\n // Include extra info about the original API error in CLI error messages\n // https://www.palantir.com/docs/foundry/api/general/overview/errors/\n message = `${e.message}\\n\\n${JSON.stringify({\n errorCode,\n errorName,\n errorInstanceId,\n parameters\n }, null, 2)}`;\n }\n throw new ExitProcessError(1, message, tip, e);\n}\nfunction createRequestLoggingFetch(fetchFn = fetch) {\n return function requestLoggingFetch(input, init) {\n const requestLog = typeof input === \"string\" || input instanceof URL ? `${init?.method ?? \"GET\"}: ${input.toString().trim()}` : `${input.method ?? \"GET\"}: ${input.url.toString().trim()}`;\n consola.trace(requestLog);\n return fetchFn(input, init).then(a => {\n consola.trace(`FINISH ${requestLog}`);\n return a;\n });\n };\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const USER_AGENT = `osdk-cli/${process.env.PACKAGE_VERSION}`;","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function deployWebsite(ctx, thirdPartyAppRid, request) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website/deploy?preview=true`;\n const result = await fetch(url, {\n method: \"POST\",\n body: JSON.stringify(request),\n headers: {\n \"Content-Type\": \"application/json\"\n }\n });\n return result.json();\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ExitProcessError } from \"@osdk/cli.common\";\nimport { PalantirApiError } from \"@osdk/shared.net\";\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function getWebsite(ctx, thirdPartyAppRid) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website?preview=true`;\n try {\n const result = await fetch(url);\n return result.json();\n } catch (e) {\n // Revisit this error handling in the API\n if (e instanceof ExitProcessError && e.originalError != null && e.originalError instanceof PalantirApiError && e.originalError.errorName === \"WebsiteNotFound\") {\n return undefined;\n }\n throw e;\n }\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function listVersions(ctx, thirdPartyAppRid) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website/versions?preview=true`;\n const result = await fetch(url);\n return result.json();\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function undeployWebsite(ctx, thirdPartyAppRid) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website/undeploy?preview=true`;\n await fetch(url, {\n method: \"POST\"\n });\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function uploadVersion(ctx, thirdPartyAppRid, version, zipFile) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website/versions/upload?version=${version}&preview=true`;\n const result = await fetch(url, {\n method: \"POST\",\n body: zipFile,\n headers: {\n \"Content-Type\": \"application/octet-stream\"\n },\n duplex: \"half\" // Node hates me\n });\n return result.json();\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { createInternalClientContext } from \"./createInternalClientContext.mjs\";\nexport * as thirdPartyApplications from \"./third-party-applications/index.mjs\";","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ExitProcessError } from \"@osdk/cli.common\";\nimport { consola } from \"consola\";\nimport { promises as fsPromises } from \"node:fs\";\nimport path from \"node:path\";\nconst TOKEN_ENV_VARS = [\"FOUNDRY_TOKEN\", \"FOUNDRY_SDK_AUTH_TOKEN\"];\n\n/**\n * Loads a JWT Auth Token from an argument, a file, or environment variable returning the first found.\n * @param token The token as a string.\n * @param tokenFile The path to the token file.\n * @returns The token as a string.\n * @throws An error if no token is found.\n */\nexport async function loadToken(token, tokenFile) {\n if (token) {\n consola.debug(`Using token from --token option`);\n validate(token);\n return token;\n }\n if (tokenFile) {\n const loadedToken = await loadTokenFile(tokenFile);\n consola.debug(`Using token from --tokenFile=${loadedToken.filePath} option`);\n validate(loadedToken.token);\n return loadedToken.token;\n }\n for (const envVar of TOKEN_ENV_VARS) {\n const environmentToken = process.env[envVar];\n if (environmentToken) {\n consola.debug(`Using token from ${envVar} environment variable`);\n validate(environmentToken);\n if (envVar === \"FOUNDRY_SDK_AUTH_TOKEN\") {\n consola.warn(`Using FOUNDRY_SDK_AUTH_TOKEN environment variable is deprecated. Please use FOUNDRY_TOKEN instead.`);\n }\n return environmentToken;\n }\n }\n throw new ExitProcessError(2, `No token found.`, `You can supply a --token or --token-file option, or set the ${TOKEN_ENV_VARS[0]} environment variable`);\n}\n/**\n * Reads a JWT Auth Token from a file.\n * @param filePath The path to the token file.\n * @returns The token as a string.\n * @throws An error if the file cannot be read.\n */\nexport async function loadTokenFile(filePath) {\n let token;\n let resolvedPath;\n try {\n resolvedPath = path.resolve(filePath);\n token = await fsPromises.readFile(resolvedPath, \"utf8\");\n token = token.trim();\n } catch (error) {\n throw new ExitProcessError(2, `Unable to read token file \"${filePath}\": ${error}`);\n }\n return {\n filePath: resolvedPath,\n token\n };\n}\nexport function validate(token) {\n if (!isJWT(token)) {\n throw new ExitProcessError(2, `Token does not appear to be a JWT`);\n }\n}\nfunction isJWT(token) {\n // https://stackoverflow.com/a/65755789\n const jwtPattern = /^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]*$/;\n return jwtPattern.test(token);\n}"]}
@@ -1,4 +1,4 @@
1
- import { createClientContext } from './chunk-3H567IY3.js';
1
+ import { createClientContext } from './chunk-CDP3LF3Z.js';
2
2
  import { YargsCheckError, ExitProcessError } from './chunk-G6CPJEWR.js';
3
3
  import { invokeLoginFlow } from './chunk-WDTMUT6T.js';
4
4
  import { __commonJS, init_esm_shims, __export, __toESM } from './chunk-TIWBVCHX.js';
@@ -21125,7 +21125,7 @@ function formatTs(contents) {
21125
21125
  }
21126
21126
 
21127
21127
  // ../generator/build/esm/v2.0/generateMetadata.js
21128
- var ExpectedOsdkVersion = "2.0.9";
21128
+ var ExpectedOsdkVersion = "2.0.10";
21129
21129
  async function generateOntologyMetadataFile({
21130
21130
  fs: fs9,
21131
21131
  outDir,
@@ -22385,7 +22385,7 @@ init_esm_shims();
22385
22385
 
22386
22386
  // ../cli.cmd.typescript/build/esm/generate/handleGenerate.mjs
22387
22387
  var import_fast_deep_equal2 = __toESM(require_fast_deep_equal(), 1);
22388
- var USER_AGENT = `osdk-cli.cmd.typescript/${"0.24.9"}`;
22388
+ var USER_AGENT = `osdk-cli.cmd.typescript/${"0.24.10"}`;
22389
22389
  async function handleGenerate(args) {
22390
22390
  let success = false;
22391
22391
  if (args.ontologyPath) {
@@ -22521,7 +22521,7 @@ async function generateClientSdk(ontology, args) {
22521
22521
  }
22522
22522
  return true;
22523
22523
  }
22524
- await generateClientSdkPackage(args.packageName, args.version, args.beta ? "2.0" : "1.1", args.outDir, ontology, minimalFs, await getDependencyVersions(), "0.24.9", args.externalObjects, args.externalInterfaces);
22524
+ await generateClientSdkPackage(args.packageName, args.version, args.beta ? "2.0" : "1.1", args.outDir, ontology, minimalFs, await getDependencyVersions(), "0.24.10", args.externalObjects, args.externalInterfaces);
22525
22525
  return true;
22526
22526
  } catch (e) {
22527
22527
  consola.error("OSDK generation failed", e.message, e.stack);
@@ -22543,8 +22543,8 @@ async function getDependencyVersions() {
22543
22543
  const typescriptVersion = ourPackageJson.devDependencies.typescript;
22544
22544
  const tslibVersion = ourPackageJson.dependencies.tslib;
22545
22545
  const areTheTypesWrongVersion = ourPackageJson.dependencies["@arethetypeswrong/cli"];
22546
- const osdkClientVersion = `^${"2.0.9"}`;
22547
- const osdkApiVersion = `^${"2.0.9"}`;
22546
+ const osdkClientVersion = `^${"2.0.10"}`;
22547
+ const osdkApiVersion = `^${"2.0.10"}`;
22548
22548
  const osdkLegacyClientVersion = `^${process.env.PACKAGE_LEGACY_CLIENT_VERSION}`;
22549
22549
  return {
22550
22550
  typescriptVersion,
@@ -22590,5 +22590,5 @@ function createNormalFs() {
22590
22590
  }
22591
22591
 
22592
22592
  export { getDependencyVersions, handleGenerate, updateVersionsIfTheyExist };
22593
- //# sourceMappingURL=handleGenerate-QY5GPZ7H.js.map
22594
- //# sourceMappingURL=handleGenerate-QY5GPZ7H.js.map
22593
+ //# sourceMappingURL=handleGenerate-2ISEGQIX.js.map
22594
+ //# sourceMappingURL=handleGenerate-2ISEGQIX.js.map