@osdk/cli 0.5.0 → 0.7.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 (116) hide show
  1. package/build/js/{chunk-GTNZA5UY.mjs → chunk-CLAEREOL.mjs} +4 -2
  2. package/build/js/chunk-CLAEREOL.mjs.map +1 -0
  3. package/build/js/chunk-DQYIDDJN.cjs +17 -0
  4. package/build/js/chunk-DQYIDDJN.cjs.map +1 -0
  5. package/build/js/{chunk-XNYKWAIE.mjs → chunk-EZIJJWAA.mjs} +35 -16
  6. package/build/js/chunk-EZIJJWAA.mjs.map +1 -0
  7. package/build/js/chunk-GX2IOTA6.mjs +10 -0
  8. package/build/js/{chunk-N6K26UR4.mjs.map → chunk-GX2IOTA6.mjs.map} +1 -1
  9. package/build/js/{chunk-JFDXL5SV.mjs → chunk-HD6SVFKA.mjs} +5 -5
  10. package/build/js/chunk-HD6SVFKA.mjs.map +1 -0
  11. package/build/js/{chunk-HYF3CTKZ.cjs → chunk-HZ3XILMW.cjs} +4 -2
  12. package/build/js/chunk-HZ3XILMW.cjs.map +1 -0
  13. package/build/js/chunk-IV3QY3PZ.mjs +15 -0
  14. package/build/js/chunk-IV3QY3PZ.mjs.map +1 -0
  15. package/build/js/{chunk-D7QHLGEU.cjs → chunk-JFYC74FJ.cjs} +41 -22
  16. package/build/js/chunk-JFYC74FJ.cjs.map +1 -0
  17. package/build/js/{chunk-2DZBTS5E.cjs → chunk-TZGNA5WR.cjs} +5 -5
  18. package/build/js/chunk-TZGNA5WR.cjs.map +1 -0
  19. package/build/js/chunk-UE2TMWJL.cjs +12 -0
  20. package/build/js/{chunk-X2S4O5ZR.cjs.map → chunk-UE2TMWJL.cjs.map} +1 -1
  21. package/build/js/{handleGenerate-Q6EQWXFG.cjs → handleGenerate-GBN42PDO.cjs} +11 -11
  22. package/build/js/handleGenerate-GBN42PDO.cjs.map +1 -0
  23. package/build/js/{handleGenerate-ZUZV3IBI.mjs → handleGenerate-NQPMMKLX.mjs} +10 -10
  24. package/build/js/handleGenerate-NQPMMKLX.mjs.map +1 -0
  25. package/build/js/index.cjs +99 -55
  26. package/build/js/index.cjs.map +1 -1
  27. package/build/js/index.mjs +95 -51
  28. package/build/js/index.mjs.map +1 -1
  29. package/build/js/loginFlow-5ZAMXQKE.cjs +10 -0
  30. package/build/js/loginFlow-BWWZBM36.mjs +4 -0
  31. package/build/js/siteDeployCommand-7QTLGWZI.mjs +150 -0
  32. package/build/js/siteDeployCommand-7QTLGWZI.mjs.map +1 -0
  33. package/build/js/siteDeployCommand-HOXKQM56.cjs +176 -0
  34. package/build/js/siteDeployCommand-HOXKQM56.cjs.map +1 -0
  35. package/build/js/versionDeleteCommand-GDQEZLYA.cjs +38 -0
  36. package/build/js/versionDeleteCommand-GDQEZLYA.cjs.map +1 -0
  37. package/build/js/{versionDeleteCommand-6BJL5XLG.mjs → versionDeleteCommand-LQRGKTMH.mjs} +13 -3
  38. package/build/js/versionDeleteCommand-LQRGKTMH.mjs.map +1 -0
  39. package/build/js/{versionGetCommand-OR4RLOLM.mjs → versionGetCommand-NZAQX7U5.mjs} +3 -3
  40. package/build/js/{versionGetCommand-Y2VR2WKH.cjs → versionGetCommand-RU5LS3IG.cjs} +8 -8
  41. package/build/js/{versionListCommand-LPPGQCQF.mjs → versionListCommand-5N57YKEQ.mjs} +6 -4
  42. package/build/js/versionListCommand-5N57YKEQ.mjs.map +1 -0
  43. package/build/js/{versionListCommand-5KM5PFYL.cjs → versionListCommand-QYCTS6KU.cjs} +11 -9
  44. package/build/js/versionListCommand-QYCTS6KU.cjs.map +1 -0
  45. package/build/js/{versionSetCommand-VD3L5DOV.cjs → versionSetCommand-K4SDBPLB.cjs} +8 -8
  46. package/build/js/{versionSetCommand-LHOVVI6U.mjs → versionSetCommand-UWPAQ7NV.mjs} +3 -3
  47. package/build/js/versionUnsetCommand-INDJ26MO.cjs +36 -0
  48. package/build/js/versionUnsetCommand-INDJ26MO.cjs.map +1 -0
  49. package/build/js/{versionUnsetCommand-IJT4JWBN.mjs → versionUnsetCommand-PZRZPTPR.mjs} +13 -3
  50. package/build/js/versionUnsetCommand-PZRZPTPR.mjs.map +1 -0
  51. package/build/types/ExitProcessError.d.ts +3 -1
  52. package/build/types/commands/auth/CommonAuthArgs.d.ts +1 -1
  53. package/build/types/commands/auth/login/LoginArgs.d.ts +1 -1
  54. package/build/types/commands/site/deploy/SiteDeployArgs.d.ts +2 -1
  55. package/build/types/commands/site/deploy/siteDeployCommand.d.mts +8 -1
  56. package/build/types/commands/site/version/delete/VersionDeleteArgs.d.ts +5 -0
  57. package/build/types/commands/site/version/delete/index.d.ts +2 -2
  58. package/build/types/commands/site/version/delete/versionDeleteCommand.d.mts +2 -2
  59. package/build/types/commands/site/version/get/VersionGetArgs.d.ts +3 -0
  60. package/build/types/commands/site/version/get/index.d.ts +2 -1
  61. package/build/types/commands/site/version/get/versionGetCommand.d.mts +2 -2
  62. package/build/types/commands/site/version/list/VersionListArgs.d.ts +3 -0
  63. package/build/types/commands/site/version/list/index.d.ts +2 -1
  64. package/build/types/commands/site/version/list/versionListCommand.d.mts +2 -2
  65. package/build/types/commands/site/version/set/VersionSetArgs.d.ts +4 -0
  66. package/build/types/commands/site/version/set/index.d.ts +2 -2
  67. package/build/types/commands/site/version/set/versionSetCommand.d.mts +2 -2
  68. package/build/types/commands/site/version/unset/VersionUnsetArgs.d.ts +4 -0
  69. package/build/types/commands/site/version/unset/index.d.ts +2 -1
  70. package/build/types/commands/site/version/unset/versionUnsetCommand.d.mts +2 -2
  71. package/build/types/commands/typescript/generate/TypescriptGenerateArgs.d.ts +1 -1
  72. package/build/types/consola/handlePromptCancel.d.ts +1 -0
  73. package/build/types/net/UserAgent.d.ts +1 -0
  74. package/build/types/net/index.d.mts +1 -0
  75. package/build/types/util/config.d.ts +2 -2
  76. package/build/types/util/token.d.ts +2 -2
  77. package/changelog/0.6.0/pr-54.v2.yml +5 -0
  78. package/changelog/0.6.0/pr-56.v2.yml +5 -0
  79. package/changelog/0.6.0/pr-58.v2.yml +5 -0
  80. package/changelog/0.7.0/pr-50.v2.yml +5 -0
  81. package/changelog/0.7.0/pr-52.v2.yml +5 -0
  82. package/changelog/0.7.0/pr-55.v2.yml +5 -0
  83. package/changelog/0.7.0/pr-61.v2.yml +5 -0
  84. package/changelog/0.7.0/pr-63.v2.yml +5 -0
  85. package/package.json +9 -3
  86. package/build/js/chunk-2DZBTS5E.cjs.map +0 -1
  87. package/build/js/chunk-D7QHLGEU.cjs.map +0 -1
  88. package/build/js/chunk-GTNZA5UY.mjs.map +0 -1
  89. package/build/js/chunk-HYF3CTKZ.cjs.map +0 -1
  90. package/build/js/chunk-JFDXL5SV.mjs.map +0 -1
  91. package/build/js/chunk-N6K26UR4.mjs +0 -9
  92. package/build/js/chunk-X2S4O5ZR.cjs +0 -11
  93. package/build/js/chunk-XNYKWAIE.mjs.map +0 -1
  94. package/build/js/handleGenerate-Q6EQWXFG.cjs.map +0 -1
  95. package/build/js/handleGenerate-ZUZV3IBI.mjs.map +0 -1
  96. package/build/js/loginFlow-BZDDHHT5.cjs +0 -10
  97. package/build/js/loginFlow-KGLTXVZ6.mjs +0 -4
  98. package/build/js/siteDeployCommand-7GXJF5HF.mjs +0 -100
  99. package/build/js/siteDeployCommand-7GXJF5HF.mjs.map +0 -1
  100. package/build/js/siteDeployCommand-KUNL3GIW.cjs +0 -126
  101. package/build/js/siteDeployCommand-KUNL3GIW.cjs.map +0 -1
  102. package/build/js/versionDeleteCommand-6BJL5XLG.mjs.map +0 -1
  103. package/build/js/versionDeleteCommand-RLU7UUYD.cjs +0 -28
  104. package/build/js/versionDeleteCommand-RLU7UUYD.cjs.map +0 -1
  105. package/build/js/versionListCommand-5KM5PFYL.cjs.map +0 -1
  106. package/build/js/versionListCommand-LPPGQCQF.mjs.map +0 -1
  107. package/build/js/versionUnsetCommand-IJT4JWBN.mjs.map +0 -1
  108. package/build/js/versionUnsetCommand-XYBUQ6XB.cjs +0 -26
  109. package/build/js/versionUnsetCommand-XYBUQ6XB.cjs.map +0 -1
  110. package/build/types/commands/site/version/SiteVersionArgs.d.ts +0 -4
  111. /package/build/js/{loginFlow-BZDDHHT5.cjs.map → loginFlow-5ZAMXQKE.cjs.map} +0 -0
  112. /package/build/js/{loginFlow-KGLTXVZ6.mjs.map → loginFlow-BWWZBM36.mjs.map} +0 -0
  113. /package/build/js/{versionGetCommand-OR4RLOLM.mjs.map → versionGetCommand-NZAQX7U5.mjs.map} +0 -0
  114. /package/build/js/{versionGetCommand-Y2VR2WKH.cjs.map → versionGetCommand-RU5LS3IG.cjs.map} +0 -0
  115. /package/build/js/{versionSetCommand-LHOVVI6U.mjs.map → versionSetCommand-K4SDBPLB.cjs.map} +0 -0
  116. /package/build/js/{versionSetCommand-VD3L5DOV.cjs.map → versionSetCommand-UWPAQ7NV.mjs.map} +0 -0
