@osdk/cli 0.26.0-beta.2 → 0.26.0-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +63 -0
- package/build/esm/{acorn-LQZJTRX7.js → acorn-6J2XFAF2.js} +33 -34
- package/build/esm/{acorn-LQZJTRX7.js.map → acorn-6J2XFAF2.js.map} +1 -1
- package/build/esm/{angular-VWUX447C.js → angular-FXKB67LX.js} +11 -11
- package/build/esm/{angular-VWUX447C.js.map → angular-FXKB67LX.js.map} +1 -1
- package/build/esm/{babel-7BWEVLBS.js → babel-P3PJ67NT.js} +67 -67
- package/build/esm/{babel-7BWEVLBS.js.map → babel-P3PJ67NT.js.map} +1 -1
- package/build/esm/{chunk-LR3YBME3.js → chunk-FNSPUDYX.js} +10 -10
- package/build/esm/{chunk-LR3YBME3.js.map → chunk-FNSPUDYX.js.map} +1 -1
- package/build/esm/{chunk-KHVWTBWA.js → chunk-G4YHZ22X.js} +8 -8
- package/build/esm/{chunk-KHVWTBWA.js.map → chunk-G4YHZ22X.js.map} +1 -1
- package/build/esm/{chunk-GVZBRYRL.js → chunk-GMSFWYOD.js} +3 -3
- package/build/esm/{chunk-GVZBRYRL.js.map → chunk-GMSFWYOD.js.map} +1 -1
- package/build/esm/{chunk-DMUWBIYY.js → chunk-HRFGJCX3.js} +4 -4
- package/build/esm/{chunk-DMUWBIYY.js.map → chunk-HRFGJCX3.js.map} +1 -1
- package/build/esm/{chunk-SAOPV5FF.js → chunk-MX6IUHH6.js} +3 -3
- package/build/esm/{chunk-SAOPV5FF.js.map → chunk-MX6IUHH6.js.map} +1 -1
- package/build/esm/{chunk-KXNCVDQG.js → chunk-SB26PVZG.js} +11 -11
- package/build/esm/{chunk-KXNCVDQG.js.map → chunk-SB26PVZG.js.map} +1 -1
- package/build/esm/{chunk-PXU2ECCD.js → chunk-WID24PKG.js} +23 -16
- package/build/esm/chunk-WID24PKG.js.map +1 -0
- package/build/esm/{chunk-HCWMXOMI.js → chunk-WJJGFC5B.js} +5 -4
- package/build/esm/chunk-WJJGFC5B.js.map +1 -0
- package/build/esm/{chunk-3XCF7EHX.js → chunk-YW7LQXZX.js} +47 -65
- package/build/esm/chunk-YW7LQXZX.js.map +1 -0
- package/build/esm/{estree-PI6JMQNR.js → estree-YZZ76ZCZ.js} +102 -118
- package/build/esm/{estree-PI6JMQNR.js.map → estree-YZZ76ZCZ.js.map} +1 -1
- package/build/esm/find-up-J6UG2A4A.js +4 -0
- package/build/esm/{find-up-QYNPYSRQ.js.map → find-up-J6UG2A4A.js.map} +1 -1
- package/build/esm/{flow-AP4DEOL5.js → flow-FLMB2WRS.js} +14 -14
- package/build/esm/{flow-AP4DEOL5.js.map → flow-FLMB2WRS.js.map} +1 -1
- package/build/esm/{glimmer-LM2ZFC5U.js → glimmer-QTYNZR7I.js} +53 -53
- package/build/esm/{glimmer-LM2ZFC5U.js.map → glimmer-QTYNZR7I.js.map} +1 -1
- package/build/esm/{graphql-U5CPDQKQ.js → graphql-RJWZIGAD.js} +22 -57
- package/build/esm/graphql-RJWZIGAD.js.map +1 -0
- package/build/esm/{handleGenerate-WWXANW5U.js → handleGenerate-SJCGFNLM.js} +364 -346
- package/build/esm/handleGenerate-SJCGFNLM.js.map +1 -0
- package/build/esm/{html-FNGHE355.js → html-CASQPPRX.js} +37 -66
- package/build/esm/html-CASQPPRX.js.map +1 -0
- package/build/esm/index.js +24 -24
- package/build/esm/index.js.map +1 -1
- package/build/esm/loginFlow-UZUROTUU.js +4 -0
- package/build/esm/{loginFlow-ESPJDVBX.js.map → loginFlow-UZUROTUU.js.map} +1 -1
- package/build/esm/{markdown-HUHOYR5Q.js → markdown-SVGJ3QZI.js} +49 -69
- package/build/esm/{markdown-HUHOYR5Q.js.map → markdown-SVGJ3QZI.js.map} +1 -1
- package/build/esm/{meriyah-WP7UQXC7.js → meriyah-YDXWEWLV.js} +36 -36
- package/build/esm/{meriyah-WP7UQXC7.js.map → meriyah-YDXWEWLV.js.map} +1 -1
- package/build/esm/{postcss-JMNG34CL.js → postcss-BBOQTN3X.js} +79 -115
- package/build/esm/{postcss-JMNG34CL.js.map → postcss-BBOQTN3X.js.map} +1 -1
- package/build/esm/{siteDeployCommand-MPU32NSO.js → siteDeployCommand-YLTZ3EMA.js} +60 -14
- package/build/esm/siteDeployCommand-YLTZ3EMA.js.map +1 -0
- package/build/esm/{typescript-A4QI3FB6.js → typescript-JGKMLQMS.js} +670 -668
- package/build/esm/{typescript-A4QI3FB6.js.map → typescript-JGKMLQMS.js.map} +1 -1
- package/build/esm/versionDeleteCommand-B7NYU34P.js +37 -0
- package/build/esm/versionDeleteCommand-B7NYU34P.js.map +1 -0
- package/build/esm/{versionDeleteCommand-DGFC2RVA.js → versionDeleteCommand-X6MIOXJX.js} +9 -8
- package/build/esm/versionDeleteCommand-X6MIOXJX.js.map +1 -0
- package/build/esm/{versionGetCommand-GAS2KI7X.js → versionGetCommand-O3YYZH2S.js} +6 -6
- package/build/esm/{versionGetCommand-GAS2KI7X.js.map → versionGetCommand-O3YYZH2S.js.map} +1 -1
- package/build/esm/{versionInfoCommand-D2I45O6W.js → versionInfoCommand-BWKY7FTE.js} +7 -7
- package/build/esm/versionInfoCommand-BWKY7FTE.js.map +1 -0
- package/build/esm/{versionListCommand-FOLF3MQJ.js → versionListCommand-6FLSCXT3.js} +9 -9
- package/build/esm/versionListCommand-6FLSCXT3.js.map +1 -0
- package/build/esm/{versionListCommand-LOJCLRAG.js → versionListCommand-J5XHJPFM.js} +6 -6
- package/build/esm/{versionListCommand-LOJCLRAG.js.map → versionListCommand-J5XHJPFM.js.map} +1 -1
- package/build/esm/{versionSetCommand-3PPJLHJU.js → versionSetCommand-IO56CZ7N.js} +6 -6
- package/build/esm/{versionSetCommand-3PPJLHJU.js.map → versionSetCommand-IO56CZ7N.js.map} +1 -1
- package/build/esm/{versionUnsetCommand-7A4RM25B.js → versionUnsetCommand-CBISKVJV.js} +9 -8
- package/build/esm/versionUnsetCommand-CBISKVJV.js.map +1 -0
- package/build/esm/{widgetSetDeployCommand-VLVRA7AB.js → widgetSetDeployCommand-K4ECXH3H.js} +13 -22
- package/build/esm/widgetSetDeployCommand-K4ECXH3H.js.map +1 -0
- package/build/esm/{yaml-IT3UOTAK.js → yaml-C7WVEV2M.js} +50 -63
- package/build/esm/yaml-C7WVEV2M.js.map +1 -0
- package/build/types/commands/site/deploy/index.d.ts.map +1 -1
- package/build/types/commands/site/deploy/siteDeployCommand.d.mts.map +1 -1
- package/build/types/commands/site/version/delete/versionDeleteCommand.d.mts.map +1 -1
- package/build/types/commands/site/version/get/versionGetCommand.d.mts.map +1 -1
- package/build/types/commands/site/version/list/versionListCommand.d.mts.map +1 -1
- package/build/types/commands/site/version/set/versionSetCommand.d.mts.map +1 -1
- package/build/types/commands/site/version/unset/versionUnsetCommand.d.mts.map +1 -1
- package/build/types/commands/widgetset/deploy/widgetSetDeployCommand.d.mts.map +1 -1
- package/build/types/commands/widgetset/version/delete/versionDeleteCommand.d.mts.map +1 -1
- package/build/types/commands/widgetset/version/info/versionInfoCommand.d.mts.map +1 -1
- package/build/types/commands/widgetset/version/list/versionListCommand.d.mts.map +1 -1
- package/build/types/consola/handlePromptCancel.d.ts.map +1 -1
- package/build/types/net/createFetch.d.mts.map +1 -1
- package/build/types/net/third-party-applications/index.d.mts +4 -4
- package/build/types/net/third-party-applications/index.d.mts.map +1 -1
- package/build/types/net/widget-registry/ListReleasesResponse.d.mts +5 -0
- package/build/types/net/widget-registry/ListReleasesResponse.d.mts.map +1 -0
- package/build/types/net/widget-registry/Release.d.mts +8 -0
- package/build/types/net/widget-registry/Release.d.mts.map +1 -0
- package/build/types/net/widget-registry/ReleaseLocator.d.mts +6 -0
- package/build/types/net/widget-registry/ReleaseLocator.d.mts.map +1 -0
- package/build/types/net/widget-registry/deleteRelease.d.mts +3 -0
- package/build/types/net/widget-registry/deleteRelease.d.mts.map +1 -0
- package/build/types/net/widget-registry/getRelease.d.mts +4 -0
- package/build/types/net/widget-registry/getRelease.d.mts.map +1 -0
- package/build/types/net/widget-registry/index.d.mts +7 -8
- package/build/types/net/widget-registry/index.d.mts.map +1 -1
- package/build/types/net/widget-registry/listReleases.d.mts +4 -0
- package/build/types/net/widget-registry/listReleases.d.mts.map +1 -0
- package/build/types/net/widget-registry/publishRelease.d.mts +4 -0
- package/build/types/net/widget-registry/publishRelease.d.mts.map +1 -0
- package/build/types/util/maybeUpdateJemmaCustomMetadata.d.ts +17 -0
- package/build/types/util/maybeUpdateJemmaCustomMetadata.d.ts.map +1 -0
- package/build/types/util/maybeUpdateJemmaCustomMetadata.test.d.ts +1 -0
- package/build/types/util/maybeUpdateJemmaCustomMetadata.test.d.ts.map +1 -0
- package/package.json +9 -9
- package/build/esm/chunk-3XCF7EHX.js.map +0 -1
- package/build/esm/chunk-HCWMXOMI.js.map +0 -1
- package/build/esm/chunk-PXU2ECCD.js.map +0 -1
- package/build/esm/find-up-QYNPYSRQ.js +0 -4
- package/build/esm/graphql-U5CPDQKQ.js.map +0 -1
- package/build/esm/handleGenerate-WWXANW5U.js.map +0 -1
- package/build/esm/html-FNGHE355.js.map +0 -1
- package/build/esm/loginFlow-ESPJDVBX.js +0 -4
- package/build/esm/siteDeployCommand-MPU32NSO.js.map +0 -1
- package/build/esm/versionDeleteCommand-DGFC2RVA.js.map +0 -1
- package/build/esm/versionDeleteCommand-YZVRSZFQ.js +0 -58
- package/build/esm/versionDeleteCommand-YZVRSZFQ.js.map +0 -1
- package/build/esm/versionInfoCommand-D2I45O6W.js.map +0 -1
- package/build/esm/versionListCommand-FOLF3MQJ.js.map +0 -1
- package/build/esm/versionUnsetCommand-7A4RM25B.js.map +0 -1
- package/build/esm/widgetSetDeployCommand-VLVRA7AB.js.map +0 -1
- package/build/esm/yaml-IT3UOTAK.js.map +0 -1
- package/build/types/net/widget-registry/ListWidgetSetReleasesResponse.d.mts +0 -5
- package/build/types/net/widget-registry/ListWidgetSetReleasesResponse.d.mts.map +0 -1
- package/build/types/net/widget-registry/WidgetSetLocator.d.mts +0 -16
- package/build/types/net/widget-registry/WidgetSetLocator.d.mts.map +0 -1
- package/build/types/net/widget-registry/WidgetSetRelease.d.mts +0 -13
- package/build/types/net/widget-registry/WidgetSetRelease.d.mts.map +0 -1
- package/build/types/net/widget-registry/deleteSiteVersion.d.mts +0 -4
- package/build/types/net/widget-registry/deleteSiteVersion.d.mts.map +0 -1
- package/build/types/net/widget-registry/deleteWidgetSetRelease.d.mts +0 -3
- package/build/types/net/widget-registry/deleteWidgetSetRelease.d.mts.map +0 -1
- package/build/types/net/widget-registry/getWidgetSetRelease.d.mts +0 -4
- package/build/types/net/widget-registry/getWidgetSetRelease.d.mts.map +0 -1
- package/build/types/net/widget-registry/listWidgetSetReleases.d.mts +0 -4
- package/build/types/net/widget-registry/listWidgetSetReleases.d.mts.map +0 -1
- package/build/types/net/widget-registry/publishManifest.d.mts +0 -4
- package/build/types/net/widget-registry/publishManifest.d.mts.map +0 -1
- package/build/types/net/widget-registry/uploadSiteVersion.d.mts +0 -4
- package/build/types/net/widget-registry/uploadSiteVersion.d.mts.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { init_esm_shims } from './chunk-
|
|
2
|
-
import path2 from 'path';
|
|
3
|
-
import process from 'process';
|
|
4
|
-
import fs, { promises } from 'fs';
|
|
5
|
-
import { fileURLToPath } from 'url';
|
|
1
|
+
import { init_esm_shims } from './chunk-HRFGJCX3.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';
|
|
6
6
|
|
|
7
7
|
// ../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js
|
|
8
8
|
init_esm_shims();
|
|
@@ -53,8 +53,8 @@ var Queue = class {
|
|
|
53
53
|
return current.value;
|
|
54
54
|
}
|
|
55
55
|
clear() {
|
|
56
|
-
this.#head =
|
|
57
|
-
this.#tail =
|
|
56
|
+
this.#head = void 0;
|
|
57
|
+
this.#tail = void 0;
|
|
58
58
|
this.#size = 0;
|
|
59
59
|
}
|
|
60
60
|
get size() {
|
|
@@ -93,7 +93,7 @@ function pLimit(concurrency) {
|
|
|
93
93
|
next();
|
|
94
94
|
};
|
|
95
95
|
const enqueue = (fn, resolve, args) => {
|
|
96
|
-
queue.enqueue(run.bind(
|
|
96
|
+
queue.enqueue(run.bind(void 0, fn, resolve, args));
|
|
97
97
|
(async () => {
|
|
98
98
|
await Promise.resolve();
|
|
99
99
|
if (activeCount < concurrency && queue.size > 0) {
|
|
@@ -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-
|
|
332
|
-
//# sourceMappingURL=chunk-
|
|
331
|
+
//# sourceMappingURL=chunk-FNSPUDYX.js.map
|
|
332
|
+
//# sourceMappingURL=chunk-FNSPUDYX.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js","../../../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js","../../../../node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.js","../../../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js","../../../../node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js","../../../../node_modules/.pnpm/unicorn-magic@0.1.0/node_modules/unicorn-magic/node.js","../../../../node_modules/.pnpm/path-exists@5.0.0/node_modules/path-exists/index.js"],"names":["fsPromises","path","toPath","fileURLToPath","fs"],"mappings":";;;;;;;AAAA,cAAA,EAAA;;;ACAA,cAAA,EAAA;;;ACAA,cAAA,EAAA;;;ACAA,cAAA,EAAA;;;ACAA,cAAA,EAAA;AAKA,IAAM,OAAN,M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GACR,CAAA;AACD,EAAA,OAAO,QAAQ,CAAC,CAAA;AAClB","file":"chunk-LR3YBME3.js","sourcesContent":["import path from 'node:path';\nimport { locatePath, locatePathSync } from 'locate-path';\nimport { toPath } from 'unicorn-magic';\nexport const findUpStop = Symbol('findUpStop');\nexport async function findUpMultiple(name, options = {}) {\n let directory = path.resolve(toPath(options.cwd) ?? '');\n const {\n root\n } = path.parse(directory);\n const stopAt = path.resolve(directory, toPath(options.stopAt ?? root));\n const limit = options.limit ?? Number.POSITIVE_INFINITY;\n const paths = [name].flat();\n const runMatcher = async locateOptions => {\n if (typeof name !== 'function') {\n return locatePath(paths, locateOptions);\n }\n const foundPath = await name(locateOptions.cwd);\n if (typeof foundPath === 'string') {\n return locatePath([foundPath], locateOptions);\n }\n return foundPath;\n };\n const matches = [];\n // eslint-disable-next-line no-constant-condition\n while (true) {\n // eslint-disable-next-line no-await-in-loop\n const foundPath = await runMatcher({\n ...options,\n cwd: directory\n });\n if (foundPath === findUpStop) {\n break;\n }\n if (foundPath) {\n matches.push(path.resolve(directory, foundPath));\n }\n if (directory === stopAt || matches.length >= limit) {\n break;\n }\n directory = path.dirname(directory);\n }\n return matches;\n}\nexport function findUpMultipleSync(name, options = {}) {\n let directory = path.resolve(toPath(options.cwd) ?? '');\n const {\n root\n } = path.parse(directory);\n const stopAt = path.resolve(directory, toPath(options.stopAt) ?? root);\n const limit = options.limit ?? Number.POSITIVE_INFINITY;\n const paths = [name].flat();\n const runMatcher = locateOptions => {\n if (typeof name !== 'function') {\n return locatePathSync(paths, locateOptions);\n }\n const foundPath = name(locateOptions.cwd);\n if (typeof foundPath === 'string') {\n return locatePathSync([foundPath], locateOptions);\n }\n return foundPath;\n };\n const matches = [];\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const foundPath = runMatcher({\n ...options,\n cwd: directory\n });\n if (foundPath === findUpStop) {\n break;\n }\n if (foundPath) {\n matches.push(path.resolve(directory, foundPath));\n }\n if (directory === stopAt || matches.length >= limit) {\n break;\n }\n directory = path.dirname(directory);\n }\n return matches;\n}\nexport async function findUp(name, options = {}) {\n const matches = await findUpMultiple(name, {\n ...options,\n limit: 1\n });\n return matches[0];\n}\nexport function findUpSync(name, options = {}) {\n const matches = findUpMultipleSync(name, {\n ...options,\n limit: 1\n });\n return matches[0];\n}\nexport { pathExists, pathExistsSync } from 'path-exists';","import process from 'node:process';\nimport path from 'node:path';\nimport fs, { promises as fsPromises } from 'node:fs';\nimport { fileURLToPath } from 'node:url';\nimport pLocate from 'p-locate';\nconst typeMappings = {\n directory: 'isDirectory',\n file: 'isFile'\n};\nfunction checkType(type) {\n if (Object.hasOwnProperty.call(typeMappings, type)) {\n return;\n }\n throw new Error(`Invalid type specified: ${type}`);\n}\nconst matchType = (type, stat) => stat[typeMappings[type]]();\nconst toPath = urlOrPath => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\nexport async function locatePath(paths, {\n cwd = process.cwd(),\n type = 'file',\n allowSymlinks = true,\n concurrency,\n preserveOrder\n} = {}) {\n checkType(type);\n cwd = toPath(cwd);\n const statFunction = allowSymlinks ? fsPromises.stat : fsPromises.lstat;\n return pLocate(paths, async path_ => {\n try {\n const stat = await statFunction(path.resolve(cwd, path_));\n return matchType(type, stat);\n } catch {\n return false;\n }\n }, {\n concurrency,\n preserveOrder\n });\n}\nexport function locatePathSync(paths, {\n cwd = process.cwd(),\n type = 'file',\n allowSymlinks = true\n} = {}) {\n checkType(type);\n cwd = toPath(cwd);\n const statFunction = allowSymlinks ? fs.statSync : fs.lstatSync;\n for (const path_ of paths) {\n try {\n const stat = statFunction(path.resolve(cwd, path_), {\n throwIfNoEntry: false\n });\n if (!stat) {\n continue;\n }\n if (matchType(type, stat)) {\n return path_;\n }\n } catch {}\n }\n}","import pLimit from 'p-limit';\nclass EndError extends Error {\n constructor(value) {\n super();\n this.value = value;\n }\n}\n\n// The input can also be a promise, so we await it.\nconst testElement = async (element, tester) => tester(await element);\n\n// The input can also be a promise, so we `Promise.all()` them both.\nconst finder = async element => {\n const values = await Promise.all(element);\n if (values[1] === true) {\n throw new EndError(values[0]);\n }\n return false;\n};\nexport default async function pLocate(iterable, tester, {\n concurrency = Number.POSITIVE_INFINITY,\n preserveOrder = true\n} = {}) {\n const limit = pLimit(concurrency);\n\n // Start all the promises concurrently with optional limit.\n const items = [...iterable].map(element => [element, limit(testElement, element, tester)]);\n\n // Check the promises either serially or concurrently.\n const checkLimit = pLimit(preserveOrder ? 1 : Number.POSITIVE_INFINITY);\n try {\n await Promise.all(items.map(element => checkLimit(finder, element)));\n } catch (error) {\n if (error instanceof EndError) {\n return error.value;\n }\n throw error;\n }\n}","import Queue from 'yocto-queue';\nexport default function pLimit(concurrency) {\n if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {\n throw new TypeError('Expected `concurrency` to be a number from 1 and up');\n }\n const queue = new Queue();\n let activeCount = 0;\n const next = () => {\n activeCount--;\n if (queue.size > 0) {\n queue.dequeue()();\n }\n };\n const run = async (fn, resolve, args) => {\n activeCount++;\n const result = (async () => fn(...args))();\n resolve(result);\n try {\n await result;\n } catch {}\n next();\n };\n const enqueue = (fn, resolve, args) => {\n queue.enqueue(run.bind(undefined, fn, resolve, args));\n (async () => {\n // This function needs to wait until the next microtask before comparing\n // `activeCount` to `concurrency`, because `activeCount` is updated asynchronously\n // when the run function is dequeued and called. The comparison in the if-statement\n // needs to happen asynchronously as well to get an up-to-date value for `activeCount`.\n await Promise.resolve();\n if (activeCount < concurrency && queue.size > 0) {\n queue.dequeue()();\n }\n })();\n };\n const generator = (fn, ...args) => new Promise(resolve => {\n enqueue(fn, resolve, args);\n });\n Object.defineProperties(generator, {\n activeCount: {\n get: () => activeCount\n },\n pendingCount: {\n get: () => queue.size\n },\n clearQueue: {\n value: () => {\n queue.clear();\n }\n }\n });\n return generator;\n}","/*\nHow it works:\n`this.#head` is an instance of `Node` which keeps track of its current value and nests another instance of `Node` that keeps the value that comes after it. When a value is provided to `.enqueue()`, the code needs to iterate through `this.#head`, going deeper and deeper to find the last value. However, iterating through every single item is slow. This problem is solved by saving a reference to the last value as `this.#tail` so that it can reference it to add a new value.\n*/\n\nclass Node {\n value;\n next;\n constructor(value) {\n this.value = value;\n }\n}\nexport default class Queue {\n #head;\n #tail;\n #size;\n constructor() {\n this.clear();\n }\n enqueue(value) {\n const node = new Node(value);\n if (this.#head) {\n this.#tail.next = node;\n this.#tail = node;\n } else {\n this.#head = node;\n this.#tail = node;\n }\n this.#size++;\n }\n dequeue() {\n const current = this.#head;\n if (!current) {\n return;\n }\n this.#head = this.#head.next;\n this.#size--;\n return current.value;\n }\n clear() {\n this.#head = undefined;\n this.#tail = undefined;\n this.#size = 0;\n }\n get size() {\n return this.#size;\n }\n *[Symbol.iterator]() {\n let current = this.#head;\n while (current) {\n yield current.value;\n current = current.next;\n }\n }\n}","import { fileURLToPath } from 'node:url';\nexport function toPath(urlOrPath) {\n return urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n}\nexport * from './default.js';","import fs, { promises as fsPromises } from 'node:fs';\nexport async function pathExists(path) {\n try {\n await fsPromises.access(path);\n return true;\n } catch {\n return false;\n }\n}\nexport function pathExistsSync(path) {\n try {\n fs.accessSync(path);\n return true;\n } catch {\n return false;\n }\n}"]}
|
|
1
|
+
{"version":3,"sources":["../../../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js","../../../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js","../../../../node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.js","../../../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js","../../../../node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js","../../../../node_modules/.pnpm/unicorn-magic@0.1.0/node_modules/unicorn-magic/node.js","../../../../node_modules/.pnpm/path-exists@5.0.0/node_modules/path-exists/index.js"],"names":["fsPromises","path","toPath","fileURLToPath","fs"],"mappings":";;;;;;;AAAA,c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,EAAA;AAC7C,EAAM,MAAA,OAAA,GAAU,mBAAmB,IAAM,EAAA;AAAA,IACvC,GAAG,OAAA;AAAA,IACH,KAAO,EAAA;AAAA,GACR,CAAA;AACD,EAAA,OAAO,QAAQ,CAAC,CAAA;AAClB","file":"chunk-FNSPUDYX.js","sourcesContent":["import path from 'node:path';\nimport { locatePath, locatePathSync } from 'locate-path';\nimport { toPath } from 'unicorn-magic';\nexport const findUpStop = Symbol('findUpStop');\nexport async function findUpMultiple(name, options = {}) {\n let directory = path.resolve(toPath(options.cwd) ?? '');\n const {\n root\n } = path.parse(directory);\n const stopAt = path.resolve(directory, toPath(options.stopAt ?? root));\n const limit = options.limit ?? Number.POSITIVE_INFINITY;\n const paths = [name].flat();\n const runMatcher = async locateOptions => {\n if (typeof name !== 'function') {\n return locatePath(paths, locateOptions);\n }\n const foundPath = await name(locateOptions.cwd);\n if (typeof foundPath === 'string') {\n return locatePath([foundPath], locateOptions);\n }\n return foundPath;\n };\n const matches = [];\n // eslint-disable-next-line no-constant-condition\n while (true) {\n // eslint-disable-next-line no-await-in-loop\n const foundPath = await runMatcher({\n ...options,\n cwd: directory\n });\n if (foundPath === findUpStop) {\n break;\n }\n if (foundPath) {\n matches.push(path.resolve(directory, foundPath));\n }\n if (directory === stopAt || matches.length >= limit) {\n break;\n }\n directory = path.dirname(directory);\n }\n return matches;\n}\nexport function findUpMultipleSync(name, options = {}) {\n let directory = path.resolve(toPath(options.cwd) ?? '');\n const {\n root\n } = path.parse(directory);\n const stopAt = path.resolve(directory, toPath(options.stopAt) ?? root);\n const limit = options.limit ?? Number.POSITIVE_INFINITY;\n const paths = [name].flat();\n const runMatcher = locateOptions => {\n if (typeof name !== 'function') {\n return locatePathSync(paths, locateOptions);\n }\n const foundPath = name(locateOptions.cwd);\n if (typeof foundPath === 'string') {\n return locatePathSync([foundPath], locateOptions);\n }\n return foundPath;\n };\n const matches = [];\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const foundPath = runMatcher({\n ...options,\n cwd: directory\n });\n if (foundPath === findUpStop) {\n break;\n }\n if (foundPath) {\n matches.push(path.resolve(directory, foundPath));\n }\n if (directory === stopAt || matches.length >= limit) {\n break;\n }\n directory = path.dirname(directory);\n }\n return matches;\n}\nexport async function findUp(name, options = {}) {\n const matches = await findUpMultiple(name, {\n ...options,\n limit: 1\n });\n return matches[0];\n}\nexport function findUpSync(name, options = {}) {\n const matches = findUpMultipleSync(name, {\n ...options,\n limit: 1\n });\n return matches[0];\n}\nexport { pathExists, pathExistsSync } from 'path-exists';","import process from 'node:process';\nimport path from 'node:path';\nimport fs, { promises as fsPromises } from 'node:fs';\nimport { fileURLToPath } from 'node:url';\nimport pLocate from 'p-locate';\nconst typeMappings = {\n directory: 'isDirectory',\n file: 'isFile'\n};\nfunction checkType(type) {\n if (Object.hasOwnProperty.call(typeMappings, type)) {\n return;\n }\n throw new Error(`Invalid type specified: ${type}`);\n}\nconst matchType = (type, stat) => stat[typeMappings[type]]();\nconst toPath = urlOrPath => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\nexport async function locatePath(paths, {\n cwd = process.cwd(),\n type = 'file',\n allowSymlinks = true,\n concurrency,\n preserveOrder\n} = {}) {\n checkType(type);\n cwd = toPath(cwd);\n const statFunction = allowSymlinks ? fsPromises.stat : fsPromises.lstat;\n return pLocate(paths, async path_ => {\n try {\n const stat = await statFunction(path.resolve(cwd, path_));\n return matchType(type, stat);\n } catch {\n return false;\n }\n }, {\n concurrency,\n preserveOrder\n });\n}\nexport function locatePathSync(paths, {\n cwd = process.cwd(),\n type = 'file',\n allowSymlinks = true\n} = {}) {\n checkType(type);\n cwd = toPath(cwd);\n const statFunction = allowSymlinks ? fs.statSync : fs.lstatSync;\n for (const path_ of paths) {\n try {\n const stat = statFunction(path.resolve(cwd, path_), {\n throwIfNoEntry: false\n });\n if (!stat) {\n continue;\n }\n if (matchType(type, stat)) {\n return path_;\n }\n } catch {}\n }\n}","import pLimit from 'p-limit';\nclass EndError extends Error {\n constructor(value) {\n super();\n this.value = value;\n }\n}\n\n// The input can also be a promise, so we await it.\nconst testElement = async (element, tester) => tester(await element);\n\n// The input can also be a promise, so we `Promise.all()` them both.\nconst finder = async element => {\n const values = await Promise.all(element);\n if (values[1] === true) {\n throw new EndError(values[0]);\n }\n return false;\n};\nexport default async function pLocate(iterable, tester, {\n concurrency = Number.POSITIVE_INFINITY,\n preserveOrder = true\n} = {}) {\n const limit = pLimit(concurrency);\n\n // Start all the promises concurrently with optional limit.\n const items = [...iterable].map(element => [element, limit(testElement, element, tester)]);\n\n // Check the promises either serially or concurrently.\n const checkLimit = pLimit(preserveOrder ? 1 : Number.POSITIVE_INFINITY);\n try {\n await Promise.all(items.map(element => checkLimit(finder, element)));\n } catch (error) {\n if (error instanceof EndError) {\n return error.value;\n }\n throw error;\n }\n}","import Queue from 'yocto-queue';\nexport default function pLimit(concurrency) {\n if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {\n throw new TypeError('Expected `concurrency` to be a number from 1 and up');\n }\n const queue = new Queue();\n let activeCount = 0;\n const next = () => {\n activeCount--;\n if (queue.size > 0) {\n queue.dequeue()();\n }\n };\n const run = async (fn, resolve, args) => {\n activeCount++;\n const result = (async () => fn(...args))();\n resolve(result);\n try {\n await result;\n } catch {}\n next();\n };\n const enqueue = (fn, resolve, args) => {\n queue.enqueue(run.bind(undefined, fn, resolve, args));\n (async () => {\n // This function needs to wait until the next microtask before comparing\n // `activeCount` to `concurrency`, because `activeCount` is updated asynchronously\n // when the run function is dequeued and called. The comparison in the if-statement\n // needs to happen asynchronously as well to get an up-to-date value for `activeCount`.\n await Promise.resolve();\n if (activeCount < concurrency && queue.size > 0) {\n queue.dequeue()();\n }\n })();\n };\n const generator = (fn, ...args) => new Promise(resolve => {\n enqueue(fn, resolve, args);\n });\n Object.defineProperties(generator, {\n activeCount: {\n get: () => activeCount\n },\n pendingCount: {\n get: () => queue.size\n },\n clearQueue: {\n value: () => {\n queue.clear();\n }\n }\n });\n return generator;\n}","/*\nHow it works:\n`this.#head` is an instance of `Node` which keeps track of its current value and nests another instance of `Node` that keeps the value that comes after it. When a value is provided to `.enqueue()`, the code needs to iterate through `this.#head`, going deeper and deeper to find the last value. However, iterating through every single item is slow. This problem is solved by saving a reference to the last value as `this.#tail` so that it can reference it to add a new value.\n*/\n\nclass Node {\n value;\n next;\n constructor(value) {\n this.value = value;\n }\n}\nexport default class Queue {\n #head;\n #tail;\n #size;\n constructor() {\n this.clear();\n }\n enqueue(value) {\n const node = new Node(value);\n if (this.#head) {\n this.#tail.next = node;\n this.#tail = node;\n } else {\n this.#head = node;\n this.#tail = node;\n }\n this.#size++;\n }\n dequeue() {\n const current = this.#head;\n if (!current) {\n return;\n }\n this.#head = this.#head.next;\n this.#size--;\n return current.value;\n }\n clear() {\n this.#head = undefined;\n this.#tail = undefined;\n this.#size = 0;\n }\n get size() {\n return this.#size;\n }\n *[Symbol.iterator]() {\n let current = this.#head;\n while (current) {\n yield current.value;\n current = current.next;\n }\n }\n}","import { fileURLToPath } from 'node:url';\nexport function toPath(urlOrPath) {\n return urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n}\nexport * from './default.js';","import fs, { promises as fsPromises } from 'node:fs';\nexport async function pathExists(path) {\n try {\n await fsPromises.access(path);\n return true;\n } catch {\n return false;\n }\n}\nexport function pathExistsSync(path) {\n try {\n fs.accessSync(path);\n return true;\n } catch {\n return false;\n }\n}"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { init_esm_shims } from './chunk-
|
|
1
|
+
import { init_esm_shims } from './chunk-HRFGJCX3.js';
|
|
2
2
|
import consola from 'consola';
|
|
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';
|
|
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';
|
|
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-
|
|
127
|
-
//# sourceMappingURL=chunk-
|
|
126
|
+
//# sourceMappingURL=chunk-G4YHZ22X.js.map
|
|
127
|
+
//# sourceMappingURL=chunk-G4YHZ22X.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,G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BAAoB,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-KHVWTBWA.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 let output = [];\n let 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\"].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;A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,aAAa,QAAQ,CAAA;AACjC,EAAK,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-G4YHZ22X.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 let output = [];\n let 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\"].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-
|
|
1
|
+
import { init_esm_shims } from './chunk-HRFGJCX3.js';
|
|
2
2
|
|
|
3
3
|
// ../widget.api.unstable/build/esm/manifest.js
|
|
4
4
|
init_esm_shims();
|
|
@@ -24,5 +24,5 @@ init_esm_shims();
|
|
|
24
24
|
init_esm_shims();
|
|
25
25
|
|
|
26
26
|
export { MANIFEST_FILE_LOCATION };
|
|
27
|
-
//# sourceMappingURL=chunk-
|
|
28
|
-
//# sourceMappingURL=chunk-
|
|
27
|
+
//# sourceMappingURL=chunk-GMSFWYOD.js.map
|
|
28
|
+
//# sourceMappingURL=chunk-GMSFWYOD.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../widget.api.unstable/build/esm/manifest.js","../../../widget.api.unstable/build/esm/index.js","../../../widget.api.unstable/build/esm/config.js","../../../widget.api.unstable/build/esm/messages/hostMessages.js","../../../widget.api.unstable/build/esm/messages/widgetMessages.js","../../../widget.api.unstable/build/esm/metaTags.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;AASzB,CAAG,EAAA,WAAA,KAAgB,WAAc,GAAA,EAAG,CAAA,CAAA;;;AC3BpC,cAAA,EAAA;;;ACAA,cAAA,EAAA","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../../../widget.api.unstable/build/esm/manifest.js","../../../widget.api.unstable/build/esm/index.js","../../../widget.api.unstable/build/esm/config.js","../../../widget.api.unstable/build/esm/messages/hostMessages.js","../../../widget.api.unstable/build/esm/messages/widgetMessages.js","../../../widget.api.unstable/build/esm/metaTags.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;AASzB,CAAG,EAAA,WAAA,KAAgB,WAAc,GAAA,EAAG,CAAA,CAAA;;;AC3BpC,cAAA,EAAA;;;ACAA,cAAA,EAAA","file":"chunk-GMSFWYOD.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 { _unstable_isHostFetchResponseFailedMessage, _unstable_isHostFetchResponseSuccessMessage, HostMessage, isHostParametersUpdatedMessage, visitHostMessage } from \"./messages/hostMessages.js\";\nexport { _unstable_isWidgetFetchMessage, isWidgetEmitEventMessage, isWidgetReadyMessage, visitWidgetMessage } from \"./messages/widgetMessages.js\";\nexport { META_TAG_HOST_ORIGIN } from \"./metaTags.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 /**\n * Temporary fetch proxy response\n * Will be removed in favor of server side proxy\n */\n /**\n * Temporary fetch proxy response\n * Will be removed in favor of server side proxy\n */\n})(HostMessage || (HostMessage = {}));\nexport function isHostParametersUpdatedMessage(event) {\n return event.type === \"host.update-parameters\";\n}\nexport function _unstable_isHostFetchResponseSuccessMessage(event) {\n return event.type === \"host._unstable.fetch-response-success\";\n}\nexport function _unstable_isHostFetchResponseFailedMessage(event) {\n return event.type === \"host._unstable.fetch-response-failed\";\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 _unstable_isWidgetFetchMessage(event) {\n return event.type === \"widget._unstable.fetch-request\";\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}","/*\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 META_TAG_HOST_ORIGIN = \"x-palantir-widgets-host-origin\";"]}
|
|
@@ -31,12 +31,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
31
31
|
mod
|
|
32
32
|
));
|
|
33
33
|
|
|
34
|
-
// ../../node_modules/.pnpm/tsup@8.
|
|
34
|
+
// ../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.52.7_@types+node@18.19.97__@swc+core@1.7.39_jiti@2.4.2__kxzaa7ugeuo2htsbghawal3spu/node_modules/tsup/assets/esm_shims.js
|
|
35
35
|
var init_esm_shims = __esm({
|
|
36
|
-
"../../node_modules/.pnpm/tsup@8.
|
|
36
|
+
"../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.52.7_@types+node@18.19.97__@swc+core@1.7.39_jiti@2.4.2__kxzaa7ugeuo2htsbghawal3spu/node_modules/tsup/assets/esm_shims.js"() {
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
|
|
40
40
|
export { __commonJS, __export, __toESM, init_esm_shims };
|
|
41
|
-
//# sourceMappingURL=chunk-
|
|
42
|
-
//# sourceMappingURL=chunk-
|
|
41
|
+
//# sourceMappingURL=chunk-HRFGJCX3.js.map
|
|
42
|
+
//# sourceMappingURL=chunk-HRFGJCX3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../node_modules/.pnpm/tsup@8.
|
|
1
|
+
{"version":3,"sources":["../../../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.52.7_@types+node@18.19.97__@swc+core@1.7.39_jiti@2.4.2__kxzaa7ugeuo2htsbghawal3spu/node_modules/tsup/assets/esm_shims.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,cAAA,GAAA,KAAA,CAAA;AAAA,EAAA,yLAAA,GAAA;AAAA;AAAA,CAAA","file":"chunk-HRFGJCX3.js","sourcesContent":["// Shim globals in esm bundle\nimport { fileURLToPath } from 'url';\nimport path from 'path';\nconst getFilename = () => fileURLToPath(import.meta.url);\nconst getDirname = () => path.dirname(getFilename());\nexport const __dirname = /* @__PURE__ */getDirname();\nexport const __filename = /* @__PURE__ */getFilename();"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { init_esm_shims } from './chunk-
|
|
1
|
+
import { init_esm_shims } from './chunk-HRFGJCX3.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-
|
|
84
|
-
//# sourceMappingURL=chunk-
|
|
83
|
+
//# sourceMappingURL=chunk-MX6IUHH6.js.map
|
|
84
|
+
//# sourceMappingURL=chunk-MX6IUHH6.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.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,eAAsB,mBAAmB,IAAM,EAAA;AAC7C,EAAA,IAAI,SAAW,EAAA;AACb,IAAY,SAAA,GAAA,KAAA;AACZ,IAAQ,OAAA,CAAA,KAAA,GAAQ,IAAI,IAAK,CAAA,OAAA;AACzB,IAAI,IAAA,OAAA,CAAQ,QAAQ,CAAG,EAAA;AACrB,MAAA,OAAA,CAAQ,MAAM,CAA4B,yBAAA,EAAA,OAAA,CAAQ,KAAU,KAAA,CAAA,GAAI,UAAU,OAAO,CAAA;AAAA,CAAK,CAAA;AAAA;AACxF;AAEJ;;;ADHO,SAAS,aAAa,IAAM,EAAA;AACjC,EAA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AA,KAAA,CAAM,YAAY,CAAK,IAAA,IAAA;AAChC","file":"chunk-
|
|
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,eAAsB,mBAAmB,IAAM,EAAA;AAC7C,EAAA,IAAI,SAAW,EAAA;AACb,IAAY,SAAA,GAAA,KAAA;AACZ,IAAQ,OAAA,CAAA,KAAA,GAAQ,IAAI,IAAK,CAAA,OAAA;AACzB,IAAI,IAAA,OAAA,CAAQ,QAAQ,CAAG,EAAA;AACrB,MAAA,OAAA,CAAQ,MAAM,CAA4B,yBAAA,EAAA,OAAA,CAAQ,KAAU,KAAA,CAAA,GAAI,UAAU,OAAO,CAAA;AAAA,CAAK,CAAA;AAAA;AACxF;AAEJ;;;ADHO,SAAS,aA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Ac,EAAA;AAC1C,EAAO,OAAA,KAAA,CAAM,YAAY,CAAK,IAAA,IAAA;AAChC","file":"chunk-MX6IUHH6.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 === false) {\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 { findUp } from './chunk-
|
|
2
|
-
import { init_esm_shims } from './chunk-
|
|
3
|
-
import { exec } from 'child_process';
|
|
4
|
-
import { promises } from 'fs';
|
|
5
|
-
import { promisify } from 'util';
|
|
1
|
+
import { findUp } from './chunk-FNSPUDYX.js';
|
|
2
|
+
import { init_esm_shims } from './chunk-HRFGJCX3.js';
|
|
3
|
+
import { exec } from 'node:child_process';
|
|
4
|
+
import { promises } from 'node:fs';
|
|
5
|
+
import { promisify } from 'node:util';
|
|
6
6
|
import { valid } from 'semver';
|
|
7
|
-
import { extname } from 'path';
|
|
7
|
+
import { extname } from 'node:path';
|
|
8
8
|
|
|
9
9
|
// ../foundry-config-json/build/esm/autoVersion.js
|
|
10
10
|
init_esm_shims();
|
|
@@ -26,7 +26,7 @@ async function autoVersion(config) {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
async function gitDescribeAutoVersion(tagPrefix = "") {
|
|
29
|
-
const [matchPrefix, prefixRegex] = tagPrefix !== "" ? [tagPrefix, new RegExp(`^${tagPrefix}`)] : [
|
|
29
|
+
const [matchPrefix, prefixRegex] = tagPrefix !== "" ? [tagPrefix, new RegExp(`^${tagPrefix}`)] : [void 0, new RegExp(`^v?`)];
|
|
30
30
|
const gitVersion = await gitDescribe(matchPrefix);
|
|
31
31
|
const version = gitVersion.trim().replace(prefixRegex, "");
|
|
32
32
|
validateVersion(version);
|
|
@@ -181,7 +181,7 @@ async function loadFoundryConfig(type) {
|
|
|
181
181
|
const validate = ajv.compile(FOUNDRY_CONFIG_SCHEMA[type]);
|
|
182
182
|
const {
|
|
183
183
|
findUp: findUp2
|
|
184
|
-
} = await import('./find-up-
|
|
184
|
+
} = await import('./find-up-J6UG2A4A.js');
|
|
185
185
|
const configFilePath = await findUp2(CONFIG_FILE_NAMES);
|
|
186
186
|
if (configFilePath) {
|
|
187
187
|
let foundryConfig;
|
|
@@ -199,7 +199,7 @@ async function loadFoundryConfig(type) {
|
|
|
199
199
|
configFilePath
|
|
200
200
|
};
|
|
201
201
|
}
|
|
202
|
-
return
|
|
202
|
+
return void 0;
|
|
203
203
|
}
|
|
204
204
|
function parseConfigFile(fileContent, configFilePath) {
|
|
205
205
|
const extension = extname(configFilePath);
|
|
@@ -212,5 +212,5 @@ function parseConfigFile(fileContent, configFilePath) {
|
|
|
212
212
|
}
|
|
213
213
|
|
|
214
214
|
export { AutoVersionError, autoVersion, loadFoundryConfig };
|
|
215
|
-
//# sourceMappingURL=chunk-
|
|
216
|
-
//# sourceMappingURL=chunk-
|
|
215
|
+
//# sourceMappingURL=chunk-SB26PVZG.js.map
|
|
216
|
+
//# sourceMappingURL=chunk-SB26PVZG.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../foundry-config-json/build/esm/autoVersion.js","../../../foundry-config-json/build/esm/index.js","../../../foundry-config-json/build/esm/config.js"],"names":["fsPromises","findUp"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AO,OAAA,SAAA;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-KXNCVDQG.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 { exec } from \"node:child_process\";\nimport { promises as fsPromises } from \"node:fs\";\nimport { promisify } from \"node:util\";\nimport { valid } from \"semver\";\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 execAsync = promisify(exec);\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 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
|
+
{"version":3,"sources":["../../../foundry-config-json/build/esm/autoVersion.js","../../../foundry-config-json/build/esm/index.js","../../../foundry-config-json/build/esm/config.js"],"names":["fsPromises","findUp"],"mappings":";;;;;;;;;AAAA,cAAA,EAAA;AAqBa,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,WAAA,CAAY,WAAW,CAAA;AAChD,EAAA,MAAM,UAAU,UAAW,CAAA,IAAA,EAAO,CAAA,OAAA,CAAQ,aAAa,EAAE,CAAA;AACzD,EAAA,eAAA,CAAgB,OAAO,CAAA;AACvB,EAAO,OAAA,OAAA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AAM,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-SB26PVZG.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 { exec } from \"node:child_process\";\nimport { promises as fsPromises } from \"node:fs\";\nimport { promisify } from \"node:util\";\nimport { valid } from \"semver\";\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 execAsync = promisify(exec);\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 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,4 +1,4 @@
|
|
|
1
|
-
import { __commonJS, init_esm_shims, __toESM } from './chunk-
|
|
1
|
+
import { __commonJS, init_esm_shims, __toESM } from './chunk-HRFGJCX3.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({
|
|
@@ -12,13 +12,13 @@ var require_fetch_retry = __commonJS({
|
|
|
12
12
|
if (typeof defaults !== "object") {
|
|
13
13
|
throw new ArgumentError("defaults must be an object");
|
|
14
14
|
}
|
|
15
|
-
if (defaults.retries !==
|
|
15
|
+
if (defaults.retries !== void 0 && !isPositiveInteger(defaults.retries)) {
|
|
16
16
|
throw new ArgumentError("retries must be a positive integer");
|
|
17
17
|
}
|
|
18
|
-
if (defaults.retryDelay !==
|
|
18
|
+
if (defaults.retryDelay !== void 0 && !isPositiveInteger(defaults.retryDelay) && typeof defaults.retryDelay !== "function") {
|
|
19
19
|
throw new ArgumentError("retryDelay must be a positive integer or a function returning a positive integer");
|
|
20
20
|
}
|
|
21
|
-
if (defaults.retryOn !==
|
|
21
|
+
if (defaults.retryOn !== void 0 && !Array.isArray(defaults.retryOn) && typeof defaults.retryOn !== "function") {
|
|
22
22
|
throw new ArgumentError("retryOn property expects an array or function");
|
|
23
23
|
}
|
|
24
24
|
var baseDefaults = {
|
|
@@ -31,14 +31,14 @@ var require_fetch_retry = __commonJS({
|
|
|
31
31
|
var retries = defaults.retries;
|
|
32
32
|
var retryDelay = defaults.retryDelay;
|
|
33
33
|
var retryOn = defaults.retryOn;
|
|
34
|
-
if (init && init.retries !==
|
|
34
|
+
if (init && init.retries !== void 0) {
|
|
35
35
|
if (isPositiveInteger(init.retries)) {
|
|
36
36
|
retries = init.retries;
|
|
37
37
|
} else {
|
|
38
38
|
throw new ArgumentError("retries must be a positive integer");
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
if (init && init.retryDelay !==
|
|
41
|
+
if (init && init.retryDelay !== void 0) {
|
|
42
42
|
if (isPositiveInteger(init.retryDelay) || typeof init.retryDelay === "function") {
|
|
43
43
|
retryDelay = init.retryDelay;
|
|
44
44
|
} else {
|
|
@@ -139,8 +139,8 @@ init_esm_shims();
|
|
|
139
139
|
// ../shared.net.errors/build/esm/UnknownError.js
|
|
140
140
|
init_esm_shims();
|
|
141
141
|
var UnknownError = class extends PalantirApiError {
|
|
142
|
-
constructor(message,
|
|
143
|
-
super(message,
|
|
142
|
+
constructor(message, errorName, originalError, statusCode) {
|
|
143
|
+
super(message, errorName, void 0, statusCode);
|
|
144
144
|
this.originalError = originalError;
|
|
145
145
|
}
|
|
146
146
|
};
|
|
@@ -172,25 +172,32 @@ function createFetchOrThrow(fetchFn = fetch) {
|
|
|
172
172
|
throw convertError(e, "A network error occurred");
|
|
173
173
|
}
|
|
174
174
|
if (!response.ok) {
|
|
175
|
+
const fallbackMessage = `Failed to fetch ${response.status} ${response.statusText}`;
|
|
175
176
|
if (response.headers.get("Content-Type") === "text/plain") {
|
|
176
|
-
throw
|
|
177
|
+
throw unknownError(await response.text(), response.status);
|
|
178
|
+
}
|
|
179
|
+
if (response.headers.get("Content-Type") === "text/html") {
|
|
180
|
+
throw unknownError(fallbackMessage, response.status, new Error("Received HTML error page: " + await response.text()));
|
|
177
181
|
}
|
|
178
182
|
let body;
|
|
179
183
|
try {
|
|
180
184
|
body = await response.json();
|
|
181
185
|
} catch (e) {
|
|
182
|
-
throw
|
|
186
|
+
throw unknownError(fallbackMessage, response.status, e instanceof Error ? e : void 0);
|
|
183
187
|
}
|
|
184
|
-
throw new PalantirApiError(body?.message ??
|
|
188
|
+
throw new PalantirApiError(body?.message ?? fallbackMessage, body?.errorName, body?.errorCode, response.status, body?.errorInstanceId, body?.parameters);
|
|
185
189
|
}
|
|
186
190
|
return response;
|
|
187
191
|
};
|
|
188
192
|
}
|
|
189
193
|
function convertError(e, msgIfNotError = "An unknown error occurred") {
|
|
190
194
|
if (e instanceof Error) {
|
|
191
|
-
return
|
|
195
|
+
return unknownError(e.message, void 0, e);
|
|
192
196
|
}
|
|
193
|
-
return
|
|
197
|
+
return unknownError(msgIfNotError, void 0);
|
|
198
|
+
}
|
|
199
|
+
function unknownError(message, statusCode, originalError) {
|
|
200
|
+
return new UnknownError(message, void 0, originalError, statusCode);
|
|
194
201
|
}
|
|
195
202
|
|
|
196
203
|
// ../shared.net.fetch/build/esm/createRetryingFetch.js
|
|
@@ -226,6 +233,6 @@ var TOO_MANY_REQUESTS = 429;
|
|
|
226
233
|
// ../shared.net.fetch/build/esm/index.js
|
|
227
234
|
init_esm_shims();
|
|
228
235
|
|
|
229
|
-
export { PalantirApiError, createFetchHeaderMutator, createFetchOrThrow, createRetryingFetch };
|
|
230
|
-
//# sourceMappingURL=chunk-
|
|
231
|
-
//# sourceMappingURL=chunk-
|
|
236
|
+
export { PalantirApiError, UnknownError, createFetchHeaderMutator, createFetchOrThrow, createRetryingFetch };
|
|
237
|
+
//# sourceMappingURL=chunk-WID24PKG.js.map
|
|
238
|
+
//# sourceMappingURL=chunk-WID24PKG.js.map
|