@osdk/cli 0.29.0-beta.4 → 0.29.0-rc.6

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 (100) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/esm/{acorn-LDCVC6JB.js → acorn-OOLA2SYL.js} +1429 -1263
  3. package/build/esm/acorn-OOLA2SYL.js.map +1 -0
  4. package/build/esm/angular-B3DVBAJV.js +3921 -0
  5. package/build/esm/angular-B3DVBAJV.js.map +1 -0
  6. package/build/esm/{babel-N25BYA2X.js → babel-QGU36NF2.js} +4749 -4416
  7. package/build/esm/babel-QGU36NF2.js.map +1 -0
  8. package/build/esm/{chunk-QXPYZB75.js → chunk-2R54QG3I.js} +7 -6
  9. package/build/esm/chunk-2R54QG3I.js.map +1 -0
  10. package/build/esm/{chunk-LSNWUUU4.js → chunk-5WP6J4UN.js} +3 -3
  11. package/build/esm/{chunk-LSNWUUU4.js.map → chunk-5WP6J4UN.js.map} +1 -1
  12. package/build/esm/{chunk-DDJKLTGZ.js → chunk-CZNX7NAA.js} +8 -8
  13. package/build/esm/{chunk-DDJKLTGZ.js.map → chunk-CZNX7NAA.js.map} +1 -1
  14. package/build/esm/{chunk-OQOD7Q5O.js → chunk-HDRBKETK.js} +3 -3
  15. package/build/esm/{chunk-OQOD7Q5O.js.map → chunk-HDRBKETK.js.map} +1 -1
  16. package/build/esm/{chunk-KAX6KWRO.js → chunk-J2YZJA3N.js} +9 -9
  17. package/build/esm/chunk-J2YZJA3N.js.map +1 -0
  18. package/build/esm/{chunk-QM5477MW.js → chunk-QCQEOFJ7.js} +15 -10
  19. package/build/esm/chunk-QCQEOFJ7.js.map +1 -0
  20. package/build/esm/{chunk-F2MY3E4F.js → chunk-SEG3TN7G.js} +7 -7
  21. package/build/esm/{chunk-F2MY3E4F.js.map → chunk-SEG3TN7G.js.map} +1 -1
  22. package/build/esm/{chunk-LKKWDXGN.js → chunk-TGQMPTOO.js} +6 -5
  23. package/build/esm/chunk-TGQMPTOO.js.map +1 -0
  24. package/build/esm/{chunk-WLVSRC6U.js → chunk-WLPJIKJV.js} +3 -3
  25. package/build/esm/{chunk-WLVSRC6U.js.map → chunk-WLPJIKJV.js.map} +1 -1
  26. package/build/esm/estree-ATGZ6OGQ.js +6145 -0
  27. package/build/esm/estree-ATGZ6OGQ.js.map +1 -0
  28. package/build/esm/find-up-JM7QWHT3.js +4 -0
  29. package/build/esm/{find-up-3ECFX3RW.js.map → find-up-JM7QWHT3.js.map} +1 -1
  30. package/build/esm/flow-GUZBCHQS.js +27169 -0
  31. package/build/esm/flow-GUZBCHQS.js.map +1 -0
  32. package/build/esm/{glimmer-LMYVLKQJ.js → glimmer-K2WK52BN.js} +2642 -2669
  33. package/build/esm/glimmer-K2WK52BN.js.map +1 -0
  34. package/build/esm/{graphql-TIIPUP6F.js → graphql-MBGHR3ZR.js} +543 -529
  35. package/build/esm/graphql-MBGHR3ZR.js.map +1 -0
  36. package/build/esm/{handleGenerate-445OLTOF.js → handleGenerate-KOADZ5FR.js} +4633 -8532
  37. package/build/esm/handleGenerate-KOADZ5FR.js.map +1 -0
  38. package/build/esm/{html-GXELFXJW.js → html-IRNVR4MI.js} +1485 -1328
  39. package/build/esm/html-IRNVR4MI.js.map +1 -0
  40. package/build/esm/index.js +18 -18
  41. package/build/esm/index.js.map +1 -1
  42. package/build/esm/loginFlow-AGXNBVJB.js +4 -0
  43. package/build/esm/{loginFlow-Q22IZHBH.js.map → loginFlow-AGXNBVJB.js.map} +1 -1
  44. package/build/esm/markdown-N3ITOTMK.js +6697 -0
  45. package/build/esm/markdown-N3ITOTMK.js.map +1 -0
  46. package/build/esm/meriyah-LUFL36FF.js +4343 -0
  47. package/build/esm/meriyah-LUFL36FF.js.map +1 -0
  48. package/build/esm/{postcss-H2GULB5O.js → postcss-TV6UK7MR.js} +2266 -2173
  49. package/build/esm/postcss-TV6UK7MR.js.map +1 -0
  50. package/build/esm/{siteDeployCommand-ELG3HGUO.js → siteDeployCommand-4XKHQO4G.js} +11 -11
  51. package/build/esm/{siteDeployCommand-ELG3HGUO.js.map → siteDeployCommand-4XKHQO4G.js.map} +1 -1
  52. package/build/esm/typescript-KPTOIHC3.js +13078 -0
  53. package/build/esm/typescript-KPTOIHC3.js.map +1 -0
  54. package/build/esm/{versionDeleteCommand-TZ7OZMJZ.js → versionDeleteCommand-OF2PZR4F.js} +7 -7
  55. package/build/esm/{versionDeleteCommand-TZ7OZMJZ.js.map → versionDeleteCommand-OF2PZR4F.js.map} +1 -1
  56. package/build/esm/{versionDeleteCommand-WCPNWWCT.js → versionDeleteCommand-RLDPF3CC.js} +7 -7
  57. package/build/esm/{versionDeleteCommand-WCPNWWCT.js.map → versionDeleteCommand-RLDPF3CC.js.map} +1 -1
  58. package/build/esm/{versionGetCommand-Y5IZVCDV.js → versionGetCommand-VYIQ5QD4.js} +6 -6
  59. package/build/esm/{versionGetCommand-Y5IZVCDV.js.map → versionGetCommand-VYIQ5QD4.js.map} +1 -1
  60. package/build/esm/{versionInfoCommand-A6QWBVHM.js → versionInfoCommand-RBHLAHNP.js} +6 -6
  61. package/build/esm/{versionInfoCommand-A6QWBVHM.js.map → versionInfoCommand-RBHLAHNP.js.map} +1 -1
  62. package/build/esm/{versionListCommand-OUVNRPF4.js → versionListCommand-NJKWNOAQ.js} +6 -6
  63. package/build/esm/{versionListCommand-OUVNRPF4.js.map → versionListCommand-NJKWNOAQ.js.map} +1 -1
  64. package/build/esm/{versionListCommand-BIQXS35T.js → versionListCommand-R6S7EWTY.js} +6 -6
  65. package/build/esm/{versionListCommand-BIQXS35T.js.map → versionListCommand-R6S7EWTY.js.map} +1 -1
  66. package/build/esm/{versionSetCommand-IXGZF74D.js → versionSetCommand-B6ILNHRQ.js} +6 -6
  67. package/build/esm/{versionSetCommand-IXGZF74D.js.map → versionSetCommand-B6ILNHRQ.js.map} +1 -1
  68. package/build/esm/{versionUnsetCommand-T25RYSWI.js → versionUnsetCommand-M6WFHVOV.js} +7 -7
  69. package/build/esm/{versionUnsetCommand-T25RYSWI.js.map → versionUnsetCommand-M6WFHVOV.js.map} +1 -1
  70. package/build/esm/{widgetSetDeployCommand-GTUZPXWV.js → widgetSetDeployCommand-VL5GCVWG.js} +10 -10
  71. package/build/esm/{widgetSetDeployCommand-GTUZPXWV.js.map → widgetSetDeployCommand-VL5GCVWG.js.map} +1 -1
  72. package/build/esm/{yaml-KOGLWA2D.js → yaml-LD5K7H4C.js} +1294 -1270
  73. package/build/esm/yaml-LD5K7H4C.js.map +1 -0
  74. package/package.json +10 -10
  75. package/build/esm/acorn-LDCVC6JB.js.map +0 -1
  76. package/build/esm/angular-QCCX4AYW.js +0 -1981
  77. package/build/esm/angular-QCCX4AYW.js.map +0 -1
  78. package/build/esm/babel-N25BYA2X.js.map +0 -1
  79. package/build/esm/chunk-KAX6KWRO.js.map +0 -1
  80. package/build/esm/chunk-LKKWDXGN.js.map +0 -1
  81. package/build/esm/chunk-QM5477MW.js.map +0 -1
  82. package/build/esm/chunk-QXPYZB75.js.map +0 -1
  83. package/build/esm/estree-UST4NHPG.js +0 -6035
  84. package/build/esm/estree-UST4NHPG.js.map +0 -1
  85. package/build/esm/find-up-3ECFX3RW.js +0 -4
  86. package/build/esm/flow-AR2Y6E56.js +0 -26049
  87. package/build/esm/flow-AR2Y6E56.js.map +0 -1
  88. package/build/esm/glimmer-LMYVLKQJ.js.map +0 -1
  89. package/build/esm/graphql-TIIPUP6F.js.map +0 -1
  90. package/build/esm/handleGenerate-445OLTOF.js.map +0 -1
  91. package/build/esm/html-GXELFXJW.js.map +0 -1
  92. package/build/esm/loginFlow-Q22IZHBH.js +0 -4
  93. package/build/esm/markdown-F6PPZMW4.js +0 -6529
  94. package/build/esm/markdown-F6PPZMW4.js.map +0 -1
  95. package/build/esm/meriyah-BSWDAYFB.js +0 -4105
  96. package/build/esm/meriyah-BSWDAYFB.js.map +0 -1
  97. package/build/esm/postcss-H2GULB5O.js.map +0 -1
  98. package/build/esm/typescript-JCJLC54Y.js +0 -19653
  99. package/build/esm/typescript-JCJLC54Y.js.map +0 -1
  100. package/build/esm/yaml-KOGLWA2D.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { __commonJS, init_esm_shims, __toESM } from './chunk-LKKWDXGN.js';
