@osdk/cli 0.25.0-beta.5 → 0.25.0-beta.7

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.
Files changed (40) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/build/browser/{chunk-GO6BWFSB.js → chunk-IHYAXZ5B.js} +3 -3
  3. package/build/{esm/chunk-GO6BWFSB.js.map → browser/chunk-IHYAXZ5B.js.map} +1 -1
  4. package/build/{esm/handleGenerate-IS5DFQEZ.js → browser/handleGenerate-7AXASAED.js} +28 -21
  5. package/build/browser/handleGenerate-7AXASAED.js.map +1 -0
  6. package/build/browser/index.js +8 -8
  7. package/build/browser/index.js.map +1 -1
  8. package/build/browser/{siteDeployCommand-BDL5RTL4.js → siteDeployCommand-TUUAVXVA.js} +3 -3
  9. package/build/browser/{siteDeployCommand-BDL5RTL4.js.map → siteDeployCommand-TUUAVXVA.js.map} +1 -1
  10. package/build/browser/{versionDeleteCommand-W4G4K2UM.js → versionDeleteCommand-OATGWIKR.js} +3 -3
  11. package/build/browser/{versionDeleteCommand-W4G4K2UM.js.map → versionDeleteCommand-OATGWIKR.js.map} +1 -1
  12. package/build/{esm/versionGetCommand-P6AB5D7J.js → browser/versionGetCommand-F2KL4MEI.js} +3 -3
  13. package/build/browser/{versionGetCommand-P6AB5D7J.js.map → versionGetCommand-F2KL4MEI.js.map} +1 -1
  14. package/build/{esm/versionListCommand-5VLKOKRF.js → browser/versionListCommand-5CR63CBN.js} +3 -3
  15. package/build/browser/{versionListCommand-5VLKOKRF.js.map → versionListCommand-5CR63CBN.js.map} +1 -1
  16. package/build/{esm/versionSetCommand-HPVUXTYV.js → browser/versionSetCommand-J2DWHL65.js} +3 -3
  17. package/build/browser/{versionSetCommand-HPVUXTYV.js.map → versionSetCommand-J2DWHL65.js.map} +1 -1
  18. package/build/browser/{versionUnsetCommand-MTD3D22O.js → versionUnsetCommand-GIN5AOKS.js} +3 -3
  19. package/build/browser/{versionUnsetCommand-MTD3D22O.js.map → versionUnsetCommand-GIN5AOKS.js.map} +1 -1
  20. package/build/esm/{chunk-GO6BWFSB.js → chunk-IHYAXZ5B.js} +3 -3
  21. package/build/{browser/chunk-GO6BWFSB.js.map → esm/chunk-IHYAXZ5B.js.map} +1 -1
  22. package/build/{browser/handleGenerate-IS5DFQEZ.js → esm/handleGenerate-7AXASAED.js} +28 -21
  23. package/build/esm/handleGenerate-7AXASAED.js.map +1 -0
  24. package/build/esm/index.js +8 -8
  25. package/build/esm/index.js.map +1 -1
  26. package/build/esm/{siteDeployCommand-BDL5RTL4.js → siteDeployCommand-TUUAVXVA.js} +3 -3
  27. package/build/esm/{siteDeployCommand-BDL5RTL4.js.map → siteDeployCommand-TUUAVXVA.js.map} +1 -1
  28. package/build/esm/{versionDeleteCommand-W4G4K2UM.js → versionDeleteCommand-OATGWIKR.js} +3 -3
  29. package/build/esm/{versionDeleteCommand-W4G4K2UM.js.map → versionDeleteCommand-OATGWIKR.js.map} +1 -1
  30. package/build/{browser/versionGetCommand-P6AB5D7J.js → esm/versionGetCommand-F2KL4MEI.js} +3 -3
  31. package/build/esm/{versionGetCommand-P6AB5D7J.js.map → versionGetCommand-F2KL4MEI.js.map} +1 -1
  32. package/build/{browser/versionListCommand-5VLKOKRF.js → esm/versionListCommand-5CR63CBN.js} +3 -3
  33. package/build/esm/{versionListCommand-5VLKOKRF.js.map → versionListCommand-5CR63CBN.js.map} +1 -1
  34. package/build/{browser/versionSetCommand-HPVUXTYV.js → esm/versionSetCommand-J2DWHL65.js} +3 -3
  35. package/build/esm/{versionSetCommand-HPVUXTYV.js.map → versionSetCommand-J2DWHL65.js.map} +1 -1
  36. package/build/esm/{versionUnsetCommand-MTD3D22O.js → versionUnsetCommand-GIN5AOKS.js} +3 -3
  37. package/build/esm/{versionUnsetCommand-MTD3D22O.js.map → versionUnsetCommand-GIN5AOKS.js.map} +1 -1
  38. package/package.json +10 -8
  39. package/build/browser/handleGenerate-IS5DFQEZ.js.map +0 -1
  40. package/build/esm/handleGenerate-IS5DFQEZ.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @osdk/cli
