@osdk/cli 0.31.0-beta.2 → 0.31.0
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 +23 -0
- package/build/esm/{acorn-YSEQ53CG.js → acorn-2YJLPGID.js} +3 -3
- package/build/esm/{acorn-YSEQ53CG.js.map → acorn-2YJLPGID.js.map} +1 -1
- package/build/esm/{angular-7FD4VEB2.js → angular-2UQQBORC.js} +3 -3
- package/build/esm/{angular-7FD4VEB2.js.map → angular-2UQQBORC.js.map} +1 -1
- package/build/esm/{babel-4O5ROH7P.js → babel-BV4W3BOJ.js} +3 -3
- package/build/esm/{babel-4O5ROH7P.js.map → babel-BV4W3BOJ.js.map} +1 -1
- package/build/esm/{chunk-Z2MJFYY7.js → chunk-4L3JS54F.js} +3 -3
- package/build/esm/{chunk-Z2MJFYY7.js.map → chunk-4L3JS54F.js.map} +1 -1
- package/build/esm/{chunk-QINZLUQ3.js → chunk-ALV6NI27.js} +3 -3
- package/build/esm/{chunk-QINZLUQ3.js.map → chunk-ALV6NI27.js.map} +1 -1
- package/build/esm/{chunk-ESVT7U37.js → chunk-BL3NTXLM.js} +3 -3
- package/build/esm/{chunk-ESVT7U37.js.map → chunk-BL3NTXLM.js.map} +1 -1
- package/build/esm/{chunk-RBJBODXB.js → chunk-CINFOKVJ.js} +3 -3
- package/build/esm/{chunk-RBJBODXB.js.map → chunk-CINFOKVJ.js.map} +1 -1
- package/build/esm/{chunk-JMZKMGV3.js → chunk-CMWYDM5Q.js} +3 -3
- package/build/esm/{chunk-JMZKMGV3.js.map → chunk-CMWYDM5Q.js.map} +1 -1
- package/build/esm/{chunk-734SVMAK.js → chunk-TDNRRWOC.js} +3 -3
- package/build/esm/{chunk-734SVMAK.js.map → chunk-TDNRRWOC.js.map} +1 -1
- package/build/esm/{chunk-S5ZOEHLJ.js → chunk-TSX7O7HY.js} +6 -6
- package/build/esm/{chunk-S5ZOEHLJ.js.map → chunk-TSX7O7HY.js.map} +1 -1
- package/build/esm/{chunk-VI2PPUJW.js → chunk-W7U4ETYH.js} +3 -3
- package/build/esm/{chunk-VI2PPUJW.js.map → chunk-W7U4ETYH.js.map} +1 -1
- package/build/esm/{chunk-PTWXGEFK.js → chunk-XF44FMSL.js} +5 -5
- package/build/esm/{chunk-PTWXGEFK.js.map → chunk-XF44FMSL.js.map} +1 -1
- package/build/esm/{estree-EM55NQOH.js → estree-PTS7QPRO.js} +3 -3
- package/build/esm/{estree-EM55NQOH.js.map → estree-PTS7QPRO.js.map} +1 -1
- package/build/esm/find-up-GVGEKQPQ.js +4 -0
- package/build/esm/{find-up-4NYOPMEX.js.map → find-up-GVGEKQPQ.js.map} +1 -1
- package/build/esm/{flow-Q44IFPPY.js → flow-Y46VD55R.js} +3 -3
- package/build/esm/{flow-Q44IFPPY.js.map → flow-Y46VD55R.js.map} +1 -1
- package/build/esm/{glimmer-IAOCCN7N.js → glimmer-SE4IEQF6.js} +3 -3
- package/build/esm/{glimmer-IAOCCN7N.js.map → glimmer-SE4IEQF6.js.map} +1 -1
- package/build/esm/{graphql-FSED3VAI.js → graphql-QF7PMC3R.js} +3 -3
- package/build/esm/{graphql-FSED3VAI.js.map → graphql-QF7PMC3R.js.map} +1 -1
- package/build/esm/{handleGenerate-WZRH2AEA.js → handleGenerate-HZSOXAY7.js} +80 -50
- package/build/esm/handleGenerate-HZSOXAY7.js.map +1 -0
- package/build/esm/{html-X5TDJHVJ.js → html-EQKLXLBJ.js} +3 -3
- package/build/esm/{html-X5TDJHVJ.js.map → html-EQKLXLBJ.js.map} +1 -1
- package/build/esm/index.js +18 -22
- package/build/esm/index.js.map +1 -1
- package/build/esm/loginFlow-GP5ZJP3D.js +4 -0
- package/build/esm/{loginFlow-IXG6OKLA.js.map → loginFlow-GP5ZJP3D.js.map} +1 -1
- package/build/esm/{markdown-3BO6WVIC.js → markdown-FZBHQ3B4.js} +3 -3
- package/build/esm/{markdown-3BO6WVIC.js.map → markdown-FZBHQ3B4.js.map} +1 -1
- package/build/esm/{meriyah-VLP2WI6O.js → meriyah-Q2DK6BAD.js} +3 -3
- package/build/esm/{meriyah-VLP2WI6O.js.map → meriyah-Q2DK6BAD.js.map} +1 -1
- package/build/esm/{postcss-HMVGVGRU.js → postcss-SR3FYBVU.js} +3 -3
- package/build/esm/{postcss-HMVGVGRU.js.map → postcss-SR3FYBVU.js.map} +1 -1
- package/build/esm/{siteDeployCommand-I3SPEO3S.js → siteDeployCommand-ZF3US2OO.js} +8 -8
- package/build/esm/{siteDeployCommand-I3SPEO3S.js.map → siteDeployCommand-ZF3US2OO.js.map} +1 -1
- package/build/esm/{typescript-22FVOYI3.js → typescript-DEUJRDXE.js} +3 -3
- package/build/esm/{typescript-22FVOYI3.js.map → typescript-DEUJRDXE.js.map} +1 -1
- package/build/esm/{versionDeleteCommand-4E2TBJJQ.js → versionDeleteCommand-GTGX4WSA.js} +7 -7
- package/build/esm/{versionDeleteCommand-4E2TBJJQ.js.map → versionDeleteCommand-GTGX4WSA.js.map} +1 -1
- package/build/esm/{versionDeleteCommand-4X4FYM5L.js → versionDeleteCommand-KPDNFCLU.js} +7 -7
- package/build/esm/{versionDeleteCommand-4X4FYM5L.js.map → versionDeleteCommand-KPDNFCLU.js.map} +1 -1
- package/build/esm/{versionGetCommand-JJYAOKZQ.js → versionGetCommand-CYPONYBC.js} +6 -6
- package/build/esm/{versionGetCommand-JJYAOKZQ.js.map → versionGetCommand-CYPONYBC.js.map} +1 -1
- package/build/esm/{versionInfoCommand-D6DYQEHL.js → versionInfoCommand-ZZ6GO7PX.js} +6 -6
- package/build/esm/{versionInfoCommand-D6DYQEHL.js.map → versionInfoCommand-ZZ6GO7PX.js.map} +1 -1
- package/build/esm/{versionListCommand-T4SW5I7I.js → versionListCommand-DAID4G25.js} +6 -6
- package/build/esm/{versionListCommand-T4SW5I7I.js.map → versionListCommand-DAID4G25.js.map} +1 -1
- package/build/esm/{versionListCommand-XA66WI62.js → versionListCommand-GMO5SYUE.js} +6 -6
- package/build/esm/{versionListCommand-XA66WI62.js.map → versionListCommand-GMO5SYUE.js.map} +1 -1
- package/build/esm/{versionSetCommand-OMCMNAXY.js → versionSetCommand-3OJ335BU.js} +6 -6
- package/build/esm/{versionSetCommand-OMCMNAXY.js.map → versionSetCommand-3OJ335BU.js.map} +1 -1
- package/build/esm/{versionUnsetCommand-LVYQ6ADH.js → versionUnsetCommand-57HRMYXS.js} +7 -7
- package/build/esm/{versionUnsetCommand-LVYQ6ADH.js.map → versionUnsetCommand-57HRMYXS.js.map} +1 -1
- package/build/esm/{widgetSetDeployCommand-J4VTJLVR.js → widgetSetDeployCommand-JDUWKQMU.js} +7 -7
- package/build/esm/{widgetSetDeployCommand-J4VTJLVR.js.map → widgetSetDeployCommand-JDUWKQMU.js.map} +1 -1
- package/build/esm/{yaml-AXQPPS5Y.js → yaml-KQJSRZTS.js} +3 -3
- package/build/esm/{yaml-AXQPPS5Y.js.map → yaml-KQJSRZTS.js.map} +1 -1
- package/package.json +9 -9
- package/build/esm/find-up-4NYOPMEX.js +0 -4
- package/build/esm/handleGenerate-WZRH2AEA.js.map +0 -1
- package/build/esm/loginFlow-IXG6OKLA.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { init_esm_shims } from './chunk-
|
|
1
|
+
import { init_esm_shims } from './chunk-CINFOKVJ.js';
|
|
2
2
|
import { consola } from 'consola';
|
|
3
3
|
|
|
4
4
|
// src/consola/handlePromptCancel.ts
|
|
@@ -14,5 +14,5 @@ function handlePromptCancel(promptResponse) {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export { handlePromptCancel };
|
|
17
|
-
//# sourceMappingURL=chunk-
|
|
18
|
-
//# sourceMappingURL=chunk-
|
|
17
|
+
//# sourceMappingURL=chunk-4L3JS54F.js.map
|
|
18
|
+
//# sourceMappingURL=chunk-4L3JS54F.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/consola/handlePromptCancel.ts"],"names":[],"mappings":";;;;AAAA,cAAA,EAAA;AAmBA,IAAM,YAAA,GAAe,MAAO,CAAA,GAAA,CAAI,QAAQ,CAAA;AACjC,SAAS,mBAAmB,cAAgB,EAAA;AACjD,EAAA,MAAM,OAAU,GAAA,OAAO,cAAmB,KAAA,SAAA,IAAa,CAAC,cAAA;AACxD,EAAA,MAAM,WAAW,cAAmB,KAAA,YAAA;AACpC,EAAA,IAAI,YAAY,OAAS,EAAA;AACvB,IAAA,OAAA,CAAQ,KAAK,qBAAqB,CAAA;AAClC,IAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAAA;AAElB","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../../src/consola/handlePromptCancel.ts"],"names":[],"mappings":";;;;AAAA,cAAA,EAAA;AAmBA,IAAM,YAAA,GAAe,MAAO,CAAA,GAAA,CAAI,QAAQ,CAAA;AACjC,SAAS,mBAAmB,cAAgB,EAAA;AACjD,EAAA,MAAM,OAAU,GAAA,OAAO,cAAmB,KAAA,SAAA,IAAa,CAAC,cAAA;AACxD,EAAA,MAAM,WAAW,cAAmB,KAAA,YAAA;AACpC,EAAA,IAAI,YAAY,OAAS,EAAA;AACvB,IAAA,OAAA,CAAQ,KAAK,qBAAqB,CAAA;AAClC,IAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAAA;AAElB","file":"chunk-4L3JS54F.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 { consola } from \"consola\";\n\n// https://github.com/unjs/consola?tab=readme-ov-file#await-promptmessage--type-cancel-\nconst cancelSymbol = Symbol.for(\"cancel\");\nexport function handlePromptCancel(promptResponse) {\n const isFalse = typeof promptResponse === \"boolean\" && !promptResponse;\n const isSigInt = promptResponse === cancelSymbol;\n if (isSigInt || isFalse) {\n consola.fail(\"Operation cancelled\");\n process.exit(0);\n }\n}"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { init_esm_shims } from './chunk-
|
|
1
|
+
import { init_esm_shims } from './chunk-CINFOKVJ.js';
|
|
2
2
|
import consola from 'consola';
|
|
3
3
|
import { getRandomValues, subtle } from 'crypto';
|
|
4
4
|
import { createServer } from 'http';
|
|
@@ -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-ALV6NI27.js.map
|
|
127
|
+
//# sourceMappingURL=chunk-ALV6NI27.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,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A,QAAA,EAAU,WAAa,EAAA,IAAA,EAAM,SAAS,YAAc,EAAA;AAC1F,EAAM,MAAA,IAAA,GAAO,IAAI,eAAgB,EAAA;AACjC,EAAK,IAAA,CAAA,MAAA,CAAO,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-QINZLUQ3.js","sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { invokeLoginFlow as default } from \"../commands/auth/login/loginFlow.js\";","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport consola from \"consola\";\nimport { getRandomValues, subtle } from \"node:crypto\";\nimport { createServer } from \"node:http\";\nimport { join } from \"node:path/posix\";\nimport { exit } from \"node:process\";\nimport { parse } from \"node:url\";\nimport open from \"open\";\nimport { isTokenErrorResponse } from \"./token.js\";\nconst BROWSER_PROMPT_TIME_MS = 60 * 1000;\nexport async function invokeLoginFlow(args) {\n consola.start(`Authenticating using application id: ${args.clientId}`);\n const redirectUrl = \"http://localhost:8080/auth/callback\";\n const port = parse(redirectUrl).port;\n let resolve;\n const authCode = new Promise(_res => {\n resolve = _res;\n });\n const server = createServer((req, res) => {\n const query = parse(req.url, true).query;\n res.end(\"Authenticated\");\n resolve(query[\"code\"]);\n });\n server.on(\"error\", e => {\n if (e.code === \"EADDRINUSE\") {\n consola.error(`Port ${port} is already in use, unable to perform authentication flow.`);\n server.close();\n exit(1);\n }\n });\n server.listen(port);\n const clientId = args.clientId;\n const state = generateRandomString();\n const codeVerifier = generateRandomString();\n const codeChallenge = await generateCodeChallenge(codeVerifier);\n const authorizeUrl = generateAuthorizeUrl(args.foundryUrl, clientId, state, redirectUrl, codeChallenge);\n try {\n await open(authorizeUrl);\n } catch {\n consola.warn(`Unable to open browser, please open this url in your browser to to authenticate: ${authorizeUrl}`);\n }\n\n // nag the user if we didn't get an auth token for a relatively long time\n const browserPrompt = setTimeout(() => {\n consola.warn(`Still waiting for the authentication to complete. Please open a browser to ${authorizeUrl}`);\n }, BROWSER_PROMPT_TIME_MS);\n const code = await authCode;\n server.close();\n clearTimeout(browserPrompt);\n const token = await getTokenWithCodeVerifier(clientId, redirectUrl, code, args.foundryUrl, codeVerifier);\n if (isTokenErrorResponse(token)) {\n consola.error(\"Unable to authenticate\", token.error, token.error_description);\n exit(1);\n }\n consola.success(`Successfully authenticated!`);\n return token;\n}\nfunction generateRandomString(length = 128) {\n const characters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~\";\n const output = [];\n const array = new Uint8Array(1);\n const maxIndex = 256 - 256 % characters.length;\n while (output.length < length) {\n getRandomValues(array);\n if (array[0] < maxIndex) {\n output.push(characters[array[0] % characters.length]);\n }\n }\n return output.join(\"\");\n}\nasync function generateCodeChallenge(codeVerifier) {\n const data = new TextEncoder().encode(codeVerifier);\n const digest = await subtle.digest(\"SHA-256\", data);\n const codeChallenge = btoa(String.fromCharCode(...new Uint8Array(digest))).replace(/\\//g, \"_\").replace(/\\+/g, \"-\").replace(/=/g, \"\");\n return {\n codeChallenge,\n codeChallengeMethod: \"S256\"\n };\n}\nfunction generateAuthorizeUrl(baseUrl, clientId, state, redirectUrl, codeChallenge) {\n const queryParams = new URLSearchParams();\n queryParams.append(\"client_id\", clientId);\n queryParams.append(\"response_type\", \"code\");\n queryParams.append(\"state\", state);\n queryParams.append(\"redirect_uri\", redirectUrl);\n queryParams.append(\"code_challenge\", codeChallenge.codeChallenge);\n queryParams.append(\"code_challenge_method\", codeChallenge.codeChallengeMethod);\n queryParams.append(\"scope\", [\"offline_access\", \"api:read-data\", \"api:use-ontologies-read\"].join(\" \"));\n return join(baseUrl, \"multipass\", \"api\", \"oauth2\", \"authorize\") + `?` + queryParams.toString();\n}\nasync function getTokenWithCodeVerifier(clientId, redirectUrl, code, baseUrl, codeVerifier) {\n const body = new URLSearchParams();\n body.append(\"client_id\", clientId);\n body.append(\"grant_type\", \"authorization_code\");\n body.append(\"code\", code);\n body.append(\"redirect_uri\", redirectUrl);\n body.append(\"code_verifier\", codeVerifier);\n const tokenUrl = join(baseUrl, \"multipass\", \"api\", \"oauth2\", \"token\") + `?state=${codeVerifier}`;\n try {\n const response = await fetch(tokenUrl, {\n body: body.toString(),\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\"\n },\n method: \"POST\"\n });\n const responseText = await response.json();\n return responseText;\n } catch (e) {\n throw new Error(`Failed to get token: ${e?.cause?.toString() ?? e?.toString() ?? \"Unknown error\"}`);\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function isTokenErrorResponse(response) {\n return response.error != null;\n}"]}
|
|
1
|
+
{"version":3,"sources":["../../../cli.common/build/esm/public/loginFlow.js","../../../cli.common/build/esm/commands/auth/login/loginFlow.js","../../../cli.common/build/esm/commands/auth/login/token.js"],"names":[],"mappings":";;;;;;;;;;AAAA,cAAA,EAAA;;;ACAA,cAAA,EAAA;;;ACAA,cAAA,EAAA;AAgBO,SAAS,qBAAqB,QAAU,EAAA;AAC7C,EAAA,OAAO,SAAS,KAAS,IAAA,IAAA;AAC3B;;;ADMA,IAAM,yBAAyB,EAAK,GAAA,GAAA;AACpC,eAAsB,gBAAgB,IAAM,EAAA;AAC1C,EAAA,OAAA,CAAQ,KAAM,CAAA,CAAA,qCAAA,EAAwC,IAAK,CAAA,QAAQ,CAAE,CAAA,CAAA;AACrE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W,CAAA,GAAI,CAAM,CAAA,CAAA,GAAA,WAAA,CAAY,QAAS,EAAA;AAC/F;AACA,eAAe,wBAAyB,CAAA,QAAA,EAAU,WAAa,EAAA,IAAA,EAAM,SAAS,YAAc,EAAA;AAC1F,EAAM,MAAA,IAAA,GAAO,IAAI,eAAgB,EAAA;AACjC,EAAK,IAAA,CAAA,MAAA,CAAO,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-ALV6NI27.js","sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { invokeLoginFlow as default } from \"../commands/auth/login/loginFlow.js\";","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport consola from \"consola\";\nimport { getRandomValues, subtle } from \"node:crypto\";\nimport { createServer } from \"node:http\";\nimport { join } from \"node:path/posix\";\nimport { exit } from \"node:process\";\nimport { parse } from \"node:url\";\nimport open from \"open\";\nimport { isTokenErrorResponse } from \"./token.js\";\nconst BROWSER_PROMPT_TIME_MS = 60 * 1000;\nexport async function invokeLoginFlow(args) {\n consola.start(`Authenticating using application id: ${args.clientId}`);\n const redirectUrl = \"http://localhost:8080/auth/callback\";\n const port = parse(redirectUrl).port;\n let resolve;\n const authCode = new Promise(_res => {\n resolve = _res;\n });\n const server = createServer((req, res) => {\n const query = parse(req.url, true).query;\n res.end(\"Authenticated\");\n resolve(query[\"code\"]);\n });\n server.on(\"error\", e => {\n if (e.code === \"EADDRINUSE\") {\n consola.error(`Port ${port} is already in use, unable to perform authentication flow.`);\n server.close();\n exit(1);\n }\n });\n server.listen(port);\n const clientId = args.clientId;\n const state = generateRandomString();\n const codeVerifier = generateRandomString();\n const codeChallenge = await generateCodeChallenge(codeVerifier);\n const authorizeUrl = generateAuthorizeUrl(args.foundryUrl, clientId, state, redirectUrl, codeChallenge);\n try {\n await open(authorizeUrl);\n } catch {\n consola.warn(`Unable to open browser, please open this url in your browser to to authenticate: ${authorizeUrl}`);\n }\n\n // nag the user if we didn't get an auth token for a relatively long time\n const browserPrompt = setTimeout(() => {\n consola.warn(`Still waiting for the authentication to complete. Please open a browser to ${authorizeUrl}`);\n }, BROWSER_PROMPT_TIME_MS);\n const code = await authCode;\n server.close();\n clearTimeout(browserPrompt);\n const token = await getTokenWithCodeVerifier(clientId, redirectUrl, code, args.foundryUrl, codeVerifier);\n if (isTokenErrorResponse(token)) {\n consola.error(\"Unable to authenticate\", token.error, token.error_description);\n exit(1);\n }\n consola.success(`Successfully authenticated!`);\n return token;\n}\nfunction generateRandomString(length = 128) {\n const characters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~\";\n const output = [];\n const array = new Uint8Array(1);\n const maxIndex = 256 - 256 % characters.length;\n while (output.length < length) {\n getRandomValues(array);\n if (array[0] < maxIndex) {\n output.push(characters[array[0] % characters.length]);\n }\n }\n return output.join(\"\");\n}\nasync function generateCodeChallenge(codeVerifier) {\n const data = new TextEncoder().encode(codeVerifier);\n const digest = await subtle.digest(\"SHA-256\", data);\n const codeChallenge = btoa(String.fromCharCode(...new Uint8Array(digest))).replace(/\\//g, \"_\").replace(/\\+/g, \"-\").replace(/=/g, \"\");\n return {\n codeChallenge,\n codeChallengeMethod: \"S256\"\n };\n}\nfunction generateAuthorizeUrl(baseUrl, clientId, state, redirectUrl, codeChallenge) {\n const queryParams = new URLSearchParams();\n queryParams.append(\"client_id\", clientId);\n queryParams.append(\"response_type\", \"code\");\n queryParams.append(\"state\", state);\n queryParams.append(\"redirect_uri\", redirectUrl);\n queryParams.append(\"code_challenge\", codeChallenge.codeChallenge);\n queryParams.append(\"code_challenge_method\", codeChallenge.codeChallengeMethod);\n queryParams.append(\"scope\", [\"offline_access\", \"api:read-data\", \"api:use-ontologies-read\"].join(\" \"));\n return join(baseUrl, \"multipass\", \"api\", \"oauth2\", \"authorize\") + `?` + queryParams.toString();\n}\nasync function getTokenWithCodeVerifier(clientId, redirectUrl, code, baseUrl, codeVerifier) {\n const body = new URLSearchParams();\n body.append(\"client_id\", clientId);\n body.append(\"grant_type\", \"authorization_code\");\n body.append(\"code\", code);\n body.append(\"redirect_uri\", redirectUrl);\n body.append(\"code_verifier\", codeVerifier);\n const tokenUrl = join(baseUrl, \"multipass\", \"api\", \"oauth2\", \"token\") + `?state=${codeVerifier}`;\n try {\n const response = await fetch(tokenUrl, {\n body: body.toString(),\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\"\n },\n method: \"POST\"\n });\n const responseText = await response.json();\n return responseText;\n } catch (e) {\n throw new Error(`Failed to get token: ${e?.cause?.toString() ?? e?.toString() ?? \"Unknown error\"}`);\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function isTokenErrorResponse(response) {\n return response.error != null;\n}"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { init_esm_shims } from './chunk-
|
|
1
|
+
import { init_esm_shims } from './chunk-CINFOKVJ.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-BL3NTXLM.js.map
|
|
84
|
+
//# sourceMappingURL=chunk-BL3NTXLM.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,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A,GACf,CAAA;AACH;;;AEhDA,cAAA,EAAA;AAiBO,SAAS,cAAc,YAAc,EAAA;AAC1C,EAAO,OAAA,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,KAA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AQ,KAAK,CAAC,CAAA;AAAA,GACf,CAAA;AACH;;;AEhDA,cAAA,EAAA;AAiBO,SAAS,cAAc,YAAc,EAAA;AAC1C,EAAO,OAAA,KAAA,CAAM,YAAY,CAAK,IAAA,IAAA;AAChC","file":"chunk-BL3NTXLM.js","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport class ExitProcessError extends Error {\n constructor(errorCode, msg, tip, originalError) {\n super(msg);\n this.errorCode = errorCode;\n this.msg = msg;\n this.tip = tip;\n this.originalError = originalError;\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport class YargsCheckError extends Error {\n constructor(msg) {\n super(msg);\n }\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { ExitProcessError } from \"./ExitProcessError.js\";\nexport { getYargsBase } from \"./getYargsBase.js\";\nexport { isValidSemver } from \"./util/isValidSemver.js\";\nexport { YargsCheckError } from \"./YargsCheckError.js\";","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nimport { colorize } from \"consola/utils\";\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport { ExitProcessError } from \"./ExitProcessError.js\";\nimport { logLevelMiddleware } from \"./yargs/logLevelMiddleware.js\";\nimport { YargsCheckError } from \"./YargsCheckError.js\";\nexport function getYargsBase(args) {\n return yargs(hideBin(args)).wrap(Math.min(150, yargs().terminalWidth())).env(\"OSDK\").version(false).option(\"verbose\", {\n alias: \"v\",\n type: \"boolean\",\n description: \"Enable verbose logging\",\n count: true\n }).demandCommand().middleware(logLevelMiddleware, true).strict().fail(async (msg, err, argv) => {\n if (err instanceof ExitProcessError) {\n consola.error(err.message);\n if (err.tip != null) {\n consola.log(colorize(\"bold\", `💡 Tip: ${err.tip}`));\n consola.log(\"\");\n }\n consola.debug(err.stack);\n } else {\n if (err && !(err instanceof YargsCheckError)) {\n throw err;\n } else {\n argv.showHelp();\n consola.log(\"\");\n consola.error(msg);\n }\n }\n process.exit(1);\n });\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nlet firstTime = true;\nexport async function logLevelMiddleware(args) {\n if (firstTime) {\n firstTime = false;\n consola.level = 3 + args.verbose; // so 1 -v is debug logs and -vv is trace\n if (consola.level > 3) {\n consola.debug(`Verbose logging enabled (${consola.level === 4 ? \"debug\" : \"trace\"})\\n`);\n }\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { valid } from \"semver\";\nexport function isValidSemver(semverString) {\n return valid(semverString) != null;\n}"]}
|
|
@@ -34,10 +34,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
34
34
|
mod
|
|
35
35
|
));
|
|
36
36
|
var init_esm_shims = __esm({
|
|
37
|
-
"../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.52.11_@types+node@18.19.124__@swc+core@1.7.
|
|
37
|
+
"../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.52.11_@types+node@18.19.124__@swc+core@1.7.39_jit_5812e3bb233f51687c0be44fc94bb79b/node_modules/tsup/assets/esm_shims.js"() {
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
export { __commonJS, __export, __toESM, init_esm_shims };
|
|
42
|
-
//# sourceMappingURL=chunk-
|
|
43
|
-
//# sourceMappingURL=chunk-
|
|
42
|
+
//# sourceMappingURL=chunk-CINFOKVJ.js.map
|
|
43
|
+
//# sourceMappingURL=chunk-CINFOKVJ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.52.11_@types+node@18.19.124__@swc+core@1.7.
|
|
1
|
+
{"version":3,"sources":["../../../../node_modules/.pnpm/tsup@8.5.0_@microsoft+api-extractor@7.52.11_@types+node@18.19.124__@swc+core@1.7.39_jit_5812e3bb233f51687c0be44fc94bb79b/node_modules/tsup/assets/esm_shims.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,cAAA,GAAA,KAAA,CAAA;AAAA,EAAA,yLAAA,GAAA;AAAA;AAAA,CAAA","file":"chunk-CINFOKVJ.js","sourcesContent":["// Shim globals in esm bundle\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\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-CINFOKVJ.js';
|
|
2
2
|
import path2 from 'path';
|
|
3
3
|
import process from 'process';
|
|
4
4
|
import fs, { promises } from 'fs';
|
|
@@ -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-CMWYDM5Q.js.map
|
|
332
|
+
//# sourceMappingURL=chunk-CMWYDM5Q.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,MAAW;AAAA,EACT,KAAA;AAAA,EACA,IAAA;AAAA,EACA,YAAY,KAAO,EAAA;AACjB,IAAA,IAAA,CAAK,KAAQ,GAAA,KAAA;AAAA;AAEjB,CAAA;AACA,IAAqB,QAArB,MAA2B;AAAA,EACzB,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,WAAc,GAAA;AACZ,IAAA,IAAA,CAAK,KAAM,EAAA;AAAA;AACb,EACA,QAAQ,KAAO,EAAA;AACb,IAAM,MAAA,IAAA,GAAO,IAAI,IAAA,CAAK,KAAK,CAAA;AAC3B,IAAA,IAAI,KAAK,KAAO,EAAA;AACd,MAAA,IAAA,CAAK,MAAM,IAAO,GAAA,IAAA;AAClB,MAAA,IAAA,CAAK,KAAQ,GAAA,IAAA;AAAA,KACR,MAAA;AACL,MAAA,IAAA,CAAK,KAAQ,GAAA,IAAA;AACb,MAAA,IAAA,CAAK,KAAQ,GAAA,IAAA;AAAA;AAEf,IAAK,IAAA,CAAA,KAAA,EAAA;AAAA;AACP,EACA,OAAU,GAAA;AACR,IAAA,MAAM,UAAU,IAAK,CAAA,KAAA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AAA,MAAA,IAAU,KAAO,EAAA;AACnD,MAAA;AAAA;AAEF,IAAYA,SAAAA,GAAAA,KAAAA,CAAK,QAAQ,SAAS,CAAA;AAAA;AAEpC,EAAO,OAAA,OAAA;AACT;AACA,eAAsB,MAAO,CAAA,IAAA,EAAM,OAAU,GAAA,EAAI,EAAA;AAC/C,EAAM,MAAA,OAAA,GAAU,MAAM,cAAA,CAAe,IAAM,EAAA;AAAA,IACzC,GAAG,OAAA;AAAA,IACH,KAAO,EAAA;AAAA,GACR,CAAA;AACD,EAAA,OAAO,QAAQ,CAAC,CAAA;AAClB;AACO,SAAS,UAAW,CAAA,IAAA,EAAM,OAAU,GAAA,EAAI,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-JMZKMGV3.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,cAAA,EAAA;;;ACAA,cAAA,EAAA;;;ACAA,cAAA,EAAA;;;ACAA,cAAA,EAAA;;;ACAA,cAAA,EAAA;AAKA,IAAM,OAAN,MAAW;AAAA,EACT,KAAA;AAAA,EACA,IAAA;AAAA,EACA,YAAY,KAAO,EAAA;AACjB,IAAA,IAAA,CAAK,KAAQ,GAAA,KAAA;AAAA;AAEjB,CAAA;AACA,IAAqB,QAArB,MAA2B;AAAA,EACzB,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,WAAc,GAAA;AACZ,IAAA,IAAA,CAAK,KAAM,EAAA;AAAA;AACb,EACA,QAAQ,KAAO,EAAA;AACb,IAAM,MAAA,IAAA,GAAO,IAAI,IAAA,CAAK,KAAK,CAAA;AAC3B,IAAA,IAAI,KAAK,KAAO,EAAA;AACd,MAAA,IAAA,CAAK,MAAM,IAAO,GAAA,IAAA;AAClB,MAAA,IAAA,CAAK,KAAQ,GAAA,IAAA;AAAA,KACR,MAAA;AACL,MAAA,IAAA,CAAK,KAAQ,GAAA,IAAA;AACb,MAAA,IAAA,CAAK,KAAQ,GAAA,IA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AAAA,CAAK,OAAQ,CAAA,SAAA,EAAW,SAAS,CAAC,CAAA;AAAA;AAEjD,IAAA,IAAI,SAAc,KAAA,MAAA,IAAU,OAAQ,CAAA,MAAA,IAAU,KAAO,EAAA;AACnD,MAAA;AAAA;AAEF,IAAYA,SAAAA,GAAAA,KAAAA,CAAK,QAAQ,SAAS,CAAA;AAAA;AAEpC,EAAO,OAAA,OAAA;AACT;AACA,eAAsB,MAAO,CAAA,IAAA,EAAM,OAAU,GAAA,EAAI,EAAA;AAC/C,EAAM,MAAA,OAAA,GAAU,MAAM,cAAA,CAAe,IAAM,EAAA;AAAA,IACzC,GAAG,OAAA;AAAA,IACH,KAAO,EAAA;AAAA,GACR,CAAA;AACD,EAAA,OAAO,QAAQ,CAAC,CAAA;AAClB;AACO,SAAS,UAAW,CAAA,IAAA,EAAM,OAAU,GAAA,EAAI,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-CMWYDM5Q.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,4 +1,4 @@
|
|
|
1
|
-
import { init_esm_shims } from './chunk-
|
|
1
|
+
import { init_esm_shims } from './chunk-CINFOKVJ.js';
|
|
2
2
|
|
|
3
3
|
// ../widget.api/build/esm/manifest.js
|
|
4
4
|
init_esm_shims();
|
|
@@ -21,5 +21,5 @@ var HostMessage;
|
|
|
21
21
|
init_esm_shims();
|
|
22
22
|
|
|
23
23
|
export { MANIFEST_FILE_LOCATION };
|
|
24
|
-
//# sourceMappingURL=chunk-
|
|
25
|
-
//# sourceMappingURL=chunk-
|
|
24
|
+
//# sourceMappingURL=chunk-TDNRRWOC.js.map
|
|
25
|
+
//# sourceMappingURL=chunk-TDNRRWOC.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../widget.api/build/esm/manifest.js","../../../widget.api/build/esm/index.js","../../../widget.api/build/esm/config.js","../../../widget.api/build/esm/messages/hostMessages.js","../../../widget.api/build/esm/messages/widgetMessages.js"],"names":[],"mappings":";;;AAAA,cAAA,EAAA;AAgBO,IAAM,sBAAyB,GAAA;;;AChBtC,cAAA,EAAA;;;ACAA,cAAA,EAAA;;;ACAA,cAAA,EAAA;AAgBO,IAAI,WAAA;AAAA,CACV,SAAU,YAAc,EAAA;AACvB,EAAA,YAAA,CAAa,OAAU,GAAA,OAAA;AACzB,CAAG,EAAA,WAAA,KAAgB,WAAc,GAAA,EAAG,CAAA,CAAA;;;ACnBpC,cAAA,EAAA","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../../../widget.api/build/esm/manifest.js","../../../widget.api/build/esm/index.js","../../../widget.api/build/esm/config.js","../../../widget.api/build/esm/messages/hostMessages.js","../../../widget.api/build/esm/messages/widgetMessages.js"],"names":[],"mappings":";;;AAAA,cAAA,EAAA;AAgBO,IAAM,sBAAyB,GAAA;;;AChBtC,cAAA,EAAA;;;ACAA,cAAA,EAAA;;;ACAA,cAAA,EAAA;AAgBO,IAAI,WAAA;AAAA,CACV,SAAU,YAAc,EAAA;AACvB,EAAA,YAAA,CAAa,OAAU,GAAA,OAAA;AACzB,CAAG,EAAA,WAAA,KAAgB,WAAc,GAAA,EAAG,CAAA,CAAA;;;ACnBpC,cAAA,EAAA","file":"chunk-TDNRRWOC.js","sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const MANIFEST_FILE_LOCATION = \".palantir/widgets.config.json\";","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { defineConfig } from \"./config.js\";\nexport { MANIFEST_FILE_LOCATION } from \"./manifest.js\";\nexport { HostMessage, isHostParametersUpdatedMessage, visitHostMessage } from \"./messages/hostMessages.js\";\nexport { isWidgetEmitEventMessage, isWidgetReadyMessage, isWidgetResizeMessage, visitWidgetMessage } from \"./messages/widgetMessages.js\";","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Extracts the parameter ID strings as types from the given ParameterConfig.\n */\n\n/**\n * Extracts a map of parameter IDs to their async-wrapped value types from the given ParameterConfig.\n */\n\n/**\n * Extracts a map of parameter IDs to the raw parameter values from the given ParameterConfig.\n */\n\n/**\n * Extracts a list of strongly-typed parameter IDs from the given WidgetConfig for a given event ID.\n * If a parameter ID is referenced by an event but does not exist, its type will be never\n */\n\n/**\n * Extracts a map of event IDs to their raw parameter value types from the given WidgetConfig.\n */\n\nexport function defineConfig(c) {\n return c;\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Interfaces and type guards for messages passed from the host Foundry UI to the widget\nexport let HostMessage;\n(function (_HostMessage) {\n _HostMessage.Version = \"1.0.0\";\n})(HostMessage || (HostMessage = {}));\nexport function isHostParametersUpdatedMessage(event) {\n return event.type === \"host.update-parameters\";\n}\n/**\n * Strongly typed visitor to handle every type of host message\n */\nexport function visitHostMessage(message, visitor) {\n const {\n type,\n payload\n } = message;\n const handler = visitor[type];\n if (handler) {\n // Typescript creates an & of the parameters instead of a union\n handler(payload);\n } else {\n visitor._unknown(type);\n }\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Interfaces and type guards for messages passed from the widget to the host Foundry UI\nexport let WidgetMessage;\nexport function isWidgetReadyMessage(event) {\n return event.type === \"widget.ready\";\n}\nexport function isWidgetResizeMessage(event) {\n return event.type === \"widget.resize\";\n}\nexport function isWidgetEmitEventMessage(event) {\n return event.type === \"widget.emit-event\";\n}\nexport function visitWidgetMessage(message, visitor) {\n const {\n type,\n payload\n } = message;\n const handler = visitor[type];\n if (handler) {\n // Typescript creates an & of the parameters instead of a union\n handler(payload);\n } else {\n visitor._unknown(type);\n }\n}"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PalantirApiError, createFetchHeaderMutator, createFetchOrThrow, UnknownError } from './chunk-
|
|
2
|
-
import { ExitProcessError } from './chunk-
|
|
3
|
-
import { init_esm_shims, __export } from './chunk-
|
|
1
|
+
import { PalantirApiError, createFetchHeaderMutator, createFetchOrThrow, UnknownError } from './chunk-W7U4ETYH.js';
|
|
2
|
+
import { ExitProcessError } from './chunk-BL3NTXLM.js';
|
|
3
|
+
import { init_esm_shims, __export } from './chunk-CINFOKVJ.js';
|
|
4
4
|
import { consola } from 'consola';
|
|
5
5
|
import { inspect } from 'util';
|
|
6
6
|
import prettyBytes from 'pretty-bytes';
|
|
@@ -37,7 +37,7 @@ init_esm_shims();
|
|
|
37
37
|
|
|
38
38
|
// src/net/UserAgent.ts
|
|
39
39
|
init_esm_shims();
|
|
40
|
-
var USER_AGENT = `osdk-cli/${"0.31.0
|
|
40
|
+
var USER_AGENT = `osdk-cli/${"0.31.0"}`;
|
|
41
41
|
|
|
42
42
|
// src/net/createFetch.mts
|
|
43
43
|
function createFetch(tokenProvider, fetchFn = fetch) {
|
|
@@ -346,5 +346,5 @@ function isJWT(token) {
|
|
|
346
346
|
}
|
|
347
347
|
|
|
348
348
|
export { createInternalClientContext, loadToken, third_party_applications_exports, widget_registry_exports };
|
|
349
|
-
//# sourceMappingURL=chunk-
|
|
350
|
-
//# sourceMappingURL=chunk-
|
|
349
|
+
//# sourceMappingURL=chunk-TSX7O7HY.js.map
|
|
350
|
+
//# sourceMappingURL=chunk-TSX7O7HY.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/net/createInternalClientContext.mts","../../src/net/third-party-applications/index.mts","../../src/net/third-party-applications/deleteVersion.mts","../../src/net/createFetch.mts","../../src/net/UserAgent.ts","../../src/net/third-party-applications/deployWebsite.mts","../../src/net/third-party-applications/getWebsite.mts","../../src/net/third-party-applications/listVersions.mts","../../src/net/third-party-applications/undeployWebsite.mts","../../src/net/third-party-applications/uploadSnapshotVersion.mts","../../src/net/third-party-applications/uploadVersion.mts","../../src/net/widget-registry/index.mts","../../src/net/widget-registry/deleteRelease.mts","../../src/net/widget-registry/getRelease.mts","../../src/net/widget-registry/listReleases.mts","../../src/net/widget-registry/publishRelease.mts","../../src/net/index.mts","../../src/util/token.ts"],"names":["fetch","consola","fsPromises"],"mappings":";;;;;;;;;;AAAA,cAAA,EAAA;AAgBO,SAAS,2BAAA,CAA4B,YAAY,aAAe,EAAA;AACrE,EAAO,OAAA;AAAA,IACL,aAAA;AAAA,IACA;AAAA,GACF;AACF;;;ACrBA,IAAA,gCAAA,GAAA;AAAA,QAAA,CAAA,gCAAA,EAAA;AAAA,EAAA,aAAA,EAAA,MAAA,aAAA;AAAA,EAAA,aAAA,EAAA,MAAA,aAAA;AAAA,EAAA,UAAA,EAAA,MAAA,UAAA;AAAA,EAAA,YAAA,EAAA,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,CAAA,YAAA,EAAc,MAAM,CAAA;AACtD,IAAA,KAAA,GAAQ,MAAM,IAAK,EAAA;AAAA,WACZ,KAAO,EAAA;AACd,IAAA,MAAM,IAAI,gBAAiB,CAAA,CAAA,EAAG,8BAA8B,QAAQ,CAAA,GAAA,EAAM,KAAK,CAAE,CAAA,CAAA;AAAA;AAEnF,EAAO,OAAA;AAAA,IACL,QAAU,EAAA,YAAA;AAAA,IACV;AAAA,GACF;AACF;AACO,SAAS,SAAS,KAAO,EAAA;AAC9B,EAAI,IAAA,CAAC,KAAM,CAAA,KAAK,CAAG,EAAA;AACjB,IAAM,MAAA,IAAI,gBAAiB,CAAA,CAAA,EAAG,CAAmC,iCAAA,CAAA,CAAA;AAAA;AAErE;AACA,SAAS,MAAM,KAAO,EAAA;AAEpB,EAAA,MAAM,UAAa,GAAA,kDAAA;AACnB,EAAO,OAAA,UAAA,CAAW,KAAK,KAAK,CAAA;AAC9B","file":"chunk-S5ZOEHLJ.js","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function createInternalClientContext(foundryUrl, tokenProvider) {\n return {\n tokenProvider,\n foundryUrl\n };\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { deleteVersion } from \"./deleteVersion.mjs\";\nexport { deployWebsite } from \"./deployWebsite.mjs\";\nexport { getWebsite } from \"./getWebsite.mjs\";\nexport { listVersions } from \"./listVersions.mjs\";\nexport { undeployWebsite } from \"./undeployWebsite.mjs\";\nexport { uploadSnapshotVersion } from \"./uploadSnapshotVersion.mjs\";\nexport { uploadVersion } from \"./uploadVersion.mjs\";","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function deleteVersion(ctx, thirdPartyAppRid, version) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website/versions/${encodeURIComponent(version)}?preview=true`;\n await fetch(url, {\n method: \"DELETE\"\n });\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ExitProcessError } from \"@osdk/cli.common\";\nimport { PalantirApiError, UnknownError } from \"@osdk/shared.net.errors\";\nimport { createFetchHeaderMutator, createFetchOrThrow } from \"@osdk/shared.net.fetch\";\nimport { consola } from \"consola\";\nimport { inspect } from \"node:util\";\nimport prettyBytes from \"pretty-bytes\";\nimport { USER_AGENT } from \"./UserAgent.js\";\nexport function createFetch(tokenProvider, fetchFn = fetch) {\n return createFetchHeaderMutator(createRequestLoggingFetch(createErrorExitingFetch(createFetchOrThrow(fetchFn))), async headers => {\n const token = await tokenProvider();\n headers.set(\"Authorization\", `Bearer ${token}`);\n headers.set(\"Fetch-User-Agent\", USER_AGENT);\n return headers;\n });\n}\nfunction createErrorExitingFetch(fetchFn = fetch) {\n return function errorExitingFetch(input, init) {\n return fetchFn(input, init).catch(handleFetchError);\n };\n}\nfunction handleFetchError(e) {\n if (!(e instanceof PalantirApiError)) {\n throw new ExitProcessError(1, \"Unexpected fetch error\");\n }\n let tip;\n if (e.statusCode === 401) {\n tip = \"Check your token is valid and has not expired or been disabled\";\n } else if (e.statusCode === 403) {\n tip = \"Check your token has the required scopes for this operation\";\n } else if (e.statusCode === 404) {\n tip = \"The resource may not exist or your token may not have the required scopes to load it\";\n }\n let message;\n if (e.errorName === \"CannotDeleteDeployedVersion\") {\n message = \"The site version to delete is live and cannot be deleted\";\n tip = \"Run the `site version set` command to change the live site version\";\n } else if (e.errorName === \"InvalidVersion\") {\n message = \"The site version is invalid and must be a valid SemVer string\";\n } else if (e.errorName === \"VersionAlreadyExists\") {\n message = \"The site version already exists\";\n } else if (e.errorName === \"VersionNotFound\") {\n message = \"The site version could not be found\";\n } else if (e.errorName === \"VersionLimitExceeded\") {\n const {\n versionLimit\n } = e.parameters ?? {};\n const versionLimitPart = versionLimit != null ? ` (Limit: ${versionLimit} versions)` : \"\";\n message = `The site contains too many versions${versionLimitPart}`;\n tip = \"Run the `site version delete` command to delete an old version and try again\";\n } else if (e.errorName === \"FileCountLimitExceeded\") {\n const {\n fileCountLimit\n } = e.parameters ?? {};\n const fileCountLimitPart = fileCountLimit != null ? ` (Limit: ${fileCountLimit} files)` : \"\";\n message = `The .zip file contains too many files${fileCountLimitPart}`;\n tip = \"Reduce the number of files in the production build to below the limit\";\n } else if (e.errorName === \"FileSizeLimitExceeded\") {\n const {\n currentFilePath,\n currentFileSizeBytes,\n fileSizeBytesLimit\n } = e.parameters ?? {};\n const currentFilePathPart = currentFilePath != null ? ` \"${currentFilePath}\"` : \"\";\n const currentFileSizePart = currentFileSizeBytes != null ? ` (${prettyBytes(parseInt(currentFileSizeBytes), {\n binary: true\n })})` : \"\";\n const fileSizeLimitPart = fileSizeBytesLimit != null ? ` (Limit: ${prettyBytes(parseInt(fileSizeBytesLimit), {\n binary: true\n })})` : \"\";\n message = `The .zip file contains a file${currentFilePathPart}${currentFileSizePart} that is too large${fileSizeLimitPart}`;\n tip = \"Ensure all files in the production build are below the size limit\";\n } else {\n if (e instanceof UnknownError) {\n // Include deep inspect of original error\n message = `${e.message}\\n\\n${inspect(e, {\n depth: 10,\n colors: true\n })}`;\n } else {\n // Include extra info about the original API error\n // https://www.palantir.com/docs/foundry/api/general/overview/errors/\n const {\n errorCode,\n errorName,\n errorInstanceId,\n parameters\n } = e;\n message = `${e.message}\\n\\n${JSON.stringify({\n errorCode,\n errorName,\n errorInstanceId,\n parameters\n }, null, 2)}`;\n }\n }\n throw new ExitProcessError(1, message, tip, e);\n}\nfunction createRequestLoggingFetch(fetchFn = fetch) {\n return function requestLoggingFetch(input, init) {\n const requestLog = typeof input === \"string\" || input instanceof URL ? `${init?.method ?? \"GET\"}: ${input.toString().trim()}`\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-conversion\n : `${input.method ?? \"GET\"}: ${input.url.toString().trim()}`;\n consola.trace(requestLog);\n return fetchFn(input, init).then(a => {\n consola.trace(`FINISH ${requestLog}`);\n return a;\n });\n };\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const USER_AGENT = `osdk-cli/${process.env.PACKAGE_VERSION}`;","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function deployWebsite(ctx, thirdPartyAppRid, request) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website/deploy?preview=true`;\n const result = await fetch(url, {\n method: \"POST\",\n body: JSON.stringify(request),\n headers: {\n \"Content-Type\": \"application/json\"\n }\n });\n return result.json();\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ExitProcessError } from \"@osdk/cli.common\";\nimport { PalantirApiError } from \"@osdk/shared.net.errors\";\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function getWebsite(ctx, thirdPartyAppRid) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website?preview=true`;\n try {\n const result = await fetch(url);\n return await result.json();\n } catch (e) {\n // Revisit this error handling in the API\n if (e instanceof ExitProcessError && e.originalError != null && e.originalError instanceof PalantirApiError && e.originalError.errorName === \"WebsiteNotFound\") {\n return undefined;\n }\n throw e;\n }\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function listVersions(ctx, thirdPartyAppRid) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website/versions?preview=true`;\n const result = await fetch(url);\n return result.json();\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function undeployWebsite(ctx, thirdPartyAppRid) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website/undeploy?preview=true`;\n await fetch(url, {\n method: \"POST\"\n });\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function uploadSnapshotVersion(ctx, thirdPartyAppRid, version, snapshotId, zipFile) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website/versions/uploadSnapshot?version=${encodeURIComponent(version)}&preview=true${snapshotId !== \"\" ? `&snapshotIdentifier=${encodeURIComponent(snapshotId)}` : \"\"}`;\n const result = await fetch(url, {\n method: \"POST\",\n body: zipFile,\n headers: {\n \"Content-Type\": \"application/octet-stream\"\n },\n duplex: \"half\" // Node hates me\n });\n return result.json();\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function uploadVersion(ctx, thirdPartyAppRid, version, zipFile) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website/versions/upload?version=${encodeURIComponent(version)}&preview=true`;\n const result = await fetch(url, {\n method: \"POST\",\n body: zipFile,\n headers: {\n \"Content-Type\": \"application/octet-stream\"\n },\n duplex: \"half\" // Node hates me\n });\n return result.json();\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { deleteRelease } from \"./deleteRelease.mjs\";\nexport { getRelease } from \"./getRelease.mjs\";\nexport { listReleases } from \"./listReleases.mjs\";\nexport { publishRelease } from \"./publishRelease.mjs\";","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function deleteRelease(ctx, widgetSetRid, releaseVersion) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/widgets/widgetSets/${widgetSetRid}/releases/${releaseVersion}?preview=true`;\n await fetch(url, {\n method: \"DELETE\"\n });\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function getRelease(ctx, widgetSetRid, releaseVersion) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/widgets/widgetSets/${widgetSetRid}/releases/${releaseVersion}?preview=true`;\n const response = await fetch(url);\n return response.json();\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function listReleases(ctx, widgetSetRid) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/widgets/widgetSets/${widgetSetRid}/releases?preview=true`;\n const response = await fetch(url);\n return response.json();\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function publishRelease(ctx, repositoryRid, repositoryVersion, zipFile) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/widgets/repositories/${repositoryRid}/publish?preview=true&repositoryVersion=${repositoryVersion}`;\n await fetch(url, {\n method: \"POST\",\n body: zipFile,\n headers: {\n \"Content-Type\": \"application/octet-stream\"\n },\n duplex: \"half\" // Node hates me\n });\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { createInternalClientContext } from \"./createInternalClientContext.mjs\";\nexport * as thirdPartyApplications from \"./third-party-applications/index.mjs\";\nexport * as widgetRegistry from \"./widget-registry/index.mjs\";","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ExitProcessError } from \"@osdk/cli.common\";\nimport { consola } from \"consola\";\nimport { promises as fsPromises } from \"node:fs\";\nimport path from \"node:path\";\nconst TOKEN_ENV_VARS = [\"FOUNDRY_TOKEN\", \"FOUNDRY_SDK_AUTH_TOKEN\"];\n\n/**\n * Loads a JWT Auth Token from an argument, a file, or environment variable returning the first found.\n * @param token The token as a string.\n * @param tokenFile The path to the token file.\n * @returns The token as a string.\n * @throws An error if no token is found.\n */\nexport async function loadToken(token, tokenFile) {\n if (token) {\n consola.debug(`Using token from --token option`);\n validate(token);\n return token;\n }\n if (tokenFile) {\n const loadedToken = await loadTokenFile(tokenFile);\n consola.debug(`Using token from --tokenFile=${loadedToken.filePath} option`);\n validate(loadedToken.token);\n return loadedToken.token;\n }\n for (const envVar of TOKEN_ENV_VARS) {\n const environmentToken = process.env[envVar];\n if (environmentToken) {\n consola.debug(`Using token from ${envVar} environment variable`);\n validate(environmentToken);\n if (envVar === \"FOUNDRY_SDK_AUTH_TOKEN\") {\n consola.warn(`Using FOUNDRY_SDK_AUTH_TOKEN environment variable is deprecated. Please use FOUNDRY_TOKEN instead.`);\n }\n return environmentToken;\n }\n }\n throw new ExitProcessError(2, `No token found.`, `You can supply a --token or --token-file option, or set the ${TOKEN_ENV_VARS[0]} environment variable`);\n}\n/**\n * Reads a JWT Auth Token from a file.\n * @param filePath The path to the token file.\n * @returns The token as a string.\n * @throws An error if the file cannot be read.\n */\nexport async function loadTokenFile(filePath) {\n let token;\n let resolvedPath;\n try {\n resolvedPath = path.resolve(filePath);\n token = await fsPromises.readFile(resolvedPath, \"utf8\");\n token = token.trim();\n } catch (error) {\n throw new ExitProcessError(2, `Unable to read token file \"${filePath}\": ${error}`);\n }\n return {\n filePath: resolvedPath,\n token\n };\n}\nexport function validate(token) {\n if (!isJWT(token)) {\n throw new ExitProcessError(2, `Token does not appear to be a JWT`);\n }\n}\nfunction isJWT(token) {\n // https://stackoverflow.com/a/65755789\n const jwtPattern = /^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]*$/;\n return jwtPattern.test(token);\n}"]}
|
|
1
|
+
{"version":3,"sources":["../../src/net/createInternalClientContext.mts","../../src/net/third-party-applications/index.mts","../../src/net/third-party-applications/deleteVersion.mts","../../src/net/createFetch.mts","../../src/net/UserAgent.ts","../../src/net/third-party-applications/deployWebsite.mts","../../src/net/third-party-applications/getWebsite.mts","../../src/net/third-party-applications/listVersions.mts","../../src/net/third-party-applications/undeployWebsite.mts","../../src/net/third-party-applications/uploadSnapshotVersion.mts","../../src/net/third-party-applications/uploadVersion.mts","../../src/net/widget-registry/index.mts","../../src/net/widget-registry/deleteRelease.mts","../../src/net/widget-registry/getRelease.mts","../../src/net/widget-registry/listReleases.mts","../../src/net/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,kGAAA,CAAA,CAAA;AAAA;AAEnH,MAAO,OAAA,gBAAA;AAAA;AACT;AAEF,EAAM,MAAA,IAAI,iBAAiB,CAAG,EAAA,CAAA,eAAA,CAAA,EAAmB,+DAA+D,cAAe,CAAA,CAAC,CAAC,CAAuB,qBAAA,CAAA,CAAA;AAC1J;AAOA,eAAsB,cAAc,QAAU,EAAA;AAC5C,EAAI,IAAA,KAAA;AACJ,EAAI,IAAA,YAAA;AACJ,EAAI,IAAA;AACF,IAAe,YAAA,GAAA,IAAA,CAAK,QAAQ,QAAQ,CAAA;AACpC,IAAA,KAAA,GAAQ,MAAMC,QAAA,CAAW,QAAS,CAAA,YAAA,EAAc,MAAM,CAAA;AACtD,IAAA,KAAA,GAAQ,MAAM,IAAK,EAAA;AAAA,WACZ,KAAO,EAAA;AACd,IAAA,MAAM,IAAI,gBAAiB,CAAA,CAAA,EAAG,8BAA8B,QAAQ,CAAA,GAAA,EAAM,KAAK,CAAE,CAAA,CAAA;AAAA;AAEnF,EAAO,OAAA;AAAA,IACL,QAAU,EAAA,YAAA;AAAA,IACV;AAAA,GACF;AACF;AACO,SAAS,SAAS,KAAO,EAAA;AAC9B,EAAI,IAAA,CAAC,KAAM,CAAA,KAAK,CAAG,EAAA;AACjB,IAAM,MAAA,IAAI,gBAAiB,CAAA,CAAA,EAAG,CAAmC,iCAAA,CAAA,CAAA;AAAA;AAErE;AACA,SAAS,MAAM,KAAO,EAAA;AAEpB,EAAA,MAAM,UAAa,GAAA,kDAAA;AACnB,EAAO,OAAA,UAAA,CAAW,KAAK,KAAK,CAAA;AAC9B","file":"chunk-TSX7O7HY.js","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function createInternalClientContext(foundryUrl, tokenProvider) {\n return {\n tokenProvider,\n foundryUrl\n };\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { deleteVersion } from \"./deleteVersion.mjs\";\nexport { deployWebsite } from \"./deployWebsite.mjs\";\nexport { getWebsite } from \"./getWebsite.mjs\";\nexport { listVersions } from \"./listVersions.mjs\";\nexport { undeployWebsite } from \"./undeployWebsite.mjs\";\nexport { uploadSnapshotVersion } from \"./uploadSnapshotVersion.mjs\";\nexport { uploadVersion } from \"./uploadVersion.mjs\";","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function deleteVersion(ctx, thirdPartyAppRid, version) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website/versions/${encodeURIComponent(version)}?preview=true`;\n await fetch(url, {\n method: \"DELETE\"\n });\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ExitProcessError } from \"@osdk/cli.common\";\nimport { PalantirApiError, UnknownError } from \"@osdk/shared.net.errors\";\nimport { createFetchHeaderMutator, createFetchOrThrow } from \"@osdk/shared.net.fetch\";\nimport { consola } from \"consola\";\nimport { inspect } from \"node:util\";\nimport prettyBytes from \"pretty-bytes\";\nimport { USER_AGENT } from \"./UserAgent.js\";\nexport function createFetch(tokenProvider, fetchFn = fetch) {\n return createFetchHeaderMutator(createRequestLoggingFetch(createErrorExitingFetch(createFetchOrThrow(fetchFn))), async headers => {\n const token = await tokenProvider();\n headers.set(\"Authorization\", `Bearer ${token}`);\n headers.set(\"Fetch-User-Agent\", USER_AGENT);\n return headers;\n });\n}\nfunction createErrorExitingFetch(fetchFn = fetch) {\n return function errorExitingFetch(input, init) {\n return fetchFn(input, init).catch(handleFetchError);\n };\n}\nfunction handleFetchError(e) {\n if (!(e instanceof PalantirApiError)) {\n throw new ExitProcessError(1, \"Unexpected fetch error\");\n }\n let tip;\n if (e.statusCode === 401) {\n tip = \"Check your token is valid and has not expired or been disabled\";\n } else if (e.statusCode === 403) {\n tip = \"Check your token has the required scopes for this operation\";\n } else if (e.statusCode === 404) {\n tip = \"The resource may not exist or your token may not have the required scopes to load it\";\n }\n let message;\n if (e.errorName === \"CannotDeleteDeployedVersion\") {\n message = \"The site version to delete is live and cannot be deleted\";\n tip = \"Run the `site version set` command to change the live site version\";\n } else if (e.errorName === \"InvalidVersion\") {\n message = \"The site version is invalid and must be a valid SemVer string\";\n } else if (e.errorName === \"VersionAlreadyExists\") {\n message = \"The site version already exists\";\n } else if (e.errorName === \"VersionNotFound\") {\n message = \"The site version could not be found\";\n } else if (e.errorName === \"VersionLimitExceeded\") {\n const {\n versionLimit\n } = e.parameters ?? {};\n const versionLimitPart = versionLimit != null ? ` (Limit: ${versionLimit} versions)` : \"\";\n message = `The site contains too many versions${versionLimitPart}`;\n tip = \"Run the `site version delete` command to delete an old version and try again\";\n } else if (e.errorName === \"FileCountLimitExceeded\") {\n const {\n fileCountLimit\n } = e.parameters ?? {};\n const fileCountLimitPart = fileCountLimit != null ? ` (Limit: ${fileCountLimit} files)` : \"\";\n message = `The .zip file contains too many files${fileCountLimitPart}`;\n tip = \"Reduce the number of files in the production build to below the limit\";\n } else if (e.errorName === \"FileSizeLimitExceeded\") {\n const {\n currentFilePath,\n currentFileSizeBytes,\n fileSizeBytesLimit\n } = e.parameters ?? {};\n const currentFilePathPart = currentFilePath != null ? ` \"${currentFilePath}\"` : \"\";\n const currentFileSizePart = currentFileSizeBytes != null ? ` (${prettyBytes(parseInt(currentFileSizeBytes), {\n binary: true\n })})` : \"\";\n const fileSizeLimitPart = fileSizeBytesLimit != null ? ` (Limit: ${prettyBytes(parseInt(fileSizeBytesLimit), {\n binary: true\n })})` : \"\";\n message = `The .zip file contains a file${currentFilePathPart}${currentFileSizePart} that is too large${fileSizeLimitPart}`;\n tip = \"Ensure all files in the production build are below the size limit\";\n } else {\n if (e instanceof UnknownError) {\n // Include deep inspect of original error\n message = `${e.message}\\n\\n${inspect(e, {\n depth: 10,\n colors: true\n })}`;\n } else {\n // Include extra info about the original API error\n // https://www.palantir.com/docs/foundry/api/general/overview/errors/\n const {\n errorCode,\n errorName,\n errorInstanceId,\n parameters\n } = e;\n message = `${e.message}\\n\\n${JSON.stringify({\n errorCode,\n errorName,\n errorInstanceId,\n parameters\n }, null, 2)}`;\n }\n }\n throw new ExitProcessError(1, message, tip, e);\n}\nfunction createRequestLoggingFetch(fetchFn = fetch) {\n return function requestLoggingFetch(input, init) {\n const requestLog = typeof input === \"string\" || input instanceof URL ? `${init?.method ?? \"GET\"}: ${input.toString().trim()}`\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-conversion\n : `${input.method ?? \"GET\"}: ${input.url.toString().trim()}`;\n consola.trace(requestLog);\n return fetchFn(input, init).then(a => {\n consola.trace(`FINISH ${requestLog}`);\n return a;\n });\n };\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const USER_AGENT = `osdk-cli/${process.env.PACKAGE_VERSION}`;","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function deployWebsite(ctx, thirdPartyAppRid, request) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website/deploy?preview=true`;\n const result = await fetch(url, {\n method: \"POST\",\n body: JSON.stringify(request),\n headers: {\n \"Content-Type\": \"application/json\"\n }\n });\n return result.json();\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ExitProcessError } from \"@osdk/cli.common\";\nimport { PalantirApiError } from \"@osdk/shared.net.errors\";\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function getWebsite(ctx, thirdPartyAppRid) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website?preview=true`;\n try {\n const result = await fetch(url);\n return await result.json();\n } catch (e) {\n // Revisit this error handling in the API\n if (e instanceof ExitProcessError && e.originalError != null && e.originalError instanceof PalantirApiError && e.originalError.errorName === \"WebsiteNotFound\") {\n return undefined;\n }\n throw e;\n }\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function listVersions(ctx, thirdPartyAppRid) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website/versions?preview=true`;\n const result = await fetch(url);\n return result.json();\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function undeployWebsite(ctx, thirdPartyAppRid) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website/undeploy?preview=true`;\n await fetch(url, {\n method: \"POST\"\n });\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function uploadSnapshotVersion(ctx, thirdPartyAppRid, version, snapshotId, zipFile) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website/versions/uploadSnapshot?version=${encodeURIComponent(version)}&preview=true${snapshotId !== \"\" ? `&snapshotIdentifier=${encodeURIComponent(snapshotId)}` : \"\"}`;\n const result = await fetch(url, {\n method: \"POST\",\n body: zipFile,\n headers: {\n \"Content-Type\": \"application/octet-stream\"\n },\n duplex: \"half\" // Node hates me\n });\n return result.json();\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function uploadVersion(ctx, thirdPartyAppRid, version, zipFile) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website/versions/upload?version=${encodeURIComponent(version)}&preview=true`;\n const result = await fetch(url, {\n method: \"POST\",\n body: zipFile,\n headers: {\n \"Content-Type\": \"application/octet-stream\"\n },\n duplex: \"half\" // Node hates me\n });\n return result.json();\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { deleteRelease } from \"./deleteRelease.mjs\";\nexport { getRelease } from \"./getRelease.mjs\";\nexport { listReleases } from \"./listReleases.mjs\";\nexport { publishRelease } from \"./publishRelease.mjs\";","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function deleteRelease(ctx, widgetSetRid, releaseVersion) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/widgets/widgetSets/${widgetSetRid}/releases/${releaseVersion}?preview=true`;\n await fetch(url, {\n method: \"DELETE\"\n });\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function getRelease(ctx, widgetSetRid, releaseVersion) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/widgets/widgetSets/${widgetSetRid}/releases/${releaseVersion}?preview=true`;\n const response = await fetch(url);\n return response.json();\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function listReleases(ctx, widgetSetRid) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/widgets/widgetSets/${widgetSetRid}/releases?preview=true`;\n const response = await fetch(url);\n return response.json();\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function publishRelease(ctx, repositoryRid, repositoryVersion, zipFile) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/widgets/repositories/${repositoryRid}/publish?preview=true&repositoryVersion=${repositoryVersion}`;\n await fetch(url, {\n method: \"POST\",\n body: zipFile,\n headers: {\n \"Content-Type\": \"application/octet-stream\"\n },\n duplex: \"half\" // Node hates me\n });\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { createInternalClientContext } from \"./createInternalClientContext.mjs\";\nexport * as thirdPartyApplications from \"./third-party-applications/index.mjs\";\nexport * as widgetRegistry from \"./widget-registry/index.mjs\";","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ExitProcessError } from \"@osdk/cli.common\";\nimport { consola } from \"consola\";\nimport { promises as fsPromises } from \"node:fs\";\nimport path from \"node:path\";\nconst TOKEN_ENV_VARS = [\"FOUNDRY_TOKEN\", \"FOUNDRY_SDK_AUTH_TOKEN\"];\n\n/**\n * Loads a JWT Auth Token from an argument, a file, or environment variable returning the first found.\n * @param token The token as a string.\n * @param tokenFile The path to the token file.\n * @returns The token as a string.\n * @throws An error if no token is found.\n */\nexport async function loadToken(token, tokenFile) {\n if (token) {\n consola.debug(`Using token from --token option`);\n validate(token);\n return token;\n }\n if (tokenFile) {\n const loadedToken = await loadTokenFile(tokenFile);\n consola.debug(`Using token from --tokenFile=${loadedToken.filePath} option`);\n validate(loadedToken.token);\n return loadedToken.token;\n }\n for (const envVar of TOKEN_ENV_VARS) {\n const environmentToken = process.env[envVar];\n if (environmentToken) {\n consola.debug(`Using token from ${envVar} environment variable`);\n validate(environmentToken);\n if (envVar === \"FOUNDRY_SDK_AUTH_TOKEN\") {\n consola.warn(`Using FOUNDRY_SDK_AUTH_TOKEN environment variable is deprecated. Please use FOUNDRY_TOKEN instead.`);\n }\n return environmentToken;\n }\n }\n throw new ExitProcessError(2, `No token found.`, `You can supply a --token or --token-file option, or set the ${TOKEN_ENV_VARS[0]} environment variable`);\n}\n/**\n * Reads a JWT Auth Token from a file.\n * @param filePath The path to the token file.\n * @returns The token as a string.\n * @throws An error if the file cannot be read.\n */\nexport async function loadTokenFile(filePath) {\n let token;\n let resolvedPath;\n try {\n resolvedPath = path.resolve(filePath);\n token = await fsPromises.readFile(resolvedPath, \"utf8\");\n token = token.trim();\n } catch (error) {\n throw new ExitProcessError(2, `Unable to read token file \"${filePath}\": ${error}`);\n }\n return {\n filePath: resolvedPath,\n token\n };\n}\nexport function validate(token) {\n if (!isJWT(token)) {\n throw new ExitProcessError(2, `Token does not appear to be a JWT`);\n }\n}\nfunction isJWT(token) {\n // https://stackoverflow.com/a/65755789\n const jwtPattern = /^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]*$/;\n return jwtPattern.test(token);\n}"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __commonJS, init_esm_shims, __toESM } from './chunk-
|
|
1
|
+
import { __commonJS, init_esm_shims, __toESM } from './chunk-CINFOKVJ.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({
|
|
@@ -235,5 +235,5 @@ var TOO_MANY_REQUESTS = 429;
|
|
|
235
235
|
init_esm_shims();
|
|
236
236
|
|
|
237
237
|
export { PalantirApiError, UnknownError, createFetchHeaderMutator, createFetchOrThrow, createRetryingFetch };
|
|
238
|
-
//# sourceMappingURL=chunk-
|
|
239
|
-
//# sourceMappingURL=chunk-
|
|
238
|
+
//# sourceMappingURL=chunk-W7U4ETYH.js.map
|
|
239
|
+
//# sourceMappingURL=chunk-W7U4ETYH.js.map
|