@osdk/cli 0.4.0 → 0.6.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.
Files changed (57) hide show
  1. package/build/js/chunk-DQYIDDJN.cjs +17 -0
  2. package/build/js/chunk-DQYIDDJN.cjs.map +1 -0
  3. package/build/js/chunk-IV3QY3PZ.mjs +15 -0
  4. package/build/js/chunk-IV3QY3PZ.mjs.map +1 -0
  5. package/build/js/{handleGenerate-A7X2XAGW.mjs → handleGenerate-7QGFIWKO.mjs} +2 -2
  6. package/build/js/{handleGenerate-WOW33WYG.cjs → handleGenerate-FHM4MFPH.cjs} +2 -2
  7. package/build/js/index.cjs +72 -85
  8. package/build/js/index.cjs.map +1 -1
  9. package/build/js/index.mjs +67 -80
  10. package/build/js/index.mjs.map +1 -1
  11. package/build/js/{siteDeployCommand-HSR3QDAT.mjs → siteDeployCommand-4S2UQKJP.mjs} +60 -9
  12. package/build/js/siteDeployCommand-4S2UQKJP.mjs.map +1 -0
  13. package/build/js/{siteDeployCommand-MXKGJFFB.cjs → siteDeployCommand-QKPJEL4X.cjs} +60 -8
  14. package/build/js/siteDeployCommand-QKPJEL4X.cjs.map +1 -0
  15. package/build/js/{versionDeleteCommand-6BJL5XLG.mjs → versionDeleteCommand-DGB5NTFM.mjs} +11 -1
  16. package/build/js/versionDeleteCommand-DGB5NTFM.mjs.map +1 -0
  17. package/build/js/{versionDeleteCommand-RLU7UUYD.cjs → versionDeleteCommand-S7AXTY46.cjs} +11 -1
  18. package/build/js/versionDeleteCommand-S7AXTY46.cjs.map +1 -0
  19. package/build/js/{versionUnsetCommand-IJT4JWBN.mjs → versionUnsetCommand-ISMMMWWZ.mjs} +11 -1
  20. package/build/js/versionUnsetCommand-ISMMMWWZ.mjs.map +1 -0
  21. package/build/js/{versionUnsetCommand-XYBUQ6XB.cjs → versionUnsetCommand-V3ZVCGSI.cjs} +11 -1
  22. package/build/js/versionUnsetCommand-V3ZVCGSI.cjs.map +1 -0
  23. package/build/types/commands/site/deploy/logDeployCommandConfigFileOverride.d.ts +1 -1
  24. package/build/types/commands/site/logSiteCommandConfigFileOverride.d.ts +1 -1
  25. package/build/types/commands/site/version/delete/VersionDeleteArgs.d.ts +5 -0
  26. package/build/types/commands/site/version/delete/index.d.ts +2 -2
  27. package/build/types/commands/site/version/delete/versionDeleteCommand.d.mts +2 -2
  28. package/build/types/commands/site/version/get/VersionGetArgs.d.ts +3 -0
  29. package/build/types/commands/site/version/get/index.d.ts +2 -1
  30. package/build/types/commands/site/version/get/versionGetCommand.d.mts +2 -2
  31. package/build/types/commands/site/version/list/VersionListArgs.d.ts +3 -0
  32. package/build/types/commands/site/version/list/index.d.ts +2 -1
  33. package/build/types/commands/site/version/list/versionListCommand.d.mts +2 -2
  34. package/build/types/commands/site/version/set/VersionSetArgs.d.ts +4 -0
  35. package/build/types/commands/site/version/set/index.d.ts +2 -2
  36. package/build/types/commands/site/version/set/versionSetCommand.d.mts +2 -2
  37. package/build/types/commands/site/version/unset/VersionUnsetArgs.d.ts +4 -0
  38. package/build/types/commands/site/version/unset/index.d.ts +2 -1
  39. package/build/types/commands/site/version/unset/versionUnsetCommand.d.mts +2 -2
  40. package/build/types/consola/handlePromptCancel.d.ts +1 -0
  41. package/build/types/net/index.d.mts +1 -0
  42. package/changelog/0.5.0/pr-47.v2.yml +5 -0
  43. package/changelog/0.5.0/pr-49.v2.yml +5 -0
  44. package/changelog/0.5.0/pr-51.v2.yml +5 -0
  45. package/changelog/0.6.0/pr-54.v2.yml +5 -0
  46. package/changelog/0.6.0/pr-56.v2.yml +5 -0
  47. package/changelog/0.6.0/pr-58.v2.yml +5 -0
  48. package/package.json +3 -3
  49. package/build/js/siteDeployCommand-HSR3QDAT.mjs.map +0 -1
  50. package/build/js/siteDeployCommand-MXKGJFFB.cjs.map +0 -1
  51. package/build/js/versionDeleteCommand-6BJL5XLG.mjs.map +0 -1
  52. package/build/js/versionDeleteCommand-RLU7UUYD.cjs.map +0 -1
  53. package/build/js/versionUnsetCommand-IJT4JWBN.mjs.map +0 -1
  54. package/build/js/versionUnsetCommand-XYBUQ6XB.cjs.map +0 -1
  55. package/build/types/commands/site/version/SiteVersionArgs.d.ts +0 -4
  56. /package/build/js/{handleGenerate-A7X2XAGW.mjs.map → handleGenerate-7QGFIWKO.mjs.map} +0 -0
  57. /package/build/js/{handleGenerate-WOW33WYG.cjs.map → handleGenerate-FHM4MFPH.cjs.map} +0 -0
