@osdk/cli 0.7.0 → 0.9.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 (45) hide show
  1. package/build/js/chunk-CCA2T5YW.cjs +12 -0
  2. package/build/js/chunk-CCA2T5YW.cjs.map +1 -0
  3. package/build/js/chunk-MU5KWUEI.mjs +10 -0
  4. package/build/js/chunk-MU5KWUEI.mjs.map +1 -0
  5. package/build/js/{chunk-JFYC74FJ.cjs → chunk-S2I3VLCY.cjs} +2 -2
  6. package/build/js/{chunk-EZIJJWAA.mjs → chunk-UUMRUSW7.mjs} +2 -2
  7. package/build/js/{handleGenerate-GBN42PDO.cjs → handleGenerate-CR7EMFR7.cjs} +4 -3
  8. package/build/js/handleGenerate-CR7EMFR7.cjs.map +1 -0
  9. package/build/js/{handleGenerate-NQPMMKLX.mjs → handleGenerate-JD2EN42M.mjs} +4 -3
  10. package/build/js/handleGenerate-JD2EN42M.mjs.map +1 -0
  11. package/build/js/index.cjs +26 -27
  12. package/build/js/index.cjs.map +1 -1
  13. package/build/js/index.mjs +21 -22
  14. package/build/js/index.mjs.map +1 -1
  15. package/build/js/{siteDeployCommand-7QTLGWZI.mjs → siteDeployCommand-PEQ4IOIZ.mjs} +2 -2
  16. package/build/js/{siteDeployCommand-HOXKQM56.cjs → siteDeployCommand-XSWYJZYG.cjs} +9 -9
  17. package/build/js/{versionDeleteCommand-LQRGKTMH.mjs → versionDeleteCommand-AAP4O5ZE.mjs} +2 -2
  18. package/build/js/{versionDeleteCommand-GDQEZLYA.cjs → versionDeleteCommand-VFJ2WM7Q.cjs} +5 -5
  19. package/build/js/{versionGetCommand-NZAQX7U5.mjs → versionGetCommand-3UVDIRMY.mjs} +2 -2
  20. package/build/js/{versionGetCommand-RU5LS3IG.cjs → versionGetCommand-JASRA4QL.cjs} +7 -7
  21. package/build/js/{versionListCommand-5N57YKEQ.mjs → versionListCommand-AGCM7LFR.mjs} +2 -2
  22. package/build/js/{versionListCommand-QYCTS6KU.cjs → versionListCommand-DANLZEEE.cjs} +7 -7
  23. package/build/js/{versionSetCommand-K4SDBPLB.cjs → versionSetCommand-K3IPOA5G.cjs} +7 -7
  24. package/build/js/{versionSetCommand-UWPAQ7NV.mjs → versionSetCommand-UT4LAKJO.mjs} +2 -2
  25. package/build/js/{versionUnsetCommand-INDJ26MO.cjs → versionUnsetCommand-NIEO3RO4.cjs} +7 -7
  26. package/build/js/{versionUnsetCommand-PZRZPTPR.mjs → versionUnsetCommand-OKXMDWJU.mjs} +2 -2
  27. package/changelog/0.9.0/pr-38.v2.yml +5 -0
  28. package/changelog/0.9.0/pr-68.v2.yml +6 -0
  29. package/package.json +3 -3
  30. package/build/js/handleGenerate-GBN42PDO.cjs.map +0 -1
  31. package/build/js/handleGenerate-NQPMMKLX.mjs.map +0 -1
  32. /package/build/js/{chunk-EZIJJWAA.mjs.map → chunk-S2I3VLCY.cjs.map} +0 -0
  33. /package/build/js/{chunk-JFYC74FJ.cjs.map → chunk-UUMRUSW7.mjs.map} +0 -0
  34. /package/build/js/{siteDeployCommand-7QTLGWZI.mjs.map → siteDeployCommand-PEQ4IOIZ.mjs.map} +0 -0
  35. /package/build/js/{siteDeployCommand-HOXKQM56.cjs.map → siteDeployCommand-XSWYJZYG.cjs.map} +0 -0
  36. /package/build/js/{versionDeleteCommand-GDQEZLYA.cjs.map → versionDeleteCommand-AAP4O5ZE.mjs.map} +0 -0
  37. /package/build/js/{versionDeleteCommand-LQRGKTMH.mjs.map → versionDeleteCommand-VFJ2WM7Q.cjs.map} +0 -0
  38. /package/build/js/{versionGetCommand-NZAQX7U5.mjs.map → versionGetCommand-3UVDIRMY.mjs.map} +0 -0
  39. /package/build/js/{versionGetCommand-RU5LS3IG.cjs.map → versionGetCommand-JASRA4QL.cjs.map} +0 -0
  40. /package/build/js/{versionListCommand-5N57YKEQ.mjs.map → versionListCommand-AGCM7LFR.mjs.map} +0 -0
  41. /package/build/js/{versionListCommand-QYCTS6KU.cjs.map → versionListCommand-DANLZEEE.cjs.map} +0 -0
  42. /package/build/js/{versionSetCommand-K4SDBPLB.cjs.map → versionSetCommand-K3IPOA5G.cjs.map} +0 -0
  43. /package/build/js/{versionSetCommand-UWPAQ7NV.mjs.map → versionSetCommand-UT4LAKJO.mjs.map} +0 -0
  44. /package/build/js/{versionUnsetCommand-INDJ26MO.cjs.map → versionUnsetCommand-NIEO3RO4.cjs.map} +0 -0
  45. /package/build/js/{versionUnsetCommand-PZRZPTPR.mjs.map → versionUnsetCommand-OKXMDWJU.mjs.map} +0 -0
@@ -1,3 +1,4 @@
1
+ import { YargsCheckError } from './chunk-MU5KWUEI.mjs';
1
2
  import { isValidSemver } from './chunk-GX2IOTA6.mjs';
2
3
  import { ExitProcessError } from './chunk-CLAEREOL.mjs';
3
4
  import './chunk-E2SEJZTC.mjs';
@@ -17,7 +18,8 @@ var command = {
17
18
  alias: "applicationId",
18
19
  // for backwards compatibility
19
20
  type: "string",
20
- demandOption: true
21
+ demandOption: true,
22
+ describe: "OAuth client ID for application"
21
23
  });
