@osdk/cli 0.0.3 → 0.0.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.
Files changed (117) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/build/js/chunk-2LNCUMIA.cjs +8 -0
  3. package/build/js/chunk-2LNCUMIA.cjs.map +1 -0
  4. package/build/js/chunk-AFLYFRYO.cjs +16 -0
  5. package/build/js/chunk-AFLYFRYO.cjs.map +1 -0
  6. package/build/js/chunk-LBGQDFFN.js +5 -0
  7. package/build/js/chunk-LBGQDFFN.js.map +1 -0
  8. package/build/js/chunk-NOVNYG3L.js +11 -0
  9. package/build/js/chunk-NOVNYG3L.js.map +1 -0
  10. package/build/js/handleSiteDeploy-2C2WC2A7.js +9 -0
  11. package/build/js/handleSiteDeploy-2C2WC2A7.js.map +1 -0
  12. package/build/js/handleSiteDeploy-4O4DUUB6.cjs +11 -0
  13. package/build/js/handleSiteDeploy-4O4DUUB6.cjs.map +1 -0
  14. package/build/js/index.cjs +35 -0
  15. package/build/js/index.cjs.map +1 -0
  16. package/build/js/index.js +6 -11
  17. package/build/js/index.js.map +1 -1
  18. package/build/js/siteDeleteCommand-GQCHP3EN.js +9 -0
  19. package/build/js/siteDeleteCommand-GQCHP3EN.js.map +1 -0
  20. package/build/js/siteDeleteCommand-ZXXHDOOM.cjs +11 -0
  21. package/build/js/siteDeleteCommand-ZXXHDOOM.cjs.map +1 -0
  22. package/build/js/siteUploadCommand-4ZL5TAIW.js +12 -0
  23. package/build/js/siteUploadCommand-4ZL5TAIW.js.map +1 -0
  24. package/build/js/siteUploadCommand-5AYNOXAT.cjs +37 -0
  25. package/build/js/siteUploadCommand-5AYNOXAT.cjs.map +1 -0
  26. package/build/js/siteVersionsCommand-ZUFBC6EH.js +10 -0
  27. package/build/js/siteVersionsCommand-ZUFBC6EH.js.map +1 -0
  28. package/build/js/siteVersionsCommand-ZVHYGOAQ.cjs +12 -0
  29. package/build/js/siteVersionsCommand-ZVHYGOAQ.cjs.map +1 -0
  30. package/build/types/CliCommonArgs.d.ts +3 -0
  31. package/build/types/cli.d.ts +1 -0
  32. package/build/types/commands/site/CommonSiteArgs.d.ts +6 -0
  33. package/build/types/commands/site/delete/DeleteArgs.d.ts +4 -0
  34. package/build/types/commands/site/delete/index.d.ts +5 -0
  35. package/build/types/commands/site/delete/siteDeleteCommand.d.mts +2 -0
  36. package/build/types/commands/site/deploy/SiteDeployArgs.d.ts +5 -0
  37. package/build/types/commands/site/deploy/handleSiteDeploy.d.mts +2 -0
  38. package/build/types/commands/site/deploy/index.d.ts +5 -0
  39. package/build/types/commands/site/index.d.ts +5 -0
  40. package/build/types/commands/site/upload/UploadArgs.d.ts +1 -1
  41. package/build/types/commands/site/upload/index.d.ts +2 -2
  42. package/build/types/commands/site/versions/index.d.ts +1 -1
  43. package/build/types/commands/site/versions/siteVersionsCommand.d.mts +2 -2
  44. package/build/types/generated/artifacts-admin/ArtifactsAdminService/clearDeletedUserRepositories.d.ts +3 -0
  45. package/build/types/generated/artifacts-admin/ArtifactsAdminService/getContainerRegistryDomain.d.ts +3 -0
  46. package/build/types/generated/artifacts-admin/ArtifactsAdminService.d.ts +2 -0
  47. package/build/types/generated/artifacts-admin/ClearDeletedUserRepositoriesRequest.d.ts +3 -0
  48. package/build/types/generated/artifacts-admin/ContainerRegistryDomainResponse.d.ts +3 -0
  49. package/build/types/generated/artifacts-admin/index.d.ts +3 -0
  50. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminService/deleteSiteDeployment.d.ts +2 -0
  51. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminService/deploySite.d.ts +3 -0
  52. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminService/getDeployedVersion.d.ts +3 -0
  53. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminService.d.ts +3 -0
  54. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/clearDeployedVersion.d.ts +2 -0
  55. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/getContentSecurityPolicyAdditions.d.ts +3 -0
  56. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/getDeployedVersion.d.ts +3 -0
  57. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/getRegisteredSiteDomains.d.ts +3 -0
  58. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/getRequestedSiteDomains.d.ts +3 -0
  59. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/previewContentSecurityPolicy.d.ts +4 -0
  60. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/putContentSecurityPolicyAdditions.d.ts +3 -0
  61. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/requestSiteDomainForRepository.d.ts +4 -0
  62. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/unregisterSiteDomain.d.ts +3 -0
  63. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/updateDeployedVersion.d.ts +3 -0
  64. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service.d.ts +10 -0
  65. package/build/types/generated/artifacts-sites/ContentSecurityPolicyAdditions.d.ts +3 -0
  66. package/build/types/generated/artifacts-sites/ContentSecurityPolicyDirectiveName.d.ts +1 -0
  67. package/build/types/generated/artifacts-sites/ContentSecurityPolicyDirectiveValue.d.ts +1 -0
  68. package/build/types/generated/artifacts-sites/ContentSecurityPolicyHeaderValue.d.ts +1 -0
  69. package/build/types/generated/artifacts-sites/ControlPanelManagedDomainInfo.d.ts +6 -0
  70. package/build/types/generated/artifacts-sites/DeploySiteRequest.d.ts +7 -0
  71. package/build/types/generated/artifacts-sites/DeploymentInfo.d.ts +6 -0
  72. package/build/types/generated/artifacts-sites/DomainName.d.ts +3 -0
  73. package/build/types/generated/artifacts-sites/PreviewContentSecurityPolicyRequest.d.ts +4 -0
  74. package/build/types/generated/artifacts-sites/SiteDomainInfo.d.ts +6 -0
  75. package/build/types/generated/artifacts-sites/SiteDomainRegistrationRequestRid.d.ts +1 -0
  76. package/build/types/generated/artifacts-sites/SiteVersion.d.ts +3 -0
  77. package/build/types/generated/artifacts-sites/SitesDomainRegistryService/getRegisteredDomains.d.ts +2 -0
  78. package/build/types/generated/artifacts-sites/SitesDomainRegistryService.d.ts +1 -0
  79. package/build/types/generated/artifacts-sites/SubmitDomainRegistrationRequest.d.ts +7 -0
  80. package/build/types/generated/artifacts-sites/UnregisterDomainRequest.d.ts +4 -0
  81. package/build/types/generated/artifacts-sites/UpdateDeployedVersionRequest.d.ts +4 -0
  82. package/build/types/generated/artifacts-sites/index.d.ts +18 -0
  83. package/build/types/index.d.ts +1 -1
  84. package/build/types/net/artifacts/SiteAssetArtifactsService/SiteAssetVersions.d.mts +3 -0
  85. package/build/types/net/artifacts/SiteAssetArtifactsService/deleteSiteVersion.d.mts +2 -0
  86. package/build/types/net/artifacts/SiteAssetArtifactsService/fetchSiteVersions.d.mts +2 -0
  87. package/build/types/net/artifacts/SiteAssetArtifactsService/index.d.mts +4 -0
  88. package/build/types/net/{uploadSiteVersion.d.mts → artifacts/SiteAssetArtifactsService/uploadSiteVersion.d.mts} +1 -4
  89. package/build/types/net/artifacts/index.d.mts +1 -0
  90. package/build/types/net/createConjureContext.d.mts +2 -0
  91. package/build/types/net/index.d.mts +4 -0
  92. package/build/types/net/{fetchWebsiteRepositoryRid.d.mts → third-party-application-service/fetchWebsiteRepositoryRid.d.mts} +2 -2
  93. package/build/types/net/third-party-application-service/index.d.mts +1 -0
  94. package/build/types/readCliVersionFromPackageJson.d.ts +1 -0
  95. package/build/types/yargs/logVersionMiddleware.d.ts +2 -0
  96. package/package.json +8 -2
  97. package/build/js/chunk-2DJZUIFP.js +0 -7
  98. package/build/js/chunk-2DJZUIFP.js.map +0 -1
  99. package/build/js/chunk-6PVNK2PW.js +0 -13
  100. package/build/js/chunk-6PVNK2PW.js.map +0 -1
  101. package/build/js/chunk-MGT3UGXW.mjs +0 -5
  102. package/build/js/chunk-MGT3UGXW.mjs.map +0 -1
  103. package/build/js/chunk-YEWM6TCR.mjs +0 -9
  104. package/build/js/chunk-YEWM6TCR.mjs.map +0 -1
  105. package/build/js/index.mjs +0 -9
  106. package/build/js/index.mjs.map +0 -1
  107. package/build/js/siteUploadCommand-36HAEYDG.js +0 -37
  108. package/build/js/siteUploadCommand-36HAEYDG.js.map +0 -1
  109. package/build/js/siteUploadCommand-L3QDNVWX.mjs +0 -12
  110. package/build/js/siteUploadCommand-L3QDNVWX.mjs.map +0 -1
  111. package/build/js/siteVersionsCommand-BQMPCMGZ.mjs +0 -10
  112. package/build/js/siteVersionsCommand-BQMPCMGZ.mjs.map +0 -1
  113. package/build/js/siteVersionsCommand-YSV7HQJK.js +0 -12
  114. package/build/js/siteVersionsCommand-YSV7HQJK.js.map +0 -1
  115. package/build/types/commands/site/addSiteCommand.d.ts +0 -7
  116. package/build/types/net/getSiteVersions.d.mts +0 -5
  117. /package/build/types/net/{getSiteAssetBaseUrl.d.mts → artifacts/SiteAssetArtifactsService/getSiteAssetBaseUrl.d.mts} +0 -0
