@osdk/cli 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/js/{chunk-OOW63BC4.cjs → chunk-D7QHLGEU.cjs} +88 -24
- package/build/js/chunk-D7QHLGEU.cjs.map +1 -0
- package/build/js/chunk-N6K26UR4.mjs +9 -0
- package/build/js/chunk-N6K26UR4.mjs.map +1 -0
- package/build/js/chunk-X2S4O5ZR.cjs +11 -0
- package/build/js/chunk-X2S4O5ZR.cjs.map +1 -0
- package/build/js/{chunk-SQHFJOHN.mjs → chunk-XNYKWAIE.mjs} +84 -26
- package/build/js/chunk-XNYKWAIE.mjs.map +1 -0
- package/build/js/{handleGenerate-K6X2HG4V.mjs → handleGenerate-A7X2XAGW.mjs} +2 -2
- package/build/js/{handleGenerate-FCY2LRSZ.cjs → handleGenerate-WOW33WYG.cjs} +2 -2
- package/build/js/index.cjs +334 -81
- package/build/js/index.cjs.map +1 -1
- package/build/js/index.mjs +333 -80
- package/build/js/index.mjs.map +1 -1
- package/build/js/siteDeployCommand-HSR3QDAT.mjs +82 -0
- package/build/js/siteDeployCommand-HSR3QDAT.mjs.map +1 -0
- package/build/js/siteDeployCommand-MXKGJFFB.cjs +107 -0
- package/build/js/siteDeployCommand-MXKGJFFB.cjs.map +1 -0
- package/build/js/versionDeleteCommand-6BJL5XLG.mjs +26 -0
- package/build/js/versionDeleteCommand-6BJL5XLG.mjs.map +1 -0
- package/build/js/versionDeleteCommand-RLU7UUYD.cjs +28 -0
- package/build/js/versionDeleteCommand-RLU7UUYD.cjs.map +1 -0
- package/build/js/versionGetCommand-OR4RLOLM.mjs +28 -0
- package/build/js/versionGetCommand-OR4RLOLM.mjs.map +1 -0
- package/build/js/versionGetCommand-Y2VR2WKH.cjs +30 -0
- package/build/js/versionGetCommand-Y2VR2WKH.cjs.map +1 -0
- package/build/js/versionListCommand-5KM5PFYL.cjs +34 -0
- package/build/js/versionListCommand-5KM5PFYL.cjs.map +1 -0
- package/build/js/versionListCommand-LPPGQCQF.mjs +32 -0
- package/build/js/versionListCommand-LPPGQCQF.mjs.map +1 -0
- package/build/js/versionSetCommand-LHOVVI6U.mjs +31 -0
- package/build/js/versionSetCommand-LHOVVI6U.mjs.map +1 -0
- package/build/js/versionSetCommand-VD3L5DOV.cjs +33 -0
- package/build/js/versionSetCommand-VD3L5DOV.cjs.map +1 -0
- package/build/js/versionUnsetCommand-IJT4JWBN.mjs +24 -0
- package/build/js/versionUnsetCommand-IJT4JWBN.mjs.map +1 -0
- package/build/js/versionUnsetCommand-XYBUQ6XB.cjs +26 -0
- package/build/js/versionUnsetCommand-XYBUQ6XB.cjs.map +1 -0
- package/build/types/YargsCheckError.d.ts +3 -0
- package/build/types/commands/site/CommonSiteArgs.d.ts +4 -2
- package/build/types/commands/site/deploy/SiteDeployArgs.d.ts +5 -2
- package/build/types/commands/site/deploy/index.d.ts +1 -1
- package/build/types/commands/site/deploy/logDeployCommandConfigFileOverride.d.ts +4 -0
- package/build/types/commands/site/deploy/siteDeployCommand.d.mts +2 -0
- package/build/types/commands/site/index.d.ts +3 -3
- package/build/types/commands/site/logSiteCommandConfigFileOverride.d.ts +4 -0
- package/build/types/commands/site/version/SiteVersionArgs.d.ts +4 -0
- package/build/types/commands/site/version/delete/index.d.ts +5 -0
- package/build/types/commands/site/version/delete/versionDeleteCommand.d.mts +2 -0
- package/build/types/commands/site/version/get/index.d.ts +4 -0
- package/build/types/commands/site/version/get/versionGetCommand.d.mts +2 -0
- package/build/types/commands/site/{versions → version}/index.d.ts +1 -1
- package/build/types/commands/site/version/list/index.d.ts +4 -0
- package/build/types/commands/site/version/list/versionListCommand.d.mts +2 -0
- package/build/types/commands/site/version/set/index.d.ts +5 -0
- package/build/types/commands/site/version/set/versionSetCommand.d.mts +2 -0
- package/build/types/commands/site/version/unset/index.d.ts +4 -0
- package/build/types/commands/site/version/unset/versionUnsetCommand.d.mts +2 -0
- package/build/types/net/artifacts/SiteAssetArtifactsService/DeleteSiteVersionRequest.d.mts +5 -0
- package/build/types/net/artifacts/SiteAssetArtifactsService/UploadZippedSiteAssetRequest.d.mts +6 -0
- package/build/types/net/artifacts/SiteAssetArtifactsService/deleteSiteVersion.d.mts +3 -2
- package/build/types/net/artifacts/SiteAssetArtifactsService/fetchSiteVersions.d.mts +2 -1
- package/build/types/net/artifacts/SiteAssetArtifactsService/uploadSiteVersion.d.mts +3 -2
- package/build/types/net/createConjureContext.d.mts +1 -1
- package/build/types/net/createInternalClientContext.d.mts +2 -0
- package/build/types/net/index.d.mts +1 -0
- package/build/types/net/internalClientContext.d.mts +4 -0
- package/build/types/net/third-party-application-service/fetchWebsiteRepositoryRid.d.mts +2 -1
- package/build/types/util/autoVersion.d.ts +8 -0
- package/build/types/util/autoVersion.test.d.ts +1 -0
- package/build/types/util/config.d.ts +25 -0
- package/build/types/util/config.test.d.ts +1 -0
- package/build/types/util/configLoader.d.ts +3 -0
- package/build/types/util/isValidSemver.test.d.ts +1 -0
- package/build/types/util/token.d.ts +21 -0
- package/build/types/util/token.test.d.ts +1 -0
- package/build/types/yargs/logConfigFileMiddleware.d.ts +1 -0
- package/changelog/0.3.0/pr-20.v2.yml +5 -0
- package/changelog/0.4.0/pr-15.v2.yml +5 -0
- package/changelog/0.4.0/pr-17.v2.yml +5 -0
- package/changelog/0.4.0/pr-35.v2.yml +5 -0
- package/changelog/0.4.0/pr-41.v2.yml +5 -0
- package/changelog/0.4.0/pr-42.v2.yml +5 -0
- package/changelog/@unreleased/.gitkeep +0 -0
- package/package.json +5 -2
- package/build/js/chunk-OOW63BC4.cjs.map +0 -1
- package/build/js/chunk-SQHFJOHN.mjs.map +0 -1
- package/build/js/handleSiteDeploy-5C2FGADK.cjs +0 -30
- package/build/js/handleSiteDeploy-5C2FGADK.cjs.map +0 -1
- package/build/js/handleSiteDeploy-HHXON5YE.mjs +0 -28
- package/build/js/handleSiteDeploy-HHXON5YE.mjs.map +0 -1
- package/build/js/siteDeleteCommand-47GMSHFS.mjs +0 -13
- package/build/js/siteDeleteCommand-47GMSHFS.mjs.map +0 -1
- package/build/js/siteDeleteCommand-7YTHDD4P.cjs +0 -15
- package/build/js/siteDeleteCommand-7YTHDD4P.cjs.map +0 -1
- package/build/js/siteUploadCommand-HBZYJ4ZP.cjs +0 -58
- package/build/js/siteUploadCommand-HBZYJ4ZP.cjs.map +0 -1
- package/build/js/siteUploadCommand-S2HTCGZK.mjs +0 -33
- package/build/js/siteUploadCommand-S2HTCGZK.mjs.map +0 -1
- package/build/js/siteVersionsCommand-GU3HKEGQ.cjs +0 -29
- package/build/js/siteVersionsCommand-GU3HKEGQ.cjs.map +0 -1
- package/build/js/siteVersionsCommand-X5MO726Z.mjs +0 -27
- package/build/js/siteVersionsCommand-X5MO726Z.mjs.map +0 -1
- package/build/types/commands/site/delete/DeleteArgs.d.ts +0 -4
- package/build/types/commands/site/delete/index.d.ts +0 -5
- package/build/types/commands/site/delete/siteDeleteCommand.d.mts +0 -2
- package/build/types/commands/site/deploy/handleSiteDeploy.d.mts +0 -2
- package/build/types/commands/site/upload/UploadArgs.d.ts +0 -5
- package/build/types/commands/site/upload/index.d.ts +0 -5
- package/build/types/commands/site/upload/siteUploadCommand.d.mts +0 -2
- package/build/types/commands/site/versions/siteVersionsCommand.d.mts +0 -2
- /package/{CHANGELOG.md → CHANGELOG_OLD.md} +0 -0
- /package/build/js/{handleGenerate-FCY2LRSZ.cjs.map → handleGenerate-A7X2XAGW.mjs.map} +0 -0
- /package/build/js/{handleGenerate-K6X2HG4V.mjs.map → handleGenerate-WOW33WYG.cjs.map} +0 -0
package/build/js/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cli.ts","../../src/commands/auth/login/index.ts","../../src/commands/auth/index.ts","../../src/commands/site/delete/index.ts","../../src/commands/site/deploy/index.ts","../../src/commands/site/upload/index.ts","../../src/commands/site/versions/index.ts","../../src/commands/site/index.ts","../../src/util/isValidSemver.ts","../../src/commands/typescript/generate/generate.ts","../../src/commands/typescript/index.ts","../../src/yargs/logVersionMiddleware.ts"],"names":["command","site","argv"],"mappings":";;;;;;AAgBA,OAAO,WAAW;AAClB,SAAS,eAAe;;;ACDjB,IAAM,UAAU;AAAA,EACrB,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS,UAAQ;AACf,WAAO,KAAK,OAAO,iBAAiB;AAAA,MAClC,MAAM;AAAA,MACN,cAAc;AAAA,IAChB,CAAC;AAAA,EACH;AAAA,EACA,SAAS,OAAM,SAAQ;AACrB,UAAMA,WAAU,MAAM,OAAO,0BAAgB;AAC7C,UAAMA,SAAQ,QAAQ,IAAI;AAAA,EAC5B;AACF;AACA,IAAO,gBAAQ;;;ACbf,IAAM,OAAO;AAAA,EACX,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS,UAAQ;AACf,WAAO,KAAK,QAAQ;AAAA,MAClB,SAAS;AAAA,QACP,MAAM;AAAA,QACN,cAAc;AAAA,MAChB;AAAA,IACF,CAAC,EAAE,QAAQ,aAAK,EAAE,cAAc;AAAA,EAClC;AAAA,EACA,SAAS,OAAM,SAAQ;AAAA,EAAC;AAC1B;AACA,IAAO,eAAQ;;;ACdR,IAAMA,WAAU;AAAA,EACrB,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS,UAAQ;AACf,WAAO,KAAK,OAAO,eAAe;AAAA,MAChC,MAAM;AAAA,MACN,cAAc;AAAA,IAChB,CAAC,EAAE,OAAO,OAAO;AAAA,MACf,MAAM;AAAA,IACR,CAAC;AAAA,EACH;AAAA,EACA,SAAS,OAAM,SAAQ;AACrB,UAAMA,WAAU,MAAM,OAAO,kCAAyB;AACtD,UAAMA,SAAQ,QAAQ,IAAI;AAAA,EAC5B;AACF;AACA,IAAO,iBAAQA;;;AChBR,IAAMA,WAAU;AAAA,EACrB,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS,UAAQ;AACf,WAAO,KAAK,QAAQ;AAAA,MAClB,eAA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AAA,IAC7E,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,OAAO;AAAA,EACT,CAAC,EAAE,cAAc,EAAE,WAAW,sBAAsB,IAAI,EAAE,OAAO,EAAE,QAAQ;AAAA,IACzE,SAAS;AAAA,IACT,SAAS,CAAC,cAAc;AAAA,IACxB,SAAS,OAAM,SAAQ;AACrB,aAAO,KAAK,QAAQ,YAAI,EAAE,QAAQ,kBAAU,EAAE,QAAQ,YAAI,EAAE,cAAc;AAAA,IAC5E;AAAA,IACA,SAAS,WAAS;AAAA,IAAC;AAAA,EACrB,CAAC;AACD,MAAI;AACF,WAAO,KAAK,WAAW;AAAA,EACzB,SAAS,GAAG;AACV,QAAI,aAAa,kBAAkB;AACjC,YAAM,UAAU,MAAM,OAAO,SAAS;AACtC,cAAQ,QAAQ,MAAM,EAAE,OAAO;AAAA,IACjC;AAAA,EACF;AACF","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 yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport auth from \"./commands/auth/index.js\";\nimport site from \"./commands/site/index.js\";\nimport typescript from \"./commands/typescript/index.js\";\nimport { ExitProcessError } from \"./ExitProcessError.js\";\nimport { logVersionMiddleware } from \"./yargs/logVersionMiddleware.js\";\nexport async function cli(args = process.argv) {\n const base = yargs(hideBin(args)).env(\"OSDK\").version(false).option(\"verbose\", {\n alias: \"v\",\n type: \"boolean\",\n description: \"Enable verbose logging\",\n count: true\n }).demandCommand().middleware(logVersionMiddleware, true).strict().command({\n command: \"unstable\",\n aliases: [\"experimental\"],\n builder: async argv => {\n return argv.command(site).command(typescript).command(auth).demandCommand();\n },\n handler: _args => {}\n });\n try {\n return base.parseAsync();\n } catch (e) {\n if (e instanceof ExitProcessError) {\n const Consola = await import(\"consola\");\n Consola.consola.error(e.message);\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(\"applicationId\", {\n type: \"string\",\n demandOption: true\n });\n },\n handler: async args => {\n const command = await import(\"./loginFlow.js\");\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 site = {\n command: \"auth\",\n describe: \"Manage your session\",\n builder: argv => {\n return argv.options({\n baseUrl: {\n type: \"string\",\n demandOption: true\n }\n }).command(login).demandCommand();\n },\n handler: async args => {}\n};\nexport default site;","/*\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: \"delete\",\n describe: \"Delete an uploaded version\",\n builder: argv => {\n return argv.option(\"siteVersion\", {\n type: \"string\",\n demandOption: true\n }).option(\"dir\", {\n type: \"string\"\n });\n },\n handler: async args => {\n const command = await import(\"./siteDeleteCommand.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\nexport const command = {\n command: \"deploy\",\n describe: \"Deploy an uploaded version\",\n builder: argv => {\n return argv.options({\n \"siteVersion\": {\n type: \"string\",\n conflicts: \"clearVersion\"\n // group: \"Deploy Version\",\n // implies: { \"clearVersion\": \"false\" },\n },\n undeploy: {\n alias: \"clearVersion\",\n description: \"Causes the site to no longer be deployed\",\n type: \"boolean\",\n conflicts: \"siteVersion\"\n // group: \"Deploy Version\",\n // implies: { \"siteVersion\": \"\" },\n }\n }).group([\"siteVersion\", \"clearVersion\"], \"Version To Deploy (requires one of)\");\n\n // .check((args) => {\n // if (\n // (args.siteVersion && args.clearVersion)\n // || (!args.siteVersion && args.clearVersion == undefined)\n // ) {\n // // consola.error(\"Only one of --siteVersion or --clearVersion may be provided\");\n // throw new Error(\n // \"Only one of --siteVersion or --clearVersion may be provided\",\n // );\n // }\n // });\n },\n handler: async args => {\n const command = await import(\"./handleSiteDeploy.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\nexport const command = {\n command: \"upload\",\n describe: \"Upload an application version\",\n builder: argv => {\n return argv.option(\"siteVersion\", {\n type: \"string\",\n demandOption: true\n }).option(\"dir\", {\n type: \"string\"\n });\n },\n handler: async args => {\n const command = await import(\"./siteUploadCommand.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\nexport const command = {\n command: \"versions\",\n describe: \"List application versions\",\n builder: argv => {\n return argv;\n },\n handler: async args => {\n const command = await import(\"./siteVersionsCommand.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 siteDelete from \"./delete/index.js\";\nimport siteDeploy from \"./deploy/index.js\";\nimport upload from \"./upload/index.js\";\nimport versions from \"./versions/index.js\";\nconst site = {\n command: \"site\",\n describe: \"Manage your site\",\n builder: argv => {\n return argv.options({\n appRid: {\n type: \"string\",\n demandOption: true,\n coerce: a => a\n },\n baseUrl: {\n type: \"string\",\n demandOption: true\n }\n }).group([\"appRid\", \"baseUrl\"], \"Common Arguments\").command(versions).command(upload).command(siteDelete).command(siteDeploy).demandCommand();\n },\n handler: async args => {}\n};\nexport default site;","/*\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\n// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\nconst semver = /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/;\nexport function isValidSemver(semverString) {\n return semver.test(semverString);\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 } from \"../../../util/isValidSemver.js\";\nexport const command = {\n command: \"generate\",\n describe: \"Generate typescript 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: [\"stack\", \"clientId\"]\n },\n stack: {\n description: \"the URL to the stack that contains the ontology\",\n type: \"string\",\n demandOption: false,\n conflicts: \"ontologyPath\",\n implies: \"clientId\"\n },\n clientId: {\n description: \"the application's client id\",\n type: \"string\",\n demandOption: false,\n conflicts: \"ontologyPath\",\n implies: \"stack\"\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 }).group([\"ontologyPath\", \"outDir\", \"version\"], \"Generate from a local file\").group([\"stack\", \"clientId\", \"outDir\", \"ontologyWritePath\", \"version\"], \"OR Generate from a stack\").check(argv => {\n if (!argv.ontologyPath && !argv.stack) {\n throw new Error(\"Error: Must specify either ontologyPath or stack and clientId\");\n }\n if (argv.version !== \"dev\" && !isValidSemver(argv.version)) {\n throw new Error(\"Error: Version must be 'dev' or a valid semver version\");\n }\n return true;\n });\n },\n handler: async args => {\n const command = await import(\"./handleGenerate.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 generate from \"./generate/generate.js\";\nconst site = {\n command: \"typescript\",\n describe: \"Manage code\",\n builder: argv => {\n return argv.command(generate).demandCommand();\n },\n handler: async args => {}\n};\nexport default site;","/*\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\nlet firstTime = true;\nexport async function logVersionMiddleware(args) {\n if (firstTime) {\n const Consola = await import(\"consola\");\n // This will be called before any command is executed\n const consola = Consola.consola;\n consola.info(`Palantir OSDK CLI ${process.env.PACKAGE_VERSION}`);\n consola.level = 3 + args.verbose; // so 1 -v is debug logs and -vv is trace\n if (consola.level > 3) {\n consola.debug(`Verbose logging enabled (${consola.level === 4 ? \"debug\" : \"trace\"})`);\n }\n\n // eslint-disable-next-line no-console\n console.log(); // Not consola. Just want a blank line\n firstTime = false;\n }\n}"]}
|
|
1
|
+
{"version":3,"sources":["../../src/cli.ts","../../src/commands/auth/login/index.ts","../../src/commands/auth/index.ts","../../src/util/config.ts","../../src/util/configLoader.ts","../../src/YargsCheckError.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/commands/typescript/generate/generate.ts","../../src/commands/typescript/index.ts","../../src/yargs/logConfigFileMiddleware.ts","../../src/yargs/logVersionMiddleware.ts"],"names":["command","argv","application","foundryUrl","site","firstTime"],"mappings":";;;;;;;;;AAgBA,OAAO,WAAW;AAClB,SAAS,eAAe;;;ACDjB,IAAM,UAAU;AAAA,EACrB,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS,UAAQ;AACf,WAAO,KAAK,OAAO,iBAAiB;AAAA,MAClC,MAAM;AAAA,MACN,cAAc;AAAA,IAChB,CAAC;AAAA,EACH;AAAA,EACA,SAAS,OAAM,SAAQ;AACrB,UAAMA,YAAU,MAAM,OAAO,0BAAgB;AAC7C,UAAMA,UAAQ,QAAQ,IAAI;AAAA,EAC5B;AACF;AACA,IAAO,gBAAQ;;;ACbf,IAAM,OAAO;AAAA,EACX,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS,UAAQ;AACf,WAAO,KAAK,QAAQ;AAAA,MAClB,SAAS;AAAA,QACP,MAAM;AAAA,QACN,cAAc;AAAA,MAChB;AAAA,IACF,CAAC,EAAE,QAAQ,aAAK,EAAE,cAAc;AAAA,EAClC;AAAA,EACA,SAAS,OAAM,SAAQ;AAAA,EAAC;AAC1B;AACA,IAAO,eAAQ;;;ACdf,SAAS,YAAY,kBAAkB;AAEvC,IAAM,oBAAoB,CAAC,qBAAqB;AAChD,IAAM,qBAAqB;AAAA,EACzB,MAAM;AAAA,EACN,YAAY;AAAA,IACV,YAAY;AAAA,MACV,MAAM;AAAA,IACR;AAAA,IACA,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,YAAY;AAAA,QACV,aAAa;AAAA,UACX,MAAM;AAAA,QACR;AAAA,QACA,WAAW;AAAA,UACT,MAAM;AAAA,QACR;AAAA,QACA,aAAa;AAAA,UACX,MAAM;AAAA,UACN,UAAU;AAAA,UACV,OAAO,CAAC;AAAA,YACN,Y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B,gBAAQ,QAAQ,IAAI,EAAE;AAEtB,gBAAQ,MAAM,GAAG;AAAA,MACnB;AAAA,IACF;AACA,YAAQ,KAAK,CAAC;AAAA,EAChB,CAAC;AAGD,MAAI;AACF,WAAO,MAAM,KAAK,WAAW;AAAA,EAC/B,SAAS,KAAK;AACZ,QAAI,eAAe,kBAAkB;AACnC,YAAM,UAAU,MAAM,OAAO,SAAS;AACtC,cAAQ,QAAQ,MAAM,GAAG;AAAA,IAC3B;AAAA,EACF;AACF","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 yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport auth from \"./commands/auth/index.js\";\nimport site from \"./commands/site/index.js\";\nimport typescript from \"./commands/typescript/index.js\";\nimport { ExitProcessError } from \"./ExitProcessError.js\";\nimport { logConfigFileMiddleware } from \"./yargs/logConfigFileMiddleware.js\";\nimport { logVersionMiddleware } from \"./yargs/logVersionMiddleware.js\";\nimport { YargsCheckError } from \"./YargsCheckError.js\";\nexport async function cli(args = process.argv) {\n const base = yargs(hideBin(args)).env(\"OSDK\").version(false).option(\"verbose\", {\n alias: \"v\",\n type: \"boolean\",\n description: \"Enable verbose logging\",\n count: true\n }).demandCommand().middleware(logVersionMiddleware, true).middleware(logConfigFileMiddleware).strict().command({\n command: \"unstable\",\n aliases: [\"experimental\"],\n builder: async argv => {\n return argv.command(site).command(typescript).command(auth).demandCommand();\n },\n handler: _args => {}\n }).fail(async (msg, err, yargsContext) => {\n const Consola = await import(\"consola\");\n const isVerbose = args.some(arg => [\"-v\", \"--v\", \"--verbose\"].includes(arg));\n if (err instanceof ExitProcessError) {\n if (isVerbose) {\n Consola.consola.error(err);\n } else {\n Consola.consola.error(err.message);\n }\n } else {\n if (err && err instanceof YargsCheckError === false) {\n throw err;\n } else {\n yargsContext.showHelp();\n Consola.consola.log(\"\"); // intentional blank line\n // eslint-disable-next-line no-console\n console.error(msg);\n }\n }\n process.exit(1);\n });\n\n // Special handling where failures happen before yargs does its error handling within .fail\n try {\n return await base.parseAsync();\n } catch (err) {\n if (err instanceof ExitProcessError) {\n const Consola = await import(\"consola\");\n Consola.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(\"applicationId\", {\n type: \"string\",\n demandOption: true\n });\n },\n handler: async args => {\n const command = await import(\"./loginFlow.js\");\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 site = {\n command: \"auth\",\n describe: \"Manage your session\",\n builder: argv => {\n return argv.options({\n baseUrl: {\n type: \"string\",\n demandOption: true\n }\n }).command(login).demandCommand();\n },\n handler: async args => {}\n};\nexport default site;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { promises as fsPromises } from \"node:fs\";\nimport { ExitProcessError } from \"../ExitProcessError.js\";\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 Consola = await import(\"consola\");\n const consola = Consola.consola;\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 = JSON.parse(fileContent);\n } catch {\n throw new ExitProcessError(2, `Couldn't read or parse config file ${configFilePath}`);\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}","/*\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\nexport class YargsCheckError extends Error {\n constructor(msg) {\n super(msg);\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 async function logDeployCommandConfigFileOverride(argv, config) {\n const Consola = await import(\"consola\");\n const consola = Consola.consola;\n if (config?.autoVersion != null && argv.autoVersion !== config?.autoVersion.type) {\n consola.debug(`Overriding \"autoVersion\" from config file with ${argv.autoVersion}`);\n }\n if (config?.directory != null && argv.directory !== config?.directory) {\n consola.debug(`Overriding \"directory\" from config file with ${argv.directory}`);\n }\n if (config?.autoVersion?.tagPrefix != null && argv.gitTagPrefix != null && argv.gitTagPrefix !== config?.autoVersion.tagPrefix) {\n consola.debug(`Overriding \"gitTagPrefix\" from config file with ${argv.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 configLoader from \"../../../util/configLoader.js\";\nimport { YargsCheckError } from \"../../../YargsCheckError.js\";\nimport { logDeployCommandConfigFileOverride } from \"./logDeployCommandConfigFileOverride.js\";\nconst command = {\n command: \"deploy\",\n describe: \"Deploy an uploaded 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 to deploy\",\n ...(directory ? {\n default: directory\n } : {\n demandOption: true\n })\n },\n uploadOnly: {\n type: \"boolean\",\n description: \"Upload the directory but do not deploy it\",\n default: false\n },\n version: {\n type: \"string\",\n description: \"Version to deploy\",\n ...(autoVersion == null ? {\n conflicts: \"autoVersion\"\n } : {})\n },\n autoVersion: {\n type: \"string\",\n description: \"Enables autoversioning. Can be set to 'git-describe' to use git describe to determine the version.\",\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 against when --autoVersion=git-describe is used. If not provided, a default prefix 'v' is used.\",\n ...(gitTagPrefix ? {\n default: gitTagPrefix\n } : {})\n }\n }).group([\"autoVersion\", \"gitTagPrefix\"], \"Autoversion Arguments\").group([\"version\", \"directory\", \"uploadOnly\"], \"Common Arguments\").check(argv => {\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 && argv.autoVersion == null && argv.version == null) {\n throw new YargsCheckError(\"One of --version or --autoVersion must be specified\");\n }\n const autoVersionType = argv.autoVersion ?? autoVersion;\n if (autoVersionType !== \"git-describe\") {\n throw new YargsCheckError(`Only 'git-describe' is supported for autoVersion`);\n }\n const gitTagPrefixValue = argv.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(argv => logDeployCommandConfigFileOverride(argv, siteConfig));\n },\n handler: async args => {\n const command = await import(\"./siteDeployCommand.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\nexport async function logSiteCommandConfigFileOverride(argv, config) {\n const Consola = await import(\"consola\");\n const consola = Consola.consola;\n if (config?.site.application != null && argv.application !== config.site.application) {\n consola.debug(`Overriding \"application\" from config file with ${argv.application}`);\n }\n if (config?.foundryUrl != null && argv.foundryUrl !== config.foundryUrl) {\n consola.debug(`Overriding \"foundryUrl\" from config file with ${argv.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 the specified 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(\"./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 the currently set 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 application 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 the 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 the currently set live site version.\",\n builder: argv => {\n return argv;\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 application version\",\n builder: argv => {\n return argv.command(list).command(set).command(unset).command(deleteCmd).command(get).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 configLoader from \"../../util/configLoader.js\";\nimport { YargsCheckError } from \"../../YargsCheckError.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 RID\"\n },\n foundryUrl: {\n coerce: foundryUrl => foundryUrl.replace(/\\/$/, \"\"),\n type: \"string\",\n ...(foundryUrl ? {\n default: foundryUrl\n } : {\n demandOption: true\n }),\n description: \"Foundry Stack URL with Protocol (e.g. https://example.palantirfoundry.com)\"\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 a file containing your Foundry API Token\"\n }\n }).group([\"application\", \"foundryUrl\", \"token\", \"tokenFile\"], \"Common Arguments\").command(version).command(deploy).check(argv => {\n if (!argv.foundryUrl.startsWith(\"https://\")) {\n throw new YargsCheckError(\"foundryUrl must start with https://\");\n }\n return true;\n }).middleware(argv => logSiteCommandConfigFileOverride(argv, 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 { isValidSemver } from \"../../../util/isValidSemver.js\";\nexport const command = {\n command: \"generate\",\n describe: \"Generate typescript 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: [\"stack\", \"clientId\"]\n },\n stack: {\n description: \"the URL to the stack that contains the ontology\",\n type: \"string\",\n demandOption: false,\n conflicts: \"ontologyPath\",\n implies: \"clientId\"\n },\n clientId: {\n description: \"the application's client id\",\n type: \"string\",\n demandOption: false,\n conflicts: \"ontologyPath\",\n implies: \"stack\"\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 }).group([\"ontologyPath\", \"outDir\", \"version\"], \"Generate from a local file\").group([\"stack\", \"clientId\", \"outDir\", \"ontologyWritePath\", \"version\"], \"OR Generate from a stack\").check(argv => {\n if (!argv.ontologyPath && !argv.stack) {\n throw new Error(\"Error: Must specify either ontologyPath or stack and clientId\");\n }\n if (argv.version !== \"dev\" && !isValidSemver(argv.version)) {\n throw new Error(\"Error: Version must be 'dev' or a valid semver version\");\n }\n return true;\n });\n },\n handler: async args => {\n const command = await import(\"./handleGenerate.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 generate from \"./generate/generate.js\";\nconst site = {\n command: \"typescript\",\n describe: \"Manage code\",\n builder: argv => {\n return argv.command(generate).demandCommand();\n },\n handler: async args => {}\n};\nexport default site;","/*\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 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 const Consola = await import(\"consola\");\n const consola = Consola.consola;\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\nlet firstTime = true;\nexport async function logVersionMiddleware(args) {\n if (firstTime) {\n firstTime = false;\n const Consola = await import(\"consola\");\n // This will be called before any command is executed\n const consola = Consola.consola;\n consola.info(`Palantir OSDK CLI ${process.env.PACKAGE_VERSION}`);\n consola.level = 3 + args.verbose; // so 1 -v is debug logs and -vv is trace\n if (consola.level > 3) {\n consola.debug(`Verbose logging enabled (${consola.level === 4 ? \"debug\" : \"trace\"})`);\n }\n consola.log(\"\"); // intentional blank line\n }\n}"]}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { isValidSemver } from './chunk-N6K26UR4.mjs';
|
|
2
|
+
import { loadToken, createInternalClientContext, artifacts_exports, third_party_application_service_exports, createConjureContext, ArtifactsSitesAdminV2Service_exports } from './chunk-XNYKWAIE.mjs';
|
|
3
|
+
import { ExitProcessError } from './chunk-GTNZA5UY.mjs';
|
|
4
|
+
import './chunk-E2SEJZTC.mjs';
|
|
5
|
+
import { consola } from 'consola';
|
|
6
|
+
import archiver from 'archiver';
|
|
7
|
+
import * as fs from 'fs';
|
|
8
|
+
import { Readable } from 'stream';
|
|
9
|
+
import { execSync } from 'child_process';
|
|
10
|
+
|
|
11
|
+
async function autoVersion(tagPrefix = "") {
|
|
12
|
+
const [matchPrefix, prefixRegex] = tagPrefix !== "" ? [tagPrefix, new RegExp(`^${tagPrefix}`)] : [void 0, new RegExp(`^v?`)];
|
|
13
|
+
try {
|
|
14
|
+
const gitVersion = execSync(`git describe --tags --first-parent --dirty${matchPrefix != null ? ` --match="${matchPrefix}*"` : ""}`, {
|
|
15
|
+
encoding: "utf8"
|
|
16
|
+
});
|
|
17
|
+
const version = gitVersion.trim().replace(prefixRegex, "");
|
|
18
|
+
if (!isValidSemver(version)) {
|
|
19
|
+
throw new ExitProcessError(2, `The version string ${version} is not SemVer compliant.`);
|
|
20
|
+
}
|
|
21
|
+
return version;
|
|
22
|
+
} catch (error) {
|
|
23
|
+
throw new ExitProcessError(2, `Unable to determine the version automatically. Please supply a --version argument. ${error}`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// src/commands/site/deploy/siteDeployCommand.mts
|
|
28
|
+
async function siteDeployCommand({
|
|
29
|
+
version,
|
|
30
|
+
application,
|
|
31
|
+
foundryUrl,
|
|
32
|
+
autoVersion: autoVersion2,
|
|
33
|
+
gitTagPrefix,
|
|
34
|
+
uploadOnly,
|
|
35
|
+
directory,
|
|
36
|
+
token,
|
|
37
|
+
tokenFile
|
|
38
|
+
}) {
|
|
39
|
+
if (version == null && autoVersion2 == null) {
|
|
40
|
+
throw new Error("Either version or autoVersion must be specified");
|
|
41
|
+
}
|
|
42
|
+
const loadedToken = await loadToken(token, tokenFile);
|
|
43
|
+
let siteVersion;
|
|
44
|
+
if (version != null) {
|
|
45
|
+
siteVersion = version;
|
|
46
|
+
} else {
|
|
47
|
+
siteVersion = await autoVersion(gitTagPrefix);
|
|
48
|
+
consola.info(`Auto version inferred next version to be: ${siteVersion}`);
|
|
49
|
+
}
|
|
50
|
+
const stat = await fs.promises.stat(directory);
|
|
51
|
+
if (!stat.isDirectory()) {
|
|
52
|
+
consola.error("Specified path is not a directory");
|
|
53
|
+
throw new ExitProcessError(2);
|
|
54
|
+
}
|
|
55
|
+
consola.start("Zippping site files");
|
|
56
|
+
const archive = archiver("zip").directory(directory, false);
|
|
57
|
+
const tokenProvider = () => loadedToken;
|
|
58
|
+
const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);
|
|
59
|
+
await Promise.all([artifacts_exports.SiteAssetArtifactsService.uploadZippedSiteAsset(clientCtx, {
|
|
60
|
+
application,
|
|
61
|
+
version: siteVersion,
|
|
62
|
+
zipFile: Readable.toWeb(archive)
|
|
63
|
+
// This cast is because the dom fetch doesnt align type wise with streams
|
|
64
|
+
}), archive.finalize()]);
|
|
65
|
+
consola.success("Upload complete");
|
|
66
|
+
if (!uploadOnly) {
|
|
67
|
+
const repositoryRid = await third_party_application_service_exports.fetchWebsiteRepositoryRid(clientCtx, application);
|
|
68
|
+
const ctx = createConjureContext(foundryUrl, "/artifacts/api", tokenProvider);
|
|
69
|
+
await ArtifactsSitesAdminV2Service_exports.updateDeployedVersion(ctx, repositoryRid, {
|
|
70
|
+
siteVersion: {
|
|
71
|
+
version: siteVersion
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
consola.success(`Deployed ${siteVersion} successfully`);
|
|
75
|
+
} else {
|
|
76
|
+
consola.debug("Upload only mode enabled, skipping deployment");
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export { siteDeployCommand as default };
|
|
81
|
+
//# sourceMappingURL=out.js.map
|
|
82
|
+
//# sourceMappingURL=siteDeployCommand-HSR3QDAT.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/commands/site/deploy/siteDeployCommand.mts","../../src/util/autoVers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,UAAM,IAAI,iBAAiB,CAAC;AAAA,EAC9B;AACA,UAAQ,MAAM,qBAAqB;AACnC,QAAM,UAAU,SAAS,KAAK,EAAE,UAAU,WAAW,KAAK;AAC1D,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,QAAM,QAAQ,IAAI,CAAC,kBAAU,0BAA0B,sBAAsB,WAAW;AAAA,IACtF;AAAA,IACA,SAAS;AAAA,IACT,SAAS,SAAS,MAAM,OAAO;AAAA;AAAA,EACjC,CAAC,GAAG,QAAQ,SAAS,CAAC,CAAC;AACvB,UAAQ,QAAQ,iBAAiB;AACjC,MAAI,CAAC,YAAY;AACf,UAAM,gBAAgB,MAAM,wCAA6B,0BAA0B,WAAW,WAAW;AACzG,UAAM,MAAM,qBAAqB,YAAY,kBAAkB,aAAa;AAC5E,UAAM,qCAA6B,sBAAsB,KAAK,eAAe;AAAA,MAC3E,aAAa;AAAA,QACX,SAAS;AAAA,MACX;AAAA,IACF,CAAC;AACD,YAAQ,QAAQ,YAAY,WAAW,eAAe;AAAA,EACxD,OAAO;AACL,YAAQ,MAAM,+CAA+C;AAAA,EAC/D;AACF","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nimport { artifacts, ArtifactsSitesAdminV2Service, createConjureContext, createInternalClientContext, thirdPartyApplicationService } from \"#net\";\nimport archiver from \"archiver\";\nimport * as fs from \"node:fs\";\nimport { Readable } from \"node:stream\";\nimport { ExitProcessError } from \"../../../ExitProcessError.js\";\nimport { autoVersion as findAutoVersion } from \"../../../util/autoVersion.js\";\nimport { loadToken } from \"../../../util/token.js\";\nexport default async function siteDeployCommand({\n version,\n application,\n foundryUrl,\n autoVersion,\n gitTagPrefix,\n uploadOnly,\n directory,\n token,\n tokenFile\n}) {\n if (version == null && autoVersion == null) {\n throw new Error(\"Either version or autoVersion must be specified\");\n }\n const loadedToken = await loadToken(token, tokenFile);\n\n // version has a priority over autoVersion. Both could be defined at the same time when\n // autoVersion is present in the config file (it assigns that as a default value to argv.autoVersion)\n // and --version is passed as an argument\n let siteVersion;\n if (version != null) {\n siteVersion = version;\n } else {\n siteVersion = await findAutoVersion(gitTagPrefix);\n consola.info(`Auto version inferred next version to be: ${siteVersion}`);\n }\n const stat = await fs.promises.stat(directory);\n if (!stat.isDirectory()) {\n consola.error(\"Specified path is not a directory\");\n throw new ExitProcessError(2);\n }\n consola.start(\"Zippping site files\");\n const archive = archiver(\"zip\").directory(directory, false);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n await Promise.all([artifacts.SiteAssetArtifactsService.uploadZippedSiteAsset(clientCtx, {\n application,\n version: siteVersion,\n zipFile: Readable.toWeb(archive) // This cast is because the dom fetch doesnt align type wise with streams\n }), archive.finalize()]);\n consola.success(\"Upload complete\");\n if (!uploadOnly) {\n const repositoryRid = await thirdPartyApplicationService.fetchWebsiteRepositoryRid(clientCtx, application);\n const ctx = createConjureContext(foundryUrl, \"/artifacts/api\", tokenProvider);\n await ArtifactsSitesAdminV2Service.updateDeployedVersion(ctx, repositoryRid, {\n siteVersion: {\n version: siteVersion\n }\n });\n consola.success(`Deployed ${siteVersion} successfully`);\n } else {\n consola.debug(\"Upload only mode enabled, skipping deployment\");\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 { execSync } from \"node:child_process\";\nimport { ExitProcessError } from \"../ExitProcessError.js\";\nimport { isValidSemver } from \"./isValidSemver.js\";\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 try {\n const gitVersion = execSync(`git describe --tags --first-parent --dirty${matchPrefix != null ? ` --match=\"${matchPrefix}*\"` : \"\"}`, {\n encoding: \"utf8\"\n });\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 } catch (error) {\n throw new ExitProcessError(2, `Unable to determine the version automatically. Please supply a --version argument. ${error}`);\n }\n}"]}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkX2S4O5ZR_cjs = require('./chunk-X2S4O5ZR.cjs');
|
|
4
|
+
var chunkD7QHLGEU_cjs = require('./chunk-D7QHLGEU.cjs');
|
|
5
|
+
var chunkHYF3CTKZ_cjs = require('./chunk-HYF3CTKZ.cjs');
|
|
6
|
+
require('./chunk-HQDDGVB7.cjs');
|
|
7
|
+
var consola = require('consola');
|
|
8
|
+
var archiver = require('archiver');
|
|
9
|
+
var fs = require('fs');
|
|
10
|
+
var stream = require('stream');
|
|
11
|
+
var child_process = require('child_process');
|
|
12
|
+
|
|
13
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
|
|
15
|
+
function _interopNamespace(e) {
|
|
16
|
+
if (e && e.__esModule) return e;
|
|
17
|
+
var n = Object.create(null);
|
|
18
|
+
if (e) {
|
|
19
|
+
Object.keys(e).forEach(function (k) {
|
|
20
|
+
if (k !== 'default') {
|
|
21
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
22
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function () { return e[k]; }
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
n.default = e;
|
|
30
|
+
return Object.freeze(n);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
var archiver__default = /*#__PURE__*/_interopDefault(archiver);
|
|
34
|
+
var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
|
|
35
|
+
|
|
36
|
+
async function autoVersion(tagPrefix = "") {
|
|
37
|
+
const [matchPrefix, prefixRegex] = tagPrefix !== "" ? [tagPrefix, new RegExp(`^${tagPrefix}`)] : [void 0, new RegExp(`^v?`)];
|
|
38
|
+
try {
|
|
39
|
+
const gitVersion = child_process.execSync(`git describe --tags --first-parent --dirty${matchPrefix != null ? ` --match="${matchPrefix}*"` : ""}`, {
|
|
40
|
+
encoding: "utf8"
|
|
41
|
+
});
|
|
42
|
+
const version = gitVersion.trim().replace(prefixRegex, "");
|
|
43
|
+
if (!chunkX2S4O5ZR_cjs.isValidSemver(version)) {
|
|
44
|
+
throw new chunkHYF3CTKZ_cjs.ExitProcessError(2, `The version string ${version} is not SemVer compliant.`);
|
|
45
|
+
}
|
|
46
|
+
return version;
|
|
47
|
+
} catch (error) {
|
|
48
|
+
throw new chunkHYF3CTKZ_cjs.ExitProcessError(2, `Unable to determine the version automatically. Please supply a --version argument. ${error}`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// src/commands/site/deploy/siteDeployCommand.mts
|
|
53
|
+
async function siteDeployCommand({
|
|
54
|
+
version,
|
|
55
|
+
application,
|
|
56
|
+
foundryUrl,
|
|
57
|
+
autoVersion: autoVersion2,
|
|
58
|
+
gitTagPrefix,
|
|
59
|
+
uploadOnly,
|
|
60
|
+
directory,
|
|
61
|
+
token,
|
|
62
|
+
tokenFile
|
|
63
|
+
}) {
|
|
64
|
+
if (version == null && autoVersion2 == null) {
|
|
65
|
+
throw new Error("Either version or autoVersion must be specified");
|
|
66
|
+
}
|
|
67
|
+
const loadedToken = await chunkD7QHLGEU_cjs.loadToken(token, tokenFile);
|
|
68
|
+
let siteVersion;
|
|
69
|
+
if (version != null) {
|
|
70
|
+
siteVersion = version;
|
|
71
|
+
} else {
|
|
72
|
+
siteVersion = await autoVersion(gitTagPrefix);
|
|
73
|
+
consola.consola.info(`Auto version inferred next version to be: ${siteVersion}`);
|
|
74
|
+
}
|
|
75
|
+
const stat = await fs__namespace.promises.stat(directory);
|
|
76
|
+
if (!stat.isDirectory()) {
|
|
77
|
+
consola.consola.error("Specified path is not a directory");
|
|
78
|
+
throw new chunkHYF3CTKZ_cjs.ExitProcessError(2);
|
|
79
|
+
}
|
|
80
|
+
consola.consola.start("Zippping site files");
|
|
81
|
+
const archive = archiver__default.default("zip").directory(directory, false);
|
|
82
|
+
const tokenProvider = () => loadedToken;
|
|
83
|
+
const clientCtx = chunkD7QHLGEU_cjs.createInternalClientContext(foundryUrl, tokenProvider);
|
|
84
|
+
await Promise.all([chunkD7QHLGEU_cjs.artifacts_exports.SiteAssetArtifactsService.uploadZippedSiteAsset(clientCtx, {
|
|
85
|
+
application,
|
|
86
|
+
version: siteVersion,
|
|
87
|
+
zipFile: stream.Readable.toWeb(archive)
|
|
88
|
+
// This cast is because the dom fetch doesnt align type wise with streams
|
|
89
|
+
}), archive.finalize()]);
|
|
90
|
+
consola.consola.success("Upload complete");
|
|
91
|
+
if (!uploadOnly) {
|
|
92
|
+
const repositoryRid = await chunkD7QHLGEU_cjs.third_party_application_service_exports.fetchWebsiteRepositoryRid(clientCtx, application);
|
|
93
|
+
const ctx = chunkD7QHLGEU_cjs.createConjureContext(foundryUrl, "/artifacts/api", tokenProvider);
|
|
94
|
+
await chunkD7QHLGEU_cjs.ArtifactsSitesAdminV2Service_exports.updateDeployedVersion(ctx, repositoryRid, {
|
|
95
|
+
siteVersion: {
|
|
96
|
+
version: siteVersion
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
consola.consola.success(`Deployed ${siteVersion} successfully`);
|
|
100
|
+
} else {
|
|
101
|
+
consola.consola.debug("Upload only mode enabled, skipping deployment");
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
module.exports = siteDeployCommand;
|
|
106
|
+
//# sourceMappingURL=out.js.map
|
|
107
|
+
//# sourceMappingURL=siteDeployCommand-MXKGJFFB.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/commands/site/deploy/siteDeployCommand.mts","../../src/util/autoVersion.ts"],"names":["autoVersion"],"mappings":";;;;;;;;;;;;;;;;;AAgBA,SAAS,eAAe;AAExB,OAAO,cAAc;AACrB,YAAY,QAAQ;AACpB,SAAS,gBAAgB;;;ACJzB,SAAS,gBAAgB;AAWzB,eAAsB,YAAY,YAAY,IAAI;AAChD,QAAM,CAAC,aAAa,WAAW,IAAI,cAAc,KAAK,CAAC,WAAW,IAAI,OAAO,IAAI,SAAS,EAAE,CAAC,IAAI,CAAC,QAAW,IAAI,OAAO,KAAK,CAAC;AAC9H,MAAI;AACF,UAAM,aAAa,SAAS,6CAA6C,eAAe,OAAO,aAAa,WAAW,OAAO,EAAE,IAAI;AAAA,MAClI,UAAU;AAAA,IACZ,CAAC;AACD,UAAM,UAAU,WAAW,KAAK,EAAE,QAAQ,aAAa,EAAE;AACzD,QAAI,CAAC,cAAc,OAAO,GAAG;AAC3B,YAAM,IAAI,iBAAiB,GA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Ae;AAAA,MAC3E,aAAa;AAAA,QACX,SAAS;AAAA,MACX;AAAA,IACF,CAAC;AACD,YAAQ,QAAQ,YAAY,WAAW,eAAe;AAAA,EACxD,OAAO;AACL,YAAQ,MAAM,+CAA+C;AAAA,EAC/D;AACF","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nimport { artifacts, ArtifactsSitesAdminV2Service, createConjureContext, createInternalClientContext, thirdPartyApplicationService } from \"#net\";\nimport archiver from \"archiver\";\nimport * as fs from \"node:fs\";\nimport { Readable } from \"node:stream\";\nimport { ExitProcessError } from \"../../../ExitProcessError.js\";\nimport { autoVersion as findAutoVersion } from \"../../../util/autoVersion.js\";\nimport { loadToken } from \"../../../util/token.js\";\nexport default async function siteDeployCommand({\n version,\n application,\n foundryUrl,\n autoVersion,\n gitTagPrefix,\n uploadOnly,\n directory,\n token,\n tokenFile\n}) {\n if (version == null && autoVersion == null) {\n throw new Error(\"Either version or autoVersion must be specified\");\n }\n const loadedToken = await loadToken(token, tokenFile);\n\n // version has a priority over autoVersion. Both could be defined at the same time when\n // autoVersion is present in the config file (it assigns that as a default value to argv.autoVersion)\n // and --version is passed as an argument\n let siteVersion;\n if (version != null) {\n siteVersion = version;\n } else {\n siteVersion = await findAutoVersion(gitTagPrefix);\n consola.info(`Auto version inferred next version to be: ${siteVersion}`);\n }\n const stat = await fs.promises.stat(directory);\n if (!stat.isDirectory()) {\n consola.error(\"Specified path is not a directory\");\n throw new ExitProcessError(2);\n }\n consola.start(\"Zippping site files\");\n const archive = archiver(\"zip\").directory(directory, false);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n await Promise.all([artifacts.SiteAssetArtifactsService.uploadZippedSiteAsset(clientCtx, {\n application,\n version: siteVersion,\n zipFile: Readable.toWeb(archive) // This cast is because the dom fetch doesnt align type wise with streams\n }), archive.finalize()]);\n consola.success(\"Upload complete\");\n if (!uploadOnly) {\n const repositoryRid = await thirdPartyApplicationService.fetchWebsiteRepositoryRid(clientCtx, application);\n const ctx = createConjureContext(foundryUrl, \"/artifacts/api\", tokenProvider);\n await ArtifactsSitesAdminV2Service.updateDeployedVersion(ctx, repositoryRid, {\n siteVersion: {\n version: siteVersion\n }\n });\n consola.success(`Deployed ${siteVersion} successfully`);\n } else {\n consola.debug(\"Upload only mode enabled, skipping deployment\");\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 { execSync } from \"node:child_process\";\nimport { ExitProcessError } from \"../ExitProcessError.js\";\nimport { isValidSemver } from \"./isValidSemver.js\";\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 try {\n const gitVersion = execSync(`git describe --tags --first-parent --dirty${matchPrefix != null ? ` --match=\"${matchPrefix}*\"` : \"\"}`, {\n encoding: \"utf8\"\n });\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 } catch (error) {\n throw new ExitProcessError(2, `Unable to determine the version automatically. Please supply a --version argument. ${error}`);\n }\n}"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { loadToken, createInternalClientContext, artifacts_exports } from './chunk-XNYKWAIE.mjs';
|
|
2
|
+
import './chunk-GTNZA5UY.mjs';
|
|
3
|
+
import './chunk-E2SEJZTC.mjs';
|
|
4
|
+
import { consola } from 'consola';
|
|
5
|
+
|
|
6
|
+
async function versionDeleteCommand({
|
|
7
|
+
version,
|
|
8
|
+
application,
|
|
9
|
+
foundryUrl,
|
|
10
|
+
token,
|
|
11
|
+
tokenFile
|
|
12
|
+
}) {
|
|
13
|
+
consola.start(`Deleting version ${version}`);
|
|
14
|
+
const loadedToken = await loadToken(token, tokenFile);
|
|
15
|
+
const tokenProvider = () => loadedToken;
|
|
16
|
+
const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);
|
|
17
|
+
await artifacts_exports.SiteAssetArtifactsService.deleteSiteVersion(clientCtx, {
|
|
18
|
+
application,
|
|
19
|
+
version
|
|
20
|
+
});
|
|
21
|
+
consola.success(`Deleted version ${version}`);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { versionDeleteCommand as default };
|
|
25
|
+
//# sourceMappingURL=out.js.map
|
|
26
|
+
//# sourceMappingURL=versionDeleteCommand-6BJL5XLG.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/commands/site/version/delete/versionDeleteCommand.mts"],"names":[],"mappings":";;;;;;;;;AAiBA,SAAS,eAAe;AAExB,eAAO,qBAA4C;AAAA,EACjD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,UAAQ,MAAM,oBAAoB,OAAO,EAAE;AAC3C,QAAM,cAAc,MAAM,UAAU,OAAO,SAAS;AACpD,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,QAAM,kBAAU,0BAA0B,kBAAkB,WAAW;AAAA,IACrE;AAAA,IACA;AAAA,EACF,CAAC;AACD,UAAQ,QAAQ,mBAAmB,OAAO,EAAE;AAC9C","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 { artifacts, createInternalClientContext } from \"#net\";\nimport { consola } from \"consola\";\nimport { loadToken } from \"../../../../util/token.js\";\nexport default async function versionDeleteCommand({\n version,\n application,\n foundryUrl,\n token,\n tokenFile\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 artifacts.SiteAssetArtifactsService.deleteSiteVersion(clientCtx, {\n application,\n version\n });\n consola.success(`Deleted version ${version}`);\n}"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkD7QHLGEU_cjs = require('./chunk-D7QHLGEU.cjs');
|
|
4
|
+
require('./chunk-HYF3CTKZ.cjs');
|
|
5
|
+
require('./chunk-HQDDGVB7.cjs');
|
|
6
|
+
var consola = require('consola');
|
|
7
|
+
|
|
8
|
+
async function versionDeleteCommand({
|
|
9
|
+
version,
|
|
10
|
+
application,
|
|
11
|
+
foundryUrl,
|
|
12
|
+
token,
|
|
13
|
+
tokenFile
|
|
14
|
+
}) {
|
|
15
|
+
consola.consola.start(`Deleting version ${version}`);
|
|
16
|
+
const loadedToken = await chunkD7QHLGEU_cjs.loadToken(token, tokenFile);
|
|
17
|
+
const tokenProvider = () => loadedToken;
|
|
18
|
+
const clientCtx = chunkD7QHLGEU_cjs.createInternalClientContext(foundryUrl, tokenProvider);
|
|
19
|
+
await chunkD7QHLGEU_cjs.artifacts_exports.SiteAssetArtifactsService.deleteSiteVersion(clientCtx, {
|
|
20
|
+
application,
|
|
21
|
+
version
|
|
22
|
+
});
|
|
23
|
+
consola.consola.success(`Deleted version ${version}`);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
module.exports = versionDeleteCommand;
|
|
27
|
+
//# sourceMappingURL=out.js.map
|
|
28
|
+
//# sourceMappingURL=versionDeleteCommand-RLU7UUYD.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/commands/site/version/delete/versionDeleteCommand.mts"],"names":[],"mappings":";;;;;;;;;AAiBA,SAAS,eAAe;AAExB,eAAO,qBAA4C;AAAA,EACjD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,UAAQ,MAAM,oBAAoB,OAAO,EAAE;AAC3C,QAAM,cAAc,MAAM,UAAU,OAAO,SAAS;AACpD,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,QAAM,kBAAU,0BAA0B,kBAAkB,WAAW;AAAA,IACrE;AAAA,IACA;AAAA,EACF,CAAC;AACD,UAAQ,QAAQ,mBAAmB,OAAO,EAAE;AAC9C","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 { artifacts, createInternalClientContext } from \"#net\";\nimport { consola } from \"consola\";\nimport { loadToken } from \"../../../../util/token.js\";\nexport default async function versionDeleteCommand({\n version,\n application,\n foundryUrl,\n token,\n tokenFile\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 artifacts.SiteAssetArtifactsService.deleteSiteVersion(clientCtx, {\n application,\n version\n });\n consola.success(`Deleted version ${version}`);\n}"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { loadToken, createInternalClientContext, third_party_application_service_exports, createConjureContext, ArtifactsSitesAdminV2Service_exports } from './chunk-XNYKWAIE.mjs';
|
|
2
|
+
import './chunk-GTNZA5UY.mjs';
|
|
3
|
+
import './chunk-E2SEJZTC.mjs';
|
|
4
|
+
import { consola } from 'consola';
|
|
5
|
+
|
|
6
|
+
async function versionGetCommand({
|
|
7
|
+
foundryUrl,
|
|
8
|
+
application,
|
|
9
|
+
token,
|
|
10
|
+
tokenFile
|
|
11
|
+
}) {
|
|
12
|
+
const loadedToken = await loadToken(token, tokenFile);
|
|
13
|
+
const tokenProvider = () => loadedToken;
|
|
14
|
+
const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);
|
|
15
|
+
consola.start("Getting live version");
|
|
16
|
+
const repositoryRid = await third_party_application_service_exports.fetchWebsiteRepositoryRid(clientCtx, application);
|
|
17
|
+
const ctx = createConjureContext(foundryUrl, "/artifacts/api", tokenProvider);
|
|
18
|
+
const deployedVersion = await ArtifactsSitesAdminV2Service_exports.getDeployedVersion(ctx, repositoryRid);
|
|
19
|
+
if (!deployedVersion) {
|
|
20
|
+
consola.info("No live site version set");
|
|
21
|
+
} else {
|
|
22
|
+
consola.success(`Live site version is ${deployedVersion.version}`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { versionGetCommand as default };
|
|
27
|
+
//# sourceMappingURL=out.js.map
|
|
28
|
+
//# sourceMappingURL=versionGetCommand-OR4RLOLM.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/commands/site/version/get/versionGetCommand.mts"],"names":[],"mappings":";;;;;;;;;;;AAiBA,SAAS,eAAe;AAExB,eAAO,kBAAyC;AAAA,EAC9C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,QAAM,cAAc,MAAM,UAAU,OAAO,SAAS;AACpD,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,UAAQ,MAAM,sBAAsB;AACpC,QAAM,gBAAgB,MAAM,wCAA6B,0BAA0B,WAAW,WAAW;AACzG,QAAM,MAAM,qBAAqB,YAAY,kBAAkB,aAAa;AAC5E,QAAM,kBAAkB,MAAM,qCAA6B,mBAAmB,KAAK,aAAa;AAChG,MAAI,CAAC,iBAAiB;AACpB,YAAQ,KAAK,0BAA0B;AAAA,EACzC,OAAO;AACL,YAAQ,QAAQ,wBAAwB,gBAAgB,OAAO,EAAE;AAAA,EACnE;AACF","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 { ArtifactsSitesAdminV2Service, createConjureContext, createInternalClientContext, thirdPartyApplicationService } from \"#net\";\nimport { consola } from \"consola\";\nimport { loadToken } from \"../../../../util/token.js\";\nexport default async function versionGetCommand({\n foundryUrl,\n application,\n token,\n tokenFile\n}) {\n const loadedToken = await loadToken(token, tokenFile);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n consola.start(\"Getting live version\");\n const repositoryRid = await thirdPartyApplicationService.fetchWebsiteRepositoryRid(clientCtx, application);\n const ctx = createConjureContext(foundryUrl, \"/artifacts/api\", tokenProvider);\n const deployedVersion = await ArtifactsSitesAdminV2Service.getDeployedVersion(ctx, repositoryRid);\n if (!deployedVersion) {\n consola.info(\"No live site version set\");\n } else {\n consola.success(`Live site version is ${deployedVersion.version}`);\n }\n}"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkD7QHLGEU_cjs = require('./chunk-D7QHLGEU.cjs');
|
|
4
|
+
require('./chunk-HYF3CTKZ.cjs');
|
|
5
|
+
require('./chunk-HQDDGVB7.cjs');
|
|
6
|
+
var consola = require('consola');
|
|
7
|
+
|
|
8
|
+
async function versionGetCommand({
|
|
9
|
+
foundryUrl,
|
|
10
|
+
application,
|
|
11
|
+
token,
|
|
12
|
+
tokenFile
|
|
13
|
+
}) {
|
|
14
|
+
const loadedToken = await chunkD7QHLGEU_cjs.loadToken(token, tokenFile);
|
|
15
|
+
const tokenProvider = () => loadedToken;
|
|
16
|
+
const clientCtx = chunkD7QHLGEU_cjs.createInternalClientContext(foundryUrl, tokenProvider);
|
|
17
|
+
consola.consola.start("Getting live version");
|
|
18
|
+
const repositoryRid = await chunkD7QHLGEU_cjs.third_party_application_service_exports.fetchWebsiteRepositoryRid(clientCtx, application);
|
|
19
|
+
const ctx = chunkD7QHLGEU_cjs.createConjureContext(foundryUrl, "/artifacts/api", tokenProvider);
|
|
20
|
+
const deployedVersion = await chunkD7QHLGEU_cjs.ArtifactsSitesAdminV2Service_exports.getDeployedVersion(ctx, repositoryRid);
|
|
21
|
+
if (!deployedVersion) {
|
|
22
|
+
consola.consola.info("No live site version set");
|
|
23
|
+
} else {
|
|
24
|
+
consola.consola.success(`Live site version is ${deployedVersion.version}`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
module.exports = versionGetCommand;
|
|
29
|
+
//# sourceMappingURL=out.js.map
|
|
30
|
+
//# sourceMappingURL=versionGetCommand-Y2VR2WKH.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/commands/site/version/get/versionGetCommand.mts"],"names":[],"mappings":";;;;;;;;;;;AAiBA,SAAS,eAAe;AAExB,eAAO,kBAAyC;AAAA,EAC9C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,QAAM,cAAc,MAAM,UAAU,OAAO,SAAS;AACpD,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,UAAQ,MAAM,sBAAsB;AACpC,QAAM,gBAAgB,MAAM,wCAA6B,0BAA0B,WAAW,WAAW;AACzG,QAAM,MAAM,qBAAqB,YAAY,kBAAkB,aAAa;AAC5E,QAAM,kBAAkB,MAAM,qCAA6B,mBAAmB,KAAK,aAAa;AAChG,MAAI,CAAC,iBAAiB;AACpB,YAAQ,KAAK,0BAA0B;AAAA,EACzC,OAAO;AACL,YAAQ,QAAQ,wBAAwB,gBAAgB,OAAO,EAAE;AAAA,EACnE;AACF","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 { ArtifactsSitesAdminV2Service, createConjureContext, createInternalClientContext, thirdPartyApplicationService } from \"#net\";\nimport { consola } from \"consola\";\nimport { loadToken } from \"../../../../util/token.js\";\nexport default async function versionGetCommand({\n foundryUrl,\n application,\n token,\n tokenFile\n}) {\n const loadedToken = await loadToken(token, tokenFile);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n consola.start(\"Getting live version\");\n const repositoryRid = await thirdPartyApplicationService.fetchWebsiteRepositoryRid(clientCtx, application);\n const ctx = createConjureContext(foundryUrl, \"/artifacts/api\", tokenProvider);\n const deployedVersion = await ArtifactsSitesAdminV2Service.getDeployedVersion(ctx, repositoryRid);\n if (!deployedVersion) {\n consola.info(\"No live site version set\");\n } else {\n consola.success(`Live site version is ${deployedVersion.version}`);\n }\n}"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkD7QHLGEU_cjs = require('./chunk-D7QHLGEU.cjs');
|
|
4
|
+
require('./chunk-HYF3CTKZ.cjs');
|
|
5
|
+
require('./chunk-HQDDGVB7.cjs');
|
|
6
|
+
var consola = require('consola');
|
|
7
|
+
var utils = require('consola/utils');
|
|
8
|
+
|
|
9
|
+
async function versionListCommand({
|
|
10
|
+
foundryUrl,
|
|
11
|
+
application,
|
|
12
|
+
token,
|
|
13
|
+
tokenFile
|
|
14
|
+
}) {
|
|
15
|
+
const loadedToken = await chunkD7QHLGEU_cjs.loadToken(token, tokenFile);
|
|
16
|
+
const tokenProvider = () => loadedToken;
|
|
17
|
+
const clientCtx = chunkD7QHLGEU_cjs.createInternalClientContext(foundryUrl, tokenProvider);
|
|
18
|
+
consola.consola.start("Fetching versions & deployed version");
|
|
19
|
+
const repositoryRid = await chunkD7QHLGEU_cjs.third_party_application_service_exports.fetchWebsiteRepositoryRid(clientCtx, application);
|
|
20
|
+
const ctx = chunkD7QHLGEU_cjs.createConjureContext(foundryUrl, "/artifacts/api", tokenProvider);
|
|
21
|
+
const [versions, deployedVersion] = await Promise.all([chunkD7QHLGEU_cjs.artifacts_exports.SiteAssetArtifactsService.fetchSiteVersions(clientCtx, application), chunkD7QHLGEU_cjs.ArtifactsSitesAdminV2Service_exports.getDeployedVersion(ctx, repositoryRid)]);
|
|
22
|
+
if (versions.length === 0) {
|
|
23
|
+
consola.consola.warn("Successfully connected to server, but no versions were found.");
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
consola.consola.success("Found versions:");
|
|
27
|
+
for (const version of versions) {
|
|
28
|
+
consola.consola.log(` - ${version}${deployedVersion && version === deployedVersion.version ? utils.colorize("green", ` (deployed)`) : ""}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
module.exports = versionListCommand;
|
|
33
|
+
//# sourceMappingURL=out.js.map
|
|
34
|
+
//# sourceMappingURL=versionListCommand-5KM5PFYL.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/commands/site/version/list/versionListCommand.mts"],"names":[],"mappings":";;;;;;;;;;;;AAiBA,SAAS,eAAe;AACxB,SAAS,gBAAgB;AAEzB,eAAO,mBAA0C;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,QAAM,cAAc,MAAM,UAAU,OAAO,SAAS;AACpD,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,UAAQ,MAAM,sCAAsC;AACpD,QAAM,gBAAgB,MAAM,wCAA6B,0BAA0B,WAAW,WAAW;AACzG,QAAM,MAAM,qBAAqB,YAAY,kBAAkB,aAAa;AAC5E,QAAM,CAAC,UAAU,eAAe,IAAI,MAAM,QAAQ,IAAI,CAAC,kBAAU,0BAA0B,kBAAkB,WAAW,WAAW,GAAG,qCAA6B,mBAAmB,KAAK,aAAa,CAAC,CAAC;AAC1M,MAAI,SAAS,WAAW,GAAG;AACzB,YAAQ,KAAK,+DAA+D;AAC5E;AAAA,EACF;AACA,UAAQ,QAAQ,iBAAiB;AACjC,aAAW,WAAW,UAAU;AAC9B,YAAQ,IAAI,SAAS,OAAO,GAAG,mBAAmB,YAAY,gBAAgB,UAAU,SAAS,SAAS,aAAa,IAAI,EAAE,EAAE;AAAA,EACjI;AACF","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 { artifacts, ArtifactsSitesAdminV2Service, createConjureContext, createInternalClientContext, thirdPartyApplicationService } from \"#net\";\nimport { consola } from \"consola\";\nimport { colorize } from \"consola/utils\";\nimport { loadToken } from \"../../../../util/token.js\";\nexport default async function versionListCommand({\n foundryUrl,\n application,\n token,\n tokenFile\n}) {\n const loadedToken = await loadToken(token, tokenFile);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n consola.start(\"Fetching versions & deployed version\");\n const repositoryRid = await thirdPartyApplicationService.fetchWebsiteRepositoryRid(clientCtx, application);\n const ctx = createConjureContext(foundryUrl, \"/artifacts/api\", tokenProvider);\n const [versions, deployedVersion] = await Promise.all([artifacts.SiteAssetArtifactsService.fetchSiteVersions(clientCtx, application), ArtifactsSitesAdminV2Service.getDeployedVersion(ctx, repositoryRid)]);\n if (versions.length === 0) {\n consola.warn(\"Successfully connected to server, but no versions were found.\");\n return;\n }\n consola.success(\"Found versions:\");\n for (const version of versions) {\n consola.log(` - ${version}${deployedVersion && version === deployedVersion.version ? colorize(\"green\", ` (deployed)`) : \"\"}`);\n }\n}"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { loadToken, createInternalClientContext, third_party_application_service_exports, createConjureContext, artifacts_exports, ArtifactsSitesAdminV2Service_exports } from './chunk-XNYKWAIE.mjs';
|
|
2
|
+
import './chunk-GTNZA5UY.mjs';
|
|
3
|
+
import './chunk-E2SEJZTC.mjs';
|
|
4
|
+
import { consola } from 'consola';
|
|
5
|
+
import { colorize } from 'consola/utils';
|
|
6
|
+
|
|
7
|
+
async function versionListCommand({
|
|
8
|
+
foundryUrl,
|
|
9
|
+
application,
|
|
10
|
+
token,
|
|
11
|
+
tokenFile
|
|
12
|
+
}) {
|
|
13
|
+
const loadedToken = await loadToken(token, tokenFile);
|
|
14
|
+
const tokenProvider = () => loadedToken;
|
|
15
|
+
const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);
|
|
16
|
+
consola.start("Fetching versions & deployed version");
|
|
17
|
+
const repositoryRid = await third_party_application_service_exports.fetchWebsiteRepositoryRid(clientCtx, application);
|
|
18
|
+
const ctx = createConjureContext(foundryUrl, "/artifacts/api", tokenProvider);
|
|
19
|
+
const [versions, deployedVersion] = await Promise.all([artifacts_exports.SiteAssetArtifactsService.fetchSiteVersions(clientCtx, application), ArtifactsSitesAdminV2Service_exports.getDeployedVersion(ctx, repositoryRid)]);
|
|
20
|
+
if (versions.length === 0) {
|
|
21
|
+
consola.warn("Successfully connected to server, but no versions were found.");
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
consola.success("Found versions:");
|
|
25
|
+
for (const version of versions) {
|
|
26
|
+
consola.log(` - ${version}${deployedVersion && version === deployedVersion.version ? colorize("green", ` (deployed)`) : ""}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { versionListCommand as default };
|
|
31
|
+
//# sourceMappingURL=out.js.map
|
|
32
|
+
//# sourceMappingURL=versionListCommand-LPPGQCQF.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/commands/site/version/list/versionListCommand.mts"],"names":[],"mappings":";;;;;;;;;;;;AAiBA,SAAS,eAAe;AACxB,SAAS,gBAAgB;AAEzB,eAAO,mBAA0C;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,QAAM,cAAc,MAAM,UAAU,OAAO,SAAS;AACpD,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,UAAQ,MAAM,sCAAsC;AACpD,QAAM,gBAAgB,MAAM,wCAA6B,0BAA0B,WAAW,WAAW;AACzG,QAAM,MAAM,qBAAqB,YAAY,kBAAkB,aAAa;AAC5E,QAAM,CAAC,UAAU,eAAe,IAAI,MAAM,QAAQ,IAAI,CAAC,kBAAU,0BAA0B,kBAAkB,WAAW,WAAW,GAAG,qCAA6B,mBAAmB,KAAK,aAAa,CAAC,CAAC;AAC1M,MAAI,SAAS,WAAW,GAAG;AACzB,YAAQ,KAAK,+DAA+D;AAC5E;AAAA,EACF;AACA,UAAQ,QAAQ,iBAAiB;AACjC,aAAW,WAAW,UAAU;AAC9B,YAAQ,IAAI,SAAS,OAAO,GAAG,mBAAmB,YAAY,gBAAgB,UAAU,SAAS,SAAS,aAAa,IAAI,EAAE,EAAE;AAAA,EACjI;AACF","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 { artifacts, ArtifactsSitesAdminV2Service, createConjureContext, createInternalClientContext, thirdPartyApplicationService } from \"#net\";\nimport { consola } from \"consola\";\nimport { colorize } from \"consola/utils\";\nimport { loadToken } from \"../../../../util/token.js\";\nexport default async function versionListCommand({\n foundryUrl,\n application,\n token,\n tokenFile\n}) {\n const loadedToken = await loadToken(token, tokenFile);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n consola.start(\"Fetching versions & deployed version\");\n const repositoryRid = await thirdPartyApplicationService.fetchWebsiteRepositoryRid(clientCtx, application);\n const ctx = createConjureContext(foundryUrl, \"/artifacts/api\", tokenProvider);\n const [versions, deployedVersion] = await Promise.all([artifacts.SiteAssetArtifactsService.fetchSiteVersions(clientCtx, application), ArtifactsSitesAdminV2Service.getDeployedVersion(ctx, repositoryRid)]);\n if (versions.length === 0) {\n consola.warn(\"Successfully connected to server, but no versions were found.\");\n return;\n }\n consola.success(\"Found versions:\");\n for (const version of versions) {\n consola.log(` - ${version}${deployedVersion && version === deployedVersion.version ? colorize(\"green\", ` (deployed)`) : \"\"}`);\n }\n}"]}
|