22
24
  },
23
25
  handler: async (args) => {
@@ -36,8 +38,9 @@ var site = {
36
38
  foundryUrl: {
37
39
  type: "string",
38
40
  demandOption: true,
39
- alias: "baseUrl"
41
+ alias: "baseUrl",
40
42
  // for backwards compatibility
43
+ describe: "URL for the Foundry stack"
41
44
  }
42
45
  }).command(login_default).demandCommand();
43
46
  },
@@ -133,13 +136,6 @@ function getConfig() {
133
136
  return configPromise;
134
137
  }
135
138
  var configLoader_default = getConfig;
136
-
137
- // src/YargsCheckError.ts
138
- var YargsCheckError = class extends Error {
139
- constructor(msg) {
140
- super(msg);
141
- }
142
- };
143
139
  async function logDeployCommandConfigFileOverride(args, config) {
144
140
  if (config?.autoVersion != null && args.autoVersion !== config?.autoVersion.type) {
145
141
  consola.debug(`Overriding "autoVersion" from config file with ${args.autoVersion}`);
@@ -206,6 +202,9 @@ var command2 = {
206
202
  if (autoVersion == null && args.autoVersion == null && args.version == null) {
207
203
  throw new YargsCheckError("One of --version or --autoVersion must be specified");
208
204
  }
205
+ if (args.version != null && !isValidSemver(args.version)) {
206
+ throw new YargsCheckError(`--version "${args.version}" must be a valid SemVer string`);
207
+ }
209
208
  const autoVersionType = args.autoVersion ?? autoVersion;
210
209
  if (autoVersionType !== "git-describe") {
211
210
  throw new YargsCheckError(`Only 'git-describe' is supported for autoVersion`);
@@ -218,7 +217,7 @@ var command2 = {
218
217
  }).middleware((args) => logDeployCommandConfigFileOverride(args, siteConfig));
219
218
  },
220
219
  handler: async (args) => {
221
- const command11 = await import('./siteDeployCommand-7QTLGWZI.mjs');
220
+ const command11 = await import('./siteDeployCommand-PEQ4IOIZ.mjs');
222
221
  const {
223
222
  version,
224
223
  autoVersion,
@@ -261,7 +260,7 @@ var command3 = {
261
260
  }).group(["yes"], "Delete Options");
262
261
  },
263
262
  handler: async (args) => {
264
- const command11 = await import('./versionDeleteCommand-LQRGKTMH.mjs');
263
+ const command11 = await import('./versionDeleteCommand-AAP4O5ZE.mjs');
265
264
  await command11.default(args);
266
265
  }
267
266
  };
@@ -275,7 +274,7 @@ var command4 = {
275
274
  return argv;
276
275
  },
277
276
  handler: async (args) => {
278
- const command11 = await import('./versionGetCommand-NZAQX7U5.mjs');
277
+ const command11 = await import('./versionGetCommand-3UVDIRMY.mjs');
279
278
  await command11.default(args);
280
279
  }
281
280
  };
@@ -289,7 +288,7 @@ var command5 = {
289
288
  return argv;
290
289
  },
291
290
  handler: async (args) => {
292
- const command11 = await import('./versionListCommand-5N57YKEQ.mjs');
291
+ const command11 = await import('./versionListCommand-AGCM7LFR.mjs');
293
292
  await command11.default(args);
294
293
  }
295
294
  };
@@ -307,7 +306,7 @@ var command6 = {
307
306
  });
308
307
  },
309
308
  handler: async (args) => {
310
- const command11 = await import('./versionSetCommand-UWPAQ7NV.mjs');
309
+ const command11 = await import('./versionSetCommand-UT4LAKJO.mjs');
311
310
  await command11.default(args);
312
311
  }
313
312
  };
@@ -325,7 +324,7 @@ var command7 = {
325
324
  }).group(["yes"], "Unset Options");
326
325
  },
327
326
  handler: async (args) => {
328
- const command11 = await import('./versionUnsetCommand-PZRZPTPR.mjs');
327
+ const command11 = await import('./versionUnsetCommand-OKXMDWJU.mjs');
329
328
  await command11.default(args);
330
329
  }
331
330
  };
@@ -370,7 +369,7 @@ var command9 = {
370
369
  } : {
371
370
  demandOption: true
372
371
  },
373
- description: "Foundry URL including protocol"
372
+ description: "URL for the Foundry stack"
374
373
  },
375
374
  token: {
376
375
  type: "string",
@@ -412,7 +411,7 @@ var command10 = {
412
411
  conflicts: ["foundryUrl", "clientId"]
413
412
  },
414
413
  foundryUrl: {
415
- description: "The URL to the foundry stack that contains the ontology",
414
+ description: "URL for the foundry stack that contains the ontology",
416
415
  type: "string",
417
416
  demandOption: false,
418
417
  conflicts: "ontologyPath",
@@ -421,7 +420,7 @@ var command10 = {
421
420
  // for backwards compatibility
422
421
  },
423
422
  clientId: {
424
- description: "The application's client id",
423
+ description: "OAuth client ID for application",
425
424
  type: "string",
426
425
  demandOption: false,
427
426
  conflicts: "ontologyPath",
@@ -449,16 +448,16 @@ var command10 = {
449
448
  }
450
449
  }).group(["ontologyPath", "outDir", "version"], "Generate from a local file").group(["foundryUrl", "clientId", "outDir", "ontologyWritePath", "version"], "OR Generate from Foundry").check((args) => {
451
450
  if (!args.ontologyPath && !args.foundryUrl) {
452
- throw new Error("Error: Must specify either ontologyPath or foundryUrl and clientId");
451
+ throw new YargsCheckError("Must specify either ontologyPath or foundryUrl and clientId");
453
452
  }
454
453
  if (args.version !== "dev" && !isValidSemver(args.version)) {
455
- throw new Error("Error: Version must be 'dev' or a valid semver version");
454
+ throw new YargsCheckError("Version must be 'dev' or a valid semver version");
456
455
  }
457
456
  return true;
458
457
  });
459
458
  },
460
459
  handler: async (args) => {
461
- const command11 = await import('./handleGenerate-NQPMMKLX.mjs');
460
+ const command11 = await import('./handleGenerate-JD2EN42M.mjs');
462
461
  await command11.default(args);
463
462
  }