@@ -1,37 +0,0 @@
1
- 'use strict';
2
-
3
- var chunk2DJZUIFP_js = require('./chunk-2DJZUIFP.js');
4
- var chunk6PVNK2PW_js = require('./chunk-6PVNK2PW.js');
5
- var w = require('archiver');
6
- var consola = require('consola');
7
- var d = require('fs');
8
- var stream = require('stream');
9
-
10
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
11
-
12
- function _interopNamespace(e) {
13
- if (e && e.__esModule) return e;
14
- var n = Object.create(null);
15
- if (e) {
16
- Object.keys(e).forEach(function (k) {
17
- if (k !== 'default') {
18
- var d = Object.getOwnPropertyDescriptor(e, k);
19
- Object.defineProperty(n, k, d.get ? d : {
20
- enumerable: true,
21
- get: function () { return e[k]; }
22
- });
23
- }
24
- });
25
- }
26
- n.default = e;
27
- return Object.freeze(n);
28
- }
29
-
30
- var w__default = /*#__PURE__*/_interopDefault(w);
31
- var d__namespace = /*#__PURE__*/_interopNamespace(d);
32
-
33
- async function f(t,i,s,l){let m=await chunk6PVNK2PW_js.b(t,i),u=`${chunk6PVNK2PW_js.c(t,m)}/versions/zip/${s}`,e=await chunk6PVNK2PW_js.a(()=>process.env.FOUNDRY_SDK_AUTH_TOKEN)(u,{method:"PUT",body:l,headers:{"Content-Type":"application/octet-stream"},duplex:"half"});if(e.status>=200&&e.status<300)return consola.consola.level=consola.LogLevels.debug,consola.consola.debug("Status Text: "+e.statusText),!0;throw e.status===409?new chunk2DJZUIFP_js.a(e.status,"Version already exists"):new chunk2DJZUIFP_js.a(e.status,`Unexpected response code ${e.status} (${e.statusText})`)}async function x(t){if(t.dir==null)throw consola.consola.error("No directory specified"),new chunk2DJZUIFP_js.a(1);if(!(await d__namespace.promises.stat(t.dir)).isDirectory())throw consola.consola.error("Specified path is not a directory"),new chunk2DJZUIFP_js.a(2);consola.consola.start("Zippping site files");let s=w__default.default("zip").directory(t.dir,!1);await Promise.all([f(t.baseUrl,t.appRid,t.siteVersion,stream.Readable.toWeb(s)),s.finalize()]),consola.consola.success("Found versions");}
34
-
35
- module.exports = x;
36
- //# sourceMappingURL=out.js.map
37
- //# sourceMappingURL=siteUploadCommand-36HAEYDG.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/commands/site/upload/siteUploadCommand.mts","../../src/net/uploadSiteVersion.mts"],"names":["archiver","consola","fs","Readable","LogLevels","uploadZippedSiteAsset","baseUrl","thirdPartyAppRid","version","zipFile","repositoryRid","fetchWebsiteRepositoryRid","url","getSiteAssetBaseUrl","result","createFetch","ExitProcessError","invokeSiteUpload","args","archive"],"mappings":"yFAgBA,OAAOA,MAAc,WACrB,OAAS,WAAAC,MAAe,UACxB,UAAYC,MAAQ,KACpB,OAAS,YAAAC,MAAgB,SCHzB,OAAS,WAAAF,EAAS,aAAAG,MAAiB,UAKnC,eAAsBC,EAAsBC,EAASC,EAAkBC,EAASC,EAAS,CACvF,IAAMC,EAAgB,MAAMC,EAA0BL,EAASC,CAAgB,EACzEK,EAAM,GAAGC,EAAoBP,EAASI,CAAa,CAAC,iBAAiBF,CAAO,GAE5EM,EAAS,MADDC,EAAY,IAAM,QAAQ,IAAI,sBAAsB,EACvCH,EAAK,CAC9B,OAAQ,MACR,KAAMH,EACN,QAAS,CACP,eAAgB,0BAClB,EACA,OAAQ,MACV,CAAC,EAED,GAAIK,EAAO,QAAU,KAAOA,EAAO,OAAS,IAC1C,OAAAb,EAAQ,MAAQG,EAAU,MAC1BH,EAAQ,MAAM,gBAAkBa,EAAO,UAAU,EAC1C,GACF,MAAIA,EAAO,SAAW,IACrB,IAAIE,EAAiBF,EAAO,OAAQ,wBAAwB,EAE5D,IAAIE,EAAiBF,EAAO,OAAQ,4BAA4BA,EAAO,MAAM,KAAKA,EAAO,UAAU,GAAG,CAEhH,CDrBA,eAAOG,EAAwCC,EAAM,CACnD,GAAIA,EAAK,KAAO,KACd,MAAAjB,EAAQ,MAAM,wBAAwB,EAChC,IAAIe,EAAiB,CAAC,EAG9B,GAAI,EADS,MAAS,WAAS,KAAKE,EAAK,GAAG,GAClC,YAAY,EACpB,MAAAjB,EAAQ,MAAM,mCAAmC,EAC3C,IAAIe,EAAiB,CAAC,EAE9Bf,EAAQ,MAAM,qBAAqB,EACnC,IAAMkB,EAAUnB,EAAS,KAAK,EAAE,UAAUkB,EAAK,IAAK,EAAK,EACzD,MAAM,QAAQ,IAAI,CAACb,EAAsBa,EAAK,QAASA,EAAK,OAAQA,EAAK,YAAaf,EAAS,MAAMgB,CAAO,CAC5G,EAAGA,EAAQ,SAAS,CAAC,CAAC,EACtBlB,EAAQ,QAAQ,gBAAgB,CAClC","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport archiver from \"archiver\";\nimport { consola } from \"consola\";\nimport * as fs from \"node:fs\";\nimport { Readable } from \"node:stream\";\nimport { ExitProcessError } from \"../../../ExitProcessError.js\";\nimport { uploadZippedSiteAsset } from \"../../../net/uploadSiteVersion.mjs\";\nexport default async function invokeSiteUpload(args) {\n if (args.dir == null) {\n consola.error(\"No directory specified\");\n throw new ExitProcessError(1);\n }\n const stat = await fs.promises.stat(args.dir);\n if (!stat.isDirectory()) {\n consola.error(\"Specified path is not a directory\");\n throw new ExitProcessError(2);\n }\n consola.start(\"Zippping site files\");\n const archive = archiver(\"zip\").directory(args.dir, false);\n await Promise.all([uploadZippedSiteAsset(args.baseUrl, args.appRid, args.siteVersion, Readable.toWeb(archive) // This cast is because the dom fetch doesnt align type wise with streams\n ), archive.finalize()]);\n consola.success(\"Found versions\");\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola, LogLevels } from \"consola\";\nimport { ExitProcessError } from \"../ExitProcessError.js\";\nimport { createFetch } from \"./createFetch.mjs\";\nimport { fetchWebsiteRepositoryRid } from \"./fetchWebsiteRepositoryRid.mjs\";\nimport { getSiteAssetBaseUrl } from \"./getSiteAssetBaseUrl.mjs\";\nexport async function uploadZippedSiteAsset(baseUrl, thirdPartyAppRid, version, zipFile) {\n const repositoryRid = await fetchWebsiteRepositoryRid(baseUrl, thirdPartyAppRid);\n const url = `${getSiteAssetBaseUrl(baseUrl, repositoryRid)}/versions/zip/${version}`;\n const fetch = createFetch(() => process.env.FOUNDRY_SDK_AUTH_TOKEN);\n const result = await fetch(url, {\n method: \"PUT\",\n body: zipFile,\n headers: {\n \"Content-Type\": \"application/octet-stream\"\n },\n duplex: \"half\" // Node hates me\n });\n\n if (result.status >= 200 && result.status < 300) {\n consola.level = LogLevels.debug;\n consola.debug(\"Status Text: \" + result.statusText);\n return true;\n } else if (result.status === 409) {\n throw new ExitProcessError(result.status, \"Version already exists\");\n } else {\n throw new ExitProcessError(result.status, `Unexpected response code ${result.status} (${result.statusText})`);\n }\n}"]}
@@ -1,12 +0,0 @@
1
- import { a } from './chunk-MGT3UGXW.mjs';
2
- import { b, c, a as a$1 } from './chunk-YEWM6TCR.mjs';
3
- import w from 'archiver';
4
- import { consola, LogLevels } from 'consola';
5
- import * as d from 'fs';
6
- import { Readable } from 'stream';
7
-
8
- async function f(t,i,s,l){let m=await b(t,i),u=`${c(t,m)}/versions/zip/${s}`,e=await a$1(()=>process.env.FOUNDRY_SDK_AUTH_TOKEN)(u,{method:"PUT",body:l,headers:{"Content-Type":"application/octet-stream"},duplex:"half"});if(e.status>=200&&e.status<300)return consola.level=LogLevels.debug,consola.debug("Status Text: "+e.statusText),!0;throw e.status===409?new a(e.status,"Version already exists"):new a(e.status,`Unexpected response code ${e.status} (${e.statusText})`)}async function x(t){if(t.dir==null)throw consola.error("No directory specified"),new a(1);if(!(await d.promises.stat(t.dir)).isDirectory())throw consola.error("Specified path is not a directory"),new a(2);consola.start("Zippping site files");let s=w("zip").directory(t.dir,!1);await Promise.all([f(t.baseUrl,t.appRid,t.siteVersion,Readable.toWeb(s)),s.finalize()]),consola.success("Found versions");}
9
-
10
- export { x as default };
11
- //# sourceMappingURL=out.js.map
12
- //# sourceMappingURL=siteUploadCommand-L3QDNVWX.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/commands/site/upload/siteUploadCommand.mts","../../src/net/uploadSiteVersion.mts"],"names":["archiver","consola","fs","Readable","LogLevels","uploadZippedSiteAsset","baseUrl","thirdPartyAppRid","version","zipFile","repositoryRid","fetchWebsiteRepositoryRid","url","getSiteAssetBaseUrl","result","createFetch","ExitProcessError","invokeSiteUpload","args","archive"],"mappings":"2FAgBA,OAAOA,MAAc,WACrB,OAAS,WAAAC,MAAe,UACxB,UAAYC,MAAQ,KACpB,OAAS,YAAAC,MAAgB,SCHzB,OAAS,WAAAF,EAAS,aAAAG,MAAiB,UAKnC,eAAsBC,EAAsBC,EAASC,EAAkBC,EAASC,EAAS,CACvF,IAAMC,EAAgB,MAAMC,EAA0BL,EAASC,CAAgB,EACzEK,EAAM,GAAGC,EAAoBP,EAASI,CAAa,CAAC,iBAAiBF,CAAO,GAE5EM,EAAS,MADDC,EAAY,IAAM,QAAQ,IAAI,sBAAsB,EACvCH,EAAK,CAC9B,OAAQ,MACR,KAAMH,EACN,QAAS,CACP,eAAgB,0BAClB,EACA,OAAQ,MACV,CAAC,EAED,GAAIK,EAAO,QAAU,KAAOA,EAAO,OAAS,IAC1C,OAAAb,EAAQ,MAAQG,EAAU,MAC1BH,EAAQ,MAAM,gBAAkBa,EAAO,UAAU,EAC1C,GACF,MAAIA,EAAO,SAAW,IACrB,IAAIE,EAAiBF,EAAO,OAAQ,wBAAwB,EAE5D,IAAIE,EAAiBF,EAAO,OAAQ,4BAA4BA,EAAO,MAAM,KAAKA,EAAO,UAAU,GAAG,CAEhH,CDrBA,eAAOG,EAAwCC,EAAM,CACnD,GAAIA,EAAK,KAAO,KACd,MAAAjB,EAAQ,MAAM,wBAAwB,EAChC,IAAIe,EAAiB,CAAC,EAG9B,GAAI,EADS,MAAS,WAAS,KAAKE,EAAK,GAAG,GAClC,YAAY,EACpB,MAAAjB,EAAQ,MAAM,mCAAmC,EAC3C,IAAIe,EAAiB,CAAC,EAE9Bf,EAAQ,MAAM,qBAAqB,EACnC,IAAMkB,EAAUnB,EAAS,KAAK,EAAE,UAAUkB,EAAK,IAAK,EAAK,EACzD,MAAM,QAAQ,IAAI,CAACb,EAAsBa,EAAK,QAASA,EAAK,OAAQA,EAAK,YAAaf,EAAS,MAAMgB,CAAO,CAC5G,EAAGA,EAAQ,SAAS,CAAC,CAAC,EACtBlB,EAAQ,QAAQ,gBAAgB,CAClC","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport archiver from \"archiver\";\nimport { consola } from \"consola\";\nimport * as fs from \"node:fs\";\nimport { Readable } from \"node:stream\";\nimport { ExitProcessError } from \"../../../ExitProcessError.js\";\nimport { uploadZippedSiteAsset } from \"../../../net/uploadSiteVersion.mjs\";\nexport default async function invokeSiteUpload(args) {\n if (args.dir == null) {\n consola.error(\"No directory specified\");\n throw new ExitProcessError(1);\n }\n const stat = await fs.promises.stat(args.dir);\n if (!stat.isDirectory()) {\n consola.error(\"Specified path is not a directory\");\n throw new ExitProcessError(2);\n }\n consola.start(\"Zippping site files\");\n const archive = archiver(\"zip\").directory(args.dir, false);\n await Promise.all([uploadZippedSiteAsset(args.baseUrl, args.appRid, args.siteVersion, Readable.toWeb(archive) // This cast is because the dom fetch doesnt align type wise with streams\n ), archive.finalize()]);\n consola.success(\"Found versions\");\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola, LogLevels } from \"consola\";\nimport { ExitProcessError } from \"../ExitProcessError.js\";\nimport { createFetch } from \"./createFetch.mjs\";\nimport { fetchWebsiteRepositoryRid } from \"./fetchWebsiteRepositoryRid.mjs\";\nimport { getSiteAssetBaseUrl } from \"./getSiteAssetBaseUrl.mjs\";\nexport async function uploadZippedSiteAsset(baseUrl, thirdPartyAppRid, version, zipFile) {\n const repositoryRid = await fetchWebsiteRepositoryRid(baseUrl, thirdPartyAppRid);\n const url = `${getSiteAssetBaseUrl(baseUrl, repositoryRid)}/versions/zip/${version}`;\n const fetch = createFetch(() => process.env.FOUNDRY_SDK_AUTH_TOKEN);\n const result = await fetch(url, {\n method: \"PUT\",\n body: zipFile,\n headers: {\n \"Content-Type\": \"application/octet-stream\"\n },\n duplex: \"half\" // Node hates me\n });\n\n if (result.status >= 200 && result.status < 300) {\n consola.level = LogLevels.debug;\n consola.debug(\"Status Text: \" + result.statusText);\n return true;\n } else if (result.status === 409) {\n throw new ExitProcessError(result.status, \"Version already exists\");\n } else {\n throw new ExitProcessError(result.status, `Unexpected response code ${result.status} (${result.statusText})`);\n }\n}"]}
@@ -1,10 +0,0 @@
1
- import { b, c, a as a$1 } from './chunk-YEWM6TCR.mjs';
2
- import { consola } from 'consola';
3
-
4
- async function a(e,s){let o=await b(e,s),p=`${c(e,o)}/versions`,t=await a$1(()=>process.env.FOUNDRY_SDK_AUTH_TOKEN)(p);if(t.status===200)return (await t.json()).versions;throw new Error(`Unexpected response code ${t.status} (${t.statusText})`)}async function u(e){consola.start("Fetching versions");let s=await a(e.baseUrl,e.appRid);if(s.length==0){consola.warn("Successfully connected to server, but no versions were found.");return}consola.success(`Found versions:
5
- `+s.map(o=>` * ${o}`).join(`
6
- `));}
7
-
8
- export { u as default };
9
- //# sourceMappingURL=out.js.map
10
- //# sourceMappingURL=siteVersionsCommand-BQMPCMGZ.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/commands/site/versions/siteVersionsCommand.mts","../../src/net/getSiteVersions.mts"],"names":["consola","getSiteVersions","baseUrl","thirdPartyAppRid","repositoryRid","fetchWebsiteRepositoryRid","url","getSiteAssetBaseUrl","result","createFetch","invokeSiteVersionsCommand","args","versions","a"],"mappings":"kDAgBA,OAAS,WAAAA,MAAe,UCGxB,eAAsBC,EAAgBC,EAASC,EAAkB,CAC/D,IAAMC,EAAgB,MAAMC,EAA0BH,EAASC,CAAgB,EACzEG,EAAM,GAAGC,EAAoBL,EAASE,CAAa,CAAC,YAEpDI,EAAS,MADDC,EAAY,IAAM,QAAQ,IAAI,sBAAsB,EACvCH,CAAG,EAC9B,GAAIE,EAAO,SAAW,IAEpB,OADiB,MAAMA,EAAO,KAAK,GACnB,SAEhB,MAAM,IAAI,MAAM,4BAA4BA,EAAO,MAAM,KAAKA,EAAO,UAAU,GAAG,CAEtF,CDZA,eAAOE,EAAiDC,EAAM,CAC5DX,EAAQ,MAAM,mBAAmB,EACjC,IAAMY,EAAW,MAAMX,EAAgBU,EAAK,QAASA,EAAK,MAAM,EAChE,GAAIC,EAAS,QAAU,EAAG,CACxBZ,EAAQ,KAAK,+DAA+D,EAC5E,MACF,CACAA,EAAQ,QAAQ;AAAA,EAAsBY,EAAS,IAAIC,GAAK,SAASA,CAAC,EAAE,EAAE,KAAK;AAAA,CAAI,CAAC,CAClF","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nimport { getSiteVersions } from \"../../../net/getSiteVersions.mjs\";\nexport default async function invokeSiteVersionsCommand(args) {\n consola.start(\"Fetching versions\");\n const versions = await getSiteVersions(args.baseUrl, args.appRid);\n if (versions.length == 0) {\n consola.warn(\"Successfully connected to server, but no versions were found.\");\n return;\n }\n consola.success(\"Found versions:\\n\" + versions.map(a => ` * ${a}`).join(\"\\n\"));\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"./createFetch.mjs\";\nimport { fetchWebsiteRepositoryRid } from \"./fetchWebsiteRepositoryRid.mjs\";\nimport { getSiteAssetBaseUrl } from \"./getSiteAssetBaseUrl.mjs\";\nexport async function getSiteVersions(baseUrl, thirdPartyAppRid) {\n const repositoryRid = await fetchWebsiteRepositoryRid(baseUrl, thirdPartyAppRid);\n const url = `${getSiteAssetBaseUrl(baseUrl, repositoryRid)}/versions`;\n const fetch = createFetch(() => process.env.FOUNDRY_SDK_AUTH_TOKEN);\n const result = await fetch(url);\n if (result.status === 200) {\n const response = await result.json();\n return response.versions;\n } else {\n throw new Error(`Unexpected response code ${result.status} (${result.statusText})`);\n }\n}"]}
@@ -1,12 +0,0 @@
1
- 'use strict';
2
-
3
- var chunk6PVNK2PW_js = require('./chunk-6PVNK2PW.js');
4
- var consola = require('consola');
5
-
6
- async function a(e,s){let o=await chunk6PVNK2PW_js.b(e,s),p=`${chunk6PVNK2PW_js.c(e,o)}/versions`,t=await chunk6PVNK2PW_js.a(()=>process.env.FOUNDRY_SDK_AUTH_TOKEN)(p);if(t.status===200)return (await t.json()).versions;throw new Error(`Unexpected response code ${t.status} (${t.statusText})`)}async function u(e){consola.consola.start("Fetching versions");let s=await a(e.baseUrl,e.appRid);if(s.length==0){consola.consola.warn("Successfully connected to server, but no versions were found.");return}consola.consola.success(`Found versions:
7
- `+s.map(o=>` * ${o}`).join(`
8
- `));}
9
-
10
- module.exports = u;
11
- //# sourceMappingURL=out.js.map
12
- //# sourceMappingURL=siteVersionsCommand-YSV7HQJK.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/commands/site/versions/siteVersionsCommand.mts","../../src/net/getSiteVersions.mts"],"names":["consola","getSiteVersions","baseUrl","thirdPartyAppRid","repositoryRid","fetchWebsiteRepositoryRid","url","getSiteAssetBaseUrl","result","createFetch","invokeSiteVersionsCommand","args","versions","a"],"mappings":"iDAgBA,OAAS,WAAAA,MAAe,UCGxB,eAAsBC,EAAgBC,EAASC,EAAkB,CAC/D,IAAMC,EAAgB,MAAMC,EAA0BH,EAASC,CAAgB,EACzEG,EAAM,GAAGC,EAAoBL,EAASE,CAAa,CAAC,YAEpDI,EAAS,MADDC,EAAY,IAAM,QAAQ,IAAI,sBAAsB,EACvCH,CAAG,EAC9B,GAAIE,EAAO,SAAW,IAEpB,OADiB,MAAMA,EAAO,KAAK,GACnB,SAEhB,MAAM,IAAI,MAAM,4BAA4BA,EAAO,MAAM,KAAKA,EAAO,UAAU,GAAG,CAEtF,CDZA,eAAOE,EAAiDC,EAAM,CAC5DX,EAAQ,MAAM,mBAAmB,EACjC,IAAMY,EAAW,MAAMX,EAAgBU,EAAK,QAASA,EAAK,MAAM,EAChE,GAAIC,EAAS,QAAU,EAAG,CACxBZ,EAAQ,KAAK,+DAA+D,EAC5E,MACF,CACAA,EAAQ,QAAQ;AAAA,EAAsBY,EAAS,IAAIC,GAAK,SAASA,CAAC,EAAE,EAAE,KAAK;AAAA,CAAI,CAAC,CAClF","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nimport { getSiteVersions } from \"../../../net/getSiteVersions.mjs\";\nexport default async function invokeSiteVersionsCommand(args) {\n consola.start(\"Fetching versions\");\n const versions = await getSiteVersions(args.baseUrl, args.appRid);\n if (versions.length == 0) {\n consola.warn(\"Successfully connected to server, but no versions were found.\");\n return;\n }\n consola.success(\"Found versions:\\n\" + versions.map(a => ` * ${a}`).join(\"\\n\"));\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetch } from \"./createFetch.mjs\";\nimport { fetchWebsiteRepositoryRid } from \"./fetchWebsiteRepositoryRid.mjs\";\nimport { getSiteAssetBaseUrl } from \"./getSiteAssetBaseUrl.mjs\";\nexport async function getSiteVersions(baseUrl, thirdPartyAppRid) {\n const repositoryRid = await fetchWebsiteRepositoryRid(baseUrl, thirdPartyAppRid);\n const url = `${getSiteAssetBaseUrl(baseUrl, repositoryRid)}/versions`;\n const fetch = createFetch(() => process.env.FOUNDRY_SDK_AUTH_TOKEN);\n const result = await fetch(url);\n if (result.status === 200) {\n const response = await result.json();\n return response.versions;\n } else {\n throw new Error(`Unexpected response code ${result.status} (${result.statusText})`);\n }\n}"]}
@@ -1,7 +0,0 @@
1
- import type * as yargs from "yargs";
2
- import type { ThirdPartyAppRid } from "../../net/ThirdPartyAppRid.js";
3
- export interface CommonSiteArgs {
4
- appRid: ThirdPartyAppRid;
5
- baseUrl: string;
6
- }
7
- export default function addSiteCommand(yargs: yargs.Argv<{}>): yargs.Argv<{}>;
@@ -1,5 +0,0 @@
1
- import type { ThirdPartyAppRid } from "./ThirdPartyAppRid.js";
2
- export interface SiteAssetVersions {
3
- versions: string[];
4
- }
5
- export declare function getSiteVersions(baseUrl: string, thirdPartyAppRid: ThirdPartyAppRid): Promise<string[]>;