2
2
 
3
+ ## 0.25.0-beta.7
4
+
5
+ ## 0.25.0-beta.6
6
+
7
+ ### Minor Changes
8
+
9
+ - 25fd9f0: Updating package.json to have better entry points to support react native bundlers.
10
+
3
11
  ## 0.25.0-beta.5
4
12
 
5
13
  ### Minor 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.25.0-beta.5"}`;
37
+ var USER_AGENT = `osdk-cli/${"0.25.0-beta.7"}`;
38
38
 
39
39
  // src/net/createFetch.mts
40
40
  function createFetch(tokenProvider, fetchFn = fetch) {
@@ -234,5 +234,5 @@ function isJWT(token) {
234
234
  }
235
235
 
236
236
  export { createInternalClientContext, loadToken, third_party_applications_exports };
237
- //# sourceMappingURL=chunk-GO6BWFSB.js.map
238
- //# sourceMappingURL=chunk-GO6BWFSB.js.map
237
+ //# sourceMappingURL=chunk-IHYAXZ5B.js.map
238
+ //# sourceMappingURL=chunk-IHYAXZ5B.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","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;;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AM,MAAA,IAAI,iBAAiB,CAAG,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-GO6BWFSB.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 } else if (e.statusCode === 404) {\n tip = \"The resource may not exist or your token may not have the required scopes to load it\";\n }\n let 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 } else {\n const {\n errorCode,\n errorName,\n errorInstanceId,\n parameters\n } = e;\n // Include extra info about the original API error in CLI error messages\n // https://www.palantir.com/docs/foundry/api/general/overview/errors/\n message = `${e.message}\\n\\n${JSON.stringify({\n errorCode,\n errorName,\n errorInstanceId,\n parameters\n }, null, 2)}`;\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","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;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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-IHYAXZ5B.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 } else if (e.statusCode === 404) {\n tip = \"The resource may not exist or your token may not have the required scopes to load it\";\n }\n let 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 } else {\n const {\n errorCode,\n errorName,\n errorInstanceId,\n parameters\n } = e;\n // Include extra info about the original API error in CLI error messages\n // https://www.palantir.com/docs/foundry/api/general/overview/errors/\n message = `${e.message}\\n\\n${JSON.stringify({\n errorCode,\n errorName,\n errorInstanceId,\n parameters\n }, null, 2)}`;\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}"]}
@@ -194,6 +194,9 @@ function wirePropertyV2ToSdkPropertyDefinition(input, isNullable = true) {
194
194
  nullable: true
195
195
  };
196
196
  }
197
+ case "mediaReference": {
198
+ throw new Error(`Media references not supported yet`);
199
+ }
197
200
  default:
198
201
  input.dataType;
199
202
  throw new Error(`Unexpected data type ${JSON.stringify(input.dataType)}`);
@@ -226,6 +229,9 @@ function objectPropertyTypeToSdkPropertyDefinition(propertyType) {
226
229
  return "stringTimeseries";
227
230
  }
228
231
  return "numericTimeseries";