@@ -1 +1 @@
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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AAS,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,EAAE,KAAK,OAAO,KAAK,KAAK,iBAAiB;AACxC,UAAM,UAAU,MAAM,OAAO,SAAS;AACtC,UAAM,YAAY,KAAK,KAAK,SAAO,CAAC,MAAM,OAAO,WAAW,EAAE,SAAS,GAAG,CAAC;AAC3E,QAAI,eAAe,kBAAkB;AACnC,UAAI,WAAW;AACb,gBAAQ,QAAQ,MAAM,GAAG;AAAA,MAC3B,OAAO;AACL,gBAAQ,QAAQ,MAAM,IAAI,OAAO;AAAA,MACnC;AAAA,IACF,OAAO;AACL,UAAI,OAAO,eAAe,oBAAoB,OAAO;AACnD,cAAM;AAAA,MACR,OAAO;AACL,qBAAa,SAAS;AACtB,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}"]}
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":["consola","command","application","foundryUrl","site","firstTime"],"mappings":";;;;;;;;;AAgBA,SAAS,WAAAA,gBAAe;AACxB,OAAO,WAAW;AAClB,SAAS,eAAe;;;ACFjB,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,UAAMC,YAAU,MAAM,OAAO,0BAAgB;AAC7C,UAAMA,UAAQ,QAAQ,IAAI;AAAA,EAC5B;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AM,EAAE,QAAQ,KAAK,EAAE,OAAO,WAAW;AAAA,IAC1H,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,OAAO;AAAA,EACT,CAAC,EAAE,cAAc,EAAE,WAAW,sBAAsB,IAAI,EAAE,WAAW,uBAAuB,EAAE,OAAO,EAAE,QAAQ;AAAA,IAC7G,SAAS;AAAA,IACT,SAAS,CAAC,cAAc;AAAA,IACxB,UAAU;AAAA,IACV,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,EAAE,KAAK,OAAO,KAAK,KAAK,SAAS;AAChC,QAAI,eAAe,kBAAkB;AACnC,MAAAA,SAAQ,MAAM,IAAI,OAAO;AACzB,MAAAA,SAAQ,MAAM,IAAI,KAAK;AAAA,IACzB,OAAO;AACL,UAAI,OAAO,eAAe,oBAAoB,OAAO;AACnD,cAAM;AAAA,MACR,OAAO;AACL,aAAK,SAAS;AACd,QAAAA,SAAQ,IAAI,EAAE;AACd,QAAAA,SAAQ,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,MAAAA,SAAQ,MAAM,GAAG;AAAA,IACnB;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 { consola } from \"consola\";\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)).wrap(Math.min(150, yargs().terminalWidth())).env(\"OSDK\").version(false).option(\"verbose\", {\n alias: \"v\",\n type: \"boolean\",\n description: \"Enable verbose logging\",\n count: true\n }).demandCommand().middleware(logVersionMiddleware, true).middleware(logConfigFileMiddleware).strict().command({\n command: \"unstable\",\n aliases: [\"experimental\"],\n describe: \"Unstable commands\",\n builder: async argv => {\n return argv.command(site).command(typescript).command(auth).demandCommand();\n },\n handler: _args => {}\n }).fail(async (msg, err, argv) => {\n if (err instanceof ExitProcessError) {\n consola.error(err.message);\n consola.debug(err.stack);\n } else {\n if (err && err instanceof YargsCheckError === false) {\n throw err;\n } else {\n argv.showHelp();\n consola.log(\"\"); // intentional blank line\n consola.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 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 {\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\nimport { consola } from \"consola\";\nexport async function logDeployCommandConfigFileOverride(args, config) {\n if (config?.autoVersion != null && args.autoVersion !== config?.autoVersion.type) {\n consola.debug(`Overriding \"autoVersion\" from config file with ${args.autoVersion}`);\n }\n if (config?.directory != null && args.directory !== config?.directory) {\n consola.debug(`Overriding \"directory\" from config file with ${args.directory}`);\n }\n if (config?.autoVersion?.tagPrefix != null && args.gitTagPrefix != null && args.gitTagPrefix !== config?.autoVersion.tagPrefix) {\n consola.debug(`Overriding \"gitTagPrefix\" from config file with ${args.gitTagPrefix}`);\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport configLoader from \"../../../util/configLoader.js\";\nimport { YargsCheckError } from \"../../../YargsCheckError.js\";\nimport { logDeployCommandConfigFileOverride } from \"./logDeployCommandConfigFileOverride.js\";\nconst command = {\n command: \"deploy\",\n describe: \"Deploy a new site version\",\n builder: async argv => {\n const config = await configLoader();\n const siteConfig = config?.foundryConfig.site;\n const directory = siteConfig?.directory;\n const autoVersion = siteConfig?.autoVersion;\n const gitTagPrefix = autoVersion?.tagPrefix;\n return argv.options({\n directory: {\n type: \"string\",\n description: \"Directory containing site files\",\n ...(directory ? {\n default: directory\n } : {\n demandOption: true\n })\n },\n uploadOnly: {\n type: \"boolean\",\n description: \"Upload new site version only without setting as live\",\n default: false\n },\n version: {\n type: \"string\",\n description: \"New version of site to deploy\",\n ...(autoVersion == null ? {\n conflicts: \"autoVersion\"\n } : {})\n },\n autoVersion: {\n type: \"string\",\n choices: [\"git-describe\"],\n description: \"Enable auto versioning\",\n ...(autoVersion != null ? {\n default: autoVersion.type\n } : {\n conflicts: \"version\"\n })\n },\n gitTagPrefix: {\n type: \"string\",\n description: \"Prefix to match git tags on when 'git-describe' auto versioning is used. If not provided, all tags are matched and the prefix 'v' is stripped if present.\",\n ...(gitTagPrefix ? {\n default: gitTagPrefix\n } : {})\n }\n }).group([\"directory\", \"version\", \"uploadOnly\"], \"Deploy Options\").group([\"autoVersion\", \"gitTagPrefix\"], \"Auto Version Options\").check(args => {\n // This is required because we can't use demandOption with conflicts. conflicts protects us against the case where both are provided.\n // So this case is for when nothing is provided.\n if (autoVersion == null && args.autoVersion == null && args.version == null) {\n throw new YargsCheckError(\"One of --version or --autoVersion must be specified\");\n }\n const autoVersionType = args.autoVersion ?? autoVersion;\n if (autoVersionType !== \"git-describe\") {\n throw new YargsCheckError(`Only 'git-describe' is supported for autoVersion`);\n }\n const gitTagPrefixValue = args.gitTagPrefix ?? gitTagPrefix;\n // Future proofing for when we support other autoVersion types\n if (gitTagPrefixValue != null && autoVersionType !== \"git-describe\") {\n throw new YargsCheckError(`--gitTagPrefix is only supported when --autoVersion=git-describe`);\n }\n return true;\n }).middleware(args => logDeployCommandConfigFileOverride(args, siteConfig));\n },\n handler: async args => {\n const command = await import(\"./siteDeployCommand.mjs\");\n 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 { consola } from \"consola\";\nexport async function logSiteCommandConfigFileOverride(args, config) {\n if (config?.site.application != null && args.application !== config.site.application) {\n consola.debug(`Overriding \"application\" from config file with ${args.application}`);\n }\n if (config?.foundryUrl != null && args.foundryUrl !== config.foundryUrl) {\n consola.debug(`Overriding \"foundryUrl\" from config file with ${args.foundryUrl}`);\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst command = {\n command: \"delete <version>\",\n describe: \"Delete site version\",\n builder: argv => {\n return argv.positional(\"version\", {\n type: \"string\",\n demandOption: true,\n description: \"Version to set as live\"\n }).option(\"yes\", {\n alias: \"y\",\n type: \"boolean\",\n description: \"Automatically confirm destructive changes\"\n }).group([\"yes\"], \"Delete Options\");\n },\n handler: async args => {\n const command = await import(\"./versionDeleteCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst command = {\n command: \"get\",\n describe: \"Get live site version\",\n builder: argv => {\n return argv;\n },\n handler: async args => {\n const command = await import(\"./versionGetCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst command = {\n command: \"list\",\n describe: \"List site versions\",\n builder: argv => {\n return argv;\n },\n handler: async args => {\n const command = await import(\"./versionListCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst command = {\n command: \"set <version>\",\n describe: \"Set live site version\",\n builder: argv => {\n return argv.positional(\"version\", {\n type: \"string\",\n demandOption: true,\n description: \"Version to set as live\"\n });\n },\n handler: async args => {\n const command = await import(\"./versionSetCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst command = {\n command: \"unset\",\n describe: \"Clear live site version\",\n builder: argv => {\n return argv.option(\"yes\", {\n alias: \"y\",\n type: \"boolean\",\n description: \"Automatically confirm destructive changes\"\n }).group([\"yes\"], \"Unset Options\");\n },\n handler: async args => {\n const command = await import(\"./versionUnsetCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport deleteCmd from \"./delete/index.js\";\nimport get from \"./get/index.js\";\nimport list from \"./list/index.js\";\nimport set from \"./set/index.js\";\nimport unset from \"./unset/index.js\";\nconst command = {\n command: \"version\",\n describe: \"Manage site versions\",\n builder: argv => {\n return argv.command(list).command(get).command(set).command(unset).command(deleteCmd).demandCommand();\n },\n handler: async args => {}\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport 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 resource identifier (rid)\"\n },\n foundryUrl: {\n coerce: foundryUrl => foundryUrl.replace(/\\/$/, \"\"),\n type: \"string\",\n ...(foundryUrl ? {\n default: foundryUrl\n } : {\n demandOption: true\n }),\n description: \"Foundry URL including protocol\"\n },\n token: {\n type: \"string\",\n conflicts: \"tokenFile\",\n description: \"Foundry API token\"\n },\n tokenFile: {\n type: \"string\",\n conflicts: \"token\",\n description: \"Path to file containing Foundry API token\"\n }\n }).group([\"application\", \"foundryUrl\", \"token\", \"tokenFile\"], \"Common Options\").command(version).command(deploy).check(args => {\n if (!args.foundryUrl.startsWith(\"https://\")) {\n throw new YargsCheckError(\"foundryUrl must start with https://\");\n }\n return true;\n }).middleware(args => logSiteCommandConfigFileOverride(args, config?.foundryConfig)).demandCommand();\n },\n handler: async args => {}\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { isValidSemver } from \"../../../util/isValidSemver.js\";\nexport const command = {\n command: \"generate\",\n describe: \"Generate TypeScript SDK from ontology\",\n builder: argv => {\n return argv.options({\n \"outDir\": {\n type: \"string\",\n description: \"Where to place the generated files\",\n demandOption: true\n },\n ontologyPath: {\n description: \"path to the ontology wire json\",\n type: \"string\",\n demandOption: false,\n conflicts: [\"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(args => {\n if (!args.ontologyPath && !args.stack) {\n throw new Error(\"Error: Must specify either ontologyPath or stack and clientId\");\n }\n if (args.version !== \"dev\" && !isValidSemver(args.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 { consola } from \"consola\";\nimport getConfig from \"../util/configLoader.js\";\nlet firstTime = true;\nexport async function logConfigFileMiddleware() {\n if (firstTime) {\n firstTime = false;\n const config = getConfig();\n const configFilePath = (await config)?.configFilePath;\n if (configFilePath) {\n consola.debug(`Using configuration from file: \"${configFilePath}\"`);\n }\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nlet firstTime = true;\nexport async function logVersionMiddleware(args) {\n if (firstTime) {\n firstTime = false;\n // This will be called before any command is executed\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}"]}
@@ -1,6 +1,7 @@
1
1
  import { isValidSemver } from './chunk-N6K26UR4.mjs';
