@osdk/cli 0.24.0-beta.4 → 0.24.0-beta.5
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 +16 -0
- package/build/browser/{chunk-Z2FVVJT6.js → chunk-UPMHHB5S.js} +3 -3
- package/build/browser/{chunk-Z2FVVJT6.js.map → chunk-UPMHHB5S.js.map} +1 -1
- package/build/{esm/handleGenerate-H7YYTBNV-EIOFZGQA.js → browser/handleGenerate-P5NBNPCC-HLPQGGOW.js} +50 -12
- package/build/browser/handleGenerate-P5NBNPCC-HLPQGGOW.js.map +1 -0
- package/build/browser/index.js +8 -8
- package/build/browser/index.js.map +1 -1
- package/build/browser/{siteDeployCommand-KORX6FXU.js → siteDeployCommand-XH2UMQ65.js} +3 -3
- package/build/browser/{siteDeployCommand-KORX6FXU.js.map → siteDeployCommand-XH2UMQ65.js.map} +1 -1
- package/build/browser/{versionDeleteCommand-JYMY6PWJ.js → versionDeleteCommand-4KFXAB6N.js} +3 -3
- package/build/browser/{versionDeleteCommand-JYMY6PWJ.js.map → versionDeleteCommand-4KFXAB6N.js.map} +1 -1
- package/build/{esm/versionGetCommand-TNXWRJAE.js → browser/versionGetCommand-EKQHOJCA.js} +3 -3
- package/build/browser/{versionGetCommand-TNXWRJAE.js.map → versionGetCommand-EKQHOJCA.js.map} +1 -1
- package/build/{esm/versionListCommand-TKFBRQHZ.js → browser/versionListCommand-3QCKM6DT.js} +3 -3
- package/build/browser/{versionListCommand-TKFBRQHZ.js.map → versionListCommand-3QCKM6DT.js.map} +1 -1
- package/build/{esm/versionSetCommand-BFDK4JWD.js → browser/versionSetCommand-KE5HBSWU.js} +3 -3
- package/build/browser/{versionSetCommand-BFDK4JWD.js.map → versionSetCommand-KE5HBSWU.js.map} +1 -1
- package/build/browser/{versionUnsetCommand-GN73TWZD.js → versionUnsetCommand-D7H47FMM.js} +3 -3
- package/build/browser/{versionUnsetCommand-GN73TWZD.js.map → versionUnsetCommand-D7H47FMM.js.map} +1 -1
- package/build/esm/{chunk-Z2FVVJT6.js → chunk-UPMHHB5S.js} +3 -3
- package/build/esm/{chunk-Z2FVVJT6.js.map → chunk-UPMHHB5S.js.map} +1 -1
- package/build/{browser/handleGenerate-H7YYTBNV-EIOFZGQA.js → esm/handleGenerate-P5NBNPCC-HLPQGGOW.js} +50 -12
- package/build/esm/handleGenerate-P5NBNPCC-HLPQGGOW.js.map +1 -0
- package/build/esm/index.js +8 -8
- package/build/esm/index.js.map +1 -1
- package/build/esm/{siteDeployCommand-KORX6FXU.js → siteDeployCommand-XH2UMQ65.js} +3 -3
- package/build/esm/{siteDeployCommand-KORX6FXU.js.map → siteDeployCommand-XH2UMQ65.js.map} +1 -1
- package/build/esm/{versionDeleteCommand-JYMY6PWJ.js → versionDeleteCommand-4KFXAB6N.js} +3 -3
- package/build/esm/{versionDeleteCommand-JYMY6PWJ.js.map → versionDeleteCommand-4KFXAB6N.js.map} +1 -1
- package/build/{browser/versionGetCommand-TNXWRJAE.js → esm/versionGetCommand-EKQHOJCA.js} +3 -3
- package/build/esm/{versionGetCommand-TNXWRJAE.js.map → versionGetCommand-EKQHOJCA.js.map} +1 -1
- package/build/{browser/versionListCommand-TKFBRQHZ.js → esm/versionListCommand-3QCKM6DT.js} +3 -3
- package/build/esm/{versionListCommand-TKFBRQHZ.js.map → versionListCommand-3QCKM6DT.js.map} +1 -1
- package/build/{browser/versionSetCommand-BFDK4JWD.js → esm/versionSetCommand-KE5HBSWU.js} +3 -3
- package/build/esm/{versionSetCommand-BFDK4JWD.js.map → versionSetCommand-KE5HBSWU.js.map} +1 -1
- package/build/esm/{versionUnsetCommand-GN73TWZD.js → versionUnsetCommand-D7H47FMM.js} +3 -3
- package/build/esm/{versionUnsetCommand-GN73TWZD.js.map → versionUnsetCommand-D7H47FMM.js.map} +1 -1
- package/package.json +8 -9
- package/build/browser/handleGenerate-H7YYTBNV-EIOFZGQA.js.map +0 -1
- package/build/esm/handleGenerate-H7YYTBNV-EIOFZGQA.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @osdk/cli
|
|
2
2
|
|
|
3
|
+
## 0.24.0-beta.5
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 0a374d6: Remove legacy client
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [0a374d6]
|
|
12
|
+
- Updated dependencies [96ea876]
|
|
13
|
+
- Updated dependencies [5d6d5ab]
|
|
14
|
+
- Updated dependencies [6f93c8b]
|
|
15
|
+
- @osdk/generator@2.0.0-beta.6
|
|
16
|
+
- @osdk/gateway@2.5.0-beta.0
|
|
17
|
+
- @osdk/shared.net@1.13.0-beta.0
|
|
18
|
+
|
|
3
19
|
## 0.24.0-beta.4
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -34,7 +34,7 @@ init_esm_shims();
|
|
|
34
34
|
|
|
35
35
|
// src/net/UserAgent.ts
|
|
36
36
|
init_esm_shims();
|
|
37
|
-
var USER_AGENT = `osdk-cli/${"0.24.0-beta.
|
|
37
|
+
var USER_AGENT = `osdk-cli/${"0.24.0-beta.5"}`;
|
|
38
38
|
|
|
39
39
|
// src/net/createFetch.mts
|
|
40
40
|
function createFetch(tokenProvider, fetchFn = fetch) {
|
|
@@ -217,5 +217,5 @@ function isJWT(token) {
|
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
export { createInternalClientContext, loadToken, third_party_applications_exports };
|
|
220
|
-
//# sourceMappingURL=chunk-
|
|
221
|
-
//# sourceMappingURL=chunk-
|
|
220
|
+
//# sourceMappingURL=chunk-UPMHHB5S.js.map
|
|
221
|
+
//# sourceMappingURL=chunk-UPMHHB5S.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/net/createInternalClientContext.mts","../../src/net/third-party-applications/index.mts","../../src/net/third-party-applications/deleteVersion.mts","../../src/net/createFetch.mts","../../src/net/UserAgent.ts","../../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/net/index.mts","../../src/util/token.ts"],"names":["fetch","PalantirApiError","consola","fsPromises"],"mappings":";;;;;;;;AAAA,cAAA,EAAA,CAAA;AAgBO,SAAS,2BAAA,CAA4B,YAAY,aAAe,EAAA;AACrE,EAAO,OAAA;AAAA,IACL,aAAA;AAAA,IACA,UAAA;AAAA,GACF,CAAA;AACF,CAAA;;;ACrBA,IAAA,gCAAA,GAAA,GAAA;AAAA,QAAA,CAAA,gCAAA,EAAA;AAAA,EAAA,aAAA,EAAA,MAAA,aAAA;AAAA,EAAA,aAAA,EAAA,MAAA,aAAA;AAAA,EAAA,UAAA,EAAA,MAAA,UAAA;AAAA,EAAA,YAAA,EAAA,MAAA,YAAA;AAAA,EAAA,eAAA,EAAA,MAAA,eAAA;AAAA,EAAA,aAAA,EAAA,MAAA,aAAA;AAAA,CAAA,CAAA,CAAA;AAAA,cAAA,EAAA,CAAA;;;ACAA,cAAA,EAAA,CAAA;;;ACAA,cAAA,EAAA,CAAA;;;ACAA,cAAA,EAAA,CAAA;AAgBO,IAAM,UAAA,GAAa,YAAY,eAA2B,CAAA,CAAA,CAAA;;;ADI1D,SAAS,WAAA,CAAY,aAAe,EAAA,OAAA,GAAU,KAAO,EAAA;AAC1D,EAAO,OAAA,wBAAA,CAAyB,0BAA0B,uBAAwB,CAAA,kBAAA,CAAmB,OAAO,CAAC,CAAC,CAAG,EAAA,OAAM,OAAW,KAAA;AAChI,IAAM,MAAA,KAAA,GAAQ,MAAM,aAAc,EAAA,CAAA;AAClC,IAAA,OAAA,CAAQ,GAAI,CAAA,eAAA,EAAiB,CAAU,OAAA,EAAA,KAAK,CAAE,CAAA,CAAA,CAAA;AAC9C,IAAQ,OAAA,CAAA,G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AG,EAAA,CAAA,eAAA,CAAA,EAAmB,+DAA+D,cAAe,CAAA,CAAC,CAAC,CAAuB,qBAAA,CAAA,CAAA,CAAA;AAC1J,CAAA;AAOA,eAAsB,cAAc,QAAU,EAAA;AAC5C,EAAI,IAAA,KAAA,CAAA;AACJ,EAAI,IAAA,YAAA,CAAA;AACJ,EAAI,IAAA;AACF,IAAe,YAAA,GAAA,IAAA,CAAK,QAAQ,QAAQ,CAAA,CAAA;AACpC,IAAA,KAAA,GAAQ,MAAMC,QAAA,CAAW,QAAS,CAAA,YAAA,EAAc,MAAM,CAAA,CAAA;AACtD,IAAA,KAAA,GAAQ,MAAM,IAAK,EAAA,CAAA;AAAA,WACZ,KAAO,EAAA;AACd,IAAA,MAAM,IAAI,gBAAiB,CAAA,CAAA,EAAG,8BAA8B,QAAQ,CAAA,GAAA,EAAM,KAAK,CAAE,CAAA,CAAA,CAAA;AAAA,GACnF;AACA,EAAO,OAAA;AAAA,IACL,QAAU,EAAA,YAAA;AAAA,IACV,KAAA;AAAA,GACF,CAAA;AACF,CAAA;AACO,SAAS,SAAS,KAAO,EAAA;AAC9B,EAAI,IAAA,CAAC,KAAM,CAAA,KAAK,CAAG,EAAA;AACjB,IAAM,MAAA,IAAI,gBAAiB,CAAA,CAAA,EAAG,CAAmC,iCAAA,CAAA,CAAA,CAAA;AAAA,GACnE;AACF,CAAA;AACA,SAAS,MAAM,KAAO,EAAA;AAEpB,EAAA,MAAM,UAAa,GAAA,kDAAA,CAAA;AACnB,EAAO,OAAA,UAAA,CAAW,KAAK,KAAK,CAAA,CAAA;AAC9B","file":"chunk-Z2FVVJT6.js","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 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 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 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\nexport { createInternalClientContext } from \"./createInternalClientContext.mjs\";\nexport * as thirdPartyApplications from \"./third-party-applications/index.mjs\";","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\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
|
+
{"version":3,"sources":["../../src/net/createInternalClientContext.mts","../../src/net/third-party-applications/index.mts","../../src/net/third-party-applications/deleteVersion.mts","../../src/net/createFetch.mts","../../src/net/UserAgent.ts","../../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/net/index.mts","../../src/util/token.ts"],"names":["fetch","PalantirApiError","consola","fsPromises"],"mappings":";;;;;;;;AAAA,cAAA,EAAA,CAAA;AAgBO,SAAS,2BAAA,CAA4B,YAAY,aAAe,EAAA;AACrE,EAAO,OAAA;AAAA,IACL,aAAA;AAAA,IACA,UAAA;AAAA,GACF,CAAA;AACF,CAAA;;;ACrBA,IAAA,gCAAA,GAAA,GAAA;AAAA,QAAA,CAAA,gCAAA,EAAA;AAAA,EAAA,aAAA,EAAA,MAAA,aAAA;AAAA,EAAA,aAAA,EAAA,MAAA,aAAA;AAAA,EAAA,UAAA,EAAA,MAAA,UAAA;AAAA,EAAA,YAAA,EAAA,MAAA,YAAA;AAAA,EAAA,eAAA,EAAA,MAAA,eAAA;AAAA,EAAA,aAAA,EAAA,MAAA,aAAA;AAAA,CAAA,CAAA,CAAA;AAAA,cAAA,EAAA,CAAA;;;ACAA,cAAA,EAAA,C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AM,MAAA,IAAI,gBAAiB,CAAA,CAAA,EAAG,CAAmC,iCAAA,CAAA,CAAA,CAAA;AAAA,GACnE;AACF,CAAA;AACA,SAAS,MAAM,KAAO,EAAA;AAEpB,EAAA,MAAM,UAAa,GAAA,kDAAA,CAAA;AACnB,EAAO,OAAA,UAAA,CAAW,KAAK,KAAK,CAAA,CAAA;AAC9B","file":"chunk-UPMHHB5S.js","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 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 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 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\nexport { createInternalClientContext } from \"./createInternalClientContext.mjs\";\nexport * as thirdPartyApplications from \"./third-party-applications/index.mjs\";","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\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}"]}
|
|
@@ -2,7 +2,7 @@ import { invokeLoginFlow } from './chunk-XJLUGCCS.js';
|
|
|
2
2
|
import { YargsCheckError, ExitProcessError } from './chunk-SBJIY4HI.js';
|
|
3
3
|
import { __commonJS, init_esm_shims, __toESM } from './chunk-DAYFZSC6.js';
|
|
4
4
|
import { listOntologiesV2, getOntologyFullMetadata } from '@osdk/gateway/requests';
|
|
5
|
-
import { getExpectedDependencies, __UNSTABLE_generateClientSdkPackage, generateClientSdkVersionTwoPointZero
|
|
5
|
+
import { getExpectedDependencies, __UNSTABLE_generateClientSdkPackage, generateClientSdkVersionTwoPointZero } from '@osdk/generator';
|
|
6
6
|
import { createClientContext, createOpenApiRequest } from '@osdk/shared.net';
|
|
7
7
|
import { consola } from 'consola';
|
|
8
8
|
import { findUp } from 'find-up';
|
|
@@ -43,10 +43,10 @@ var require_fast_deep_equal = __commonJS({
|
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
-
// ../cli.cmd.typescript/build/esm/handleGenerate-
|
|
46
|
+
// ../cli.cmd.typescript/build/esm/handleGenerate-P5NBNPCC.js
|
|
47
47
|
init_esm_shims();
|
|
48
48
|
var import_fast_deep_equal = __toESM(require_fast_deep_equal(), 1);
|
|
49
|
-
var USER_AGENT = `osdk-cli.cmd.typescript/${"0.6.0-beta.
|
|
49
|
+
var USER_AGENT = `osdk-cli.cmd.typescript/${"0.6.0-beta.5"}`;
|
|
50
50
|
async function handleGenerate(args) {
|
|
51
51
|
let success = false;
|
|
52
52
|
if (args.ontologyPath) {
|
|
@@ -89,6 +89,12 @@ async function generateFromStack(args) {
|
|
|
89
89
|
}
|
|
90
90
|
}, args.foundryUrl, () => token.access_token, USER_AGENT);
|
|
91
91
|
try {
|
|
92
|
+
let sortKeys2 = function(obj, mutateValue) {
|
|
93
|
+
const sorted = Object.entries(obj).sort(([a], [b]) => a.localeCompare(b));
|
|
94
|
+
const mutated = mutateValue ? sorted.map(([k, v]) => [k, mutateValue(v)]) : sorted;
|
|
95
|
+
return Object.fromEntries(mutated);
|
|
96
|
+
};
|
|
97
|
+
var sortKeys = sortKeys2;
|
|
92
98
|
const ontologies = await listOntologiesV2(createOpenApiRequest(foundryUrl, fetch));
|
|
93
99
|
if (args.ontologyRid) {
|
|
94
100
|
ontologies.data = ontologies.data.filter((o) => o.rid === args.ontologyRid);
|
|
@@ -98,6 +104,38 @@ async function generateFromStack(args) {
|
|
|
98
104
|
return false;
|
|
99
105
|
}
|
|
100
106
|
const ontology = await getOntologyFullMetadata(createOpenApiRequest(foundryUrl, fetch), ontologies.data[0].apiName);
|
|
107
|
+
ontology.actionTypes = sortKeys2(ontology.actionTypes, (x) => {
|
|
108
|
+
return {
|
|
109
|
+
...x,
|
|
110
|
+
parameters: sortKeys2(x.parameters)
|
|
111
|
+
};
|
|
112
|
+
});
|
|
113
|
+
ontology.objectTypes = sortKeys2(ontology.objectTypes, (x) => {
|
|
114
|
+
return {
|
|
115
|
+
...x,
|
|
116
|
+
linkTypes: [...x.linkTypes].sort((a, b) => a.apiName.localeCompare(b.apiName)),
|
|
117
|
+
implementsInterfaces2: sortKeys2(x.implementsInterfaces2),
|
|
118
|
+
sharedPropertyTypeMapping: sortKeys2(x.sharedPropertyTypeMapping),
|
|
119
|
+
objectType: {
|
|
120
|
+
...x.objectType,
|
|
121
|
+
properties: sortKeys2(x.objectType.properties)
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
});
|
|
125
|
+
ontology.interfaceTypes = sortKeys2(ontology.interfaceTypes, (x) => {
|
|
126
|
+
return {
|
|
127
|
+
...x,
|
|
128
|
+
extendsInterfaces: [...x.extendsInterfaces].sort(),
|
|
129
|
+
properties: sortKeys2(x.properties)
|
|
130
|
+
};
|
|
131
|
+
});
|
|
132
|
+
ontology.queryTypes = sortKeys2(ontology.queryTypes, (x) => {
|
|
133
|
+
return {
|
|
134
|
+
...x,
|
|
135
|
+
parameters: sortKeys2(x.parameters)
|
|
136
|
+
};
|
|
137
|
+
});
|
|
138
|
+
ontology.sharedPropertyTypes = sortKeys2(ontology.sharedPropertyTypes);
|
|
101
139
|
if (ontologyWritePath) {
|
|
102
140
|
fs.writeFileSync(ontologyWritePath, JSON.stringify(ontology, null, 2));
|
|
103
141
|
}
|
|
@@ -134,7 +172,7 @@ async function generateClientSdk(ontology, args) {
|
|
|
134
172
|
dependencyVersions.osdkClientVersion = "workspace:~";
|
|
135
173
|
dependencyVersions.osdkLegacyClientVersion = "workspace:~";
|
|
136
174
|
}
|
|
137
|
-
const expectedDeps = getExpectedDependencies(
|
|
175
|
+
const expectedDeps = getExpectedDependencies(dependencyVersions);
|
|
138
176
|
for (const [type, deps] of Object.entries(expectedDeps)) {
|
|
139
177
|
if (!(type in packageJson)) {
|
|
140
178
|
packageJson[type] = deps;
|
|
@@ -147,7 +185,7 @@ async function generateClientSdk(ontology, args) {
|
|
|
147
185
|
}
|
|
148
186
|
return true;
|
|
149
187
|
}
|
|
150
|
-
await __UNSTABLE_generateClientSdkPackage(args.packageName, args.version, args.beta ? "2.0" : "1.1", args.outDir, ontology, minimalFs, await getDependencyVersions(), "0.24.0-beta.
|
|
188
|
+
await __UNSTABLE_generateClientSdkPackage(args.packageName, args.version, args.beta ? "2.0" : "1.1", args.outDir, ontology, minimalFs, await getDependencyVersions(), "0.24.0-beta.5", args.ontologyApiNamespace, args.apiNamespaceMap);
|
|
151
189
|
return true;
|
|
152
190
|
} catch (e) {
|
|
153
191
|
consola.error("OSDK generation failed", e.message, e.stack);
|
|
@@ -160,10 +198,10 @@ async function getDependencyVersions() {
|
|
|
160
198
|
const typescriptVersion = ourPackageJson.devDependencies.typescript;
|
|
161
199
|
const tslibVersion = ourPackageJson.dependencies.tslib;
|
|
162
200
|
const areTheTypesWrongVersion = ourPackageJson.dependencies["@arethetypeswrong/cli"];
|
|
163
|
-
const osdkClientVersion = `^${"0.
|
|
164
|
-
const osdkClientApiVersion = `^${"0.
|
|
165
|
-
const osdkApiVersion = `^${"
|
|
166
|
-
const osdkLegacyClientVersion = `^${
|
|
201
|
+
const osdkClientVersion = `^${"2.0.0-beta.6"}`;
|
|
202
|
+
const osdkClientApiVersion = `^${"2.0.0-beta.6"}`;
|
|
203
|
+
const osdkApiVersion = `^${"2.0.0-beta.6"}`;
|
|
204
|
+
const osdkLegacyClientVersion = `^${process.env.PACKAGE_LEGACY_CLIENT_VERSION}`;
|
|
167
205
|
return {
|
|
168
206
|
typescriptVersion,
|
|
169
207
|
tslibVersion,
|
|
@@ -187,7 +225,7 @@ async function getOurPackageJsonPath() {
|
|
|
187
225
|
return cachedOurPackageJsonPath = ourPackageJsonPath;
|
|
188
226
|
}
|
|
189
227
|
async function generateSourceFiles(args, ontology, fs2) {
|
|
190
|
-
await
|
|
228
|
+
await generateClientSdkVersionTwoPointZero(ontology, getUserAgent(args.version), fs2, args.outDir, args.packageType, args.ontologyApiNamespace, args.apiNamespaceMap);
|
|
191
229
|
}
|
|
192
230
|
function getUserAgent(version) {
|
|
193
231
|
if (version === "dev") {
|
|
@@ -209,5 +247,5 @@ function createNormalFs() {
|
|
|
209
247
|
}
|
|
210
248
|
|
|
211
249
|
export { getDependencyVersions, handleGenerate };
|
|
212
|
-
//# sourceMappingURL=handleGenerate-
|
|
213
|
-
//# sourceMappingURL=handleGenerate-
|
|
250
|
+
//# sourceMappingURL=handleGenerate-P5NBNPCC-HLPQGGOW.js.map
|
|
251
|
+
//# sourceMappingURL=handleGenerate-P5NBNPCC-HLPQGGOW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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-P5NBNPCC.js"],"names":["deepEqual"],"mappings":";;;;;;;;;;;;;AAAA,IAAA,uBAAA,GAAA,UAAA,CAAA;AAAA,EAAA,sFAAA,CAAA,OAAA,EAAA,MAAA,EAAA;AAAA,IAAA,cAAA,EAAA,CAAA;AAGA,IAAA,MAAA,CAAO,OAAU,GAAA,SAAS,KAAM,CAAA,CAAA,EAAG,CAAG,EAAA;AACpC,MAAI,IAAA,CAAA,KAAM,GAAU,OAAA,IAAA,CAAA;AACpB,MAAA,IAAI,KAAK,CAAK,IAAA,OAAO,KAAK,QAAY,IAAA,OAAO,KAAK,QAAU,EAAA;AAC1D,QAAA,IAAI,CAAE,CAAA,WAAA,KAAgB,CAAE,CAAA,WAAA,EAAoB,OAAA,KAAA,CAAA;AAC5C,QAAA,IAAI,QAAQ,CAAG,EAAA,IAAA,CAAA;AACf,QAAI,IAAA,KAAA,CAAM,OAAQ,C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AAM,iCAAiC,CAAA,CAAA;AAAA,GACnD;AACA,EAAA,OAAO,wBAA2B,GAAA,kBAAA,CAAA;AACpC,CAAA;AACA,eAAe,mBAAA,CAAoB,IAAM,EAAA,QAAA,EAAU,GAAK,EAAA;AACtD,EAAA,MAAM,oCAAqC,CAAA,QAAA,EAAU,YAAa,CAAA,IAAA,CAAK,OAAO,CAAG,EAAA,GAAA,EAAK,IAAK,CAAA,MAAA,EAAQ,IAAK,CAAA,WAAA,EAAa,IAAK,CAAA,oBAAA,EAAsB,KAAK,eAAe,CAAA,CAAA;AACtK,CAAA;AACA,SAAS,aAAa,OAAS,EAAA;AAC7B,EAAA,IAAI,YAAY,KAAO,EAAA;AACrB,IAAO,OAAA,iCAAA,CAAA;AAAA,GACF,MAAA;AACL,IAAO,OAAA,CAAA,eAAA,EAAkB,OAAO,CAAA,CAAA,EAAI,UAAU,CAAA,CAAA,CAAA;AAAA,GAChD;AACF,CAAA;AACA,SAAS,cAAiB,GAAA;AACxB,EAAO,OAAA;AAAA,IACL,SAAA,EAAW,CAAC,KAAA,EAAO,QAAa,KAAA;AAC9B,MAAA,OAAU,EAAS,CAAA,QAAA,CAAA,SAAA,CAAU,KAAO,EAAA,QAAA,EAAU,OAAO,CAAA,CAAA;AAAA,KACvD;AAAA,IACA,KAAA,EAAO,OAAO,KAAA,EAAO,OAAY,KAAA;AAC/B,MAAS,MAAA,EAAA,CAAA,QAAA,CAAS,KAAM,CAAA,KAAA,EAAO,OAAO,CAAA,CAAA;AAAA,KACxC;AAAA,IACA,OAAS,EAAA,OAAM,KAAY,KAAA,EAAA,CAAA,QAAA,CAAS,QAAQ,KAAK,CAAA;AAAA,GACnD,CAAA;AACF","file":"handleGenerate-P5NBNPCC-HLPQGGOW.js","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 } 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.6.0-beta.5\"}`;\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 let sortKeys2 = function (obj, mutateValue) {\n const sorted = Object.entries(obj).sort(([a], [b]) => a.localeCompare(b));\n const mutated = mutateValue ? sorted.map(([k, v]) => [k, mutateValue(v)]) : sorted;\n return Object.fromEntries(mutated);\n };\n var sortKeys = sortKeys2;\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 ontology.actionTypes = sortKeys2(ontology.actionTypes, x => {\n return {\n ...x,\n parameters: sortKeys2(x.parameters)\n };\n });\n ontology.objectTypes = sortKeys2(ontology.objectTypes, x => {\n return {\n ...x,\n linkTypes: [...x.linkTypes].sort((a, b) => a.apiName.localeCompare(b.apiName)),\n implementsInterfaces2: sortKeys2(x.implementsInterfaces2),\n sharedPropertyTypeMapping: sortKeys2(x.sharedPropertyTypeMapping),\n objectType: {\n ...x.objectType,\n properties: sortKeys2(x.objectType.properties)\n }\n };\n });\n ontology.interfaceTypes = sortKeys2(ontology.interfaceTypes, x => {\n return {\n ...x,\n extendsInterfaces: [...x.extendsInterfaces].sort(),\n properties: sortKeys2(x.properties)\n };\n });\n ontology.queryTypes = sortKeys2(ontology.queryTypes, x => {\n return {\n ...x,\n parameters: sortKeys2(x.parameters)\n };\n });\n ontology.sharedPropertyTypes = sortKeys2(ontology.sharedPropertyTypes);\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(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.24.0-beta.5\", args.ontologyApiNamespace, args.apiNamespaceMap);\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 = `^${\"2.0.0-beta.6\"}`;\n const osdkClientApiVersion = `^${\"2.0.0-beta.6\"}`;\n const osdkApiVersion = `^${\"2.0.0-beta.6\"}`;\n const osdkLegacyClientVersion = `^${process.env.PACKAGE_LEGACY_CLIENT_VERSION}`;\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 generateClientSdkVersionTwoPointZero(ontology, getUserAgent(args.version), fs2, args.outDir, args.packageType, args.ontologyApiNamespace, args.apiNamespaceMap);\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 };"]}
|
package/build/browser/index.js
CHANGED
|
@@ -119,7 +119,7 @@ var generateCommand = {
|
|
|
119
119
|
});
|
|
120
120
|
},
|
|
121
121
|
handler: async (args) => {
|
|
122
|
-
const command10 = await import('./handleGenerate-
|
|
122
|
+
const command10 = await import('./handleGenerate-P5NBNPCC-HLPQGGOW.js');
|
|
123
123
|
await command10.handleGenerate(args);
|
|
124
124
|
}
|
|
125
125
|
};
|
|
@@ -360,7 +360,7 @@ var command2 = {
|
|
|
360
360
|
}).middleware((args) => logDeployCommandConfigFileOverride(args, siteConfig));
|
|
361
361
|
},
|
|
362
362
|
handler: async (args) => {
|
|
363
|
-
const command10 = await import('./siteDeployCommand-
|
|
363
|
+
const command10 = await import('./siteDeployCommand-XH2UMQ65.js');
|
|
364
364
|
const {
|
|
365
365
|
version,
|
|
366
366
|
autoVersion,
|
|
@@ -410,7 +410,7 @@ var command3 = {
|
|
|
410
410
|
}).group(["yes"], "Delete Options");
|
|
411
411
|
},
|
|
412
412
|
handler: async (args) => {
|
|
413
|
-
const command10 = await import('./versionDeleteCommand-
|
|
413
|
+
const command10 = await import('./versionDeleteCommand-4KFXAB6N.js');
|
|
414
414
|
await command10.default(args);
|
|
415
415
|
}
|
|
416
416
|
};
|
|
@@ -425,7 +425,7 @@ var command4 = {
|
|
|
425
425
|
return argv;
|
|
426
426
|
},
|
|
427
427
|
handler: async (args) => {
|
|
428
|
-
const command10 = await import('./versionGetCommand-
|
|
428
|
+
const command10 = await import('./versionGetCommand-EKQHOJCA.js');
|
|
429
429
|
await command10.default(args);
|
|
430
430
|
}
|
|
431
431
|
};
|
|
@@ -440,7 +440,7 @@ var command5 = {
|
|
|
440
440
|
return argv;
|
|
441
441
|
},
|
|
442
442
|
handler: async (args) => {
|
|
443
|
-
const command10 = await import('./versionListCommand-
|
|
443
|
+
const command10 = await import('./versionListCommand-3QCKM6DT.js');
|
|
444
444
|
await command10.default(args);
|
|
445
445
|
}
|
|
446
446
|
};
|
|
@@ -459,7 +459,7 @@ var command6 = {
|
|
|
459
459
|
});
|
|
460
460
|
},
|
|
461
461
|
handler: async (args) => {
|
|
462
|
-
const command10 = await import('./versionSetCommand-
|
|
462
|
+
const command10 = await import('./versionSetCommand-KE5HBSWU.js');
|
|
463
463
|
await command10.default(args);
|
|
464
464
|
}
|
|
465
465
|
};
|
|
@@ -478,7 +478,7 @@ var command7 = {
|
|
|
478
478
|
}).group(["yes"], "Unset Options");
|
|
479
479
|
},
|
|
480
480
|
handler: async (args) => {
|
|
481
|
-
const command10 = await import('./versionUnsetCommand-
|
|
481
|
+
const command10 = await import('./versionUnsetCommand-D7H47FMM.js');
|
|
482
482
|
await command10.default(args);
|
|
483
483
|
}
|
|
484
484
|
};
|
|
@@ -563,7 +563,7 @@ async function logConfigFileMiddleware() {
|
|
|
563
563
|
|
|
564
564
|
// src/cli.ts
|
|
565
565
|
async function cli(args = process.argv) {
|
|
566
|
-
consola.info(`Palantir OSDK CLI ${"0.24.0-beta.
|
|
566
|
+
consola.info(`Palantir OSDK CLI ${"0.24.0-beta.5"}
|
|
567
567
|
`);
|
|
568
568
|
const base = getYargsBase(args);
|
|
569
569
|
try {
|