@osdk/cli 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/js/{chunk-OOW63BC4.cjs → chunk-D7QHLGEU.cjs} +88 -24
- package/build/js/chunk-D7QHLGEU.cjs.map +1 -0
- package/build/js/chunk-N6K26UR4.mjs +9 -0
- package/build/js/chunk-N6K26UR4.mjs.map +1 -0
- package/build/js/chunk-X2S4O5ZR.cjs +11 -0
- package/build/js/chunk-X2S4O5ZR.cjs.map +1 -0
- package/build/js/{chunk-SQHFJOHN.mjs → chunk-XNYKWAIE.mjs} +84 -26
- package/build/js/chunk-XNYKWAIE.mjs.map +1 -0
- package/build/js/{handleGenerate-FCY2LRSZ.cjs → handleGenerate-Q6EQWXFG.cjs} +2 -2
- package/build/js/{handleGenerate-K6X2HG4V.mjs → handleGenerate-ZUZV3IBI.mjs} +2 -2
- package/build/js/index.cjs +322 -91
- package/build/js/index.cjs.map +1 -1
- package/build/js/index.mjs +319 -88
- package/build/js/index.mjs.map +1 -1
- package/build/js/siteDeployCommand-7GXJF5HF.mjs +100 -0
- package/build/js/siteDeployCommand-7GXJF5HF.mjs.map +1 -0
- package/build/js/siteDeployCommand-KUNL3GIW.cjs +126 -0
- package/build/js/siteDeployCommand-KUNL3GIW.cjs.map +1 -0
- package/build/js/versionDeleteCommand-6BJL5XLG.mjs +26 -0
- package/build/js/versionDeleteCommand-6BJL5XLG.mjs.map +1 -0
- package/build/js/versionDeleteCommand-RLU7UUYD.cjs +28 -0
- package/build/js/versionDeleteCommand-RLU7UUYD.cjs.map +1 -0
- package/build/js/versionGetCommand-OR4RLOLM.mjs +28 -0
- package/build/js/versionGetCommand-OR4RLOLM.mjs.map +1 -0
- package/build/js/versionGetCommand-Y2VR2WKH.cjs +30 -0
- package/build/js/versionGetCommand-Y2VR2WKH.cjs.map +1 -0
- package/build/js/versionListCommand-5KM5PFYL.cjs +34 -0
- package/build/js/versionListCommand-5KM5PFYL.cjs.map +1 -0
- package/build/js/versionListCommand-LPPGQCQF.mjs +32 -0
- package/build/js/versionListCommand-LPPGQCQF.mjs.map +1 -0
- package/build/js/versionSetCommand-LHOVVI6U.mjs +31 -0
- package/build/js/versionSetCommand-LHOVVI6U.mjs.map +1 -0
- package/build/js/versionSetCommand-VD3L5DOV.cjs +33 -0
- package/build/js/versionSetCommand-VD3L5DOV.cjs.map +1 -0
- package/build/js/versionUnsetCommand-IJT4JWBN.mjs +24 -0
- package/build/js/versionUnsetCommand-IJT4JWBN.mjs.map +1 -0
- package/build/js/versionUnsetCommand-XYBUQ6XB.cjs +26 -0
- package/build/js/versionUnsetCommand-XYBUQ6XB.cjs.map +1 -0
- package/build/types/YargsCheckError.d.ts +3 -0
- package/build/types/commands/site/CommonSiteArgs.d.ts +4 -2
- package/build/types/commands/site/deploy/SiteDeployArgs.d.ts +5 -2
- package/build/types/commands/site/deploy/index.d.ts +1 -1
- package/build/types/commands/site/deploy/logDeployCommandConfigFileOverride.d.ts +4 -0
- package/build/types/commands/site/deploy/siteDeployCommand.d.mts +2 -0
- package/build/types/commands/site/index.d.ts +3 -3
- package/build/types/commands/site/logSiteCommandConfigFileOverride.d.ts +4 -0
- package/build/types/commands/site/version/SiteVersionArgs.d.ts +4 -0
- package/build/types/commands/site/version/delete/index.d.ts +5 -0
- package/build/types/commands/site/version/delete/versionDeleteCommand.d.mts +2 -0
- package/build/types/commands/site/version/get/index.d.ts +4 -0
- package/build/types/commands/site/version/get/versionGetCommand.d.mts +2 -0
- package/build/types/commands/site/{versions → version}/index.d.ts +1 -1
- package/build/types/commands/site/version/list/index.d.ts +4 -0
- package/build/types/commands/site/version/list/versionListCommand.d.mts +2 -0
- package/build/types/commands/site/version/set/index.d.ts +5 -0
- package/build/types/commands/site/version/set/versionSetCommand.d.mts +2 -0
- package/build/types/commands/site/version/unset/index.d.ts +4 -0
- package/build/types/commands/site/version/unset/versionUnsetCommand.d.mts +2 -0
- package/build/types/net/artifacts/SiteAssetArtifactsService/DeleteSiteVersionRequest.d.mts +5 -0
- package/build/types/net/artifacts/SiteAssetArtifactsService/UploadZippedSiteAssetRequest.d.mts +6 -0
- package/build/types/net/artifacts/SiteAssetArtifactsService/deleteSiteVersion.d.mts +3 -2
- package/build/types/net/artifacts/SiteAssetArtifactsService/fetchSiteVersions.d.mts +2 -1
- package/build/types/net/artifacts/SiteAssetArtifactsService/uploadSiteVersion.d.mts +3 -2
- package/build/types/net/createConjureContext.d.mts +1 -1
- package/build/types/net/createInternalClientContext.d.mts +2 -0
- package/build/types/net/index.d.mts +1 -0
- package/build/types/net/internalClientContext.d.mts +4 -0
- package/build/types/net/third-party-application-service/fetchWebsiteRepositoryRid.d.mts +2 -1
- package/build/types/util/autoVersion.d.ts +8 -0
- package/build/types/util/autoVersion.test.d.ts +1 -0
- package/build/types/util/config.d.ts +25 -0
- package/build/types/util/config.test.d.ts +1 -0
- package/build/types/util/configLoader.d.ts +3 -0
- package/build/types/util/isValidSemver.test.d.ts +1 -0
- package/build/types/util/token.d.ts +21 -0
- package/build/types/util/token.test.d.ts +1 -0
- package/build/types/yargs/logConfigFileMiddleware.d.ts +1 -0
- package/changelog/0.3.0/pr-20.v2.yml +5 -0
- package/changelog/0.4.0/pr-15.v2.yml +5 -0
- package/changelog/0.4.0/pr-17.v2.yml +5 -0
- package/changelog/0.4.0/pr-35.v2.yml +5 -0
- package/changelog/0.4.0/pr-41.v2.yml +5 -0
- package/changelog/0.4.0/pr-42.v2.yml +5 -0
- package/changelog/0.5.0/pr-47.v2.yml +5 -0
- package/changelog/0.5.0/pr-49.v2.yml +5 -0
- package/changelog/0.5.0/pr-51.v2.yml +5 -0
- package/changelog/@unreleased/.gitkeep +0 -0
- package/package.json +7 -4
- package/build/js/chunk-OOW63BC4.cjs.map +0 -1
- package/build/js/chunk-SQHFJOHN.mjs.map +0 -1
- package/build/js/handleSiteDeploy-5C2FGADK.cjs +0 -30
- package/build/js/handleSiteDeploy-5C2FGADK.cjs.map +0 -1
- package/build/js/handleSiteDeploy-HHXON5YE.mjs +0 -28
- package/build/js/handleSiteDeploy-HHXON5YE.mjs.map +0 -1
- package/build/js/siteDeleteCommand-47GMSHFS.mjs +0 -13
- package/build/js/siteDeleteCommand-47GMSHFS.mjs.map +0 -1
- package/build/js/siteDeleteCommand-7YTHDD4P.cjs +0 -15
- package/build/js/siteDeleteCommand-7YTHDD4P.cjs.map +0 -1
- package/build/js/siteUploadCommand-HBZYJ4ZP.cjs +0 -58
- package/build/js/siteUploadCommand-HBZYJ4ZP.cjs.map +0 -1
- package/build/js/siteUploadCommand-S2HTCGZK.mjs +0 -33
- package/build/js/siteUploadCommand-S2HTCGZK.mjs.map +0 -1
- package/build/js/siteVersionsCommand-GU3HKEGQ.cjs +0 -29
- package/build/js/siteVersionsCommand-GU3HKEGQ.cjs.map +0 -1
- package/build/js/siteVersionsCommand-X5MO726Z.mjs +0 -27
- package/build/js/siteVersionsCommand-X5MO726Z.mjs.map +0 -1
- package/build/types/commands/site/delete/DeleteArgs.d.ts +0 -4
- package/build/types/commands/site/delete/index.d.ts +0 -5
- package/build/types/commands/site/delete/siteDeleteCommand.d.mts +0 -2
- package/build/types/commands/site/deploy/handleSiteDeploy.d.mts +0 -2
- package/build/types/commands/site/upload/UploadArgs.d.ts +0 -5
- package/build/types/commands/site/upload/index.d.ts +0 -5
- package/build/types/commands/site/upload/siteUploadCommand.d.mts +0 -2
- package/build/types/commands/site/versions/siteVersionsCommand.d.mts +0 -2
- /package/{CHANGELOG.md → CHANGELOG_OLD.md} +0 -0
- /package/build/js/{handleGenerate-FCY2LRSZ.cjs.map → handleGenerate-Q6EQWXFG.cjs.map} +0 -0
- /package/build/js/{handleGenerate-K6X2HG4V.mjs.map → handleGenerate-ZUZV3IBI.mjs.map} +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { loadToken, createInternalClientContext, third_party_application_service_exports, createConjureContext, artifacts_exports, ArtifactsSitesAdminV2Service_exports } from './chunk-XNYKWAIE.mjs';
|
|
2
|
+
import './chunk-GTNZA5UY.mjs';
|
|
3
|
+
import './chunk-E2SEJZTC.mjs';
|
|
4
|
+
import { consola } from 'consola';
|
|
5
|
+
import { colorize } from 'consola/utils';
|
|
6
|
+
|
|
7
|
+
async function versionListCommand({
|
|
8
|
+
foundryUrl,
|
|
9
|
+
application,
|
|
10
|
+
token,
|
|
11
|
+
tokenFile
|
|
12
|
+
}) {
|
|
13
|
+
const loadedToken = await loadToken(token, tokenFile);
|
|
14
|
+
const tokenProvider = () => loadedToken;
|
|
15
|
+
const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);
|
|
16
|
+
consola.start("Fetching versions & deployed version");
|
|
17
|
+
const repositoryRid = await third_party_application_service_exports.fetchWebsiteRepositoryRid(clientCtx, application);
|
|
18
|
+
const ctx = createConjureContext(foundryUrl, "/artifacts/api", tokenProvider);
|
|
19
|
+
const [versions, deployedVersion] = await Promise.all([artifacts_exports.SiteAssetArtifactsService.fetchSiteVersions(clientCtx, application), ArtifactsSitesAdminV2Service_exports.getDeployedVersion(ctx, repositoryRid)]);
|
|
20
|
+
if (versions.length === 0) {
|
|
21
|
+
consola.warn("Successfully connected to server, but no versions were found.");
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
consola.success("Found versions:");
|
|
25
|
+
for (const version of versions) {
|
|
26
|
+
consola.log(` - ${version}${deployedVersion && version === deployedVersion.version ? colorize("green", ` (deployed)`) : ""}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { versionListCommand as default };
|
|
31
|
+
//# sourceMappingURL=out.js.map
|
|
32
|
+
//# sourceMappingURL=versionListCommand-LPPGQCQF.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/commands/site/version/list/versionListCommand.mts"],"names":[],"mappings":";;;;;;;;;;;;AAiBA,SAAS,eAAe;AACxB,SAAS,gBAAgB;AAEzB,eAAO,mBAA0C;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,QAAM,cAAc,MAAM,UAAU,OAAO,SAAS;AACpD,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,UAAQ,MAAM,sCAAsC;AACpD,QAAM,gBAAgB,MAAM,wCAA6B,0BAA0B,WAAW,WAAW;AACzG,QAAM,MAAM,qBAAqB,YAAY,kBAAkB,aAAa;AAC5E,QAAM,CAAC,UAAU,eAAe,IAAI,MAAM,QAAQ,IAAI,CAAC,kBAAU,0BAA0B,kBAAkB,WAAW,WAAW,GAAG,qCAA6B,mBAAmB,KAAK,aAAa,CAAC,CAAC;AAC1M,MAAI,SAAS,WAAW,GAAG;AACzB,YAAQ,KAAK,+DAA+D;AAC5E;AAAA,EACF;AACA,UAAQ,QAAQ,iBAAiB;AACjC,aAAW,WAAW,UAAU;AAC9B,YAAQ,IAAI,SAAS,OAAO,GAAG,mBAAmB,YAAY,gBAAgB,UAAU,SAAS,SAAS,aAAa,IAAI,EAAE,EAAE;AAAA,EACjI;AACF","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { artifacts, ArtifactsSitesAdminV2Service, createConjureContext, createInternalClientContext, thirdPartyApplicationService } from \"#net\";\nimport { consola } from \"consola\";\nimport { colorize } from \"consola/utils\";\nimport { loadToken } from \"../../../../util/token.js\";\nexport default async function versionListCommand({\n foundryUrl,\n application,\n token,\n tokenFile\n}) {\n const loadedToken = await loadToken(token, tokenFile);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n consola.start(\"Fetching versions & deployed version\");\n const repositoryRid = await thirdPartyApplicationService.fetchWebsiteRepositoryRid(clientCtx, application);\n const ctx = createConjureContext(foundryUrl, \"/artifacts/api\", tokenProvider);\n const [versions, deployedVersion] = await Promise.all([artifacts.SiteAssetArtifactsService.fetchSiteVersions(clientCtx, application), ArtifactsSitesAdminV2Service.getDeployedVersion(ctx, repositoryRid)]);\n if (versions.length === 0) {\n consola.warn(\"Successfully connected to server, but no versions were found.\");\n return;\n }\n consola.success(\"Found versions:\");\n for (const version of versions) {\n consola.log(` - ${version}${deployedVersion && version === deployedVersion.version ? colorize(\"green\", ` (deployed)`) : \"\"}`);\n }\n}"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { loadToken, createInternalClientContext, third_party_application_service_exports, createConjureContext, ArtifactsSitesAdminV2Service_exports } from './chunk-XNYKWAIE.mjs';
|
|
2
|
+
import './chunk-GTNZA5UY.mjs';
|
|
3
|
+
import './chunk-E2SEJZTC.mjs';
|
|
4
|
+
import { consola } from 'consola';
|
|
5
|
+
|
|
6
|
+
async function versionSetCommand({
|
|
7
|
+
version,
|
|
8
|
+
application,
|
|
9
|
+
foundryUrl,
|
|
10
|
+
token,
|
|
11
|
+
tokenFile
|
|
12
|
+
}) {
|
|
13
|
+
consola.start(`Setting live version`);
|
|
14
|
+
const loadedToken = await loadToken(token, tokenFile);
|
|
15
|
+
const tokenProvider = () => loadedToken;
|
|
16
|
+
const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);
|
|
17
|
+
const repositoryRid = await third_party_application_service_exports.fetchWebsiteRepositoryRid(clientCtx, application);
|
|
18
|
+
const ctx = createConjureContext(foundryUrl, "/artifacts/api", tokenProvider);
|
|
19
|
+
if (version) {
|
|
20
|
+
await ArtifactsSitesAdminV2Service_exports.updateDeployedVersion(ctx, repositoryRid, {
|
|
21
|
+
siteVersion: {
|
|
22
|
+
version
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
consola.success(`Set live version to ${version}`);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { versionSetCommand as default };
|
|
30
|
+
//# sourceMappingURL=out.js.map
|
|
31
|
+
//# sourceMappingURL=versionSetCommand-LHOVVI6U.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/commands/site/version/set/versionSetCommand.mts"],"names":[],"mappings":";;;;;;;;;;;AAgBA,SAAS,eAAe;AAGxB,eAAO,kBAAyC;AAAA,EAC9C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,UAAQ,MAAM,sBAAsB;AACpC,QAAM,cAAc,MAAM,UAAU,OAAO,SAAS;AACpD,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,QAAM,gBAAgB,MAAM,wCAA6B,0BAA0B,WAAW,WAAW;AACzG,QAAM,MAAM,qBAAqB,YAAY,kBAAkB,aAAa;AAC5E,MAAI,SAAS;AACX,UAAM,qCAA6B,sBAAsB,KAAK,eAAe;AAAA,MAC3E,aAAa;AAAA,QACX;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACA,UAAQ,QAAQ,uBAAuB,OAAO,EAAE;AAClD","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 versionSetCommand({\n version,\n application,\n foundryUrl,\n token,\n tokenFile\n}) {\n consola.start(`Setting live version`);\n const loadedToken = await loadToken(token, tokenFile);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n const repositoryRid = await thirdPartyApplicationService.fetchWebsiteRepositoryRid(clientCtx, application);\n const ctx = createConjureContext(foundryUrl, \"/artifacts/api\", tokenProvider);\n if (version) {\n await ArtifactsSitesAdminV2Service.updateDeployedVersion(ctx, repositoryRid, {\n siteVersion: {\n version\n }\n });\n }\n consola.success(`Set live version to ${version}`);\n}"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
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 versionSetCommand({
|
|
9
|
+
version,
|
|
10
|
+
application,
|
|
11
|
+
foundryUrl,
|
|
12
|
+
token,
|
|
13
|
+
tokenFile
|
|
14
|
+
}) {
|
|
15
|
+
consola.consola.start(`Setting live version`);
|
|
16
|
+
const loadedToken = await chunkD7QHLGEU_cjs.loadToken(token, tokenFile);
|
|
17
|
+
const tokenProvider = () => loadedToken;
|
|
18
|
+
const clientCtx = chunkD7QHLGEU_cjs.createInternalClientContext(foundryUrl, tokenProvider);
|
|
19
|
+
const repositoryRid = await chunkD7QHLGEU_cjs.third_party_application_service_exports.fetchWebsiteRepositoryRid(clientCtx, application);
|
|
20
|
+
const ctx = chunkD7QHLGEU_cjs.createConjureContext(foundryUrl, "/artifacts/api", tokenProvider);
|
|
21
|
+
if (version) {
|
|
22
|
+
await chunkD7QHLGEU_cjs.ArtifactsSitesAdminV2Service_exports.updateDeployedVersion(ctx, repositoryRid, {
|
|
23
|
+
siteVersion: {
|
|
24
|
+
version
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
consola.consola.success(`Set live version to ${version}`);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
module.exports = versionSetCommand;
|
|
32
|
+
//# sourceMappingURL=out.js.map
|
|
33
|
+
//# sourceMappingURL=versionSetCommand-VD3L5DOV.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/commands/site/version/set/versionSetCommand.mts"],"names":[],"mappings":";;;;;;;;;;;AAgBA,SAAS,eAAe;AAGxB,eAAO,kBAAyC;AAAA,EAC9C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,UAAQ,MAAM,sBAAsB;AACpC,QAAM,cAAc,MAAM,UAAU,OAAO,SAAS;AACpD,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,QAAM,gBAAgB,MAAM,wCAA6B,0BAA0B,WAAW,WAAW;AACzG,QAAM,MAAM,qBAAqB,YAAY,kBAAkB,aAAa;AAC5E,MAAI,SAAS;AACX,UAAM,qCAA6B,sBAAsB,KAAK,eAAe;AAAA,MAC3E,aAAa;AAAA,QACX;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACA,UAAQ,QAAQ,uBAAuB,OAAO,EAAE;AAClD","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 versionSetCommand({\n version,\n application,\n foundryUrl,\n token,\n tokenFile\n}) {\n consola.start(`Setting live version`);\n const loadedToken = await loadToken(token, tokenFile);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n const repositoryRid = await thirdPartyApplicationService.fetchWebsiteRepositoryRid(clientCtx, application);\n const ctx = createConjureContext(foundryUrl, \"/artifacts/api\", tokenProvider);\n if (version) {\n await ArtifactsSitesAdminV2Service.updateDeployedVersion(ctx, repositoryRid, {\n siteVersion: {\n version\n }\n });\n }\n consola.success(`Set live version to ${version}`);\n}"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { loadToken, createInternalClientContext, third_party_application_service_exports, createConjureContext, ArtifactsSitesAdminV2Service_exports } from './chunk-XNYKWAIE.mjs';
|
|
2
|
+
import './chunk-GTNZA5UY.mjs';
|
|
3
|
+
import './chunk-E2SEJZTC.mjs';
|
|
4
|
+
import { consola } from 'consola';
|
|
5
|
+
|
|
6
|
+
async function versionUnsetCommand({
|
|
7
|
+
application,
|
|
8
|
+
foundryUrl,
|
|
9
|
+
token,
|
|
10
|
+
tokenFile
|
|
11
|
+
}) {
|
|
12
|
+
const loadedToken = await loadToken(token, tokenFile);
|
|
13
|
+
const tokenProvider = () => loadedToken;
|
|
14
|
+
const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);
|
|
15
|
+
consola.start("Clearing live site version");
|
|
16
|
+
const repositoryRid = await third_party_application_service_exports.fetchWebsiteRepositoryRid(clientCtx, application);
|
|
17
|
+
const ctx = createConjureContext(foundryUrl, "/artifacts/api", tokenProvider);
|
|
18
|
+
await ArtifactsSitesAdminV2Service_exports.clearDeployedVersion(ctx, repositoryRid);
|
|
19
|
+
consola.success("Cleared live site version");
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { versionUnsetCommand as default };
|
|
23
|
+
//# sourceMappingURL=out.js.map
|
|
24
|
+
//# sourceMappingURL=versionUnsetCommand-IJT4JWBN.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
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}"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,6 +1,8 @@
|
|
|
1
1
|
import type { CliCommonArgs } from "../../CliCommonArgs.js";
|
|
2
2
|
import type { ThirdPartyAppRid } from "../../net/ThirdPartyAppRid.js";
|
|
3
3
|
export interface CommonSiteArgs extends CliCommonArgs {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
application: ThirdPartyAppRid;
|
|
5
|
+
foundryUrl: string;
|
|
6
|
+
token?: string;
|
|
7
|
+
tokenFile?: string;
|
|
6
8
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { CommonSiteArgs } from "../CommonSiteArgs.js";
|
|
2
2
|
export interface SiteDeployArgs extends CommonSiteArgs {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
version?: string;
|
|
4
|
+
directory: string;
|
|
5
|
+
uploadOnly: boolean;
|
|
6
|
+
autoVersion?: string;
|
|
7
|
+
gitTagPrefix?: string;
|
|
5
8
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CommandModule } from "yargs";
|
|
2
2
|
import type { CommonSiteArgs } from "../CommonSiteArgs.js";
|
|
3
3
|
import type { SiteDeployArgs } from "./SiteDeployArgs.js";
|
|
4
|
-
|
|
4
|
+
declare const command: CommandModule<CommonSiteArgs, SiteDeployArgs>;
|
|
5
5
|
export default command;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Arguments } from "yargs";
|
|
2
|
+
import type { SiteConfig } from "../../../util/config.js";
|
|
3
|
+
import type { SiteDeployArgs } from "./SiteDeployArgs.js";
|
|
4
|
+
export declare function logDeployCommandConfigFileOverride(args: Arguments<SiteDeployArgs>, config: SiteConfig | undefined): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type { CommandModule } from "yargs";
|
|
2
2
|
import type { CliCommonArgs } from "../../CliCommonArgs.js";
|
|
3
3
|
import type { CommonSiteArgs } from "./CommonSiteArgs.js";
|
|
4
|
-
declare const
|
|
5
|
-
export default
|
|
4
|
+
declare const command: CommandModule<CliCommonArgs, CommonSiteArgs>;
|
|
5
|
+
export default command;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Arguments } from "yargs";
|
|
2
|
+
import type { FoundryConfig } from "../../util/config.js";
|
|
3
|
+
import type { CommonSiteArgs } from "./CommonSiteArgs.js";
|
|
4
|
+
export declare function logSiteCommandConfigFileOverride(args: Arguments<CommonSiteArgs>, config: FoundryConfig | undefined): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { CommandModule } from "yargs";
|
|
2
2
|
import type { CommonSiteArgs } from "../CommonSiteArgs.js";
|
|
3
|
-
|
|
3
|
+
declare const command: CommandModule<CommonSiteArgs, CommonSiteArgs>;
|
|
4
4
|
export default command;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { InternalClientContext } from "../../internalClientContext.mjs";
|
|
2
|
+
import type { DeleteSiteVersionRequest } from "./DeleteSiteVersionRequest.mjs";
|
|
3
|
+
export declare function deleteSiteVersion(ctx: InternalClientContext, request: DeleteSiteVersionRequest): Promise<boolean>;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import type { InternalClientContext } from "../../internalClientContext.mjs";
|
|
1
2
|
import type { ThirdPartyAppRid } from "../../ThirdPartyAppRid.js";
|
|
2
|
-
export declare function fetchSiteVersions(
|
|
3
|
+
export declare function fetchSiteVersions(ctx: InternalClientContext, thirdPartyAppRid: ThirdPartyAppRid): Promise<string[]>;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { InternalClientContext } from "../../internalClientContext.mjs";
|
|
2
|
+
import type { UploadZippedSiteAssetRequest } from "./UploadZippedSiteAssetRequest.mjs";
|
|
3
|
+
export declare function uploadZippedSiteAsset(ctx: InternalClientContext, request: UploadZippedSiteAssetRequest): Promise<boolean>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ConjureContext } from "conjure-lite";
|
|
2
|
-
export declare function createConjureContext(
|
|
2
|
+
export declare function createConjureContext(foundryUrl: string, servicePath: "/artifacts/api", tokenProvider: () => string): ConjureContext;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { ArtifactsSitesAdminV2Service } from "../generated/artifacts-sites/index.js";
|
|
2
2
|
export * as artifacts from "./artifacts/index.mjs";
|
|
3
3
|
export { createConjureContext } from "./createConjureContext.mjs";
|
|
4
|
+
export { createInternalClientContext } from "./createInternalClientContext.mjs";
|
|
4
5
|
export * as thirdPartyApplicationService from "./third-party-application-service/index.mjs";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { InternalClientContext } from "../internalClientContext.mjs";
|
|
1
2
|
import type { RepositoryRid } from "../RepositoryRid.js";
|
|
2
3
|
import type { ThirdPartyAppRid } from "../ThirdPartyAppRid.js";
|
|
3
|
-
export declare function fetchWebsiteRepositoryRid(
|
|
4
|
+
export declare function fetchWebsiteRepositoryRid(ctx: InternalClientContext, thirdPartyAppRid: ThirdPartyAppRid): Promise<RepositoryRid>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gets the version string using git describe. If the @param tagPrefix is empty, git describe will return the
|
|
3
|
+
* latest tag (without any filtering) and if the tag starts with "v", it will be removed.
|
|
4
|
+
* @param tagPrefix The prefix to use for matching against tags. Defaults to an empty string.
|
|
5
|
+
* @returns A promise that resolves to the version string.
|
|
6
|
+
* @throws An error if the version string is not SemVer compliant or if the version cannot be determined.
|
|
7
|
+
*/
|
|
8
|
+
export declare function autoVersion(tagPrefix?: string): Promise<string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface GitDescribeAutoVersionConfig {
|
|
2
|
+
type: "git-describe";
|
|
3
|
+
tagPrefix?: string;
|
|
4
|
+
}
|
|
5
|
+
type AutoVersionConfig = GitDescribeAutoVersionConfig;
|
|
6
|
+
export interface SiteConfig {
|
|
7
|
+
application: string;
|
|
8
|
+
directory: string;
|
|
9
|
+
autoVersion?: AutoVersionConfig;
|
|
10
|
+
}
|
|
11
|
+
export interface FoundryConfig {
|
|
12
|
+
foundryUrl: string;
|
|
13
|
+
site: SiteConfig;
|
|
14
|
+
}
|
|
15
|
+
export interface LoadedFoundryConfig {
|
|
16
|
+
foundryConfig: FoundryConfig;
|
|
17
|
+
configFilePath: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Asynchronously loads a configuration file. Looks for any of the CONFIG_FILE_NAMES in the current directory going up to the root directory.
|
|
21
|
+
* @returns A promise that resolves to the configuration JSON object, or undefined if not found.
|
|
22
|
+
* @throws Will throw an error if the configuration file is found but cannot be read or parsed.
|
|
23
|
+
*/
|
|
24
|
+
export declare function loadFoundryConfig(): Promise<LoadedFoundryConfig | undefined>;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loads a JWT Auth Token from an argument, a file, or environment variable returning the first found.
|
|
3
|
+
* @param token The token as a string.
|
|
4
|
+
* @param tokenFile The path to the token file.
|
|
5
|
+
* @returns The token as a string.
|
|
6
|
+
* @throws An error if no token is found.
|
|
7
|
+
*/
|
|
8
|
+
export declare function loadToken(token?: string, tokenFile?: string): Promise<string>;
|
|
9
|
+
interface LoadedToken {
|
|
10
|
+
filePath: string;
|
|
11
|
+
token: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Synchronously reads a JWT Auth Token from a file.
|
|
15
|
+
* @param filePath The path to the token file.
|
|
16
|
+
* @returns The token as a string.
|
|
17
|
+
* @throws An error if the file cannot be read or if the file does not contain a valid JWT.
|
|
18
|
+
*/
|
|
19
|
+
export declare function loadTokenFile(filePath: string): Promise<LoadedToken>;
|
|
20
|
+
export declare function validate(token: string): void;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function logConfigFileMiddleware(): Promise<void>;
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osdk/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"access": "public",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -17,16 +17,17 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
+
"ajv": "^8.12.0",
|
|
20
21
|
"archiver": "^6.0.1",
|
|
21
22
|
"conjure-lite": "^0.3.3",
|
|
22
23
|
"consola": "^3.2.3",
|
|
23
24
|
"find-up": "^6.3.0",
|
|
24
25
|
"open": "^9.1.0",
|
|
25
26
|
"yargs": "^17.7.2",
|
|
26
|
-
"@osdk/api": "1.1.1",
|
|
27
27
|
"@osdk/gateway": "1.1.1",
|
|
28
28
|
"@osdk/generator": "1.3.0",
|
|
29
|
-
"@osdk/shared.net": "1.2.0"
|
|
29
|
+
"@osdk/shared.net": "1.2.0",
|
|
30
|
+
"@osdk/api": "1.1.1"
|
|
30
31
|
},
|
|
31
32
|
"devDependencies": {
|
|
32
33
|
"@types/archiver": "^6.0.0",
|
|
@@ -49,7 +50,8 @@
|
|
|
49
50
|
"files": [
|
|
50
51
|
"build/types",
|
|
51
52
|
"build/js",
|
|
52
|
-
"
|
|
53
|
+
"changelog",
|
|
54
|
+
"CHANGELOG_OLD.md",
|
|
53
55
|
"package.json",
|
|
54
56
|
"templates",
|
|
55
57
|
"*.d.ts"
|
|
@@ -63,6 +65,7 @@
|
|
|
63
65
|
"dev:transpile": "tsup --watch",
|
|
64
66
|
"fix-lint": "eslint . --fix && dprint fmt --config $(find-up dprint.json)",
|
|
65
67
|
"lint": "eslint . && dprint check --config $(find-up dprint.json)",
|
|
68
|
+
"test": "vitest run",
|
|
66
69
|
"test:watch": "vitest",
|
|
67
70
|
"transpile": "tsup",
|
|
68
71
|
"transpileWatch": "tsup --watch",
|