@osdk/cli 0.22.0-beta.2 → 0.22.1
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 +29 -0
- package/build/browser/chunk-2FHBRDJE.js +1 -1
- package/build/browser/chunk-2FHBRDJE.js.map +1 -1
- package/build/browser/chunk-G3PMV62Z.js +1 -1
- package/build/browser/chunk-G3PMV62Z.js.map +1 -1
- package/build/browser/chunk-IRSUCKI2.js +1 -1
- package/build/browser/chunk-IRSUCKI2.js.map +1 -1
- package/build/browser/{chunk-XUNEMZTE.js → chunk-RTBY6IQO.js} +3 -3
- package/build/browser/chunk-RTBY6IQO.js.map +1 -0
- package/build/browser/chunk-YYFW7BKO.js +1 -1
- package/build/browser/chunk-YYFW7BKO.js.map +1 -1
- package/build/{esm/handleGenerate-LFHFMTI5-4XSGH53A.js → browser/handleGenerate-BRWT5QJG-XBEQW44J.js} +9 -9
- package/build/browser/handleGenerate-BRWT5QJG-XBEQW44J.js.map +1 -0
- package/build/browser/index.js +9 -9
- package/build/browser/index.js.map +1 -1
- package/build/browser/loginFlow-SCW45N4C.js +1 -1
- package/build/browser/loginFlow-SCW45N4C.js.map +1 -1
- package/build/{esm/siteDeployCommand-CM2MORY4.js → browser/siteDeployCommand-5VG3J6JA.js} +3 -3
- package/build/browser/siteDeployCommand-5VG3J6JA.js.map +1 -0
- package/build/browser/{versionDeleteCommand-X57FGSGV.js → versionDeleteCommand-PYIX6VKL.js} +3 -3
- package/build/browser/versionDeleteCommand-PYIX6VKL.js.map +1 -0
- package/build/{esm/versionGetCommand-XXW7AUYY.js → browser/versionGetCommand-LK7EMAMW.js} +3 -3
- package/build/browser/versionGetCommand-LK7EMAMW.js.map +1 -0
- package/build/{esm/versionListCommand-YCG2FWRB.js → browser/versionListCommand-MOU6FSOB.js} +3 -3
- package/build/browser/versionListCommand-MOU6FSOB.js.map +1 -0
- package/build/{esm/versionSetCommand-VXNQ4MK6.js → browser/versionSetCommand-Z2XKFFT3.js} +3 -3
- package/build/browser/versionSetCommand-Z2XKFFT3.js.map +1 -0
- package/build/browser/{versionUnsetCommand-UFLNPHZE.js → versionUnsetCommand-R7GVBMMI.js} +3 -3
- package/build/browser/versionUnsetCommand-R7GVBMMI.js.map +1 -0
- package/build/cjs/chunk-DQYIDDJN.cjs +1 -1
- package/build/cjs/chunk-DQYIDDJN.cjs.map +1 -1
- package/build/cjs/chunk-EMMSS5I5.cjs +1 -1
- package/build/cjs/chunk-EMMSS5I5.cjs.map +1 -1
- package/build/cjs/chunk-KN4OGPAB.cjs +1 -1
- package/build/cjs/chunk-KN4OGPAB.cjs.map +1 -1
- package/build/cjs/{chunk-3CPXWE5R.cjs → chunk-N7QAVHKA.cjs} +3 -3
- package/build/cjs/chunk-N7QAVHKA.cjs.map +1 -0
- package/build/cjs/chunk-V7DUQNL2.cjs +1 -1
- package/build/cjs/chunk-V7DUQNL2.cjs.map +1 -1
- package/build/cjs/{handleGenerate-LFHFMTI5-R364IB4D.cjs → handleGenerate-BRWT5QJG-YCPINH4C.cjs} +10 -10
- package/build/cjs/handleGenerate-BRWT5QJG-YCPINH4C.cjs.map +1 -0
- package/build/cjs/index.cjs +9 -9
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/loginFlow-DU7IQXS5.cjs +1 -1
- package/build/cjs/loginFlow-DU7IQXS5.cjs.map +1 -1
- package/build/cjs/{siteDeployCommand-3MZDNJBW.cjs → siteDeployCommand-A22XLCDF.cjs} +8 -8
- package/build/cjs/siteDeployCommand-A22XLCDF.cjs.map +1 -0
- package/build/cjs/{versionDeleteCommand-3AFHOPBB.cjs → versionDeleteCommand-ANP5N2PJ.cjs} +6 -6
- package/build/cjs/versionDeleteCommand-ANP5N2PJ.cjs.map +1 -0
- package/build/cjs/{versionGetCommand-G44GPMEG.cjs → versionGetCommand-QL2Q2CP4.cjs} +6 -6
- package/build/cjs/versionGetCommand-QL2Q2CP4.cjs.map +1 -0
- package/build/cjs/{versionListCommand-GTTXNVK4.cjs → versionListCommand-ABUMTBDK.cjs} +6 -6
- package/build/cjs/versionListCommand-ABUMTBDK.cjs.map +1 -0
- package/build/cjs/{versionSetCommand-ELRINKPK.cjs → versionSetCommand-YRMBNTFW.cjs} +6 -6
- package/build/cjs/versionSetCommand-YRMBNTFW.cjs.map +1 -0
- package/build/cjs/{versionUnsetCommand-GYBYED5E.cjs → versionUnsetCommand-EOAXE7JX.cjs} +6 -6
- package/build/cjs/versionUnsetCommand-EOAXE7JX.cjs.map +1 -0
- package/build/esm/chunk-2FHBRDJE.js +1 -1
- package/build/esm/chunk-2FHBRDJE.js.map +1 -1
- package/build/esm/chunk-G3PMV62Z.js +1 -1
- package/build/esm/chunk-G3PMV62Z.js.map +1 -1
- package/build/esm/chunk-IRSUCKI2.js +1 -1
- package/build/esm/chunk-IRSUCKI2.js.map +1 -1
- package/build/esm/{chunk-XUNEMZTE.js → chunk-RTBY6IQO.js} +3 -3
- package/build/esm/chunk-RTBY6IQO.js.map +1 -0
- package/build/esm/chunk-YYFW7BKO.js +1 -1
- package/build/esm/chunk-YYFW7BKO.js.map +1 -1
- package/build/{browser/handleGenerate-LFHFMTI5-4XSGH53A.js → esm/handleGenerate-BRWT5QJG-XBEQW44J.js} +9 -9
- package/build/esm/handleGenerate-BRWT5QJG-XBEQW44J.js.map +1 -0
- package/build/esm/index.js +9 -9
- package/build/esm/index.js.map +1 -1
- package/build/esm/loginFlow-SCW45N4C.js +1 -1
- package/build/esm/loginFlow-SCW45N4C.js.map +1 -1
- package/build/{browser/siteDeployCommand-CM2MORY4.js → esm/siteDeployCommand-5VG3J6JA.js} +3 -3
- package/build/esm/siteDeployCommand-5VG3J6JA.js.map +1 -0
- package/build/esm/{versionDeleteCommand-X57FGSGV.js → versionDeleteCommand-PYIX6VKL.js} +3 -3
- package/build/esm/versionDeleteCommand-PYIX6VKL.js.map +1 -0
- package/build/{browser/versionGetCommand-XXW7AUYY.js → esm/versionGetCommand-LK7EMAMW.js} +3 -3
- package/build/esm/versionGetCommand-LK7EMAMW.js.map +1 -0
- package/build/{browser/versionListCommand-YCG2FWRB.js → esm/versionListCommand-MOU6FSOB.js} +3 -3
- package/build/esm/versionListCommand-MOU6FSOB.js.map +1 -0
- package/build/{browser/versionSetCommand-VXNQ4MK6.js → esm/versionSetCommand-Z2XKFFT3.js} +3 -3
- package/build/esm/versionSetCommand-Z2XKFFT3.js.map +1 -0
- package/build/esm/{versionUnsetCommand-UFLNPHZE.js → versionUnsetCommand-R7GVBMMI.js} +3 -3
- package/build/esm/versionUnsetCommand-R7GVBMMI.js.map +1 -0
- package/package.json +10 -10
- package/build/browser/chunk-XUNEMZTE.js.map +0 -1
- package/build/browser/handleGenerate-LFHFMTI5-4XSGH53A.js.map +0 -1
- package/build/browser/siteDeployCommand-CM2MORY4.js.map +0 -1
- package/build/browser/versionDeleteCommand-X57FGSGV.js.map +0 -1
- package/build/browser/versionGetCommand-XXW7AUYY.js.map +0 -1
- package/build/browser/versionListCommand-YCG2FWRB.js.map +0 -1
- package/build/browser/versionSetCommand-VXNQ4MK6.js.map +0 -1
- package/build/browser/versionUnsetCommand-UFLNPHZE.js.map +0 -1
- package/build/cjs/chunk-3CPXWE5R.cjs.map +0 -1
- package/build/cjs/handleGenerate-LFHFMTI5-R364IB4D.cjs.map +0 -1
- package/build/cjs/siteDeployCommand-3MZDNJBW.cjs.map +0 -1
- package/build/cjs/versionDeleteCommand-3AFHOPBB.cjs.map +0 -1
- package/build/cjs/versionGetCommand-G44GPMEG.cjs.map +0 -1
- package/build/cjs/versionListCommand-GTTXNVK4.cjs.map +0 -1
- package/build/cjs/versionSetCommand-ELRINKPK.cjs.map +0 -1
- package/build/cjs/versionUnsetCommand-GYBYED5E.cjs.map +0 -1
- package/build/esm/chunk-XUNEMZTE.js.map +0 -1
- package/build/esm/handleGenerate-LFHFMTI5-4XSGH53A.js.map +0 -1
- package/build/esm/siteDeployCommand-CM2MORY4.js.map +0 -1
- package/build/esm/versionDeleteCommand-X57FGSGV.js.map +0 -1
- package/build/esm/versionGetCommand-XXW7AUYY.js.map +0 -1
- package/build/esm/versionListCommand-YCG2FWRB.js.map +0 -1
- package/build/esm/versionSetCommand-VXNQ4MK6.js.map +0 -1
- package/build/esm/versionUnsetCommand-UFLNPHZE.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../cli.common/build/esm/public/loginFlow.js"],"names":[
|
|
1
|
+
{"version":3,"sources":["../../../cli.common/build/esm/public/loginFlow.js"],"names":["consola","parse","createServer","exit","open","getRandomValues","subtle","join"],"mappings":";;;;;;;;;;;;;;;;AAWA,SAAS,qBAAqB,QAAU,EAAA;AACtC,EAAA,OAAO,SAAS,KAAS,IAAA,IAAA,CAAA;AAC3B,CAAA;AAGA,IAAI,yBAAyB,EAAK,GAAA,GAAA,CAAA;AAClC,eAAe,gBAAgB,IAAM,EAAA;AACnC,EAAAA,wBAAA,CAAQ,KAAM,CAAA,CAAA,qCAAA,EAAwC,IAAK,CAAA,QAAQ,CAAE,CAAA,CAAA,CAAA;AACrE,EAAA,MAAM,WAAc,GAAA,qCAAA,CAAA;AACpB,EAAM,MAAA,IAAA,GAAOC,SAAM,CAAA,WAAW,CAAE,CAAA,IAAA,CAAA;AAChC,EAAI,IAAA,OAAA,CAAA;AACJ,EAAM,MAAA,QAAA,GAAW,IAAI,OAAA,CAAQ,CAAQ,IAAA,KAAA;AACnC,IAAU,OAAA,GAAA,IAAA,CAAA;AAAA,GACX,CAAA,CAAA;AACD,EAAA,MAAM,MAAS,GAAAC,iBAAA,CAAa,CAAC,GAAA,EAAK,GAAQ,KAAA;AACxC,IAAA,MAAM,KAAQ,GAAAD,SAAA,CAAM,GAAI,CAAA,GAAA,EAAK,IAAI,CAAE,CAAA,KAAA,CAAA;AACnC,IAAA,GAAA,CAAI,IAAI,eAAe,CAAA,CAAA;AACvB,IAAQ,OAAA,CAAA,KAAA,CAAM,MAAM,CAAC,CAAA,CAAA;AAAA,GACtB,CAAA,C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,IAAA,GAAO,IAAI,eAAgB,EAAA,CAAA;AACjC,EAAK,IAAA,CAAA,MAAA,CAAO,aAAa,QAAQ,CAAA,CAAA;AACjC,EAAK,IAAA,CAAA,MAAA,CAAO,cAAc,oBAAoB,CAAA,CAAA;AAC9C,EAAK,IAAA,CAAA,MAAA,CAAO,QAAQ,IAAI,CAAA,CAAA;AACxB,EAAK,IAAA,CAAA,MAAA,CAAO,gBAAgB,WAAW,CAAA,CAAA;AACvC,EAAK,IAAA,CAAA,MAAA,CAAO,iBAAiB,YAAY,CAAA,CAAA;AACzC,EAAM,MAAA,QAAA,GAAWA,WAAK,OAAS,EAAA,WAAA,EAAa,OAAO,QAAU,EAAA,OAAO,CAAI,GAAA,CAAA,OAAA,EAAU,YAAY,CAAA,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,mCAAA;AAAA,OAClB;AAAA,MACA,MAAQ,EAAA,MAAA;AAAA,KACT,CAAA,CAAA;AACD,IAAM,MAAA,YAAA,GAAe,MAAM,QAAA,CAAS,IAAK,EAAA,CAAA;AACzC,IAAO,OAAA,YAAA,CAAA;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,CAAA;AAAA,GACpG;AACF","file":"chunk-V7DUQNL2.cjs","sourcesContent":["import consola from 'consola';\nimport { getRandomValues, subtle } from 'crypto';\nimport { createServer } from 'http';\nimport { join } from 'path/posix';\nimport { exit } from 'process';\nimport { parse } from 'url';\nimport open from 'open';\n\n// src/commands/auth/login/loginFlow.ts\n\n// src/commands/auth/login/token.ts\nfunction isTokenErrorResponse(response) {\n return response.error != null;\n}\n\n// src/commands/auth/login/loginFlow.ts\nvar BROWSER_PROMPT_TIME_MS = 60 * 1e3;\nasync 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 const browserPrompt = setTimeout(() => {\n consola.warn(`Still waiting for the authentication to complete. Please open a browser to ${authorizeUrl}`);\n }, BROWSER_PROMPT_TIME_MS);\n const code = await authCode;\n server.close();\n clearTimeout(browserPrompt);\n const token = await getTokenWithCodeVerifier(clientId, redirectUrl, code, args.foundryUrl, codeVerifier);\n if (isTokenErrorResponse(token)) {\n consola.error(\"Unable to authenticate\", token.error, token.error_description);\n exit(1);\n }\n consola.success(`Successfully authenticated!`);\n return token;\n}\nfunction generateRandomString(length = 128) {\n const characters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~\";\n let output = [];\n let array = new Uint8Array(1);\n const maxIndex = 256 - 256 % characters.length;\n while (output.length < length) {\n getRandomValues(array);\n if (array[0] < maxIndex) {\n output.push(characters[array[0] % characters.length]);\n }\n }\n return output.join(\"\");\n}\nasync function generateCodeChallenge(codeVerifier) {\n const data = new TextEncoder().encode(codeVerifier);\n const digest = await subtle.digest(\"SHA-256\", data);\n const codeChallengeMethod = \"S256\";\n const codeChallenge = btoa(String.fromCharCode(...new Uint8Array(digest))).replace(/\\//g, \"_\").replace(/\\+/g, \"-\").replace(/=/g, \"\");\n return {\n codeChallenge,\n codeChallengeMethod\n };\n}\nfunction generateAuthorizeUrl(baseUrl, clientId, state, redirectUrl, codeChallenge) {\n const queryParams = new URLSearchParams();\n queryParams.append(\"client_id\", clientId);\n queryParams.append(\"response_type\", \"code\");\n queryParams.append(\"state\", state);\n queryParams.append(\"redirect_uri\", redirectUrl);\n queryParams.append(\"code_challenge\", codeChallenge.codeChallenge);\n queryParams.append(\"code_challenge_method\", codeChallenge.codeChallengeMethod);\n queryParams.append(\"scope\", [\"offline_access\", \"api:read-data\"].join(\" \"));\n return join(baseUrl, \"multipass\", \"api\", \"oauth2\", \"authorize\") + `?` + queryParams.toString();\n}\nasync function getTokenWithCodeVerifier(clientId, redirectUrl, code, baseUrl, codeVerifier) {\n const body = new URLSearchParams();\n body.append(\"client_id\", clientId);\n body.append(\"grant_type\", \"authorization_code\");\n body.append(\"code\", code);\n body.append(\"redirect_uri\", redirectUrl);\n body.append(\"code_verifier\", codeVerifier);\n const tokenUrl = join(baseUrl, \"multipass\", \"api\", \"oauth2\", \"token\") + `?state=${codeVerifier}`;\n try {\n const response = await fetch(tokenUrl, {\n body: body.toString(),\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\"\n },\n method: \"POST\"\n });\n const responseText = await response.json();\n return responseText;\n } catch (e) {\n throw new Error(`Failed to get token: ${e?.cause?.toString() ?? e?.toString() ?? \"Unknown error\"}`);\n }\n}\nexport { invokeLoginFlow as default };"]}
|
package/build/cjs/{handleGenerate-LFHFMTI5-R364IB4D.cjs → handleGenerate-BRWT5QJG-YCPINH4C.cjs}
RENAMED
|
@@ -66,9 +66,9 @@ var require_fast_deep_equal = chunkEMMSS5I5_cjs.__commonJS({
|
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
68
|
|
|
69
|
-
// ../cli.cmd.typescript/build/esm/handleGenerate-
|
|
69
|
+
// ../cli.cmd.typescript/build/esm/handleGenerate-BRWT5QJG.js
|
|
70
70
|
var import_fast_deep_equal = chunkEMMSS5I5_cjs.__toESM(require_fast_deep_equal(), 1);
|
|
71
|
-
var USER_AGENT = `osdk-cli.cmd.typescript/${"0.4.
|
|
71
|
+
var USER_AGENT = `osdk-cli.cmd.typescript/${"0.4.1"}`;
|
|
72
72
|
async function handleGenerate(args) {
|
|
73
73
|
let success = false;
|
|
74
74
|
if (args.ontologyPath) {
|
|
@@ -169,7 +169,7 @@ async function generateClientSdk(ontology, args) {
|
|
|
169
169
|
}
|
|
170
170
|
return true;
|
|
171
171
|
}
|
|
172
|
-
await generator.__UNSTABLE_generateClientSdkPackage(args.packageName, args.version, args.beta ? "2.0" : "1.1", args.outDir, ontology, minimalFs, await getDependencyVersions(), "0.22.
|
|
172
|
+
await generator.__UNSTABLE_generateClientSdkPackage(args.packageName, args.version, args.beta ? "2.0" : "1.1", args.outDir, ontology, minimalFs, await getDependencyVersions(), "0.22.1");
|
|
173
173
|
return true;
|
|
174
174
|
} catch (e) {
|
|
175
175
|
consola.consola.error("OSDK generation failed", e.message, e.stack);
|
|
@@ -182,10 +182,10 @@ async function getDependencyVersions() {
|
|
|
182
182
|
const typescriptVersion = ourPackageJson.devDependencies.typescript;
|
|
183
183
|
const tslibVersion = ourPackageJson.dependencies.tslib;
|
|
184
184
|
const areTheTypesWrongVersion = ourPackageJson.dependencies["@arethetypeswrong/cli"];
|
|
185
|
-
const osdkClientVersion = `^${"0.20.
|
|
186
|
-
const osdkClientApiVersion = `^${"0.20.
|
|
187
|
-
const osdkApiVersion = `^${"1.9.0
|
|
188
|
-
const osdkLegacyClientVersion = `^${"2.4.
|
|
185
|
+
const osdkClientVersion = `^${"0.20.1"}`;
|
|
186
|
+
const osdkClientApiVersion = `^${"0.20.1"}`;
|
|
187
|
+
const osdkApiVersion = `^${"1.9.0"}`;
|
|
188
|
+
const osdkLegacyClientVersion = `^${"2.4.1"}`;
|
|
189
189
|
return {
|
|
190
190
|
typescriptVersion,
|
|
191
191
|
tslibVersion,
|
|
@@ -199,7 +199,7 @@ async function getDependencyVersions() {
|
|
|
199
199
|
var cachedOurPackageJsonPath;
|
|
200
200
|
async function getOurPackageJsonPath() {
|
|
201
201
|
if (cachedOurPackageJsonPath) return cachedOurPackageJsonPath;
|
|
202
|
-
const __dir = path__namespace.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('
|
|
202
|
+
const __dir = path__namespace.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('handleGenerate-BRWT5QJG-YCPINH4C.cjs', document.baseURI).href))));
|
|
203
203
|
const ourPackageJsonPath = await findUp.findUp("package.json", {
|
|
204
204
|
cwd: __dir
|
|
205
205
|
});
|
|
@@ -232,5 +232,5 @@ function createNormalFs() {
|
|
|
232
232
|
|
|
233
233
|
exports.getDependencyVersions = getDependencyVersions;
|
|
234
234
|
exports.handleGenerate = handleGenerate;
|
|
235
|
-
//# sourceMappingURL=
|
|
236
|
-
//# sourceMappingURL=handleGenerate-
|
|
235
|
+
//# sourceMappingURL=handleGenerate-BRWT5QJG-YCPINH4C.cjs.map
|
|
236
|
+
//# sourceMappingURL=handleGenerate-BRWT5QJG-YCPINH4C.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js","../../../cli.cmd.typescript/build/esm/handleGenerate-BRWT5QJG.js"],"names":["__commonJS","__toESM","YargsCheckError","consola","ExitProcessError","fs","invokeLoginFlow","createClientContext","listOntologiesV2","createOpenApiRequest","getOntologyFullMetadata","findUp","getExpectedD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,CAAA,IAAA,GAAOM,8CAAuC,GAAAC,2CAAA,EAAmC,QAAU,EAAA,YAAA,CAAa,IAAK,CAAA,OAAO,CAAG,EAAA,GAAA,EAAK,IAAK,CAAA,MAAA,EAAQ,KAAK,WAAW,CAAA,CAAA;AACvK,CAAA;AACA,SAAS,aAAa,OAAS,EAAA;AAC7B,EAAA,IAAI,YAAY,KAAO,EAAA;AACrB,IAAO,OAAA,iCAAA,CAAA;AAAA,GACF,MAAA;AACL,IAAO,OAAA,CAAA,eAAA,EAAkB,OAAO,CAAA,CAAA,EAAI,UAAU,CAAA,CAAA,CAAA;AAAA,GAChD;AACF,CAAA;AACA,SAAS,cAAiB,GAAA;AACxB,EAAO,OAAA;AAAA,IACL,SAAA,EAAW,CAAC,KAAA,EAAO,QAAa,KAAA;AAC9B,MAAA,OAAUb,aAAS,CAAA,QAAA,CAAA,SAAA,CAAU,KAAO,EAAA,QAAA,EAAU,OAAO,CAAA,CAAA;AAAA,KACvD;AAAA,IACA,KAAA,EAAO,OAAO,KAAA,EAAO,OAAY,KAAA;AAC/B,MAAS,MAAAA,aAAA,CAAA,QAAA,CAAS,KAAM,CAAA,KAAA,EAAO,OAAO,CAAA,CAAA;AAAA,KACxC;AAAA,IACA,OAAS,EAAA,OAAM,KAAY,KAAAA,aAAA,CAAA,QAAA,CAAS,QAAQ,KAAK,CAAA;AAAA,GACnD,CAAA;AACF","file":"handleGenerate-BRWT5QJG-YCPINH4C.cjs","sourcesContent":["'use strict';\n\n// do not edit .js files directly - edit src/index.jst\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;) if (!equal(a[i], b[i])) return false;\n return true;\n }\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n for (i = length; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n if (!equal(a[key], b[key])) return false;\n }\n return true;\n }\n\n // true if both NaN, false otherwise\n return a !== a && b !== b;\n};","import { YargsCheckError, ExitProcessError } from '@osdk/cli.common';\nimport invokeLoginFlow from '@osdk/cli.common/loginFlow';\nimport { listOntologiesV2, getOntologyFullMetadata } from '@osdk/gateway/requests';\nimport { getExpectedDependencies, __UNSTABLE_generateClientSdkPackage, generateClientSdkVersionTwoPointZero, generateClientSdkVersionOneDotOne } from '@osdk/generator';\nimport { createClientContext, createOpenApiRequest } from '@osdk/shared.net';\nimport { consola } from 'consola';\nimport deepEqual from 'fast-deep-equal';\nimport { findUp } from 'find-up';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { fileURLToPath } from 'url';\n\n// src/generate/handleGenerate.mts\nvar USER_AGENT = `osdk-cli.cmd.typescript/${\"0.4.1\"}`;\nasync function handleGenerate(args) {\n let success = false;\n if (args.ontologyPath) {\n success = await generateFromLocalFile(args);\n } else if (args.foundryUrl && args.clientId) {\n success = await generateFromStack(args);\n } else {\n throw new YargsCheckError(\"Must have specified ontologyPath or stack and clientId\");\n }\n if (success) {\n consola.info(\"OSDK Generated!\");\n } else {\n throw new ExitProcessError(1, \"Failed to generate the TypeScript SDK\");\n }\n}\nasync function generateFromLocalFile(args) {\n if (!fs.existsSync(args.ontologyPath)) {\n consola.error(`Ontology file does not exist: ${args.ontologyPath}`);\n return false;\n }\n const ontology = JSON.parse(await fs.promises.readFile(args.ontologyPath, \"utf-8\"));\n return await generateClientSdk(ontology, args);\n}\nasync function generateFromStack(args) {\n const {\n foundryUrl,\n clientId,\n ontologyWritePath\n } = args;\n const token = await invokeLoginFlow({\n clientId,\n foundryUrl,\n verbose: 0\n });\n const {\n fetch\n } = createClientContext({\n metadata: {\n userAgent: USER_AGENT\n }\n }, args.foundryUrl, () => token.access_token, USER_AGENT);\n try {\n const ontologies = await listOntologiesV2(createOpenApiRequest(foundryUrl, fetch));\n if (args.ontologyRid) {\n ontologies.data = ontologies.data.filter(o => o.rid === args.ontologyRid);\n }\n if (ontologies.data.length !== 1) {\n consola.error(`Could not look up ontology with these credentials. Found ${ontologies.data.length} ontologies.`);\n return false;\n }\n const ontology = await getOntologyFullMetadata(createOpenApiRequest(foundryUrl, fetch), ontologies.data[0].apiName);\n if (ontologyWritePath) {\n fs.writeFileSync(ontologyWritePath, JSON.stringify(ontology, null, 2));\n }\n return await generateClientSdk(ontology, args);\n } catch (e) {\n consola.error(\"Failed to generate the ontology\", e);\n return false;\n }\n}\nasync function generateClientSdk(ontology, args) {\n const minimalFs = createNormalFs();\n try {\n if (args.clean) {\n consola.info(\"Cleaning output directory\", args.outDir);\n await fs.promises.rm(args.outDir, {\n recursive: true,\n force: true\n });\n }\n if (!args.asPackage) {\n await generateSourceFiles(args, ontology, minimalFs);\n const packageJsonPath = await findUp(\"package.json\", {\n cwd: args.outDir\n });\n if (!packageJsonPath) {\n return true;\n }\n const packageJsonOriginal = JSON.parse(await fs.promises.readFile(packageJsonPath, \"utf-8\"));\n const packageJson = JSON.parse(await fs.promises.readFile(packageJsonPath, \"utf-8\"));\n const dependencyVersions = await getDependencyVersions();\n if (args.internal) {\n dependencyVersions.osdkApiVersion = \"workspace:~\";\n dependencyVersions.osdkClientApiVersion = \"workspace:~\";\n dependencyVersions.osdkClientVersion = \"workspace:~\";\n dependencyVersions.osdkLegacyClientVersion = \"workspace:~\";\n }\n const expectedDeps = getExpectedDependencies(args.beta ? \"2.0\" : \"1.1\", dependencyVersions);\n for (const [type, deps] of Object.entries(expectedDeps)) {\n if (!(type in packageJson)) {\n packageJson[type] = deps;\n } else {\n Object.assign(packageJson[type], deps);\n }\n }\n if (!deepEqual(packageJsonOriginal, packageJson)) {\n await fs.promises.writeFile(packageJsonPath, JSON.stringify(packageJson, void 0, 2) + \"\\n\");\n }\n return true;\n }\n await __UNSTABLE_generateClientSdkPackage(args.packageName, args.version, args.beta ? \"2.0\" : \"1.1\", args.outDir, ontology, minimalFs, await getDependencyVersions(), \"0.22.1\");\n return true;\n } catch (e) {\n consola.error(\"OSDK generation failed\", e.message, e.stack);\n return false;\n }\n}\nasync function getDependencyVersions() {\n const ourPackageJsonPath = await getOurPackageJsonPath();\n const ourPackageJson = JSON.parse(await fs.promises.readFile(ourPackageJsonPath, \"utf-8\"));\n const typescriptVersion = ourPackageJson.devDependencies.typescript;\n const tslibVersion = ourPackageJson.dependencies.tslib;\n const areTheTypesWrongVersion = ourPackageJson.dependencies[\"@arethetypeswrong/cli\"];\n const osdkClientVersion = `^${\"0.20.1\"}`;\n const osdkClientApiVersion = `^${\"0.20.1\"}`;\n const osdkApiVersion = `^${\"1.9.0\"}`;\n const osdkLegacyClientVersion = `^${\"2.4.1\"}`;\n return {\n typescriptVersion,\n tslibVersion,\n areTheTypesWrongVersion,\n osdkApiVersion,\n osdkClientVersion,\n osdkClientApiVersion,\n osdkLegacyClientVersion\n };\n}\nvar cachedOurPackageJsonPath;\nasync function getOurPackageJsonPath() {\n if (cachedOurPackageJsonPath) return cachedOurPackageJsonPath;\n const __dir = path.dirname(fileURLToPath(import.meta.url));\n const ourPackageJsonPath = await findUp(\"package.json\", {\n cwd: __dir\n });\n if (!ourPackageJsonPath) {\n throw new Error(\"Could not find our package.json\");\n }\n return cachedOurPackageJsonPath = ourPackageJsonPath;\n}\nasync function generateSourceFiles(args, ontology, fs2) {\n await (args.beta ? generateClientSdkVersionTwoPointZero : generateClientSdkVersionOneDotOne)(ontology, getUserAgent(args.version), fs2, args.outDir, args.packageType);\n}\nfunction getUserAgent(version) {\n if (version === \"dev\") {\n return \"typescript-sdk/dev osdk-cli/dev\";\n } else {\n return `typescript-sdk/${version} ${USER_AGENT}`;\n }\n}\nfunction createNormalFs() {\n return {\n writeFile: (path2, contents) => {\n return fs.promises.writeFile(path2, contents, \"utf-8\");\n },\n mkdir: async (path2, options) => {\n await fs.promises.mkdir(path2, options);\n },\n readdir: async path2 => fs.promises.readdir(path2)\n };\n}\nexport { getDependencyVersions, handleGenerate };"]}
|
package/build/cjs/index.cjs
CHANGED
|
@@ -96,7 +96,7 @@ var generateCommand = {
|
|
|
96
96
|
});
|
|
97
97
|
},
|
|
98
98
|
handler: async (args) => {
|
|
99
|
-
const command10 = await import('./handleGenerate-
|
|
99
|
+
const command10 = await import('./handleGenerate-BRWT5QJG-YCPINH4C.cjs');
|
|
100
100
|
await command10.handleGenerate(args);
|
|
101
101
|
}
|
|
102
102
|
};
|
|
@@ -318,7 +318,7 @@ var command2 = {
|
|
|
318
318
|
}).middleware((args) => logDeployCommandConfigFileOverride(args, siteConfig));
|
|
319
319
|
},
|
|
320
320
|
handler: async (args) => {
|
|
321
|
-
const command10 = await import('./siteDeployCommand-
|
|
321
|
+
const command10 = await import('./siteDeployCommand-A22XLCDF.cjs');
|
|
322
322
|
const {
|
|
323
323
|
version,
|
|
324
324
|
autoVersion,
|
|
@@ -361,7 +361,7 @@ var command3 = {
|
|
|
361
361
|
}).group(["yes"], "Delete Options");
|
|
362
362
|
},
|
|
363
363
|
handler: async (args) => {
|
|
364
|
-
const command10 = await import('./versionDeleteCommand-
|
|
364
|
+
const command10 = await import('./versionDeleteCommand-ANP5N2PJ.cjs');
|
|
365
365
|
await command10.default(args);
|
|
366
366
|
}
|
|
367
367
|
};
|
|
@@ -375,7 +375,7 @@ var command4 = {
|
|
|
375
375
|
return argv;
|
|
376
376
|
},
|
|
377
377
|
handler: async (args) => {
|
|
378
|
-
const command10 = await import('./versionGetCommand-
|
|
378
|
+
const command10 = await import('./versionGetCommand-QL2Q2CP4.cjs');
|
|
379
379
|
await command10.default(args);
|
|
380
380
|
}
|
|
381
381
|
};
|
|
@@ -389,7 +389,7 @@ var command5 = {
|
|
|
389
389
|
return argv;
|
|
390
390
|
},
|
|
391
391
|
handler: async (args) => {
|
|
392
|
-
const command10 = await import('./versionListCommand-
|
|
392
|
+
const command10 = await import('./versionListCommand-ABUMTBDK.cjs');
|
|
393
393
|
await command10.default(args);
|
|
394
394
|
}
|
|
395
395
|
};
|
|
@@ -407,7 +407,7 @@ var command6 = {
|
|
|
407
407
|
});
|
|
408
408
|
},
|
|
409
409
|
handler: async (args) => {
|
|
410
|
-
const command10 = await import('./versionSetCommand-
|
|
410
|
+
const command10 = await import('./versionSetCommand-YRMBNTFW.cjs');
|
|
411
411
|
await command10.default(args);
|
|
412
412
|
}
|
|
413
413
|
};
|
|
@@ -425,7 +425,7 @@ var command7 = {
|
|
|
425
425
|
}).group(["yes"], "Unset Options");
|
|
426
426
|
},
|
|
427
427
|
handler: async (args) => {
|
|
428
|
-
const command10 = await import('./versionUnsetCommand-
|
|
428
|
+
const command10 = await import('./versionUnsetCommand-EOAXE7JX.cjs');
|
|
429
429
|
await command10.default(args);
|
|
430
430
|
}
|
|
431
431
|
};
|
|
@@ -507,7 +507,7 @@ async function logConfigFileMiddleware() {
|
|
|
507
507
|
|
|
508
508
|
// src/cli.ts
|
|
509
509
|
async function cli(args = process.argv) {
|
|
510
|
-
consola.consola.info(`Palantir OSDK CLI ${"0.22.
|
|
510
|
+
consola.consola.info(`Palantir OSDK CLI ${"0.22.1"}
|
|
511
511
|
`);
|
|
512
512
|
const base = chunkKN4OGPAB_cjs.getYargsBase(args);
|
|
513
513
|
try {
|
|
@@ -529,5 +529,5 @@ async function cli(args = process.argv) {
|
|
|
529
529
|
}
|
|
530
530
|
|
|
531
531
|
exports.cli = cli;
|
|
532
|
-
//# sourceMappingURL=
|
|
532
|
+
//# sourceMappingURL=index.cjs.map
|
|
533
533
|
//# sourceMappingURL=index.cjs.map
|
package/build/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../cli.cmd.typescript/build/esm/index.js","../../src/cli.ts","../../src/commands/auth/login/index.ts","../../src/commands/auth/index.ts","../../src/util/config.ts","../../src/util/configLoader.ts","../../src/commands/site/deploy/logDeployCommandConfigFileOverride.ts","../../src/commands/site/deploy/index.ts","../../src/commands/site/logSiteCommandConfigFileOverride.ts","../../src/commands/site/version/delete/index.ts","../../src/commands/site/version/get/index.ts","../../src/commands/site/version/list/index.ts","../../src/commands/site/version/set/index.ts","../../src/commands/site/version/unset/index.ts","../../src/commands/site/version/index.ts","../../src/commands/site/index.ts","../../src/yargs/logConfigFileMiddleware.ts"],"names":["command","consola","autoVersion","application","foundryUrl"],"mappings":";;;;;;;;;AACA,SAAS,eAAe;AAGxB,IAAI,kBAAkB;AAAA,EACpB,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS,UAAQ;AACf,WAAO,KAAK,QAAQ;AAAA,MAClB,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,aAAa;AAAA,QACb,cAAc;AAAA,MAChB;AAAA,MACA,cAAc;AAAA,QACZ,aAAa;AAAA,QACb,MAAM;AAAA,QACN,cAAc;AAAA,QACd,WAAW,CAAC,cAAc,UAAU;AAAA,MACtC;AAAA,MACA,YAAY;AAAA,QACV,aAAa;AAAA,QACb,MAAM;AAAA,QACN,cAAc;AAAA,QACd,WAAW;AAAA,QACX,SAAS;AAAA,QACT,OAAO;AAAA;AAAA,MAET;AAAA,MACA,UAAU;AAAA,QACR,aAAa;AAAA,QACb,MAAM;AAAA,QACN,cAAc;AAAA,QACd,WAAW;AAAA,QACX,SAAS;AAAA,MACX;AAAA,MACA,aAAa;AAAA,QACX,aAAa;AAAA,QACb,MAAM;AAAA,QACN,cAAc;AAAA,MAChB;AAAA,MACA,mBAAmB;AAAA,QACjB,aAAa;AAAA,QACb,MAAM;AAAA,QACN,cAAc;AAAA,QACd,WAAW,CAAC,cAAc;AAAA,MAC5B;AAAA,MACA,MAAM;AAAA,QACJ,MAAM;AAAA,QACN,aAAa;AAAA,QACb,cAAc;AAAA,MAChB;AAAA,MACA,aAAa;AAAA,QACX,S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AU;AACzB,UAAM,kBAAkB,MAAM,SAAS;AACvC,QAAI,gBAAgB;AAClB,MAAAA,SAAQ,MAAM,mCAAmC,cAAc,GAAG;AAAA,IACpE;AAAA,EACF;AACF;;;AfNA,eAAsB,IAAI,OAAO,QAAQ,MAAM;AAC7C,EAAAA,SAAQ,KAAK,qBAAqB,eAA2B;AAAA,CAAI;AACjE,QAAM,OAAO,aAAa,IAAI;AAG9B,MAAI;AACF,WAAO,MAAM,KAAK,WAAW,uBAAuB,EAAE,QAAQ,YAAI,EAAE,QAAQ;AAAA,MAC1E,SAAS;AAAA,MACT,SAAS,CAAC,cAAc;AAAA,MACxB,UAAU;AAAA,MACV,SAAS,OAAM,SAAQ;AACrB,eAAO,KAAK,QAAQ,iBAAU,EAAE,QAAQ,YAAI,EAAE,cAAc;AAAA,MAC9D;AAAA,MACA,SAAS,WAAS;AAAA,MAAC;AAAA,IACrB,CAAC,EAAE,WAAW;AAAA,EAChB,SAAS,KAAK;AACZ,QAAI,eAAe,kBAAkB;AACnC,MAAAA,SAAQ,MAAM,GAAG;AAAA,IACnB;AAAA,EACF;AACF","sourcesContent":["import { getYargsBase, ExitProcessError, YargsCheckError, isValidSemver } from '@osdk/cli.common';\nimport { consola } from 'consola';\n\n// src/cli.ts\nvar generateCommand = {\n command: \"generate\",\n describe: \"Generate TypeScript SDK from ontology\",\n builder: argv => {\n return argv.options({\n outDir: {\n type: \"string\",\n description: \"Where to place the generated files\",\n demandOption: true\n },\n ontologyPath: {\n description: \"Path to the ontology wire json\",\n type: \"string\",\n demandOption: false,\n conflicts: [\"foundryUrl\", \"clientId\"]\n },\n foundryUrl: {\n description: \"URL for the foundry stack that contains the ontology\",\n type: \"string\",\n demandOption: false,\n conflicts: \"ontologyPath\",\n implies: \"clientId\",\n alias: \"stack\"\n // for backwards compatibility\n },\n clientId: {\n description: \"OAuth client ID for application\",\n type: \"string\",\n demandOption: false,\n conflicts: \"ontologyPath\",\n implies: \"foundryUrl\"\n },\n ontologyRid: {\n description: \"Limit requests to this ontology rid only\",\n type: \"string\",\n demandOption: false\n },\n ontologyWritePath: {\n description: \"Path to write the ontology wire json\",\n type: \"string\",\n demandOption: false,\n conflicts: [\"ontologyPath\"]\n },\n beta: {\n type: \"boolean\",\n description: \"Should generate beta sdk\",\n demandOption: false\n },\n packageType: {\n default: \"commonjs\",\n choices: [\"commonjs\", \"module\"]\n },\n version: {\n type: \"string\",\n description: \"Version of the generated code, or 'dev'\",\n demandOption: true\n },\n packageName: {\n type: \"string\",\n description: \"Name of the package to generate\"\n },\n asPackage: {\n type: \"boolean\",\n description: \"Generate as a package (makes a package.json and co)\"\n },\n clean: {\n type: \"boolean\",\n description: \"Clean the output directory before generating\"\n },\n internal: {\n type: \"boolean\",\n default: false\n }\n }).group([\"ontologyPath\", \"outDir\", \"version\"], \"Generate from a local file\").group([\"foundryUrl\", \"clientId\", \"outDir\", \"ontologyWritePath\", \"version\"], \"OR Generate from Foundry\").group([\"packageName\", \"as\"], \"Package generation options\").check(args => {\n if (!args.ontologyPath && !args.foundryUrl) {\n throw new YargsCheckError(\"Must specify either ontologyPath or foundryUrl and clientId\");\n }\n if (args.version !== \"dev\" && !isValidSemver(args.version)) {\n throw new YargsCheckError(\"Version must be 'dev' or a valid semver version\");\n }\n if (args.asPackage && !args.packageName) {\n throw new YargsCheckError(\"Must specify packageName when generating as a package\");\n }\n if (args.asPackage && !args.version) {\n throw new YargsCheckError(\"Must specify version when generating as a package\");\n }\n return true;\n });\n },\n handler: async args => {\n const command = await import('./handleGenerate-LFHFMTI5.js');\n await command.handleGenerate(args);\n }\n};\n\n// src/cli.ts\nasync function cli(args = process.argv) {\n consola.info(`Palantir OSDK CLI ${\"0.4.0-beta.2\"}\n`);\n const base = getYargsBase(args);\n try {\n return await base.command(generateCommand).parseAsync();\n } catch (err) {\n if (err instanceof ExitProcessError) {\n consola.error(err);\n }\n }\n}\n\n// src/typescriptCommand.ts\nvar typescriptCommand = {\n command: \"typescript\",\n describe: \"Manage code\",\n builder: argv => {\n return argv.command(generateCommand).demandCommand();\n },\n handler: async args => {}\n};\nexport { cli, typescriptCommand as default };","/*\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 typescript from \"@osdk/cli.cmd.typescript\";\nimport { ExitProcessError, getYargsBase } from \"@osdk/cli.common\";\nimport { consola } from \"consola\";\nimport auth from \"./commands/auth/index.js\";\nimport site from \"./commands/site/index.js\";\nimport { logConfigFileMiddleware } from \"./yargs/logConfigFileMiddleware.js\";\nexport async function cli(args = process.argv) {\n consola.info(`Palantir OSDK CLI ${process.env.PACKAGE_VERSION}\\n`);\n const base = getYargsBase(args);\n\n // Special handling where failures happen before yargs does its error handling within .fail\n try {\n return await base.middleware(logConfigFileMiddleware).command(site).command({\n command: \"unstable\",\n aliases: [\"experimental\"],\n describe: \"Unstable commands\",\n builder: async argv => {\n return argv.command(typescript).command(auth).demandCommand();\n },\n handler: _args => {}\n }).parseAsync();\n } catch (err) {\n if (err instanceof ExitProcessError) {\n consola.error(err);\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 command = {\n command: \"login\",\n describe: \"Authenticate with an application ID\",\n builder: argv => {\n return argv.option(\"clientId\", {\n alias: \"applicationId\",\n // for backwards compatibility\n type: \"string\",\n demandOption: true,\n describe: \"OAuth client ID for application\"\n });\n },\n handler: async args => {\n const command = await import(\"@osdk/cli.common/loginFlow\");\n await command.default(args);\n }\n};\nexport default command;","/*\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 login from \"./login/index.js\";\nconst auth = {\n command: \"auth\",\n describe: \"Manage your session\",\n builder: argv => {\n return argv.options({\n foundryUrl: {\n type: \"string\",\n demandOption: true,\n alias: \"baseUrl\",\n // for backwards compatibility\n describe: \"URL for the Foundry stack\"\n }\n }).command(login).demandCommand();\n },\n handler: async args => {}\n};\nexport default auth;","/*\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 { promises as fsPromises } from \"node:fs\";\nimport { extname } from \"node:path\";\nconst CONFIG_FILE_NAMES = [\"foundry.config.json\"];\nconst CONFIG_FILE_SCHEMA = {\n type: \"object\",\n properties: {\n foundryUrl: {\n type: \"string\"\n },\n site: {\n type: \"object\",\n properties: {\n application: {\n type: \"string\"\n },\n directory: {\n type: \"string\"\n },\n autoVersion: {\n type: \"object\",\n nullable: true,\n oneOf: [{\n properties: {\n type: {\n const: \"git-describe\",\n type: \"string\"\n },\n tagPrefix: {\n type: \"string\",\n nullable: true\n }\n }\n }],\n required: [\"type\"]\n }\n },\n required: [\"application\", \"directory\"]\n }\n },\n required: [\"foundryUrl\", \"site\"],\n additionalProperties: false\n};\n\n/**\n * Asynchronously loads a configuration file. Looks for any of the CONFIG_FILE_NAMES in the current directory going up to the root directory.\n * @returns A promise that resolves to the configuration JSON object, or undefined if not found.\n * @throws Will throw an error if the configuration file is found but cannot be read or parsed.\n */\nexport async function loadFoundryConfig() {\n const ajvModule = await import(\"ajv\");\n const Ajv = ajvModule.default.default; // https://github.com/ajv-validator/ajv/issues/2132\n const ajv = new Ajv({\n allErrors: true\n });\n const validate = ajv.compile(CONFIG_FILE_SCHEMA);\n const {\n findUp\n } = await import(\"find-up\");\n const configFilePath = await findUp(CONFIG_FILE_NAMES);\n if (configFilePath) {\n let foundryConfig;\n try {\n const fileContent = await fsPromises.readFile(configFilePath, \"utf-8\");\n foundryConfig = parseConfigFile(fileContent, configFilePath);\n } catch (error) {\n throw new ExitProcessError(2, `Couldn't read or parse config file ${configFilePath}. Error: ${error}`);\n }\n if (!validate(foundryConfig)) {\n throw new ExitProcessError(2, `The configuration file does not match the expected schema: ${ajv.errorsText(validate.errors)}`);\n }\n return {\n foundryConfig,\n configFilePath\n };\n }\n return undefined;\n}\nfunction parseConfigFile(fileContent, configFilePath) {\n const extension = extname(configFilePath);\n switch (extension) {\n case \".json\":\n return JSON.parse(fileContent);\n default:\n throw new ExitProcessError(2, `Unsupported file extension: ${extension} for config file.`);\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 { loadFoundryConfig } from \"./config.js\";\nlet configPromise = undefined;\nfunction getConfig() {\n if (configPromise == null) {\n configPromise = loadFoundryConfig();\n }\n return configPromise;\n}\nexport default getConfig;","/*\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\";\nexport async function logDeployCommandConfigFileOverride(args, config) {\n if (config?.autoVersion != null && args.autoVersion !== config?.autoVersion.type) {\n consola.debug(`Overriding \"autoVersion\" from config file with ${args.autoVersion}`);\n }\n if (config?.directory != null && args.directory !== config?.directory) {\n consola.debug(`Overriding \"directory\" from config file with ${args.directory}`);\n }\n if (config?.autoVersion?.tagPrefix != null && args.gitTagPrefix != null && args.gitTagPrefix !== config?.autoVersion.tagPrefix) {\n consola.debug(`Overriding \"gitTagPrefix\" from config file with ${args.gitTagPrefix}`);\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 { isValidSemver, YargsCheckError } from \"@osdk/cli.common\";\nimport configLoader from \"../../../util/configLoader.js\";\nimport { logDeployCommandConfigFileOverride } from \"./logDeployCommandConfigFileOverride.js\";\nconst command = {\n command: \"deploy\",\n describe: \"Deploy a new site version\",\n builder: async argv => {\n const config = await configLoader();\n const siteConfig = config?.foundryConfig.site;\n const directory = siteConfig?.directory;\n const autoVersion = siteConfig?.autoVersion;\n const gitTagPrefix = autoVersion?.tagPrefix;\n return argv.options({\n directory: {\n type: \"string\",\n description: \"Directory containing site files\",\n ...(directory ? {\n default: directory\n } : {\n demandOption: true\n })\n },\n uploadOnly: {\n type: \"boolean\",\n description: \"Upload new site version only without setting as live\",\n default: false\n },\n version: {\n type: \"string\",\n description: \"New version of site to deploy\",\n ...(autoVersion == null ? {\n conflicts: \"autoVersion\"\n } : {})\n },\n autoVersion: {\n coerce: autoVersion => autoVersion,\n type: \"string\",\n choices: [\"git-describe\"],\n description: \"Enable auto versioning\",\n ...(autoVersion != null ? {\n default: autoVersion.type\n } : {\n conflicts: \"version\"\n })\n },\n gitTagPrefix: {\n type: \"string\",\n description: \"Prefix to match git tags on when 'git-describe' auto versioning is used. If not provided, all tags are matched and the prefix 'v' is stripped if present.\",\n ...(gitTagPrefix ? {\n default: gitTagPrefix\n } : {})\n }\n }).group([\"directory\", \"version\", \"uploadOnly\"], \"Deploy Options\").group([\"autoVersion\", \"gitTagPrefix\"], \"Auto Version Options\").check(args => {\n // This is required because we can't use demandOption with conflicts. conflicts protects us against the case where both are provided.\n // So this case is for when nothing is provided.\n if (autoVersion == null && args.autoVersion == null && args.version == null) {\n throw new YargsCheckError(\"One of --version or --autoVersion must be specified\");\n }\n if (args.version != null && !isValidSemver(args.version)) {\n throw new YargsCheckError(`--version \"${args.version}\" must be a valid SemVer string`);\n }\n const autoVersionType = args.autoVersion ?? autoVersion;\n if (autoVersionType !== \"git-describe\") {\n throw new YargsCheckError(`Only 'git-describe' is supported for autoVersion`);\n }\n const gitTagPrefixValue = args.gitTagPrefix ?? gitTagPrefix;\n // Future proofing for when we support other autoVersion types\n if (gitTagPrefixValue != null && autoVersionType !== \"git-describe\") {\n throw new YargsCheckError(`--gitTagPrefix is only supported when --autoVersion=git-describe`);\n }\n return true;\n }).middleware(args => logDeployCommandConfigFileOverride(args, siteConfig));\n },\n handler: async args => {\n const command = await import(\"./siteDeployCommand.mjs\");\n const {\n version,\n autoVersion,\n gitTagPrefix,\n ...restArgs\n } = args;\n const selectedVersion = args.version != null ? args.version : {\n type: args.autoVersion,\n tagPrefix: args.gitTagPrefix\n };\n await command.default({\n ...restArgs,\n selectedVersion\n });\n }\n};\nexport default command;","/*\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\";\nexport async function logSiteCommandConfigFileOverride(args, config) {\n if (config?.site.application != null && args.application !== config.site.application) {\n consola.debug(`Overriding \"application\" from config file with ${args.application}`);\n }\n if (config?.foundryUrl != null && args.foundryUrl !== config.foundryUrl) {\n consola.debug(`Overriding \"foundryUrl\" from config file with ${args.foundryUrl}`);\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\nconst command = {\n command: \"delete <version>\",\n describe: \"Delete site version\",\n builder: argv => {\n return argv.positional(\"version\", {\n type: \"string\",\n demandOption: true,\n description: \"Version to set as live\"\n }).option(\"yes\", {\n alias: \"y\",\n type: \"boolean\",\n description: \"Automatically confirm destructive changes\"\n }).group([\"yes\"], \"Delete Options\");\n },\n handler: async args => {\n const command = await import(\"./versionDeleteCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\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\nconst command = {\n command: \"get\",\n describe: \"Get live site version\",\n builder: argv => {\n return argv;\n },\n handler: async args => {\n const command = await import(\"./versionGetCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\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\nconst command = {\n command: \"list\",\n describe: \"List site versions\",\n builder: argv => {\n return argv;\n },\n handler: async args => {\n const command = await import(\"./versionListCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\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\nconst command = {\n command: \"set <version>\",\n describe: \"Set live site version\",\n builder: argv => {\n return argv.positional(\"version\", {\n type: \"string\",\n demandOption: true,\n description: \"Version to set as live\"\n });\n },\n handler: async args => {\n const command = await import(\"./versionSetCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\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\nconst command = {\n command: \"unset\",\n describe: \"Clear live site version\",\n builder: argv => {\n return argv.option(\"yes\", {\n alias: \"y\",\n type: \"boolean\",\n description: \"Automatically confirm destructive changes\"\n }).group([\"yes\"], \"Unset Options\");\n },\n handler: async args => {\n const command = await import(\"./versionUnsetCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\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 deleteCmd from \"./delete/index.js\";\nimport get from \"./get/index.js\";\nimport list from \"./list/index.js\";\nimport set from \"./set/index.js\";\nimport unset from \"./unset/index.js\";\nconst command = {\n command: \"version\",\n describe: \"Manage site versions\",\n builder: argv => {\n return argv.command(list).command(get).command(set).command(unset).command(deleteCmd).demandCommand();\n },\n handler: async args => {}\n};\nexport default command;","/*\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 { YargsCheckError } from \"@osdk/cli.common\";\nimport configLoader from \"../../util/configLoader.js\";\nimport deploy from \"./deploy/index.js\";\nimport { logSiteCommandConfigFileOverride } from \"./logSiteCommandConfigFileOverride.js\";\nimport version from \"./version/index.js\";\nconst command = {\n command: \"site\",\n describe: \"Manage your site\",\n builder: async argv => {\n const config = await configLoader();\n const application = config?.foundryConfig.site.application;\n const foundryUrl = config?.foundryConfig.foundryUrl;\n return argv.options({\n application: {\n type: \"string\",\n coerce: application => application,\n ...(application ? {\n default: application\n } : {\n demandOption: true\n }),\n description: \"Application resource identifier (rid)\"\n },\n foundryUrl: {\n coerce: foundryUrl => foundryUrl.replace(/\\/$/, \"\"),\n type: \"string\",\n ...(foundryUrl ? {\n default: foundryUrl\n } : {\n demandOption: true\n }),\n description: \"URL for the Foundry stack\"\n },\n token: {\n type: \"string\",\n conflicts: \"tokenFile\",\n description: \"Foundry API token\"\n },\n tokenFile: {\n type: \"string\",\n conflicts: \"token\",\n description: \"Path to file containing Foundry API token\"\n }\n }).group([\"application\", \"foundryUrl\", \"token\", \"tokenFile\"], \"Common Options\").command(version).command(deploy).check(args => {\n if (!args.foundryUrl.startsWith(\"https://\")) {\n throw new YargsCheckError(\"foundryUrl must start with https://\");\n }\n return true;\n }).middleware(args => logSiteCommandConfigFileOverride(args, config?.foundryConfig)).demandCommand();\n },\n handler: async args => {}\n};\nexport default command;","/*\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 getConfig from \"../util/configLoader.js\";\nlet firstTime = true;\nexport async function logConfigFileMiddleware() {\n if (firstTime) {\n firstTime = false;\n const config = getConfig();\n const configFilePath = (await config)?.configFilePath;\n if (configFilePath) {\n consola.debug(`Using configuration from file: \"${configFilePath}\"`);\n }\n }\n}"]}
|
|
1
|
+
{"version":3,"sources":["../../../cli.cmd.typescript/build/esm/index.js","../../src/commands/auth/login/index.ts","../../src/commands/auth/index.ts","../../src/util/config.ts","../../src/util/configLoader.ts","../../src/commands/site/deploy/logDeployCommandConfigFileOverride.ts","../../src/commands/site/deploy/index.ts","../../src/commands/site/logSiteCommandConfigFileOverride.ts","../../src/commands/site/version/delete/index.ts","../../src/commands/site/version/get/index.ts","../../src/commands/site/version/list/index.ts","../../src/commands/site/version/set/index.ts","../../src/commands/site/version/unset/index.ts","../../src/commands/site/version/index.ts","../../src/commands/site/index.ts","../../src/yargs/logConfigFileMiddleware.ts","../../src/cli.ts"],"names":["YargsCheckError","isValidSemver","command","fsPromises","ExitProcessError","extname","consola","autoVersion","application","foundryUrl","getYargsBase"],"mappings":";;;;;;;;AAIA,IAAI,eAAkB,GAAA;AAAA,EACpB,OAAS,EAAA,UAAA;AAAA,EACT,QAAU,EAAA,uCAAA;AAAA,EACV,SAAS,CAAQ,IAAA,KAAA;AACf,IAAA,OAAO,KAAK,O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UAAW,EAAA,CAAA;AAAA,WACP,GAAK,EAAA;AACZ,IAAA,IAAI,eAAeN,kCAAkB,EAAA;AACnC,MAAAE,eAAAA,CAAQ,MAAM,GAAG,CAAA,CAAA;AAAA,KACnB;AAAA,GACF;AACF","file":"index.cjs","sourcesContent":["import { getYargsBase, ExitProcessError, YargsCheckError, isValidSemver } from '@osdk/cli.common';\nimport { consola } from 'consola';\n\n// src/cli.ts\nvar generateCommand = {\n command: \"generate\",\n describe: \"Generate TypeScript SDK from ontology\",\n builder: argv => {\n return argv.options({\n outDir: {\n type: \"string\",\n description: \"Where to place the generated files\",\n demandOption: true\n },\n ontologyPath: {\n description: \"Path to the ontology wire json\",\n type: \"string\",\n demandOption: false,\n conflicts: [\"foundryUrl\", \"clientId\"]\n },\n foundryUrl: {\n description: \"URL for the foundry stack that contains the ontology\",\n type: \"string\",\n demandOption: false,\n conflicts: \"ontologyPath\",\n implies: \"clientId\",\n alias: \"stack\"\n // for backwards compatibility\n },\n clientId: {\n description: \"OAuth client ID for application\",\n type: \"string\",\n demandOption: false,\n conflicts: \"ontologyPath\",\n implies: \"foundryUrl\"\n },\n ontologyRid: {\n description: \"Limit requests to this ontology rid only\",\n type: \"string\",\n demandOption: false\n },\n ontologyWritePath: {\n description: \"Path to write the ontology wire json\",\n type: \"string\",\n demandOption: false,\n conflicts: [\"ontologyPath\"]\n },\n beta: {\n type: \"boolean\",\n description: \"Should generate beta sdk\",\n demandOption: false\n },\n packageType: {\n default: \"commonjs\",\n choices: [\"commonjs\", \"module\"]\n },\n version: {\n type: \"string\",\n description: \"Version of the generated code, or 'dev'\",\n demandOption: true\n },\n packageName: {\n type: \"string\",\n description: \"Name of the package to generate\"\n },\n asPackage: {\n type: \"boolean\",\n description: \"Generate as a package (makes a package.json and co)\"\n },\n clean: {\n type: \"boolean\",\n description: \"Clean the output directory before generating\"\n },\n internal: {\n type: \"boolean\",\n default: false\n }\n }).group([\"ontologyPath\", \"outDir\", \"version\"], \"Generate from a local file\").group([\"foundryUrl\", \"clientId\", \"outDir\", \"ontologyWritePath\", \"version\"], \"OR Generate from Foundry\").group([\"packageName\", \"as\"], \"Package generation options\").check(args => {\n if (!args.ontologyPath && !args.foundryUrl) {\n throw new YargsCheckError(\"Must specify either ontologyPath or foundryUrl and clientId\");\n }\n if (args.version !== \"dev\" && !isValidSemver(args.version)) {\n throw new YargsCheckError(\"Version must be 'dev' or a valid semver version\");\n }\n if (args.asPackage && !args.packageName) {\n throw new YargsCheckError(\"Must specify packageName when generating as a package\");\n }\n if (args.asPackage && !args.version) {\n throw new YargsCheckError(\"Must specify version when generating as a package\");\n }\n return true;\n });\n },\n handler: async args => {\n const command = await import('./handleGenerate-BRWT5QJG.js');\n await command.handleGenerate(args);\n }\n};\n\n// src/cli.ts\nasync function cli(args = process.argv) {\n consola.info(`Palantir OSDK CLI ${\"0.4.1\"}\n`);\n const base = getYargsBase(args);\n try {\n return await base.command(generateCommand).parseAsync();\n } catch (err) {\n if (err instanceof ExitProcessError) {\n consola.error(err);\n }\n }\n}\n\n// src/typescriptCommand.ts\nvar typescriptCommand = {\n command: \"typescript\",\n describe: \"Manage code\",\n builder: argv => {\n return argv.command(generateCommand).demandCommand();\n },\n handler: async args => {}\n};\nexport { cli, typescriptCommand as default };","/*\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 command = {\n command: \"login\",\n describe: \"Authenticate with an application ID\",\n builder: argv => {\n return argv.option(\"clientId\", {\n alias: \"applicationId\",\n // for backwards compatibility\n type: \"string\",\n demandOption: true,\n describe: \"OAuth client ID for application\"\n });\n },\n handler: async args => {\n const command = await import(\"@osdk/cli.common/loginFlow\");\n await command.default(args);\n }\n};\nexport default command;","/*\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 login from \"./login/index.js\";\nconst auth = {\n command: \"auth\",\n describe: \"Manage your session\",\n builder: argv => {\n return argv.options({\n foundryUrl: {\n type: \"string\",\n demandOption: true,\n alias: \"baseUrl\",\n // for backwards compatibility\n describe: \"URL for the Foundry stack\"\n }\n }).command(login).demandCommand();\n },\n handler: async args => {}\n};\nexport default auth;","/*\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 { promises as fsPromises } from \"node:fs\";\nimport { extname } from \"node:path\";\nconst CONFIG_FILE_NAMES = [\"foundry.config.json\"];\nconst CONFIG_FILE_SCHEMA = {\n type: \"object\",\n properties: {\n foundryUrl: {\n type: \"string\"\n },\n site: {\n type: \"object\",\n properties: {\n application: {\n type: \"string\"\n },\n directory: {\n type: \"string\"\n },\n autoVersion: {\n type: \"object\",\n nullable: true,\n oneOf: [{\n properties: {\n type: {\n const: \"git-describe\",\n type: \"string\"\n },\n tagPrefix: {\n type: \"string\",\n nullable: true\n }\n }\n }],\n required: [\"type\"]\n }\n },\n required: [\"application\", \"directory\"]\n }\n },\n required: [\"foundryUrl\", \"site\"],\n additionalProperties: false\n};\n\n/**\n * Asynchronously loads a configuration file. Looks for any of the CONFIG_FILE_NAMES in the current directory going up to the root directory.\n * @returns A promise that resolves to the configuration JSON object, or undefined if not found.\n * @throws Will throw an error if the configuration file is found but cannot be read or parsed.\n */\nexport async function loadFoundryConfig() {\n const ajvModule = await import(\"ajv\");\n const Ajv = ajvModule.default.default; // https://github.com/ajv-validator/ajv/issues/2132\n const ajv = new Ajv({\n allErrors: true\n });\n const validate = ajv.compile(CONFIG_FILE_SCHEMA);\n const {\n findUp\n } = await import(\"find-up\");\n const configFilePath = await findUp(CONFIG_FILE_NAMES);\n if (configFilePath) {\n let foundryConfig;\n try {\n const fileContent = await fsPromises.readFile(configFilePath, \"utf-8\");\n foundryConfig = parseConfigFile(fileContent, configFilePath);\n } catch (error) {\n throw new ExitProcessError(2, `Couldn't read or parse config file ${configFilePath}. Error: ${error}`);\n }\n if (!validate(foundryConfig)) {\n throw new ExitProcessError(2, `The configuration file does not match the expected schema: ${ajv.errorsText(validate.errors)}`);\n }\n return {\n foundryConfig,\n configFilePath\n };\n }\n return undefined;\n}\nfunction parseConfigFile(fileContent, configFilePath) {\n const extension = extname(configFilePath);\n switch (extension) {\n case \".json\":\n return JSON.parse(fileContent);\n default:\n throw new ExitProcessError(2, `Unsupported file extension: ${extension} for config file.`);\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 { loadFoundryConfig } from \"./config.js\";\nlet configPromise = undefined;\nfunction getConfig() {\n if (configPromise == null) {\n configPromise = loadFoundryConfig();\n }\n return configPromise;\n}\nexport default getConfig;","/*\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\";\nexport async function logDeployCommandConfigFileOverride(args, config) {\n if (config?.autoVersion != null && args.autoVersion !== config?.autoVersion.type) {\n consola.debug(`Overriding \"autoVersion\" from config file with ${args.autoVersion}`);\n }\n if (config?.directory != null && args.directory !== config?.directory) {\n consola.debug(`Overriding \"directory\" from config file with ${args.directory}`);\n }\n if (config?.autoVersion?.tagPrefix != null && args.gitTagPrefix != null && args.gitTagPrefix !== config?.autoVersion.tagPrefix) {\n consola.debug(`Overriding \"gitTagPrefix\" from config file with ${args.gitTagPrefix}`);\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 { isValidSemver, YargsCheckError } from \"@osdk/cli.common\";\nimport configLoader from \"../../../util/configLoader.js\";\nimport { logDeployCommandConfigFileOverride } from \"./logDeployCommandConfigFileOverride.js\";\nconst command = {\n command: \"deploy\",\n describe: \"Deploy a new site version\",\n builder: async argv => {\n const config = await configLoader();\n const siteConfig = config?.foundryConfig.site;\n const directory = siteConfig?.directory;\n const autoVersion = siteConfig?.autoVersion;\n const gitTagPrefix = autoVersion?.tagPrefix;\n return argv.options({\n directory: {\n type: \"string\",\n description: \"Directory containing site files\",\n ...(directory ? {\n default: directory\n } : {\n demandOption: true\n })\n },\n uploadOnly: {\n type: \"boolean\",\n description: \"Upload new site version only without setting as live\",\n default: false\n },\n version: {\n type: \"string\",\n description: \"New version of site to deploy\",\n ...(autoVersion == null ? {\n conflicts: \"autoVersion\"\n } : {})\n },\n autoVersion: {\n coerce: autoVersion => autoVersion,\n type: \"string\",\n choices: [\"git-describe\"],\n description: \"Enable auto versioning\",\n ...(autoVersion != null ? {\n default: autoVersion.type\n } : {\n conflicts: \"version\"\n })\n },\n gitTagPrefix: {\n type: \"string\",\n description: \"Prefix to match git tags on when 'git-describe' auto versioning is used. If not provided, all tags are matched and the prefix 'v' is stripped if present.\",\n ...(gitTagPrefix ? {\n default: gitTagPrefix\n } : {})\n }\n }).group([\"directory\", \"version\", \"uploadOnly\"], \"Deploy Options\").group([\"autoVersion\", \"gitTagPrefix\"], \"Auto Version Options\").check(args => {\n // This is required because we can't use demandOption with conflicts. conflicts protects us against the case where both are provided.\n // So this case is for when nothing is provided.\n if (autoVersion == null && args.autoVersion == null && args.version == null) {\n throw new YargsCheckError(\"One of --version or --autoVersion must be specified\");\n }\n if (args.version != null && !isValidSemver(args.version)) {\n throw new YargsCheckError(`--version \"${args.version}\" must be a valid SemVer string`);\n }\n const autoVersionType = args.autoVersion ?? autoVersion;\n if (autoVersionType !== \"git-describe\") {\n throw new YargsCheckError(`Only 'git-describe' is supported for autoVersion`);\n }\n const gitTagPrefixValue = args.gitTagPrefix ?? gitTagPrefix;\n // Future proofing for when we support other autoVersion types\n if (gitTagPrefixValue != null && autoVersionType !== \"git-describe\") {\n throw new YargsCheckError(`--gitTagPrefix is only supported when --autoVersion=git-describe`);\n }\n return true;\n }).middleware(args => logDeployCommandConfigFileOverride(args, siteConfig));\n },\n handler: async args => {\n const command = await import(\"./siteDeployCommand.mjs\");\n const {\n version,\n autoVersion,\n gitTagPrefix,\n ...restArgs\n } = args;\n const selectedVersion = args.version != null ? args.version : {\n type: args.autoVersion,\n tagPrefix: args.gitTagPrefix\n };\n await command.default({\n ...restArgs,\n selectedVersion\n });\n }\n};\nexport default command;","/*\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\";\nexport async function logSiteCommandConfigFileOverride(args, config) {\n if (config?.site.application != null && args.application !== config.site.application) {\n consola.debug(`Overriding \"application\" from config file with ${args.application}`);\n }\n if (config?.foundryUrl != null && args.foundryUrl !== config.foundryUrl) {\n consola.debug(`Overriding \"foundryUrl\" from config file with ${args.foundryUrl}`);\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\nconst command = {\n command: \"delete <version>\",\n describe: \"Delete site version\",\n builder: argv => {\n return argv.positional(\"version\", {\n type: \"string\",\n demandOption: true,\n description: \"Version to set as live\"\n }).option(\"yes\", {\n alias: \"y\",\n type: \"boolean\",\n description: \"Automatically confirm destructive changes\"\n }).group([\"yes\"], \"Delete Options\");\n },\n handler: async args => {\n const command = await import(\"./versionDeleteCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\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\nconst command = {\n command: \"get\",\n describe: \"Get live site version\",\n builder: argv => {\n return argv;\n },\n handler: async args => {\n const command = await import(\"./versionGetCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\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\nconst command = {\n command: \"list\",\n describe: \"List site versions\",\n builder: argv => {\n return argv;\n },\n handler: async args => {\n const command = await import(\"./versionListCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\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\nconst command = {\n command: \"set <version>\",\n describe: \"Set live site version\",\n builder: argv => {\n return argv.positional(\"version\", {\n type: \"string\",\n demandOption: true,\n description: \"Version to set as live\"\n });\n },\n handler: async args => {\n const command = await import(\"./versionSetCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\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\nconst command = {\n command: \"unset\",\n describe: \"Clear live site version\",\n builder: argv => {\n return argv.option(\"yes\", {\n alias: \"y\",\n type: \"boolean\",\n description: \"Automatically confirm destructive changes\"\n }).group([\"yes\"], \"Unset Options\");\n },\n handler: async args => {\n const command = await import(\"./versionUnsetCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\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 deleteCmd from \"./delete/index.js\";\nimport get from \"./get/index.js\";\nimport list from \"./list/index.js\";\nimport set from \"./set/index.js\";\nimport unset from \"./unset/index.js\";\nconst command = {\n command: \"version\",\n describe: \"Manage site versions\",\n builder: argv => {\n return argv.command(list).command(get).command(set).command(unset).command(deleteCmd).demandCommand();\n },\n handler: async args => {}\n};\nexport default command;","/*\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 { YargsCheckError } from \"@osdk/cli.common\";\nimport configLoader from \"../../util/configLoader.js\";\nimport deploy from \"./deploy/index.js\";\nimport { logSiteCommandConfigFileOverride } from \"./logSiteCommandConfigFileOverride.js\";\nimport version from \"./version/index.js\";\nconst command = {\n command: \"site\",\n describe: \"Manage your site\",\n builder: async argv => {\n const config = await configLoader();\n const application = config?.foundryConfig.site.application;\n const foundryUrl = config?.foundryConfig.foundryUrl;\n return argv.options({\n application: {\n type: \"string\",\n coerce: application => application,\n ...(application ? {\n default: application\n } : {\n demandOption: true\n }),\n description: \"Application resource identifier (rid)\"\n },\n foundryUrl: {\n coerce: foundryUrl => foundryUrl.replace(/\\/$/, \"\"),\n type: \"string\",\n ...(foundryUrl ? {\n default: foundryUrl\n } : {\n demandOption: true\n }),\n description: \"URL for the Foundry stack\"\n },\n token: {\n type: \"string\",\n conflicts: \"tokenFile\",\n description: \"Foundry API token\"\n },\n tokenFile: {\n type: \"string\",\n conflicts: \"token\",\n description: \"Path to file containing Foundry API token\"\n }\n }).group([\"application\", \"foundryUrl\", \"token\", \"tokenFile\"], \"Common Options\").command(version).command(deploy).check(args => {\n if (!args.foundryUrl.startsWith(\"https://\")) {\n throw new YargsCheckError(\"foundryUrl must start with https://\");\n }\n return true;\n }).middleware(args => logSiteCommandConfigFileOverride(args, config?.foundryConfig)).demandCommand();\n },\n handler: async args => {}\n};\nexport default command;","/*\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 getConfig from \"../util/configLoader.js\";\nlet firstTime = true;\nexport async function logConfigFileMiddleware() {\n if (firstTime) {\n firstTime = false;\n const config = getConfig();\n const configFilePath = (await config)?.configFilePath;\n if (configFilePath) {\n consola.debug(`Using configuration from file: \"${configFilePath}\"`);\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 typescript from \"@osdk/cli.cmd.typescript\";\nimport { ExitProcessError, getYargsBase } from \"@osdk/cli.common\";\nimport { consola } from \"consola\";\nimport auth from \"./commands/auth/index.js\";\nimport site from \"./commands/site/index.js\";\nimport { logConfigFileMiddleware } from \"./yargs/logConfigFileMiddleware.js\";\nexport async function cli(args = process.argv) {\n consola.info(`Palantir OSDK CLI ${process.env.PACKAGE_VERSION}\\n`);\n const base = getYargsBase(args);\n\n // Special handling where failures happen before yargs does its error handling within .fail\n try {\n return await base.middleware(logConfigFileMiddleware).command(site).command({\n command: \"unstable\",\n aliases: [\"experimental\"],\n describe: \"Unstable commands\",\n builder: async argv => {\n return argv.command(typescript).command(auth).demandCommand();\n },\n handler: _args => {}\n }).parseAsync();\n } catch (err) {\n if (err instanceof ExitProcessError) {\n consola.error(err);\n }\n }\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"loginFlow-DU7IQXS5.cjs"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkN7QAVHKA_cjs = require('./chunk-N7QAVHKA.cjs');
|
|
4
4
|
var chunkKN4OGPAB_cjs = require('./chunk-KN4OGPAB.cjs');
|
|
5
5
|
require('./chunk-EMMSS5I5.cjs');
|
|
6
6
|
var consola = require('consola');
|
|
@@ -83,9 +83,9 @@ async function siteDeployCommand({
|
|
|
83
83
|
token,
|
|
84
84
|
tokenFile
|
|
85
85
|
}) {
|
|
86
|
-
const loadedToken = await
|
|
86
|
+
const loadedToken = await chunkN7QAVHKA_cjs.loadToken(token, tokenFile);
|
|
87
87
|
const tokenProvider = () => loadedToken;
|
|
88
|
-
const clientCtx =
|
|
88
|
+
const clientCtx = chunkN7QAVHKA_cjs.createInternalClientContext(foundryUrl, tokenProvider);
|
|
89
89
|
let siteVersion;
|
|
90
90
|
if (typeof selectedVersion === "string") {
|
|
91
91
|
siteVersion = selectedVersion;
|
|
@@ -102,7 +102,7 @@ async function siteDeployCommand({
|
|
|
102
102
|
const archive = archiver__default.default("zip").directory(directory, false);
|
|
103
103
|
logArchiveStats(archive);
|
|
104
104
|
consola.consola.start("Uploading site files");
|
|
105
|
-
await Promise.all([
|
|
105
|
+
await Promise.all([chunkN7QAVHKA_cjs.third_party_applications_exports.uploadVersion(
|
|
106
106
|
clientCtx,
|
|
107
107
|
application,
|
|
108
108
|
siteVersion,
|
|
@@ -111,7 +111,7 @@ async function siteDeployCommand({
|
|
|
111
111
|
), archive.finalize()]);
|
|
112
112
|
consola.consola.success("Upload complete");
|
|
113
113
|
if (!uploadOnly) {
|
|
114
|
-
const website = await
|
|
114
|
+
const website = await chunkN7QAVHKA_cjs.third_party_applications_exports.deployWebsite(clientCtx, application, {
|
|
115
115
|
version: siteVersion
|
|
116
116
|
});
|
|
117
117
|
consola.consola.success(`Deployed ${siteVersion} successfully`);
|
|
@@ -120,7 +120,7 @@ async function siteDeployCommand({
|
|
|
120
120
|
logSiteLink("View live site:", `https://${domain}`);
|
|
121
121
|
}
|
|
122
122
|
} else {
|
|
123
|
-
const website = await
|
|
123
|
+
const website = await chunkN7QAVHKA_cjs.third_party_applications_exports.getWebsite(clientCtx, application);
|
|
124
124
|
const domain = website?.subdomains[0];
|
|
125
125
|
consola.consola.debug("Upload only mode enabled, skipping deployment");
|
|
126
126
|
if (domain != null) {
|
|
@@ -157,5 +157,5 @@ ${utils.colorize("green", link)}`,
|
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
module.exports = siteDeployCommand;
|
|
160
|
-
//# sourceMappingURL=
|
|
161
|
-
//# sourceMappingURL=siteDeployCommand-
|
|
160
|
+
//# sourceMappingURL=siteDeployCommand-A22XLCDF.cjs.map
|
|
161
|
+
//# sourceMappingURL=siteDeployCommand-A22XLCDF.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/util/autoVersion.ts","../../src/commands/site/deploy/siteDeployCommand.mts"],"names":["isValidSemver","ExitProcessError","promisify","exec","loadToken","createInternalClientContext","consola","path","fs","archiver","third_party_applications_exports","Readable","colorize"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,eAAsB,WAAA,CAAY,YAAY,EAAI,EAAA;AAChD,EAAM,MAAA,CAAC,aAAa,WAAW,CAAA,GAAI,cAAc,EAAK,GAAA,CAAC,WAAW,IAAI,MAAA,CAAO,IAAI,SAAS,CAAA,CAAE,CAAC,CAAI,GAAA,CAAC,QAAW,IAAI,MAAA,CAAO,KAAK,CAAC,CAAA,CAAA;AAC9H,EAAM,MAAA,UAAA,GAA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AA,MACL,OAAS,EAAA,CAAA;AAAA,MACT,WAAa,EAAA,OAAA;AAAA,MACb,WAAa,EAAA,SAAA;AAAA,KACf;AAAA,GACD,CAAA,CAAA;AACH","file":"siteDeployCommand-A22XLCDF.cjs","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 { ExitProcessError, isValidSemver } from \"@osdk/cli.common\";\nimport { exec } from \"node:child_process\";\nimport { promisify } from \"node:util\";\n\n/**\n * Gets the version string using git describe. If the @param tagPrefix is empty, git describe will return the\n * latest tag (without any filtering) and if the tag starts with \"v\", it will be removed.\n * @param tagPrefix The prefix to use for matching against tags. Defaults to an empty string.\n * @returns A promise that resolves to the version string.\n * @throws An error if the version string is not SemVer compliant or if the version cannot be determined.\n */\nexport async function autoVersion(tagPrefix = \"\") {\n const [matchPrefix, prefixRegex] = tagPrefix !== \"\" ? [tagPrefix, new RegExp(`^${tagPrefix}`)] : [undefined, new RegExp(`^v?`)];\n const gitVersion = await gitDescribe(matchPrefix);\n const version = gitVersion.trim().replace(prefixRegex, \"\");\n if (!isValidSemver(version)) {\n throw new ExitProcessError(2, `The version string ${version} is not SemVer compliant.`);\n }\n return version;\n}\nasync function gitDescribe(matchPrefix) {\n let gitVersion;\n try {\n const execAsync = promisify(exec);\n const {\n stdout\n } = await execAsync(`git describe --tags --first-parent --dirty${matchPrefix != null ? ` --match=\"${matchPrefix}*\"` : \"\"}`, {\n encoding: \"utf8\"\n });\n gitVersion = stdout;\n } catch (error) {\n if (error instanceof Error) {\n const errorMessage = error.message.toLowerCase();\n if (errorMessage.includes(\"not recognized\") || errorMessage.includes(\"command not found\") || errorMessage.includes(\"no such file or directory\")) {\n throw new ExitProcessError(2, \"Unable to determine auto version using git-describe as git is not installed or found in the PATH.\", `You can set up git and try again or supply a --version option to set the version manually`);\n }\n if (errorMessage.includes(\"fatal: not a git repository\")) {\n throw new ExitProcessError(2, `Unable to determine auto version using git-describe as the current directory is not a git repository.`, `You can run the command in a git repository and try again or supply a --version option to set the version manually`);\n }\n if (errorMessage.includes(\"fatal: no names found, cannot describe anything.\")) {\n throw new ExitProcessError(2, `Unable to determine auto version using git-describe as no matching tags were found.`, `You can create a tag matching the configured tag prefix and try again or supply a --version option to set the version manually`);\n }\n }\n throw new ExitProcessError(2, `Unable to determine auto version using git-describe: ${error}.`, `You can supply a --version option to set the version manually`);\n }\n return gitVersion;\n}","/*\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 { createInternalClientContext, thirdPartyApplications } from \"#net\";\nimport { ExitProcessError } from \"@osdk/cli.common\";\nimport archiver from \"archiver\";\nimport { colorize } from \"consola/utils\";\nimport * as fs from \"node:fs\";\nimport path from \"node:path\";\nimport { Readable } from \"node:stream\";\nimport { autoVersion as findAutoVersion } from \"../../../util/autoVersion.js\";\nimport { loadToken } from \"../../../util/token.js\";\nexport default async function siteDeployCommand({\n selectedVersion,\n application,\n foundryUrl,\n uploadOnly,\n directory,\n token,\n tokenFile\n}) {\n const loadedToken = await loadToken(token, tokenFile);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n let siteVersion;\n if (typeof selectedVersion === \"string\") {\n siteVersion = selectedVersion;\n } else {\n siteVersion = await findAutoVersion(selectedVersion.tagPrefix);\n consola.info(`Auto version inferred next version to be: ${siteVersion}`);\n }\n consola.debug(`Using directory for site files: \"${path.resolve(directory)}`);\n const stat = await fs.promises.stat(directory);\n if (!stat.isDirectory()) {\n throw new ExitProcessError(2, \"Specified path exists but is not a directory\");\n }\n consola.start(\"Zipping site files\");\n const archive = archiver(\"zip\").directory(directory, false);\n logArchiveStats(archive);\n consola.start(\"Uploading site files\");\n await Promise.all([thirdPartyApplications.uploadVersion(clientCtx, application, siteVersion, Readable.toWeb(archive) // This cast is because the dom fetch doesn't align type wise with streams\n ), archive.finalize()]);\n consola.success(\"Upload complete\");\n if (!uploadOnly) {\n const website = await thirdPartyApplications.deployWebsite(clientCtx, application, {\n version: siteVersion\n });\n consola.success(`Deployed ${siteVersion} successfully`);\n const domain = website.subdomains[0];\n if (domain != null) {\n logSiteLink(\"View live site:\", `https://${domain}`);\n }\n } else {\n const website = await thirdPartyApplications.getWebsite(clientCtx, application);\n const domain = website?.subdomains[0];\n consola.debug(\"Upload only mode enabled, skipping deployment\");\n if (domain != null) {\n logSiteLink(\"Preview link:\", `https://${domain}/.system/preview?previewVersion=${siteVersion}`);\n }\n }\n}\nfunction logArchiveStats(archive) {\n let archiveStats = {\n fileCount: 0,\n bytes: 0\n };\n archive.on(\"progress\", progress => {\n archiveStats = {\n fileCount: progress.entries.total,\n bytes: progress.fs.totalBytes\n };\n });\n archive.on(\"finish\", () => {\n consola.debug(`Zipped ${archiveStats.fileCount} files and ${archiveStats.bytes} bytes`);\n });\n}\nfunction logSiteLink(title, link) {\n consola.box({\n message: `${title}\\n\\n${colorize(\"green\", link)}`,\n style: {\n padding: 2,\n borderColor: \"green\",\n borderStyle: \"rounded\"\n }\n });\n}"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkDQYIDDJN_cjs = require('./chunk-DQYIDDJN.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkN7QAVHKA_cjs = require('./chunk-N7QAVHKA.cjs');
|
|
5
5
|
require('./chunk-KN4OGPAB.cjs');
|
|
6
6
|
require('./chunk-EMMSS5I5.cjs');
|
|
7
7
|
var consola = require('consola');
|
|
@@ -23,13 +23,13 @@ ${utils.colorize("bold", "This action cannot be undone.")}`, {
|
|
|
23
23
|
chunkDQYIDDJN_cjs.handlePromptCancel(confirmed);
|
|
24
24
|
}
|
|
25
25
|
consola.consola.start(`Deleting version ${version}`);
|
|
26
|
-
const loadedToken = await
|
|
26
|
+
const loadedToken = await chunkN7QAVHKA_cjs.loadToken(token, tokenFile);
|
|
27
27
|
const tokenProvider = () => loadedToken;
|
|
28
|
-
const clientCtx =
|
|
29
|
-
await
|
|
28
|
+
const clientCtx = chunkN7QAVHKA_cjs.createInternalClientContext(foundryUrl, tokenProvider);
|
|
29
|
+
await chunkN7QAVHKA_cjs.third_party_applications_exports.deleteVersion(clientCtx, application, version);
|
|
30
30
|
consola.consola.success(`Deleted version ${version}`);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
module.exports = versionDeleteCommand;
|
|
34
|
-
//# sourceMappingURL=
|
|
35
|
-
//# sourceMappingURL=versionDeleteCommand-
|
|
34
|
+
//# sourceMappingURL=versionDeleteCommand-ANP5N2PJ.cjs.map
|
|
35
|
+
//# sourceMappingURL=versionDeleteCommand-ANP5N2PJ.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/commands/site/version/delete/versionDeleteCommand.mts"],"names":["consola","colorize","handlePromptCancel","loadToken","createInternalClientContext","third_party_applications_exports"],"mappings":";;;;;;;;;AAqBA,eAAO,oBAA4C,CAAA;AAAA,EACjD,OAAA;AAAA,EACA,GAAA;AAAA,EACA,WAAA;AAAA,EACA,UAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAA;AACF,CAAG,EAAA;AACD,EAAA,IAAI,CAAC,GAAK,EAAA;AACR,IAAA,MAAM,SAAY,GAAA,MAAMA,eAAQ,CAAA,MAAA,CAAO,+CAA+C,OAAO,CAAA;AAAA,EAAMC,cAAS,CAAA,MAAA,EAAQ,+BAA+B,CAAC,CAAI,CAAA,EAAA;AAAA,MACtJ,IAAM,EAAA,SAAA;AAAA,KACP,CAAA,CAAA;AACD,IAAAC,oCAAA,CAAmB,SAAS,CAAA,CAAA;AAAA,GAC9B;AACA,EAAQF,eAAA,CAAA,KAAA,CAAM,CAAoB,iBAAA,EAAA,OAAO,CAAE,CAAA,CAAA,CAAA;AAC3C,EAAA,MAAM,WAAc,GAAA,MAAMG,2BAAU,CAAA,KAAA,EAAO,SAAS,CAAA,CAAA;AACpD,EAAA,MAAM,gBAAgB,MAAM,WAAA,CAAA;AAC5B,EAAM,MAAA,SAAA,GAAYC,6CAA4B,CAAA,UAAA,EAAY,aAAa,CAAA,CAAA;AACvE,EAAA,MAAMC,kDAAuB,CAAA,aAAA,CAAc,SAAW,EAAA,WAAA,EAAa,OAAO,CAAA,CAAA;AAC1E,EAAQL,eAAA,CAAA,OAAA,CAAQ,CAAmB,gBAAA,EAAA,OAAO,CAAE,CAAA,CAAA,CAAA;AAC9C","file":"versionDeleteCommand-ANP5N2PJ.cjs","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 { createInternalClientContext, thirdPartyApplications } from \"#net\";\nimport { consola } from \"consola\";\nimport { colorize } from \"consola/utils\";\nimport { handlePromptCancel } from \"../../../../consola/handlePromptCancel.js\";\nimport { loadToken } from \"../../../../util/token.js\";\nexport default async function versionDeleteCommand({\n version,\n yes,\n application,\n foundryUrl,\n token,\n tokenFile\n}) {\n if (!yes) {\n const confirmed = await consola.prompt(`Are you sure you want to delete the version ${version}?\\n${colorize(\"bold\", \"This action cannot be undone.\")}`, {\n type: \"confirm\"\n });\n handlePromptCancel(confirmed);\n }\n consola.start(`Deleting version ${version}`);\n const loadedToken = await loadToken(token, tokenFile);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n await thirdPartyApplications.deleteVersion(clientCtx, application, version);\n consola.success(`Deleted version ${version}`);\n}"]}
|