@osdk/cli 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/js/{chunk-OOW63BC4.cjs → chunk-D7QHLGEU.cjs} +88 -24
- package/build/js/chunk-D7QHLGEU.cjs.map +1 -0
- package/build/js/chunk-N6K26UR4.mjs +9 -0
- package/build/js/chunk-N6K26UR4.mjs.map +1 -0
- package/build/js/chunk-X2S4O5ZR.cjs +11 -0
- package/build/js/chunk-X2S4O5ZR.cjs.map +1 -0
- package/build/js/{chunk-SQHFJOHN.mjs → chunk-XNYKWAIE.mjs} +84 -26
- package/build/js/chunk-XNYKWAIE.mjs.map +1 -0
- package/build/js/{handleGenerate-K6X2HG4V.mjs → handleGenerate-A7X2XAGW.mjs} +2 -2
- package/build/js/{handleGenerate-FCY2LRSZ.cjs → handleGenerate-WOW33WYG.cjs} +2 -2
- package/build/js/index.cjs +334 -81
- package/build/js/index.cjs.map +1 -1
- package/build/js/index.mjs +333 -80
- package/build/js/index.mjs.map +1 -1
- package/build/js/siteDeployCommand-HSR3QDAT.mjs +82 -0
- package/build/js/siteDeployCommand-HSR3QDAT.mjs.map +1 -0
- package/build/js/siteDeployCommand-MXKGJFFB.cjs +107 -0
- package/build/js/siteDeployCommand-MXKGJFFB.cjs.map +1 -0
- package/build/js/versionDeleteCommand-6BJL5XLG.mjs +26 -0
- package/build/js/versionDeleteCommand-6BJL5XLG.mjs.map +1 -0
- package/build/js/versionDeleteCommand-RLU7UUYD.cjs +28 -0
- package/build/js/versionDeleteCommand-RLU7UUYD.cjs.map +1 -0
- package/build/js/versionGetCommand-OR4RLOLM.mjs +28 -0
- package/build/js/versionGetCommand-OR4RLOLM.mjs.map +1 -0
- package/build/js/versionGetCommand-Y2VR2WKH.cjs +30 -0
- package/build/js/versionGetCommand-Y2VR2WKH.cjs.map +1 -0
- package/build/js/versionListCommand-5KM5PFYL.cjs +34 -0
- package/build/js/versionListCommand-5KM5PFYL.cjs.map +1 -0
- package/build/js/versionListCommand-LPPGQCQF.mjs +32 -0
- package/build/js/versionListCommand-LPPGQCQF.mjs.map +1 -0
- package/build/js/versionSetCommand-LHOVVI6U.mjs +31 -0
- package/build/js/versionSetCommand-LHOVVI6U.mjs.map +1 -0
- package/build/js/versionSetCommand-VD3L5DOV.cjs +33 -0
- package/build/js/versionSetCommand-VD3L5DOV.cjs.map +1 -0
- package/build/js/versionUnsetCommand-IJT4JWBN.mjs +24 -0
- package/build/js/versionUnsetCommand-IJT4JWBN.mjs.map +1 -0
- package/build/js/versionUnsetCommand-XYBUQ6XB.cjs +26 -0
- package/build/js/versionUnsetCommand-XYBUQ6XB.cjs.map +1 -0
- package/build/types/YargsCheckError.d.ts +3 -0
- package/build/types/commands/site/CommonSiteArgs.d.ts +4 -2
- package/build/types/commands/site/deploy/SiteDeployArgs.d.ts +5 -2
- package/build/types/commands/site/deploy/index.d.ts +1 -1
- package/build/types/commands/site/deploy/logDeployCommandConfigFileOverride.d.ts +4 -0
- package/build/types/commands/site/deploy/siteDeployCommand.d.mts +2 -0
- package/build/types/commands/site/index.d.ts +3 -3
- package/build/types/commands/site/logSiteCommandConfigFileOverride.d.ts +4 -0
- package/build/types/commands/site/version/SiteVersionArgs.d.ts +4 -0
- package/build/types/commands/site/version/delete/index.d.ts +5 -0
- package/build/types/commands/site/version/delete/versionDeleteCommand.d.mts +2 -0
- package/build/types/commands/site/version/get/index.d.ts +4 -0
- package/build/types/commands/site/version/get/versionGetCommand.d.mts +2 -0
- package/build/types/commands/site/{versions → version}/index.d.ts +1 -1
- package/build/types/commands/site/version/list/index.d.ts +4 -0
- package/build/types/commands/site/version/list/versionListCommand.d.mts +2 -0
- package/build/types/commands/site/version/set/index.d.ts +5 -0
- package/build/types/commands/site/version/set/versionSetCommand.d.mts +2 -0
- package/build/types/commands/site/version/unset/index.d.ts +4 -0
- package/build/types/commands/site/version/unset/versionUnsetCommand.d.mts +2 -0
- package/build/types/net/artifacts/SiteAssetArtifactsService/DeleteSiteVersionRequest.d.mts +5 -0
- package/build/types/net/artifacts/SiteAssetArtifactsService/UploadZippedSiteAssetRequest.d.mts +6 -0
- package/build/types/net/artifacts/SiteAssetArtifactsService/deleteSiteVersion.d.mts +3 -2
- package/build/types/net/artifacts/SiteAssetArtifactsService/fetchSiteVersions.d.mts +2 -1
- package/build/types/net/artifacts/SiteAssetArtifactsService/uploadSiteVersion.d.mts +3 -2
- package/build/types/net/createConjureContext.d.mts +1 -1
- package/build/types/net/createInternalClientContext.d.mts +2 -0
- package/build/types/net/index.d.mts +1 -0
- package/build/types/net/internalClientContext.d.mts +4 -0
- package/build/types/net/third-party-application-service/fetchWebsiteRepositoryRid.d.mts +2 -1
- package/build/types/util/autoVersion.d.ts +8 -0
- package/build/types/util/autoVersion.test.d.ts +1 -0
- package/build/types/util/config.d.ts +25 -0
- package/build/types/util/config.test.d.ts +1 -0
- package/build/types/util/configLoader.d.ts +3 -0
- package/build/types/util/isValidSemver.test.d.ts +1 -0
- package/build/types/util/token.d.ts +21 -0
- package/build/types/util/token.test.d.ts +1 -0
- package/build/types/yargs/logConfigFileMiddleware.d.ts +1 -0
- package/changelog/0.3.0/pr-20.v2.yml +5 -0
- package/changelog/0.4.0/pr-15.v2.yml +5 -0
- package/changelog/0.4.0/pr-17.v2.yml +5 -0
- package/changelog/0.4.0/pr-35.v2.yml +5 -0
- package/changelog/0.4.0/pr-41.v2.yml +5 -0
- package/changelog/0.4.0/pr-42.v2.yml +5 -0
- package/changelog/@unreleased/.gitkeep +0 -0
- package/package.json +5 -2
- package/build/js/chunk-OOW63BC4.cjs.map +0 -1
- package/build/js/chunk-SQHFJOHN.mjs.map +0 -1
- package/build/js/handleSiteDeploy-5C2FGADK.cjs +0 -30
- package/build/js/handleSiteDeploy-5C2FGADK.cjs.map +0 -1
- package/build/js/handleSiteDeploy-HHXON5YE.mjs +0 -28
- package/build/js/handleSiteDeploy-HHXON5YE.mjs.map +0 -1
- package/build/js/siteDeleteCommand-47GMSHFS.mjs +0 -13
- package/build/js/siteDeleteCommand-47GMSHFS.mjs.map +0 -1
- package/build/js/siteDeleteCommand-7YTHDD4P.cjs +0 -15
- package/build/js/siteDeleteCommand-7YTHDD4P.cjs.map +0 -1
- package/build/js/siteUploadCommand-HBZYJ4ZP.cjs +0 -58
- package/build/js/siteUploadCommand-HBZYJ4ZP.cjs.map +0 -1
- package/build/js/siteUploadCommand-S2HTCGZK.mjs +0 -33
- package/build/js/siteUploadCommand-S2HTCGZK.mjs.map +0 -1
- package/build/js/siteVersionsCommand-GU3HKEGQ.cjs +0 -29
- package/build/js/siteVersionsCommand-GU3HKEGQ.cjs.map +0 -1
- package/build/js/siteVersionsCommand-X5MO726Z.mjs +0 -27
- package/build/js/siteVersionsCommand-X5MO726Z.mjs.map +0 -1
- package/build/types/commands/site/delete/DeleteArgs.d.ts +0 -4
- package/build/types/commands/site/delete/index.d.ts +0 -5
- package/build/types/commands/site/delete/siteDeleteCommand.d.mts +0 -2
- package/build/types/commands/site/deploy/handleSiteDeploy.d.mts +0 -2
- package/build/types/commands/site/upload/UploadArgs.d.ts +0 -5
- package/build/types/commands/site/upload/index.d.ts +0 -5
- package/build/types/commands/site/upload/siteUploadCommand.d.mts +0 -2
- package/build/types/commands/site/versions/siteVersionsCommand.d.mts +0 -2
- /package/{CHANGELOG.md → CHANGELOG_OLD.md} +0 -0
- /package/build/js/{handleGenerate-FCY2LRSZ.cjs.map → handleGenerate-A7X2XAGW.mjs.map} +0 -0
- /package/build/js/{handleGenerate-K6X2HG4V.mjs.map → handleGenerate-WOW33WYG.cjs.map} +0 -0
|
@@ -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(argv: 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(argv: 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.4.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"access": "public",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -17,6 +17,7 @@
|
|
|
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",
|
|
@@ -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",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/generated/artifacts-sites/ArtifactsSitesAdminV2Service.ts","../../src/generated/artifacts-sites/ArtifactsSitesAdminV2Service/clearDeployedVersion.ts","../../src/generated/artifacts-sites/ArtifactsSitesAdminV2Service/getContentSecurityPolicyAdditions.ts","../../src/generated/artifacts-sites/ArtifactsSitesAdminV2Service/getDeployedVersion.ts","../../src/generated/artifacts-sites/ArtifactsSitesAdminV2Service/getRegisteredSiteDomains.ts","../../src/generated/artifacts-sites/ArtifactsSitesAdminV2Service/getRequestedSiteDomains.ts","../../src/generated/artifacts-sites/ArtifactsSitesAdminV2Service/previewContentSecurityPolicy.ts","../../src/generated/artifacts-sites/ArtifactsSitesAdminV2Service/putContentSecurityPolicyAdditions.ts","../../src/generated/artifacts-sites/ArtifactsSitesAdminV2Service/requestSiteDomainForRepository.ts","../../src/generated/artifacts-sites/ArtifactsSitesAdminV2Service/unregisterSiteDomain.ts","../../src/generated/artifacts-sites/ArtifactsSitesAdminV2Service/updateDeployedVersion.ts","../../src/net/artifacts/index.mts","../../src/net/artifacts/SiteAssetArtifactsService/index.mts","../../src/net/artifacts/SiteAssetArtifactsService/deleteSiteVersion.mts","../../src/net/createFetch.mts","../../src/net/third-party-application-service/fetchWebsiteRepositoryRid.mts","../../src/net/artifacts/SiteAssetArtifactsService/getSiteAssetBaseUrl.mts","../../src/net/artifacts/SiteAssetArtifactsService/fetchSiteVersions.mts","../../src/net/artifacts/SiteAssetArtifactsService/uploadSiteVersion.mts","../../src/net/createConjureContext.mts","../../src/net/third-party-application-service/index.mts"],"names":["conjureFetch","consola","fetch","LogLevels"],"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\nexport { clearDeployedVersion } from \"./ArtifactsSitesAdminV2Service/clearDeployedVersion.js\";\nexport { getContentSecurityPolicyAdditions } from \"./ArtifactsSitesAdminV2Service/getContentSecurityPolicyAdditions.js\";\nexport { getDeployedVersion } from \"./ArtifactsSitesAdminV2Service/getDeployedVersion.js\";\nexport { getRegisteredSiteDomains } from \"./ArtifactsSitesAdminV2Service/getRegisteredSiteDomains.js\";\nexport { getRequestedSiteDomains } from \"./ArtifactsSitesAdminV2Service/getRequestedSiteDomains.js\";\nexport { previewContentSecurityPolicy } from \"./ArtifactsSitesAdminV2Service/previewContentSecurityPolicy.js\";\nexport { putContentSecurityPolicyAdditions } from \"./ArtifactsSitesAdminV2Service/putContentSecurityPolicyAdditions.js\";\nexport { requestSiteDomainForRepository } from \"./ArtifactsSitesAdminV2Service/requestSiteDomainForRepository.js\";\nexport { unregisterSiteDomain } from \"./ArtifactsSitesAdminV2Service/unregisterSiteDomain.js\";\nexport { updateDeployedVersion } from \"./ArtifactsSitesAdminV2Service/updateDeployedVersion.js\";","/*\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 { conjureFetch } from \"conjure-lite\";\n\n/**\n * Clears the deployed version while leaving the associated domain, visiting the associated domain in this state\n * will return an error.\n *\n * artifacts:sites:write-deployment-info permission is needed on the repository rid to call this endpoint.\n */\nexport async function clearDeployedVersion(ctx, repositoryRid) {\n return conjureFetch(ctx, `/sites/v2/admin/repository/${repositoryRid}/deployed-version`, \"DELETE\");\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Get the CSP additions configured for a repository.\n *\n * artifacts:sites:read-deployment-info permission is needed on the repository rid to call this endpoint.\n */\nexport async function getContentSecurityPolicyAdditions(ctx, repositoryRid) {\n return conjureFetch(ctx, `/sites/v2/admin/repository/${repositoryRid}/csp/additions`, \"GET\");\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Get the deployed version that will be served for a given siteasset repository.\n *\n * artifacts:sites:read-deployment-info permission is needed on the repository rid to call this endpoint.\n */\nexport async function getDeployedVersion(ctx, repositoryRid) {\n return conjureFetch(ctx, `/sites/v2/admin/repository/${repositoryRid}/deployed-version`, \"GET\");\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Get domains that have been successfully registered with the given repository. Visiting a successfully\n * registered domain should serve the registered repository assets.\n *\n * artifacts:sites:read-deployment-info permission is needed on the repository rid to call this endpoint.\n */\nexport async function getRegisteredSiteDomains(ctx, repositoryRid) {\n return conjureFetch(ctx, `/sites/v2/admin/repository/${repositoryRid}/domains/registered`, \"GET\");\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Get domains that have been requested for a given repository. For control panel domains that require\n * an approval, this will also include pending requests. Closed/rejected requests will only be included as long\n * as their domain hasn't been re-requested for another repository.\n *\n * artifacts:sites:read-deployment-info permission is needed on the repository rid to call this endpoint.\n */\nexport async function getRequestedSiteDomains(ctx, repositoryRid) {\n return conjureFetch(ctx, `/sites/v2/admin/repository/${repositoryRid}/domains/requested`, \"GET\");\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Preview what the CSP that will be served with the site looks like.\n *\n * artifacts:sites:read-deployment-info permission is needed on the repository rid to call this endpoint.\n */\nexport async function previewContentSecurityPolicy(ctx, repositoryRid, request) {\n return conjureFetch(ctx, `/sites/v2/admin/repository/${repositoryRid}/csp/preview`, \"POST\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Set the CSP additions configured for a repository.\n *\n * artifacts:sites:write-deployment-info permission is needed on the repository rid to call this endpoint.\n */\nexport async function putContentSecurityPolicyAdditions(ctx, repositoryRid, contentSecurityPolicyAdditions) {\n return conjureFetch(ctx, `/sites/v2/admin/repository/${repositoryRid}/csp/additions`, \"PUT\", contentSecurityPolicyAdditions);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Requests the registration of a domain with the provided repository, this will result in an approvals task\n * getting created for approval by an admin.\n *\n * Once the task has been approved, visiting the domain will serve the deployed version, if any is deployed.\n *\n * artifacts:sites:manage-domains permission is needed on the repository rid to call this endpoint.\n */\nexport async function requestSiteDomainForRepository(ctx, repositoryRid, request) {\n return conjureFetch(ctx, `/sites/v2/admin/repository/${repositoryRid}/domains/submit-registration`, \"POST\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Unregisters a domain from a repository, visiting the domain will no longer serve the repository assets.\n *\n * Depending on how the domain for the repository was setup, this might also result in deleting the domain\n * itself.\n *\n * artifacts:sites:manage-domains permission is needed on the repository rid to call this endpoint.\n */\nexport async function unregisterSiteDomain(ctx, repositoryRid, request) {\n return conjureFetch(ctx, `/sites/v2/admin/repository/${repositoryRid}/domains/unregister`, \"POST\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Sets the asset version of the siteasset repository that will be served.\n *\n * artifacts:sites:write-deployment-info permission is needed on the repository rid to call this endpoint.\n */\nexport async function updateDeployedVersion(ctx, repositoryRid, version) {\n return conjureFetch(ctx, `/sites/v2/admin/repository/${repositoryRid}/deployed-version`, \"PUT\", version);\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 * as SiteAssetArtifactsService from \"./SiteAssetArtifactsService/index.mjs\";","/*\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 { deleteSiteVersion } from \"./deleteSiteVersion.mjs\";\nexport { fetchSiteVersions } from \"./fetchSiteVersions.mjs\";\nexport { uploadZippedSiteAsset } from \"./uploadSiteVersion.mjs\";","/*\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, LogLevels } from \"consola\";\nimport { ExitProcessError } from \"../../../ExitProcessError.js\";\nimport { createFetch } from \"../../createFetch.mjs\";\nimport { fetchWebsiteRepositoryRid } from \"../../third-party-application-service/fetchWebsiteRepositoryRid.mjs\";\nimport { getSiteAssetBaseUrl } from \"./getSiteAssetBaseUrl.mjs\";\nexport async function deleteSiteVersion(baseUrl, thirdPartyAppRid, version) {\n const repositoryRid = await fetchWebsiteRepositoryRid(baseUrl, thirdPartyAppRid);\n const url = `${getSiteAssetBaseUrl(baseUrl, repositoryRid)}/versions/${version}`;\n const fetch = createFetch(() => process.env.FOUNDRY_SDK_AUTH_TOKEN);\n const result = await fetch(url, {\n method: \"DELETE\"\n });\n if (result.status >= 200 && result.status < 300) {\n consola.level = LogLevels.debug;\n consola.debug(`${result.status} - Status Text: '${result.statusText}'`);\n return true;\n } else {\n throw new ExitProcessError(result.status, `Unexpected response code ${result.status} (${result.statusText})`);\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 { createFetchHeaderMutator } from \"@osdk/shared.net\";\nimport { consola } from \"consola\";\nexport function createFetch(tokenProvider, fetchFn = fetch) {\n return createFetchHeaderMutator(createDebugLoggingFetch(fetchFn), async headers => {\n const token = await tokenProvider();\n headers.set(\"Authorization\", `Bearer ${token}`);\n headers.set(\"Fetch-User-Agent\", \"\");\n return headers;\n });\n}\nfunction createDebugLoggingFetch(fetchFn = fetch) {\n return function debugLoggingFetch(input, init) {\n if (typeof input === \"string\" || input instanceof URL) {\n consola.debug(`${init?.method ?? \"GET\"}: ${input.toString().trim()}`);\n } else {\n consola.debug(`${input.method ?? \"GET\"}: ${input.url.toString().trim()}`);\n }\n return fetchFn(input, init).then(a => {\n consola.debug(\"Finished fetch\");\n return a;\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\";\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function fetchWebsiteRepositoryRid(baseUrl, thirdPartyAppRid) {\n const fetch = createFetch(() => process.env.FOUNDRY_SDK_AUTH_TOKEN);\n const url = `\n ${baseUrl}/third-party-application-service/api/application-websites/${thirdPartyAppRid}`;\n const result = await fetch(url);\n if (result.status >= 200 && result.status < 300) {\n const repositoryRid = await result.json();\n consola.debug(`Repository RID: ${repositoryRid}`);\n return repositoryRid;\n }\n throw new Error(`Unexpected response code ${result.status} (${result.statusText})`);\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 function getSiteAssetBaseUrl(foundryBaseUrl, repositoryRid) {\n return `${foundryBaseUrl}/artifacts/api/repositories/${repositoryRid}/contents/release/siteasset`;\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 { createFetch } from \"../../createFetch.mjs\";\nimport { fetchWebsiteRepositoryRid } from \"../../third-party-application-service/fetchWebsiteRepositoryRid.mjs\";\nimport { getSiteAssetBaseUrl } from \"./getSiteAssetBaseUrl.mjs\";\nexport async function fetchSiteVersions(baseUrl, thirdPartyAppRid) {\n const repositoryRid = await fetchWebsiteRepositoryRid(baseUrl, thirdPartyAppRid);\n const url = `${getSiteAssetBaseUrl(baseUrl, repositoryRid)}/versions`;\n const fetch = createFetch(() => process.env.FOUNDRY_SDK_AUTH_TOKEN);\n const result = await fetch(url);\n if (result.status === 200) {\n const response = await result.json();\n return response.versions;\n } else {\n throw new Error(`Unexpected response code ${result.status} (${result.statusText})`);\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, LogLevels } from \"consola\";\nimport { ExitProcessError } from \"../../../ExitProcessError.js\";\nimport { createFetch } from \"../../createFetch.mjs\";\nimport { fetchWebsiteRepositoryRid } from \"../../third-party-application-service/fetchWebsiteRepositoryRid.mjs\";\nimport { getSiteAssetBaseUrl } from \"./getSiteAssetBaseUrl.mjs\";\nexport async function uploadZippedSiteAsset(baseUrl, thirdPartyAppRid, version, zipFile) {\n const repositoryRid = await fetchWebsiteRepositoryRid(baseUrl, thirdPartyAppRid);\n const url = `${getSiteAssetBaseUrl(baseUrl, repositoryRid)}/versions/zip/${version}`;\n const fetch = createFetch(() => process.env.FOUNDRY_SDK_AUTH_TOKEN);\n const result = await fetch(url, {\n method: \"PUT\",\n body: zipFile,\n headers: {\n \"Content-Type\": \"application/octet-stream\"\n },\n duplex: \"half\" // Node hates me\n });\n if (result.status >= 200 && result.status < 300) {\n consola.level = LogLevels.debug;\n consola.debug(\"Status Text: \" + result.statusText);\n return true;\n } else if (result.status === 409) {\n throw new ExitProcessError(result.status, \"Version already exists\");\n } else {\n throw new ExitProcessError(result.status, `Unexpected response code ${result.status} (${result.statusText})`);\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 { createFetch } from \"./createFetch.mjs\";\nexport function createConjureContext(baseUrl, servicePath) {\n return {\n fetchFn: createFetch(() => process.env.FOUNDRY_SDK_AUTH_TOKEN),\n baseUrl,\n servicePath\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 { fetchWebsiteRepositoryRid } from \"./fetchWebsiteRepositoryRid.mjs\";"]}
|