464
463
  };
@@ -490,7 +489,7 @@ var firstTime2 = true;
490
489
  async function logVersionMiddleware(args) {
491
490
  if (firstTime2) {
492
491
  firstTime2 = false;
493
- consola.info(`Palantir OSDK CLI ${"0.7.0"}`);
492
+ consola.info(`Palantir OSDK CLI ${"0.9.0"}`);
494
493
  consola.level = 3 + args.verbose;
495
494
  if (consola.level > 3) {
496
495
  consola.debug(`Verbose logging enabled (${consola.level === 4 ? "debug" : "trace"})`);
@@ -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":["consola","command","autoVersion","application","foundryUrl","site","firstTime"],"mappings":";;;;;;;;;AAgBA,SAAS,WAAAA,gBAAe;AACxB,SAAS,gBAAgB;AACzB,OAAO,WAAW;AAClB,SAAS,eAAe;;;ACHjB,IAAM,UAAU;AAAA,EACrB,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS,UAAQ;AACf,WAAO,KAAK,OAAO,YAAY;AAAA,MAC7B,OAAO;AAAA;AAAA,MAEP,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;AACF;AACA,IAAO,gBAAQ;;;ACff,IAAM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,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 { colorize } from \"consola/utils\";\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 if (err.tip != null) {\n consola.log(colorize(\"bold\", `💡 Tip: ${err.tip}`));\n consola.log(\"\");\n }\n consola.debug(err.stack);\n } else {\n if (err && err instanceof YargsCheckError === false) {\n throw err;\n } else {\n argv.showHelp();\n consola.log(\"\");\n consola.error(msg);\n }\n }\n process.exit(1);\n });\n\n // 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(\"clientId\", {\n alias: \"applicationId\",\n // for backwards compatibility\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 foundryUrl: {\n type: \"string\",\n demandOption: true,\n alias: \"baseUrl\" // for backwards compatibility\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 { extname } from \"node:path\";\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 = parseConfigFile(fileContent, configFilePath);\n } catch (error) {\n throw new ExitProcessError(2, `Couldn't read or parse config file ${configFilePath}. Error: ${error}`);\n }\n if (!validate(foundryConfig)) {\n throw new ExitProcessError(2, `The configuration file does not match the expected schema: ${ajv.errorsText(validate.errors)}`);\n }\n return {\n foundryConfig,\n configFilePath\n };\n }\n return undefined;\n}\nfunction parseConfigFile(fileContent, configFilePath) {\n const extension = extname(configFilePath);\n switch (extension) {\n case \".json\":\n return JSON.parse(fileContent);\n default:\n throw new ExitProcessError(2, `Unsupported file extension: ${extension} for config file.`);\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { loadFoundryConfig } from \"./config.js\";\nlet configPromise = undefined;\nfunction getConfig() {\n if (configPromise == null) {\n configPromise = loadFoundryConfig();\n }\n return configPromise;\n}\nexport default getConfig;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\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 coerce: autoVersion => autoVersion,\n type: \"string\",\n choices: [\"git-describe\"],\n description: \"Enable auto versioning\",\n ...(autoVersion != null ? {\n default: autoVersion.type\n } : {\n conflicts: \"version\"\n })\n },\n gitTagPrefix: {\n type: \"string\",\n description: \"Prefix to match git tags on when 'git-describe' auto versioning is used. If not provided, all tags are matched and the prefix 'v' is stripped if present.\",\n ...(gitTagPrefix ? {\n default: gitTagPrefix\n } : {})\n }\n }).group([\"directory\", \"version\", \"uploadOnly\"], \"Deploy Options\").group([\"autoVersion\", \"gitTagPrefix\"], \"Auto Version Options\").check(args => {\n // This is required because we can't use demandOption with conflicts. conflicts protects us against the case where both are provided.\n // So this case is for when nothing is provided.\n if (autoVersion == null && args.autoVersion == null && args.version == null) {\n throw new YargsCheckError(\"One of --version or --autoVersion must be specified\");\n }\n const autoVersionType = args.autoVersion ?? autoVersion;\n if (autoVersionType !== \"git-describe\") {\n throw new YargsCheckError(`Only 'git-describe' is supported for autoVersion`);\n }\n const gitTagPrefixValue = args.gitTagPrefix ?? gitTagPrefix;\n // Future proofing for when we support other autoVersion types\n if (gitTagPrefixValue != null && autoVersionType !== \"git-describe\") {\n throw new YargsCheckError(`--gitTagPrefix is only supported when --autoVersion=git-describe`);\n }\n return true;\n }).middleware(args => logDeployCommandConfigFileOverride(args, siteConfig));\n },\n handler: async args => {\n const command = await import(\"./siteDeployCommand.mjs\");\n const {\n version,\n autoVersion,\n gitTagPrefix,\n ...restArgs\n } = args;\n const selectedVersion = args.version != null ? args.version : {\n type: args.autoVersion,\n tagPrefix: args.gitTagPrefix\n };\n await command.default({\n ...restArgs,\n selectedVersion\n });\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nexport async function logSiteCommandConfigFileOverride(args, config) {\n if (config?.site.application != null && args.application !== config.site.application) {\n consola.debug(`Overriding \"application\" from config file with ${args.application}`);\n }\n if (config?.foundryUrl != null && args.foundryUrl !== config.foundryUrl) {\n consola.debug(`Overriding \"foundryUrl\" from config file with ${args.foundryUrl}`);\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst command = {\n command: \"delete <version>\",\n describe: \"Delete site version\",\n builder: argv => {\n return argv.positional(\"version\", {\n type: \"string\",\n demandOption: true,\n description: \"Version to set as live\"\n }).option(\"yes\", {\n alias: \"y\",\n type: \"boolean\",\n description: \"Automatically confirm destructive changes\"\n }).group([\"yes\"], \"Delete Options\");\n },\n handler: async args => {\n const command = await import(\"./versionDeleteCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst command = {\n command: \"get\",\n describe: \"Get live site version\",\n builder: argv => {\n return argv;\n },\n handler: async args => {\n const command = await import(\"./versionGetCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst command = {\n command: \"list\",\n describe: \"List site versions\",\n builder: argv => {\n return argv;\n },\n handler: async args => {\n const command = await import(\"./versionListCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst command = {\n command: \"set <version>\",\n describe: \"Set live site version\",\n builder: argv => {\n return argv.positional(\"version\", {\n type: \"string\",\n demandOption: true,\n description: \"Version to set as live\"\n });\n },\n handler: async args => {\n const command = await import(\"./versionSetCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst command = {\n command: \"unset\",\n describe: \"Clear live site version\",\n builder: argv => {\n return argv.option(\"yes\", {\n alias: \"y\",\n type: \"boolean\",\n description: \"Automatically confirm destructive changes\"\n }).group([\"yes\"], \"Unset Options\");\n },\n handler: async args => {\n const command = await import(\"./versionUnsetCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport deleteCmd from \"./delete/index.js\";\nimport get from \"./get/index.js\";\nimport list from \"./list/index.js\";\nimport set from \"./set/index.js\";\nimport unset from \"./unset/index.js\";\nconst command = {\n command: \"version\",\n describe: \"Manage site versions\",\n builder: argv => {\n return argv.command(list).command(get).command(set).command(unset).command(deleteCmd).demandCommand();\n },\n handler: async args => {}\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport 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: [\"foundryUrl\", \"clientId\"]\n },\n foundryUrl: {\n description: \"The URL to the foundry stack that contains the ontology\",\n type: \"string\",\n demandOption: false,\n conflicts: \"ontologyPath\",\n implies: \"clientId\",\n alias: \"stack\" // for backwards compatibility\n },\n clientId: {\n description: \"The application's client id\",\n type: \"string\",\n demandOption: false,\n conflicts: \"ontologyPath\",\n implies: \"foundryUrl\"\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([\"foundryUrl\", \"clientId\", \"outDir\", \"ontologyWritePath\", \"version\"], \"OR Generate from Foundry\").check(args => {\n if (!args.ontologyPath && !args.foundryUrl) {\n throw new Error(\"Error: Must specify either ontologyPath or foundryUrl 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
+ {"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/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","autoVersion","application","foundryUrl","site","firstTime"],"mappings":";;;;;;;;;;;;AAgBA,SAAS,WAAAA,gBAAe;AACxB,SAAS,gBAAgB;AACzB,OAAO,WAAW;AAClB,SAAS,eAAe;;;ACHjB,IAAM,UAAU;AAAA,EACrB,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS,UAAQ;AACf,WAAO,KAAK,OAAO,YAAY;AAAA,MAC7B,OAAO;AAAA;AAAA,MAEP,MAAM;AAAA,MACN,cAAc;AAAA,MACd,UAAU;AAAA,IACZ,CAAC;AAAA,EACH;AAAA,EACA,SAAS,OAAM,SAAQ;AACrB,UAAMC,YAAU,MAAM,OAAO,0BAAgB;AAC7C,UAAMA,UAAQ,QAAQ,IAAI;AAAA,EAC5B;AACF;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QAAQ,kBAAW,IAAI,GAAG,EAAE,CAAC;AAClD,QAAAA,SAAQ,IAAI,EAAE;AAAA,MAChB;AACA,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 { colorize } from \"consola/utils\";\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 if (err.tip != null) {\n consola.log(colorize(\"bold\", `💡 Tip: ${err.tip}`));\n consola.log(\"\");\n }\n consola.debug(err.stack);\n } else {\n if (err && err instanceof YargsCheckError === false) {\n throw err;\n } else {\n argv.showHelp();\n consola.log(\"\");\n consola.error(msg);\n }\n }\n process.exit(1);\n });\n\n // 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(\"clientId\", {\n alias: \"applicationId\",\n // for backwards compatibility\n type: \"string\",\n demandOption: true,\n describe: \"OAuth client ID for application\"\n });\n },\n handler: async args => {\n const command = await import(\"./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 foundryUrl: {\n type: \"string\",\n demandOption: true,\n alias: \"baseUrl\",\n // for backwards compatibility\n describe: \"URL for the Foundry stack\"\n }\n }).command(login).demandCommand();\n },\n handler: async args => {}\n};\nexport default 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 { extname } from \"node:path\";\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 = parseConfigFile(fileContent, configFilePath);\n } catch (error) {\n throw new ExitProcessError(2, `Couldn't read or parse config file ${configFilePath}. Error: ${error}`);\n }\n if (!validate(foundryConfig)) {\n throw new ExitProcessError(2, `The configuration file does not match the expected schema: ${ajv.errorsText(validate.errors)}`);\n }\n return {\n foundryConfig,\n configFilePath\n };\n }\n return undefined;\n}\nfunction parseConfigFile(fileContent, configFilePath) {\n const extension = extname(configFilePath);\n switch (extension) {\n case \".json\":\n return JSON.parse(fileContent);\n default:\n throw new ExitProcessError(2, `Unsupported file extension: ${extension} for config file.`);\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { loadFoundryConfig } from \"./config.js\";\nlet configPromise = undefined;\nfunction getConfig() {\n if (configPromise == null) {\n configPromise = loadFoundryConfig();\n }\n return configPromise;\n}\nexport default getConfig;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nexport async function logDeployCommandConfigFileOverride(args, config) {\n if (config?.autoVersion != null && args.autoVersion !== config?.autoVersion.type) {\n consola.debug(`Overriding \"autoVersion\" from config file with ${args.autoVersion}`);\n }\n if (config?.directory != null && args.directory !== config?.directory) {\n consola.debug(`Overriding \"directory\" from config file with ${args.directory}`);\n }\n if (config?.autoVersion?.tagPrefix != null && args.gitTagPrefix != null && args.gitTagPrefix !== config?.autoVersion.tagPrefix) {\n consola.debug(`Overriding \"gitTagPrefix\" from config file with ${args.gitTagPrefix}`);\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport configLoader from \"../../../util/configLoader.js\";\nimport { isValidSemver } from \"../../../util/isValidSemver.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 coerce: autoVersion => autoVersion,\n type: \"string\",\n choices: [\"git-describe\"],\n description: \"Enable auto versioning\",\n ...(autoVersion != null ? {\n default: autoVersion.type\n } : {\n conflicts: \"version\"\n })\n },\n gitTagPrefix: {\n type: \"string\",\n description: \"Prefix to match git tags on when 'git-describe' auto versioning is used. If not provided, all tags are matched and the prefix 'v' is stripped if present.\",\n ...(gitTagPrefix ? {\n default: gitTagPrefix\n } : {})\n }\n }).group([\"directory\", \"version\", \"uploadOnly\"], \"Deploy Options\").group([\"autoVersion\", \"gitTagPrefix\"], \"Auto Version Options\").check(args => {\n // This is required because we can't use demandOption with conflicts. conflicts protects us against the case where both are provided.\n // So this case is for when nothing is provided.\n if (autoVersion == null && args.autoVersion == null && args.version == null) {\n throw new YargsCheckError(\"One of --version or --autoVersion must be specified\");\n }\n if (args.version != null && !isValidSemver(args.version)) {\n throw new YargsCheckError(`--version \"${args.version}\" must be a valid SemVer string`);\n }\n const autoVersionType = args.autoVersion ?? autoVersion;\n if (autoVersionType !== \"git-describe\") {\n throw new YargsCheckError(`Only 'git-describe' is supported for autoVersion`);\n }\n const gitTagPrefixValue = args.gitTagPrefix ?? gitTagPrefix;\n // Future proofing for when we support other autoVersion types\n if (gitTagPrefixValue != null && autoVersionType !== \"git-describe\") {\n throw new YargsCheckError(`--gitTagPrefix is only supported when --autoVersion=git-describe`);\n }\n return true;\n }).middleware(args => logDeployCommandConfigFileOverride(args, siteConfig));\n },\n handler: async args => {\n const command = await import(\"./siteDeployCommand.mjs\");\n const {\n version,\n autoVersion,\n gitTagPrefix,\n ...restArgs\n } = args;\n const selectedVersion = args.version != null ? args.version : {\n type: args.autoVersion,\n tagPrefix: args.gitTagPrefix\n };\n await command.default({\n ...restArgs,\n selectedVersion\n });\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nexport async function logSiteCommandConfigFileOverride(args, config) {\n if (config?.site.application != null && args.application !== config.site.application) {\n consola.debug(`Overriding \"application\" from config file with ${args.application}`);\n }\n if (config?.foundryUrl != null && args.foundryUrl !== config.foundryUrl) {\n consola.debug(`Overriding \"foundryUrl\" from config file with ${args.foundryUrl}`);\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst command = {\n command: \"delete <version>\",\n describe: \"Delete site version\",\n builder: argv => {\n return argv.positional(\"version\", {\n type: \"string\",\n demandOption: true,\n description: \"Version to set as live\"\n }).option(\"yes\", {\n alias: \"y\",\n type: \"boolean\",\n description: \"Automatically confirm destructive changes\"\n }).group([\"yes\"], \"Delete Options\");\n },\n handler: async args => {\n const command = await import(\"./versionDeleteCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst command = {\n command: \"get\",\n describe: \"Get live site version\",\n builder: argv => {\n return argv;\n },\n handler: async args => {\n const command = await import(\"./versionGetCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst command = {\n command: \"list\",\n describe: \"List site versions\",\n builder: argv => {\n return argv;\n },\n handler: async args => {\n const command = await import(\"./versionListCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst command = {\n command: \"set <version>\",\n describe: \"Set live site version\",\n builder: argv => {\n return argv.positional(\"version\", {\n type: \"string\",\n demandOption: true,\n description: \"Version to set as live\"\n });\n },\n handler: async args => {\n const command = await import(\"./versionSetCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst command = {\n command: \"unset\",\n describe: \"Clear live site version\",\n builder: argv => {\n return argv.option(\"yes\", {\n alias: \"y\",\n type: \"boolean\",\n description: \"Automatically confirm destructive changes\"\n }).group([\"yes\"], \"Unset Options\");\n },\n handler: async args => {\n const command = await import(\"./versionUnsetCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport deleteCmd from \"./delete/index.js\";\nimport get from \"./get/index.js\";\nimport list from \"./list/index.js\";\nimport set from \"./set/index.js\";\nimport unset from \"./unset/index.js\";\nconst command = {\n command: \"version\",\n describe: \"Manage site versions\",\n builder: argv => {\n return argv.command(list).command(get).command(set).command(unset).command(deleteCmd).demandCommand();\n },\n handler: async args => {}\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport 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: \"URL for the Foundry stack\"\n },\n token: {\n type: \"string\",\n conflicts: \"tokenFile\",\n description: \"Foundry API token\"\n },\n tokenFile: {\n type: \"string\",\n conflicts: \"token\",\n description: \"Path to file containing Foundry API token\"\n }\n }).group([\"application\", \"foundryUrl\", \"token\", \"tokenFile\"], \"Common Options\").command(version).command(deploy).check(args => {\n if (!args.foundryUrl.startsWith(\"https://\")) {\n throw new YargsCheckError(\"foundryUrl must start with https://\");\n }\n return true;\n }).middleware(args => logSiteCommandConfigFileOverride(args, config?.foundryConfig)).demandCommand();\n },\n handler: async args => {}\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { isValidSemver } from \"../../../util/isValidSemver.js\";\nimport { YargsCheckError } from \"../../../YargsCheckError.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: [\"foundryUrl\", \"clientId\"]\n },\n foundryUrl: {\n description: \"URL for the foundry stack that contains the ontology\",\n type: \"string\",\n demandOption: false,\n conflicts: \"ontologyPath\",\n implies: \"clientId\",\n alias: \"stack\" // for backwards compatibility\n },\n clientId: {\n description: \"OAuth client ID for application\",\n type: \"string\",\n demandOption: false,\n conflicts: \"ontologyPath\",\n implies: \"foundryUrl\"\n },\n 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([\"foundryUrl\", \"clientId\", \"outDir\", \"ontologyWritePath\", \"version\"], \"OR Generate from Foundry\").check(args => {\n if (!args.ontologyPath && !args.foundryUrl) {\n throw new YargsCheckError(\"Must specify either ontologyPath or foundryUrl and clientId\");\n }\n if (args.version !== \"dev\" && !isValidSemver(args.version)) {\n throw new YargsCheckError(\"Version must be 'dev' or a valid semver version\");\n }\n 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,5 +1,5 @@
1
1
  import { isValidSemver } from './chunk-GX2IOTA6.mjs';
2
- import { loadToken, createInternalClientContext, createConjureContext, artifacts_exports, third_party_application_service_exports, ArtifactsSitesAdminV2Service_exports } from './chunk-EZIJJWAA.mjs';
2
+ import { loadToken, createInternalClientContext, createConjureContext, artifacts_exports, third_party_application_service_exports, ArtifactsSitesAdminV2Service_exports } from './chunk-UUMRUSW7.mjs';
3
3
  import { ExitProcessError } from './chunk-CLAEREOL.mjs';
4
4
  import './chunk-E2SEJZTC.mjs';
5
5
  import { consola } from 'consola';
@@ -147,4 +147,4 @@ function getFirstSiteDomain(domains) {
147
147
 
148
148
  export { siteDeployCommand as default };
149
149
  //# sourceMappingURL=out.js.map
150
- //# sourceMappingURL=siteDeployCommand-7QTLGWZI.mjs.map
150
+ //# sourceMappingURL=siteDeployCommand-PEQ4IOIZ.mjs.map
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkUE2TMWJL_cjs = require('./chunk-UE2TMWJL.cjs');
4
- var chunkJFYC74FJ_cjs = require('./chunk-JFYC74FJ.cjs');
4
+ var chunkS2I3VLCY_cjs = require('./chunk-S2I3VLCY.cjs');
5
5
  var chunkHZ3XILMW_cjs = require('./chunk-HZ3XILMW.cjs');
6
6
  require('./chunk-HQDDGVB7.cjs');
7
7
  var consola = require('consola');
@@ -84,10 +84,10 @@ async function siteDeployCommand({
84
84
  token,
85
85
  tokenFile
86
86
  }) {
87
- const loadedToken = await chunkJFYC74FJ_cjs.loadToken(token, tokenFile);
87
+ const loadedToken = await chunkS2I3VLCY_cjs.loadToken(token, tokenFile);
88
88
  const tokenProvider = () => loadedToken;
89
- const clientCtx = chunkJFYC74FJ_cjs.createInternalClientContext(foundryUrl, tokenProvider);
90
- const ctx = chunkJFYC74FJ_cjs.createConjureContext(foundryUrl, "/artifacts/api", tokenProvider);
89
+ const clientCtx = chunkS2I3VLCY_cjs.createInternalClientContext(foundryUrl, tokenProvider);
90
+ const ctx = chunkS2I3VLCY_cjs.createConjureContext(foundryUrl, "/artifacts/api", tokenProvider);
91
91
  let siteVersion;
92
92
  if (typeof selectedVersion === "string") {
93
93
  siteVersion = selectedVersion;
@@ -104,18 +104,18 @@ async function siteDeployCommand({
104
104
  const archive = archiver__default.default("zip").directory(directory, false);
105
105
  logArchiveStats(archive);
106
106
  consola.consola.start("Uploading site files");
107
- await Promise.all([chunkJFYC74FJ_cjs.artifacts_exports.SiteAssetArtifactsService.uploadZippedSiteAsset(clientCtx, {
107
+ await Promise.all([chunkS2I3VLCY_cjs.artifacts_exports.SiteAssetArtifactsService.uploadZippedSiteAsset(clientCtx, {
108
108
  application,
109
109
  version: siteVersion,
110
110
  zipFile: stream.Readable.toWeb(archive)
111
111
  // This cast is because the dom fetch doesnt align type wise with streams
112
112
  }), archive.finalize()]);
113
113
  consola.consola.success("Upload complete");
114
- const repositoryRid = await chunkJFYC74FJ_cjs.third_party_application_service_exports.fetchWebsiteRepositoryRid(clientCtx, application);
115
- const registeredSiteDomains = await chunkJFYC74FJ_cjs.ArtifactsSitesAdminV2Service_exports.getRegisteredSiteDomains(ctx, repositoryRid);
114
+ const repositoryRid = await chunkS2I3VLCY_cjs.third_party_application_service_exports.fetchWebsiteRepositoryRid(clientCtx, application);
115
+ const registeredSiteDomains = await chunkS2I3VLCY_cjs.ArtifactsSitesAdminV2Service_exports.getRegisteredSiteDomains(ctx, repositoryRid);
116
116
  const domain = getFirstSiteDomain(registeredSiteDomains);
117
117
  if (!uploadOnly) {
118
- await chunkJFYC74FJ_cjs.ArtifactsSitesAdminV2Service_exports.updateDeployedVersion(ctx, repositoryRid, {
118
+ await chunkS2I3VLCY_cjs.ArtifactsSitesAdminV2Service_exports.updateDeployedVersion(ctx, repositoryRid, {
119
119
  siteVersion: {
120
120
  version: siteVersion
121
121
  }
@@ -173,4 +173,4 @@ function getFirstSiteDomain(domains) {
173
173
 
174
174
  module.exports = siteDeployCommand;
175
175
  //# sourceMappingURL=out.js.map
176
- //# sourceMappingURL=siteDeployCommand-HOXKQM56.cjs.map
176
+ //# sourceMappingURL=siteDeployCommand-XSWYJZYG.cjs.map
@@ -1,5 +1,5 @@
1
1
  import { handlePromptCancel } from './chunk-IV3QY3PZ.mjs';
2
- import { loadToken, createInternalClientContext, artifacts_exports } from './chunk-EZIJJWAA.mjs';
2
+ import { loadToken, createInternalClientContext, artifacts_exports } from './chunk-UUMRUSW7.mjs';
3
3
  import './chunk-CLAEREOL.mjs';
4
4
  import './chunk-E2SEJZTC.mjs';
5
5
  import { consola } from 'consola';
@@ -33,4 +33,4 @@ ${colorize("bold", "This action cannot be undone.")}`, {
33
33
 
34
34
  export { versionDeleteCommand as default };
35
35
  //# sourceMappingURL=out.js.map
36
- //# sourceMappingURL=versionDeleteCommand-LQRGKTMH.mjs.map
36
+ //# sourceMappingURL=versionDeleteCommand-AAP4O5ZE.mjs.map
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkDQYIDDJN_cjs = require('./chunk-DQYIDDJN.cjs');
4
- var chunkJFYC74FJ_cjs = require('./chunk-JFYC74FJ.cjs');
4
+ var chunkS2I3VLCY_cjs = require('./chunk-S2I3VLCY.cjs');
5
5
  require('./chunk-HZ3XILMW.cjs');
6
6
  require('./chunk-HQDDGVB7.cjs');
7
7
  var consola = require('consola');
@@ -23,10 +23,10 @@ ${utils.colorize("bold", "This action cannot be undone.")}`, {
23
23
  chunkDQYIDDJN_cjs.handlePromptCancel(confirmed);
24
24
  }
25
25
  consola.consola.start(`Deleting version ${version}`);
26
- const loadedToken = await chunkJFYC74FJ_cjs.loadToken(token, tokenFile);
26
+ const loadedToken = await chunkS2I3VLCY_cjs.loadToken(token, tokenFile);
27
27
  const tokenProvider = () => loadedToken;
28
- const clientCtx = chunkJFYC74FJ_cjs.createInternalClientContext(foundryUrl, tokenProvider);
29
- await chunkJFYC74FJ_cjs.artifacts_exports.SiteAssetArtifactsService.deleteSiteVersion(clientCtx, {
28
+ const clientCtx = chunkS2I3VLCY_cjs.createInternalClientContext(foundryUrl, tokenProvider);
29
+ await chunkS2I3VLCY_cjs.artifacts_exports.SiteAssetArtifactsService.deleteSiteVersion(clientCtx, {
30
30
  application,
31
31
  version
32
32
  });
@@ -35,4 +35,4 @@ ${utils.colorize("bold", "This action cannot be undone.")}`, {
35
35
 
36
36
  module.exports = versionDeleteCommand;
37
37
  //# sourceMappingURL=out.js.map
38
- //# sourceMappingURL=versionDeleteCommand-GDQEZLYA.cjs.map
38
+ //# sourceMappingURL=versionDeleteCommand-VFJ2WM7Q.cjs.map
@@ -1,4 +1,4 @@
1
- import { loadToken, createInternalClientContext, third_party_application_service_exports, createConjureContext, ArtifactsSitesAdminV2Service_exports } from './chunk-EZIJJWAA.mjs';
1
+ import { loadToken, createInternalClientContext, third_party_application_service_exports, createConjureContext, ArtifactsSitesAdminV2Service_exports } from './chunk-UUMRUSW7.mjs';
2
2
  import './chunk-CLAEREOL.mjs';
3
3
  import './chunk-E2SEJZTC.mjs';
4
4
  import { consola } from 'consola';
@@ -25,4 +25,4 @@ async function versionGetCommand({
25
25
 
26
26
  export { versionGetCommand as default };
27
27
  //# sourceMappingURL=out.js.map
28
- //# sourceMappingURL=versionGetCommand-NZAQX7U5.mjs.map
28
+ //# sourceMappingURL=versionGetCommand-3UVDIRMY.mjs.map
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkJFYC74FJ_cjs = require('./chunk-JFYC74FJ.cjs');
3
+ var chunkS2I3VLCY_cjs = require('./chunk-S2I3VLCY.cjs');
4
4
  require('./chunk-HZ3XILMW.cjs');
5
5
  require('./chunk-HQDDGVB7.cjs');
6
6
  var consola = require('consola');
@@ -11,13 +11,13 @@ async function versionGetCommand({
11
11
  token,
12
12
  tokenFile
13
13
  }) {
14
- const loadedToken = await chunkJFYC74FJ_cjs.loadToken(token, tokenFile);
14
+ const loadedToken = await chunkS2I3VLCY_cjs.loadToken(token, tokenFile);
15
15
  const tokenProvider = () => loadedToken;
16
- const clientCtx = chunkJFYC74FJ_cjs.createInternalClientContext(foundryUrl, tokenProvider);
16
+ const clientCtx = chunkS2I3VLCY_cjs.createInternalClientContext(foundryUrl, tokenProvider);
17
17
  consola.consola.start("Getting live version");
18
- const repositoryRid = await chunkJFYC74FJ_cjs.third_party_application_service_exports.fetchWebsiteRepositoryRid(clientCtx, application);
19
- const ctx = chunkJFYC74FJ_cjs.createConjureContext(foundryUrl, "/artifacts/api", tokenProvider);
20
- const deployedVersion = await chunkJFYC74FJ_cjs.ArtifactsSitesAdminV2Service_exports.getDeployedVersion(ctx, repositoryRid);
18
+ const repositoryRid = await chunkS2I3VLCY_cjs.third_party_application_service_exports.fetchWebsiteRepositoryRid(clientCtx, application);
19
+ const ctx = chunkS2I3VLCY_cjs.createConjureContext(foundryUrl, "/artifacts/api", tokenProvider);
20
+ const deployedVersion = await chunkS2I3VLCY_cjs.ArtifactsSitesAdminV2Service_exports.getDeployedVersion(ctx, repositoryRid);
21
21
  if (!deployedVersion) {
22
22
  consola.consola.info("No live site version set");
23
23
  } else {
@@ -27,4 +27,4 @@ async function versionGetCommand({
27
27
 
28
28
  module.exports = versionGetCommand;
29
29
  //# sourceMappingURL=out.js.map
30
- //# sourceMappingURL=versionGetCommand-RU5LS3IG.cjs.map
30
+ //# sourceMappingURL=versionGetCommand-JASRA4QL.cjs.map
@@ -1,4 +1,4 @@
1
- import { loadToken, createInternalClientContext, third_party_application_service_exports, createConjureContext, artifacts_exports, ArtifactsSitesAdminV2Service_exports } from './chunk-EZIJJWAA.mjs';
1
+ import { loadToken, createInternalClientContext, third_party_application_service_exports, createConjureContext, artifacts_exports, ArtifactsSitesAdminV2Service_exports } from './chunk-UUMRUSW7.mjs';
2
2
  import './chunk-CLAEREOL.mjs';
3
3
  import './chunk-E2SEJZTC.mjs';
4
4
  import { consola } from 'consola';
@@ -31,4 +31,4 @@ async function versionListCommand({
31
31
 
32
32
  export { versionListCommand as default };
33
33
  //# sourceMappingURL=out.js.map
34
- //# sourceMappingURL=versionListCommand-5N57YKEQ.mjs.map
34
+ //# sourceMappingURL=versionListCommand-AGCM7LFR.mjs.map
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkJFYC74FJ_cjs = require('./chunk-JFYC74FJ.cjs');
3
+ var chunkS2I3VLCY_cjs = require('./chunk-S2I3VLCY.cjs');
4
4
  require('./chunk-HZ3XILMW.cjs');
5
5
  require('./chunk-HQDDGVB7.cjs');
6
6
  var consola = require('consola');
@@ -12,13 +12,13 @@ async function versionListCommand({
12
12
  token,
13
13
  tokenFile
14
14
  }) {
15
- const loadedToken = await chunkJFYC74FJ_cjs.loadToken(token, tokenFile);
15
+ const loadedToken = await chunkS2I3VLCY_cjs.loadToken(token, tokenFile);
16
16
  const tokenProvider = () => loadedToken;
17
- const clientCtx = chunkJFYC74FJ_cjs.createInternalClientContext(foundryUrl, tokenProvider);
17
+ const clientCtx = chunkS2I3VLCY_cjs.createInternalClientContext(foundryUrl, tokenProvider);
18
18
  consola.consola.start("Fetching versions & deployed version");
19
- const repositoryRid = await chunkJFYC74FJ_cjs.third_party_application_service_exports.fetchWebsiteRepositoryRid(clientCtx, application);
20
- const ctx = chunkJFYC74FJ_cjs.createConjureContext(foundryUrl, "/artifacts/api", tokenProvider);
21
- const [versions, deployedVersion] = await Promise.all([chunkJFYC74FJ_cjs.artifacts_exports.SiteAssetArtifactsService.fetchSiteVersions(clientCtx, application), chunkJFYC74FJ_cjs.ArtifactsSitesAdminV2Service_exports.getDeployedVersion(ctx, repositoryRid)]);
19
+ const repositoryRid = await chunkS2I3VLCY_cjs.third_party_application_service_exports.fetchWebsiteRepositoryRid(clientCtx, application);
20
+ const ctx = chunkS2I3VLCY_cjs.createConjureContext(foundryUrl, "/artifacts/api", tokenProvider);
21
+ const [versions, deployedVersion] = await Promise.all([chunkS2I3VLCY_cjs.artifacts_exports.SiteAssetArtifactsService.fetchSiteVersions(clientCtx, application), chunkS2I3VLCY_cjs.ArtifactsSitesAdminV2Service_exports.getDeployedVersion(ctx, repositoryRid)]);
22
22
  if (versions.length === 0) {
23
23
  consola.consola.warn("Successfully connected to server, but no versions were found.");
24
24
  return;
@@ -33,4 +33,4 @@ async function versionListCommand({
33
33
 
34
34
  module.exports = versionListCommand;
35
35
  //# sourceMappingURL=out.js.map
36
- //# sourceMappingURL=versionListCommand-QYCTS6KU.cjs.map
36
+ //# sourceMappingURL=versionListCommand-DANLZEEE.cjs.map
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkJFYC74FJ_cjs = require('./chunk-JFYC74FJ.cjs');
3
+ var chunkS2I3VLCY_cjs = require('./chunk-S2I3VLCY.cjs');
4
4
  require('./chunk-HZ3XILMW.cjs');
5
5
  require('./chunk-HQDDGVB7.cjs');
6
6
  var consola = require('consola');
@@ -13,13 +13,13 @@ async function versionSetCommand({
13
13
  tokenFile
14
14
  }) {
15
15
  consola.consola.start(`Setting live version`);
16
- const loadedToken = await chunkJFYC74FJ_cjs.loadToken(token, tokenFile);
16
+ const loadedToken = await chunkS2I3VLCY_cjs.loadToken(token, tokenFile);
17
17
  const tokenProvider = () => loadedToken;
18
- const clientCtx = chunkJFYC74FJ_cjs.createInternalClientContext(foundryUrl, tokenProvider);
19
- const repositoryRid = await chunkJFYC74FJ_cjs.third_party_application_service_exports.fetchWebsiteRepositoryRid(clientCtx, application);
20
- const ctx = chunkJFYC74FJ_cjs.createConjureContext(foundryUrl, "/artifacts/api", tokenProvider);
18
+ const clientCtx = chunkS2I3VLCY_cjs.createInternalClientContext(foundryUrl, tokenProvider);
19
+ const repositoryRid = await chunkS2I3VLCY_cjs.third_party_application_service_exports.fetchWebsiteRepositoryRid(clientCtx, application);
20
+ const ctx = chunkS2I3VLCY_cjs.createConjureContext(foundryUrl, "/artifacts/api", tokenProvider);
21
21
  if (version) {
22
- await chunkJFYC74FJ_cjs.ArtifactsSitesAdminV2Service_exports.updateDeployedVersion(ctx, repositoryRid, {
22
+ await chunkS2I3VLCY_cjs.ArtifactsSitesAdminV2Service_exports.updateDeployedVersion(ctx, repositoryRid, {
23
23
  siteVersion: {
24
24
  version
25
25
  }
@@ -30,4 +30,4 @@ async function versionSetCommand({
30
30
 
31
31
  module.exports = versionSetCommand;
32
32
  //# sourceMappingURL=out.js.map
33
- //# sourceMappingURL=versionSetCommand-K4SDBPLB.cjs.map
33
+ //# sourceMappingURL=versionSetCommand-K3IPOA5G.cjs.map
@@ -1,4 +1,4 @@
1
- import { loadToken, createInternalClientContext, third_party_application_service_exports, createConjureContext, ArtifactsSitesAdminV2Service_exports } from './chunk-EZIJJWAA.mjs';
1
+ import { loadToken, createInternalClientContext, third_party_application_service_exports, createConjureContext, ArtifactsSitesAdminV2Service_exports } from './chunk-UUMRUSW7.mjs';
2
2
  import './chunk-CLAEREOL.mjs';
3
3
  import './chunk-E2SEJZTC.mjs';
4
4
  import { consola } from 'consola';
@@ -28,4 +28,4 @@ async function versionSetCommand({
28
28
 
29
29
  export { versionSetCommand as default };
30
30
  //# sourceMappingURL=out.js.map
31
- //# sourceMappingURL=versionSetCommand-UWPAQ7NV.mjs.map
31
+ //# sourceMappingURL=versionSetCommand-UT4LAKJO.mjs.map