@osdk/cli 0.0.3 → 0.0.4
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/CHANGELOG.md +8 -0
- package/build/js/chunk-3T6ZEX2P.js +12 -0
- package/build/js/chunk-3T6ZEX2P.js.map +1 -0
- package/build/js/chunk-B2HWA3VZ.mjs +5 -0
- package/build/js/chunk-B2HWA3VZ.mjs.map +1 -0
- package/build/js/chunk-LBGQDFFN.js +8 -0
- package/build/js/chunk-LBGQDFFN.js.map +1 -0
- package/build/js/chunk-V7N7LKX3.mjs +10 -0
- package/build/js/chunk-V7N7LKX3.mjs.map +1 -0
- package/build/js/handleSiteDeploy-75PKAAEV.js +11 -0
- package/build/js/handleSiteDeploy-75PKAAEV.js.map +1 -0
- package/build/js/handleSiteDeploy-MCIRO5BB.mjs +9 -0
- package/build/js/handleSiteDeploy-MCIRO5BB.mjs.map +1 -0
- package/build/js/index.js +25 -5
- package/build/js/index.js.map +1 -1
- package/build/js/index.mjs +5 -4
- package/build/js/index.mjs.map +1 -1
- package/build/js/siteDeleteCommand-7QIAJLKJ.mjs +9 -0
- package/build/js/siteDeleteCommand-7QIAJLKJ.mjs.map +1 -0
- package/build/js/siteDeleteCommand-QIT2NBQ5.js +11 -0
- package/build/js/siteDeleteCommand-QIT2NBQ5.js.map +1 -0
- package/build/js/siteUploadCommand-F37O2BSG.mjs +12 -0
- package/build/js/siteUploadCommand-F37O2BSG.mjs.map +1 -0
- package/build/js/siteUploadCommand-SK4GDXFX.js +37 -0
- package/build/js/siteUploadCommand-SK4GDXFX.js.map +1 -0
- package/build/js/siteVersionsCommand-K6M7GBIK.mjs +10 -0
- package/build/js/siteVersionsCommand-K6M7GBIK.mjs.map +1 -0
- package/build/js/siteVersionsCommand-LJJ3SJNM.js +12 -0
- package/build/js/siteVersionsCommand-LJJ3SJNM.js.map +1 -0
- package/build/types/CliCommonArgs.d.ts +3 -0
- package/build/types/cli.d.ts +1 -0
- package/build/types/commands/site/CommonSiteArgs.d.ts +6 -0
- package/build/types/commands/site/delete/DeleteArgs.d.ts +4 -0
- package/build/types/commands/site/delete/index.d.ts +5 -0
- package/build/types/commands/site/delete/siteDeleteCommand.d.mts +2 -0
- package/build/types/commands/site/deploy/SiteDeployArgs.d.ts +5 -0
- package/build/types/commands/site/deploy/handleSiteDeploy.d.mts +2 -0
- package/build/types/commands/site/deploy/index.d.ts +5 -0
- package/build/types/commands/site/index.d.ts +5 -0
- package/build/types/commands/site/upload/UploadArgs.d.ts +1 -1
- package/build/types/commands/site/upload/index.d.ts +1 -1
- package/build/types/commands/site/versions/index.d.ts +1 -1
- package/build/types/commands/site/versions/siteVersionsCommand.d.mts +2 -2
- package/build/types/net/artifacts/SiteAssetArtifactsService/SiteAssetVersions.d.mts +3 -0
- package/build/types/net/artifacts/SiteAssetArtifactsService/deleteSiteVersion.d.mts +2 -0
- package/build/types/net/artifacts/SiteAssetArtifactsService/fetchSiteVersions.d.mts +2 -0
- package/build/types/net/artifacts/SiteAssetArtifactsService/index.d.mts +4 -0
- package/build/types/net/{uploadSiteVersion.d.mts → artifacts/SiteAssetArtifactsService/uploadSiteVersion.d.mts} +1 -4
- package/build/types/net/artifacts/conjure/ArtifactsSitesAdminV2Service/SiteVersion.d.mts +3 -0
- package/build/types/net/artifacts/conjure/ArtifactsSitesAdminV2Service/clearSiteVersion.d.mts +2 -0
- package/build/types/net/artifacts/conjure/ArtifactsSitesAdminV2Service/deploySiteVersion.d.mts +5 -0
- package/build/types/net/artifacts/conjure/ArtifactsSitesAdminV2Service/fetchDeployedVersion.d.mts +3 -0
- package/build/types/net/artifacts/conjure/ArtifactsSitesAdminV2Service/getSitesAdminV2ServiceBaseUrl.d.mts +1 -0
- package/build/types/net/artifacts/conjure/ArtifactsSitesAdminV2Service/index.d.mts +5 -0
- package/build/types/net/artifacts/conjure/index.d.mts +1 -0
- package/build/types/net/artifacts/index.d.mts +2 -0
- package/build/types/net/index.d.mts +2 -0
- package/build/types/net/{fetchWebsiteRepositoryRid.d.mts → third-party-application-service/fetchWebsiteRepositoryRid.d.mts} +2 -2
- package/build/types/net/third-party-application-service/index.d.mts +1 -0
- package/build/types/readCliVersionFromPackageJson.d.ts +1 -0
- package/build/types/yargs/logVersionMiddleware.d.ts +2 -0
- package/package.json +3 -2
- package/build/js/chunk-2DJZUIFP.js +0 -7
- package/build/js/chunk-2DJZUIFP.js.map +0 -1
- package/build/js/chunk-6PVNK2PW.js +0 -13
- package/build/js/chunk-6PVNK2PW.js.map +0 -1
- package/build/js/chunk-MGT3UGXW.mjs +0 -5
- package/build/js/chunk-MGT3UGXW.mjs.map +0 -1
- package/build/js/chunk-YEWM6TCR.mjs +0 -9
- package/build/js/chunk-YEWM6TCR.mjs.map +0 -1
- package/build/js/siteUploadCommand-36HAEYDG.js +0 -37
- package/build/js/siteUploadCommand-36HAEYDG.js.map +0 -1
- package/build/js/siteUploadCommand-L3QDNVWX.mjs +0 -12
- package/build/js/siteUploadCommand-L3QDNVWX.mjs.map +0 -1
- package/build/js/siteVersionsCommand-BQMPCMGZ.mjs +0 -10
- package/build/js/siteVersionsCommand-BQMPCMGZ.mjs.map +0 -1
- package/build/js/siteVersionsCommand-YSV7HQJK.js +0 -12
- package/build/js/siteVersionsCommand-YSV7HQJK.js.map +0 -1
- package/build/types/commands/site/addSiteCommand.d.ts +0 -7
- package/build/types/net/getSiteVersions.d.mts +0 -5
- /package/build/types/net/{getSiteAssetBaseUrl.d.mts → artifacts/SiteAssetArtifactsService/getSiteAssetBaseUrl.d.mts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkLBGQDFFN_js = require('./chunk-LBGQDFFN.js');
|
|
4
|
+
var utils = require('@osdk/api/utils');
|
|
5
|
+
var consola = require('consola');
|
|
6
|
+
|
|
7
|
+
var U={};chunkLBGQDFFN_js.a(U,{SiteAssetArtifactsService:()=>y,conjure:()=>x});var x={};chunkLBGQDFFN_js.a(x,{ArtifactsSitesAdminV2Service:()=>l});var l={};chunkLBGQDFFN_js.a(l,{clearSiteVersion:()=>S,deploySiteVersion:()=>$,fetchDeployedVersion:()=>w});function c(t,s=fetch){return utils.createFetchHeaderMutator(_(s),async e=>{let o=await t();return e.set("Authorization",`Bearer ${o}`),e.set("Fetch-User-Agent",""),e})}function _(t=fetch){return function(e,o){return typeof e=="string"||e instanceof URL?consola.consola.debug(`${o?.method??"GET"}: ${e.toString().trim()}`):consola.consola.debug(`${e.method??"GET"}: ${e.url.toString().trim()}`),t(e,o).then(i=>(consola.consola.debug("Finished fetch"),i))}}async function a(t,s){let e=c(()=>process.env.FOUNDRY_SDK_AUTH_TOKEN),o=`
|
|
8
|
+
${t}/third-party-application-service/api/application-websites/${s}`,i=await e(o);if(i.status>=200&&i.status<300){let r=await i.json();return consola.consola.debug(`Repository RID: ${r}`),r}throw new Error(`Unexpected response code ${i.status} (${i.statusText})`)}function m(t){return `${t}/artifacts/api/sites/v2/admin`}async function S(t,s){let e=await a(t,s),o=`${m(t)}/repository/${e}/deployed-version`,r=await c(()=>process.env.FOUNDRY_SDK_AUTH_TOKEN)(o,{method:"DELETE"});if(r.status>=200&&r.status<300)return !0;throw r.status===400?new Error("Invalid version"):new Error(`Unexpected response code ${r.status} (${r.statusText})`)}async function $(t,s,e){let o=await a(t,s),i=`${m(t)}/repository/${o}/deployed-version`,n=await c(()=>process.env.FOUNDRY_SDK_AUTH_TOKEN)(i,{method:"PUT",body:JSON.stringify({siteVersion:{version:e}}),headers:{"Content-Type":"application/json"}});if(n.status>=200&&n.status<300)return !0;throw n.status===400?new Error("Invalid version"):new Error(`Unexpected response code ${n.status} (${n.statusText})`)}function F(t){return `${t}/artifacts/api/sites/v2/admin`}async function w(t,s){let e=await a(t,s),o=`${F(t)}/repository/${e}/deployed-version`,r=await c(()=>process.env.FOUNDRY_SDK_AUTH_TOKEN)(o,{method:"GET"});if(r.status!==204){if(r.status>=200&&r.status<300)return await r.json();throw new Error(`Unexpected response code ${r.status} (${r.statusText})`)}}var y={};chunkLBGQDFFN_js.a(y,{deleteSiteVersion:()=>R,fetchSiteVersions:()=>v,uploadZippedSiteAsset:()=>E});function f(t,s){return `${t}/artifacts/api/repositories/${s}/contents/release/siteasset`}async function R(t,s,e){let o=await a(t,s),i=`${f(t,o)}/versions/${e}`,n=await c(()=>process.env.FOUNDRY_SDK_AUTH_TOKEN)(i,{method:"DELETE"});if(n.status>=200&&n.status<300)return consola.consola.level=consola.LogLevels.debug,consola.consola.debug(`${n.status} - Status Text: '${n.statusText}'`),!0;throw new chunkLBGQDFFN_js.b(n.status,`Unexpected response code ${n.status} (${n.statusText})`)}async function v(t,s){let e=await a(t,s),o=`${f(t,e)}/versions`,r=await c(()=>process.env.FOUNDRY_SDK_AUTH_TOKEN)(o);if(r.status===200)return (await r.json()).versions;throw new Error(`Unexpected response code ${r.status} (${r.statusText})`)}async function E(t,s,e,o){let i=await a(t,s),r=`${f(t,i)}/versions/zip/${e}`,p=await c(()=>process.env.FOUNDRY_SDK_AUTH_TOKEN)(r,{method:"PUT",body:o,headers:{"Content-Type":"application/octet-stream"},duplex:"half"});if(p.status>=200&&p.status<300)return consola.consola.level=consola.LogLevels.debug,consola.consola.debug("Status Text: "+p.statusText),!0;throw p.status===409?new chunkLBGQDFFN_js.b(p.status,"Version already exists"):new chunkLBGQDFFN_js.b(p.status,`Unexpected response code ${p.status} (${p.statusText})`)}
|
|
9
|
+
|
|
10
|
+
exports.a = U;
|
|
11
|
+
//# sourceMappingURL=out.js.map
|
|
12
|
+
//# sourceMappingURL=chunk-3T6ZEX2P.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/net/artifacts/index.mts","../../src/net/artifacts/conjure/index.mts","../../src/net/artifacts/conjure/ArtifactsSitesAdminV2Service/index.mts","../../src/net/createFetch.mts","../../src/net/third-party-application-service/fetchWebsiteRepositoryRid.mts","../../src/net/artifacts/conjure/ArtifactsSitesAdminV2Service/getSitesAdminV2ServiceBaseUrl.mts","../../src/net/artifacts/conjure/ArtifactsSitesAdminV2Service/clearSiteVersion.mts","../../src/net/artifacts/conjure/ArtifactsSitesAdminV2Service/deploySiteVersion.mts","../../src/net/artifacts/conjure/ArtifactsSitesAdminV2Service/fetchDeployedVersion.mts","../../src/net/artifacts/SiteAssetArtifactsService/index.mts","../../src/net/artifacts/SiteAssetArtifactsService/deleteSiteVersion.mts","../../src/net/artifacts/SiteAssetArtifactsService/getSiteAssetBaseUrl.mts","../../src/net/artifacts/SiteAssetArtifactsService/fetchSiteVersions.mts","../../src/net/artifacts/SiteAssetArtifactsService/uploadSiteVersion.mts"],"names":["artifacts_exports","__export","SiteAssetArtifactsService_exports","conjure_exports","ArtifactsSitesAdminV2Service_exports","clearSiteVersion","deploySiteVersion","fetchDeployedVersion","createFetchHeaderMutator","consola","createFetch","tokenProvider","fetchFn","createDebugLoggingFetch","headers","token","input","init","a","fetchWebsiteRepositoryRid","baseUrl","thirdPartyAppRid","fetch","url","result","repositoryRid","getSitesAdminV2ServiceBaseUrl","version","deleteSiteVersion","fetchSiteVersions","uploadZippedSiteAsset","LogLevels","getSiteAssetBaseUrl","foundryBaseUrl","ExitProcessError","zipFile"],"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 * as conjure from \"./conjure/index.mjs\";\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 * as ArtifactsSitesAdminV2Service from \"./ArtifactsSitesAdminV2Service/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 { clearSiteVersion } from \"./clearSiteVersion.mjs\";\nexport { deploySiteVersion } from \"./deploySiteVersion.mjs\";\nexport { fetchDeployedVersion } from \"./fetchDeployedVersion.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 { createFetchHeaderMutator } from \"@osdk/api/utils\";\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 getSitesAdminV2ServiceBaseUrl(baseUrl) {\n return `${baseUrl}/artifacts/api/sites/v2/admin`;\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 { getSitesAdminV2ServiceBaseUrl } from \"./getSitesAdminV2ServiceBaseUrl.mjs\";\n\n// This is from conjure but the others are not. Interestingly\nexport async function clearSiteVersion(baseUrl, thirdPartyAppRid) {\n const repositoryRid = await fetchWebsiteRepositoryRid(baseUrl, thirdPartyAppRid);\n const url = `${getSitesAdminV2ServiceBaseUrl(baseUrl)}/repository/${repositoryRid}/deployed-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 return true;\n } else if (result.status === 400) {\n throw new Error(\"Invalid version\");\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 { createFetch } from \"../../../createFetch.mjs\";\nimport { fetchWebsiteRepositoryRid } from \"../../../third-party-application-service/fetchWebsiteRepositoryRid.mjs\";\nimport { getSitesAdminV2ServiceBaseUrl } from \"./getSitesAdminV2ServiceBaseUrl.mjs\";\n// This is from conjure but the others are not. Interestingly\nexport async function deploySiteVersion(baseUrl, thirdPartyAppRid, version) {\n const repositoryRid = await fetchWebsiteRepositoryRid(baseUrl, thirdPartyAppRid);\n const url = `${getSitesAdminV2ServiceBaseUrl(baseUrl)}/repository/${repositoryRid}/deployed-version`;\n const fetch = createFetch(() => process.env.FOUNDRY_SDK_AUTH_TOKEN);\n const result = await fetch(url, {\n method: \"PUT\",\n body: JSON.stringify({\n siteVersion: {\n version\n }\n }),\n headers: {\n \"Content-Type\": \"application/json\"\n }\n });\n if (result.status >= 200 && result.status < 300) {\n return true;\n } else if (result.status === 400) {\n throw new Error(\"Invalid version\");\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 { createFetch } from \"../../../createFetch.mjs\";\nimport { fetchWebsiteRepositoryRid } from \"../../../third-party-application-service/fetchWebsiteRepositoryRid.mjs\";\nfunction getSitesAdminV2ServiceBaseUrl(baseUrl) {\n return `${baseUrl}/artifacts/api/sites/v2/admin`;\n}\n\n// This is from conjure but the others are not. Interestingly\nexport async function fetchDeployedVersion(baseUrl, thirdPartyAppRid) {\n const repositoryRid = await fetchWebsiteRepositoryRid(baseUrl, thirdPartyAppRid);\n const url = `${getSitesAdminV2ServiceBaseUrl(baseUrl)}/repository/${repositoryRid}/deployed-version`;\n const fetch = createFetch(() => process.env.FOUNDRY_SDK_AUTH_TOKEN);\n const result = await fetch(url, {\n method: \"GET\"\n });\n if (result.status === 204) {\n return undefined;\n } else if (result.status >= 200 && result.status < 300) {\n return await result.json();\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\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\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\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}"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var t=Object.defineProperty;var c=(o,r)=>{for(var e in r)t(o,e,{get:r[e],enumerable:!0});};var s=class extends Error{constructor(r,e){super(e),this.errorCode=r;}};
|
|
2
|
+
|
|
3
|
+
export { c as a, s as b };
|
|
4
|
+
//# sourceMappingURL=out.js.map
|
|
5
|
+
//# sourceMappingURL=chunk-B2HWA3VZ.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/ExitProcessError.ts"],"names":["ExitProcessError","errorCode","msg"],"mappings":"0FAgBO,IAAMA,EAAN,cAA+B,KAAM,CAC1C,YAAYC,EAAWC,EAAK,CAC1B,MAAMA,CAAG,EACT,KAAK,UAAYD,CACnB,CACF","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 class ExitProcessError extends Error {\n constructor(errorCode, msg) {\n super(msg);\n this.errorCode = errorCode;\n }\n}"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var t=Object.defineProperty;var c=(o,r)=>{for(var e in r)t(o,e,{get:r[e],enumerable:!0});};var s=class extends Error{constructor(r,e){super(e),this.errorCode=r;}};
|
|
4
|
+
|
|
5
|
+
exports.a = c;
|
|
6
|
+
exports.b = s;
|
|
7
|
+
//# sourceMappingURL=out.js.map
|
|
8
|
+
//# sourceMappingURL=chunk-LBGQDFFN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/ExitProcessError.ts"],"names":["ExitProcessError","errorCode","msg"],"mappings":"0FAgBO,IAAMA,EAAN,cAA+B,KAAM,CAC1C,YAAYC,EAAWC,EAAK,CAC1B,MAAMA,CAAG,EACT,KAAK,UAAYD,CACnB,CACF","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 class ExitProcessError extends Error {\n constructor(errorCode, msg) {\n super(msg);\n this.errorCode = errorCode;\n }\n}"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a as a$1, b } from './chunk-B2HWA3VZ.mjs';
|
|
2
|
+
import { createFetchHeaderMutator } from '@osdk/api/utils';
|
|
3
|
+
import { consola, LogLevels } from 'consola';
|
|
4
|
+
|
|
5
|
+
var U={};a$1(U,{SiteAssetArtifactsService:()=>y,conjure:()=>x});var x={};a$1(x,{ArtifactsSitesAdminV2Service:()=>l});var l={};a$1(l,{clearSiteVersion:()=>S,deploySiteVersion:()=>$,fetchDeployedVersion:()=>w});function c(t,s=fetch){return createFetchHeaderMutator(_(s),async e=>{let o=await t();return e.set("Authorization",`Bearer ${o}`),e.set("Fetch-User-Agent",""),e})}function _(t=fetch){return function(e,o){return typeof e=="string"||e instanceof URL?consola.debug(`${o?.method??"GET"}: ${e.toString().trim()}`):consola.debug(`${e.method??"GET"}: ${e.url.toString().trim()}`),t(e,o).then(i=>(consola.debug("Finished fetch"),i))}}async function a(t,s){let e=c(()=>process.env.FOUNDRY_SDK_AUTH_TOKEN),o=`
|
|
6
|
+
${t}/third-party-application-service/api/application-websites/${s}`,i=await e(o);if(i.status>=200&&i.status<300){let r=await i.json();return consola.debug(`Repository RID: ${r}`),r}throw new Error(`Unexpected response code ${i.status} (${i.statusText})`)}function m(t){return `${t}/artifacts/api/sites/v2/admin`}async function S(t,s){let e=await a(t,s),o=`${m(t)}/repository/${e}/deployed-version`,r=await c(()=>process.env.FOUNDRY_SDK_AUTH_TOKEN)(o,{method:"DELETE"});if(r.status>=200&&r.status<300)return !0;throw r.status===400?new Error("Invalid version"):new Error(`Unexpected response code ${r.status} (${r.statusText})`)}async function $(t,s,e){let o=await a(t,s),i=`${m(t)}/repository/${o}/deployed-version`,n=await c(()=>process.env.FOUNDRY_SDK_AUTH_TOKEN)(i,{method:"PUT",body:JSON.stringify({siteVersion:{version:e}}),headers:{"Content-Type":"application/json"}});if(n.status>=200&&n.status<300)return !0;throw n.status===400?new Error("Invalid version"):new Error(`Unexpected response code ${n.status} (${n.statusText})`)}function F(t){return `${t}/artifacts/api/sites/v2/admin`}async function w(t,s){let e=await a(t,s),o=`${F(t)}/repository/${e}/deployed-version`,r=await c(()=>process.env.FOUNDRY_SDK_AUTH_TOKEN)(o,{method:"GET"});if(r.status!==204){if(r.status>=200&&r.status<300)return await r.json();throw new Error(`Unexpected response code ${r.status} (${r.statusText})`)}}var y={};a$1(y,{deleteSiteVersion:()=>R,fetchSiteVersions:()=>v,uploadZippedSiteAsset:()=>E});function f(t,s){return `${t}/artifacts/api/repositories/${s}/contents/release/siteasset`}async function R(t,s,e){let o=await a(t,s),i=`${f(t,o)}/versions/${e}`,n=await c(()=>process.env.FOUNDRY_SDK_AUTH_TOKEN)(i,{method:"DELETE"});if(n.status>=200&&n.status<300)return consola.level=LogLevels.debug,consola.debug(`${n.status} - Status Text: '${n.statusText}'`),!0;throw new b(n.status,`Unexpected response code ${n.status} (${n.statusText})`)}async function v(t,s){let e=await a(t,s),o=`${f(t,e)}/versions`,r=await c(()=>process.env.FOUNDRY_SDK_AUTH_TOKEN)(o);if(r.status===200)return (await r.json()).versions;throw new Error(`Unexpected response code ${r.status} (${r.statusText})`)}async function E(t,s,e,o){let i=await a(t,s),r=`${f(t,i)}/versions/zip/${e}`,p=await c(()=>process.env.FOUNDRY_SDK_AUTH_TOKEN)(r,{method:"PUT",body:o,headers:{"Content-Type":"application/octet-stream"},duplex:"half"});if(p.status>=200&&p.status<300)return consola.level=LogLevels.debug,consola.debug("Status Text: "+p.statusText),!0;throw p.status===409?new b(p.status,"Version already exists"):new b(p.status,`Unexpected response code ${p.status} (${p.statusText})`)}
|
|
7
|
+
|
|
8
|
+
export { U as a };
|
|
9
|
+
//# sourceMappingURL=out.js.map
|
|
10
|
+
//# sourceMappingURL=chunk-V7N7LKX3.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/net/artifacts/index.mts","../../src/net/artifacts/conjure/index.mts","../../src/net/artifacts/conjure/ArtifactsSitesAdminV2Service/index.mts","../../src/net/createFetch.mts","../../src/net/third-party-application-service/fetchWebsiteRepositoryRid.mts","../../src/net/artifacts/conjure/ArtifactsSitesAdminV2Service/getSitesAdminV2ServiceBaseUrl.mts","../../src/net/artifacts/conjure/ArtifactsSitesAdminV2Service/clearSiteVersion.mts","../../src/net/artifacts/conjure/ArtifactsSitesAdminV2Service/deploySiteVersion.mts","../../src/net/artifacts/conjure/ArtifactsSitesAdminV2Service/fetchDeployedVersion.mts","../../src/net/artifacts/SiteAssetArtifactsService/index.mts","../../src/net/artifacts/SiteAssetArtifactsService/deleteSiteVersion.mts","../../src/net/artifacts/SiteAssetArtifactsService/getSiteAssetBaseUrl.mts","../../src/net/artifacts/SiteAssetArtifactsService/fetchSiteVersions.mts","../../src/net/artifacts/SiteAssetArtifactsService/uploadSiteVersion.mts"],"names":["artifacts_exports","__export","SiteAssetArtifactsService_exports","conjure_exports","ArtifactsSitesAdminV2Service_exports","clearSiteVersion","deploySiteVersion","fetchDeployedVersion","createFetchHeaderMutator","consola","createFetch","tokenProvider","fetchFn","createDebugLoggingFetch","headers","token","input","init","a","fetchWebsiteRepositoryRid","baseUrl","thirdPartyAppRid","fetch","url","result","repositoryRid","getSitesAdminV2ServiceBaseUrl","version","deleteSiteVersion","fetchSiteVersions","uploadZippedSiteAsset","LogLevels","getSiteAssetBaseUrl","foundryBaseUrl","ExitProcessError","zipFile"],"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 * as conjure from \"./conjure/index.mjs\";\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 * as ArtifactsSitesAdminV2Service from \"./ArtifactsSitesAdminV2Service/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 { clearSiteVersion } from \"./clearSiteVersion.mjs\";\nexport { deploySiteVersion } from \"./deploySiteVersion.mjs\";\nexport { fetchDeployedVersion } from \"./fetchDeployedVersion.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 { createFetchHeaderMutator } from \"@osdk/api/utils\";\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 getSitesAdminV2ServiceBaseUrl(baseUrl) {\n return `${baseUrl}/artifacts/api/sites/v2/admin`;\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 { getSitesAdminV2ServiceBaseUrl } from \"./getSitesAdminV2ServiceBaseUrl.mjs\";\n\n// This is from conjure but the others are not. Interestingly\nexport async function clearSiteVersion(baseUrl, thirdPartyAppRid) {\n const repositoryRid = await fetchWebsiteRepositoryRid(baseUrl, thirdPartyAppRid);\n const url = `${getSitesAdminV2ServiceBaseUrl(baseUrl)}/repository/${repositoryRid}/deployed-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 return true;\n } else if (result.status === 400) {\n throw new Error(\"Invalid version\");\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 { createFetch } from \"../../../createFetch.mjs\";\nimport { fetchWebsiteRepositoryRid } from \"../../../third-party-application-service/fetchWebsiteRepositoryRid.mjs\";\nimport { getSitesAdminV2ServiceBaseUrl } from \"./getSitesAdminV2ServiceBaseUrl.mjs\";\n// This is from conjure but the others are not. Interestingly\nexport async function deploySiteVersion(baseUrl, thirdPartyAppRid, version) {\n const repositoryRid = await fetchWebsiteRepositoryRid(baseUrl, thirdPartyAppRid);\n const url = `${getSitesAdminV2ServiceBaseUrl(baseUrl)}/repository/${repositoryRid}/deployed-version`;\n const fetch = createFetch(() => process.env.FOUNDRY_SDK_AUTH_TOKEN);\n const result = await fetch(url, {\n method: \"PUT\",\n body: JSON.stringify({\n siteVersion: {\n version\n }\n }),\n headers: {\n \"Content-Type\": \"application/json\"\n }\n });\n if (result.status >= 200 && result.status < 300) {\n return true;\n } else if (result.status === 400) {\n throw new Error(\"Invalid version\");\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 { createFetch } from \"../../../createFetch.mjs\";\nimport { fetchWebsiteRepositoryRid } from \"../../../third-party-application-service/fetchWebsiteRepositoryRid.mjs\";\nfunction getSitesAdminV2ServiceBaseUrl(baseUrl) {\n return `${baseUrl}/artifacts/api/sites/v2/admin`;\n}\n\n// This is from conjure but the others are not. Interestingly\nexport async function fetchDeployedVersion(baseUrl, thirdPartyAppRid) {\n const repositoryRid = await fetchWebsiteRepositoryRid(baseUrl, thirdPartyAppRid);\n const url = `${getSitesAdminV2ServiceBaseUrl(baseUrl)}/repository/${repositoryRid}/deployed-version`;\n const fetch = createFetch(() => process.env.FOUNDRY_SDK_AUTH_TOKEN);\n const result = await fetch(url, {\n method: \"GET\"\n });\n if (result.status === 204) {\n return undefined;\n } else if (result.status >= 200 && result.status < 300) {\n return await result.json();\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\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\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\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}"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk3T6ZEX2P_js = require('./chunk-3T6ZEX2P.js');
|
|
4
|
+
require('./chunk-LBGQDFFN.js');
|
|
5
|
+
var consola = require('consola');
|
|
6
|
+
|
|
7
|
+
async function o(e){e.siteVersion?await chunk3T6ZEX2P_js.a.conjure.ArtifactsSitesAdminV2Service.deploySiteVersion(e.baseUrl,e.appRid,e.siteVersion):e.clearVersion&&await chunk3T6ZEX2P_js.a.conjure.ArtifactsSitesAdminV2Service.clearSiteVersion(e.baseUrl,e.appRid),consola.consola.success("Deploy successful");}
|
|
8
|
+
|
|
9
|
+
module.exports = o;
|
|
10
|
+
//# sourceMappingURL=out.js.map
|
|
11
|
+
//# sourceMappingURL=handleSiteDeploy-75PKAAEV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/commands/site/deploy/handleSiteDeploy.mts"],"names":["consola","handleSiteDeploy","args","artifacts_exports"],"mappings":"oEAgBA,OAAS,WAAAA,MAAe,UAExB,eAAOC,EAAwCC,EAAM,CAC/CA,EAAK,YACP,MAAMC,EAAU,QAAQ,6BAA6B,kBAAkBD,EAAK,QAASA,EAAK,OAAQA,EAAK,WAAW,EACzGA,EAAK,cACd,MAAMC,EAAU,QAAQ,6BAA6B,iBAAiBD,EAAK,QAASA,EAAK,MAAM,EAEjGF,EAAQ,QAAQ,mBAAmB,CACrC","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nimport { artifacts } from \"../../../net/index.mjs\";\nexport default async function handleSiteDeploy(args) {\n if (args.siteVersion) {\n await artifacts.conjure.ArtifactsSitesAdminV2Service.deploySiteVersion(args.baseUrl, args.appRid, args.siteVersion);\n } else if (args.clearVersion) {\n await artifacts.conjure.ArtifactsSitesAdminV2Service.clearSiteVersion(args.baseUrl, args.appRid);\n }\n consola.success(\"Deploy successful\");\n}"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { a } from './chunk-V7N7LKX3.mjs';
|
|
2
|
+
import './chunk-B2HWA3VZ.mjs';
|
|
3
|
+
import { consola } from 'consola';
|
|
4
|
+
|
|
5
|
+
async function o(e){e.siteVersion?await a.conjure.ArtifactsSitesAdminV2Service.deploySiteVersion(e.baseUrl,e.appRid,e.siteVersion):e.clearVersion&&await a.conjure.ArtifactsSitesAdminV2Service.clearSiteVersion(e.baseUrl,e.appRid),consola.success("Deploy successful");}
|
|
6
|
+
|
|
7
|
+
export { o as default };
|
|
8
|
+
//# sourceMappingURL=out.js.map
|
|
9
|
+
//# sourceMappingURL=handleSiteDeploy-MCIRO5BB.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/commands/site/deploy/handleSiteDeploy.mts"],"names":["consola","handleSiteDeploy","args","artifacts_exports"],"mappings":"sEAgBA,OAAS,WAAAA,MAAe,UAExB,eAAOC,EAAwCC,EAAM,CAC/CA,EAAK,YACP,MAAMC,EAAU,QAAQ,6BAA6B,kBAAkBD,EAAK,QAASA,EAAK,OAAQA,EAAK,WAAW,EACzGA,EAAK,cACd,MAAMC,EAAU,QAAQ,6BAA6B,iBAAiBD,EAAK,QAASA,EAAK,MAAM,EAEjGF,EAAQ,QAAQ,mBAAmB,CACrC","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nimport { artifacts } from \"../../../net/index.mjs\";\nexport default async function handleSiteDeploy(args) {\n if (args.siteVersion) {\n await artifacts.conjure.ArtifactsSitesAdminV2Service.deploySiteVersion(args.baseUrl, args.appRid, args.siteVersion);\n } else if (args.clearVersion) {\n await artifacts.conjure.ArtifactsSitesAdminV2Service.clearSiteVersion(args.baseUrl, args.appRid);\n }\n consola.success(\"Deploy successful\");\n}"]}
|
package/build/js/index.js
CHANGED
|
@@ -1,15 +1,35 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkLBGQDFFN_js = require('./chunk-LBGQDFFN.js');
|
|
4
|
+
var v = require('yargs');
|
|
5
5
|
var helpers = require('yargs/helpers');
|
|
6
|
+
var m = require('fs');
|
|
6
7
|
|
|
7
8
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
function _interopNamespace(e) {
|
|
11
|
+
if (e && e.__esModule) return e;
|
|
12
|
+
var n = Object.create(null);
|
|
13
|
+
if (e) {
|
|
14
|
+
Object.keys(e).forEach(function (k) {
|
|
15
|
+
if (k !== 'default') {
|
|
16
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
17
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () { return e[k]; }
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
n.default = e;
|
|
25
|
+
return Object.freeze(n);
|
|
26
|
+
}
|
|
10
27
|
|
|
11
|
-
var
|
|
28
|
+
var v__default = /*#__PURE__*/_interopDefault(v);
|
|
29
|
+
var m__namespace = /*#__PURE__*/_interopNamespace(m);
|
|
12
30
|
|
|
13
|
-
|
|
31
|
+
var u={command:"delete",describe:"Delete an uploaded version",builder:o=>o.option("siteVersion",{type:"string",demandOption:!0}).option("dir",{type:"string"}),handler:async o=>{await(await import('./siteDeleteCommand-QIT2NBQ5.js')).default(o);}},t=u;var f={command:"deploy",describe:"Deploy an uploaded version",builder:o=>o.options({siteVersion:{type:"string",conflicts:"clearVersion"},undeploy:{alias:"clearVersion",description:"Causes the site to no longer be deployed",type:"boolean",conflicts:"siteVersion"}}).group(["siteVersion","clearVersion"],"Version To Deploy (requires one of)"),handler:async o=>{await(await import('./handleSiteDeploy-75PKAAEV.js')).default(o);}},a=f;var g={command:"upload",describe:"Upload an application version",builder:o=>o.option("siteVersion",{type:"string",demandOption:!0}).option("dir",{type:"string"}),handler:async o=>{await(await import('./siteUploadCommand-SK4GDXFX.js')).default(o);}},i=g;var y={command:"versions",describe:"List application versions",builder:o=>o,handler:async o=>{await(await import('./siteVersionsCommand-LJJ3SJNM.js')).default(o);}},s=y;var b={command:"site",describe:"Manage your site",builder:o=>o.options({appRid:{type:"string",demandOption:!0,coerce:e=>e},baseUrl:{type:"string",demandOption:!0}}).group(["appRid","baseUrl"],"Common Arguments").command(s).command(i).command(t).command(a).demandCommand(),handler:async o=>{}},d=b;async function c(){let{findUp:o}=await import('find-up'),e=await o("package.json");if(!e)return "(unknown version. No package.json found)";let n=JSON.parse(await m__namespace.promises.readFile(e,"utf-8"));return n.version?`v${n.version}`:"(unknown version. No version in package.json found)"}var p=!0;async function l(o){if(p){let n=(await import('consola')).consola;n.info(`Palantir OSDK CLI ${await c()}`),n.level=3+o.verbose,n.level>3&&n.debug(`Verbose logging enabled (${n.level===4?"debug":"trace"})`),console.log(),p=!1;}}async function x(o=process.argv){let e=v__default.default(helpers.hideBin(o)).env("OSDK").version(!1).option("verbose",{alias:"v",type:"boolean",description:"Enable verbose logging",count:!0}).demandCommand().middleware(l,!0).strict().command(d);try{return e.parseAsync()}catch(n){n instanceof chunkLBGQDFFN_js.b&&(await import('consola')).consola.error(n.message);}}
|
|
32
|
+
|
|
33
|
+
exports.cli = x;
|
|
14
34
|
//# sourceMappingURL=out.js.map
|
|
15
35
|
//# sourceMappingURL=index.js.map
|
package/build/js/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cli.ts","../../src/commands/site/upload/index.ts","../../src/commands/site/versions/index.ts","../../src/commands/site/addSiteCommand.ts"],"names":["yargs","hideBin","command","argv","args","upload_default","versions_default","addSiteCommand","originalYargs","a","cli","base","Consola","e","ExitProcessError"],"mappings":"wCAgBA,OAAOA,MAAW,QAClB,OAAS,WAAAC,MAAe,gBCDjB,IAAMC,EAAU,CACrB,QAAS,SACT,SAAU,gCACV,QAASC,GACAA,EAAK,OAAO,cAAe,CAChC,KAAM,SACN,aAAc,EAChB,CAAC,EAAE,OAAO,MAAO,CACf,KAAM,QACR,CAAC,EAEH,QAAS,MAAMC,GAAQ,CAErB,MADgB,KAAM,QAAO,iCAAyB,GACxC,QAAQA,CAAI,CAC5B,CACF,EACOC,EAAQH,EChBR,IAAMA,EAAU,CACrB,QAAS,WACT,SAAU,4BACV,QAASC,GACAA,EAET,QAAS,MAAMC,GAAQ,CAErB,MADgB,KAAM,QAAO,mCAA2B,GAC1C,QAAQA,CAAI,CAC5B,CACF,EACOE,EAAQJ,ECTA,SAARK,EAAgCP,EAAO,CAC5C,OAAOA,EAAM,QAAQ,OAAQ,mBAAoBQ,GAAiB,CAChE,IAAMR,EAAQQ,EAAc,QAAQ,CAClC,OAAQ,CACN,KAAM,SACN,aAAc,GACd,OAAQC,GAAKA,CACf,EACA,QAAS,CACP,KAAM,SACN,aAAc,EAChB,CACF,CAAC,EAAE,cAAc,EACjB,OAAAT,EAAM,QAAQM,CAAQ,EACtBN,EAAM,QAAQK,CAAM,EACbL,CACT,EAAGI,GAAQ,CAAC,CAAC,CACf,CHfA,eAAsBM,EAAIN,EAAO,QAAQ,KAAM,CAC7C,IAAMO,EAAOX,EAAMC,EAAQG,CAAI,CAAC,EAAE,IAAI,MAAM,EACtCQ,EAAU,KAAM,QAAO,SAAS,EAGtCL,EAAeI,CAAI,EACnBA,EAAK,cAAc,EAAE,OAAO,EAC5B,GAAI,CACF,OAAOA,EAAK,WAAW,CACzB,OAASE,EAAG,CACNA,aAAaC,GACfF,EAAQ,QAAQ,MAAMC,EAAE,OAAO,CAEnC,CACF","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport addSiteCommand from \"./commands/site/addSiteCommand\";\nimport { ExitProcessError } from \"./ExitProcessError.js\";\nexport async function cli(args = process.argv) {\n const base = yargs(hideBin(args)).env(\"OSDK\");\n const Consola = await import(\"consola\");\n // Consola.default.level = Consola.LogLevels.debug;\n\n addSiteCommand(base);\n base.demandCommand().strict();\n try {\n return base.parseAsync();\n } catch (e) {\n if (e instanceof ExitProcessError) {\n Consola.consola.error(e.message);\n }\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const command = {\n command: \"upload\",\n describe: \"Upload an application version\",\n builder: argv => {\n return argv.option(\"siteVersion\", {\n type: \"string\",\n demandOption: true\n }).option(\"dir\", {\n type: \"string\"\n });\n },\n handler: async args => {\n const command = await import(\"./siteUploadCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const command = {\n command: \"versions\",\n describe: \"List application versions\",\n builder: argv => {\n return argv;\n },\n handler: async args => {\n const command = await import(\"./siteVersionsCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport upload from \"./upload\";\nimport versions from \"./versions\";\nexport default function addSiteCommand(yargs) {\n return yargs.command(\"site\", \"Manage your site\", originalYargs => {\n const yargs = originalYargs.options({\n appRid: {\n type: \"string\",\n demandOption: true,\n coerce: a => a\n },\n baseUrl: {\n type: \"string\",\n demandOption: true\n }\n }).demandCommand();\n yargs.command(versions);\n yargs.command(upload);\n return yargs;\n }, args => {});\n}"]}
|
|
1
|
+
{"version":3,"sources":["../../src/cli.ts","../../src/commands/site/delete/index.ts","../../src/commands/site/deploy/index.ts","../../src/commands/site/upload/index.ts","../../src/commands/site/versions/index.ts","../../src/commands/site/index.ts","../../src/readCliVersionFromPackageJson.ts","../../src/yargs/logVersionMiddleware.ts"],"names":["yargs","hideBin","command","argv","args","delete_default","deploy_default","upload_default","versions_default","site","a","site_default","fs","readCliVersionFromPackageJson","findUp","result","packageJson","firstTime","logVersionMiddleware","consola","cli","base","e","ExitProcessError"],"mappings":"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","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport site from \"./commands/site\";\nimport { ExitProcessError } from \"./ExitProcessError.js\";\nimport { logVersionMiddleware } from \"./yargs/logVersionMiddleware\";\nexport async function cli(args = process.argv) {\n const base = yargs(hideBin(args)).env(\"OSDK\").version(false).option(\"verbose\", {\n alias: \"v\",\n type: \"boolean\",\n description: \"Enable verbose logging\",\n count: true\n }).demandCommand().middleware(logVersionMiddleware, true).strict().command(site);\n try {\n return base.parseAsync();\n } catch (e) {\n if (e instanceof ExitProcessError) {\n const Consola = await import(\"consola\");\n Consola.consola.error(e.message);\n }\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const command = {\n command: \"delete\",\n describe: \"Delete an uploaded version\",\n builder: argv => {\n return argv.option(\"siteVersion\", {\n type: \"string\",\n demandOption: true\n }).option(\"dir\", {\n type: \"string\"\n });\n },\n handler: async args => {\n const command = await import(\"./siteDeleteCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const command = {\n command: \"deploy\",\n describe: \"Deploy an uploaded version\",\n builder: argv => {\n return argv.options({\n \"siteVersion\": {\n type: \"string\",\n conflicts: \"clearVersion\"\n // group: \"Deploy Version\",\n // implies: { \"clearVersion\": \"false\" },\n },\n\n undeploy: {\n alias: \"clearVersion\",\n description: \"Causes the site to no longer be deployed\",\n type: \"boolean\",\n conflicts: \"siteVersion\"\n // group: \"Deploy Version\",\n // implies: { \"siteVersion\": \"\" },\n }\n }).group([\"siteVersion\", \"clearVersion\"], \"Version To Deploy (requires one of)\");\n\n // .check((args) => {\n // if (\n // (args.siteVersion && args.clearVersion)\n // || (!args.siteVersion && args.clearVersion == undefined)\n // ) {\n // // consola.error(\"Only one of --siteVersion or --clearVersion may be provided\");\n // throw new Error(\n // \"Only one of --siteVersion or --clearVersion may be provided\",\n // );\n // }\n // });\n },\n\n handler: async args => {\n const command = await import(\"./handleSiteDeploy.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const command = {\n command: \"upload\",\n describe: \"Upload an application version\",\n builder: argv => {\n return argv.option(\"siteVersion\", {\n type: \"string\",\n demandOption: true\n }).option(\"dir\", {\n type: \"string\"\n });\n },\n handler: async args => {\n const command = await import(\"./siteUploadCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const command = {\n command: \"versions\",\n describe: \"List application versions\",\n builder: argv => {\n return argv;\n },\n handler: async args => {\n const command = await import(\"./siteVersionsCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport siteDelete from \"./delete\";\nimport siteDeploy from \"./deploy\";\nimport upload from \"./upload\";\nimport versions from \"./versions\";\nconst site = {\n command: \"site\",\n describe: \"Manage your site\",\n builder: argv => {\n return argv.options({\n appRid: {\n type: \"string\",\n demandOption: true,\n coerce: a => a\n },\n baseUrl: {\n type: \"string\",\n demandOption: true\n }\n }).group([\"appRid\", \"baseUrl\"], \"Common Arguments\").command(versions).command(upload).command(siteDelete).command(siteDeploy).demandCommand();\n },\n handler: async args => {}\n};\nexport default site;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as fs from \"node:fs\";\nexport async function readCliVersionFromPackageJson() {\n const {\n findUp\n } = await import(\"find-up\");\n const result = await findUp(\"package.json\");\n if (!result) {\n return \"(unknown version. No package.json found)\";\n }\n const packageJson = JSON.parse(await fs.promises.readFile(result, \"utf-8\"));\n if (packageJson.version) {\n return `v${packageJson.version}`;\n } else {\n return \"(unknown version. No version in package.json found)\";\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 { readCliVersionFromPackageJson } from \"../readCliVersionFromPackageJson\";\nlet firstTime = true;\nexport async function logVersionMiddleware(args) {\n if (firstTime) {\n const Consola = await import(\"consola\");\n // This will be called before any command is executed\n const consola = Consola.consola;\n consola.info(`Palantir OSDK CLI ${await readCliVersionFromPackageJson()}`);\n consola.level = 3 + args.verbose; // so 1 -v is debug logs and -vv is trace\n if (consola.level > 3) {\n consola.debug(`Verbose logging enabled (${consola.level === 4 ? \"debug\" : \"trace\"})`);\n }\n\n // eslint-disable-next-line no-console\n console.log(); // Not consola. Just want a blank line\n firstTime = false;\n }\n}"]}
|
package/build/js/index.mjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { b as b$1 } from './chunk-B2HWA3VZ.mjs';
|
|
2
|
+
import v from 'yargs';
|
|
3
3
|
import { hideBin } from 'yargs/helpers';
|
|
4
|
+
import * as m from 'fs';
|
|
4
5
|
|
|
5
|
-
var
|
|
6
|
+
var u={command:"delete",describe:"Delete an uploaded version",builder:o=>o.option("siteVersion",{type:"string",demandOption:!0}).option("dir",{type:"string"}),handler:async o=>{await(await import('./siteDeleteCommand-7QIAJLKJ.mjs')).default(o);}},t=u;var f={command:"deploy",describe:"Deploy an uploaded version",builder:o=>o.options({siteVersion:{type:"string",conflicts:"clearVersion"},undeploy:{alias:"clearVersion",description:"Causes the site to no longer be deployed",type:"boolean",conflicts:"siteVersion"}}).group(["siteVersion","clearVersion"],"Version To Deploy (requires one of)"),handler:async o=>{await(await import('./handleSiteDeploy-MCIRO5BB.mjs')).default(o);}},a=f;var g={command:"upload",describe:"Upload an application version",builder:o=>o.option("siteVersion",{type:"string",demandOption:!0}).option("dir",{type:"string"}),handler:async o=>{await(await import('./siteUploadCommand-F37O2BSG.mjs')).default(o);}},i=g;var y={command:"versions",describe:"List application versions",builder:o=>o,handler:async o=>{await(await import('./siteVersionsCommand-K6M7GBIK.mjs')).default(o);}},s=y;var b={command:"site",describe:"Manage your site",builder:o=>o.options({appRid:{type:"string",demandOption:!0,coerce:e=>e},baseUrl:{type:"string",demandOption:!0}}).group(["appRid","baseUrl"],"Common Arguments").command(s).command(i).command(t).command(a).demandCommand(),handler:async o=>{}},d=b;async function c(){let{findUp:o}=await import('find-up'),e=await o("package.json");if(!e)return "(unknown version. No package.json found)";let n=JSON.parse(await m.promises.readFile(e,"utf-8"));return n.version?`v${n.version}`:"(unknown version. No version in package.json found)"}var p=!0;async function l(o){if(p){let n=(await import('consola')).consola;n.info(`Palantir OSDK CLI ${await c()}`),n.level=3+o.verbose,n.level>3&&n.debug(`Verbose logging enabled (${n.level===4?"debug":"trace"})`),console.log(),p=!1;}}async function x(o=process.argv){let e=v(hideBin(o)).env("OSDK").version(!1).option("verbose",{alias:"v",type:"boolean",description:"Enable verbose logging",count:!0}).demandCommand().middleware(l,!0).strict().command(d);try{return e.parseAsync()}catch(n){n instanceof b$1&&(await import('consola')).consola.error(n.message);}}
|
|
6
7
|
|
|
7
|
-
export {
|
|
8
|
+
export { x as cli };
|
|
8
9
|
//# sourceMappingURL=out.js.map
|
|
9
10
|
//# sourceMappingURL=index.mjs.map
|
package/build/js/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cli.ts","../../src/commands/site/upload/index.ts","../../src/commands/site/versions/index.ts","../../src/commands/site/addSiteCommand.ts"],"names":["yargs","hideBin","command","argv","args","upload_default","versions_default","addSiteCommand","originalYargs","a","cli","base","Consola","e","ExitProcessError"],"mappings":"yCAgBA,OAAOA,MAAW,QAClB,OAAS,WAAAC,MAAe,gBCDjB,IAAMC,EAAU,CACrB,QAAS,SACT,SAAU,gCACV,QAASC,GACAA,EAAK,OAAO,cAAe,CAChC,KAAM,SACN,aAAc,EAChB,CAAC,EAAE,OAAO,MAAO,CACf,KAAM,QACR,CAAC,EAEH,QAAS,MAAMC,GAAQ,CAErB,MADgB,KAAM,QAAO,kCAAyB,GACxC,QAAQA,CAAI,CAC5B,CACF,EACOC,EAAQH,EChBR,IAAMA,EAAU,CACrB,QAAS,WACT,SAAU,4BACV,QAASC,GACAA,EAET,QAAS,MAAMC,GAAQ,CAErB,MADgB,KAAM,QAAO,oCAA2B,GAC1C,QAAQA,CAAI,CAC5B,CACF,EACOE,EAAQJ,ECTA,SAARK,EAAgCP,EAAO,CAC5C,OAAOA,EAAM,QAAQ,OAAQ,mBAAoBQ,GAAiB,CAChE,IAAMR,EAAQQ,EAAc,QAAQ,CAClC,OAAQ,CACN,KAAM,SACN,aAAc,GACd,OAAQC,GAAKA,CACf,EACA,QAAS,CACP,KAAM,SACN,aAAc,EAChB,CACF,CAAC,EAAE,cAAc,EACjB,OAAAT,EAAM,QAAQM,CAAQ,EACtBN,EAAM,QAAQK,CAAM,EACbL,CACT,EAAGI,GAAQ,CAAC,CAAC,CACf,CHfA,eAAsBM,EAAIN,EAAO,QAAQ,KAAM,CAC7C,IAAMO,EAAOX,EAAMC,EAAQG,CAAI,CAAC,EAAE,IAAI,MAAM,EACtCQ,EAAU,KAAM,QAAO,SAAS,EAGtCL,EAAeI,CAAI,EACnBA,EAAK,cAAc,EAAE,OAAO,EAC5B,GAAI,CACF,OAAOA,EAAK,WAAW,CACzB,OAASE,EAAG,CACNA,aAAaC,GACfF,EAAQ,QAAQ,MAAMC,EAAE,OAAO,CAEnC,CACF","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport addSiteCommand from \"./commands/site/addSiteCommand\";\nimport { ExitProcessError } from \"./ExitProcessError.js\";\nexport async function cli(args = process.argv) {\n const base = yargs(hideBin(args)).env(\"OSDK\");\n const Consola = await import(\"consola\");\n // Consola.default.level = Consola.LogLevels.debug;\n\n addSiteCommand(base);\n base.demandCommand().strict();\n try {\n return base.parseAsync();\n } catch (e) {\n if (e instanceof ExitProcessError) {\n Consola.consola.error(e.message);\n }\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const command = {\n command: \"upload\",\n describe: \"Upload an application version\",\n builder: argv => {\n return argv.option(\"siteVersion\", {\n type: \"string\",\n demandOption: true\n }).option(\"dir\", {\n type: \"string\"\n });\n },\n handler: async args => {\n const command = await import(\"./siteUploadCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const command = {\n command: \"versions\",\n describe: \"List application versions\",\n builder: argv => {\n return argv;\n },\n handler: async args => {\n const command = await import(\"./siteVersionsCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport upload from \"./upload\";\nimport versions from \"./versions\";\nexport default function addSiteCommand(yargs) {\n return yargs.command(\"site\", \"Manage your site\", originalYargs => {\n const yargs = originalYargs.options({\n appRid: {\n type: \"string\",\n demandOption: true,\n coerce: a => a\n },\n baseUrl: {\n type: \"string\",\n demandOption: true\n }\n }).demandCommand();\n yargs.command(versions);\n yargs.command(upload);\n return yargs;\n }, args => {});\n}"]}
|
|
1
|
+
{"version":3,"sources":["../../src/cli.ts","../../src/commands/site/delete/index.ts","../../src/commands/site/deploy/index.ts","../../src/commands/site/upload/index.ts","../../src/commands/site/versions/index.ts","../../src/commands/site/index.ts","../../src/readCliVersionFromPackageJson.ts","../../src/yargs/logVersionMiddleware.ts"],"names":["yargs","hideBin","command","argv","args","delete_default","deploy_default","upload_default","versions_default","site","a","site_default","fs","readCliVersionFromPackageJson","findUp","result","packageJson","firstTime","logVersionMiddleware","consola","cli","base","e","ExitProcessError"],"mappings":"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","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport site from \"./commands/site\";\nimport { ExitProcessError } from \"./ExitProcessError.js\";\nimport { logVersionMiddleware } from \"./yargs/logVersionMiddleware\";\nexport async function cli(args = process.argv) {\n const base = yargs(hideBin(args)).env(\"OSDK\").version(false).option(\"verbose\", {\n alias: \"v\",\n type: \"boolean\",\n description: \"Enable verbose logging\",\n count: true\n }).demandCommand().middleware(logVersionMiddleware, true).strict().command(site);\n try {\n return base.parseAsync();\n } catch (e) {\n if (e instanceof ExitProcessError) {\n const Consola = await import(\"consola\");\n Consola.consola.error(e.message);\n }\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const command = {\n command: \"delete\",\n describe: \"Delete an uploaded version\",\n builder: argv => {\n return argv.option(\"siteVersion\", {\n type: \"string\",\n demandOption: true\n }).option(\"dir\", {\n type: \"string\"\n });\n },\n handler: async args => {\n const command = await import(\"./siteDeleteCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const command = {\n command: \"deploy\",\n describe: \"Deploy an uploaded version\",\n builder: argv => {\n return argv.options({\n \"siteVersion\": {\n type: \"string\",\n conflicts: \"clearVersion\"\n // group: \"Deploy Version\",\n // implies: { \"clearVersion\": \"false\" },\n },\n\n undeploy: {\n alias: \"clearVersion\",\n description: \"Causes the site to no longer be deployed\",\n type: \"boolean\",\n conflicts: \"siteVersion\"\n // group: \"Deploy Version\",\n // implies: { \"siteVersion\": \"\" },\n }\n }).group([\"siteVersion\", \"clearVersion\"], \"Version To Deploy (requires one of)\");\n\n // .check((args) => {\n // if (\n // (args.siteVersion && args.clearVersion)\n // || (!args.siteVersion && args.clearVersion == undefined)\n // ) {\n // // consola.error(\"Only one of --siteVersion or --clearVersion may be provided\");\n // throw new Error(\n // \"Only one of --siteVersion or --clearVersion may be provided\",\n // );\n // }\n // });\n },\n\n handler: async args => {\n const command = await import(\"./handleSiteDeploy.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const command = {\n command: \"upload\",\n describe: \"Upload an application version\",\n builder: argv => {\n return argv.option(\"siteVersion\", {\n type: \"string\",\n demandOption: true\n }).option(\"dir\", {\n type: \"string\"\n });\n },\n handler: async args => {\n const command = await import(\"./siteUploadCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const command = {\n command: \"versions\",\n describe: \"List application versions\",\n builder: argv => {\n return argv;\n },\n handler: async args => {\n const command = await import(\"./siteVersionsCommand.mjs\");\n await command.default(args);\n }\n};\nexport default command;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport siteDelete from \"./delete\";\nimport siteDeploy from \"./deploy\";\nimport upload from \"./upload\";\nimport versions from \"./versions\";\nconst site = {\n command: \"site\",\n describe: \"Manage your site\",\n builder: argv => {\n return argv.options({\n appRid: {\n type: \"string\",\n demandOption: true,\n coerce: a => a\n },\n baseUrl: {\n type: \"string\",\n demandOption: true\n }\n }).group([\"appRid\", \"baseUrl\"], \"Common Arguments\").command(versions).command(upload).command(siteDelete).command(siteDeploy).demandCommand();\n },\n handler: async args => {}\n};\nexport default site;","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as fs from \"node:fs\";\nexport async function readCliVersionFromPackageJson() {\n const {\n findUp\n } = await import(\"find-up\");\n const result = await findUp(\"package.json\");\n if (!result) {\n return \"(unknown version. No package.json found)\";\n }\n const packageJson = JSON.parse(await fs.promises.readFile(result, \"utf-8\"));\n if (packageJson.version) {\n return `v${packageJson.version}`;\n } else {\n return \"(unknown version. No version in package.json found)\";\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 { readCliVersionFromPackageJson } from \"../readCliVersionFromPackageJson\";\nlet firstTime = true;\nexport async function logVersionMiddleware(args) {\n if (firstTime) {\n const Consola = await import(\"consola\");\n // This will be called before any command is executed\n const consola = Consola.consola;\n consola.info(`Palantir OSDK CLI ${await readCliVersionFromPackageJson()}`);\n consola.level = 3 + args.verbose; // so 1 -v is debug logs and -vv is trace\n if (consola.level > 3) {\n consola.debug(`Verbose logging enabled (${consola.level === 4 ? \"debug\" : \"trace\"})`);\n }\n\n // eslint-disable-next-line no-console\n console.log(); // Not consola. Just want a blank line\n firstTime = false;\n }\n}"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { a } from './chunk-V7N7LKX3.mjs';
|
|
2
|
+
import './chunk-B2HWA3VZ.mjs';
|
|
3
|
+
import { consola } from 'consola';
|
|
4
|
+
|
|
5
|
+
async function i(e){await a.SiteAssetArtifactsService.deleteSiteVersion(e.baseUrl,e.appRid,e.siteVersion),consola.success("Delete successful");}
|
|
6
|
+
|
|
7
|
+
export { i as default };
|
|
8
|
+
//# sourceMappingURL=out.js.map
|
|
9
|
+
//# sourceMappingURL=siteDeleteCommand-7QIAJLKJ.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/commands/site/delete/siteDeleteCommand.mts"],"names":["consola","siteDeleteCommand","args","artifacts_exports"],"mappings":"sEAgBA,OAAS,WAAAA,MAAe,UAExB,eAAOC,EAAyCC,EAAM,CACpD,MAAMC,EAAU,0BAA0B,kBAAkBD,EAAK,QAASA,EAAK,OAAQA,EAAK,WAAW,EACvGF,EAAQ,QAAQ,mBAAmB,CACrC","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nimport { artifacts } from \"../../../net/index.mjs\";\nexport default async function siteDeleteCommand(args) {\n await artifacts.SiteAssetArtifactsService.deleteSiteVersion(args.baseUrl, args.appRid, args.siteVersion);\n consola.success(\"Delete successful\");\n}"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk3T6ZEX2P_js = require('./chunk-3T6ZEX2P.js');
|
|
4
|
+
require('./chunk-LBGQDFFN.js');
|
|
5
|
+
var consola = require('consola');
|
|
6
|
+
|
|
7
|
+
async function i(e){await chunk3T6ZEX2P_js.a.SiteAssetArtifactsService.deleteSiteVersion(e.baseUrl,e.appRid,e.siteVersion),consola.consola.success("Delete successful");}
|
|
8
|
+
|
|
9
|
+
module.exports = i;
|
|
10
|
+
//# sourceMappingURL=out.js.map
|
|
11
|
+
//# sourceMappingURL=siteDeleteCommand-QIT2NBQ5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/commands/site/delete/siteDeleteCommand.mts"],"names":["consola","siteDeleteCommand","args","artifacts_exports"],"mappings":"oEAgBA,OAAS,WAAAA,MAAe,UAExB,eAAOC,EAAyCC,EAAM,CACpD,MAAMC,EAAU,0BAA0B,kBAAkBD,EAAK,QAASA,EAAK,OAAQA,EAAK,WAAW,EACvGF,EAAQ,QAAQ,mBAAmB,CACrC","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nimport { artifacts } from \"../../../net/index.mjs\";\nexport default async function siteDeleteCommand(args) {\n await artifacts.SiteAssetArtifactsService.deleteSiteVersion(args.baseUrl, args.appRid, args.siteVersion);\n consola.success(\"Delete successful\");\n}"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { a as a$1 } from './chunk-V7N7LKX3.mjs';
|
|
2
|
+
import { b } from './chunk-B2HWA3VZ.mjs';
|
|
3
|
+
import a from 'archiver';
|
|
4
|
+
import { consola } from 'consola';
|
|
5
|
+
import * as s from 'fs';
|
|
6
|
+
import { Readable } from 'stream';
|
|
7
|
+
|
|
8
|
+
async function c(i){if(i.dir==null)throw consola.error("No directory specified"),new b(1);if(!(await s.promises.stat(i.dir)).isDirectory())throw consola.error("Specified path is not a directory"),new b(2);consola.start("Zippping site files");let e=a("zip").directory(i.dir,!1);await Promise.all([a$1.SiteAssetArtifactsService.uploadZippedSiteAsset(i.baseUrl,i.appRid,i.siteVersion,Readable.toWeb(e)),e.finalize()]),consola.success("Upload complete");}
|
|
9
|
+
|
|
10
|
+
export { c as default };
|
|
11
|
+
//# sourceMappingURL=out.js.map
|
|
12
|
+
//# sourceMappingURL=siteUploadCommand-F37O2BSG.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/commands/site/upload/siteUploadCommand.mts"],"names":["archiver","consola","fs","Readable","invokeSiteUpload","args","ExitProcessError","archive","artifacts_exports"],"mappings":"kFAgBA,OAAOA,MAAc,WACrB,OAAS,WAAAC,MAAe,UACxB,UAAYC,MAAQ,KACpB,OAAS,YAAAC,MAAgB,SAGzB,eAAOC,EAAwCC,EAAM,CACnD,GAAIA,EAAK,KAAO,KACd,MAAAJ,EAAQ,MAAM,wBAAwB,EAChC,IAAIK,EAAiB,CAAC,EAG9B,GAAI,EADS,MAAS,WAAS,KAAKD,EAAK,GAAG,GAClC,YAAY,EACpB,MAAAJ,EAAQ,MAAM,mCAAmC,EAC3C,IAAIK,EAAiB,CAAC,EAE9BL,EAAQ,MAAM,qBAAqB,EACnC,IAAMM,EAAUP,EAAS,KAAK,EAAE,UAAUK,EAAK,IAAK,EAAK,EACzD,MAAM,QAAQ,IAAI,CAACG,EAAU,0BAA0B,sBAAsBH,EAAK,QAASA,EAAK,OAAQA,EAAK,YAAaF,EAAS,MAAMI,CAAO,CAChJ,EAAGA,EAAQ,SAAS,CAAC,CAAC,EACtBN,EAAQ,QAAQ,iBAAiB,CACnC","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 archiver from \"archiver\";\nimport { consola } from \"consola\";\nimport * as fs from \"node:fs\";\nimport { Readable } from \"node:stream\";\nimport { ExitProcessError } from \"../../../ExitProcessError.js\";\nimport { artifacts } from \"../../../net/index.mjs\";\nexport default async function invokeSiteUpload(args) {\n if (args.dir == null) {\n consola.error(\"No directory specified\");\n throw new ExitProcessError(1);\n }\n const stat = await fs.promises.stat(args.dir);\n if (!stat.isDirectory()) {\n consola.error(\"Specified path is not a directory\");\n throw new ExitProcessError(2);\n }\n consola.start(\"Zippping site files\");\n const archive = archiver(\"zip\").directory(args.dir, false);\n await Promise.all([artifacts.SiteAssetArtifactsService.uploadZippedSiteAsset(args.baseUrl, args.appRid, args.siteVersion, Readable.toWeb(archive) // This cast is because the dom fetch doesnt align type wise with streams\n ), archive.finalize()]);\n consola.success(\"Upload complete\");\n}"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk3T6ZEX2P_js = require('./chunk-3T6ZEX2P.js');
|
|
4
|
+
var chunkLBGQDFFN_js = require('./chunk-LBGQDFFN.js');
|
|
5
|
+
var a = require('archiver');
|
|
6
|
+
var consola = require('consola');
|
|
7
|
+
var s = require('fs');
|
|
8
|
+
var stream = require('stream');
|
|
9
|
+
|
|
10
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
|
|
12
|
+
function _interopNamespace(e) {
|
|
13
|
+
if (e && e.__esModule) return e;
|
|
14
|
+
var n = Object.create(null);
|
|
15
|
+
if (e) {
|
|
16
|
+
Object.keys(e).forEach(function (k) {
|
|
17
|
+
if (k !== 'default') {
|
|
18
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
19
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () { return e[k]; }
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
n.default = e;
|
|
27
|
+
return Object.freeze(n);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
var a__default = /*#__PURE__*/_interopDefault(a);
|
|
31
|
+
var s__namespace = /*#__PURE__*/_interopNamespace(s);
|
|
32
|
+
|
|
33
|
+
async function c(i){if(i.dir==null)throw consola.consola.error("No directory specified"),new chunkLBGQDFFN_js.b(1);if(!(await s__namespace.promises.stat(i.dir)).isDirectory())throw consola.consola.error("Specified path is not a directory"),new chunkLBGQDFFN_js.b(2);consola.consola.start("Zippping site files");let e=a__default.default("zip").directory(i.dir,!1);await Promise.all([chunk3T6ZEX2P_js.a.SiteAssetArtifactsService.uploadZippedSiteAsset(i.baseUrl,i.appRid,i.siteVersion,stream.Readable.toWeb(e)),e.finalize()]),consola.consola.success("Upload complete");}
|
|
34
|
+
|
|
35
|
+
module.exports = c;
|
|
36
|
+
//# sourceMappingURL=out.js.map
|
|
37
|
+
//# sourceMappingURL=siteUploadCommand-SK4GDXFX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/commands/site/upload/siteUploadCommand.mts"],"names":["archiver","consola","fs","Readable","invokeSiteUpload","args","ExitProcessError","archive","artifacts_exports"],"mappings":"gFAgBA,OAAOA,MAAc,WACrB,OAAS,WAAAC,MAAe,UACxB,UAAYC,MAAQ,KACpB,OAAS,YAAAC,MAAgB,SAGzB,eAAOC,EAAwCC,EAAM,CACnD,GAAIA,EAAK,KAAO,KACd,MAAAJ,EAAQ,MAAM,wBAAwB,EAChC,IAAIK,EAAiB,CAAC,EAG9B,GAAI,EADS,MAAS,WAAS,KAAKD,EAAK,GAAG,GAClC,YAAY,EACpB,MAAAJ,EAAQ,MAAM,mCAAmC,EAC3C,IAAIK,EAAiB,CAAC,EAE9BL,EAAQ,MAAM,qBAAqB,EACnC,IAAMM,EAAUP,EAAS,KAAK,EAAE,UAAUK,EAAK,IAAK,EAAK,EACzD,MAAM,QAAQ,IAAI,CAACG,EAAU,0BAA0B,sBAAsBH,EAAK,QAASA,EAAK,OAAQA,EAAK,YAAaF,EAAS,MAAMI,CAAO,CAChJ,EAAGA,EAAQ,SAAS,CAAC,CAAC,EACtBN,EAAQ,QAAQ,iBAAiB,CACnC","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 archiver from \"archiver\";\nimport { consola } from \"consola\";\nimport * as fs from \"node:fs\";\nimport { Readable } from \"node:stream\";\nimport { ExitProcessError } from \"../../../ExitProcessError.js\";\nimport { artifacts } from \"../../../net/index.mjs\";\nexport default async function invokeSiteUpload(args) {\n if (args.dir == null) {\n consola.error(\"No directory specified\");\n throw new ExitProcessError(1);\n }\n const stat = await fs.promises.stat(args.dir);\n if (!stat.isDirectory()) {\n consola.error(\"Specified path is not a directory\");\n throw new ExitProcessError(2);\n }\n consola.start(\"Zippping site files\");\n const archive = archiver(\"zip\").directory(args.dir, false);\n await Promise.all([artifacts.SiteAssetArtifactsService.uploadZippedSiteAsset(args.baseUrl, args.appRid, args.siteVersion, Readable.toWeb(archive) // This cast is because the dom fetch doesnt align type wise with streams\n ), archive.finalize()]);\n consola.success(\"Upload complete\");\n}"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a } from './chunk-V7N7LKX3.mjs';
|
|
2
|
+
import './chunk-B2HWA3VZ.mjs';
|
|
3
|
+
import { consola } from 'consola';
|
|
4
|
+
import { colorize } from 'consola/utils';
|
|
5
|
+
|
|
6
|
+
async function c(e){consola.start("Fetching versions & deployed version");let[r,i]=await Promise.all([a.SiteAssetArtifactsService.fetchSiteVersions(e.baseUrl,e.appRid),a.conjure.ArtifactsSitesAdminV2Service.fetchDeployedVersion(e.baseUrl,e.appRid)]);if(r.length==0){consola.warn("Successfully connected to server, but no versions were found.");return}consola.success("Found versions:");for(let n of r)consola.log(` - ${n}${i&&n===i.version?colorize("green"," (deployed)"):""}`);}
|
|
7
|
+
|
|
8
|
+
export { c as default };
|
|
9
|
+
//# sourceMappingURL=out.js.map
|
|
10
|
+
//# sourceMappingURL=siteVersionsCommand-K6M7GBIK.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/commands/site/versions/siteVersionsCommand.mts"],"names":["consola","colorize","siteVersionsCommand","args","versions","deployedVersion","artifacts_exports","version"],"mappings":"sEAgBA,OAAS,WAAAA,MAAe,UACxB,OAAS,YAAAC,MAAgB,gBAEzB,eAAOC,EAA2CC,EAAM,CACtDH,EAAQ,MAAM,sCAAsC,EACpD,GAAM,CAACI,EAAUC,CAAe,EAAI,MAAM,QAAQ,IAAI,CAACC,EAAU,0BAA0B,kBAAkBH,EAAK,QAASA,EAAK,MAAM,EAAGG,EAAU,QAAQ,6BAA6B,qBAAqBH,EAAK,QAASA,EAAK,MAAM,CAAC,CAAC,EACxO,GAAIC,EAAS,QAAU,EAAG,CACxBJ,EAAQ,KAAK,+DAA+D,EAC5E,MACF,CACAA,EAAQ,QAAQ,iBAAiB,EACjC,QAAWO,KAAWH,EACpBJ,EAAQ,IAAI,SAASO,CAAO,GAAGF,GAAmBE,IAAYF,EAAgB,QAAUJ,EAAS,QAAS,aAAa,EAAI,EAAE,EAAE,CAEnI","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nimport { colorize } from \"consola/utils\";\nimport { artifacts } from \"../../../net/index.mjs\";\nexport default async function siteVersionsCommand(args) {\n consola.start(\"Fetching versions & deployed version\");\n const [versions, deployedVersion] = await Promise.all([artifacts.SiteAssetArtifactsService.fetchSiteVersions(args.baseUrl, args.appRid), artifacts.conjure.ArtifactsSitesAdminV2Service.fetchDeployedVersion(args.baseUrl, args.appRid)]);\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,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk3T6ZEX2P_js = require('./chunk-3T6ZEX2P.js');
|
|
4
|
+
require('./chunk-LBGQDFFN.js');
|
|
5
|
+
var consola = require('consola');
|
|
6
|
+
var utils = require('consola/utils');
|
|
7
|
+
|
|
8
|
+
async function c(e){consola.consola.start("Fetching versions & deployed version");let[r,i]=await Promise.all([chunk3T6ZEX2P_js.a.SiteAssetArtifactsService.fetchSiteVersions(e.baseUrl,e.appRid),chunk3T6ZEX2P_js.a.conjure.ArtifactsSitesAdminV2Service.fetchDeployedVersion(e.baseUrl,e.appRid)]);if(r.length==0){consola.consola.warn("Successfully connected to server, but no versions were found.");return}consola.consola.success("Found versions:");for(let n of r)consola.consola.log(` - ${n}${i&&n===i.version?utils.colorize("green"," (deployed)"):""}`);}
|
|
9
|
+
|
|
10
|
+
module.exports = c;
|
|
11
|
+
//# sourceMappingURL=out.js.map
|
|
12
|
+
//# sourceMappingURL=siteVersionsCommand-LJJ3SJNM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/commands/site/versions/siteVersionsCommand.mts"],"names":["consola","colorize","siteVersionsCommand","args","versions","deployedVersion","artifacts_exports","version"],"mappings":"oEAgBA,OAAS,WAAAA,MAAe,UACxB,OAAS,YAAAC,MAAgB,gBAEzB,eAAOC,EAA2CC,EAAM,CACtDH,EAAQ,MAAM,sCAAsC,EACpD,GAAM,CAACI,EAAUC,CAAe,EAAI,MAAM,QAAQ,IAAI,CAACC,EAAU,0BAA0B,kBAAkBH,EAAK,QAASA,EAAK,MAAM,EAAGG,EAAU,QAAQ,6BAA6B,qBAAqBH,EAAK,QAASA,EAAK,MAAM,CAAC,CAAC,EACxO,GAAIC,EAAS,QAAU,EAAG,CACxBJ,EAAQ,KAAK,+DAA+D,EAC5E,MACF,CACAA,EAAQ,QAAQ,iBAAiB,EACjC,QAAWO,KAAWH,EACpBJ,EAAQ,IAAI,SAASO,CAAO,GAAGF,GAAmBE,IAAYF,EAAgB,QAAUJ,EAAS,QAAS,aAAa,EAAI,EAAE,EAAE,CAEnI","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nimport { colorize } from \"consola/utils\";\nimport { artifacts } from \"../../../net/index.mjs\";\nexport default async function siteVersionsCommand(args) {\n consola.start(\"Fetching versions & deployed version\");\n const [versions, deployedVersion] = await Promise.all([artifacts.SiteAssetArtifactsService.fetchSiteVersions(args.baseUrl, args.appRid), artifacts.conjure.ArtifactsSitesAdminV2Service.fetchDeployedVersion(args.baseUrl, args.appRid)]);\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}"]}
|
package/build/types/cli.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CommandModule } from "yargs";
|
|
2
|
-
import type { CommonSiteArgs } from "../
|
|
2
|
+
import type { CommonSiteArgs } from "../CommonSiteArgs";
|
|
3
3
|
import type { UploadArgs } from "./UploadArgs";
|
|
4
4
|
export declare const command: CommandModule<CommonSiteArgs, UploadArgs>;
|
|
5
5
|
export default command;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { CommandModule } from "yargs";
|
|
2
|
-
import type { CommonSiteArgs } from "../
|
|
2
|
+
import type { CommonSiteArgs } from "../CommonSiteArgs.js";
|
|
3
3
|
export declare const command: CommandModule<CommonSiteArgs, CommonSiteArgs>;
|
|
4
4
|
export default command;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { CommonSiteArgs } from "../
|
|
2
|
-
export default function
|
|
1
|
+
import type { CommonSiteArgs } from "../CommonSiteArgs.js";
|
|
2
|
+
export default function siteVersionsCommand(args: CommonSiteArgs): Promise<void>;
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
import type { ThirdPartyAppRid } from "
|
|
2
|
-
export interface SiteAssetVersions {
|
|
3
|
-
versions: string[];
|
|
4
|
-
}
|
|
1
|
+
import type { ThirdPartyAppRid } from "../../ThirdPartyAppRid.js";
|
|
5
2
|
export declare function uploadZippedSiteAsset(baseUrl: string, thirdPartyAppRid: ThirdPartyAppRid, version: string, zipFile: ReadableStream | Blob | BufferSource): Promise<boolean>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getSitesAdminV2ServiceBaseUrl(baseUrl: string): string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { clearSiteVersion } from "./clearSiteVersion.mjs";
|
|
2
|
+
export { deploySiteVersion } from "./deploySiteVersion.mjs";
|
|
3
|
+
export type { SiteAssetVersions } from "./deploySiteVersion.mjs";
|
|
4
|
+
export { fetchDeployedVersion } from "./fetchDeployedVersion.mjs";
|
|
5
|
+
export type { SiteVersion } from "./SiteVersion.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as ArtifactsSitesAdminV2Service from "./ArtifactsSitesAdminV2Service/index.mjs";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { RepositoryRid } from "
|
|
2
|
-
import type { ThirdPartyAppRid } from "
|
|
1
|
+
import type { RepositoryRid } from "../RepositoryRid.js";
|
|
2
|
+
import type { ThirdPartyAppRid } from "../ThirdPartyAppRid.js";
|
|
3
3
|
export declare function fetchWebsiteRepositoryRid(baseUrl: string, thirdPartyAppRid: ThirdPartyAppRid): Promise<RepositoryRid>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { fetchWebsiteRepositoryRid } from "./fetchWebsiteRepositoryRid.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function readCliVersionFromPackageJson(): Promise<string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osdk/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"access": "public",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -19,8 +19,9 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"archiver": "^6.0.1",
|
|
21
21
|
"consola": "^3.2.3",
|
|
22
|
+
"find-up": "^6.3.0",
|
|
22
23
|
"yargs": "^17.7.2",
|
|
23
|
-
"@osdk/api": "0.0.
|
|
24
|
+
"@osdk/api": "0.0.8"
|
|
24
25
|
},
|
|
25
26
|
"devDependencies": {
|
|
26
27
|
"@types/archiver": "^6.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ExitProcessError.ts"],"names":["ExitProcessError","errorCode","msg"],"mappings":"AAgBO,IAAMA,EAAN,cAA+B,KAAM,CAC1C,YAAYC,EAAWC,EAAK,CAC1B,MAAMA,CAAG,EACT,KAAK,UAAYD,CACnB,CACF","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 class ExitProcessError extends Error {\n constructor(errorCode, msg) {\n super(msg);\n this.errorCode = errorCode;\n }\n}"]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var utils = require('@osdk/api/utils');
|
|
4
|
-
var consola = require('consola');
|
|
5
|
-
|
|
6
|
-
function c(e,o=fetch){return utils.createFetchHeaderMutator(u(o),async t=>{let s=await e();return t.set("Authorization",`Bearer ${s}`),t.set("Fetch-User-Agent",""),t})}function u(e=fetch){return function(t,s){return typeof t=="string"||t instanceof URL?consola.consola.debug(`${s?.method??"GET"}: ${t.toString().trim()}`):consola.consola.debug(`${t.method??"GET"}: ${t.url.toString().trim()}`),e(t,s).then(r=>(consola.consola.debug("Finished fetch"),r))}}async function $(e,o){let t=c(()=>process.env.FOUNDRY_SDK_AUTH_TOKEN),s=`
|
|
7
|
-
${e}/third-party-application-service/api/application-websites/${o}`,r=await t(s);if(r.status>=200&&r.status<300){let i=await r.json();return consola.consola.debug(`Repository RID: ${i}`),i}throw new Error(`Unexpected response code ${r.status} (${r.statusText})`)}function b(e,o){return `${e}/artifacts/api/repositories/${o}/contents/release/siteasset`}
|
|
8
|
-
|
|
9
|
-
exports.a = c;
|
|
10
|
-
exports.b = $;
|
|
11
|
-
exports.c = b;
|
|
12
|
-
//# sourceMappingURL=out.js.map
|
|
13
|
-
//# sourceMappingURL=chunk-6PVNK2PW.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/net/createFetch.mts","../../src/net/fetchWebsiteRepositoryRid.mts","../../src/net/getSiteAssetBaseUrl.mts"],"names":["createFetchHeaderMutator","consola","createFetch","tokenProvider","fetchFn","createDebugLoggingFetch","headers","token","input","init","a","fetchWebsiteRepositoryRid","baseUrl","thirdPartyAppRid","fetch","url","result","repositoryRid","getSiteAssetBaseUrl","foundryBaseUrl"],"mappings":"AAgBA,OAAS,4BAAAA,MAAgC,kBACzC,OAAS,WAAAC,MAAe,UACjB,SAASC,EAAYC,EAAeC,EAAU,MAAO,CAC1D,OAAOJ,EAAyBK,EAAwBD,CAAO,EAAG,MAAME,GAAW,CACjF,IAAMC,EAAQ,MAAMJ,EAAc,EAClC,OAAAG,EAAQ,IAAI,gBAAiB,UAAUC,CAAK,EAAE,EAC9CD,EAAQ,IAAI,mBAAoB,EAAE,EAC3BA,CACT,CAAC,CACH,CACA,SAASD,EAAwBD,EAAU,MAAO,CAChD,OAAO,SAA2BI,EAAOC,EAAM,CAC7C,OAAI,OAAOD,GAAU,UAAYA,aAAiB,IAChDP,EAAQ,MAAM,GAAGQ,GAAM,QAAU,KAAK,KAAKD,EAAM,SAAS,EAAE,KAAK,CAAC,EAAE,EAEpEP,EAAQ,MAAM,GAAGO,EAAM,QAAU,KAAK,KAAKA,EAAM,IAAI,SAAS,EAAE,KAAK,CAAC,EAAE,EAEnEJ,EAAQI,EAAOC,CAAI,EAAE,KAAKC,IAC/BT,EAAQ,MAAM,gBAAgB,EACvBS,EACR,CACH,CACF,CCtBA,OAAS,WAAAT,MAAe,UAExB,eAAsBU,EAA0BC,EAASC,EAAkB,CACzE,IAAMC,EAAQZ,EAAY,IAAM,QAAQ,IAAI,sBAAsB,EAC5Da,EAAM;AAAA,MACRH,CAAO,6DAA6DC,CAAgB,GAClFG,EAAS,MAAMF,EAAMC,CAAG,EAC9B,GAAIC,EAAO,QAAU,KAAOA,EAAO,OAAS,IAAK,CAC/C,IAAMC,EAAgB,MAAMD,EAAO,KAAK,EACxC,OAAAf,EAAQ,MAAM,mBAAmBgB,CAAa,EAAE,EACzCA,CACT,CACA,MAAM,IAAI,MAAM,4BAA4BD,EAAO,MAAM,KAAKA,EAAO,UAAU,GAAG,CACpF,CCbO,SAASE,EAAoBC,EAAgBF,EAAe,CACjE,MAAO,GAAGE,CAAc,+BAA+BF,CAAa,6BACtE","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 { createFetchHeaderMutator } from \"@osdk/api/utils\";\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}"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ExitProcessError.ts"],"names":["ExitProcessError","errorCode","msg"],"mappings":"AAgBO,IAAMA,EAAN,cAA+B,KAAM,CAC1C,YAAYC,EAAWC,EAAK,CAC1B,MAAMA,CAAG,EACT,KAAK,UAAYD,CACnB,CACF","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 class ExitProcessError extends Error {\n constructor(errorCode, msg) {\n super(msg);\n this.errorCode = errorCode;\n }\n}"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { createFetchHeaderMutator } from '@osdk/api/utils';
|
|
2
|
-
import { consola } from 'consola';
|
|
3
|
-
|
|
4
|
-
function c(e,o=fetch){return createFetchHeaderMutator(u(o),async t=>{let s=await e();return t.set("Authorization",`Bearer ${s}`),t.set("Fetch-User-Agent",""),t})}function u(e=fetch){return function(t,s){return typeof t=="string"||t instanceof URL?consola.debug(`${s?.method??"GET"}: ${t.toString().trim()}`):consola.debug(`${t.method??"GET"}: ${t.url.toString().trim()}`),e(t,s).then(r=>(consola.debug("Finished fetch"),r))}}async function $(e,o){let t=c(()=>process.env.FOUNDRY_SDK_AUTH_TOKEN),s=`
|
|
5
|
-
${e}/third-party-application-service/api/application-websites/${o}`,r=await t(s);if(r.status>=200&&r.status<300){let i=await r.json();return consola.debug(`Repository RID: ${i}`),i}throw new Error(`Unexpected response code ${r.status} (${r.statusText})`)}function b(e,o){return `${e}/artifacts/api/repositories/${o}/contents/release/siteasset`}
|
|
6
|
-
|
|
7
|
-
export { c as a, $ as b, b as c };
|
|
8
|
-
//# sourceMappingURL=out.js.map
|
|
9
|
-
//# sourceMappingURL=chunk-YEWM6TCR.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/net/createFetch.mts","../../src/net/fetchWebsiteRepositoryRid.mts","../../src/net/getSiteAssetBaseUrl.mts"],"names":["createFetchHeaderMutator","consola","createFetch","tokenProvider","fetchFn","createDebugLoggingFetch","headers","token","input","init","a","fetchWebsiteRepositoryRid","baseUrl","thirdPartyAppRid","fetch","url","result","repositoryRid","getSiteAssetBaseUrl","foundryBaseUrl"],"mappings":"AAgBA,OAAS,4BAAAA,MAAgC,kBACzC,OAAS,WAAAC,MAAe,UACjB,SAASC,EAAYC,EAAeC,EAAU,MAAO,CAC1D,OAAOJ,EAAyBK,EAAwBD,CAAO,EAAG,MAAME,GAAW,CACjF,IAAMC,EAAQ,MAAMJ,EAAc,EAClC,OAAAG,EAAQ,IAAI,gBAAiB,UAAUC,CAAK,EAAE,EAC9CD,EAAQ,IAAI,mBAAoB,EAAE,EAC3BA,CACT,CAAC,CACH,CACA,SAASD,EAAwBD,EAAU,MAAO,CAChD,OAAO,SAA2BI,EAAOC,EAAM,CAC7C,OAAI,OAAOD,GAAU,UAAYA,aAAiB,IAChDP,EAAQ,MAAM,GAAGQ,GAAM,QAAU,KAAK,KAAKD,EAAM,SAAS,EAAE,KAAK,CAAC,EAAE,EAEpEP,EAAQ,MAAM,GAAGO,EAAM,QAAU,KAAK,KAAKA,EAAM,IAAI,SAAS,EAAE,KAAK,CAAC,EAAE,EAEnEJ,EAAQI,EAAOC,CAAI,EAAE,KAAKC,IAC/BT,EAAQ,MAAM,gBAAgB,EACvBS,EACR,CACH,CACF,CCtBA,OAAS,WAAAT,MAAe,UAExB,eAAsBU,EAA0BC,EAASC,EAAkB,CACzE,IAAMC,EAAQZ,EAAY,IAAM,QAAQ,IAAI,sBAAsB,EAC5Da,EAAM;AAAA,MACRH,CAAO,6DAA6DC,CAAgB,GAClFG,EAAS,MAAMF,EAAMC,CAAG,EAC9B,GAAIC,EAAO,QAAU,KAAOA,EAAO,OAAS,IAAK,CAC/C,IAAMC,EAAgB,MAAMD,EAAO,KAAK,EACxC,OAAAf,EAAQ,MAAM,mBAAmBgB,CAAa,EAAE,EACzCA,CACT,CACA,MAAM,IAAI,MAAM,4BAA4BD,EAAO,MAAM,KAAKA,EAAO,UAAU,GAAG,CACpF,CCbO,SAASE,EAAoBC,EAAgBF,EAAe,CACjE,MAAO,GAAGE,CAAc,+BAA+BF,CAAa,6BACtE","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 { createFetchHeaderMutator } from \"@osdk/api/utils\";\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}"]}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunk2DJZUIFP_js = require('./chunk-2DJZUIFP.js');
|
|
4
|
-
var chunk6PVNK2PW_js = require('./chunk-6PVNK2PW.js');
|
|
5
|
-
var w = require('archiver');
|
|
6
|
-
var consola = require('consola');
|
|
7
|
-
var d = require('fs');
|
|
8
|
-
var stream = require('stream');
|
|
9
|
-
|
|
10
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
|
|
12
|
-
function _interopNamespace(e) {
|
|
13
|
-
if (e && e.__esModule) return e;
|
|
14
|
-
var n = Object.create(null);
|
|
15
|
-
if (e) {
|
|
16
|
-
Object.keys(e).forEach(function (k) {
|
|
17
|
-
if (k !== 'default') {
|
|
18
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
19
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function () { return e[k]; }
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
n.default = e;
|
|
27
|
-
return Object.freeze(n);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
var w__default = /*#__PURE__*/_interopDefault(w);
|
|
31
|
-
var d__namespace = /*#__PURE__*/_interopNamespace(d);
|
|
32
|
-
|
|
33
|
-
async function f(t,i,s,l){let m=await chunk6PVNK2PW_js.b(t,i),u=`${chunk6PVNK2PW_js.c(t,m)}/versions/zip/${s}`,e=await chunk6PVNK2PW_js.a(()=>process.env.FOUNDRY_SDK_AUTH_TOKEN)(u,{method:"PUT",body:l,headers:{"Content-Type":"application/octet-stream"},duplex:"half"});if(e.status>=200&&e.status<300)return consola.consola.level=consola.LogLevels.debug,consola.consola.debug("Status Text: "+e.statusText),!0;throw e.status===409?new chunk2DJZUIFP_js.a(e.status,"Version already exists"):new chunk2DJZUIFP_js.a(e.status,`Unexpected response code ${e.status} (${e.statusText})`)}async function x(t){if(t.dir==null)throw consola.consola.error("No directory specified"),new chunk2DJZUIFP_js.a(1);if(!(await d__namespace.promises.stat(t.dir)).isDirectory())throw consola.consola.error("Specified path is not a directory"),new chunk2DJZUIFP_js.a(2);consola.consola.start("Zippping site files");let s=w__default.default("zip").directory(t.dir,!1);await Promise.all([f(t.baseUrl,t.appRid,t.siteVersion,stream.Readable.toWeb(s)),s.finalize()]),consola.consola.success("Found versions");}
|
|
34
|
-
|
|
35
|
-
module.exports = x;
|
|
36
|
-
//# sourceMappingURL=out.js.map
|
|
37
|
-
//# sourceMappingURL=siteUploadCommand-36HAEYDG.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/site/upload/siteUploadCommand.mts","../../src/net/uploadSiteVersion.mts"],"names":["archiver","consola","fs","Readable","LogLevels","uploadZippedSiteAsset","baseUrl","thirdPartyAppRid","version","zipFile","repositoryRid","fetchWebsiteRepositoryRid","url","getSiteAssetBaseUrl","result","createFetch","ExitProcessError","invokeSiteUpload","args","archive"],"mappings":"yFAgBA,OAAOA,MAAc,WACrB,OAAS,WAAAC,MAAe,UACxB,UAAYC,MAAQ,KACpB,OAAS,YAAAC,MAAgB,SCHzB,OAAS,WAAAF,EAAS,aAAAG,MAAiB,UAKnC,eAAsBC,EAAsBC,EAASC,EAAkBC,EAASC,EAAS,CACvF,IAAMC,EAAgB,MAAMC,EAA0BL,EAASC,CAAgB,EACzEK,EAAM,GAAGC,EAAoBP,EAASI,CAAa,CAAC,iBAAiBF,CAAO,GAE5EM,EAAS,MADDC,EAAY,IAAM,QAAQ,IAAI,sBAAsB,EACvCH,EAAK,CAC9B,OAAQ,MACR,KAAMH,EACN,QAAS,CACP,eAAgB,0BAClB,EACA,OAAQ,MACV,CAAC,EAED,GAAIK,EAAO,QAAU,KAAOA,EAAO,OAAS,IAC1C,OAAAb,EAAQ,MAAQG,EAAU,MAC1BH,EAAQ,MAAM,gBAAkBa,EAAO,UAAU,EAC1C,GACF,MAAIA,EAAO,SAAW,IACrB,IAAIE,EAAiBF,EAAO,OAAQ,wBAAwB,EAE5D,IAAIE,EAAiBF,EAAO,OAAQ,4BAA4BA,EAAO,MAAM,KAAKA,EAAO,UAAU,GAAG,CAEhH,CDrBA,eAAOG,EAAwCC,EAAM,CACnD,GAAIA,EAAK,KAAO,KACd,MAAAjB,EAAQ,MAAM,wBAAwB,EAChC,IAAIe,EAAiB,CAAC,EAG9B,GAAI,EADS,MAAS,WAAS,KAAKE,EAAK,GAAG,GAClC,YAAY,EACpB,MAAAjB,EAAQ,MAAM,mCAAmC,EAC3C,IAAIe,EAAiB,CAAC,EAE9Bf,EAAQ,MAAM,qBAAqB,EACnC,IAAMkB,EAAUnB,EAAS,KAAK,EAAE,UAAUkB,EAAK,IAAK,EAAK,EACzD,MAAM,QAAQ,IAAI,CAACb,EAAsBa,EAAK,QAASA,EAAK,OAAQA,EAAK,YAAaf,EAAS,MAAMgB,CAAO,CAC5G,EAAGA,EAAQ,SAAS,CAAC,CAAC,EACtBlB,EAAQ,QAAQ,gBAAgB,CAClC","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 archiver from \"archiver\";\nimport { consola } from \"consola\";\nimport * as fs from \"node:fs\";\nimport { Readable } from \"node:stream\";\nimport { ExitProcessError } from \"../../../ExitProcessError.js\";\nimport { uploadZippedSiteAsset } from \"../../../net/uploadSiteVersion.mjs\";\nexport default async function invokeSiteUpload(args) {\n if (args.dir == null) {\n consola.error(\"No directory specified\");\n throw new ExitProcessError(1);\n }\n const stat = await fs.promises.stat(args.dir);\n if (!stat.isDirectory()) {\n consola.error(\"Specified path is not a directory\");\n throw new ExitProcessError(2);\n }\n consola.start(\"Zippping site files\");\n const archive = archiver(\"zip\").directory(args.dir, false);\n await Promise.all([uploadZippedSiteAsset(args.baseUrl, args.appRid, args.siteVersion, Readable.toWeb(archive) // This cast is because the dom fetch doesnt align type wise with streams\n ), archive.finalize()]);\n consola.success(\"Found versions\");\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 \"./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\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}"]}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { a } from './chunk-MGT3UGXW.mjs';
|
|
2
|
-
import { b, c, a as a$1 } from './chunk-YEWM6TCR.mjs';
|
|
3
|
-
import w from 'archiver';
|
|
4
|
-
import { consola, LogLevels } from 'consola';
|
|
5
|
-
import * as d from 'fs';
|
|
6
|
-
import { Readable } from 'stream';
|
|
7
|
-
|
|
8
|
-
async function f(t,i,s,l){let m=await b(t,i),u=`${c(t,m)}/versions/zip/${s}`,e=await a$1(()=>process.env.FOUNDRY_SDK_AUTH_TOKEN)(u,{method:"PUT",body:l,headers:{"Content-Type":"application/octet-stream"},duplex:"half"});if(e.status>=200&&e.status<300)return consola.level=LogLevels.debug,consola.debug("Status Text: "+e.statusText),!0;throw e.status===409?new a(e.status,"Version already exists"):new a(e.status,`Unexpected response code ${e.status} (${e.statusText})`)}async function x(t){if(t.dir==null)throw consola.error("No directory specified"),new a(1);if(!(await d.promises.stat(t.dir)).isDirectory())throw consola.error("Specified path is not a directory"),new a(2);consola.start("Zippping site files");let s=w("zip").directory(t.dir,!1);await Promise.all([f(t.baseUrl,t.appRid,t.siteVersion,Readable.toWeb(s)),s.finalize()]),consola.success("Found versions");}
|
|
9
|
-
|
|
10
|
-
export { x as default };
|
|
11
|
-
//# sourceMappingURL=out.js.map
|
|
12
|
-
//# sourceMappingURL=siteUploadCommand-L3QDNVWX.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/site/upload/siteUploadCommand.mts","../../src/net/uploadSiteVersion.mts"],"names":["archiver","consola","fs","Readable","LogLevels","uploadZippedSiteAsset","baseUrl","thirdPartyAppRid","version","zipFile","repositoryRid","fetchWebsiteRepositoryRid","url","getSiteAssetBaseUrl","result","createFetch","ExitProcessError","invokeSiteUpload","args","archive"],"mappings":"2FAgBA,OAAOA,MAAc,WACrB,OAAS,WAAAC,MAAe,UACxB,UAAYC,MAAQ,KACpB,OAAS,YAAAC,MAAgB,SCHzB,OAAS,WAAAF,EAAS,aAAAG,MAAiB,UAKnC,eAAsBC,EAAsBC,EAASC,EAAkBC,EAASC,EAAS,CACvF,IAAMC,EAAgB,MAAMC,EAA0BL,EAASC,CAAgB,EACzEK,EAAM,GAAGC,EAAoBP,EAASI,CAAa,CAAC,iBAAiBF,CAAO,GAE5EM,EAAS,MADDC,EAAY,IAAM,QAAQ,IAAI,sBAAsB,EACvCH,EAAK,CAC9B,OAAQ,MACR,KAAMH,EACN,QAAS,CACP,eAAgB,0BAClB,EACA,OAAQ,MACV,CAAC,EAED,GAAIK,EAAO,QAAU,KAAOA,EAAO,OAAS,IAC1C,OAAAb,EAAQ,MAAQG,EAAU,MAC1BH,EAAQ,MAAM,gBAAkBa,EAAO,UAAU,EAC1C,GACF,MAAIA,EAAO,SAAW,IACrB,IAAIE,EAAiBF,EAAO,OAAQ,wBAAwB,EAE5D,IAAIE,EAAiBF,EAAO,OAAQ,4BAA4BA,EAAO,MAAM,KAAKA,EAAO,UAAU,GAAG,CAEhH,CDrBA,eAAOG,EAAwCC,EAAM,CACnD,GAAIA,EAAK,KAAO,KACd,MAAAjB,EAAQ,MAAM,wBAAwB,EAChC,IAAIe,EAAiB,CAAC,EAG9B,GAAI,EADS,MAAS,WAAS,KAAKE,EAAK,GAAG,GAClC,YAAY,EACpB,MAAAjB,EAAQ,MAAM,mCAAmC,EAC3C,IAAIe,EAAiB,CAAC,EAE9Bf,EAAQ,MAAM,qBAAqB,EACnC,IAAMkB,EAAUnB,EAAS,KAAK,EAAE,UAAUkB,EAAK,IAAK,EAAK,EACzD,MAAM,QAAQ,IAAI,CAACb,EAAsBa,EAAK,QAASA,EAAK,OAAQA,EAAK,YAAaf,EAAS,MAAMgB,CAAO,CAC5G,EAAGA,EAAQ,SAAS,CAAC,CAAC,EACtBlB,EAAQ,QAAQ,gBAAgB,CAClC","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 archiver from \"archiver\";\nimport { consola } from \"consola\";\nimport * as fs from \"node:fs\";\nimport { Readable } from \"node:stream\";\nimport { ExitProcessError } from \"../../../ExitProcessError.js\";\nimport { uploadZippedSiteAsset } from \"../../../net/uploadSiteVersion.mjs\";\nexport default async function invokeSiteUpload(args) {\n if (args.dir == null) {\n consola.error(\"No directory specified\");\n throw new ExitProcessError(1);\n }\n const stat = await fs.promises.stat(args.dir);\n if (!stat.isDirectory()) {\n consola.error(\"Specified path is not a directory\");\n throw new ExitProcessError(2);\n }\n consola.start(\"Zippping site files\");\n const archive = archiver(\"zip\").directory(args.dir, false);\n await Promise.all([uploadZippedSiteAsset(args.baseUrl, args.appRid, args.siteVersion, Readable.toWeb(archive) // This cast is because the dom fetch doesnt align type wise with streams\n ), archive.finalize()]);\n consola.success(\"Found versions\");\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 \"./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\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}"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { b, c, a as a$1 } from './chunk-YEWM6TCR.mjs';
|
|
2
|
-
import { consola } from 'consola';
|
|
3
|
-
|
|
4
|
-
async function a(e,s){let o=await b(e,s),p=`${c(e,o)}/versions`,t=await a$1(()=>process.env.FOUNDRY_SDK_AUTH_TOKEN)(p);if(t.status===200)return (await t.json()).versions;throw new Error(`Unexpected response code ${t.status} (${t.statusText})`)}async function u(e){consola.start("Fetching versions");let s=await a(e.baseUrl,e.appRid);if(s.length==0){consola.warn("Successfully connected to server, but no versions were found.");return}consola.success(`Found versions:
|
|
5
|
-
`+s.map(o=>` * ${o}`).join(`
|
|
6
|
-
`));}
|
|
7
|
-
|
|
8
|
-
export { u as default };
|
|
9
|
-
//# sourceMappingURL=out.js.map
|
|
10
|
-
//# sourceMappingURL=siteVersionsCommand-BQMPCMGZ.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/site/versions/siteVersionsCommand.mts","../../src/net/getSiteVersions.mts"],"names":["consola","getSiteVersions","baseUrl","thirdPartyAppRid","repositoryRid","fetchWebsiteRepositoryRid","url","getSiteAssetBaseUrl","result","createFetch","invokeSiteVersionsCommand","args","versions","a"],"mappings":"kDAgBA,OAAS,WAAAA,MAAe,UCGxB,eAAsBC,EAAgBC,EAASC,EAAkB,CAC/D,IAAMC,EAAgB,MAAMC,EAA0BH,EAASC,CAAgB,EACzEG,EAAM,GAAGC,EAAoBL,EAASE,CAAa,CAAC,YAEpDI,EAAS,MADDC,EAAY,IAAM,QAAQ,IAAI,sBAAsB,EACvCH,CAAG,EAC9B,GAAIE,EAAO,SAAW,IAEpB,OADiB,MAAMA,EAAO,KAAK,GACnB,SAEhB,MAAM,IAAI,MAAM,4BAA4BA,EAAO,MAAM,KAAKA,EAAO,UAAU,GAAG,CAEtF,CDZA,eAAOE,EAAiDC,EAAM,CAC5DX,EAAQ,MAAM,mBAAmB,EACjC,IAAMY,EAAW,MAAMX,EAAgBU,EAAK,QAASA,EAAK,MAAM,EAChE,GAAIC,EAAS,QAAU,EAAG,CACxBZ,EAAQ,KAAK,+DAA+D,EAC5E,MACF,CACAA,EAAQ,QAAQ;AAAA,EAAsBY,EAAS,IAAIC,GAAK,SAASA,CAAC,EAAE,EAAE,KAAK;AAAA,CAAI,CAAC,CAClF","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 { getSiteVersions } from \"../../../net/getSiteVersions.mjs\";\nexport default async function invokeSiteVersionsCommand(args) {\n consola.start(\"Fetching versions\");\n const versions = await getSiteVersions(args.baseUrl, args.appRid);\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\" + versions.map(a => ` * ${a}`).join(\"\\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\";\nimport { fetchWebsiteRepositoryRid } from \"./fetchWebsiteRepositoryRid.mjs\";\nimport { getSiteAssetBaseUrl } from \"./getSiteAssetBaseUrl.mjs\";\nexport async function getSiteVersions(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}"]}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunk6PVNK2PW_js = require('./chunk-6PVNK2PW.js');
|
|
4
|
-
var consola = require('consola');
|
|
5
|
-
|
|
6
|
-
async function a(e,s){let o=await chunk6PVNK2PW_js.b(e,s),p=`${chunk6PVNK2PW_js.c(e,o)}/versions`,t=await chunk6PVNK2PW_js.a(()=>process.env.FOUNDRY_SDK_AUTH_TOKEN)(p);if(t.status===200)return (await t.json()).versions;throw new Error(`Unexpected response code ${t.status} (${t.statusText})`)}async function u(e){consola.consola.start("Fetching versions");let s=await a(e.baseUrl,e.appRid);if(s.length==0){consola.consola.warn("Successfully connected to server, but no versions were found.");return}consola.consola.success(`Found versions:
|
|
7
|
-
`+s.map(o=>` * ${o}`).join(`
|
|
8
|
-
`));}
|
|
9
|
-
|
|
10
|
-
module.exports = u;
|
|
11
|
-
//# sourceMappingURL=out.js.map
|
|
12
|
-
//# sourceMappingURL=siteVersionsCommand-YSV7HQJK.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/site/versions/siteVersionsCommand.mts","../../src/net/getSiteVersions.mts"],"names":["consola","getSiteVersions","baseUrl","thirdPartyAppRid","repositoryRid","fetchWebsiteRepositoryRid","url","getSiteAssetBaseUrl","result","createFetch","invokeSiteVersionsCommand","args","versions","a"],"mappings":"iDAgBA,OAAS,WAAAA,MAAe,UCGxB,eAAsBC,EAAgBC,EAASC,EAAkB,CAC/D,IAAMC,EAAgB,MAAMC,EAA0BH,EAASC,CAAgB,EACzEG,EAAM,GAAGC,EAAoBL,EAASE,CAAa,CAAC,YAEpDI,EAAS,MADDC,EAAY,IAAM,QAAQ,IAAI,sBAAsB,EACvCH,CAAG,EAC9B,GAAIE,EAAO,SAAW,IAEpB,OADiB,MAAMA,EAAO,KAAK,GACnB,SAEhB,MAAM,IAAI,MAAM,4BAA4BA,EAAO,MAAM,KAAKA,EAAO,UAAU,GAAG,CAEtF,CDZA,eAAOE,EAAiDC,EAAM,CAC5DX,EAAQ,MAAM,mBAAmB,EACjC,IAAMY,EAAW,MAAMX,EAAgBU,EAAK,QAASA,EAAK,MAAM,EAChE,GAAIC,EAAS,QAAU,EAAG,CACxBZ,EAAQ,KAAK,+DAA+D,EAC5E,MACF,CACAA,EAAQ,QAAQ;AAAA,EAAsBY,EAAS,IAAIC,GAAK,SAASA,CAAC,EAAE,EAAE,KAAK;AAAA,CAAI,CAAC,CAClF","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 { getSiteVersions } from \"../../../net/getSiteVersions.mjs\";\nexport default async function invokeSiteVersionsCommand(args) {\n consola.start(\"Fetching versions\");\n const versions = await getSiteVersions(args.baseUrl, args.appRid);\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\" + versions.map(a => ` * ${a}`).join(\"\\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\";\nimport { fetchWebsiteRepositoryRid } from \"./fetchWebsiteRepositoryRid.mjs\";\nimport { getSiteAssetBaseUrl } from \"./getSiteAssetBaseUrl.mjs\";\nexport async function getSiteVersions(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}"]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type * as yargs from "yargs";
|
|
2
|
-
import type { ThirdPartyAppRid } from "../../net/ThirdPartyAppRid.js";
|
|
3
|
-
export interface CommonSiteArgs {
|
|
4
|
-
appRid: ThirdPartyAppRid;
|
|
5
|
-
baseUrl: string;
|
|
6
|
-
}
|
|
7
|
-
export default function addSiteCommand(yargs: yargs.Argv<{}>): yargs.Argv<{}>;
|
|
File without changes
|