@osdk/cli 0.22.0-beta.2 → 0.22.1
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 +29 -0
- package/build/browser/chunk-2FHBRDJE.js +1 -1
- package/build/browser/chunk-2FHBRDJE.js.map +1 -1
- package/build/browser/chunk-G3PMV62Z.js +1 -1
- package/build/browser/chunk-G3PMV62Z.js.map +1 -1
- package/build/browser/chunk-IRSUCKI2.js +1 -1
- package/build/browser/chunk-IRSUCKI2.js.map +1 -1
- package/build/browser/{chunk-XUNEMZTE.js → chunk-RTBY6IQO.js} +3 -3
- package/build/browser/chunk-RTBY6IQO.js.map +1 -0
- package/build/browser/chunk-YYFW7BKO.js +1 -1
- package/build/browser/chunk-YYFW7BKO.js.map +1 -1
- package/build/{esm/handleGenerate-LFHFMTI5-4XSGH53A.js → browser/handleGenerate-BRWT5QJG-XBEQW44J.js} +9 -9
- package/build/browser/handleGenerate-BRWT5QJG-XBEQW44J.js.map +1 -0
- package/build/browser/index.js +9 -9
- package/build/browser/index.js.map +1 -1
- package/build/browser/loginFlow-SCW45N4C.js +1 -1
- package/build/browser/loginFlow-SCW45N4C.js.map +1 -1
- package/build/{esm/siteDeployCommand-CM2MORY4.js → browser/siteDeployCommand-5VG3J6JA.js} +3 -3
- package/build/browser/siteDeployCommand-5VG3J6JA.js.map +1 -0
- package/build/browser/{versionDeleteCommand-X57FGSGV.js → versionDeleteCommand-PYIX6VKL.js} +3 -3
- package/build/browser/versionDeleteCommand-PYIX6VKL.js.map +1 -0
- package/build/{esm/versionGetCommand-XXW7AUYY.js → browser/versionGetCommand-LK7EMAMW.js} +3 -3
- package/build/browser/versionGetCommand-LK7EMAMW.js.map +1 -0
- package/build/{esm/versionListCommand-YCG2FWRB.js → browser/versionListCommand-MOU6FSOB.js} +3 -3
- package/build/browser/versionListCommand-MOU6FSOB.js.map +1 -0
- package/build/{esm/versionSetCommand-VXNQ4MK6.js → browser/versionSetCommand-Z2XKFFT3.js} +3 -3
- package/build/browser/versionSetCommand-Z2XKFFT3.js.map +1 -0
- package/build/browser/{versionUnsetCommand-UFLNPHZE.js → versionUnsetCommand-R7GVBMMI.js} +3 -3
- package/build/browser/versionUnsetCommand-R7GVBMMI.js.map +1 -0
- package/build/cjs/chunk-DQYIDDJN.cjs +1 -1
- package/build/cjs/chunk-DQYIDDJN.cjs.map +1 -1
- package/build/cjs/chunk-EMMSS5I5.cjs +1 -1
- package/build/cjs/chunk-EMMSS5I5.cjs.map +1 -1
- package/build/cjs/chunk-KN4OGPAB.cjs +1 -1
- package/build/cjs/chunk-KN4OGPAB.cjs.map +1 -1
- package/build/cjs/{chunk-3CPXWE5R.cjs → chunk-N7QAVHKA.cjs} +3 -3
- package/build/cjs/chunk-N7QAVHKA.cjs.map +1 -0
- package/build/cjs/chunk-V7DUQNL2.cjs +1 -1
- package/build/cjs/chunk-V7DUQNL2.cjs.map +1 -1
- package/build/cjs/{handleGenerate-LFHFMTI5-R364IB4D.cjs → handleGenerate-BRWT5QJG-YCPINH4C.cjs} +10 -10
- package/build/cjs/handleGenerate-BRWT5QJG-YCPINH4C.cjs.map +1 -0
- package/build/cjs/index.cjs +9 -9
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/loginFlow-DU7IQXS5.cjs +1 -1
- package/build/cjs/loginFlow-DU7IQXS5.cjs.map +1 -1
- package/build/cjs/{siteDeployCommand-3MZDNJBW.cjs → siteDeployCommand-A22XLCDF.cjs} +8 -8
- package/build/cjs/siteDeployCommand-A22XLCDF.cjs.map +1 -0
- package/build/cjs/{versionDeleteCommand-3AFHOPBB.cjs → versionDeleteCommand-ANP5N2PJ.cjs} +6 -6
- package/build/cjs/versionDeleteCommand-ANP5N2PJ.cjs.map +1 -0
- package/build/cjs/{versionGetCommand-G44GPMEG.cjs → versionGetCommand-QL2Q2CP4.cjs} +6 -6
- package/build/cjs/versionGetCommand-QL2Q2CP4.cjs.map +1 -0
- package/build/cjs/{versionListCommand-GTTXNVK4.cjs → versionListCommand-ABUMTBDK.cjs} +6 -6
- package/build/cjs/versionListCommand-ABUMTBDK.cjs.map +1 -0
- package/build/cjs/{versionSetCommand-ELRINKPK.cjs → versionSetCommand-YRMBNTFW.cjs} +6 -6
- package/build/cjs/versionSetCommand-YRMBNTFW.cjs.map +1 -0
- package/build/cjs/{versionUnsetCommand-GYBYED5E.cjs → versionUnsetCommand-EOAXE7JX.cjs} +6 -6
- package/build/cjs/versionUnsetCommand-EOAXE7JX.cjs.map +1 -0
- package/build/esm/chunk-2FHBRDJE.js +1 -1
- package/build/esm/chunk-2FHBRDJE.js.map +1 -1
- package/build/esm/chunk-G3PMV62Z.js +1 -1
- package/build/esm/chunk-G3PMV62Z.js.map +1 -1
- package/build/esm/chunk-IRSUCKI2.js +1 -1
- package/build/esm/chunk-IRSUCKI2.js.map +1 -1
- package/build/esm/{chunk-XUNEMZTE.js → chunk-RTBY6IQO.js} +3 -3
- package/build/esm/chunk-RTBY6IQO.js.map +1 -0
- package/build/esm/chunk-YYFW7BKO.js +1 -1
- package/build/esm/chunk-YYFW7BKO.js.map +1 -1
- package/build/{browser/handleGenerate-LFHFMTI5-4XSGH53A.js → esm/handleGenerate-BRWT5QJG-XBEQW44J.js} +9 -9
- package/build/esm/handleGenerate-BRWT5QJG-XBEQW44J.js.map +1 -0
- package/build/esm/index.js +9 -9
- package/build/esm/index.js.map +1 -1
- package/build/esm/loginFlow-SCW45N4C.js +1 -1
- package/build/esm/loginFlow-SCW45N4C.js.map +1 -1
- package/build/{browser/siteDeployCommand-CM2MORY4.js → esm/siteDeployCommand-5VG3J6JA.js} +3 -3
- package/build/esm/siteDeployCommand-5VG3J6JA.js.map +1 -0
- package/build/esm/{versionDeleteCommand-X57FGSGV.js → versionDeleteCommand-PYIX6VKL.js} +3 -3
- package/build/esm/versionDeleteCommand-PYIX6VKL.js.map +1 -0
- package/build/{browser/versionGetCommand-XXW7AUYY.js → esm/versionGetCommand-LK7EMAMW.js} +3 -3
- package/build/esm/versionGetCommand-LK7EMAMW.js.map +1 -0
- package/build/{browser/versionListCommand-YCG2FWRB.js → esm/versionListCommand-MOU6FSOB.js} +3 -3
- package/build/esm/versionListCommand-MOU6FSOB.js.map +1 -0
- package/build/{browser/versionSetCommand-VXNQ4MK6.js → esm/versionSetCommand-Z2XKFFT3.js} +3 -3
- package/build/esm/versionSetCommand-Z2XKFFT3.js.map +1 -0
- package/build/esm/{versionUnsetCommand-UFLNPHZE.js → versionUnsetCommand-R7GVBMMI.js} +3 -3
- package/build/esm/versionUnsetCommand-R7GVBMMI.js.map +1 -0
- package/package.json +10 -10
- package/build/browser/chunk-XUNEMZTE.js.map +0 -1
- package/build/browser/handleGenerate-LFHFMTI5-4XSGH53A.js.map +0 -1
- package/build/browser/siteDeployCommand-CM2MORY4.js.map +0 -1
- package/build/browser/versionDeleteCommand-X57FGSGV.js.map +0 -1
- package/build/browser/versionGetCommand-XXW7AUYY.js.map +0 -1
- package/build/browser/versionListCommand-YCG2FWRB.js.map +0 -1
- package/build/browser/versionSetCommand-VXNQ4MK6.js.map +0 -1
- package/build/browser/versionUnsetCommand-UFLNPHZE.js.map +0 -1
- package/build/cjs/chunk-3CPXWE5R.cjs.map +0 -1
- package/build/cjs/handleGenerate-LFHFMTI5-R364IB4D.cjs.map +0 -1
- package/build/cjs/siteDeployCommand-3MZDNJBW.cjs.map +0 -1
- package/build/cjs/versionDeleteCommand-3AFHOPBB.cjs.map +0 -1
- package/build/cjs/versionGetCommand-G44GPMEG.cjs.map +0 -1
- package/build/cjs/versionListCommand-GTTXNVK4.cjs.map +0 -1
- package/build/cjs/versionSetCommand-ELRINKPK.cjs.map +0 -1
- package/build/cjs/versionUnsetCommand-GYBYED5E.cjs.map +0 -1
- package/build/esm/chunk-XUNEMZTE.js.map +0 -1
- package/build/esm/handleGenerate-LFHFMTI5-4XSGH53A.js.map +0 -1
- package/build/esm/siteDeployCommand-CM2MORY4.js.map +0 -1
- package/build/esm/versionDeleteCommand-X57FGSGV.js.map +0 -1
- package/build/esm/versionGetCommand-XXW7AUYY.js.map +0 -1
- package/build/esm/versionListCommand-YCG2FWRB.js.map +0 -1
- package/build/esm/versionSetCommand-VXNQ4MK6.js.map +0 -1
- package/build/esm/versionUnsetCommand-UFLNPHZE.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/site/version/unset/versionUnsetCommand.mts"],"names":[],"mappings":";;;;;;;;;;;;AAgBA,SAAS,eAAe;AAExB,SAAS,gBAAgB;AAGzB,eAAO,oBAA2C;AAAA,EAChD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,MAAI,CAAC,KAAK;AACR,UAAM,YAAY,MAAM,QAAQ,OAAO;AAAA,EAA0D,SAAS,QAAQ,8EAA8E,CAAC,IAAI;AAAA,MACnM,MAAM;AAAA,IACR,CAAC;AACD,uBAAmB,SAAS;AAAA,EAC9B;AACA,QAAM,cAAc,MAAM,UAAU,OAAO,SAAS;AACpD,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,UAAQ,MAAM,4BAA4B;AAC1C,QAAM,iCAAuB,gBAAgB,WAAW,WAAW;AACnE,UAAQ,QAAQ,2BAA2B;AAC7C","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nimport { createInternalClientContext, thirdPartyApplications } from \"#net\";\nimport { colorize } from \"consola/utils\";\nimport { handlePromptCancel } from \"../../../../consola/handlePromptCancel.js\";\nimport { loadToken } from \"../../../../util/token.js\";\nexport default async function versionUnsetCommand({\n yes,\n application,\n foundryUrl,\n token,\n tokenFile\n}) {\n if (!yes) {\n const confirmed = await consola.prompt(`Are you sure you want to clear the live site version?\\n${colorize(\"bold\", \"Your site will no longer be accessible until a new live site version is set.\")}`, {\n type: \"confirm\"\n });\n handlePromptCancel(confirmed);\n }\n const loadedToken = await loadToken(token, tokenFile);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n consola.start(\"Clearing live site version\");\n await thirdPartyApplications.undeployWebsite(clientCtx, application);\n consola.success(\"Cleared live site version\");\n}"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/net/createInternalClientContext.mts","../../src/net/third-party-applications/index.mts","../../src/net/createFetch.mts","../../src/net/UserAgent.ts","../../src/net/third-party-applications/deleteVersion.mts","../../src/net/third-party-applications/deployWebsite.mts","../../src/net/third-party-applications/getWebsite.mts","../../src/net/third-party-applications/listVersions.mts","../../src/net/third-party-applications/undeployWebsite.mts","../../src/net/third-party-applications/uploadVersion.mts","../../src/util/token.ts"],"names":["fetch","PalantirApiError","consola"],"mappings":";;;;;;;;AAgBO,SAAS,4BAA4B,YAAY,eAAe;AACrE,SAAO;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;;;ACrBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACiBA,SAAS,0BAA0B,oBAAoB,wBAAwB;AAC/E,SAAS,eAAe;;;ACFjB,IAAM,aAAa,YAAY,eAA2B;;;ADI1D,SAAS,YAAY,eAAe,UAAU,OAAO;AAC1D,SAAO,yBAAyB,0BAA0B,wBAAwB,mBAAmB,OAAO,CAAC,CAAC,GAAG,OAAM,YAAW;AAChI,UAAM,QAAQ,MAAM,cAAc;AAClC,YAAQ,IAAI,iBAAiB,UAAU,KAAK,EAAE;AAC9C,YAAQ,IAAI,oBAAoB,UAAU;AAC1C,W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AAM,KAAK;AAAA,EACrB,SAAS,OAAO;AACd,UAAM,IAAI,iBAAiB,GAAG,8BAA8B,QAAQ,MAAM,KAAK,EAAE;AAAA,EACnF;AACA,SAAO;AAAA,IACL,UAAU;AAAA,IACV;AAAA,EACF;AACF;AACO,SAAS,SAAS,OAAO;AAC9B,MAAI,CAAC,MAAM,KAAK,GAAG;AACjB,UAAM,IAAI,iBAAiB,GAAG,mCAAmC;AAAA,EACnE;AACF;AACA,SAAS,MAAM,OAAO;AAEpB,QAAM,aAAa;AACnB,SAAO,WAAW,KAAK,KAAK;AAC9B","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 function createInternalClientContext(foundryUrl, tokenProvider) {\n return {\n tokenProvider,\n foundryUrl\n };\n}","/*\n * Copyright 2024 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 { deleteVersion } from \"./deleteVersion.mjs\";\nexport { deployWebsite } from \"./deployWebsite.mjs\";\nexport { getWebsite } from \"./getWebsite.mjs\";\nexport { listVersions } from \"./listVersions.mjs\";\nexport { undeployWebsite } from \"./undeployWebsite.mjs\";\nexport { uploadVersion } from \"./uploadVersion.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 { ExitProcessError } from \"@osdk/cli.common\";\nimport { createFetchHeaderMutator, createFetchOrThrow, PalantirApiError } from \"@osdk/shared.net\";\nimport { consola } from \"consola\";\nimport { USER_AGENT } from \"./UserAgent.js\";\nexport function createFetch(tokenProvider, fetchFn = fetch) {\n return createFetchHeaderMutator(createRequestLoggingFetch(createErrorExitingFetch(createFetchOrThrow(fetchFn))), async headers => {\n const token = await tokenProvider();\n headers.set(\"Authorization\", `Bearer ${token}`);\n headers.set(\"Fetch-User-Agent\", USER_AGENT);\n return headers;\n });\n}\nfunction createErrorExitingFetch(fetchFn = fetch) {\n return function errorExitingFetch(input, init) {\n return fetchFn(input, init).catch(handleFetchError);\n };\n}\nfunction handleFetchError(e) {\n if (!(e instanceof PalantirApiError)) {\n throw new ExitProcessError(1, \"Unexpected fetch error\");\n }\n let tip;\n if (e.statusCode === 401) {\n tip = \"Check your token is valid and has not expired or been disabled\";\n } else if (e.statusCode === 403) {\n tip = \"Check your token has the required scopes for this operation\";\n }\n let message = e.message;\n if (e.errorName === \"CannotDeleteDeployedVersion\") {\n message = \"The site version to delete is live and cannot be deleted\";\n tip = \"Run the `site version set` command to change the live site version\";\n } else if (e.errorName === \"InvalidVersion\") {\n message = \"The site version is invalid and must be a valid SemVer string\";\n } else if (e.errorName === \"VersionAlreadyExists\") {\n message = \"The site version already exists\";\n } else if (e.errorName === \"VersionNotFound\") {\n message = \"The site version could not be found\";\n }\n throw new ExitProcessError(1, message, tip, e);\n}\nfunction createRequestLoggingFetch(fetchFn = fetch) {\n return function requestLoggingFetch(input, init) {\n const requestLog = typeof input === \"string\" || input instanceof URL ? `${init?.method ?? \"GET\"}: ${input.toString().trim()}` : `${input.method ?? \"GET\"}: ${input.url.toString().trim()}`;\n consola.trace(requestLog);\n return fetchFn(input, init).then(a => {\n consola.trace(`FINISH ${requestLog}`);\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\nexport const USER_AGENT = `osdk-cli/${process.env.PACKAGE_VERSION}`;","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function deleteVersion(ctx, thirdPartyAppRid, version) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website/versions/${version}?preview=true`;\n await fetch(url, {\n method: \"DELETE\"\n });\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function deployWebsite(ctx, thirdPartyAppRid, request) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website/deploy?preview=true`;\n const result = await fetch(url, {\n method: \"POST\",\n body: JSON.stringify(request),\n headers: {\n \"Content-Type\": \"application/json\"\n }\n });\n return result.json();\n}","/*\n * Copyright 2024 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 { ExitProcessError } from \"@osdk/cli.common\";\nimport { PalantirApiError } from \"@osdk/shared.net\";\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function getWebsite(ctx, thirdPartyAppRid) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website?preview=true`;\n try {\n const result = await fetch(url);\n return result.json();\n } catch (e) {\n // Revisit this error handling in the API\n if (e instanceof ExitProcessError && e.originalError != null && e.originalError instanceof PalantirApiError && e.originalError.errorName === \"WebsiteNotFound\") {\n return undefined;\n }\n throw e;\n }\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function listVersions(ctx, thirdPartyAppRid) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website/versions?preview=true`;\n const result = await fetch(url);\n return result.json();\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function undeployWebsite(ctx, thirdPartyAppRid) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website/undeploy?preview=true`;\n await fetch(url, {\n method: \"POST\"\n });\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function uploadVersion(ctx, thirdPartyAppRid, version, zipFile) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website/versions/upload?version=${version}&preview=true`;\n const result = await fetch(url, {\n method: \"POST\",\n body: zipFile,\n headers: {\n \"Content-Type\": \"application/octet-stream\"\n },\n duplex: \"half\" // Node hates me\n });\n return result.json();\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 { ExitProcessError } from \"@osdk/cli.common\";\nimport { consola } from \"consola\";\nimport { promises as fsPromises } from \"node:fs\";\nimport path from \"node:path\";\nconst TOKEN_ENV_VARS = [\"FOUNDRY_TOKEN\", \"FOUNDRY_SDK_AUTH_TOKEN\"];\n\n/**\n * Loads a JWT Auth Token from an argument, a file, or environment variable returning the first found.\n * @param token The token as a string.\n * @param tokenFile The path to the token file.\n * @returns The token as a string.\n * @throws An error if no token is found.\n */\nexport async function loadToken(token, tokenFile) {\n if (token) {\n consola.debug(`Using token from --token option`);\n validate(token);\n return token;\n }\n if (tokenFile) {\n const loadedToken = await loadTokenFile(tokenFile);\n consola.debug(`Using token from --tokenFile=${loadedToken.filePath} option`);\n validate(loadedToken.token);\n return loadedToken.token;\n }\n for (const envVar of TOKEN_ENV_VARS) {\n const environmentToken = process.env[envVar];\n if (environmentToken) {\n consola.debug(`Using token from ${envVar} environment variable`);\n validate(environmentToken);\n if (envVar === \"FOUNDRY_SDK_AUTH_TOKEN\") {\n consola.warn(`Using FOUNDRY_SDK_AUTH_TOKEN environment variable is deprecated. Please use FOUNDRY_TOKEN instead.`);\n }\n return environmentToken;\n }\n }\n throw new ExitProcessError(2, `No token found.`, `You can supply a --token or --token-file option, or set the ${TOKEN_ENV_VARS[0]} environment variable`);\n}\n/**\n * Reads a JWT Auth Token from a file.\n * @param filePath The path to the token file.\n * @returns The token as a string.\n * @throws An error if the file cannot be read.\n */\nexport async function loadTokenFile(filePath) {\n let token;\n let resolvedPath;\n try {\n resolvedPath = path.resolve(filePath);\n token = await fsPromises.readFile(resolvedPath, \"utf8\");\n token = token.trim();\n } catch (error) {\n throw new ExitProcessError(2, `Unable to read token file \"${filePath}\": ${error}`);\n }\n return {\n filePath: resolvedPath,\n token\n };\n}\nexport function validate(token) {\n if (!isJWT(token)) {\n throw new ExitProcessError(2, `Token does not appear to be a JWT`);\n }\n}\nfunction isJWT(token) {\n // https://stackoverflow.com/a/65755789\n const jwtPattern = /^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]*$/;\n return jwtPattern.test(token);\n}"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js","../../../cli.cmd.typescript/build/esm/handleGenerate-LFHFMTI5.js"],"names":["deepEqual"],"mappings":";;;;;;;;;;;;;AAAA;AAAA;AAAA;AAGA,WAAO,UAAU,SAAS,MAAM,GAAG,GAAG;AACpC,UAAI,MAAM,EAAG,QAAO;AACpB,UAAI,KAAK,KAAK,OAAO,KAAK,YAAY,OAAO,KAAK,UAAU;AAC1D,YAAI,EAAE,gBAAgB,EAAE,YAAa,QAAO;AAC5C,YAAI,QAAQ,GAAG;AACf,YAAI,MAAM,QAAQ,CAAC,GAAG;AACpB,mBAAS,EAAE;AACX,cAAI,UAAU,EAAE,OAAQ,QAAO;AAC/B,eAAK,IAAI,QAAQ,QAAQ,IAAI,KAAI,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,EAAG,QAAO;AAC5D,iBAAO;AAAA,QACT;AACA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,CAAC,OAAO,aAAa;AAC9B,aAAU,YAAS,UAAU,OAAO,UAAU,OAAO;AAAA,IACvD;AAAA,IACA,OAAO,OAAO,OAAO,YAAY;AAC/B,YAAS,YAAS,MAAM,OAAO,OAAO;AAAA,IACxC;AAAA,IACA,SAAS,OAAM,UAAY,YAAS,QAAQ,KAAK;AAAA,EACnD;AACF","sourcesContent":["'use strict';\n\n// do not edit .js files directly - edit src/index.jst\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;) if (!equal(a[i], b[i])) return false;\n return true;\n }\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n for (i = length; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n if (!equal(a[key], b[key])) return false;\n }\n return true;\n }\n\n // true if both NaN, false otherwise\n return a !== a && b !== b;\n};","import { YargsCheckError, ExitProcessError } from '@osdk/cli.common';\nimport invokeLoginFlow from '@osdk/cli.common/loginFlow';\nimport { listOntologiesV2, getOntologyFullMetadata } from '@osdk/gateway/requests';\nimport { getExpectedDependencies, __UNSTABLE_generateClientSdkPackage, generateClientSdkVersionTwoPointZero, generateClientSdkVersionOneDotOne } from '@osdk/generator';\nimport { createClientContext, createOpenApiRequest } from '@osdk/shared.net';\nimport { consola } from 'consola';\nimport deepEqual from 'fast-deep-equal';\nimport { findUp } from 'find-up';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { fileURLToPath } from 'url';\n\n// src/generate/handleGenerate.mts\nvar USER_AGENT = `osdk-cli.cmd.typescript/${\"0.4.0-beta.2\"}`;\nasync function handleGenerate(args) {\n let success = false;\n if (args.ontologyPath) {\n success = await generateFromLocalFile(args);\n } else if (args.foundryUrl && args.clientId) {\n success = await generateFromStack(args);\n } else {\n throw new YargsCheckError(\"Must have specified ontologyPath or stack and clientId\");\n }\n if (success) {\n consola.info(\"OSDK Generated!\");\n } else {\n throw new ExitProcessError(1, \"Failed to generate the TypeScript SDK\");\n }\n}\nasync function generateFromLocalFile(args) {\n if (!fs.existsSync(args.ontologyPath)) {\n consola.error(`Ontology file does not exist: ${args.ontologyPath}`);\n return false;\n }\n const ontology = JSON.parse(await fs.promises.readFile(args.ontologyPath, \"utf-8\"));\n return await generateClientSdk(ontology, args);\n}\nasync function generateFromStack(args) {\n const {\n foundryUrl,\n clientId,\n ontologyWritePath\n } = args;\n const token = await invokeLoginFlow({\n clientId,\n foundryUrl,\n verbose: 0\n });\n const {\n fetch\n } = createClientContext({\n metadata: {\n userAgent: USER_AGENT\n }\n }, args.foundryUrl, () => token.access_token, USER_AGENT);\n try {\n const ontologies = await listOntologiesV2(createOpenApiRequest(foundryUrl, fetch));\n if (args.ontologyRid) {\n ontologies.data = ontologies.data.filter(o => o.rid === args.ontologyRid);\n }\n if (ontologies.data.length !== 1) {\n consola.error(`Could not look up ontology with these credentials. Found ${ontologies.data.length} ontologies.`);\n return false;\n }\n const ontology = await getOntologyFullMetadata(createOpenApiRequest(foundryUrl, fetch), ontologies.data[0].apiName);\n if (ontologyWritePath) {\n fs.writeFileSync(ontologyWritePath, JSON.stringify(ontology, null, 2));\n }\n return await generateClientSdk(ontology, args);\n } catch (e) {\n consola.error(\"Failed to generate the ontology\", e);\n return false;\n }\n}\nasync function generateClientSdk(ontology, args) {\n const minimalFs = createNormalFs();\n try {\n if (args.clean) {\n consola.info(\"Cleaning output directory\", args.outDir);\n await fs.promises.rm(args.outDir, {\n recursive: true,\n force: true\n });\n }\n if (!args.asPackage) {\n await generateSourceFiles(args, ontology, minimalFs);\n const packageJsonPath = await findUp(\"package.json\", {\n cwd: args.outDir\n });\n if (!packageJsonPath) {\n return true;\n }\n const packageJsonOriginal = JSON.parse(await fs.promises.readFile(packageJsonPath, \"utf-8\"));\n const packageJson = JSON.parse(await fs.promises.readFile(packageJsonPath, \"utf-8\"));\n const dependencyVersions = await getDependencyVersions();\n if (args.internal) {\n dependencyVersions.osdkApiVersion = \"workspace:~\";\n dependencyVersions.osdkClientApiVersion = \"workspace:~\";\n dependencyVersions.osdkClientVersion = \"workspace:~\";\n dependencyVersions.osdkLegacyClientVersion = \"workspace:~\";\n }\n const expectedDeps = getExpectedDependencies(args.beta ? \"2.0\" : \"1.1\", dependencyVersions);\n for (const [type, deps] of Object.entries(expectedDeps)) {\n if (!(type in packageJson)) {\n packageJson[type] = deps;\n } else {\n Object.assign(packageJson[type], deps);\n }\n }\n if (!deepEqual(packageJsonOriginal, packageJson)) {\n await fs.promises.writeFile(packageJsonPath, JSON.stringify(packageJson, void 0, 2) + \"\\n\");\n }\n return true;\n }\n await __UNSTABLE_generateClientSdkPackage(args.packageName, args.version, args.beta ? \"2.0\" : \"1.1\", args.outDir, ontology, minimalFs, await getDependencyVersions(), \"0.22.0-beta.2\");\n return true;\n } catch (e) {\n consola.error(\"OSDK generation failed\", e.message, e.stack);\n return false;\n }\n}\nasync function getDependencyVersions() {\n const ourPackageJsonPath = await getOurPackageJsonPath();\n const ourPackageJson = JSON.parse(await fs.promises.readFile(ourPackageJsonPath, \"utf-8\"));\n const typescriptVersion = ourPackageJson.devDependencies.typescript;\n const tslibVersion = ourPackageJson.dependencies.tslib;\n const areTheTypesWrongVersion = ourPackageJson.dependencies[\"@arethetypeswrong/cli\"];\n const osdkClientVersion = `^${\"0.20.0-beta.4\"}`;\n const osdkClientApiVersion = `^${\"0.20.0-beta.4\"}`;\n const osdkApiVersion = `^${\"1.9.0-beta.1\"}`;\n const osdkLegacyClientVersion = `^${\"2.4.0-beta.2\"}`;\n return {\n typescriptVersion,\n tslibVersion,\n areTheTypesWrongVersion,\n osdkApiVersion,\n osdkClientVersion,\n osdkClientApiVersion,\n osdkLegacyClientVersion\n };\n}\nvar cachedOurPackageJsonPath;\nasync function getOurPackageJsonPath() {\n if (cachedOurPackageJsonPath) return cachedOurPackageJsonPath;\n const __dir = path.dirname(fileURLToPath(import.meta.url));\n const ourPackageJsonPath = await findUp(\"package.json\", {\n cwd: __dir\n });\n if (!ourPackageJsonPath) {\n throw new Error(\"Could not find our package.json\");\n }\n return cachedOurPackageJsonPath = ourPackageJsonPath;\n}\nasync function generateSourceFiles(args, ontology, fs2) {\n await (args.beta ? generateClientSdkVersionTwoPointZero : generateClientSdkVersionOneDotOne)(ontology, getUserAgent(args.version), fs2, args.outDir, args.packageType);\n}\nfunction getUserAgent(version) {\n if (version === \"dev\") {\n return \"typescript-sdk/dev osdk-cli/dev\";\n } else {\n return `typescript-sdk/${version} ${USER_AGENT}`;\n }\n}\nfunction createNormalFs() {\n return {\n writeFile: (path2, contents) => {\n return fs.promises.writeFile(path2, contents, \"utf-8\");\n },\n mkdir: async (path2, options) => {\n await fs.promises.mkdir(path2, options);\n },\n readdir: async path2 => fs.promises.readdir(path2)\n };\n}\nexport { getDependencyVersions, handleGenerate };"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/site/deploy/siteDeployCommand.mts","../../src/util/autoVersion.ts"],"names":[],"mappings":";;;;;;;;;;;;AAgBA,SAAS,eAAe;AAGxB,OAAO,cAAc;AACrB,SAAS,gBAAgB;AACzB,YAAY,QAAQ;AACpB,OAAO,UAAU;AACjB,SAAS,gBAAgB;;;ACNzB,SAAS,YAAY;AACrB,SAAS,iBAAiB;AAS1B,eAAsB,YAAY,YAAY,IAAI;AAChD,QAAM,CAAC,aAAa,WAAW,IAAI,cAAc,KAAK,CAAC,WAAW,IAAI,OAAO,IAAI,SAAS,EAAE,CAAC,IAAI,CAAC,QAAW,IAAI,OAAO,KAAK,CAAC;AAC9H,QAAM,aAAa,M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Y,cAAY;AACjC,mBAAe;AAAA,MACb,WAAW,SAAS,QAAQ;AAAA,MAC5B,OAAO,SAAS,GAAG;AAAA,IACrB;AAAA,EACF,CAAC;AACD,UAAQ,GAAG,UAAU,MAAM;AACzB,YAAQ,MAAM,UAAU,aAAa,SAAS,cAAc,aAAa,KAAK,QAAQ;AAAA,EACxF,CAAC;AACH;AACA,SAAS,YAAY,OAAO,MAAM;AAChC,UAAQ,IAAI;AAAA,IACV,SAAS,GAAG,KAAK;AAAA;AAAA,EAAO,SAAS,SAAS,IAAI,CAAC;AAAA,IAC/C,OAAO;AAAA,MACL,SAAS;AAAA,MACT,aAAa;AAAA,MACb,aAAa;AAAA,IACf;AAAA,EACF,CAAC;AACH","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 { createInternalClientContext, thirdPartyApplications } from \"#net\";\nimport { ExitProcessError } from \"@osdk/cli.common\";\nimport archiver from \"archiver\";\nimport { colorize } from \"consola/utils\";\nimport * as fs from \"node:fs\";\nimport path from \"node:path\";\nimport { Readable } from \"node:stream\";\nimport { autoVersion as findAutoVersion } from \"../../../util/autoVersion.js\";\nimport { loadToken } from \"../../../util/token.js\";\nexport default async function siteDeployCommand({\n selectedVersion,\n application,\n foundryUrl,\n uploadOnly,\n directory,\n token,\n tokenFile\n}) {\n const loadedToken = await loadToken(token, tokenFile);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n let siteVersion;\n if (typeof selectedVersion === \"string\") {\n siteVersion = selectedVersion;\n } else {\n siteVersion = await findAutoVersion(selectedVersion.tagPrefix);\n consola.info(`Auto version inferred next version to be: ${siteVersion}`);\n }\n consola.debug(`Using directory for site files: \"${path.resolve(directory)}`);\n const stat = await fs.promises.stat(directory);\n if (!stat.isDirectory()) {\n throw new ExitProcessError(2, \"Specified path exists but is not a directory\");\n }\n consola.start(\"Zipping site files\");\n const archive = archiver(\"zip\").directory(directory, false);\n logArchiveStats(archive);\n consola.start(\"Uploading site files\");\n await Promise.all([thirdPartyApplications.uploadVersion(clientCtx, application, siteVersion, Readable.toWeb(archive) // This cast is because the dom fetch doesn't align type wise with streams\n ), archive.finalize()]);\n consola.success(\"Upload complete\");\n if (!uploadOnly) {\n const website = await thirdPartyApplications.deployWebsite(clientCtx, application, {\n version: siteVersion\n });\n consola.success(`Deployed ${siteVersion} successfully`);\n const domain = website.subdomains[0];\n if (domain != null) {\n logSiteLink(\"View live site:\", `https://${domain}`);\n }\n } else {\n const website = await thirdPartyApplications.getWebsite(clientCtx, application);\n const domain = website?.subdomains[0];\n consola.debug(\"Upload only mode enabled, skipping deployment\");\n if (domain != null) {\n logSiteLink(\"Preview link:\", `https://${domain}/.system/preview?previewVersion=${siteVersion}`);\n }\n }\n}\nfunction logArchiveStats(archive) {\n let archiveStats = {\n fileCount: 0,\n bytes: 0\n };\n archive.on(\"progress\", progress => {\n archiveStats = {\n fileCount: progress.entries.total,\n bytes: progress.fs.totalBytes\n };\n });\n archive.on(\"finish\", () => {\n consola.debug(`Zipped ${archiveStats.fileCount} files and ${archiveStats.bytes} bytes`);\n });\n}\nfunction logSiteLink(title, link) {\n consola.box({\n message: `${title}\\n\\n${colorize(\"green\", link)}`,\n style: {\n padding: 2,\n borderColor: \"green\",\n borderStyle: \"rounded\"\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 { ExitProcessError, isValidSemver } from \"@osdk/cli.common\";\nimport { exec } from \"node:child_process\";\nimport { promisify } from \"node:util\";\n\n/**\n * Gets the version string using git describe. If the @param tagPrefix is empty, git describe will return the\n * latest tag (without any filtering) and if the tag starts with \"v\", it will be removed.\n * @param tagPrefix The prefix to use for matching against tags. Defaults to an empty string.\n * @returns A promise that resolves to the version string.\n * @throws An error if the version string is not SemVer compliant or if the version cannot be determined.\n */\nexport async function autoVersion(tagPrefix = \"\") {\n const [matchPrefix, prefixRegex] = tagPrefix !== \"\" ? [tagPrefix, new RegExp(`^${tagPrefix}`)] : [undefined, new RegExp(`^v?`)];\n const gitVersion = await gitDescribe(matchPrefix);\n const version = gitVersion.trim().replace(prefixRegex, \"\");\n if (!isValidSemver(version)) {\n throw new ExitProcessError(2, `The version string ${version} is not SemVer compliant.`);\n }\n return version;\n}\nasync function gitDescribe(matchPrefix) {\n let gitVersion;\n try {\n const execAsync = promisify(exec);\n const {\n stdout\n } = await execAsync(`git describe --tags --first-parent --dirty${matchPrefix != null ? ` --match=\"${matchPrefix}*\"` : \"\"}`, {\n encoding: \"utf8\"\n });\n gitVersion = stdout;\n } catch (error) {\n if (error instanceof Error) {\n const errorMessage = error.message.toLowerCase();\n if (errorMessage.includes(\"not recognized\") || errorMessage.includes(\"command not found\") || errorMessage.includes(\"no such file or directory\")) {\n throw new ExitProcessError(2, \"Unable to determine auto version using git-describe as git is not installed or found in the PATH.\", `You can set up git and try again or supply a --version option to set the version manually`);\n }\n if (errorMessage.includes(\"fatal: not a git repository\")) {\n throw new ExitProcessError(2, `Unable to determine auto version using git-describe as the current directory is not a git repository.`, `You can run the command in a git repository and try again or supply a --version option to set the version manually`);\n }\n if (errorMessage.includes(\"fatal: no names found, cannot describe anything.\")) {\n throw new ExitProcessError(2, `Unable to determine auto version using git-describe as no matching tags were found.`, `You can create a tag matching the configured tag prefix and try again or supply a --version option to set the version manually`);\n }\n }\n throw new ExitProcessError(2, `Unable to determine auto version using git-describe: ${error}.`, `You can supply a --version option to set the version manually`);\n }\n return gitVersion;\n}"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/site/version/delete/versionDeleteCommand.mts"],"names":[],"mappings":";;;;;;;;;;;;AAiBA,SAAS,eAAe;AACxB,SAAS,gBAAgB;AAGzB,eAAO,qBAA4C;AAAA,EACjD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,MAAI,CAAC,KAAK;AACR,UAAM,YAAY,MAAM,QAAQ,OAAO,+CAA+C,OAAO;AAAA,EAAM,SAAS,QAAQ,+BAA+B,CAAC,IAAI;AAAA,MACtJ,MAAM;AAAA,IACR,CAAC;AACD,uBAAmB,SAAS;AAAA,EAC9B;AACA,UAAQ,MAAM,oBAAoB,OAAO,EAAE;AAC3C,QAAM,cAAc,MAAM,UAAU,OAAO,SAAS;AACpD,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,QAAM,iCAAuB,cAAc,WAAW,aAAa,OAAO;AAC1E,UAAQ,QAAQ,mBAAmB,OAAO,EAAE;AAC9C","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createInternalClientContext, thirdPartyApplications } from \"#net\";\nimport { consola } from \"consola\";\nimport { colorize } from \"consola/utils\";\nimport { handlePromptCancel } from \"../../../../consola/handlePromptCancel.js\";\nimport { loadToken } from \"../../../../util/token.js\";\nexport default async function versionDeleteCommand({\n version,\n yes,\n application,\n foundryUrl,\n token,\n tokenFile\n}) {\n if (!yes) {\n const confirmed = await consola.prompt(`Are you sure you want to delete the version ${version}?\\n${colorize(\"bold\", \"This action cannot be undone.\")}`, {\n type: \"confirm\"\n });\n handlePromptCancel(confirmed);\n }\n consola.start(`Deleting version ${version}`);\n const loadedToken = await loadToken(token, tokenFile);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n await thirdPartyApplications.deleteVersion(clientCtx, application, version);\n consola.success(`Deleted version ${version}`);\n}"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/site/version/get/versionGetCommand.mts"],"names":[],"mappings":";;;;;;;;;AAiBA,SAAS,eAAe;AAExB,eAAO,kBAAyC;AAAA,EAC9C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,QAAM,cAAc,MAAM,UAAU,OAAO,SAAS;AACpD,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,UAAQ,MAAM,sBAAsB;AACpC,QAAM,UAAU,MAAM,iCAAuB,WAAW,WAAW,WAAW;AAC9E,QAAM,kBAAkB,SAAS;AACjC,MAAI,CAAC,iBAAiB;AACpB,YAAQ,KAAK,0BAA0B;AAAA,EACzC,OAAO;AACL,YAAQ,QAAQ,wBAAwB,eAAe,EAAE;AAAA,EAC3D;AACF","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createInternalClientContext, thirdPartyApplications } from \"#net\";\nimport { consola } from \"consola\";\nimport { loadToken } from \"../../../../util/token.js\";\nexport default async function versionGetCommand({\n foundryUrl,\n application,\n token,\n tokenFile\n}) {\n const loadedToken = await loadToken(token, tokenFile);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n consola.start(\"Getting live version\");\n const website = await thirdPartyApplications.getWebsite(clientCtx, application);\n const deployedVersion = website?.deployedVersion;\n if (!deployedVersion) {\n consola.info(\"No live site version set\");\n } else {\n consola.success(`Live site version is ${deployedVersion}`);\n }\n}"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/site/version/list/versionListCommand.mts"],"names":[],"mappings":";;;;;;;;;AAiBA,SAAS,eAAe;AACxB,SAAS,gBAAgB;AAEzB,eAAO,mBAA0C;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,QAAM,cAAc,MAAM,UAAU,OAAO,SAAS;AACpD,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,UAAQ,MAAM,sCAAsC;AACpD,QAAM,CAAC,UAAU,OAAO,IAAI,MAAM,QAAQ,IAAI,CAAC,iCAAuB,aAAa,WAAW,WAAW,GAAG,iCAAuB,WAAW,WAAW,WAAW,CAAC,CAAC;AACtK,MAAI,SAAS,KAAK,WAAW,GAAG;AAC9B,YAAQ,KAAK,wBAAwB;AACrC;AAAA,EACF;AACA,UAAQ,QAAQ,iBAAiB;AACjC,QAAM,SAAS,MAAM,OAAO,QAAQ;AACpC,QAAM,iBAAiB,OAAO,MAAM,SAAS,KAAK,IAAI,OAAK,EAAE,OAAO,EAAE,OAAO,OAAK,OAAO,MAAM,CAAC,CAAC,CAAC;AAClG,aAAW,WAAW,gBAAgB;AACpC,YAAQ,IAAI,SAAS,OAAO,GAAG,SAAS,mBAAmB,YAAY,SAAS,kBAAkB,SAAS,SAAS,aAAa,IAAI,EAAE,EAAE;AAAA,EAC3I;AACF","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createInternalClientContext, thirdPartyApplications } from \"#net\";\nimport { consola } from \"consola\";\nimport { colorize } from \"consola/utils\";\nimport { loadToken } from \"../../../../util/token.js\";\nexport default async function versionListCommand({\n foundryUrl,\n application,\n token,\n tokenFile\n}) {\n const loadedToken = await loadToken(token, tokenFile);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n consola.start(\"Fetching versions & deployed version\");\n const [versions, website] = await Promise.all([thirdPartyApplications.listVersions(clientCtx, application), thirdPartyApplications.getWebsite(clientCtx, application)]);\n if (versions.data.length === 0) {\n consola.info(\"No site versions found\");\n return;\n }\n consola.success(\"Found versions:\");\n const semver = await import(\"semver\");\n const sortedVersions = semver.rsort(versions.data.map(v => v.version).filter(v => semver.valid(v)));\n for (const version of sortedVersions) {\n consola.log(` - ${version}${website?.deployedVersion && version === website?.deployedVersion ? colorize(\"green\", ` (deployed)`) : \"\"}`);\n }\n}"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/site/version/set/versionSetCommand.mts"],"names":[],"mappings":";;;;;;;;;AAgBA,SAAS,eAAe;AAGxB,eAAO,kBAAyC;AAAA,EAC9C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,UAAQ,MAAM,sBAAsB;AACpC,QAAM,cAAc,MAAM,UAAU,OAAO,SAAS;AACpD,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,MAAI,SAAS;AACX,UAAM,iCAAuB,cAAc,WAAW,aAAa;AAAA,MACjE;AAAA,IACF,CAAC;AAAA,EACH;AACA,UAAQ,QAAQ,uBAAuB,OAAO,EAAE;AAClD","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nimport { createInternalClientContext, thirdPartyApplications } from \"#net\";\nimport { loadToken } from \"../../../../util/token.js\";\nexport default async function versionSetCommand({\n version,\n application,\n foundryUrl,\n token,\n tokenFile\n}) {\n consola.start(`Setting live version`);\n const loadedToken = await loadToken(token, tokenFile);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n if (version) {\n await thirdPartyApplications.deployWebsite(clientCtx, application, {\n version\n });\n }\n consola.success(`Set live version to ${version}`);\n}"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/site/version/unset/versionUnsetCommand.mts"],"names":[],"mappings":";;;;;;;;;;;;AAgBA,SAAS,eAAe;AAExB,SAAS,gBAAgB;AAGzB,eAAO,oBAA2C;AAAA,EAChD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,MAAI,CAAC,KAAK;AACR,UAAM,YAAY,MAAM,QAAQ,OAAO;AAAA,EAA0D,SAAS,QAAQ,8EAA8E,CAAC,IAAI;AAAA,MACnM,MAAM;AAAA,IACR,CAAC;AACD,uBAAmB,SAAS;AAAA,EAC9B;AACA,QAAM,cAAc,MAAM,UAAU,OAAO,SAAS;AACpD,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,UAAQ,MAAM,4BAA4B;AAC1C,QAAM,iCAAuB,gBAAgB,WAAW,WAAW;AACnE,UAAQ,QAAQ,2BAA2B;AAC7C","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nimport { createInternalClientContext, thirdPartyApplications } from \"#net\";\nimport { colorize } from \"consola/utils\";\nimport { handlePromptCancel } from \"../../../../consola/handlePromptCancel.js\";\nimport { loadToken } from \"../../../../util/token.js\";\nexport default async function versionUnsetCommand({\n yes,\n application,\n foundryUrl,\n token,\n tokenFile\n}) {\n if (!yes) {\n const confirmed = await consola.prompt(`Are you sure you want to clear the live site version?\\n${colorize(\"bold\", \"Your site will no longer be accessible until a new live site version is set.\")}`, {\n type: \"confirm\"\n });\n handlePromptCancel(confirmed);\n }\n const loadedToken = await loadToken(token, tokenFile);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n consola.start(\"Clearing live site version\");\n await thirdPartyApplications.undeployWebsite(clientCtx, application);\n consola.success(\"Cleared live site version\");\n}"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/net/createInternalClientContext.mts","../../src/net/third-party-applications/index.mts","../../src/net/createFetch.mts","../../src/net/UserAgent.ts","../../src/net/third-party-applications/deleteVersion.mts","../../src/net/third-party-applications/deployWebsite.mts","../../src/net/third-party-applications/getWebsite.mts","../../src/net/third-party-applications/listVersions.mts","../../src/net/third-party-applications/undeployWebsite.mts","../../src/net/third-party-applications/uploadVersion.mts","../../src/util/token.ts"],"names":["fetch","PalantirApiError","consola"],"mappings":";;;;;;;;AAgBO,SAAS,4BAA4B,YAAY,eAAe;AACrE,SAAO;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;;;ACrBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACiBA,SAAS,0BAA0B,oBAAoB,wBAAwB;AAC/E,SAAS,eAAe;;;ACFjB,IAAM,aAAa,YAAY,eAA2B;;;ADI1D,SAAS,YAAY,eAAe,UAAU,OAAO;AAC1D,SAAO,yBAAyB,0BAA0B,wBAAwB,mBAAmB,OAAO,CAAC,CAAC,GAAG,OAAM,YAAW;AAChI,UAAM,QAAQ,MAAM,cAAc;AAClC,YAAQ,IAAI,iBAAiB,UAAU,KAAK,EAAE;AAC9C,YAAQ,IAAI,oBAAoB,UAAU;AAC1C,WAAO;AAAA,EACT,CAAC;AACH;AACA,SAAS,wBAAwB,UAAU,OAAO;AAChD,SAAO,SAAS,kBAAkB,OAAO,MAAM;AAC7C,WAAO,QAAQ,OAAO,IAAI,EAAE,MAAM,gBAAgB;AAAA,EACpD;AACF;AACA,SAAS,iBAAiB,GAAG;AAC3B,MAAI,EAAE,aAAa,mBAAmB;AACpC,UAAM,IAAI,iBAAiB,GAAG,wBAAwB;AAAA,EACxD;AACA,MAAI;AACJ,MAAI,EAAE,eAAe,KAAK;AACxB,UAAM;AAAA,EACR,WAAW,EAAE,eAAe,KAAK;AAC/B,UAAM;AAAA,EACR;AACA,MAAI,UAAU,EAAE;AAChB,MAAI,EAAE,cAA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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 createInternalClientContext(foundryUrl, tokenProvider) {\n return {\n tokenProvider,\n foundryUrl\n };\n}","/*\n * Copyright 2024 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 { deleteVersion } from \"./deleteVersion.mjs\";\nexport { deployWebsite } from \"./deployWebsite.mjs\";\nexport { getWebsite } from \"./getWebsite.mjs\";\nexport { listVersions } from \"./listVersions.mjs\";\nexport { undeployWebsite } from \"./undeployWebsite.mjs\";\nexport { uploadVersion } from \"./uploadVersion.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 { ExitProcessError } from \"@osdk/cli.common\";\nimport { createFetchHeaderMutator, createFetchOrThrow, PalantirApiError } from \"@osdk/shared.net\";\nimport { consola } from \"consola\";\nimport { USER_AGENT } from \"./UserAgent.js\";\nexport function createFetch(tokenProvider, fetchFn = fetch) {\n return createFetchHeaderMutator(createRequestLoggingFetch(createErrorExitingFetch(createFetchOrThrow(fetchFn))), async headers => {\n const token = await tokenProvider();\n headers.set(\"Authorization\", `Bearer ${token}`);\n headers.set(\"Fetch-User-Agent\", USER_AGENT);\n return headers;\n });\n}\nfunction createErrorExitingFetch(fetchFn = fetch) {\n return function errorExitingFetch(input, init) {\n return fetchFn(input, init).catch(handleFetchError);\n };\n}\nfunction handleFetchError(e) {\n if (!(e instanceof PalantirApiError)) {\n throw new ExitProcessError(1, \"Unexpected fetch error\");\n }\n let tip;\n if (e.statusCode === 401) {\n tip = \"Check your token is valid and has not expired or been disabled\";\n } else if (e.statusCode === 403) {\n tip = \"Check your token has the required scopes for this operation\";\n }\n let message = e.message;\n if (e.errorName === \"CannotDeleteDeployedVersion\") {\n message = \"The site version to delete is live and cannot be deleted\";\n tip = \"Run the `site version set` command to change the live site version\";\n } else if (e.errorName === \"InvalidVersion\") {\n message = \"The site version is invalid and must be a valid SemVer string\";\n } else if (e.errorName === \"VersionAlreadyExists\") {\n message = \"The site version already exists\";\n } else if (e.errorName === \"VersionNotFound\") {\n message = \"The site version could not be found\";\n }\n throw new ExitProcessError(1, message, tip, e);\n}\nfunction createRequestLoggingFetch(fetchFn = fetch) {\n return function requestLoggingFetch(input, init) {\n const requestLog = typeof input === \"string\" || input instanceof URL ? `${init?.method ?? \"GET\"}: ${input.toString().trim()}` : `${input.method ?? \"GET\"}: ${input.url.toString().trim()}`;\n consola.trace(requestLog);\n return fetchFn(input, init).then(a => {\n consola.trace(`FINISH ${requestLog}`);\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\nexport const USER_AGENT = `osdk-cli/${process.env.PACKAGE_VERSION}`;","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function deleteVersion(ctx, thirdPartyAppRid, version) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website/versions/${version}?preview=true`;\n await fetch(url, {\n method: \"DELETE\"\n });\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function deployWebsite(ctx, thirdPartyAppRid, request) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website/deploy?preview=true`;\n const result = await fetch(url, {\n method: \"POST\",\n body: JSON.stringify(request),\n headers: {\n \"Content-Type\": \"application/json\"\n }\n });\n return result.json();\n}","/*\n * Copyright 2024 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 { ExitProcessError } from \"@osdk/cli.common\";\nimport { PalantirApiError } from \"@osdk/shared.net\";\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function getWebsite(ctx, thirdPartyAppRid) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website?preview=true`;\n try {\n const result = await fetch(url);\n return result.json();\n } catch (e) {\n // Revisit this error handling in the API\n if (e instanceof ExitProcessError && e.originalError != null && e.originalError instanceof PalantirApiError && e.originalError.errorName === \"WebsiteNotFound\") {\n return undefined;\n }\n throw e;\n }\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function listVersions(ctx, thirdPartyAppRid) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website/versions?preview=true`;\n const result = await fetch(url);\n return result.json();\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function undeployWebsite(ctx, thirdPartyAppRid) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website/undeploy?preview=true`;\n await fetch(url, {\n method: \"POST\"\n });\n}","/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function uploadVersion(ctx, thirdPartyAppRid, version, zipFile) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `${ctx.foundryUrl}/api/v2/thirdPartyApplications/${thirdPartyAppRid}/website/versions/upload?version=${version}&preview=true`;\n const result = await fetch(url, {\n method: \"POST\",\n body: zipFile,\n headers: {\n \"Content-Type\": \"application/octet-stream\"\n },\n duplex: \"half\" // Node hates me\n });\n return result.json();\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 { ExitProcessError } from \"@osdk/cli.common\";\nimport { consola } from \"consola\";\nimport { promises as fsPromises } from \"node:fs\";\nimport path from \"node:path\";\nconst TOKEN_ENV_VARS = [\"FOUNDRY_TOKEN\", \"FOUNDRY_SDK_AUTH_TOKEN\"];\n\n/**\n * Loads a JWT Auth Token from an argument, a file, or environment variable returning the first found.\n * @param token The token as a string.\n * @param tokenFile The path to the token file.\n * @returns The token as a string.\n * @throws An error if no token is found.\n */\nexport async function loadToken(token, tokenFile) {\n if (token) {\n consola.debug(`Using token from --token option`);\n validate(token);\n return token;\n }\n if (tokenFile) {\n const loadedToken = await loadTokenFile(tokenFile);\n consola.debug(`Using token from --tokenFile=${loadedToken.filePath} option`);\n validate(loadedToken.token);\n return loadedToken.token;\n }\n for (const envVar of TOKEN_ENV_VARS) {\n const environmentToken = process.env[envVar];\n if (environmentToken) {\n consola.debug(`Using token from ${envVar} environment variable`);\n validate(environmentToken);\n if (envVar === \"FOUNDRY_SDK_AUTH_TOKEN\") {\n consola.warn(`Using FOUNDRY_SDK_AUTH_TOKEN environment variable is deprecated. Please use FOUNDRY_TOKEN instead.`);\n }\n return environmentToken;\n }\n }\n throw new ExitProcessError(2, `No token found.`, `You can supply a --token or --token-file option, or set the ${TOKEN_ENV_VARS[0]} environment variable`);\n}\n/**\n * Reads a JWT Auth Token from a file.\n * @param filePath The path to the token file.\n * @returns The token as a string.\n * @throws An error if the file cannot be read.\n */\nexport async function loadTokenFile(filePath) {\n let token;\n let resolvedPath;\n try {\n resolvedPath = path.resolve(filePath);\n token = await fsPromises.readFile(resolvedPath, \"utf8\");\n token = token.trim();\n } catch (error) {\n throw new ExitProcessError(2, `Unable to read token file \"${filePath}\": ${error}`);\n }\n return {\n filePath: resolvedPath,\n token\n };\n}\nexport function validate(token) {\n if (!isJWT(token)) {\n throw new ExitProcessError(2, `Token does not appear to be a JWT`);\n }\n}\nfunction isJWT(token) {\n // https://stackoverflow.com/a/65755789\n const jwtPattern = /^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]*$/;\n return jwtPattern.test(token);\n}"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js","../../../cli.cmd.typescript/build/esm/handleGenerate-LFHFMTI5.js"],"names":["deepEqual"],"mappings":";;;;;;;;;;;;;AAAA;AAAA;AAAA;AAGA,WAAO,UAAU,SAAS,MAAM,GAAG,GAAG;AACpC,UAAI,MAAM,EAAG,QAAO;AACpB,UAAI,KAAK,KAAK,OAAO,KAAK,YAAY,OAAO,KAAK,UAAU;AAC1D,YAAI,EAAE,gBAAgB,EAAE,YAAa,QAAO;AAC5C,YAAI,QAAQ,GAAG;AACf,YAAI,MAAM,QAAQ,CAAC,GAAG;AACpB,mBAAS,EAAE;AACX,cAAI,UAAU,EAAE,OAAQ,QAAO;AAC/B,eAAK,IAAI,QAAQ,QAAQ,IAAI,KAAI,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,EAAG,QAAO;AAC5D,iBAAO;AAAA,QACT;AACA,YAAI,EAAE,gBAAgB,OAAQ,QAAO,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE;AAC5E,YAAI,EAAE,YAAY,OAAO,UAAU,QAAS,QAAO,EAAE,QAAQ,MAAM,EAAE,QAAQ;AAC7E,YAAI,EAAE,aAAa,OAAO,UAAU,SAAU,QAAO,EAAE,SAAS,MAAM,EAAE,SAAS;AACjF,eAAO,OAAO,KAAK,CAAC;AACpB,iBAAS,KAAK;AACd,YAAI,WAAW,OAAO,KAAK,CAAC,EAAE,OAAQ,QAAO;AAC7C,aAAK,IAAI,QAAQ,QAAQ,IAAI,KAAI,CAAC,OAAO,UAAU,eAAe,KAAK,GAAG,KAAK,CAAC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,QAAM,uBAAuB,IAAI,eAAe;AAChD,QAAM,iBAAiB,IAAI,cAAc;AACzC,QAAM,0BAA0B,IAAI,cAAc;AAClD,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AACA,IAAI;AACJ,eAAe,wBAAwB;AACrC,MAAI,yBAA0B,QAAO;AACrC,QAAM,QAAa,aAAQ,cAAc,YAAY,GAAG,CAAC;AACzD,QAAM,qBAAqB,MAAM,OAAO,gBAAgB;AAAA,IACtD,KAAK;AAAA,EACP,CAAC;AACD,MAAI,CAAC,oBAAoB;AACvB,UAAM,IAAI,MAAM,iCAAiC;AAAA,EACnD;AACA,SAAO,2BAA2B;AACpC;AACA,eAAe,oBAAoB,MAAM,UAAU,KAAK;AACtD,SAAO,KAAK,OAAO,uCAAuC,mCAAmC,UAAU,aAAa,KAAK,OAAO,GAAG,KAAK,KAAK,QAAQ,KAAK,WAAW;AACvK;AACA,SAAS,aAAa,SAAS;AAC7B,MAAI,YAAY,OAAO;AACrB,WAAO;AAAA,EACT,OAAO;AACL,WAAO,kBAAkB,OAAO,IAAI,UAAU;AAAA,EAChD;AACF;AACA,SAAS,iBAAiB;AACxB,SAAO;AAAA,IACL,WAAW,CAAC,OAAO,aAAa;AAC9B,aAAU,YAAS,UAAU,OAAO,UAAU,OAAO;AAAA,IACvD;AAAA,IACA,OAAO,OAAO,OAAO,YAAY;AAC/B,YAAS,YAAS,MAAM,OAAO,OAAO;AAAA,IACxC;AAAA,IACA,SAAS,OAAM,UAAY,YAAS,QAAQ,KAAK;AAAA,EACnD;AACF","sourcesContent":["'use strict';\n\n// do not edit .js files directly - edit src/index.jst\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;) if (!equal(a[i], b[i])) return false;\n return true;\n }\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n for (i = length; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n if (!equal(a[key], b[key])) return false;\n }\n return true;\n }\n\n // true if both NaN, false otherwise\n return a !== a && b !== b;\n};","import { YargsCheckError, ExitProcessError } from '@osdk/cli.common';\nimport invokeLoginFlow from '@osdk/cli.common/loginFlow';\nimport { listOntologiesV2, getOntologyFullMetadata } from '@osdk/gateway/requests';\nimport { getExpectedDependencies, __UNSTABLE_generateClientSdkPackage, generateClientSdkVersionTwoPointZero, generateClientSdkVersionOneDotOne } from '@osdk/generator';\nimport { createClientContext, createOpenApiRequest } from '@osdk/shared.net';\nimport { consola } from 'consola';\nimport deepEqual from 'fast-deep-equal';\nimport { findUp } from 'find-up';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { fileURLToPath } from 'url';\n\n// src/generate/handleGenerate.mts\nvar USER_AGENT = `osdk-cli.cmd.typescript/${\"0.4.0-beta.2\"}`;\nasync function handleGenerate(args) {\n let success = false;\n if (args.ontologyPath) {\n success = await generateFromLocalFile(args);\n } else if (args.foundryUrl && args.clientId) {\n success = await generateFromStack(args);\n } else {\n throw new YargsCheckError(\"Must have specified ontologyPath or stack and clientId\");\n }\n if (success) {\n consola.info(\"OSDK Generated!\");\n } else {\n throw new ExitProcessError(1, \"Failed to generate the TypeScript SDK\");\n }\n}\nasync function generateFromLocalFile(args) {\n if (!fs.existsSync(args.ontologyPath)) {\n consola.error(`Ontology file does not exist: ${args.ontologyPath}`);\n return false;\n }\n const ontology = JSON.parse(await fs.promises.readFile(args.ontologyPath, \"utf-8\"));\n return await generateClientSdk(ontology, args);\n}\nasync function generateFromStack(args) {\n const {\n foundryUrl,\n clientId,\n ontologyWritePath\n } = args;\n const token = await invokeLoginFlow({\n clientId,\n foundryUrl,\n verbose: 0\n });\n const {\n fetch\n } = createClientContext({\n metadata: {\n userAgent: USER_AGENT\n }\n }, args.foundryUrl, () => token.access_token, USER_AGENT);\n try {\n const ontologies = await listOntologiesV2(createOpenApiRequest(foundryUrl, fetch));\n if (args.ontologyRid) {\n ontologies.data = ontologies.data.filter(o => o.rid === args.ontologyRid);\n }\n if (ontologies.data.length !== 1) {\n consola.error(`Could not look up ontology with these credentials. Found ${ontologies.data.length} ontologies.`);\n return false;\n }\n const ontology = await getOntologyFullMetadata(createOpenApiRequest(foundryUrl, fetch), ontologies.data[0].apiName);\n if (ontologyWritePath) {\n fs.writeFileSync(ontologyWritePath, JSON.stringify(ontology, null, 2));\n }\n return await generateClientSdk(ontology, args);\n } catch (e) {\n consola.error(\"Failed to generate the ontology\", e);\n return false;\n }\n}\nasync function generateClientSdk(ontology, args) {\n const minimalFs = createNormalFs();\n try {\n if (args.clean) {\n consola.info(\"Cleaning output directory\", args.outDir);\n await fs.promises.rm(args.outDir, {\n recursive: true,\n force: true\n });\n }\n if (!args.asPackage) {\n await generateSourceFiles(args, ontology, minimalFs);\n const packageJsonPath = await findUp(\"package.json\", {\n cwd: args.outDir\n });\n if (!packageJsonPath) {\n return true;\n }\n const packageJsonOriginal = JSON.parse(await fs.promises.readFile(packageJsonPath, \"utf-8\"));\n const packageJson = JSON.parse(await fs.promises.readFile(packageJsonPath, \"utf-8\"));\n const dependencyVersions = await getDependencyVersions();\n if (args.internal) {\n dependencyVersions.osdkApiVersion = \"workspace:~\";\n dependencyVersions.osdkClientApiVersion = \"workspace:~\";\n dependencyVersions.osdkClientVersion = \"workspace:~\";\n dependencyVersions.osdkLegacyClientVersion = \"workspace:~\";\n }\n const expectedDeps = getExpectedDependencies(args.beta ? \"2.0\" : \"1.1\", dependencyVersions);\n for (const [type, deps] of Object.entries(expectedDeps)) {\n if (!(type in packageJson)) {\n packageJson[type] = deps;\n } else {\n Object.assign(packageJson[type], deps);\n }\n }\n if (!deepEqual(packageJsonOriginal, packageJson)) {\n await fs.promises.writeFile(packageJsonPath, JSON.stringify(packageJson, void 0, 2) + \"\\n\");\n }\n return true;\n }\n await __UNSTABLE_generateClientSdkPackage(args.packageName, args.version, args.beta ? \"2.0\" : \"1.1\", args.outDir, ontology, minimalFs, await getDependencyVersions(), \"0.22.0-beta.2\");\n return true;\n } catch (e) {\n consola.error(\"OSDK generation failed\", e.message, e.stack);\n return false;\n }\n}\nasync function getDependencyVersions() {\n const ourPackageJsonPath = await getOurPackageJsonPath();\n const ourPackageJson = JSON.parse(await fs.promises.readFile(ourPackageJsonPath, \"utf-8\"));\n const typescriptVersion = ourPackageJson.devDependencies.typescript;\n const tslibVersion = ourPackageJson.dependencies.tslib;\n const areTheTypesWrongVersion = ourPackageJson.dependencies[\"@arethetypeswrong/cli\"];\n const osdkClientVersion = `^${\"0.20.0-beta.4\"}`;\n const osdkClientApiVersion = `^${\"0.20.0-beta.4\"}`;\n const osdkApiVersion = `^${\"1.9.0-beta.1\"}`;\n const osdkLegacyClientVersion = `^${\"2.4.0-beta.2\"}`;\n return {\n typescriptVersion,\n tslibVersion,\n areTheTypesWrongVersion,\n osdkApiVersion,\n osdkClientVersion,\n osdkClientApiVersion,\n osdkLegacyClientVersion\n };\n}\nvar cachedOurPackageJsonPath;\nasync function getOurPackageJsonPath() {\n if (cachedOurPackageJsonPath) return cachedOurPackageJsonPath;\n const __dir = path.dirname(fileURLToPath(import.meta.url));\n const ourPackageJsonPath = await findUp(\"package.json\", {\n cwd: __dir\n });\n if (!ourPackageJsonPath) {\n throw new Error(\"Could not find our package.json\");\n }\n return cachedOurPackageJsonPath = ourPackageJsonPath;\n}\nasync function generateSourceFiles(args, ontology, fs2) {\n await (args.beta ? generateClientSdkVersionTwoPointZero : generateClientSdkVersionOneDotOne)(ontology, getUserAgent(args.version), fs2, args.outDir, args.packageType);\n}\nfunction getUserAgent(version) {\n if (version === \"dev\") {\n return \"typescript-sdk/dev osdk-cli/dev\";\n } else {\n return `typescript-sdk/${version} ${USER_AGENT}`;\n }\n}\nfunction createNormalFs() {\n return {\n writeFile: (path2, contents) => {\n return fs.promises.writeFile(path2, contents, \"utf-8\");\n },\n mkdir: async (path2, options) => {\n await fs.promises.mkdir(path2, options);\n },\n readdir: async path2 => fs.promises.readdir(path2)\n };\n}\nexport { getDependencyVersions, handleGenerate };"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/site/deploy/siteDeployCommand.mts","../../src/util/autoVersion.ts"],"names":[],"mappings":";;;;;;;;;;;;AAgBA,SAAS,eAAe;AAGxB,OAAO,cAAc;AACrB,SAAS,gBAAgB;AACzB,YAAY,QAAQ;AACpB,OAAO,UAAU;AACjB,SAAS,gBAAgB;;;ACNzB,SAAS,YAAY;AACrB,SAAS,iBAAiB;AAS1B,eAAsB,YAAY,YAAY,IAAI;AAChD,QAAM,CAAC,aAAa,WAAW,IAAI,cAAc,KAAK,CAAC,WAAW,IAAI,OAAO,IAAI,SAAS,EAAE,CAAC,IAAI,CAAC,QAAW,IAAI,OAAO,KAAK,CAAC;AAC9H,QAAM,aAAa,MAAM,YAAY,WAAW;AAChD,QAAM,UAAU,WAAW,KAAK,EAAE,QAAQ,aAAa,EAAE;AACzD,MAAI,CAAC,cAAc,OAAO,GAAG;AAC3B,UAAM,IAAI,iBAAiB,GAAG,sBAAsB,OAAO,2BAA2B;AAAA,EACxF;AACA,SAAO;AACT;AACA,eAAe,YAAY,aAAa;AACtC,MAAI;AACJ,MAAI;AACF,UAAM,YAAY,UAAU,IAAI;AAChC,UAAM;AAAA,MACJ;AAAA,IACF,IAAI,MAAM,UAAU,6CAA6C,eAAe,OAAO,aAAa,WAAW,OAAO,EAAE,IAAI;AAAA,MAC1H,UAAU;AAAA,IACZ,CAAC;AACD,iBAAa;AAAA,EACf,SA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ACF,CAAC;AACH","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 { createInternalClientContext, thirdPartyApplications } from \"#net\";\nimport { ExitProcessError } from \"@osdk/cli.common\";\nimport archiver from \"archiver\";\nimport { colorize } from \"consola/utils\";\nimport * as fs from \"node:fs\";\nimport path from \"node:path\";\nimport { Readable } from \"node:stream\";\nimport { autoVersion as findAutoVersion } from \"../../../util/autoVersion.js\";\nimport { loadToken } from \"../../../util/token.js\";\nexport default async function siteDeployCommand({\n selectedVersion,\n application,\n foundryUrl,\n uploadOnly,\n directory,\n token,\n tokenFile\n}) {\n const loadedToken = await loadToken(token, tokenFile);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n let siteVersion;\n if (typeof selectedVersion === \"string\") {\n siteVersion = selectedVersion;\n } else {\n siteVersion = await findAutoVersion(selectedVersion.tagPrefix);\n consola.info(`Auto version inferred next version to be: ${siteVersion}`);\n }\n consola.debug(`Using directory for site files: \"${path.resolve(directory)}`);\n const stat = await fs.promises.stat(directory);\n if (!stat.isDirectory()) {\n throw new ExitProcessError(2, \"Specified path exists but is not a directory\");\n }\n consola.start(\"Zipping site files\");\n const archive = archiver(\"zip\").directory(directory, false);\n logArchiveStats(archive);\n consola.start(\"Uploading site files\");\n await Promise.all([thirdPartyApplications.uploadVersion(clientCtx, application, siteVersion, Readable.toWeb(archive) // This cast is because the dom fetch doesn't align type wise with streams\n ), archive.finalize()]);\n consola.success(\"Upload complete\");\n if (!uploadOnly) {\n const website = await thirdPartyApplications.deployWebsite(clientCtx, application, {\n version: siteVersion\n });\n consola.success(`Deployed ${siteVersion} successfully`);\n const domain = website.subdomains[0];\n if (domain != null) {\n logSiteLink(\"View live site:\", `https://${domain}`);\n }\n } else {\n const website = await thirdPartyApplications.getWebsite(clientCtx, application);\n const domain = website?.subdomains[0];\n consola.debug(\"Upload only mode enabled, skipping deployment\");\n if (domain != null) {\n logSiteLink(\"Preview link:\", `https://${domain}/.system/preview?previewVersion=${siteVersion}`);\n }\n }\n}\nfunction logArchiveStats(archive) {\n let archiveStats = {\n fileCount: 0,\n bytes: 0\n };\n archive.on(\"progress\", progress => {\n archiveStats = {\n fileCount: progress.entries.total,\n bytes: progress.fs.totalBytes\n };\n });\n archive.on(\"finish\", () => {\n consola.debug(`Zipped ${archiveStats.fileCount} files and ${archiveStats.bytes} bytes`);\n });\n}\nfunction logSiteLink(title, link) {\n consola.box({\n message: `${title}\\n\\n${colorize(\"green\", link)}`,\n style: {\n padding: 2,\n borderColor: \"green\",\n borderStyle: \"rounded\"\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 { ExitProcessError, isValidSemver } from \"@osdk/cli.common\";\nimport { exec } from \"node:child_process\";\nimport { promisify } from \"node:util\";\n\n/**\n * Gets the version string using git describe. If the @param tagPrefix is empty, git describe will return the\n * latest tag (without any filtering) and if the tag starts with \"v\", it will be removed.\n * @param tagPrefix The prefix to use for matching against tags. Defaults to an empty string.\n * @returns A promise that resolves to the version string.\n * @throws An error if the version string is not SemVer compliant or if the version cannot be determined.\n */\nexport async function autoVersion(tagPrefix = \"\") {\n const [matchPrefix, prefixRegex] = tagPrefix !== \"\" ? [tagPrefix, new RegExp(`^${tagPrefix}`)] : [undefined, new RegExp(`^v?`)];\n const gitVersion = await gitDescribe(matchPrefix);\n const version = gitVersion.trim().replace(prefixRegex, \"\");\n if (!isValidSemver(version)) {\n throw new ExitProcessError(2, `The version string ${version} is not SemVer compliant.`);\n }\n return version;\n}\nasync function gitDescribe(matchPrefix) {\n let gitVersion;\n try {\n const execAsync = promisify(exec);\n const {\n stdout\n } = await execAsync(`git describe --tags --first-parent --dirty${matchPrefix != null ? ` --match=\"${matchPrefix}*\"` : \"\"}`, {\n encoding: \"utf8\"\n });\n gitVersion = stdout;\n } catch (error) {\n if (error instanceof Error) {\n const errorMessage = error.message.toLowerCase();\n if (errorMessage.includes(\"not recognized\") || errorMessage.includes(\"command not found\") || errorMessage.includes(\"no such file or directory\")) {\n throw new ExitProcessError(2, \"Unable to determine auto version using git-describe as git is not installed or found in the PATH.\", `You can set up git and try again or supply a --version option to set the version manually`);\n }\n if (errorMessage.includes(\"fatal: not a git repository\")) {\n throw new ExitProcessError(2, `Unable to determine auto version using git-describe as the current directory is not a git repository.`, `You can run the command in a git repository and try again or supply a --version option to set the version manually`);\n }\n if (errorMessage.includes(\"fatal: no names found, cannot describe anything.\")) {\n throw new ExitProcessError(2, `Unable to determine auto version using git-describe as no matching tags were found.`, `You can create a tag matching the configured tag prefix and try again or supply a --version option to set the version manually`);\n }\n }\n throw new ExitProcessError(2, `Unable to determine auto version using git-describe: ${error}.`, `You can supply a --version option to set the version manually`);\n }\n return gitVersion;\n}"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/site/version/delete/versionDeleteCommand.mts"],"names":[],"mappings":";;;;;;;;;;;;AAiBA,SAAS,eAAe;AACxB,SAAS,gBAAgB;AAGzB,eAAO,qBAA4C;AAAA,EACjD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,MAAI,CAAC,KAAK;AACR,UAAM,YAAY,MAAM,QAAQ,OAAO,+CAA+C,OAAO;AAAA,EAAM,SAAS,QAAQ,+BAA+B,CAAC,IAAI;AAAA,MACtJ,MAAM;AAAA,IACR,CAAC;AACD,uBAAmB,SAAS;AAAA,EAC9B;AACA,UAAQ,MAAM,oBAAoB,OAAO,EAAE;AAC3C,QAAM,cAAc,MAAM,UAAU,OAAO,SAAS;AACpD,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,QAAM,iCAAuB,cAAc,WAAW,aAAa,OAAO;AAC1E,UAAQ,QAAQ,mBAAmB,OAAO,EAAE;AAC9C","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createInternalClientContext, thirdPartyApplications } from \"#net\";\nimport { consola } from \"consola\";\nimport { colorize } from \"consola/utils\";\nimport { handlePromptCancel } from \"../../../../consola/handlePromptCancel.js\";\nimport { loadToken } from \"../../../../util/token.js\";\nexport default async function versionDeleteCommand({\n version,\n yes,\n application,\n foundryUrl,\n token,\n tokenFile\n}) {\n if (!yes) {\n const confirmed = await consola.prompt(`Are you sure you want to delete the version ${version}?\\n${colorize(\"bold\", \"This action cannot be undone.\")}`, {\n type: \"confirm\"\n });\n handlePromptCancel(confirmed);\n }\n consola.start(`Deleting version ${version}`);\n const loadedToken = await loadToken(token, tokenFile);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n await thirdPartyApplications.deleteVersion(clientCtx, application, version);\n consola.success(`Deleted version ${version}`);\n}"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/site/version/get/versionGetCommand.mts"],"names":[],"mappings":";;;;;;;;;AAiBA,SAAS,eAAe;AAExB,eAAO,kBAAyC;AAAA,EAC9C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,QAAM,cAAc,MAAM,UAAU,OAAO,SAAS;AACpD,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,UAAQ,MAAM,sBAAsB;AACpC,QAAM,UAAU,MAAM,iCAAuB,WAAW,WAAW,WAAW;AAC9E,QAAM,kBAAkB,SAAS;AACjC,MAAI,CAAC,iBAAiB;AACpB,YAAQ,KAAK,0BAA0B;AAAA,EACzC,OAAO;AACL,YAAQ,QAAQ,wBAAwB,eAAe,EAAE;AAAA,EAC3D;AACF","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createInternalClientContext, thirdPartyApplications } from \"#net\";\nimport { consola } from \"consola\";\nimport { loadToken } from \"../../../../util/token.js\";\nexport default async function versionGetCommand({\n foundryUrl,\n application,\n token,\n tokenFile\n}) {\n const loadedToken = await loadToken(token, tokenFile);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n consola.start(\"Getting live version\");\n const website = await thirdPartyApplications.getWebsite(clientCtx, application);\n const deployedVersion = website?.deployedVersion;\n if (!deployedVersion) {\n consola.info(\"No live site version set\");\n } else {\n consola.success(`Live site version is ${deployedVersion}`);\n }\n}"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/site/version/list/versionListCommand.mts"],"names":[],"mappings":";;;;;;;;;AAiBA,SAAS,eAAe;AACxB,SAAS,gBAAgB;AAEzB,eAAO,mBAA0C;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,QAAM,cAAc,MAAM,UAAU,OAAO,SAAS;AACpD,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,UAAQ,MAAM,sCAAsC;AACpD,QAAM,CAAC,UAAU,OAAO,IAAI,MAAM,QAAQ,IAAI,CAAC,iCAAuB,aAAa,WAAW,WAAW,GAAG,iCAAuB,WAAW,WAAW,WAAW,CAAC,CAAC;AACtK,MAAI,SAAS,KAAK,WAAW,GAAG;AAC9B,YAAQ,KAAK,wBAAwB;AACrC;AAAA,EACF;AACA,UAAQ,QAAQ,iBAAiB;AACjC,QAAM,SAAS,MAAM,OAAO,QAAQ;AACpC,QAAM,iBAAiB,OAAO,MAAM,SAAS,KAAK,IAAI,OAAK,EAAE,OAAO,EAAE,OAAO,OAAK,OAAO,MAAM,CAAC,CAAC,CAAC;AAClG,aAAW,WAAW,gBAAgB;AACpC,YAAQ,IAAI,SAAS,OAAO,GAAG,SAAS,mBAAmB,YAAY,SAAS,kBAAkB,SAAS,SAAS,aAAa,IAAI,EAAE,EAAE;AAAA,EAC3I;AACF","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createInternalClientContext, thirdPartyApplications } from \"#net\";\nimport { consola } from \"consola\";\nimport { colorize } from \"consola/utils\";\nimport { loadToken } from \"../../../../util/token.js\";\nexport default async function versionListCommand({\n foundryUrl,\n application,\n token,\n tokenFile\n}) {\n const loadedToken = await loadToken(token, tokenFile);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n consola.start(\"Fetching versions & deployed version\");\n const [versions, website] = await Promise.all([thirdPartyApplications.listVersions(clientCtx, application), thirdPartyApplications.getWebsite(clientCtx, application)]);\n if (versions.data.length === 0) {\n consola.info(\"No site versions found\");\n return;\n }\n consola.success(\"Found versions:\");\n const semver = await import(\"semver\");\n const sortedVersions = semver.rsort(versions.data.map(v => v.version).filter(v => semver.valid(v)));\n for (const version of sortedVersions) {\n consola.log(` - ${version}${website?.deployedVersion && version === website?.deployedVersion ? colorize(\"green\", ` (deployed)`) : \"\"}`);\n }\n}"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/site/version/set/versionSetCommand.mts"],"names":[],"mappings":";;;;;;;;;AAgBA,SAAS,eAAe;AAGxB,eAAO,kBAAyC;AAAA,EAC9C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,UAAQ,MAAM,sBAAsB;AACpC,QAAM,cAAc,MAAM,UAAU,OAAO,SAAS;AACpD,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,MAAI,SAAS;AACX,UAAM,iCAAuB,cAAc,WAAW,aAAa;AAAA,MACjE;AAAA,IACF,CAAC;AAAA,EACH;AACA,UAAQ,QAAQ,uBAAuB,OAAO,EAAE;AAClD","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nimport { createInternalClientContext, thirdPartyApplications } from \"#net\";\nimport { loadToken } from \"../../../../util/token.js\";\nexport default async function versionSetCommand({\n version,\n application,\n foundryUrl,\n token,\n tokenFile\n}) {\n consola.start(`Setting live version`);\n const loadedToken = await loadToken(token, tokenFile);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n if (version) {\n await thirdPartyApplications.deployWebsite(clientCtx, application, {\n version\n });\n }\n consola.success(`Set live version to ${version}`);\n}"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/site/version/unset/versionUnsetCommand.mts"],"names":[],"mappings":";;;;;;;;;;;;AAgBA,SAAS,eAAe;AAExB,SAAS,gBAAgB;AAGzB,eAAO,oBAA2C;AAAA,EAChD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,MAAI,CAAC,KAAK;AACR,UAAM,YAAY,MAAM,QAAQ,OAAO;AAAA,EAA0D,SAAS,QAAQ,8EAA8E,CAAC,IAAI;AAAA,MACnM,MAAM;AAAA,IACR,CAAC;AACD,uBAAmB,SAAS;AAAA,EAC9B;AACA,QAAM,cAAc,MAAM,UAAU,OAAO,SAAS;AACpD,QAAM,gBAAgB,MAAM;AAC5B,QAAM,YAAY,4BAA4B,YAAY,aAAa;AACvE,UAAQ,MAAM,4BAA4B;AAC1C,QAAM,iCAAuB,gBAAgB,WAAW,WAAW;AACnE,UAAQ,QAAQ,2BAA2B;AAC7C","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nimport { createInternalClientContext, thirdPartyApplications } from \"#net\";\nimport { colorize } from \"consola/utils\";\nimport { handlePromptCancel } from \"../../../../consola/handlePromptCancel.js\";\nimport { loadToken } from \"../../../../util/token.js\";\nexport default async function versionUnsetCommand({\n yes,\n application,\n foundryUrl,\n token,\n tokenFile\n}) {\n if (!yes) {\n const confirmed = await consola.prompt(`Are you sure you want to clear the live site version?\\n${colorize(\"bold\", \"Your site will no longer be accessible until a new live site version is set.\")}`, {\n type: \"confirm\"\n });\n handlePromptCancel(confirmed);\n }\n const loadedToken = await loadToken(token, tokenFile);\n const tokenProvider = () => loadedToken;\n const clientCtx = createInternalClientContext(foundryUrl, tokenProvider);\n consola.start(\"Clearing live site version\");\n await thirdPartyApplications.undeployWebsite(clientCtx, application);\n consola.success(\"Cleared live site version\");\n}"]}
|