232
+ case "mediaReference": {
233
+ throw new Error(`Media references not supported yet`);
234
+ }
229
235
  default:
230
236
  throw new Error(`Unexpected data type ${JSON.stringify(propertyType)}`);
231
237
  }
@@ -372,6 +378,7 @@ function wirePropertyV2ToSdkPrimaryKeyTypeDefinition(input) {
372
378
  case "marking":
373
379
  case "float":
374
380
  case "geotimeSeriesReference":
381
+ case "mediaReference":
375
382
  throw new Error(`Type not supported for primaryKey: ${input.dataType.type}`);
376
383
  default:
377
384
  input.dataType;
@@ -22214,10 +22221,10 @@ async function writeJson(minimalFs, filePath, body) {
22214
22221
  return await minimalFs.writeFile(filePath, JSON.stringify(body, void 0, 2) + "\n");
22215
22222
  }
22216
22223
 
22217
- // ../../node_modules/.pnpm/@osdk+internal.foundry.ontologiesv2@2.2.0/node_modules/@osdk/internal.foundry.ontologiesv2/build/esm/index.js
22224
+ // ../../node_modules/.pnpm/@osdk+internal.foundry.ontologiesv2@2.3.0/node_modules/@osdk/internal.foundry.ontologiesv2/build/esm/index.js
22218
22225
  init_esm_shims();
22219
22226
 
22220
- // ../../node_modules/.pnpm/@osdk+internal.foundry.ontologiesv2@2.2.0/node_modules/@osdk/internal.foundry.ontologiesv2/build/esm/public/Action.js
22227
+ // ../../node_modules/.pnpm/@osdk+internal.foundry.ontologiesv2@2.3.0/node_modules/@osdk/internal.foundry.ontologiesv2/build/esm/public/Action.js
22221
22228
  init_esm_shims();
22222
22229
 
22223
22230
  // ../../node_modules/.pnpm/@osdk+shared.net.platformapi@0.3.2/node_modules/@osdk/shared.net.platformapi/build/esm/index.js
@@ -22324,31 +22331,31 @@ async function apiFetch(clientCtx, method, endpointPath, data, queryArguments, h
22324
22331
  return response.blob();
22325
22332
  }
22326
22333
 
22327
- // ../../node_modules/.pnpm/@osdk+internal.foundry.ontologiesv2@2.2.0/node_modules/@osdk/internal.foundry.ontologiesv2/build/esm/public/ActionTypeV2.js
22334
+ // ../../node_modules/.pnpm/@osdk+internal.foundry.ontologiesv2@2.3.0/node_modules/@osdk/internal.foundry.ontologiesv2/build/esm/public/ActionTypeV2.js
22328
22335
  init_esm_shims();
22329
22336
 
22330
- // ../../node_modules/.pnpm/@osdk+internal.foundry.ontologiesv2@2.2.0/node_modules/@osdk/internal.foundry.ontologiesv2/build/esm/public/Attachment.js
22337
+ // ../../node_modules/.pnpm/@osdk+internal.foundry.ontologiesv2@2.3.0/node_modules/@osdk/internal.foundry.ontologiesv2/build/esm/public/Attachment.js
22331
22338
  init_esm_shims();
22332
22339
 
22333
- // ../../node_modules/.pnpm/@osdk+internal.foundry.ontologiesv2@2.2.0/node_modules/@osdk/internal.foundry.ontologiesv2/build/esm/public/AttachmentPropertyV2.js
22340
+ // ../../node_modules/.pnpm/@osdk+internal.foundry.ontologiesv2@2.3.0/node_modules/@osdk/internal.foundry.ontologiesv2/build/esm/public/AttachmentPropertyV2.js
22334
22341
  init_esm_shims();
22335
22342
 
22336
- // ../../node_modules/.pnpm/@osdk+internal.foundry.ontologiesv2@2.2.0/node_modules/@osdk/internal.foundry.ontologiesv2/build/esm/public/LinkedObjectV2.js
22343
+ // ../../node_modules/.pnpm/@osdk+internal.foundry.ontologiesv2@2.3.0/node_modules/@osdk/internal.foundry.ontologiesv2/build/esm/public/LinkedObjectV2.js
22337
22344
  init_esm_shims();
22338
22345
 
22339
- // ../../node_modules/.pnpm/@osdk+internal.foundry.ontologiesv2@2.2.0/node_modules/@osdk/internal.foundry.ontologiesv2/build/esm/public/ObjectTypeV2.js
22346
+ // ../../node_modules/.pnpm/@osdk+internal.foundry.ontologiesv2@2.3.0/node_modules/@osdk/internal.foundry.ontologiesv2/build/esm/public/ObjectTypeV2.js
22340
22347
  init_esm_shims();
22341
22348
 
22342
- // ../../node_modules/.pnpm/@osdk+internal.foundry.ontologiesv2@2.2.0/node_modules/@osdk/internal.foundry.ontologiesv2/build/esm/public/OntologyInterface.js
22349
+ // ../../node_modules/.pnpm/@osdk+internal.foundry.ontologiesv2@2.3.0/node_modules/@osdk/internal.foundry.ontologiesv2/build/esm/public/OntologyInterface.js
22343
22350
  init_esm_shims();
22344
22351
 
22345
- // ../../node_modules/.pnpm/@osdk+internal.foundry.ontologiesv2@2.2.0/node_modules/@osdk/internal.foundry.ontologiesv2/build/esm/public/OntologyObjectSet.js
22352
+ // ../../node_modules/.pnpm/@osdk+internal.foundry.ontologiesv2@2.3.0/node_modules/@osdk/internal.foundry.ontologiesv2/build/esm/public/OntologyObjectSet.js
22346
22353
  init_esm_shims();
22347
22354
 
22348
- // ../../node_modules/.pnpm/@osdk+internal.foundry.ontologiesv2@2.2.0/node_modules/@osdk/internal.foundry.ontologiesv2/build/esm/public/OntologyObjectV2.js
22355
+ // ../../node_modules/.pnpm/@osdk+internal.foundry.ontologiesv2@2.3.0/node_modules/@osdk/internal.foundry.ontologiesv2/build/esm/public/OntologyObjectV2.js
22349
22356
  init_esm_shims();
22350
22357
 
22351
- // ../../node_modules/.pnpm/@osdk+internal.foundry.ontologiesv2@2.2.0/node_modules/@osdk/internal.foundry.ontologiesv2/build/esm/public/OntologyV2.js
22358
+ // ../../node_modules/.pnpm/@osdk+internal.foundry.ontologiesv2@2.3.0/node_modules/@osdk/internal.foundry.ontologiesv2/build/esm/public/OntologyV2.js
22352
22359
  var OntologyV2_exports = {};
22353
22360
  __export(OntologyV2_exports, {
22354
22361
  get: () => get,
@@ -22369,21 +22376,21 @@ function getFullMetadata($ctx, ...args) {
22369
22376
  return foundryPlatformFetch($ctx, _getFullMetadata, ...args);
22370
22377
  }
22371
22378
 
22372
- // ../../node_modules/.pnpm/@osdk+internal.foundry.ontologiesv2@2.2.0/node_modules/@osdk/internal.foundry.ontologiesv2/build/esm/public/Query.js
22379
+ // ../../node_modules/.pnpm/@osdk+internal.foundry.ontologiesv2@2.3.0/node_modules/@osdk/internal.foundry.ontologiesv2/build/esm/public/Query.js
22373
22380
  init_esm_shims();
22374
22381
 
22375
- // ../../node_modules/.pnpm/@osdk+internal.foundry.ontologiesv2@2.2.0/node_modules/@osdk/internal.foundry.ontologiesv2/build/esm/public/QueryType.js
22382
+ // ../../node_modules/.pnpm/@osdk+internal.foundry.ontologiesv2@2.3.0/node_modules/@osdk/internal.foundry.ontologiesv2/build/esm/public/QueryType.js
22376
22383
  init_esm_shims();
22377
22384
 
22378
- // ../../node_modules/.pnpm/@osdk+internal.foundry.ontologiesv2@2.2.0/node_modules/@osdk/internal.foundry.ontologiesv2/build/esm/public/TimeSeriesPropertyV2.js
22385
+ // ../../node_modules/.pnpm/@osdk+internal.foundry.ontologiesv2@2.3.0/node_modules/@osdk/internal.foundry.ontologiesv2/build/esm/public/TimeSeriesPropertyV2.js
22379
22386
  init_esm_shims();
22380
22387
 
22381
- // ../../node_modules/.pnpm/@osdk+internal.foundry.ontologiesv2@2.2.0/node_modules/@osdk/internal.foundry.ontologiesv2/build/esm/public/TimeSeriesValueBankProperty.js
22388
+ // ../../node_modules/.pnpm/@osdk+internal.foundry.ontologiesv2@2.3.0/node_modules/@osdk/internal.foundry.ontologiesv2/build/esm/public/TimeSeriesValueBankProperty.js
22382
22389
  init_esm_shims();
22383
22390
 
22384
22391
  // ../cli.cmd.typescript/build/esm/generate/handleGenerate.mjs
22385
22392
  var import_fast_deep_equal2 = __toESM(require_fast_deep_equal(), 1);
22386
- var USER_AGENT = `osdk-cli.cmd.typescript/${"0.25.0-beta.5"}`;
22393
+ var USER_AGENT = `osdk-cli.cmd.typescript/${"0.25.0-beta.7"}`;
22387
22394
  async function handleGenerate(args) {
22388
22395
  let success = false;
22389
22396
  if (args.ontologyPath) {
@@ -22519,7 +22526,7 @@ async function generateClientSdk(ontology, args) {
22519
22526
  }
22520
22527
  return true;
22521
22528
  }
22522
- await generateClientSdkPackage(args.packageName, args.version, args.beta ? "2.0" : "1.1", args.outDir, ontology, minimalFs, await getDependencyVersions(), "0.25.0-beta.5", args.externalObjects, args.externalInterfaces);
22529
+ await generateClientSdkPackage(args.packageName, args.version, args.beta ? "2.0" : "1.1", args.outDir, ontology, minimalFs, await getDependencyVersions(), "0.25.0-beta.7", args.externalObjects, args.externalInterfaces);
22523
22530
  return true;
22524
22531
  } catch (e) {
22525
22532
  consola.error("OSDK generation failed", e.message, e.stack);
@@ -22541,8 +22548,8 @@ async function getDependencyVersions() {
22541
22548
  const typescriptVersion = ourPackageJson.devDependencies.typescript;
22542
22549
  const tslibVersion = ourPackageJson.dependencies.tslib;
22543
22550
  const areTheTypesWrongVersion = ourPackageJson.dependencies["@arethetypeswrong/cli"];
22544
- const osdkClientVersion = `^${"2.1.0-beta.5"}`;
22545
- const osdkApiVersion = `^${"2.1.0-beta.5"}`;
22551
+ const osdkClientVersion = `^${"2.1.0-beta.7"}`;
22552
+ const osdkApiVersion = `^${"2.1.0-beta.7"}`;
22546
22553
  const osdkLegacyClientVersion = `^${process.env.PACKAGE_LEGACY_CLIENT_VERSION}`;
22547
22554
  return {
22548
22555
  typescriptVersion,
@@ -22588,5 +22595,5 @@ function createNormalFs() {
22588
22595
  }
22589
22596
 
22590
22597
  export { getDependencyVersions, handleGenerate, updateVersionsIfTheyExist };
22591
- //# sourceMappingURL=handleGenerate-IS5DFQEZ.js.map
22592
- //# sourceMappingURL=handleGenerate-IS5DFQEZ.js.map
22598
+ //# sourceMappingURL=handleGenerate-7AXASAED.js.map
22599
+ //# sourceMappingURL=handleGenerate-7AXASAED.js.map