@@ -1,126 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkX2S4O5ZR_cjs = require('./chunk-X2S4O5ZR.cjs');
4
- var chunkD7QHLGEU_cjs = require('./chunk-D7QHLGEU.cjs');
5
- var chunkHYF3CTKZ_cjs = require('./chunk-HYF3CTKZ.cjs');
6
- require('./chunk-HQDDGVB7.cjs');
7
- var consola = require('consola');
8
- var archiver = require('archiver');
9
- var fs = require('fs');
10
- var path = require('path');
11
- var stream = require('stream');
12
- var child_process = require('child_process');
13
-
14
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
15
-
16
- function _interopNamespace(e) {
17
- if (e && e.__esModule) return e;
18
- var n = Object.create(null);
19
- if (e) {
20
- Object.keys(e).forEach(function (k) {
21
- if (k !== 'default') {
22
- var d = Object.getOwnPropertyDescriptor(e, k);
23
- Object.defineProperty(n, k, d.get ? d : {
24
- enumerable: true,
25
- get: function () { return e[k]; }
26
- });
27
- }
28
- });
29
- }
30
- n.default = e;
31
- return Object.freeze(n);
32
- }
33
-
34
- var archiver__default = /*#__PURE__*/_interopDefault(archiver);
35
- var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
36
- var path__default = /*#__PURE__*/_interopDefault(path);
37
-
38
- async function autoVersion(tagPrefix = "") {
39
- const [matchPrefix, prefixRegex] = tagPrefix !== "" ? [tagPrefix, new RegExp(`^${tagPrefix}`)] : [void 0, new RegExp(`^v?`)];
40
- try {
41
- const gitVersion = child_process.execSync(`git describe --tags --first-parent --dirty${matchPrefix != null ? ` --match="${matchPrefix}*"` : ""}`, {
42
- encoding: "utf8"
43
- });
44
- const version = gitVersion.trim().replace(prefixRegex, "");
45
- if (!chunkX2S4O5ZR_cjs.isValidSemver(version)) {
46
- throw new chunkHYF3CTKZ_cjs.ExitProcessError(2, `The version string ${version} is not SemVer compliant.`);
47
- }
48
- return version;
49
- } catch (error) {
50
- throw new chunkHYF3CTKZ_cjs.ExitProcessError(2, `Unable to determine the version automatically. Please supply a --version argument. ${error}`);
51
- }
52
- }
53
-
54
- // src/commands/site/deploy/siteDeployCommand.mts
55
- async function siteDeployCommand({
56
- version,
57
- application,
58
- foundryUrl,
59
- autoVersion: autoVersion2,
60
- gitTagPrefix,
61
- uploadOnly,
62
- directory,
63
- token,
64
- tokenFile
65
- }) {
66
- if (version == null && autoVersion2 == null) {
67
- throw new Error("Either version or autoVersion must be specified");
68
- }
69
- const loadedToken = await chunkD7QHLGEU_cjs.loadToken(token, tokenFile);
70
- let siteVersion;
71
- if (version != null) {
72
- siteVersion = version;
73
- } else {
74
- siteVersion = await autoVersion(gitTagPrefix);
75
- consola.consola.info(`Auto version inferred next version to be: ${siteVersion}`);
76
- }
77
- consola.consola.debug(`Using directory for site files: "${path__default.default.resolve(directory)}`);
78
- const stat = await fs__namespace.promises.stat(directory);
79
- if (!stat.isDirectory()) {
80
- throw new chunkHYF3CTKZ_cjs.ExitProcessError(2, "Specified path exists but is not a directory");
81
- }
82
- consola.consola.start("Zipping site files");
83
- const archive = archiver__default.default("zip").directory(directory, false);
84
- logArchiveStats(archive);
85
- consola.consola.start("Uploading site files");
86
- const tokenProvider = () => loadedToken;
87
- const clientCtx = chunkD7QHLGEU_cjs.createInternalClientContext(foundryUrl, tokenProvider);
88
- await Promise.all([chunkD7QHLGEU_cjs.artifacts_exports.SiteAssetArtifactsService.uploadZippedSiteAsset(clientCtx, {
89
- application,
90
- version: siteVersion,
91
- zipFile: stream.Readable.toWeb(archive)
92
- // This cast is because the dom fetch doesnt align type wise with streams
93
- }), archive.finalize()]);
94
- consola.consola.success("Upload complete");
95
- if (!uploadOnly) {
96
- const repositoryRid = await chunkD7QHLGEU_cjs.third_party_application_service_exports.fetchWebsiteRepositoryRid(clientCtx, application);
97
- const ctx = chunkD7QHLGEU_cjs.createConjureContext(foundryUrl, "/artifacts/api", tokenProvider);
98
- await chunkD7QHLGEU_cjs.ArtifactsSitesAdminV2Service_exports.updateDeployedVersion(ctx, repositoryRid, {
99
- siteVersion: {
100
- version: siteVersion
101
- }
102
- });
103
- consola.consola.success(`Deployed ${siteVersion} successfully`);
104
- } else {
105
- consola.consola.debug("Upload only mode enabled, skipping deployment");
106
- }
107
- }
108
- function logArchiveStats(archive) {
109
- let archiveStats = {
110
- fileCount: 0,
111
- bytes: 0
112
- };
113
- archive.on("progress", (progress) => {
114
- archiveStats = {
115
- fileCount: progress.entries.total,
116
- bytes: progress.fs.totalBytes
117
- };
118
- });
119
- archive.on("finish", () => {
120
- consola.consola.debug(`Zipped ${archiveStats.fileCount} files and ${archiveStats.bytes} bytes`);
121
- });
122
- }
123
-
124
- module.exports = siteDeployCommand;
125
- //# sourceMappingURL=out.js.map
126
- //# sourceMappingURL=siteDeployCommand-KUNL3GIW.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/commands/site/deploy/siteDeployCommand.mts","../../src/util/autoVersion.ts"],"names":["autoVersion"],"mappings":"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","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nimport { artifacts, ArtifactsSitesAdminV2Service, createConjureContext, createInternalClientContext, thirdPartyApplicationService } from \"#net\";\nimport archiver from \"archiver\";\nimport * as fs from \"node:fs\";\nimport path from \"node:path\";\nimport { Readable } from \"node:stream\";\nimport { ExitProcessError } from \"../../../ExitProcessError.js\";\nimport { autoVersion as findAutoVersion } from \"../../../util/autoVersion.js\";\nimport { loadToken } from \"../../../util/token.js\";\nexport default async function siteDeployCommand({\n version,\n application,\n foundryUrl,\n autoVersion,\n gitTagPrefix,\n uploadOnly,\n directory,\n token,\n tokenFile\n}) {\n if (version == null && autoVersion == null) {\n throw new Error(\"Either version or autoVersion must be specified\");\n }\n const loadedToken = await loadToken(token, tokenFile);\n\n // version has a priority over autoVersion. Both could be defined at the same time when\n // autoVersion is present in the config file (it assigns that as a default value to argv.autoVersion)\n // and --version is passed as an argument\n let siteVersion;\n if (version != null) {\n siteVersion = version;\n } else {\n siteVersion = await findAutoVersion(gitTagPrefix);\n consola.info(`Auto version inferred next version to be: ${siteVersion}`);\n }\n consola.debug(`Using directory for site files: \"${path.resolve(directory)}`);\n const stat = await fs.promises.stat(directory);\n if (!stat.isDirectory()) {\n throw new ExitProcessError(2, \"Specified path exists but is not a directory\");\n }\n consola.start(\"Zipping site files\");\n const archive = archiver(\"zip\").directory(directory, false);\n logArchiveStats(archive);\n consola.start(\"Uploading site files\");\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n await Promise.all([artifacts.SiteAssetArtifactsService.uploadZippedSiteAsset(clientCtx, {\n application,\n version: siteVersion,\n zipFile: Readable.toWeb(archive) // This cast is because the dom fetch doesnt align type wise with streams\n }), archive.finalize()]);\n consola.success(\"Upload complete\");\n if (!uploadOnly) {\n const repositoryRid = await thirdPartyApplicationService.fetchWebsiteRepositoryRid(clientCtx, application);\n const ctx = createConjureContext(foundryUrl, \"/artifacts/api\", tokenProvider);\n await ArtifactsSitesAdminV2Service.updateDeployedVersion(ctx, repositoryRid, {\n siteVersion: {\n version: siteVersion\n }\n });\n consola.success(`Deployed ${siteVersion} successfully`);\n } else {\n consola.debug(\"Upload only mode enabled, skipping deployment\");\n }\n}\nfunction logArchiveStats(archive) {\n let archiveStats = {\n fileCount: 0,\n bytes: 0\n };\n archive.on(\"progress\", progress => {\n archiveStats = {\n fileCount: progress.entries.total,\n bytes: progress.fs.totalBytes\n };\n });\n archive.on(\"finish\", () => {\n consola.debug(`Zipped ${archiveStats.fileCount} files and ${archiveStats.bytes} bytes`);\n });\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { execSync } from \"node:child_process\";\nimport { ExitProcessError } from \"../ExitProcessError.js\";\nimport { isValidSemver } from \"./isValidSemver.js\";\n\n/**\n * Gets the version string using git describe. If the @param tagPrefix is empty, git describe will return the\n * latest tag (without any filtering) and if the tag starts with \"v\", it will be removed.\n * @param tagPrefix The prefix to use for matching against tags. Defaults to an empty string.\n * @returns A promise that resolves to the version string.\n * @throws An error if the version string is not SemVer compliant or if the version cannot be determined.\n */\nexport async function autoVersion(tagPrefix = \"\") {\n const [matchPrefix, prefixRegex] = tagPrefix !== \"\" ? [tagPrefix, new RegExp(`^${tagPrefix}`)] : [undefined, new RegExp(`^v?`)];\n try {\n const gitVersion = execSync(`git describe --tags --first-parent --dirty${matchPrefix != null ? ` --match=\"${matchPrefix}*\"` : \"\"}`, {\n encoding: \"utf8\"\n });\n const version = gitVersion.trim().replace(prefixRegex, \"\");\n if (!isValidSemver(version)) {\n throw new ExitProcessError(2, `The version string ${version} is not SemVer compliant.`);\n }\n return version;\n } catch (error) {\n throw new ExitProcessError(2, `Unable to determine the version automatically. Please supply a --version argument. ${error}`);\n }\n}"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/commands/site/version/delete/versionDeleteCommand.mts"],"names":[],"mappings":";;;;;;;;;AAiBA,SAAS,eAAe;AAExB,eAAO,qBAA4C;AAAA,EACjD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,UAAQ,MAAM,oBAAoB,OAAO,EAAE;AAC3C,QAAM,cAAc,MAAM,UAAU,OAAO,SAAS;AACpD,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,QAAM,kBAAU,0BAA0B,kBAAkB,WAAW;AAAA,IACrE;AAAA,IACA;AAAA,EACF,CAAC;AACD,UAAQ,QAAQ,mBAAmB,OAAO,EAAE;AAC9C","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { artifacts, createInternalClientContext } from \"#net\";\nimport { consola } from \"consola\";\nimport { loadToken } from \"../../../../util/token.js\";\nexport default async function versionDeleteCommand({\n version,\n application,\n foundryUrl,\n token,\n tokenFile\n}) {\n consola.start(`Deleting version ${version}`);\n const loadedToken = await loadToken(token, tokenFile);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n await artifacts.SiteAssetArtifactsService.deleteSiteVersion(clientCtx, {\n application,\n version\n });\n consola.success(`Deleted version ${version}`);\n}"]}
@@ -1,28 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkD7QHLGEU_cjs = require('./chunk-D7QHLGEU.cjs');
4
- require('./chunk-HYF3CTKZ.cjs');
5
- require('./chunk-HQDDGVB7.cjs');
6
- var consola = require('consola');
7
-
8
- async function versionDeleteCommand({
9
- version,
10
- application,
11
- foundryUrl,
12
- token,
13
- tokenFile
14
- }) {
15
- consola.consola.start(`Deleting version ${version}`);
16
- const loadedToken = await chunkD7QHLGEU_cjs.loadToken(token, tokenFile);
17
- const tokenProvider = () => loadedToken;
18
- const clientCtx = chunkD7QHLGEU_cjs.createInternalClientContext(foundryUrl, tokenProvider);
19
- await chunkD7QHLGEU_cjs.artifacts_exports.SiteAssetArtifactsService.deleteSiteVersion(clientCtx, {
20
- application,
21
- version
22
- });
23
- consola.consola.success(`Deleted version ${version}`);
24
- }
25
-
26
- module.exports = versionDeleteCommand;
27
- //# sourceMappingURL=out.js.map
28
- //# sourceMappingURL=versionDeleteCommand-RLU7UUYD.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/commands/site/version/delete/versionDeleteCommand.mts"],"names":[],"mappings":";;;;;;;;;AAiBA,SAAS,eAAe;AAExB,eAAO,qBAA4C;AAAA,EACjD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,UAAQ,MAAM,oBAAoB,OAAO,EAAE;AAC3C,QAAM,cAAc,MAAM,UAAU,OAAO,SAAS;AACpD,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,QAAM,kBAAU,0BAA0B,kBAAkB,WAAW;AAAA,IACrE;AAAA,IACA;AAAA,EACF,CAAC;AACD,UAAQ,QAAQ,mBAAmB,OAAO,EAAE;AAC9C","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { artifacts, createInternalClientContext } from \"#net\";\nimport { consola } from \"consola\";\nimport { loadToken } from \"../../../../util/token.js\";\nexport default async function versionDeleteCommand({\n version,\n application,\n foundryUrl,\n token,\n tokenFile\n}) {\n consola.start(`Deleting version ${version}`);\n const loadedToken = await loadToken(token, tokenFile);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n await artifacts.SiteAssetArtifactsService.deleteSiteVersion(clientCtx, {\n application,\n version\n });\n consola.success(`Deleted version ${version}`);\n}"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/commands/site/version/list/versionListCommand.mts"],"names":[],"mappings":";;;;;;;;;;;;AAiBA,SAAS,eAAe;AACxB,SAAS,gBAAgB;AAEzB,eAAO,mBAA0C;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,QAAM,cAAc,MAAM,UAAU,OAAO,SAAS;AACpD,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,UAAQ,MAAM,sCAAsC;AACpD,QAAM,gBAAgB,MAAM,wCAA6B,0BAA0B,WAAW,WAAW;AACzG,QAAM,MAAM,qBAAqB,YAAY,kBAAkB,aAAa;AAC5E,QAAM,CAAC,UAAU,eAAe,IAAI,MAAM,QAAQ,IAAI,CAAC,kBAAU,0BAA0B,kBAAkB,WAAW,WAAW,GAAG,qCAA6B,mBAAmB,KAAK,aAAa,CAAC,CAAC;AAC1M,MAAI,SAAS,WAAW,GAAG;AACzB,YAAQ,KAAK,+DAA+D;AAC5E;AAAA,EACF;AACA,UAAQ,QAAQ,iBAAiB;AACjC,aAAW,WAAW,UAAU;AAC9B,YAAQ,IAAI,SAAS,OAAO,GAAG,mBAAmB,YAAY,gBAAgB,UAAU,SAAS,SAAS,aAAa,IAAI,EAAE,EAAE;AAAA,EACjI;AACF","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { artifacts, ArtifactsSitesAdminV2Service, createConjureContext, createInternalClientContext, thirdPartyApplicationService } from \"#net\";\nimport { consola } from \"consola\";\nimport { colorize } from \"consola/utils\";\nimport { loadToken } from \"../../../../util/token.js\";\nexport default async function versionListCommand({\n foundryUrl,\n application,\n token,\n tokenFile\n}) {\n const loadedToken = await loadToken(token, tokenFile);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n consola.start(\"Fetching versions & deployed version\");\n const repositoryRid = await thirdPartyApplicationService.fetchWebsiteRepositoryRid(clientCtx, application);\n const ctx = createConjureContext(foundryUrl, \"/artifacts/api\", tokenProvider);\n const [versions, deployedVersion] = await Promise.all([artifacts.SiteAssetArtifactsService.fetchSiteVersions(clientCtx, application), ArtifactsSitesAdminV2Service.getDeployedVersion(ctx, repositoryRid)]);\n if (versions.length === 0) {\n consola.warn(\"Successfully connected to server, but no versions were found.\");\n return;\n }\n consola.success(\"Found versions:\");\n for (const version of versions) {\n consola.log(` - ${version}${deployedVersion && version === deployedVersion.version ? colorize(\"green\", ` (deployed)`) : \"\"}`);\n }\n}"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/commands/site/version/list/versionListCommand.mts"],"names":[],"mappings":";;;;;;;;;;;;AAiBA,SAAS,eAAe;AACxB,SAAS,gBAAgB;AAEzB,eAAO,mBAA0C;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,QAAM,cAAc,MAAM,UAAU,OAAO,SAAS;AACpD,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,UAAQ,MAAM,sCAAsC;AACpD,QAAM,gBAAgB,MAAM,wCAA6B,0BAA0B,WAAW,WAAW;AACzG,QAAM,MAAM,qBAAqB,YAAY,kBAAkB,aAAa;AAC5E,QAAM,CAAC,UAAU,eAAe,IAAI,MAAM,QAAQ,IAAI,CAAC,kBAAU,0BAA0B,kBAAkB,WAAW,WAAW,GAAG,qCAA6B,mBAAmB,KAAK,aAAa,CAAC,CAAC;AAC1M,MAAI,SAAS,WAAW,GAAG;AACzB,YAAQ,KAAK,+DAA+D;AAC5E;AAAA,EACF;AACA,UAAQ,QAAQ,iBAAiB;AACjC,aAAW,WAAW,UAAU;AAC9B,YAAQ,IAAI,SAAS,OAAO,GAAG,mBAAmB,YAAY,gBAAgB,UAAU,SAAS,SAAS,aAAa,IAAI,EAAE,EAAE;AAAA,EACjI;AACF","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { artifacts, ArtifactsSitesAdminV2Service, createConjureContext, createInternalClientContext, thirdPartyApplicationService } from \"#net\";\nimport { consola } from \"consola\";\nimport { colorize } from \"consola/utils\";\nimport { loadToken } from \"../../../../util/token.js\";\nexport default async function versionListCommand({\n foundryUrl,\n application,\n token,\n tokenFile\n}) {\n const loadedToken = await loadToken(token, tokenFile);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n consola.start(\"Fetching versions & deployed version\");\n const repositoryRid = await thirdPartyApplicationService.fetchWebsiteRepositoryRid(clientCtx, application);\n const ctx = createConjureContext(foundryUrl, \"/artifacts/api\", tokenProvider);\n const [versions, deployedVersion] = await Promise.all([artifacts.SiteAssetArtifactsService.fetchSiteVersions(clientCtx, application), ArtifactsSitesAdminV2Service.getDeployedVersion(ctx, repositoryRid)]);\n if (versions.length === 0) {\n consola.warn(\"Successfully connected to server, but no versions were found.\");\n return;\n }\n consola.success(\"Found versions:\");\n for (const version of versions) {\n consola.log(` - ${version}${deployedVersion && version === deployedVersion.version ? colorize(\"green\", ` (deployed)`) : \"\"}`);\n }\n}"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/commands/site/version/unset/versionUnsetCommand.mts"],"names":[],"mappings":";;;;;;;;;;;AAgBA,SAAS,eAAe;AAGxB,eAAO,oBAA2C;AAAA,EAChD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,QAAM,cAAc,MAAM,UAAU,OAAO,SAAS;AACpD,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,UAAQ,MAAM,4BAA4B;AAC1C,QAAM,gBAAgB,MAAM,wCAA6B,0BAA0B,WAAW,WAAW;AACzG,QAAM,MAAM,qBAAqB,YAAY,kBAAkB,aAAa;AAC5E,QAAM,qCAA6B,qBAAqB,KAAK,aAAa;AAC1E,UAAQ,QAAQ,2BAA2B;AAC7C","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 { ArtifactsSitesAdminV2Service, createConjureContext, createInternalClientContext, thirdPartyApplicationService } from \"#net\";\nimport { loadToken } from \"../../../../util/token.js\";\nexport default async function versionUnsetCommand({\n application,\n foundryUrl,\n token,\n tokenFile\n}) {\n const loadedToken = await loadToken(token, tokenFile);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n consola.start(\"Clearing live site version\");\n const repositoryRid = await thirdPartyApplicationService.fetchWebsiteRepositoryRid(clientCtx, application);\n const ctx = createConjureContext(foundryUrl, \"/artifacts/api\", tokenProvider);\n await ArtifactsSitesAdminV2Service.clearDeployedVersion(ctx, repositoryRid);\n consola.success(\"Cleared live site version\");\n}"]}
@@ -1,26 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkD7QHLGEU_cjs = require('./chunk-D7QHLGEU.cjs');
4
- require('./chunk-HYF3CTKZ.cjs');
5
- require('./chunk-HQDDGVB7.cjs');
6
- var consola = require('consola');
7
-
8
- async function versionUnsetCommand({
9
- application,
10
- foundryUrl,
11
- token,
12
- tokenFile
13
- }) {
14
- const loadedToken = await chunkD7QHLGEU_cjs.loadToken(token, tokenFile);
15
- const tokenProvider = () => loadedToken;
16
- const clientCtx = chunkD7QHLGEU_cjs.createInternalClientContext(foundryUrl, tokenProvider);
17
- consola.consola.start("Clearing live site version");
18
- const repositoryRid = await chunkD7QHLGEU_cjs.third_party_application_service_exports.fetchWebsiteRepositoryRid(clientCtx, application);
19
- const ctx = chunkD7QHLGEU_cjs.createConjureContext(foundryUrl, "/artifacts/api", tokenProvider);
20
- await chunkD7QHLGEU_cjs.ArtifactsSitesAdminV2Service_exports.clearDeployedVersion(ctx, repositoryRid);
21
- consola.consola.success("Cleared live site version");
22
- }
23
-
24
- module.exports = versionUnsetCommand;
25
- //# sourceMappingURL=out.js.map
26
- //# sourceMappingURL=versionUnsetCommand-XYBUQ6XB.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/commands/site/version/unset/versionUnsetCommand.mts"],"names":[],"mappings":";;;;;;;;;;;AAgBA,SAAS,eAAe;AAGxB,eAAO,oBAA2C;AAAA,EAChD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,QAAM,cAAc,MAAM,UAAU,OAAO,SAAS;AACpD,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,UAAQ,MAAM,4BAA4B;AAC1C,QAAM,gBAAgB,MAAM,wCAA6B,0BAA0B,WAAW,WAAW;AACzG,QAAM,MAAM,qBAAqB,YAAY,kBAAkB,aAAa;AAC5E,QAAM,qCAA6B,qBAAqB,KAAK,aAAa;AAC1E,UAAQ,QAAQ,2BAA2B;AAC7C","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 { ArtifactsSitesAdminV2Service, createConjureContext, createInternalClientContext, thirdPartyApplicationService } from \"#net\";\nimport { loadToken } from \"../../../../util/token.js\";\nexport default async function versionUnsetCommand({\n application,\n foundryUrl,\n token,\n tokenFile\n}) {\n const loadedToken = await loadToken(token, tokenFile);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n consola.start(\"Clearing live site version\");\n const repositoryRid = await thirdPartyApplicationService.fetchWebsiteRepositoryRid(clientCtx, application);\n const ctx = createConjureContext(foundryUrl, \"/artifacts/api\", tokenProvider);\n await ArtifactsSitesAdminV2Service.clearDeployedVersion(ctx, repositoryRid);\n consola.success(\"Cleared live site version\");\n}"]}
@@ -1,4 +0,0 @@
1
- import type { CommonSiteArgs } from "../CommonSiteArgs.js";
2
- export interface SiteVersionArgs extends CommonSiteArgs {
3
- version: string;
4
- }