2
2
  import { ExitProcessError } from './chunk-GTNZA5UY.mjs';
3
3
  import './chunk-E2SEJZTC.mjs';
4
+ import { consola } from 'consola';
4
5
  import yargs from 'yargs';
5
6
  import { hideBin } from 'yargs/helpers';
6
7
  import { promises } from 'fs';
@@ -85,8 +86,6 @@ async function loadFoundryConfig() {
85
86
  allErrors: true
86
87
  });
87
88
  const validate = ajv.compile(CONFIG_FILE_SCHEMA);
88
- const Consola = await import('consola');
89
- Consola.consola;
90
89
  const {
91
90
  findUp
92
91
  } = await import('find-up');
@@ -126,26 +125,22 @@ var YargsCheckError = class extends Error {
126
125
  super(msg);
127
126
  }
128
127
  };
129
-
130
- // src/commands/site/deploy/logDeployCommandConfigFileOverride.ts
131
- async function logDeployCommandConfigFileOverride(argv, config) {
132
- const Consola = await import('consola');
133
- const consola = Consola.consola;
134
- if (config?.autoVersion != null && argv.autoVersion !== config?.autoVersion.type) {
135
- consola.debug(`Overriding "autoVersion" from config file with ${argv.autoVersion}`);
128
+ async function logDeployCommandConfigFileOverride(args, config) {
129
+ if (config?.autoVersion != null && args.autoVersion !== config?.autoVersion.type) {
130
+ consola.debug(`Overriding "autoVersion" from config file with ${args.autoVersion}`);
136
131
  }
137
- if (config?.directory != null && argv.directory !== config?.directory) {
138
- consola.debug(`Overriding "directory" from config file with ${argv.directory}`);
132
+ if (config?.directory != null && args.directory !== config?.directory) {
133
+ consola.debug(`Overriding "directory" from config file with ${args.directory}`);
139
134
  }
140
- if (config?.autoVersion?.tagPrefix != null && argv.gitTagPrefix != null && argv.gitTagPrefix !== config?.autoVersion.tagPrefix) {
141
- consola.debug(`Overriding "gitTagPrefix" from config file with ${argv.gitTagPrefix}`);
135
+ if (config?.autoVersion?.tagPrefix != null && args.gitTagPrefix != null && args.gitTagPrefix !== config?.autoVersion.tagPrefix) {
136
+ consola.debug(`Overriding "gitTagPrefix" from config file with ${args.gitTagPrefix}`);
142
137
  }
143
138
  }
144
139
 
145
140
  // src/commands/site/deploy/index.ts
146
141
  var command2 = {
147
142
  command: "deploy",
148
- describe: "Deploy an uploaded version",
143
+ describe: "Deploy a new site version",
149
144
  builder: async (argv) => {
150
145
  const config = await configLoader_default();
151
146
  const siteConfig = config?.foundryConfig.site;
@@ -155,7 +150,7 @@ var command2 = {
155
150
  return argv.options({
156
151
  directory: {
157
152
  type: "string",
158
- description: "Directory to deploy",
153
+ description: "Directory containing site files",
159
154
  ...directory ? {
160
155
  default: directory
161
156
  } : {
@@ -164,19 +159,20 @@ var command2 = {
164
159
  },
165
160
  uploadOnly: {
166
161
  type: "boolean",
167
- description: "Upload the directory but do not deploy it",
162
+ description: "Upload new site version only without setting as live",
168
163
  default: false
169
164
  },
170
165
  version: {
171
166
  type: "string",
172
- description: "Version to deploy",
167
+ description: "New version of site to deploy",
173
168
  ...autoVersion == null ? {
174
169
  conflicts: "autoVersion"
175
170
  } : {}
176
171
  },
177
172
  autoVersion: {
178
173
  type: "string",
179
- description: "Enables autoversioning. Can be set to 'git-describe' to use git describe to determine the version.",
174
+ choices: ["git-describe"],
175
+ description: "Enable auto versioning",
180
176
  ...autoVersion != null ? {
181
177
  default: autoVersion.type
182
178
  } : {
@@ -185,58 +181,58 @@ var command2 = {
185
181
  },
186
182
  gitTagPrefix: {
187
183
  type: "string",
188
- description: "Prefix to match git tags against when --autoVersion=git-describe is used. If not provided, a default prefix 'v' is used.",
184
+ description: "Prefix to match git tags on when 'git-describe' auto versioning is used. If not provided, all tags are matched and the prefix 'v' is stripped if present.",
189
185
  ...gitTagPrefix ? {
190
186
  default: gitTagPrefix
191
187
  } : {}
192
188
  }
193
- }).group(["autoVersion", "gitTagPrefix"], "Autoversion Arguments").group(["version", "directory", "uploadOnly"], "Common Arguments").check((argv2) => {
194
- if (autoVersion == null && argv2.autoVersion == null && argv2.version == null) {
189
+ }).group(["directory", "version", "uploadOnly"], "Deploy Options").group(["autoVersion", "gitTagPrefix"], "Auto Version Options").check((args) => {
190
+ if (autoVersion == null && args.autoVersion == null && args.version == null) {
195
191
  throw new YargsCheckError("One of --version or --autoVersion must be specified");
196
192
  }
197
- const autoVersionType = argv2.autoVersion ?? autoVersion;
193
+ const autoVersionType = args.autoVersion ?? autoVersion;
198
194
  if (autoVersionType !== "git-describe") {
199
195
  throw new YargsCheckError(`Only 'git-describe' is supported for autoVersion`);
200
196
  }
201
- const gitTagPrefixValue = argv2.gitTagPrefix ?? gitTagPrefix;
197
+ const gitTagPrefixValue = args.gitTagPrefix ?? gitTagPrefix;
202
198
  if (gitTagPrefixValue != null && autoVersionType !== "git-describe") {
203
199
  throw new YargsCheckError(`--gitTagPrefix is only supported when --autoVersion=git-describe`);
204
200
  }
205
201
  return true;
206
- }).middleware((argv2) => logDeployCommandConfigFileOverride(argv2, siteConfig));
202
+ }).middleware((args) => logDeployCommandConfigFileOverride(args, siteConfig));
207
203
  },
208
204
  handler: async (args) => {
209
- const command11 = await import('./siteDeployCommand-HSR3QDAT.mjs');
205
+ const command11 = await import('./siteDeployCommand-4S2UQKJP.mjs');
210
206
  await command11.default(args);
211
207
  }
212
208
  };
213
209
  var deploy_default = command2;
214
-
215
- // src/commands/site/logSiteCommandConfigFileOverride.ts
216
- async function logSiteCommandConfigFileOverride(argv, config) {
217
- const Consola = await import('consola');
218
- const consola = Consola.consola;
219
- if (config?.site.application != null && argv.application !== config.site.application) {
220
- consola.debug(`Overriding "application" from config file with ${argv.application}`);
210
+ async function logSiteCommandConfigFileOverride(args, config) {
211
+ if (config?.site.application != null && args.application !== config.site.application) {
212
+ consola.debug(`Overriding "application" from config file with ${args.application}`);
221
213
  }
222
- if (config?.foundryUrl != null && argv.foundryUrl !== config.foundryUrl) {
223
- consola.debug(`Overriding "foundryUrl" from config file with ${argv.foundryUrl}`);
214
+ if (config?.foundryUrl != null && args.foundryUrl !== config.foundryUrl) {
215
+ consola.debug(`Overriding "foundryUrl" from config file with ${args.foundryUrl}`);
224
216
  }
225
217
  }
226
218
 
227
219
  // src/commands/site/version/delete/index.ts
228
220
  var command3 = {
229
221
  command: "delete <version>",
230
- describe: "Delete the specified site version.",
222
+ describe: "Delete site version",
231
223
  builder: (argv) => {
232
224
  return argv.positional("version", {
233
225
  type: "string",
234
226
  demandOption: true,
235
227
  description: "Version to set as live"
236
- });
228
+ }).option("yes", {
229
+ alias: "y",
230
+ type: "boolean",
231
+ description: "Automatically confirm destructive changes"
232
+ }).group(["yes"], "Delete Options");
237
233
  },
238
234
  handler: async (args) => {
239
- const command11 = await import('./versionDeleteCommand-6BJL5XLG.mjs');
235
+ const command11 = await import('./versionDeleteCommand-DGB5NTFM.mjs');
240
236
  await command11.default(args);
241
237
  }
242
238
  };
@@ -245,7 +241,7 @@ var delete_default = command3;
245
241
  // src/commands/site/version/get/index.ts
246
242
  var command4 = {
247
243
  command: "get",
248
- describe: "Get the currently set live site version",
244
+ describe: "Get live site version",
249
245
  builder: (argv) => {
250
246
  return argv;
251
247
  },
@@ -259,7 +255,7 @@ var get_default = command4;
259
255
  // src/commands/site/version/list/index.ts
260
256
  var command5 = {
261
257
  command: "list",
262
- describe: "List application versions",
258
+ describe: "List site versions",
263
259
  builder: (argv) => {
264
260
  return argv;
265
261
  },
@@ -273,7 +269,7 @@ var list_default = command5;
273
269
  // src/commands/site/version/set/index.ts
274
270
  var command6 = {
275
271
  command: "set <version>",
276
- describe: "Set the live site version",
272
+ describe: "Set live site version",
277
273
  builder: (argv) => {
278
274
  return argv.positional("version", {
279
275
  type: "string",
@@ -291,12 +287,16 @@ var set_default = command6;
291
287
  // src/commands/site/version/unset/index.ts
292
288
  var command7 = {
293
289
  command: "unset",
294
- describe: "Clear the currently set live site version.",
290
+ describe: "Clear live site version",
295
291
  builder: (argv) => {
296
- return argv;
292
+ return argv.option("yes", {
293
+ alias: "y",
294
+ type: "boolean",
295
+ description: "Automatically confirm destructive changes"
296
+ }).group(["yes"], "Unset Options");
297
297
  },
298
298
  handler: async (args) => {
299
- const command11 = await import('./versionUnsetCommand-IJT4JWBN.mjs');
299
+ const command11 = await import('./versionUnsetCommand-ISMMMWWZ.mjs');
300
300
  await command11.default(args);
301
301
  }
302
302
  };
@@ -305,9 +305,9 @@ var unset_default = command7;
305
305
  // src/commands/site/version/index.ts
306
306
  var command8 = {
307
307
  command: "version",
308
- describe: "Manage application version",
308
+ describe: "Manage site versions",
309
309
  builder: (argv) => {
310
- return argv.command(list_default).command(set_default).command(unset_default).command(delete_default).command(get_default).demandCommand();
310
+ return argv.command(list_default).command(get_default).command(set_default).command(unset_default).command(delete_default).demandCommand();
311
311
  },
312
312
  handler: async (args) => {
313
313
  }
@@ -331,7 +331,7 @@ var command9 = {
331
331
  } : {
332
332
  demandOption: true
333
333
  },
334
- description: "Application RID"
334
+ description: "Application resource identifier (rid)"
335
335
  },
336
336
  foundryUrl: {
337
337
  coerce: (foundryUrl2) => foundryUrl2.replace(/\/$/, ""),
@@ -341,24 +341,24 @@ var command9 = {
341
341
  } : {
342
342
  demandOption: true
343
343
  },
344
- description: "Foundry Stack URL with Protocol (e.g. https://example.palantirfoundry.com)"
344
+ description: "Foundry URL including protocol"
345
345
  },
346
346
  token: {
347
347
  type: "string",
348
348
  conflicts: "tokenFile",
349
- description: "Foundry API Token"
349
+ description: "Foundry API token"
350
350
  },
351
351
  tokenFile: {
352
352
  type: "string",
353
353
  conflicts: "token",
354
- description: "Path to a file containing your Foundry API Token"
354
+ description: "Path to file containing Foundry API token"
355
355
  }
356
- }).group(["application", "foundryUrl", "token", "tokenFile"], "Common Arguments").command(version_default).command(deploy_default).check((argv2) => {
357
- if (!argv2.foundryUrl.startsWith("https://")) {
356
+ }).group(["application", "foundryUrl", "token", "tokenFile"], "Common Options").command(version_default).command(deploy_default).check((args) => {
357
+ if (!args.foundryUrl.startsWith("https://")) {
358
358
  throw new YargsCheckError("foundryUrl must start with https://");
359
359
  }
360
360
  return true;
361
- }).middleware((argv2) => logSiteCommandConfigFileOverride(argv2, config?.foundryConfig)).demandCommand();
361
+ }).middleware((args) => logSiteCommandConfigFileOverride(args, config?.foundryConfig)).demandCommand();
362
362
  },
363
363
  handler: async (args) => {
364
364
  }
@@ -368,7 +368,7 @@ var site_default = command9;
368
368
  // src/commands/typescript/generate/generate.ts
369
369
  var command10 = {
370
370
  command: "generate",
371
- describe: "Generate typescript from ontology",
371
+ describe: "Generate TypeScript SDK from ontology",
372
372
  builder: (argv) => {
373
373
  return argv.options({
374
374
  "outDir": {
@@ -416,18 +416,18 @@ var command10 = {
416
416
  description: "Version of the generated code, or 'dev'",
417
417
  demandOption: true
418
418
  }
419
- }).group(["ontologyPath", "outDir", "version"], "Generate from a local file").group(["stack", "clientId", "outDir", "ontologyWritePath", "version"], "OR Generate from a stack").check((argv2) => {
420
- if (!argv2.ontologyPath && !argv2.stack) {
419
+ }).group(["ontologyPath", "outDir", "version"], "Generate from a local file").group(["stack", "clientId", "outDir", "ontologyWritePath", "version"], "OR Generate from a stack").check((args) => {
420
+ if (!args.ontologyPath && !args.stack) {
421
421
  throw new Error("Error: Must specify either ontologyPath or stack and clientId");
422
422
  }
423
- if (argv2.version !== "dev" && !isValidSemver(argv2.version)) {
423
+ if (args.version !== "dev" && !isValidSemver(args.version)) {
424
424
  throw new Error("Error: Version must be 'dev' or a valid semver version");
425
425
  }
426
426
  return true;
427
427
  });
428
428
  },
429
429
  handler: async (args) => {
430
- const command11 = await import('./handleGenerate-A7X2XAGW.mjs');
430
+ const command11 = await import('./handleGenerate-7QGFIWKO.mjs');
431
431
  await command11.default(args);
432
432
  }
433
433
  };
@@ -444,8 +444,6 @@ var site2 = {
444
444
  }
445
445
  };
446
446
  var typescript_default = site2;
447
-
448
- // src/yargs/logConfigFileMiddleware.ts
449
447
  var firstTime = true;
450
448
  async function logConfigFileMiddleware() {
451
449
  if (firstTime) {
@@ -453,21 +451,15 @@ async function logConfigFileMiddleware() {
453
451
  const config = configLoader_default();
454
452
  const configFilePath = (await config)?.configFilePath;
455
453
  if (configFilePath) {
456
- const Consola = await import('consola');
457
- const consola = Consola.consola;
458
454
  consola.debug(`Using configuration from file: "${configFilePath}"`);
459
455
  }
460
456
  }
461
457
  }
462
-
463
- // src/yargs/logVersionMiddleware.ts
464
458
  var firstTime2 = true;
465
459
  async function logVersionMiddleware(args) {
466
460
  if (firstTime2) {
467
461
  firstTime2 = false;
468
- const Consola = await import('consola');
469
- const consola = Consola.consola;
470
- consola.info(`Palantir OSDK CLI ${"0.4.0"}`);
462
+ consola.info(`Palantir OSDK CLI ${"0.6.0"}`);
471
463
  consola.level = 3 + args.verbose;
472
464
  if (consola.level > 3) {
473
465
  consola.debug(`Verbose logging enabled (${consola.level === 4 ? "debug" : "trace"})`);
@@ -478,7 +470,7 @@ async function logVersionMiddleware(args) {
478
470
 
479
471
  // src/cli.ts
480
472
  async function cli(args = process.argv) {
481
- const base = yargs(hideBin(args)).env("OSDK").version(false).option("verbose", {
473
+ const base = yargs(hideBin(args)).wrap(Math.min(150, yargs().terminalWidth())).env("OSDK").version(false).option("verbose", {
482
474
  alias: "v",
483
475
  type: "boolean",
484
476
  description: "Enable verbose logging",
@@ -486,27 +478,23 @@ async function cli(args = process.argv) {
486
478
  }).demandCommand().middleware(logVersionMiddleware, true).middleware(logConfigFileMiddleware).strict().command({
487
479
  command: "unstable",
488
480
  aliases: ["experimental"],
481
+ describe: "Unstable commands",
489
482
  builder: async (argv) => {
490
483
  return argv.command(site_default).command(typescript_default).command(auth_default).demandCommand();
491
484
  },
492
485
  handler: (_args) => {
493
486
  }
494
- }).fail(async (msg, err, yargsContext) => {
495
- const Consola = await import('consola');
496
- const isVerbose = args.some((arg) => ["-v", "--v", "--verbose"].includes(arg));
487
+ }).fail(async (msg, err, argv) => {
497
488
  if (err instanceof ExitProcessError) {
498
- if (isVerbose) {
499
- Consola.consola.error(err);
500
- } else {
501
- Consola.consola.error(err.message);
502
- }
489
+ consola.error(err.message);
490
+ consola.debug(err.stack);
503
491
  } else {
504
492
  if (err && err instanceof YargsCheckError === false) {
505
493
  throw err;
506
494
  } else {
507
- yargsContext.showHelp();
508
- Consola.consola.log("");
509
- console.error(msg);
495
+ argv.showHelp();
496
+ consola.log("");
497
+ consola.error(msg);
510
498
  }
511
499
  }
512
500
  process.exit(1);
@@ -515,8 +503,7 @@ async function cli(args = process.argv) {
515
503
  return await base.parseAsync();
516
504
  } catch (err) {
517
505
  if (err instanceof ExitProcessError) {
518
- const Consola = await import('consola');
519
- Consola.consola.error(err);
506
+ consola.error(err);
520
507
  }
521
508
  }
522
509
  }