1
+ import { __commonJS, init_esm_shims, __toESM } from './chunk-TGQMPTOO.js';
2
2
 
3
3
  // ../../node_modules/.pnpm/fetch-retry@6.0.0/node_modules/fetch-retry/index.js
4
4
  var require_fetch_retry = __commonJS({
@@ -122,11 +122,12 @@ var require_fetch_retry = __commonJS({
122
122
  // ../shared.net.errors/build/esm/PalantirApiError.js
123
123
  init_esm_shims();
124
124
  var PalantirApiError = class extends Error {
125
- constructor(message, errorName, errorCode, statusCode, errorInstanceId, parameters) {
125
+ constructor(message, errorName, errorCode, errorDescription, statusCode, errorInstanceId, parameters) {
126
126
  super(message);
127
127
  this.message = message;
128
128
  this.errorName = errorName;
129
129
  this.errorCode = errorCode;
130
+ this.errorDescription = errorDescription;
130
131
  this.statusCode = statusCode;
131
132
  this.errorInstanceId = errorInstanceId;
132
133
  this.parameters = parameters;
@@ -140,7 +141,7 @@ init_esm_shims();
140
141
  init_esm_shims();
141
142
  var UnknownError = class extends PalantirApiError {
142
143
  constructor(message, errorName, originalError, statusCode) {
143
- super(message, errorName, void 0, statusCode);
144
+ super(message, errorName, void 0, void 0, statusCode);
144
145
  this.originalError = originalError;
145
146
  }
146
147
  };
@@ -185,7 +186,7 @@ function createFetchOrThrow(fetchFn = fetch) {
185
186
  } catch (e) {
186
187
  throw unknownError(fallbackMessage, response.status, e instanceof Error ? e : void 0);
187
188
  }
188
- throw new PalantirApiError(body?.message ?? fallbackMessage, body?.errorName, body?.errorCode, response.status, body?.errorInstanceId, body?.parameters);
189
+ throw new PalantirApiError(body?.message ?? fallbackMessage, body?.errorName, body?.errorCode, body?.errorDescription, response.status, body?.errorInstanceId, body?.parameters);
189
190
  }
190
191
  return response;
191
192
  };
@@ -234,5 +235,5 @@ var TOO_MANY_REQUESTS = 429;
234
235
  init_esm_shims();
235
236
 
236
237
  export { PalantirApiError, UnknownError, createFetchHeaderMutator, createFetchOrThrow, createRetryingFetch };
237
- //# sourceMappingURL=chunk-QXPYZB75.js.map
238
- //# sourceMappingURL=chunk-QXPYZB75.js.map
238
+ //# sourceMappingURL=chunk-2R54QG3I.js.map
239
+ //# sourceMappingURL=chunk-2R54QG3I.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../node_modules/.pnpm/fetch-retry@6.0.0/node_modules/fetch-retry/index.js","../../../shared.net.errors/build/esm/PalantirApiError.js","../../../shared.net.errors/build/esm/index.js","../../../shared.net.errors/build/esm/UnknownError.js","../../../shared.net.fetch/build/esm/createFetchHeaderMutator.js","../../../shared.net.fetch/build/esm/createFetchOrThrow.js","../../../shared.net.fetch/build/esm/createRetryingFetch.js","../../../shared.net.fetch/build/esm/index.js"],"names":["fetch","fetchRetry","error"],"mappings":";;;AAAA,IAAA,mBAAA,GAAA,UAAA,CAAA;AAAA,EAAA,8EAAA,CAAA,OAAA,EAAA,MAAA,EAAA;AAAA,IAAA,cAAA,EAAA;AAEA,IAAO,MAAA,CAAA,OAAA,GAAU,SAAUA,MAAAA,EAAO,QAAU,EAAA;AAC1C,MAAA,QAAA,GAAW,YAAY,EAAC;AACxB,MAAI,IAAA,OAAOA,WAAU,UAAY,EAAA;AAC/B,QAAM,MAAA,IAAI,cAAc,0BAA0B,CAAA;AAAA;AAEpD,MAAI,IAAA,OAAO,aAAa,QAAU,EAAA;AAChC,QAAM,MAAA,IAAI,cAAc,4BAA4B,CAAA;AAAA;AAEtD,MAAA,IAAI,SAAS,OAAY,KAAA,MAAA,IAAa,CAAC,iBAAkB,CAAA,QAAA,CAAS,OAAO,CAAG,EAAA;AAC1E,QAAM,MAAA,IAAI,cAAc,oCAAoC,CAAA;AAAA;AAE9D,MAAI,IAAA,QAAA,CAAS,UAAe,KAAA,MAAA,IAAa,CAAC,iBAAA,CAAkB,QAAS,CAAA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KAAW,CAAI,GAAA,CAAA,CAAA;AAC5D,MAAA,OAAO,KAAQ,GAAA,MAAA;AAAA,KACjB;AAAA,IACA,OAAA,CAAQ,OAAS,EAAA,KAAA,EAAO,QAAU,EAAA;AAChC,MAAM,MAAA,MAAA,GAAS,UAAU,MAAU,IAAA,CAAA;AACnC,MAAO,OAAA,EAAE,UAAU,GAAO,IAAA,MAAA,GAAS,QAAQ,WAAY,CAAA,KAAK,KAAK,OAAU,GAAA,WAAA;AAAA;AAC7E,GACD,CAAA;AACH;AACA,SAAS,YAAY,CAAG,EAAA;AACtB,EAAA,IAAI,aAAa,gBAAkB,EAAA;AACjC,IAAA,IAAI,CAAE,CAAA,UAAA,KAAe,mBAAuB,IAAA,CAAA,CAAE,eAAe,iBAAmB,EAAA;AAC9E,MAAO,OAAA,KAAA;AAAA;AACT;AAEF,EAAO,OAAA,IAAA;AACT;AACA,IAAM,mBAAsB,GAAA,GAAA;AAC5B,IAAM,iBAAoB,GAAA,GAAA;;;AC3C1B,cAAA,EAAA","file":"chunk-2R54QG3I.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 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 class PalantirApiError extends Error {\n constructor(message, errorName, errorCode, errorDescription, statusCode, errorInstanceId, parameters) {\n super(message);\n this.message = message;\n this.errorName = errorName;\n this.errorCode = errorCode;\n this.errorDescription = errorDescription;\n this.statusCode = statusCode;\n this.errorInstanceId = errorInstanceId;\n this.parameters = parameters;\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 { 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 */\n\nimport { PalantirApiError } from \"./PalantirApiError.js\";\nexport class UnknownError extends PalantirApiError {\n constructor(message, errorName, originalError, statusCode) {\n super(message, errorName, undefined, undefined, statusCode);\n this.originalError = originalError;\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 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 */\n\nimport { PalantirApiError, UnknownError } from \"@osdk/shared.net.errors\";\n\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 const fallbackMessage = `Failed to fetch ${response.status} ${response.statusText}`;\n if (response.headers.get(\"Content-Type\") === \"text/plain\") {\n throw unknownError(await response.text(), response.status);\n }\n if (response.headers.get(\"Content-Type\") === \"text/html\") {\n throw unknownError(fallbackMessage, response.status, new Error(\"Received HTML error page: \" + (await response.text())));\n }\n let body;\n try {\n body = await response.json();\n } catch (e) {\n throw unknownError(fallbackMessage, response.status, e instanceof Error ? e : undefined);\n }\n throw new PalantirApiError(body?.message ?? fallbackMessage, body?.errorName, body?.errorCode, body?.errorDescription, 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 unknownError(e.message, undefined, e);\n }\n return unknownError(msgIfNotError, undefined);\n}\nfunction unknownError(message, statusCode, originalError) {\n return new UnknownError(message, undefined, originalError, statusCode);\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 { 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 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 { createFetchHeaderMutator } from \"./createFetchHeaderMutator.js\";\nexport { createFetchOrThrow } from \"./createFetchOrThrow.js\";\nexport { createRetryingFetch } from \"./createRetryingFetch.js\";"]}
@@ -1,4 +1,4 @@
1
- import { init_esm_shims } from './chunk-LKKWDXGN.js';
1
+ import { init_esm_shims } from './chunk-TGQMPTOO.js';
2
2
  import { consola } from 'consola';
3
3
  import { colorize } from 'consola/utils';
4
4
  import yargs from 'yargs';
@@ -80,5 +80,5 @@ function isValidSemver(semverString) {
80
80
  }
81
81
 
82
82
  export { ExitProcessError, YargsCheckError, getYargsBase, isValidSemver };
83
- //# sourceMappingURL=chunk-LSNWUUU4.js.map
84
- //# sourceMappingURL=chunk-LSNWUUU4.js.map
83
+ //# sourceMappingURL=chunk-5WP6J4UN.js.map
84
+ //# sourceMappingURL=chunk-5WP6J4UN.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../cli.common/build/esm/ExitProcessError.js","../../../cli.common/build/esm/YargsCheckError.js","../../../cli.common/build/esm/index.js","../../../cli.common/build/esm/getYargsBase.js","../../../cli.common/build/esm/yargs/logLevelMiddleware.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,CAAO,SAAW,EAAA;AAAA,IACpH,KAAO,EAAA,GAAA;AAAA,IACP,IAAM,EAAA,SAAA;AAAA,IACN,WAAa,EAAA,wBAAA;AAAA,IACb,KAAO,EAAA;AAAA,GACR,CAAA,CAAE,aAAc,EAAA,CAAE,WAAW,kBAAoB,EAAA,IAAI,CAAE,CAAA,MAAA,EAAS,CAAA,IAAA,CAAK,OAAO,GAAA,EAAK,KAAK,IAAS,KAAA;AAC9F,IAAA,IAAI,eAAe,gBAAkB,EAAA;AACnC,MAAAA,OAAAA,CAAQ,KAAM,CAAA,GAAA,CAAI,OAAO,CAAA;AACzB,MAAI,IAAA,GAAA,CAAI,OAAO,IAAM,EAAA;AACnB,QAAAA,OAAAA,CAAQ,IAAI,QAAS,CAAA,MAAA,EAAQ,kBAAW,GAAI,CAAA,GAAG,EAAE,CAAC,CAAA;AAClD,QAAAA,OAAAA,CAAQ,IAAI,EAAE,CAAA;AAAA;AAEhB,MAAAA,OAAAA,CAAQ,KAAM,CAAA,GAAA,CAAI,KAAK,CAAA;AAAA,KAClB,MAAA;AACL,MAAI,IAAA,GAAA,IAAO,EAAE,GAAA,YAAe,eAAkB,CAAA,EAAA;AAC5C,QAAM,MAAA,GAAA;AAAA,OACD,MAAA;AACL,QAAA,IAAA,CAAK,QAAS,EAAA;AACd,QAAAA,OAAAA,CAAQ,IAAI,EAAE,CAAA;AACd,QAAAA,OAAAA,CAAQ,MAAM,GAAG,CAAA;AAAA;AACnB;AAEF,IAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAAA,GACf,CAAA;AACH;;;AEhDA,cAAA,EAAA;AAiBO,SAAS,cAAc,YAAc,EAAA;AAC1C,EAAO,OAAA,KAAA,CAAM,YAAY,CAAK,IAAA,IAAA;AAChC","file":"chunk-LSNWUUU4.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 class ExitProcessError extends Error {\n constructor(errorCode, msg, tip, originalError) {\n super(msg);\n this.errorCode = errorCode;\n this.msg = msg;\n this.tip = tip;\n this.originalError = originalError;\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 class YargsCheckError extends Error {\n constructor(msg) {\n super(msg);\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 { ExitProcessError } from \"./ExitProcessError.js\";\nexport { getYargsBase } from \"./getYargsBase.js\";\nexport { isValidSemver } from \"./util/isValidSemver.js\";\nexport { YargsCheckError } from \"./YargsCheckError.js\";","/*\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 { consola } from \"consola\";\nimport { colorize } from \"consola/utils\";\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport { ExitProcessError } from \"./ExitProcessError.js\";\nimport { logLevelMiddleware } from \"./yargs/logLevelMiddleware.js\";\nimport { YargsCheckError } from \"./YargsCheckError.js\";\nexport function getYargsBase(args) {\n return yargs(hideBin(args)).wrap(Math.min(150, yargs().terminalWidth())).env(\"OSDK\").version(false).option(\"verbose\", {\n alias: \"v\",\n type: \"boolean\",\n description: \"Enable verbose logging\",\n count: true\n }).demandCommand().middleware(logLevelMiddleware, true).strict().fail(async (msg, err, argv) => {\n if (err instanceof ExitProcessError) {\n consola.error(err.message);\n if (err.tip != null) {\n consola.log(colorize(\"bold\", `💡 Tip: ${err.tip}`));\n consola.log(\"\");\n }\n consola.debug(err.stack);\n } else {\n if (err && !(err instanceof YargsCheckError)) {\n throw err;\n } else {\n argv.showHelp();\n consola.log(\"\");\n consola.error(msg);\n }\n }\n process.exit(1);\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 { consola } from \"consola\";\nlet firstTime = true;\nexport async function logLevelMiddleware(args) {\n if (firstTime) {\n firstTime = false;\n consola.level = 3 + args.verbose; // so 1 -v is debug logs and -vv is trace\n if (consola.level > 3) {\n consola.debug(`Verbose logging enabled (${consola.level === 4 ? \"debug\" : \"trace\"})\\n`);\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\nimport { valid } from \"semver\";\nexport function isValidSemver(semverString) {\n return valid(semverString) != null;\n}"]}
1
+ {"version":3,"sources":["../../../cli.common/build/esm/ExitProcessError.js","../../../cli.common/build/esm/YargsCheckError.js","../../../cli.common/build/esm/index.js","../../../cli.common/build/esm/getYargsBase.js","../../../cli.common/build/esm/yargs/logLevelMiddleware.js","../../../cli.common/build/esm/util/isValidSemver.js"],"names":["consola"],"mappings":";;;;;;;;AAAA,cAAA,EAAA;AAgBa,IAAA,gBAAA,GAAN,cAA+B,KAAM,CAAA;AAAA,EAC1C,WAAY,CAAA,SAAA,EAAW,GAAK,EAAA,GAAA,EAAK,aAAe,EAAA;AAC9C,IAAA,KAAA,CAAM,GAAG,CAAA;AACT,IAAA,IAAA,CAAK,SAAY,GAAA,SAAA;AACjB,IAAA,IAAA,CAAK,GAAM,GAAA,GAAA;AACX,IAAA,IAAA,CAAK,GAAM,GAAA,GAAA;AACX,IAAA,IAAA,CAAK,aAAgB,GAAA,aAAA;AAAA;AAEzB;;;ACxBA,cAAA,EAAA;AAgBa,IAAA,eAAA,GAAN,cAA8B,KAAM,CAAA;AAAA,EACzC,YAAY,GAAK,EAAA;AACf,IAAA,KAAA,CAAM,GAAG,CAAA;AAAA;AAEb;;;ACpBA,cAAA,EAAA;;;ACAA,cAAA,EAAA;;;ACAA,cAAA,EAAA;AAiBA,IAAI,SAAY,GAAA,IAAA;AAChB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KAClB,MAAA;AACL,MAAI,IAAA,GAAA,IAAO,EAAE,GAAA,YAAe,eAAkB,CAAA,EAAA;AAC5C,QAAM,MAAA,GAAA;AAAA,OACD,MAAA;AACL,QAAA,IAAA,CAAK,QAAS,EAAA;AACd,QAAAA,OAAAA,CAAQ,IAAI,EAAE,CAAA;AACd,QAAAA,OAAAA,CAAQ,MAAM,GAAG,CAAA;AAAA;AACnB;AAEF,IAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAAA,GACf,CAAA;AACH;;;AEhDA,cAAA,EAAA;AAiBO,SAAS,cAAc,YAAc,EAAA;AAC1C,EAAO,OAAA,KAAA,CAAM,YAAY,CAAK,IAAA,IAAA;AAChC","file":"chunk-5WP6J4UN.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 class ExitProcessError extends Error {\n constructor(errorCode, msg, tip, originalError) {\n super(msg);\n this.errorCode = errorCode;\n this.msg = msg;\n this.tip = tip;\n this.originalError = originalError;\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 class YargsCheckError extends Error {\n constructor(msg) {\n super(msg);\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 { ExitProcessError } from \"./ExitProcessError.js\";\nexport { getYargsBase } from \"./getYargsBase.js\";\nexport { isValidSemver } from \"./util/isValidSemver.js\";\nexport { YargsCheckError } from \"./YargsCheckError.js\";","/*\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 { consola } from \"consola\";\nimport { colorize } from \"consola/utils\";\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport { ExitProcessError } from \"./ExitProcessError.js\";\nimport { logLevelMiddleware } from \"./yargs/logLevelMiddleware.js\";\nimport { YargsCheckError } from \"./YargsCheckError.js\";\nexport function getYargsBase(args) {\n return yargs(hideBin(args)).wrap(Math.min(150, yargs().terminalWidth())).env(\"OSDK\").version(false).option(\"verbose\", {\n alias: \"v\",\n type: \"boolean\",\n description: \"Enable verbose logging\",\n count: true\n }).demandCommand().middleware(logLevelMiddleware, true).strict().fail(async (msg, err, argv) => {\n if (err instanceof ExitProcessError) {\n consola.error(err.message);\n if (err.tip != null) {\n consola.log(colorize(\"bold\", `💡 Tip: ${err.tip}`));\n consola.log(\"\");\n }\n consola.debug(err.stack);\n } else {\n if (err && !(err instanceof YargsCheckError)) {\n throw err;\n } else {\n argv.showHelp();\n consola.log(\"\");\n consola.error(msg);\n }\n }\n process.exit(1);\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 { consola } from \"consola\";\nlet firstTime = true;\nexport async function logLevelMiddleware(args) {\n if (firstTime) {\n firstTime = false;\n consola.level = 3 + args.verbose; // so 1 -v is debug logs and -vv is trace\n if (consola.level > 3) {\n consola.debug(`Verbose logging enabled (${consola.level === 4 ? \"debug\" : \"trace\"})\\n`);\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\nimport { valid } from \"semver\";\nexport function isValidSemver(semverString) {\n return valid(semverString) != null;\n}"]}
@@ -1,10 +1,10 @@
1
- import { init_esm_shims } from './chunk-LKKWDXGN.js';
1
+ import { init_esm_shims } from './chunk-TGQMPTOO.js';
2
2
  import consola from 'consola';
3
- import { getRandomValues, subtle } from 'node:crypto';
4
- import { createServer } from 'node:http';
5
- import { join } from 'node:path/posix';
6
- import { exit } from 'node:process';
7
- import { parse } from 'node:url';
3
+ import { getRandomValues, subtle } from 'crypto';
4
+ import { createServer } from 'http';
5
+ import { join } from 'path/posix';
6
+ import { exit } from 'process';
7
+ import { parse } from 'url';
8
8
  import open from 'open';
9
9
 
10
10
  // ../cli.common/build/esm/public/loginFlow.js
@@ -123,5 +123,5 @@ async function getTokenWithCodeVerifier(clientId, redirectUrl, code, baseUrl, co
123
123
  }
124
124
 
125
125
  export { invokeLoginFlow };
126
- //# sourceMappingURL=chunk-DDJKLTGZ.js.map
127
- //# sourceMappingURL=chunk-DDJKLTGZ.js.map
126
+ //# sourceMappingURL=chunk-CZNX7NAA.js.map
127
+ //# sourceMappingURL=chunk-CZNX7NAA.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../cli.common/build/esm/public/loginFlow.js","../../../cli.common/build/esm/commands/auth/login/loginFlow.js","../../../cli.common/build/esm/commands/auth/login/token.js"],"names":[],"mappings":";;;;;;;;;;AAAA,cAAA,EAAA;;;ACAA,cAAA,EAAA;;;ACAA,cAAA,EAAA;AAgBO,SAAS,qBAAqB,QAAU,EAAA;AAC7C,EAAA,OAAO,SAAS,KAAS,IAAA,IAAA;AAC3B;;;ADMA,IAAM,yBAAyB,EAAK,GAAA,GAAA;AACpC,eAAsB,gBAAgB,IAAM,EAAA;AAC1C,EAAA,OAAA,CAAQ,KAAM,CAAA,CAAA,qCAAA,EAAwC,IAAK,CAAA,QAAQ,CAAE,CAAA,CAAA;AACrE,EAAA,MAAM,WAAc,GAAA,qCAAA;AACpB,EAAM,MAAA,IAAA,GAAO,KAAM,CAAA,WAAW,CAAE,CAAA,IAAA;AAChC,EAAI,IAAA,OAAA;AACJ,EAAM,MAAA,QAAA,GAAW,IAAI,OAAA,CAAQ,CAAQ,IAAA,KAAA;AACnC,IAAU,OAAA,GAAA,IAAA;AAAA,GACX,CAAA;AACD,EAAA,MAAM,MAAS,GAAA,YAAA,CAAa,CAAC,GAAA,EAAK,GAAQ,KAAA;AACxC,IAAA,MAAM,KAAQ,GAAA,KAAA,C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QAAQ,IAAI,CAAA;AACxB,EAAK,IAAA,CAAA,MAAA,CAAO,gBAAgB,WAAW,CAAA;AACvC,EAAK,IAAA,CAAA,MAAA,CAAO,iBAAiB,YAAY,CAAA;AACzC,EAAM,MAAA,QAAA,GAAW,KAAK,OAAS,EAAA,WAAA,EAAa,OAAO,QAAU,EAAA,OAAO,CAAI,GAAA,CAAA,OAAA,EAAU,YAAY,CAAA,CAAA;AAC9F,EAAI,IAAA;AACF,IAAM,MAAA,QAAA,GAAW,MAAM,KAAA,CAAM,QAAU,EAAA;AAAA,MACrC,IAAA,EAAM,KAAK,QAAS,EAAA;AAAA,MACpB,OAAS,EAAA;AAAA,QACP,cAAgB,EAAA;AAAA,OAClB;AAAA,MACA,MAAQ,EAAA;AAAA,KACT,CAAA;AACD,IAAM,MAAA,YAAA,GAAe,MAAM,QAAA,CAAS,IAAK,EAAA;AACzC,IAAO,OAAA,YAAA;AAAA,WACA,CAAG,EAAA;AACV,IAAM,MAAA,IAAI,KAAM,CAAA,CAAA,qBAAA,EAAwB,CAAG,EAAA,KAAA,EAAO,QAAS,EAAA,IAAK,CAAG,EAAA,QAAA,EAAc,IAAA,eAAe,CAAE,CAAA,CAAA;AAAA;AAEtG","file":"chunk-DDJKLTGZ.js","sourcesContent":["/*\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 { invokeLoginFlow as default } from \"../commands/auth/login/loginFlow.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 */\n\nimport consola from \"consola\";\nimport { getRandomValues, subtle } from \"node:crypto\";\nimport { createServer } from \"node:http\";\nimport { join } from \"node:path/posix\";\nimport { exit } from \"node:process\";\nimport { parse } from \"node:url\";\nimport open from \"open\";\nimport { isTokenErrorResponse } from \"./token.js\";\nconst BROWSER_PROMPT_TIME_MS = 60 * 1000;\nexport async function invokeLoginFlow(args) {\n consola.start(`Authenticating using application id: ${args.clientId}`);\n const redirectUrl = \"http://localhost:8080/auth/callback\";\n const port = parse(redirectUrl).port;\n let resolve;\n const authCode = new Promise(_res => {\n resolve = _res;\n });\n const server = createServer((req, res) => {\n const query = parse(req.url, true).query;\n res.end(\"Authenticated\");\n resolve(query[\"code\"]);\n });\n server.on(\"error\", e => {\n if (e.code === \"EADDRINUSE\") {\n consola.error(`Port ${port} is already in use, unable to perform authentication flow.`);\n server.close();\n exit(1);\n }\n });\n server.listen(port);\n const clientId = args.clientId;\n const state = generateRandomString();\n const codeVerifier = generateRandomString();\n const codeChallenge = await generateCodeChallenge(codeVerifier);\n const authorizeUrl = generateAuthorizeUrl(args.foundryUrl, clientId, state, redirectUrl, codeChallenge);\n try {\n await open(authorizeUrl);\n } catch {\n consola.warn(`Unable to open browser, please open this url in your browser to to authenticate: ${authorizeUrl}`);\n }\n\n // nag the user if we didn't get an auth token for a relatively long time\n const browserPrompt = setTimeout(() => {\n consola.warn(`Still waiting for the authentication to complete. Please open a browser to ${authorizeUrl}`);\n }, BROWSER_PROMPT_TIME_MS);\n const code = await authCode;\n server.close();\n clearTimeout(browserPrompt);\n const token = await getTokenWithCodeVerifier(clientId, redirectUrl, code, args.foundryUrl, codeVerifier);\n if (isTokenErrorResponse(token)) {\n consola.error(\"Unable to authenticate\", token.error, token.error_description);\n exit(1);\n }\n consola.success(`Successfully authenticated!`);\n return token;\n}\nfunction generateRandomString(length = 128) {\n const characters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~\";\n const output = [];\n const array = new Uint8Array(1);\n const maxIndex = 256 - 256 % characters.length;\n while (output.length < length) {\n getRandomValues(array);\n if (array[0] < maxIndex) {\n output.push(characters[array[0] % characters.length]);\n }\n }\n return output.join(\"\");\n}\nasync function generateCodeChallenge(codeVerifier) {\n const data = new TextEncoder().encode(codeVerifier);\n const digest = await subtle.digest(\"SHA-256\", data);\n const codeChallenge = btoa(String.fromCharCode(...new Uint8Array(digest))).replace(/\\//g, \"_\").replace(/\\+/g, \"-\").replace(/=/g, \"\");\n return {\n codeChallenge,\n codeChallengeMethod: \"S256\"\n };\n}\nfunction generateAuthorizeUrl(baseUrl, clientId, state, redirectUrl, codeChallenge) {\n const queryParams = new URLSearchParams();\n queryParams.append(\"client_id\", clientId);\n queryParams.append(\"response_type\", \"code\");\n queryParams.append(\"state\", state);\n queryParams.append(\"redirect_uri\", redirectUrl);\n queryParams.append(\"code_challenge\", codeChallenge.codeChallenge);\n queryParams.append(\"code_challenge_method\", codeChallenge.codeChallengeMethod);\n queryParams.append(\"scope\", [\"offline_access\", \"api:read-data\", \"api:use-ontologies-read\"].join(\" \"));\n return join(baseUrl, \"multipass\", \"api\", \"oauth2\", \"authorize\") + `?` + queryParams.toString();\n}\nasync function getTokenWithCodeVerifier(clientId, redirectUrl, code, baseUrl, codeVerifier) {\n const body = new URLSearchParams();\n body.append(\"client_id\", clientId);\n body.append(\"grant_type\", \"authorization_code\");\n body.append(\"code\", code);\n body.append(\"redirect_uri\", redirectUrl);\n body.append(\"code_verifier\", codeVerifier);\n const tokenUrl = join(baseUrl, \"multipass\", \"api\", \"oauth2\", \"token\") + `?state=${codeVerifier}`;\n try {\n const response = await fetch(tokenUrl, {\n body: body.toString(),\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\"\n },\n method: \"POST\"\n });\n const responseText = await response.json();\n return responseText;\n } catch (e) {\n throw new Error(`Failed to get token: ${e?.cause?.toString() ?? e?.toString() ?? \"Unknown error\"}`);\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 function isTokenErrorResponse(response) {\n return response.error != null;\n}"]}
1
+ {"version":3,"sources":["../../../cli.common/build/esm/public/loginFlow.js","../../../cli.common/build/esm/commands/auth/login/loginFlow.js","../../../cli.common/build/esm/commands/auth/login/token.js"],"names":[],"mappings":";;;;;;;;;;AAAA,cAAA,EAAA;;;ACAA,cAAA,EAAA;;;ACAA,cAAA,EAAA;AAgBO,SAAS,qBAAqB,QAAU,EAAA;AAC7C,EAAA,OAAO,SAAS,KAAS,IAAA,IAAA;AAC3B;;;ADMA,IAAM,yBAAyB,EAAK,GAAA,GAAA;AACpC,eAAsB,gBAAgB,IAAM,EAAA;AAC1C,EAAA,OAAA,CAAQ,KAAM,CAAA,CAAA,qCAAA,EAAwC,IAAK,CAAA,QAAQ,CAAE,CAAA,CAAA;AACrE,EAAA,MAAM,WAAc,GAAA,qCAAA;AACpB,EAAM,MAAA,IAAA,GAAO,KAAM,CAAA,WAAW,CAAE,CAAA,IAAA;AAChC,EAAI,IAAA,OAAA;AACJ,EAAM,MAAA,QAAA,GAAW,IAAI,OAAA,CAAQ,CAAQ,IAAA,KAAA;AACnC,IAAU,OAAA,GAAA,IAAA;AAAA,GACX,CAAA;AACD,EAAA,MAAM,MAAS,G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AAK,IAAA,CAAA,MAAA,CAAO,cAAc,oBAAoB,CAAA;AAC9C,EAAK,IAAA,CAAA,MAAA,CAAO,QAAQ,IAAI,CAAA;AACxB,EAAK,IAAA,CAAA,MAAA,CAAO,gBAAgB,WAAW,CAAA;AACvC,EAAK,IAAA,CAAA,MAAA,CAAO,iBAAiB,YAAY,CAAA;AACzC,EAAM,MAAA,QAAA,GAAW,KAAK,OAAS,EAAA,WAAA,EAAa,OAAO,QAAU,EAAA,OAAO,CAAI,GAAA,CAAA,OAAA,EAAU,YAAY,CAAA,CAAA;AAC9F,EAAI,IAAA;AACF,IAAM,MAAA,QAAA,GAAW,MAAM,KAAA,CAAM,QAAU,EAAA;AAAA,MACrC,IAAA,EAAM,KAAK,QAAS,EAAA;AAAA,MACpB,OAAS,EAAA;AAAA,QACP,cAAgB,EAAA;AAAA,OAClB;AAAA,MACA,MAAQ,EAAA;AAAA,KACT,CAAA;AACD,IAAM,MAAA,YAAA,GAAe,MAAM,QAAA,CAAS,IAAK,EAAA;AACzC,IAAO,OAAA,YAAA;AAAA,WACA,CAAG,EAAA;AACV,IAAM,MAAA,IAAI,KAAM,CAAA,CAAA,qBAAA,EAAwB,CAAG,EAAA,KAAA,EAAO,QAAS,EAAA,IAAK,CAAG,EAAA,QAAA,EAAc,IAAA,eAAe,CAAE,CAAA,CAAA;AAAA;AAEtG","file":"chunk-CZNX7NAA.js","sourcesContent":["/*\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 { invokeLoginFlow as default } from \"../commands/auth/login/loginFlow.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 */\n\nimport consola from \"consola\";\nimport { getRandomValues, subtle } from \"node:crypto\";\nimport { createServer } from \"node:http\";\nimport { join } from \"node:path/posix\";\nimport { exit } from \"node:process\";\nimport { parse } from \"node:url\";\nimport open from \"open\";\nimport { isTokenErrorResponse } from \"./token.js\";\nconst BROWSER_PROMPT_TIME_MS = 60 * 1000;\nexport async function invokeLoginFlow(args) {\n consola.start(`Authenticating using application id: ${args.clientId}`);\n const redirectUrl = \"http://localhost:8080/auth/callback\";\n const port = parse(redirectUrl).port;\n let resolve;\n const authCode = new Promise(_res => {\n resolve = _res;\n });\n const server = createServer((req, res) => {\n const query = parse(req.url, true).query;\n res.end(\"Authenticated\");\n resolve(query[\"code\"]);\n });\n server.on(\"error\", e => {\n if (e.code === \"EADDRINUSE\") {\n consola.error(`Port ${port} is already in use, unable to perform authentication flow.`);\n server.close();\n exit(1);\n }\n });\n server.listen(port);\n const clientId = args.clientId;\n const state = generateRandomString();\n const codeVerifier = generateRandomString();\n const codeChallenge = await generateCodeChallenge(codeVerifier);\n const authorizeUrl = generateAuthorizeUrl(args.foundryUrl, clientId, state, redirectUrl, codeChallenge);\n try {\n await open(authorizeUrl);\n } catch {\n consola.warn(`Unable to open browser, please open this url in your browser to to authenticate: ${authorizeUrl}`);\n }\n\n // nag the user if we didn't get an auth token for a relatively long time\n const browserPrompt = setTimeout(() => {\n consola.warn(`Still waiting for the authentication to complete. Please open a browser to ${authorizeUrl}`);\n }, BROWSER_PROMPT_TIME_MS);\n const code = await authCode;\n server.close();\n clearTimeout(browserPrompt);\n const token = await getTokenWithCodeVerifier(clientId, redirectUrl, code, args.foundryUrl, codeVerifier);\n if (isTokenErrorResponse(token)) {\n consola.error(\"Unable to authenticate\", token.error, token.error_description);\n exit(1);\n }\n consola.success(`Successfully authenticated!`);\n return token;\n}\nfunction generateRandomString(length = 128) {\n const characters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~\";\n const output = [];\n const array = new Uint8Array(1);\n const maxIndex = 256 - 256 % characters.length;\n while (output.length < length) {\n getRandomValues(array);\n if (array[0] < maxIndex) {\n output.push(characters[array[0] % characters.length]);\n }\n }\n return output.join(\"\");\n}\nasync function generateCodeChallenge(codeVerifier) {\n const data = new TextEncoder().encode(codeVerifier);\n const digest = await subtle.digest(\"SHA-256\", data);\n const codeChallenge = btoa(String.fromCharCode(...new Uint8Array(digest))).replace(/\\//g, \"_\").replace(/\\+/g, \"-\").replace(/=/g, \"\");\n return {\n codeChallenge,\n codeChallengeMethod: \"S256\"\n };\n}\nfunction generateAuthorizeUrl(baseUrl, clientId, state, redirectUrl, codeChallenge) {\n const queryParams = new URLSearchParams();\n queryParams.append(\"client_id\", clientId);\n queryParams.append(\"response_type\", \"code\");\n queryParams.append(\"state\", state);\n queryParams.append(\"redirect_uri\", redirectUrl);\n queryParams.append(\"code_challenge\", codeChallenge.codeChallenge);\n queryParams.append(\"code_challenge_method\", codeChallenge.codeChallengeMethod);\n queryParams.append(\"scope\", [\"offline_access\", \"api:read-data\", \"api:use-ontologies-read\"].join(\" \"));\n return join(baseUrl, \"multipass\", \"api\", \"oauth2\", \"authorize\") + `?` + queryParams.toString();\n}\nasync function getTokenWithCodeVerifier(clientId, redirectUrl, code, baseUrl, codeVerifier) {\n const body = new URLSearchParams();\n body.append(\"client_id\", clientId);\n body.append(\"grant_type\", \"authorization_code\");\n body.append(\"code\", code);\n body.append(\"redirect_uri\", redirectUrl);\n body.append(\"code_verifier\", codeVerifier);\n const tokenUrl = join(baseUrl, \"multipass\", \"api\", \"oauth2\", \"token\") + `?state=${codeVerifier}`;\n try {\n const response = await fetch(tokenUrl, {\n body: body.toString(),\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\"\n },\n method: \"POST\"\n });\n const responseText = await response.json();\n return responseText;\n } catch (e) {\n throw new Error(`Failed to get token: ${e?.cause?.toString() ?? e?.toString() ?? \"Unknown error\"}`);\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 function isTokenErrorResponse(response) {\n return response.error != null;\n}"]}
@@ -1,4 +1,4 @@
1
- import { init_esm_shims } from './chunk-LKKWDXGN.js';
1
+ import { init_esm_shims } from './chunk-TGQMPTOO.js';
2
2
 
3
3
  // ../widget.api/build/esm/manifest.js
4
4
  init_esm_shims();
@@ -21,5 +21,5 @@ var HostMessage;
21
21
  init_esm_shims();
22
22
 
23
23
  export { MANIFEST_FILE_LOCATION };
24
- //# sourceMappingURL=chunk-OQOD7Q5O.js.map
25
- //# sourceMappingURL=chunk-OQOD7Q5O.js.map
24
+ //# sourceMappingURL=chunk-HDRBKETK.js.map
25
+ //# sourceMappingURL=chunk-HDRBKETK.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../widget.api/build/esm/manifest.js","../../../widget.api/build/esm/index.js","../../../widget.api/build/esm/config.js","../../../widget.api/build/esm/messages/hostMessages.js","../../../widget.api/build/esm/messages/widgetMessages.js"],"names":[],"mappings":";;;AAAA,cAAA,EAAA;AAgBO,IAAM,sBAAyB,GAAA;;;AChBtC,cAAA,EAAA;;;ACAA,cAAA,EAAA;;;ACAA,cAAA,EAAA;AAgBO,IAAI,WAAA;AAAA,CACV,SAAU,YAAc,EAAA;AACvB,EAAA,YAAA,CAAa,OAAU,GAAA,OAAA;AACzB,CAAG,EAAA,WAAA,KAAgB,WAAc,GAAA,EAAG,CAAA,CAAA;;;ACnBpC,cAAA,EAAA","file":"chunk-OQOD7Q5O.js","sourcesContent":["/*\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 const MANIFEST_FILE_LOCATION = \".palantir/widgets.config.json\";","/*\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 { defineConfig } from \"./config.js\";\nexport { MANIFEST_FILE_LOCATION } from \"./manifest.js\";\nexport { HostMessage, isHostParametersUpdatedMessage, visitHostMessage } from \"./messages/hostMessages.js\";\nexport { isWidgetEmitEventMessage, isWidgetReadyMessage, visitWidgetMessage } from \"./messages/widgetMessages.js\";","/*\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\n/**\n * Extracts the parameter ID strings as types from the given ParameterConfig.\n */\n\n/**\n * Extracts a map of parameter IDs to their async-wrapped value types from the given ParameterConfig.\n */\n\n/**\n * Extracts a map of parameter IDs to the raw parameter values from the given ParameterConfig.\n */\n\n/**\n * Extracts a list of strongly-typed parameter IDs from the given WidgetConfig for a given event ID.\n * If a parameter ID is referenced by an event but does not exist, its type will be never\n */\n\n/**\n * Extracts a map of event IDs to their raw parameter value types from the given WidgetConfig.\n */\n\nexport function defineConfig(c) {\n return c;\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// Interfaces and type guards for messages passed from the host Foundry UI to the widget\nexport let HostMessage;\n(function (_HostMessage) {\n _HostMessage.Version = \"1.0.0\";\n})(HostMessage || (HostMessage = {}));\nexport function isHostParametersUpdatedMessage(event) {\n return event.type === \"host.update-parameters\";\n}\n/**\n * Strongly typed visitor to handle every type of host message\n */\nexport function visitHostMessage(message, visitor) {\n const {\n type,\n payload\n } = message;\n const handler = visitor[type];\n if (handler) {\n // Typescript creates an & of the parameters instead of a union\n handler(payload);\n } else {\n visitor._unknown(type);\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// Interfaces and type guards for messages passed from the widget to the host Foundry UI\nexport let WidgetMessage;\nexport function isWidgetReadyMessage(event) {\n return event.type === \"widget.ready\";\n}\nexport function isWidgetEmitEventMessage(event) {\n return event.type === \"widget.emit-event\";\n}\nexport function visitWidgetMessage(message, visitor) {\n const {\n type,\n payload\n } = message;\n const handler = visitor[type];\n if (handler) {\n // Typescript creates an & of the parameters instead of a union\n handler(payload);\n } else {\n visitor._unknown(type);\n }\n}"]}
1
+ {"version":3,"sources":["../../../widget.api/build/esm/manifest.js","../../../widget.api/build/esm/index.js","../../../widget.api/build/esm/config.js","../../../widget.api/build/esm/messages/hostMessages.js","../../../widget.api/build/esm/messages/widgetMessages.js"],"names":[],"mappings":";;;AAAA,cAAA,EAAA;AAgBO,IAAM,sBAAyB,GAAA;;;AChBtC,cAAA,EAAA;;;ACAA,cAAA,EAAA;;;ACAA,cAAA,EAAA;AAgBO,IAAI,WAAA;AAAA,CACV,SAAU,YAAc,EAAA;AACvB,EAAA,YAAA,CAAa,OAAU,GAAA,OAAA;AACzB,CAAG,EAAA,WAAA,KAAgB,WAAc,GAAA,EAAG,CAAA,CAAA;;;ACnBpC,cAAA,EAAA","file":"chunk-HDRBKETK.js","sourcesContent":["/*\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 const MANIFEST_FILE_LOCATION = \".palantir/widgets.config.json\";","/*\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 { defineConfig } from \"./config.js\";\nexport { MANIFEST_FILE_LOCATION } from \"./manifest.js\";\nexport { HostMessage, isHostParametersUpdatedMessage, visitHostMessage } from \"./messages/hostMessages.js\";\nexport { isWidgetEmitEventMessage, isWidgetReadyMessage, visitWidgetMessage } from \"./messages/widgetMessages.js\";","/*\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\n/**\n * Extracts the parameter ID strings as types from the given ParameterConfig.\n */\n\n/**\n * Extracts a map of parameter IDs to their async-wrapped value types from the given ParameterConfig.\n */\n\n/**\n * Extracts a map of parameter IDs to the raw parameter values from the given ParameterConfig.\n */\n\n/**\n * Extracts a list of strongly-typed parameter IDs from the given WidgetConfig for a given event ID.\n * If a parameter ID is referenced by an event but does not exist, its type will be never\n */\n\n/**\n * Extracts a map of event IDs to their raw parameter value types from the given WidgetConfig.\n */\n\nexport function defineConfig(c) {\n return c;\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// Interfaces and type guards for messages passed from the host Foundry UI to the widget\nexport let HostMessage;\n(function (_HostMessage) {\n _HostMessage.Version = \"1.0.0\";\n})(HostMessage || (HostMessage = {}));\nexport function isHostParametersUpdatedMessage(event) {\n return event.type === \"host.update-parameters\";\n}\n/**\n * Strongly typed visitor to handle every type of host message\n */\nexport function visitHostMessage(message, visitor) {\n const {\n type,\n payload\n } = message;\n const handler = visitor[type];\n if (handler) {\n // Typescript creates an & of the parameters instead of a union\n handler(payload);\n } else {\n visitor._unknown(type);\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// Interfaces and type guards for messages passed from the widget to the host Foundry UI\nexport let WidgetMessage;\nexport function isWidgetReadyMessage(event) {\n return event.type === \"widget.ready\";\n}\nexport function isWidgetEmitEventMessage(event) {\n return event.type === \"widget.emit-event\";\n}\nexport function visitWidgetMessage(message, visitor) {\n const {\n type,\n payload\n } = message;\n const handler = visitor[type];\n if (handler) {\n // Typescript creates an & of the parameters instead of a union\n handler(payload);\n } else {\n visitor._unknown(type);\n }\n}"]}
@@ -1,11 +1,11 @@
1
- import { PalantirApiError, createFetchHeaderMutator, createFetchOrThrow, UnknownError } from './chunk-QXPYZB75.js';
2
- import { ExitProcessError } from './chunk-LSNWUUU4.js';
3
- import { init_esm_shims, __export } from './chunk-LKKWDXGN.js';
1
+ import { PalantirApiError, createFetchHeaderMutator, createFetchOrThrow, UnknownError } from './chunk-2R54QG3I.js';
2
+ import { ExitProcessError } from './chunk-5WP6J4UN.js';
3
+ import { init_esm_shims, __export } from './chunk-TGQMPTOO.js';
4
4
  import { consola } from 'consola';
5
- import { inspect } from 'node:util';
5
+ import { inspect } from 'util';
6
6
  import prettyBytes from 'pretty-bytes';
7
- import { promises } from 'node:fs';
8
- import path from 'node:path';
7
+ import { promises } from 'fs';
8
+ import path from 'path';
9
9
 
10
10
  // src/net/createInternalClientContext.mts
11
11
  init_esm_shims();
@@ -37,7 +37,7 @@ init_esm_shims();
37
37
 
38
38
  // src/net/UserAgent.ts
39
39
  init_esm_shims();
40
- var USER_AGENT = `osdk-cli/${"0.29.0-beta.4"}`;
40
+ var USER_AGENT = `osdk-cli/${"0.29.0-rc.6"}`;
41
41
 
42
42
  // src/net/createFetch.mts
43
43
  function createFetch(tokenProvider, fetchFn = fetch) {
@@ -346,5 +346,5 @@ function isJWT(token) {
346
346
  }
347
347
 
348
348
  export { createInternalClientContext, loadToken, third_party_applications_exports, widget_registry_exports };
349
- //# sourceMappingURL=chunk-KAX6KWRO.js.map
350
- //# sourceMappingURL=chunk-KAX6KWRO.js.map
349
+ //# sourceMappingURL=chunk-J2YZJA3N.js.map
350
+ //# sourceMappingURL=chunk-J2YZJA3N.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/uploadSnapshotVersion.mts","../../src/net/third-party-applications/uploadVersion.mts","../../src/net/widget-registry/index.mts","../../src/net/widget-registry/deleteRelease.mts","../../src/net/widget-registry/getRelease.mts","../../src/net/widget-registry/listReleases.mts","../../src/net/widget-registry/publishRelease.mts","../../src/net/index.mts","../../src/util/token.ts"],"names":["fetch","consola","fsPromises"],"mappings":";;;;;;;;;;AAAA,cAAA,EAAA;AAgBO,SAAS,2BAAA,CAA4B,YAAY,aAAe,EAAA;AACrE,EAAO,OAAA;AAAA,IACL,aAAA;AAAA,IACA;AAAA,GACF;AACF;;;ACrBA,IAAA,gCAAA,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,qBAAA,EAAA,MAAA,qBAAA;AAAA,EAAA,aAAA,EAAA,MAAA;AAAA,CAAA,CAAA;AAAA,cAAA,EAAA;;;ACAA,cAAA,EAAA;;;ACAA,cAAA,EAAA;;;ACAA,cAAA,EAAA;AAgBO,IAAM,UAAA,GAAa,YAAY,aAA2B,CAAA,CAAA;;;ADO1D,SAAS,WAAA,CAAY,aAAe,EAAA,OAAA,GAAU,KAAO,EAAA;AAC1D,EAAO,OAAA,wBAAA,CAAyB,0BAA0B,uBAAwB,CAAA,kBAAA,CAAmB,OAAO,CAAC,CAAC,CAAG,EAAA,OAAM,OAAW,KAAA;AAChI,IAAM,MAAA,KAAA,GAAQ,MAAM,aAAc,EAAA;AAClC,IAAA,OAAA,CAAQ,GAAI,CAAA,eAAA,EAAiB,CAAU,OAAA,EAAA,KAAK,CAAE,CAAA,CAAA;AAC9C,IAAQ,OAAA,CAAA,GAAA,CAAI,oBAAoB,UAAU,CAAA;AAC1C,IAAO,OAAA,OAAA;AAAA,GACR,CAAA;AACH;AACA,SAAS,uBAAA,CAAwB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AAA,QAAA,CAAS,gBAAgB,CAAA;AACzB,MAAA,IAAI,WAAW,wBAA0B,EAAA;AACvC,QAAAA,OAAAA,CAAQ,KAAK,CAAoG,kGAAA,CAAA,CAAA;AAAA;AAEnH,MAAO,OAAA,gBAAA;AAAA;AACT;AAEF,EAAM,MAAA,IAAI,iBAAiB,CAAG,EAAA,CAAA,eAAA,CAAA,EAAmB,+DAA+D,cAAe,CAAA,CAAC,CAAC,CAAuB,qBAAA,CAAA,CAAA;AAC1J;AAOA,eAAsB,cAAc,QAAU,EAAA;AAC5C,EAAI,IAAA,KAAA;AACJ,EAAI,IAAA,YAAA;AACJ,EAAI,IAAA;AACF,IAAe,YAAA,GAAA,IAAA,CAAK,QAAQ,QAAQ,CAAA;AACpC,IAAA,KAAA,GAAQ,MAAMC,QAAA,CAAW,QAAS,CAAA,YAAA,EAAc,MAAM,CAAA;AACtD,IAAA,KAAA,GAAQ,MAAM,IAAK,EAAA;AAAA,WACZ,KAAO,EAAA;AACd,IAAA,MAAM,IAAI,gBAAiB,CAAA,CAAA,EAAG,8BAA8B,QAAQ,CAAA,GAAA,EAAM,KAAK,CAAE,CAAA,CAAA;AAAA;AAEnF,EAAO,OAAA;AAAA,IACL,QAAU,EAAA,YAAA;AAAA,IACV;AAAA,GACF;AACF;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;AAAA;AAErE;AACA,SAAS,MAAM,KAAO,EAAA;AAEpB,EAAA,MAAM,UAAa,GAAA,kDAAA;AACnB,EAAO,OAAA,UAAA,CAAW,KAAK,KAAK,CAAA;AAC9B","file":"chunk-J2YZJA3N.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 { uploadSnapshotVersion } from \"./uploadSnapshotVersion.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/${encodeURIComponent(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 { PalantirApiError, UnknownError } from \"@osdk/shared.net.errors\";\nimport { createFetchHeaderMutator, createFetchOrThrow } from \"@osdk/shared.net.fetch\";\nimport { consola } from \"consola\";\nimport { inspect } from \"node:util\";\nimport prettyBytes from \"pretty-bytes\";\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 if (e.errorName === \"VersionLimitExceeded\") {\n const {\n versionLimit\n } = e.parameters ?? {};\n const versionLimitPart = versionLimit != null ? ` (Limit: ${versionLimit} versions)` : \"\";\n message = `The site contains too many versions${versionLimitPart}`;\n tip = \"Run the `site version delete` command to delete an old version and try again\";\n } else if (e.errorName === \"FileCountLimitExceeded\") {\n const {\n fileCountLimit\n } = e.parameters ?? {};\n const fileCountLimitPart = fileCountLimit != null ? ` (Limit: ${fileCountLimit} files)` : \"\";\n message = `The .zip file contains too many files${fileCountLimitPart}`;\n tip = \"Reduce the number of files in the production build to below the limit\";\n } else if (e.errorName === \"FileSizeLimitExceeded\") {\n const {\n currentFilePath,\n currentFileSizeBytes,\n fileSizeBytesLimit\n } = e.parameters ?? {};\n const currentFilePathPart = currentFilePath != null ? ` \"${currentFilePath}\"` : \"\";\n const currentFileSizePart = currentFileSizeBytes != null ? ` (${prettyBytes(parseInt(currentFileSizeBytes), {\n binary: true\n })})` : \"\";\n const fileSizeLimitPart = fileSizeBytesLimit != null ? ` (Limit: ${prettyBytes(parseInt(fileSizeBytesLimit), {\n binary: true\n })})` : \"\";\n message = `The .zip file contains a file${currentFilePathPart}${currentFileSizePart} that is too large${fileSizeLimitPart}`;\n tip = \"Ensure all files in the production build are below the size limit\";\n } else {\n if (e instanceof UnknownError) {\n // Include deep inspect of original error\n message = `${e.message}\\n\\n${inspect(e, {\n depth: 10,\n colors: true\n })}`;\n } else {\n // Include extra info about the original API error\n // https://www.palantir.com/docs/foundry/api/general/overview/errors/\n const {\n errorCode,\n errorName,\n errorInstanceId,\n parameters\n } = e;\n message = `${e.message}\\n\\n${JSON.stringify({\n errorCode,\n errorName,\n errorInstanceId,\n parameters\n }, null, 2)}`;\n }\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()}`\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-conversion\n : `${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.errors\";\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 await 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 uploadSnapshotVersion(ctx, thirdPartyAppRid, version, snapshotId, zipFile) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website/versions/uploadSnapshot?version=${encodeURIComponent(version)}&preview=true${snapshotId !== \"\" ? `&snapshotIdentifier=${encodeURIComponent(snapshotId)}` : \"\"}`;\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 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=${encodeURIComponent(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 2025 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 { deleteRelease } from \"./deleteRelease.mjs\";\nexport { getRelease } from \"./getRelease.mjs\";\nexport { listReleases } from \"./listReleases.mjs\";\nexport { publishRelease } from \"./publishRelease.mjs\";","/*\n * Copyright 2025 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 deleteRelease(ctx, widgetSetRid, releaseVersion) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/widgets/widgetSets/${widgetSetRid}/releases/${releaseVersion}?preview=true`;\n await fetch(url, {\n method: \"DELETE\"\n });\n}","/*\n * Copyright 2025 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 getRelease(ctx, widgetSetRid, releaseVersion) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/widgets/widgetSets/${widgetSetRid}/releases/${releaseVersion}?preview=true`;\n const response = await fetch(url);\n return response.json();\n}","/*\n * Copyright 2025 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 listReleases(ctx, widgetSetRid) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/widgets/widgetSets/${widgetSetRid}/releases?preview=true`;\n const response = await fetch(url);\n return response.json();\n}","/*\n * Copyright 2025 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 publishRelease(ctx, repositoryRid, repositoryVersion, zipFile) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/widgets/repositories/${repositoryRid}/publish?preview=true&repositoryVersion=${repositoryVersion}`;\n 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}","/*\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\";\nexport * as widgetRegistry from \"./widget-registry/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,13 +1,19 @@
1
- import { findUp } from './chunk-F2MY3E4F.js';
2
- import { init_esm_shims } from './chunk-LKKWDXGN.js';
3
- import { exec } from 'node:child_process';
4
- import { promises } from 'node:fs';
5
- import { promisify } from 'node:util';
1
+ import { findUp } from './chunk-SEG3TN7G.js';
2
+ import { init_esm_shims } from './chunk-TGQMPTOO.js';
3
+ import { promises } from 'fs';
6
4
  import { valid } from 'semver';
7
- import { extname } from 'node:path';
5
+ import { exec } from 'child_process';
6
+ import { promisify } from 'util';
7
+ import { extname } from 'path';
8
8
 
9
9
  // ../foundry-config-json/build/esm/autoVersion.js
10
10
  init_esm_shims();
11
+
12
+ // ../foundry-config-json/build/esm/execAsync.js
13
+ init_esm_shims();
14
+ var execAsync = promisify(exec);
15
+
16
+ // ../foundry-config-json/build/esm/autoVersion.js
11
17
  var AutoVersionError = class extends Error {
12
18
  constructor(msg, tip) {
13
19
  super(msg);
@@ -51,7 +57,6 @@ async function packageJsonAutoVersion() {
51
57
  async function gitDescribe(matchPrefix) {
52
58
  let gitVersion;
53
59
  try {
54
- const execAsync = promisify(exec);
55
60
  const {
56
61
  stdout
57
62
  } = await execAsync(`git describe --tags --first-parent --dirty${matchPrefix != null ? ` --match="${matchPrefix}*"` : ""}`, {
@@ -181,7 +186,7 @@ async function loadFoundryConfig(type) {
181
186
  const validate = ajv.compile(FOUNDRY_CONFIG_SCHEMA[type]);
182
187
  const {
183
188
  findUp: findUp2
184
- } = await import('./find-up-3ECFX3RW.js');
189
+ } = await import('./find-up-JM7QWHT3.js');
185
190
  const configFilePath = await findUp2(CONFIG_FILE_NAMES);
186
191
  if (configFilePath) {
187
192
  let foundryConfig;
@@ -212,5 +217,5 @@ function parseConfigFile(fileContent, configFilePath) {
212
217
  }
213
218
 
214
219
  export { AutoVersionError, autoVersion, loadFoundryConfig };
215
- //# sourceMappingURL=chunk-QM5477MW.js.map
216
- //# sourceMappingURL=chunk-QM5477MW.js.map
220
+ //# sourceMappingURL=chunk-QCQEOFJ7.js.map
221
+ //# sourceMappingURL=chunk-QCQEOFJ7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../foundry-config-json/build/esm/autoVersion.js","../../../foundry-config-json/build/esm/execAsync.js","../../../foundry-config-json/build/esm/index.js","../../../foundry-config-json/build/esm/config.js"],"names":["fsPromises","findUp"],"mappings":";;;;;;;;;AAAA,cAAA,EAAA;;;ACAA,cAAA,EAAA;AAkBO,IAAM,SAAA,GAAY,UAAU,IAAI,CAAA;;;ADE1B,IAAA,gBAAA,GAAN,cAA+B,KAAM,CAAA;AAAA,EAC1C,WAAA,CAAY,KAAK,GAAK,EAAA;AACpB,IAAA,KAAA,CAAM,GAAG,CAAA;AACT,IAAA,IAAA,CAAK,GAAM,GAAA,GAAA;AACX,IAAA,IAAA,CAAK,GAAM,GAAA,GAAA;AAAA;AAEf;AASA,eAAsB,YAAY,MAAQ,EAAA;AACxC,EAAA,QAAQ,OAAO,IAAM;AAAA,IACnB,KAAK,cAAA;AACH,MAAO,OAAA,sBAAA,CAAuB,OAAO,SAAS,CAAA;AAAA,IAChD,KAAK,cAAA;AACH,MAAA,OAAO,sBAAuB,EAAA;AAAA,IAChC;AACE,MAAA,MAAM,IAAI,KAAM,CAAA,CAAA,iCAAA,EAAoC,KAAK,SAAU,CAAA,MAAM,CAAC,CAAG,CAAA,CAAA,CAAA;AAAA;AAEnF;AACA,eAAe,sBAAA,CAAuB,YAAY,EAAI,EAAA;AACpD,EAAM,MAAA,CAAC,aAAa,WAAW,CAAA,GAAI,cAAc,EAAK,GAAA,CAAC,WAAW,IAAI,MAAA,CAAO,IAAI,SAAS,CAAA,CAAE,CAAC,CAAI,GAAA,CAAC,QAAW,IAAI,MAAA,CAAO,KAAK,CAAC,CAAA;AAC9H,EAAM,MAAA,UAAA,GAAa,MAAM,WAA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AAc,CAAA,SAAA,EAAY,KAAK,CAAE,CAAA,CAAA;AAAA;AAEzF,IAAI,IAAA,CAAC,QAAS,CAAA,aAAa,CAAG,EAAA;AAC5B,MAAM,MAAA,IAAI,KAAM,CAAA,CAAA,uBAAA,EAA0B,cAAc,CAAA,qCAAA,EAAwC,IAAI,UAAW,CAAA,QAAA,CAAS,MAAM,CAAC,CAAE,CAAA,CAAA;AAAA;AAEnI,IAAO,OAAA;AAAA,MACL,aAAA;AAAA,MACA;AAAA,KACF;AAAA;AAEF,EAAO,OAAA,MAAA;AACT;AACA,SAAS,eAAA,CAAgB,aAAa,cAAgB,EAAA;AACpD,EAAM,MAAA,SAAA,GAAY,QAAQ,cAAc,CAAA;AACxC,EAAA,QAAQ,SAAW;AAAA,IACjB,KAAK,OAAA;AACH,MAAO,OAAA,IAAA,CAAK,MAAM,WAAW,CAAA;AAAA,IAC/B;AACE,MAAA,MAAM,IAAI,KAAA,CAAM,CAA+B,4BAAA,EAAA,SAAS,CAAmB,iBAAA,CAAA,CAAA;AAAA;AAEjF","file":"chunk-QCQEOFJ7.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\nimport { findUp } from \"find-up\";\nimport { promises as fsPromises } from \"node:fs\";\nimport { valid } from \"semver\";\nimport { execAsync } from \"./execAsync.js\";\nexport class AutoVersionError extends Error {\n constructor(msg, tip) {\n super(msg);\n this.msg = msg;\n this.tip = tip;\n }\n}\n\n/**\n * Gets the version string using git describe. If the @param tagPrefix is empty, git describe will return the\n * latest tag (without any filtering) and if the tag starts with \"v\", it will be removed.\n * @param tagPrefix The prefix to use for matching against tags. Defaults to an empty string.\n * @returns A promise that resolves to the version string.\n * @throws An error if the version string is not SemVer compliant or if the version cannot be determined.\n */\nexport async function autoVersion(config) {\n switch (config.type) {\n case \"git-describe\":\n return gitDescribeAutoVersion(config.tagPrefix);\n case \"package-json\":\n return packageJsonAutoVersion();\n default:\n throw new Error(`Unexpected auto version config: (${JSON.stringify(config)})`);\n }\n}\nasync function gitDescribeAutoVersion(tagPrefix = \"\") {\n const [matchPrefix, prefixRegex] = tagPrefix !== \"\" ? [tagPrefix, new RegExp(`^${tagPrefix}`)] : [undefined, new RegExp(`^v?`)];\n const gitVersion = await gitDescribe(matchPrefix);\n const version = gitVersion.trim().replace(prefixRegex, \"\");\n validateVersion(version);\n return version;\n}\nasync function packageJsonAutoVersion() {\n const packageJsonPath = await findUp(\"package.json\");\n if (!packageJsonPath) {\n throw new AutoVersionError(`Couldn't find package.json file in the current working directory or its parents: ${process.cwd()}`);\n }\n let packageJson;\n try {\n const fileContent = await fsPromises.readFile(packageJsonPath, \"utf-8\");\n packageJson = JSON.parse(fileContent);\n } catch (error) {\n throw new AutoVersionError(`Couldn't read or parse package.json file ${packageJsonPath}. Error: ${error}`);\n }\n const version = packageJson.version;\n validateVersion(version);\n return version;\n}\nasync function gitDescribe(matchPrefix) {\n let gitVersion;\n try {\n const {\n stdout\n } = await execAsync(`git describe --tags --first-parent --dirty${matchPrefix != null ? ` --match=\"${matchPrefix}*\"` : \"\"}`, {\n encoding: \"utf8\"\n });\n gitVersion = stdout;\n } catch (error) {\n if (error instanceof Error) {\n const errorMessage = error.message.toLowerCase();\n if (errorMessage.includes(\"not recognized\") || errorMessage.includes(\"command not found\") || errorMessage.includes(\"no such file or directory\")) {\n throw new AutoVersionError(\"Unable to determine auto version using git-describe as git is not installed or found in the PATH.\", `You can set up git and try again or supply a --version option to set the version manually`);\n }\n if (errorMessage.includes(\"fatal: not a git repository\")) {\n throw new AutoVersionError(`Unable to determine auto version using git-describe as the current directory is not a git repository.`, `You can run the command in a git repository and try again or supply a --version option to set the version manually`);\n }\n if (errorMessage.includes(\"fatal: no names found, cannot describe anything.\")) {\n throw new AutoVersionError(`Unable to determine auto version using git-describe as no matching tags were found.`, `You can create a tag matching the configured tag prefix and try again or supply a --version option to set the version manually`);\n }\n }\n throw new AutoVersionError(`Unable to determine auto version using git-describe: ${error}.`, `You can supply a --version option to set the version manually`);\n }\n return gitVersion;\n}\nfunction validateVersion(version) {\n if (valid(version) == null) {\n throw new AutoVersionError(`The version string ${version} is not SemVer compliant.`);\n }\n}","/*\n * Copyright 2025 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 { exec } from \"node:child_process\";\nimport { promisify } from \"node:util\";\nexport const execAsync = promisify(exec);","/*\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 { autoVersion, AutoVersionError } from \"./autoVersion.js\";\nexport { loadFoundryConfig } from \"./config.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 */\n\nimport { promises as fsPromises } from \"node:fs\";\nimport { extname } from \"node:path\";\nconst CONFIG_FILE_NAMES = [\"foundry.config.json\"];\nconst FOUNDRY_SITE_CONFIG_SCHEMA = {\n type: \"object\",\n properties: {\n foundryUrl: {\n type: \"string\"\n },\n site: {\n type: \"object\",\n properties: {\n application: {\n type: \"string\"\n },\n directory: {\n type: \"string\"\n },\n autoVersion: {\n type: \"object\",\n nullable: true,\n oneOf: [{\n properties: {\n type: {\n const: \"git-describe\",\n type: \"string\"\n },\n tagPrefix: {\n type: \"string\",\n nullable: true\n }\n }\n }, {\n properties: {\n type: {\n const: \"package-json\",\n type: \"string\"\n }\n }\n }],\n required: [\"type\"]\n },\n uploadOnly: {\n type: \"boolean\",\n nullable: true\n }\n },\n required: [\"application\", \"directory\"]\n }\n },\n required: [\"foundryUrl\", \"site\"],\n additionalProperties: false\n};\nconst FOUNDRY_WIDGET_SET_CONFIG_SCHEMA = {\n type: \"object\",\n properties: {\n foundryUrl: {\n type: \"string\"\n },\n widgetSet: {\n type: \"object\",\n properties: {\n rid: {\n type: \"string\"\n },\n directory: {\n type: \"string\"\n },\n repository: {\n type: \"string\",\n nullable: true\n },\n autoVersion: FOUNDRY_SITE_CONFIG_SCHEMA.properties.site.properties.autoVersion,\n uploadOnly: {\n type: \"boolean\",\n nullable: true\n }\n },\n required: [\"rid\", \"directory\"]\n }\n },\n required: [\"foundryUrl\", \"widgetSet\"],\n additionalProperties: false\n};\nconst FOUNDRY_CONFIG_SCHEMA = {\n site: FOUNDRY_SITE_CONFIG_SCHEMA,\n widgetSet: FOUNDRY_WIDGET_SET_CONFIG_SCHEMA\n};\n\n/**\n * Asynchronously loads a configuration file. Looks for any of the CONFIG_FILE_NAMES in the current directory going up to the root directory.\n * @returns A promise that resolves to the configuration JSON object, or undefined if not found.\n * @throws Will throw an error if the configuration file is found but cannot be read or parsed.\n */\n\nexport async function loadFoundryConfig(type) {\n const ajvModule = await import(\"ajv\");\n const Ajv = ajvModule.default.default; // https://github.com/ajv-validator/ajv/issues/2132\n const ajv = new Ajv({\n allErrors: true\n });\n const validate = ajv.compile(FOUNDRY_CONFIG_SCHEMA[type]);\n const {\n findUp\n } = await import(\"find-up\");\n const configFilePath = await findUp(CONFIG_FILE_NAMES);\n if (configFilePath) {\n let foundryConfig;\n try {\n const fileContent = await fsPromises.readFile(configFilePath, \"utf-8\");\n foundryConfig = parseConfigFile(fileContent, configFilePath);\n } catch (error) {\n throw new Error(`Couldn't read or parse config file ${configFilePath}. Error: ${error}`);\n }\n if (!validate(foundryConfig)) {\n throw new Error(`The configuration file ${configFilePath} does not match the expected schema: ${ajv.errorsText(validate.errors)}`);\n }\n return {\n foundryConfig,\n configFilePath\n };\n }\n return undefined;\n}\nfunction parseConfigFile(fileContent, configFilePath) {\n const extension = extname(configFilePath);\n switch (extension) {\n case \".json\":\n return JSON.parse(fileContent);\n default:\n throw new Error(`Unsupported file extension: ${extension} for config file.`);\n }\n}"]}
@@ -1,8 +1,8 @@
1
- import { init_esm_shims } from './chunk-LKKWDXGN.js';
2
- import path2 from 'node:path';
3
- import process from 'node:process';
4
- import fs, { promises } from 'node:fs';
5
- import { fileURLToPath } from 'node:url';
1
+ import { init_esm_shims } from './chunk-TGQMPTOO.js';
2
+ import path2 from 'path';
3
+ import process from 'process';
4
+ import fs, { promises } from 'fs';
5
+ import { fileURLToPath } from 'url';
6
6
 
7
7
  // ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
8
8
  init_esm_shims();
@@ -328,5 +328,5 @@ function findUpSync(name, options = {}) {
328
328
  }
329
329
 
330
330
  export { findUp, findUpMultiple, findUpMultipleSync, findUpStop, findUpSync, pathExists, pathExistsSync };
331
- //# sourceMappingURL=chunk-F2MY3E4F.js.map
332
- //# sourceMappingURL=chunk-F2MY3E4F.js.map
331
+ //# sourceMappingURL=chunk-SEG3TN7G.js.map
332
+ //# sourceMappingURL=chunk-SEG3TN7G.js.map