@osdk/cli 0.14.0 → 0.16.0

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 (256) hide show
  1. package/build/js/{chunk-MS72SCKG.cjs → chunk-2KJDB4YP.cjs} +13 -13
  2. package/build/js/{chunk-MS72SCKG.cjs.map → chunk-2KJDB4YP.cjs.map} +1 -1
  3. package/build/js/chunk-AX5HH3ZN.cjs +73 -0
  4. package/build/js/chunk-AX5HH3ZN.cjs.map +1 -0
  5. package/build/js/{chunk-TZGNA5WR.cjs → chunk-EVW4VRJL.cjs} +3 -7
  6. package/build/js/chunk-EVW4VRJL.cjs.map +1 -0
  7. package/build/js/{chunk-4ZJAXFFT.mjs → chunk-JTZ7GUB4.mjs} +3 -3
  8. package/build/js/{chunk-4ZJAXFFT.mjs.map → chunk-JTZ7GUB4.mjs.map} +1 -1
  9. package/build/js/chunk-MTJA6DOB.mjs +64 -0
  10. package/build/js/chunk-MTJA6DOB.mjs.map +1 -0
  11. package/build/js/{chunk-HD6SVFKA.mjs → chunk-SFL6QONJ.mjs} +3 -7
  12. package/build/js/chunk-SFL6QONJ.mjs.map +1 -0
  13. package/build/js/handleGenerate-XC5RBDDW-DL73JJG6.cjs +255 -0
  14. package/build/js/handleGenerate-XC5RBDDW-DL73JJG6.cjs.map +1 -0
  15. package/build/js/handleGenerate-XC5RBDDW-T333WMC4.mjs +230 -0
  16. package/build/js/handleGenerate-XC5RBDDW-T333WMC4.mjs.map +1 -0
  17. package/build/js/index.cjs +140 -165
  18. package/build/js/index.cjs.map +1 -1
  19. package/build/js/index.mjs +131 -152
  20. package/build/js/index.mjs.map +1 -1
  21. package/build/js/loginFlow-QTUKYZEL.cjs +10 -0
  22. package/build/js/loginFlow-ZFVT2AFZ.mjs +4 -0
  23. package/build/js/{siteDeployCommand-XWGLYIMU.cjs → siteDeployCommand-FTCDKKU4.cjs} +17 -18
  24. package/build/js/siteDeployCommand-FTCDKKU4.cjs.map +1 -0
  25. package/build/js/{siteDeployCommand-OKFLCN7L.mjs → siteDeployCommand-WHR7PIJE.mjs} +3 -4
  26. package/build/js/siteDeployCommand-WHR7PIJE.mjs.map +1 -0
  27. package/build/js/{versionDeleteCommand-MGKK73ZV.cjs → versionDeleteCommand-KQCJ7CHQ.cjs} +6 -6
  28. package/build/js/{versionDeleteCommand-NJFRYKFM.mjs → versionDeleteCommand-YFVUCYVQ.mjs} +3 -3
  29. package/build/js/{versionGetCommand-IHMNJSVC.cjs → versionGetCommand-45C2JZC4.cjs} +8 -8
  30. package/build/js/{versionGetCommand-JEYADJ77.mjs → versionGetCommand-AKPCEBQZ.mjs} +3 -3
  31. package/build/js/{versionListCommand-5C57X7XC.cjs → versionListCommand-4TM6YYNJ.cjs} +8 -8
  32. package/build/js/{versionListCommand-PKRL3YOJ.mjs → versionListCommand-6OVL7FF2.mjs} +3 -3
  33. package/build/js/{versionSetCommand-GNNIGVJO.mjs → versionSetCommand-BD3O7OAX.mjs} +3 -3
  34. package/build/js/{versionSetCommand-N2RZ26BU.cjs → versionSetCommand-FIWT6CFW.cjs} +8 -8
  35. package/build/js/{versionUnsetCommand-ADQMB7SL.cjs → versionUnsetCommand-BZ2SAFEM.cjs} +8 -8
  36. package/build/js/{versionUnsetCommand-QE6SPGJQ.mjs → versionUnsetCommand-W7ACW5O3.mjs} +3 -3
  37. package/build/types/cli.d.ts +1 -0
  38. package/build/types/cli.d.ts.map +1 -0
  39. package/build/types/commands/auth/index.d.ts +4 -4
  40. package/build/types/commands/auth/index.d.ts.map +1 -0
  41. package/build/types/commands/auth/login/index.d.ts +2 -2
  42. package/build/types/commands/auth/login/index.d.ts.map +1 -0
  43. package/build/types/commands/site/CommonSiteArgs.d.ts +2 -1
  44. package/build/types/commands/site/CommonSiteArgs.d.ts.map +1 -0
  45. package/build/types/commands/site/deploy/SiteDeployArgs.d.ts +1 -0
  46. package/build/types/commands/site/deploy/SiteDeployArgs.d.ts.map +1 -0
  47. package/build/types/commands/site/deploy/index.d.ts +1 -0
  48. package/build/types/commands/site/deploy/index.d.ts.map +1 -0
  49. package/build/types/commands/site/deploy/logDeployCommandConfigFileOverride.d.ts +1 -0
  50. package/build/types/commands/site/deploy/logDeployCommandConfigFileOverride.d.ts.map +1 -0
  51. package/build/types/commands/site/deploy/siteDeployCommand.d.mts +1 -0
  52. package/build/types/commands/site/deploy/siteDeployCommand.d.mts.map +1 -0
  53. package/build/types/commands/site/index.d.ts +2 -1
  54. package/build/types/commands/site/index.d.ts.map +1 -0
  55. package/build/types/commands/site/logSiteCommandConfigFileOverride.d.ts +1 -0
  56. package/build/types/commands/site/logSiteCommandConfigFileOverride.d.ts.map +1 -0
  57. package/build/types/commands/site/version/delete/VersionDeleteArgs.d.ts +1 -0
  58. package/build/types/commands/site/version/delete/VersionDeleteArgs.d.ts.map +1 -0
  59. package/build/types/commands/site/version/delete/index.d.ts +1 -0
  60. package/build/types/commands/site/version/delete/index.d.ts.map +1 -0
  61. package/build/types/commands/site/version/delete/versionDeleteCommand.d.mts +1 -0
  62. package/build/types/commands/site/version/delete/versionDeleteCommand.d.mts.map +1 -0
  63. package/build/types/commands/site/version/get/VersionGetArgs.d.ts +1 -0
  64. package/build/types/commands/site/version/get/VersionGetArgs.d.ts.map +1 -0
  65. package/build/types/commands/site/version/get/index.d.ts +1 -0
  66. package/build/types/commands/site/version/get/index.d.ts.map +1 -0
  67. package/build/types/commands/site/version/get/versionGetCommand.d.mts +1 -0
  68. package/build/types/commands/site/version/get/versionGetCommand.d.mts.map +1 -0
  69. package/build/types/commands/site/version/index.d.ts +1 -0
  70. package/build/types/commands/site/version/index.d.ts.map +1 -0
  71. package/build/types/commands/site/version/list/VersionListArgs.d.ts +1 -0
  72. package/build/types/commands/site/version/list/VersionListArgs.d.ts.map +1 -0
  73. package/build/types/commands/site/version/list/index.d.ts +1 -0
  74. package/build/types/commands/site/version/list/index.d.ts.map +1 -0
  75. package/build/types/commands/site/version/list/versionListCommand.d.mts +1 -0
  76. package/build/types/commands/site/version/list/versionListCommand.d.mts.map +1 -0
  77. package/build/types/commands/site/version/set/VersionSetArgs.d.ts +1 -0
  78. package/build/types/commands/site/version/set/VersionSetArgs.d.ts.map +1 -0
  79. package/build/types/commands/site/version/set/index.d.ts +1 -0
  80. package/build/types/commands/site/version/set/index.d.ts.map +1 -0
  81. package/build/types/commands/site/version/set/versionSetCommand.d.mts +1 -0
  82. package/build/types/commands/site/version/set/versionSetCommand.d.mts.map +1 -0
  83. package/build/types/commands/site/version/unset/VersionUnsetArgs.d.ts +1 -0
  84. package/build/types/commands/site/version/unset/VersionUnsetArgs.d.ts.map +1 -0
  85. package/build/types/commands/site/version/unset/index.d.ts +1 -0
  86. package/build/types/commands/site/version/unset/index.d.ts.map +1 -0
  87. package/build/types/commands/site/version/unset/versionUnsetCommand.d.mts +1 -0
  88. package/build/types/commands/site/version/unset/versionUnsetCommand.d.mts.map +1 -0
  89. package/build/types/consola/handlePromptCancel.d.ts +1 -0
  90. package/build/types/consola/handlePromptCancel.d.ts.map +1 -0
  91. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/clearDeployedVersion.d.ts +1 -0
  92. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/clearDeployedVersion.d.ts.map +1 -0
  93. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/getContentSecurityPolicyAdditions.d.ts +1 -0
  94. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/getContentSecurityPolicyAdditions.d.ts.map +1 -0
  95. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/getDeployedVersion.d.ts +1 -0
  96. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/getDeployedVersion.d.ts.map +1 -0
  97. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/getRegisteredSiteDomains.d.ts +1 -0
  98. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/getRegisteredSiteDomains.d.ts.map +1 -0
  99. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/getRequestedSiteDomains.d.ts +1 -0
  100. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/getRequestedSiteDomains.d.ts.map +1 -0
  101. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/previewContentSecurityPolicy.d.ts +1 -0
  102. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/previewContentSecurityPolicy.d.ts.map +1 -0
  103. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/putContentSecurityPolicyAdditions.d.ts +1 -0
  104. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/putContentSecurityPolicyAdditions.d.ts.map +1 -0
  105. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/requestSiteDomainForRepository.d.ts +1 -0
  106. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/requestSiteDomainForRepository.d.ts.map +1 -0
  107. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/unregisterSiteDomain.d.ts +1 -0
  108. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/unregisterSiteDomain.d.ts.map +1 -0
  109. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/updateDeployedVersion.d.ts +1 -0
  110. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service/updateDeployedVersion.d.ts.map +1 -0
  111. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service.d.ts +1 -0
  112. package/build/types/generated/artifacts-sites/ArtifactsSitesAdminV2Service.d.ts.map +1 -0
  113. package/build/types/generated/artifacts-sites/ContentSecurityPolicyAdditions.d.ts +1 -0
  114. package/build/types/generated/artifacts-sites/ContentSecurityPolicyAdditions.d.ts.map +1 -0
  115. package/build/types/generated/artifacts-sites/ContentSecurityPolicyDirectiveName.d.ts +1 -0
  116. package/build/types/generated/artifacts-sites/ContentSecurityPolicyDirectiveName.d.ts.map +1 -0
  117. package/build/types/generated/artifacts-sites/ContentSecurityPolicyDirectiveValue.d.ts +1 -0
  118. package/build/types/generated/artifacts-sites/ContentSecurityPolicyDirectiveValue.d.ts.map +1 -0
  119. package/build/types/generated/artifacts-sites/ContentSecurityPolicyHeaderValue.d.ts +1 -0
  120. package/build/types/generated/artifacts-sites/ContentSecurityPolicyHeaderValue.d.ts.map +1 -0
  121. package/build/types/generated/artifacts-sites/ControlPanelManagedDomainInfo.d.ts +1 -0
  122. package/build/types/generated/artifacts-sites/ControlPanelManagedDomainInfo.d.ts.map +1 -0
  123. package/build/types/generated/artifacts-sites/DomainName.d.ts +1 -0
  124. package/build/types/generated/artifacts-sites/DomainName.d.ts.map +1 -0
  125. package/build/types/generated/artifacts-sites/PreviewContentSecurityPolicyRequest.d.ts +1 -0
  126. package/build/types/generated/artifacts-sites/PreviewContentSecurityPolicyRequest.d.ts.map +1 -0
  127. package/build/types/generated/artifacts-sites/SiteDomainInfo.d.ts +1 -0
  128. package/build/types/generated/artifacts-sites/SiteDomainInfo.d.ts.map +1 -0
  129. package/build/types/generated/artifacts-sites/SiteDomainRegistrationRequestRid.d.ts +1 -0
  130. package/build/types/generated/artifacts-sites/SiteDomainRegistrationRequestRid.d.ts.map +1 -0
  131. package/build/types/generated/artifacts-sites/SiteVersion.d.ts +1 -0
  132. package/build/types/generated/artifacts-sites/SiteVersion.d.ts.map +1 -0
  133. package/build/types/generated/artifacts-sites/SubmitDomainRegistrationRequest.d.ts +1 -0
  134. package/build/types/generated/artifacts-sites/SubmitDomainRegistrationRequest.d.ts.map +1 -0
  135. package/build/types/generated/artifacts-sites/UnregisterDomainRequest.d.ts +1 -0
  136. package/build/types/generated/artifacts-sites/UnregisterDomainRequest.d.ts.map +1 -0
  137. package/build/types/generated/artifacts-sites/UpdateDeployedVersionRequest.d.ts +1 -0
  138. package/build/types/generated/artifacts-sites/UpdateDeployedVersionRequest.d.ts.map +1 -0
  139. package/build/types/generated/artifacts-sites/index.d.ts +1 -0
  140. package/build/types/generated/artifacts-sites/index.d.ts.map +1 -0
  141. package/build/types/index.d.ts +1 -0
  142. package/build/types/index.d.ts.map +1 -0
  143. package/build/types/net/RepositoryRid.d.ts +1 -0
  144. package/build/types/net/RepositoryRid.d.ts.map +1 -0
  145. package/build/types/net/ThirdPartyAppRid.d.ts +1 -0
  146. package/build/types/net/ThirdPartyAppRid.d.ts.map +1 -0
  147. package/build/types/net/UserAgent.d.ts +1 -0
  148. package/build/types/net/UserAgent.d.ts.map +1 -0
  149. package/build/types/net/artifacts/SiteAssetArtifactsService/DeleteSiteVersionRequest.d.mts +1 -0
  150. package/build/types/net/artifacts/SiteAssetArtifactsService/DeleteSiteVersionRequest.d.mts.map +1 -0
  151. package/build/types/net/artifacts/SiteAssetArtifactsService/SiteAssetVersions.d.mts +1 -0
  152. package/build/types/net/artifacts/SiteAssetArtifactsService/SiteAssetVersions.d.mts.map +1 -0
  153. package/build/types/net/artifacts/SiteAssetArtifactsService/UploadZippedSiteAssetRequest.d.mts +1 -0
  154. package/build/types/net/artifacts/SiteAssetArtifactsService/UploadZippedSiteAssetRequest.d.mts.map +1 -0
  155. package/build/types/net/artifacts/SiteAssetArtifactsService/deleteSiteVersion.d.mts +1 -0
  156. package/build/types/net/artifacts/SiteAssetArtifactsService/deleteSiteVersion.d.mts.map +1 -0
  157. package/build/types/net/artifacts/SiteAssetArtifactsService/fetchSiteVersions.d.mts +1 -0
  158. package/build/types/net/artifacts/SiteAssetArtifactsService/fetchSiteVersions.d.mts.map +1 -0
  159. package/build/types/net/artifacts/SiteAssetArtifactsService/getSiteAssetBaseUrl.d.mts +1 -0
  160. package/build/types/net/artifacts/SiteAssetArtifactsService/getSiteAssetBaseUrl.d.mts.map +1 -0
  161. package/build/types/net/artifacts/SiteAssetArtifactsService/index.d.mts +1 -0
  162. package/build/types/net/artifacts/SiteAssetArtifactsService/index.d.mts.map +1 -0
  163. package/build/types/net/artifacts/SiteAssetArtifactsService/uploadSiteVersion.d.mts +1 -0
  164. package/build/types/net/artifacts/SiteAssetArtifactsService/uploadSiteVersion.d.mts.map +1 -0
  165. package/build/types/net/artifacts/index.d.mts +1 -0
  166. package/build/types/net/artifacts/index.d.mts.map +1 -0
  167. package/build/types/net/createConjureContext.d.mts +1 -0
  168. package/build/types/net/createConjureContext.d.mts.map +1 -0
  169. package/build/types/net/createFetch.d.mts +1 -0
  170. package/build/types/net/createFetch.d.mts.map +1 -0
  171. package/build/types/net/createInternalClientContext.d.mts +1 -0
  172. package/build/types/net/createInternalClientContext.d.mts.map +1 -0
  173. package/build/types/net/index.d.mts +1 -0
  174. package/build/types/net/index.d.mts.map +1 -0
  175. package/build/types/net/internalClientContext.d.mts +1 -0
  176. package/build/types/net/internalClientContext.d.mts.map +1 -0
  177. package/build/types/net/third-party-application-service/fetchWebsiteRepositoryRid.d.mts +1 -0
  178. package/build/types/net/third-party-application-service/fetchWebsiteRepositoryRid.d.mts.map +1 -0
  179. package/build/types/net/third-party-application-service/index.d.mts +1 -0
  180. package/build/types/net/third-party-application-service/index.d.mts.map +1 -0
  181. package/build/types/util/autoVersion.d.ts +1 -0
  182. package/build/types/util/autoVersion.d.ts.map +1 -0
  183. package/build/types/util/autoVersion.test.d.ts +1 -0
  184. package/build/types/util/autoVersion.test.d.ts.map +1 -0
  185. package/build/types/util/config.d.ts +1 -0
  186. package/build/types/util/config.d.ts.map +1 -0
  187. package/build/types/util/config.test.d.ts +1 -0
  188. package/build/types/util/config.test.d.ts.map +1 -0
  189. package/build/types/util/configLoader.d.ts +1 -0
  190. package/build/types/util/configLoader.d.ts.map +1 -0
  191. package/build/types/util/isValidSemver.test.d.ts +1 -0
  192. package/build/types/util/isValidSemver.test.d.ts.map +1 -0
  193. package/build/types/util/token.d.ts +1 -0
  194. package/build/types/util/token.d.ts.map +1 -0
  195. package/build/types/util/token.test.d.ts +1 -0
  196. package/build/types/util/token.test.d.ts.map +1 -0
  197. package/build/types/yargs/logConfigFileMiddleware.d.ts +1 -0
  198. package/build/types/yargs/logConfigFileMiddleware.d.ts.map +1 -0
  199. package/changelog/0.15.0/pr-131.v2.yml +5 -0
  200. package/changelog/0.15.0/pr-140.v2.yml +5 -0
  201. package/changelog/0.15.0/pr-141.v2.yml +5 -0
  202. package/changelog/0.16.0/pr-143.v2.yml +5 -0
  203. package/package.json +11 -8
  204. package/build/js/chunk-CCA2T5YW.cjs +0 -12
  205. package/build/js/chunk-CCA2T5YW.cjs.map +0 -1
  206. package/build/js/chunk-CLAEREOL.mjs +0 -13
  207. package/build/js/chunk-CLAEREOL.mjs.map +0 -1
  208. package/build/js/chunk-GX2IOTA6.mjs +0 -10
  209. package/build/js/chunk-GX2IOTA6.mjs.map +0 -1
  210. package/build/js/chunk-HD6SVFKA.mjs.map +0 -1
  211. package/build/js/chunk-HZ3XILMW.cjs +0 -15
  212. package/build/js/chunk-HZ3XILMW.cjs.map +0 -1
  213. package/build/js/chunk-MU5KWUEI.mjs +0 -10
  214. package/build/js/chunk-MU5KWUEI.mjs.map +0 -1
  215. package/build/js/chunk-TZGNA5WR.cjs.map +0 -1
  216. package/build/js/chunk-UE2TMWJL.cjs +0 -12
  217. package/build/js/chunk-UE2TMWJL.cjs.map +0 -1
  218. package/build/js/handleGenerate-SKQROGSR.cjs +0 -123
  219. package/build/js/handleGenerate-SKQROGSR.cjs.map +0 -1
  220. package/build/js/handleGenerate-YUTYPPAT.mjs +0 -101
  221. package/build/js/handleGenerate-YUTYPPAT.mjs.map +0 -1
  222. package/build/js/loginFlow-5ZAMXQKE.cjs +0 -10
  223. package/build/js/loginFlow-BWWZBM36.mjs +0 -4
  224. package/build/js/siteDeployCommand-OKFLCN7L.mjs.map +0 -1
  225. package/build/js/siteDeployCommand-XWGLYIMU.cjs.map +0 -1
  226. package/build/types/CliCommonArgs.d.ts +0 -3
  227. package/build/types/ExitProcessError.d.ts +0 -6
  228. package/build/types/YargsCheckError.d.ts +0 -3
  229. package/build/types/commands/auth/CommonAuthArgs.d.ts +0 -4
  230. package/build/types/commands/auth/login/LoginArgs.d.ts +0 -4
  231. package/build/types/commands/auth/login/loginFlow.d.ts +0 -2
  232. package/build/types/commands/auth/login/token.d.ts +0 -12
  233. package/build/types/commands/typescript/generate/TypescriptGenerateArgs.d.ts +0 -10
  234. package/build/types/commands/typescript/generate/generate.d.ts +0 -4
  235. package/build/types/commands/typescript/generate/handleGenerate.d.mts +0 -2
  236. package/build/types/commands/typescript/index.d.ts +0 -4
  237. package/build/types/generated/artifacts-admin/ArtifactsAdminService/clearDeletedUserRepositories.d.ts +0 -7
  238. package/build/types/generated/artifacts-admin/ArtifactsAdminService/getContainerRegistryDomain.d.ts +0 -6
  239. package/build/types/generated/artifacts-admin/ArtifactsAdminService.d.ts +0 -2
  240. package/build/types/generated/artifacts-admin/ClearDeletedUserRepositoriesRequest.d.ts +0 -3
  241. package/build/types/generated/artifacts-admin/ContainerRegistryDomainResponse.d.ts +0 -3
  242. package/build/types/generated/artifacts-admin/index.d.ts +0 -3
  243. package/build/types/util/isValidSemver.d.ts +0 -1
  244. package/build/types/yargs/logLevelMiddleware.d.ts +0 -2
  245. /package/build/js/{loginFlow-5ZAMXQKE.cjs.map → loginFlow-QTUKYZEL.cjs.map} +0 -0
  246. /package/build/js/{loginFlow-BWWZBM36.mjs.map → loginFlow-ZFVT2AFZ.mjs.map} +0 -0
  247. /package/build/js/{versionDeleteCommand-MGKK73ZV.cjs.map → versionDeleteCommand-KQCJ7CHQ.cjs.map} +0 -0
  248. /package/build/js/{versionDeleteCommand-NJFRYKFM.mjs.map → versionDeleteCommand-YFVUCYVQ.mjs.map} +0 -0
  249. /package/build/js/{versionGetCommand-IHMNJSVC.cjs.map → versionGetCommand-45C2JZC4.cjs.map} +0 -0
  250. /package/build/js/{versionGetCommand-JEYADJ77.mjs.map → versionGetCommand-AKPCEBQZ.mjs.map} +0 -0
  251. /package/build/js/{versionListCommand-5C57X7XC.cjs.map → versionListCommand-4TM6YYNJ.cjs.map} +0 -0
  252. /package/build/js/{versionListCommand-PKRL3YOJ.mjs.map → versionListCommand-6OVL7FF2.mjs.map} +0 -0
  253. /package/build/js/{versionSetCommand-GNNIGVJO.mjs.map → versionSetCommand-BD3O7OAX.mjs.map} +0 -0
  254. /package/build/js/{versionSetCommand-N2RZ26BU.cjs.map → versionSetCommand-FIWT6CFW.cjs.map} +0 -0
  255. /package/build/js/{versionUnsetCommand-ADQMB7SL.cjs.map → versionUnsetCommand-BZ2SAFEM.cjs.map} +0 -0
  256. /package/build/js/{versionUnsetCommand-QE6SPGJQ.mjs.map → versionUnsetCommand-W7ACW5O3.mjs.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkHZ3XILMW_cjs = require('./chunk-HZ3XILMW.cjs');
3
+ var chunkAX5HH3ZN_cjs = require('./chunk-AX5HH3ZN.cjs');
4
4
  var chunkHQDDGVB7_cjs = require('./chunk-HQDDGVB7.cjs');
5
5
  var conjureLite = require('conjure-lite');
6
6
  var consola = require('consola');
@@ -72,7 +72,7 @@ chunkHQDDGVB7_cjs.__export(SiteAssetArtifactsService_exports, {
72
72
  });
73
73
 
74
74
  // src/net/UserAgent.ts
75
- var USER_AGENT = `osdk-cli/${"0.14.0"}`;
75
+ var USER_AGENT = `osdk-cli/${"0.16.0"}`;
76
76
 
77
77
  // src/net/createFetch.mts
78
78
  function createFetch(tokenProvider, fetchFn = fetch) {
@@ -90,7 +90,7 @@ function createErrorExitingFetch(fetchFn = fetch) {
90
90
  }
91
91
  function handleFetchError(e) {
92
92
  if (!(e instanceof shared_net.PalantirApiError)) {
93
- throw new chunkHZ3XILMW_cjs.ExitProcessError(1, "Unexpected fetch error");
93
+ throw new chunkAX5HH3ZN_cjs.ExitProcessError(1, "Unexpected fetch error");
94
94
  }
95
95
  let tip;
96
96
  if (e.statusCode === 401) {
@@ -102,7 +102,7 @@ function handleFetchError(e) {
102
102
  if (e.errorName === "Artifacts:ArtifactAlreadyExists") {
103
103
  message = "Version already exists";
104
104
  }
105
- throw new chunkHZ3XILMW_cjs.ExitProcessError(1, message, tip);
105
+ throw new chunkAX5HH3ZN_cjs.ExitProcessError(1, message, tip);
106
106
  }
107
107
  function createRequestLoggingFetch(fetchFn = fetch) {
108
108
  return function requestLoggingFetch(input, init) {
@@ -124,7 +124,7 @@ async function fetchWebsiteRepositoryRid(ctx, thirdPartyAppRid) {
124
124
  consola.consola.debug(`Repository RID: ${repositoryRid}`);
125
125
  return repositoryRid;
126
126
  }
127
- throw new chunkHZ3XILMW_cjs.ExitProcessError(result.status, `Unexpected response code ${result.status} (${result.statusText})`);
127
+ throw new chunkAX5HH3ZN_cjs.ExitProcessError(result.status, `Unexpected response code ${result.status} (${result.statusText})`);
128
128
  }
129
129
 
130
130
  // src/net/artifacts/SiteAssetArtifactsService/getSiteAssetBaseUrl.mts
@@ -144,7 +144,7 @@ async function deleteSiteVersion(ctx, request) {
144
144
  consola.consola.debug(`${result.status} - Status Text: '${result.statusText}'`);
145
145
  return true;
146
146
  } else {
147
- throw new chunkHZ3XILMW_cjs.ExitProcessError(result.status, `Unexpected response code ${result.status} (${result.statusText})`);
147
+ throw new chunkAX5HH3ZN_cjs.ExitProcessError(result.status, `Unexpected response code ${result.status} (${result.statusText})`);
148
148
  }
149
149
  }
150
150
 
@@ -158,7 +158,7 @@ async function fetchSiteVersions(ctx, thirdPartyAppRid) {
158
158
  const response = await result.json();
159
159
  return response.versions;
160
160
  } else {
161
- throw new chunkHZ3XILMW_cjs.ExitProcessError(result.status, `Unexpected response code ${result.status} (${result.statusText})`);
161
+ throw new chunkAX5HH3ZN_cjs.ExitProcessError(result.status, `Unexpected response code ${result.status} (${result.statusText})`);
162
162
  }
163
163
  }
164
164
  async function uploadZippedSiteAsset(ctx, request) {
@@ -178,9 +178,9 @@ async function uploadZippedSiteAsset(ctx, request) {
178
178
  consola.consola.debug("Status Text: " + result.statusText);
179
179
  return true;
180
180
  } else if (result.status === 409) {
181
- throw new chunkHZ3XILMW_cjs.ExitProcessError(result.status, "Version already exists");
181
+ throw new chunkAX5HH3ZN_cjs.ExitProcessError(result.status, "Version already exists");
182
182
  } else {
183
- throw new chunkHZ3XILMW_cjs.ExitProcessError(result.status, `Unexpected response code ${result.status} (${result.statusText})`);
183
+ throw new chunkAX5HH3ZN_cjs.ExitProcessError(result.status, `Unexpected response code ${result.status} (${result.statusText})`);
184
184
  }
185
185
  }
186
186
 
@@ -230,7 +230,7 @@ async function loadToken(token, tokenFile) {
230
230
  return environmentToken;
231
231
  }
232
232
  }
233
- throw new chunkHZ3XILMW_cjs.ExitProcessError(2, `No token found.`, `You can supply a --token or --token-file option, or set the ${TOKEN_ENV_VARS[0]} environment variable`);
233
+ throw new chunkAX5HH3ZN_cjs.ExitProcessError(2, `No token found.`, `You can supply a --token or --token-file option, or set the ${TOKEN_ENV_VARS[0]} environment variable`);
234
234
  }
235
235
  async function loadTokenFile(filePath) {
236
236
  let token;
@@ -240,7 +240,7 @@ async function loadTokenFile(filePath) {
240
240
  token = await fs.promises.readFile(resolvedPath, "utf8");
241
241
  token = token.trim();
242
242
  } catch (error) {
243
- throw new chunkHZ3XILMW_cjs.ExitProcessError(2, `Unable to read token file "${filePath}": ${error}`);
243
+ throw new chunkAX5HH3ZN_cjs.ExitProcessError(2, `Unable to read token file "${filePath}": ${error}`);
244
244
  }
245
245
  return {
246
246
  filePath: resolvedPath,
@@ -249,7 +249,7 @@ async function loadTokenFile(filePath) {
249
249
  }
250
250
  function validate(token) {
251
251
  if (!isJWT(token)) {
252
- throw new chunkHZ3XILMW_cjs.ExitProcessError(2, `Token does not appear to be a JWT`);
252
+ throw new chunkAX5HH3ZN_cjs.ExitProcessError(2, `Token does not appear to be a JWT`);
253
253
  }
254
254
  }
255
255
  function isJWT(token) {
@@ -264,4 +264,4 @@ exports.createInternalClientContext = createInternalClientContext;
264
264
  exports.loadToken = loadToken;
265
265
  exports.third_party_application_service_exports = third_party_application_service_exports;
266
266
  //# sourceMappingURL=out.js.map
267
- //# sourceMappingURL=chunk-MS72SCKG.cjs.map
267
+ //# sourceMappingURL=chunk-2KJDB4YP.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/generated/artifacts-sites/ArtifactsSitesAdminV2Service.ts","../../src/generated/artifacts-sites/ArtifactsSitesAdminV2Service/clearDeployedVersion.ts","../../src/generated/artifacts-sites/ArtifactsSitesAdminV2Service/getContentSecurityPolicyAdditions.ts","../../src/generated/artifacts-sites/ArtifactsSitesAdminV2Service/getDeployedVersion.ts","../../src/generated/artifacts-sites/ArtifactsSitesAdminV2Service/getRegisteredSiteDomains.ts","../../src/generated/artifacts-sites/ArtifactsSitesAdminV2Service/getRequestedSiteDomains.ts","../../src/generated/artifacts-sites/ArtifactsSitesAdminV2Service/previewContentSecurityPolicy.ts","../../src/generated/artifacts-sites/ArtifactsSitesAdminV2Service/putContentSecurityPolicyAdditions.ts","../../src/generated/artifacts-sites/ArtifactsSitesAdminV2Service/requestSiteDomainForRepository.ts","../../src/generated/artifacts-sites/ArtifactsSitesAdminV2Service/unregisterSiteDomain.ts","../../src/generated/artifacts-sites/ArtifactsSitesAdminV2Service/updateDeployedVersion.ts","../../src/net/artifacts/index.mts","../../src/net/artifacts/SiteAssetArtifactsService/index.mts","../../src/net/artifacts/SiteAssetArtifactsService/deleteSiteVersion.mts","../../src/net/createFetch.mts","../../src/net/UserAgent.ts","../../src/net/third-party-application-service/fetchWebsiteRepositoryRid.mts","../../src/net/artifacts/SiteAssetArtifactsService/getSiteAssetBaseUrl.mts","../../src/net/artifacts/SiteAssetArtifactsService/fetchSiteVersions.mts","../../src/net/artifacts/SiteAssetArtifactsService/uploadSiteVersion.mts","../../src/net/createConjureContext.mts","../../src/net/createInternalClientContext.mts","../../src/net/third-party-application-service/index.mts","../../src/util/token.ts"],"names":["conjureFetch","consola","fetch"],"mappings":";;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACgBA,SAAS,oBAAoB;AAQ7B,eAAsB,qBAAqB,KAAK,eAAe;AAC7D,SAAO,aAAa,KAAK,8B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C9B,MAAI,CAAC,MAAM,KAAK,GAAG;AACjB,UAAM,IAAI,iBAAiB,GAAG,mCAAmC;AAAA,EACnE;AACF;AACA,SAAS,MAAM,OAAO;AAEpB,QAAM,aAAa;AACnB,SAAO,WAAW,KAAK,KAAK;AAC9B","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { clearDeployedVersion } from \"./ArtifactsSitesAdminV2Service/clearDeployedVersion.js\";\nexport { getContentSecurityPolicyAdditions } from \"./ArtifactsSitesAdminV2Service/getContentSecurityPolicyAdditions.js\";\nexport { getDeployedVersion } from \"./ArtifactsSitesAdminV2Service/getDeployedVersion.js\";\nexport { getRegisteredSiteDomains } from \"./ArtifactsSitesAdminV2Service/getRegisteredSiteDomains.js\";\nexport { getRequestedSiteDomains } from \"./ArtifactsSitesAdminV2Service/getRequestedSiteDomains.js\";\nexport { previewContentSecurityPolicy } from \"./ArtifactsSitesAdminV2Service/previewContentSecurityPolicy.js\";\nexport { putContentSecurityPolicyAdditions } from \"./ArtifactsSitesAdminV2Service/putContentSecurityPolicyAdditions.js\";\nexport { requestSiteDomainForRepository } from \"./ArtifactsSitesAdminV2Service/requestSiteDomainForRepository.js\";\nexport { unregisterSiteDomain } from \"./ArtifactsSitesAdminV2Service/unregisterSiteDomain.js\";\nexport { updateDeployedVersion } from \"./ArtifactsSitesAdminV2Service/updateDeployedVersion.js\";","/*\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 { conjureFetch } from \"conjure-lite\";\n\n/**\n * Clears the deployed version while leaving the associated domain, visiting the associated domain in this state\n * will return an error.\n *\n * artifacts:sites:write-deployment-info permission is needed on the repository rid to call this endpoint.\n */\nexport async function clearDeployedVersion(ctx, repositoryRid) {\n return conjureFetch(ctx, `/sites/v2/admin/repository/${repositoryRid}/deployed-version`, \"DELETE\");\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Get the CSP additions configured for a repository.\n *\n * artifacts:sites:read-deployment-info permission is needed on the repository rid to call this endpoint.\n */\nexport async function getContentSecurityPolicyAdditions(ctx, repositoryRid) {\n return conjureFetch(ctx, `/sites/v2/admin/repository/${repositoryRid}/csp/additions`, \"GET\");\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Get the deployed version that will be served for a given siteasset repository.\n *\n * artifacts:sites:read-deployment-info permission is needed on the repository rid to call this endpoint.\n */\nexport async function getDeployedVersion(ctx, repositoryRid) {\n return conjureFetch(ctx, `/sites/v2/admin/repository/${repositoryRid}/deployed-version`, \"GET\");\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Get domains that have been successfully registered with the given repository. Visiting a successfully\n * registered domain should serve the registered repository assets.\n *\n * artifacts:sites:read-deployment-info permission is needed on the repository rid to call this endpoint.\n */\nexport async function getRegisteredSiteDomains(ctx, repositoryRid) {\n return conjureFetch(ctx, `/sites/v2/admin/repository/${repositoryRid}/domains/registered`, \"GET\");\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Get domains that have been requested for a given repository. For control panel domains that require\n * an approval, this will also include pending requests. Closed/rejected requests will only be included as long\n * as their domain hasn't been re-requested for another repository.\n *\n * artifacts:sites:read-deployment-info permission is needed on the repository rid to call this endpoint.\n */\nexport async function getRequestedSiteDomains(ctx, repositoryRid) {\n return conjureFetch(ctx, `/sites/v2/admin/repository/${repositoryRid}/domains/requested`, \"GET\");\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Preview what the CSP that will be served with the site looks like.\n *\n * artifacts:sites:read-deployment-info permission is needed on the repository rid to call this endpoint.\n */\nexport async function previewContentSecurityPolicy(ctx, repositoryRid, request) {\n return conjureFetch(ctx, `/sites/v2/admin/repository/${repositoryRid}/csp/preview`, \"POST\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Set the CSP additions configured for a repository.\n *\n * artifacts:sites:write-deployment-info permission is needed on the repository rid to call this endpoint.\n */\nexport async function putContentSecurityPolicyAdditions(ctx, repositoryRid, contentSecurityPolicyAdditions) {\n return conjureFetch(ctx, `/sites/v2/admin/repository/${repositoryRid}/csp/additions`, \"PUT\", contentSecurityPolicyAdditions);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Requests the registration of a domain with the provided repository, this will result in an approvals task\n * getting created for approval by an admin.\n *\n * Once the task has been approved, visiting the domain will serve the deployed version, if any is deployed.\n *\n * artifacts:sites:manage-domains permission is needed on the repository rid to call this endpoint.\n */\nexport async function requestSiteDomainForRepository(ctx, repositoryRid, request) {\n return conjureFetch(ctx, `/sites/v2/admin/repository/${repositoryRid}/domains/submit-registration`, \"POST\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Unregisters a domain from a repository, visiting the domain will no longer serve the repository assets.\n *\n * Depending on how the domain for the repository was setup, this might also result in deleting the domain\n * itself.\n *\n * artifacts:sites:manage-domains permission is needed on the repository rid to call this endpoint.\n */\nexport async function unregisterSiteDomain(ctx, repositoryRid, request) {\n return conjureFetch(ctx, `/sites/v2/admin/repository/${repositoryRid}/domains/unregister`, \"POST\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Sets the asset version of the siteasset repository that will be served.\n *\n * artifacts:sites:write-deployment-info permission is needed on the repository rid to call this endpoint.\n */\nexport async function updateDeployedVersion(ctx, repositoryRid, version) {\n return conjureFetch(ctx, `/sites/v2/admin/repository/${repositoryRid}/deployed-version`, \"PUT\", version);\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 * as SiteAssetArtifactsService from \"./SiteAssetArtifactsService/index.mjs\";","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { deleteSiteVersion } from \"./deleteSiteVersion.mjs\";\nexport { fetchSiteVersions } from \"./fetchSiteVersions.mjs\";\nexport { uploadZippedSiteAsset } from \"./uploadSiteVersion.mjs\";","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nimport { ExitProcessError } from \"../../../ExitProcessError.js\";\nimport { createFetch } from \"../../createFetch.mjs\";\nimport { fetchWebsiteRepositoryRid } from \"../../third-party-application-service/fetchWebsiteRepositoryRid.mjs\";\nimport { getSiteAssetBaseUrl } from \"./getSiteAssetBaseUrl.mjs\";\nexport async function deleteSiteVersion(ctx, request) {\n const repositoryRid = await fetchWebsiteRepositoryRid(ctx, request.application);\n const url = `${getSiteAssetBaseUrl(ctx.foundryUrl, repositoryRid)}/versions/${request.version}`;\n const fetch = createFetch(ctx.tokenProvider);\n const result = await fetch(url, {\n method: \"DELETE\"\n });\n if (result.status >= 200 && result.status < 300) {\n consola.debug(`${result.status} - Status Text: '${result.statusText}'`);\n return true;\n } else {\n throw new ExitProcessError(result.status, `Unexpected response code ${result.status} (${result.statusText})`);\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createFetchHeaderMutator, createFetchOrThrow, PalantirApiError } from \"@osdk/shared.net\";\nimport { consola } from \"consola\";\nimport { ExitProcessError } from \"../ExitProcessError.js\";\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 === \"Artifacts:ArtifactAlreadyExists\") {\n message = \"Version already exists\";\n }\n throw new ExitProcessError(1, message, tip);\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 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 { ExitProcessError } from \"../../ExitProcessError.js\";\nimport { createFetch } from \"../createFetch.mjs\";\nexport async function fetchWebsiteRepositoryRid(ctx, thirdPartyAppRid) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `\n ${ctx.foundryUrl}/third-party-application-service/api/application-websites/${thirdPartyAppRid}`;\n const result = await fetch(url);\n if (result.status >= 200 && result.status < 300) {\n const repositoryRid = await result.json();\n consola.debug(`Repository RID: ${repositoryRid}`);\n return repositoryRid;\n }\n throw new ExitProcessError(result.status, `Unexpected response code ${result.status} (${result.statusText})`);\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function getSiteAssetBaseUrl(foundryBaseUrl, repositoryRid) {\n return `${foundryBaseUrl}/artifacts/api/repositories/${repositoryRid}/contents/release/siteasset`;\n}","/*\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 \"../../../ExitProcessError.js\";\nimport { createFetch } from \"../../createFetch.mjs\";\nimport { fetchWebsiteRepositoryRid } from \"../../third-party-application-service/fetchWebsiteRepositoryRid.mjs\";\nimport { getSiteAssetBaseUrl } from \"./getSiteAssetBaseUrl.mjs\";\nexport async function fetchSiteVersions(ctx, thirdPartyAppRid) {\n const repositoryRid = await fetchWebsiteRepositoryRid(ctx, thirdPartyAppRid);\n const url = `${getSiteAssetBaseUrl(ctx.foundryUrl, repositoryRid)}/versions`;\n const fetch = createFetch(ctx.tokenProvider);\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 ExitProcessError(result.status, `Unexpected response code ${result.status} (${result.statusText})`);\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nimport { ExitProcessError } from \"../../../ExitProcessError.js\";\nimport { createFetch } from \"../../createFetch.mjs\";\nimport { fetchWebsiteRepositoryRid } from \"../../third-party-application-service/fetchWebsiteRepositoryRid.mjs\";\nimport { getSiteAssetBaseUrl } from \"./getSiteAssetBaseUrl.mjs\";\nexport async function uploadZippedSiteAsset(ctx, request) {\n const repositoryRid = await fetchWebsiteRepositoryRid(ctx, request.application);\n const url = `${getSiteAssetBaseUrl(ctx.foundryUrl, repositoryRid)}/versions/zip/${request.version}`;\n const fetch = createFetch(ctx.tokenProvider);\n const result = await fetch(url, {\n method: \"PUT\",\n body: request.zipFile,\n headers: {\n \"Content-Type\": \"application/octet-stream\"\n },\n duplex: \"half\" // Node hates me\n });\n if (result.status >= 200 && result.status < 300) {\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}","/*\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\";\nexport function createConjureContext(foundryUrl, servicePath, tokenProvider) {\n return {\n fetchFn: createFetch(tokenProvider),\n baseUrl: foundryUrl,\n servicePath\n };\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function createInternalClientContext(foundryUrl, tokenProvider) {\n return {\n tokenProvider,\n foundryUrl\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 { fetchWebsiteRepositoryRid } from \"./fetchWebsiteRepositoryRid.mjs\";","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { consola } from \"consola\";\nimport { promises as fsPromises } from \"node:fs\";\nimport path from \"node:path\";\nimport { ExitProcessError } from \"../ExitProcessError.js\";\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/generated/artifacts-sites/ArtifactsSitesAdminV2Service.ts","../../src/generated/artifacts-sites/ArtifactsSitesAdminV2Service/clearDeployedVersion.ts","../../src/generated/artifacts-sites/ArtifactsSitesAdminV2Service/getContentSecurityPolicyAdditions.ts","../../src/generated/artifacts-sites/ArtifactsSitesAdminV2Service/getDeployedVersion.ts","../../src/generated/artifacts-sites/ArtifactsSitesAdminV2Service/getRegisteredSiteDomains.ts","../../src/generated/artifacts-sites/ArtifactsSitesAdminV2Service/getRequestedSiteDomains.ts","../../src/generated/artifacts-sites/ArtifactsSitesAdminV2Service/previewContentSecurityPolicy.ts","../../src/generated/artifacts-sites/ArtifactsSitesAdminV2Service/putContentSecurityPolicyAdditions.ts","../../src/generated/artifacts-sites/ArtifactsSitesAdminV2Service/requestSiteDomainForRepository.ts","../../src/generated/artifacts-sites/ArtifactsSitesAdminV2Service/unregisterSiteDomain.ts","../../src/generated/artifacts-sites/ArtifactsSitesAdminV2Service/updateDeployedVersion.ts","../../src/net/artifacts/index.mts","../../src/net/artifacts/SiteAssetArtifactsService/index.mts","../../src/net/artifacts/SiteAssetArtifactsService/deleteSiteVersion.mts","../../src/net/createFetch.mts","../../src/net/UserAgent.ts","../../src/net/third-party-application-service/fetchWebsiteRepositoryRid.mts","../../src/net/artifacts/SiteAssetArtifactsService/getSiteAssetBaseUrl.mts","../../src/net/artifacts/SiteAssetArtifactsService/fetchSiteVersions.mts","../../src/net/artifacts/SiteAssetArtifactsService/uploadSiteVersion.mts","../../src/net/createConjureContext.mts","../../src/net/createInternalClientContext.mts","../../src/net/third-party-application-service/index.mts","../../src/util/token.ts"],"names":["conjureFetch","consola","fetch"],"mappings":";;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACgBA,SAAS,oBAAoB;AAQ7B,eAAsB,qBAAqB,KAAK,eAAe;AAC7D,SAAO,aAAa,KAAK,8BAA8B,aAAa,qBAAqB,QAAQ;AACnG;;;ACVA,SAAS,gBAAAA,qBAAoB;AAM7B,eAAsB,kCAAkC,KAAK,eAAe;AAC1E,SAAOA,cAAa,KAAK,8BAA8B,aAAa,kBAAkB,KAAK;AAC7F;;;ACRA,SAAS,gBAAAA,qBAAoB;AAM7B,eAAsB,mBAAmB,KAAK,eAAe;AAC3D,SAAOA,cAAa,KAAK,8BAA8B,aAAa,qBAAqB,KAAK;AAChG;;;ACRA,SAAS,gBAAAA,qBAAoB;AAO7B,eAAsB,yBAAyB,KAAK,eAAe;AACjE,SAAOA,cAAa,KAAK,8BAA8B,aAAa,uBAAuB,KAAK;AAClG;;;ACTA,SAAS,gBAAAA,qBAAoB;AAQ7B,eAAsB,wBAAwB,KAAK,eAAe;AAChE,SAAOA,cAAa,KAAK,8BAA8B,aAAa,sBAAsB,KAAK;AACjG;;;ACVA,SAAS,gBAAAA,qBAAoB;AAM7B,eAAsB,6BAA6B,KAAK,eAAe,SAAS;AAC9E,SAAOA,cAAa,KAAK,8BAA8B,aAAa,gBAAgB,QAAQ,OAA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AAC/D,eAAS,gBAAgB;AACzB,UAAI,WAAW,0BAA0B;AACvC,QAAAA,SAAQ,KAAK,oGAAoG;AAAA,MACnH;AACA,aAAO;AAAA,IACT;AAAA,EACF;AACA,QAAM,IAAI,iBAAiB,GAAG,mBAAmB,+DAA+D,eAAe,CAAC,CAAC,uBAAuB;AAC1J;AAOA,eAAsB,cAAc,UAAU;AAC5C,MAAI;AACJ,MAAI;AACJ,MAAI;AACF,mBAAe,KAAK,QAAQ,QAAQ;AACpC,YAAQ,MAAM,WAAW,SAAS,cAAc,MAAM;AACtD,YAAQ,MAAM,KAAK;AAAA,EACrB,SAAS,OAAO;AACd,UAAM,IAAI,iBAAiB,GAAG,8BAA8B,QAAQ,MAAM,KAAK,EAAE;AAAA,EACnF;AACA,SAAO;AAAA,IACL,UAAU;AAAA,IACV;AAAA,EACF;AACF;AACO,SAAS,SAAS,OAAO;AAC9B,MAAI,CAAC,MAAM,KAAK,GAAG;AACjB,UAAM,IAAI,iBAAiB,GAAG,mCAAmC;AAAA,EACnE;AACF;AACA,SAAS,MAAM,OAAO;AAEpB,QAAM,aAAa;AACnB,SAAO,WAAW,KAAK,KAAK;AAC9B","sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { clearDeployedVersion } from \"./ArtifactsSitesAdminV2Service/clearDeployedVersion.js\";\nexport { getContentSecurityPolicyAdditions } from \"./ArtifactsSitesAdminV2Service/getContentSecurityPolicyAdditions.js\";\nexport { getDeployedVersion } from \"./ArtifactsSitesAdminV2Service/getDeployedVersion.js\";\nexport { getRegisteredSiteDomains } from \"./ArtifactsSitesAdminV2Service/getRegisteredSiteDomains.js\";\nexport { getRequestedSiteDomains } from \"./ArtifactsSitesAdminV2Service/getRequestedSiteDomains.js\";\nexport { previewContentSecurityPolicy } from \"./ArtifactsSitesAdminV2Service/previewContentSecurityPolicy.js\";\nexport { putContentSecurityPolicyAdditions } from \"./ArtifactsSitesAdminV2Service/putContentSecurityPolicyAdditions.js\";\nexport { requestSiteDomainForRepository } from \"./ArtifactsSitesAdminV2Service/requestSiteDomainForRepository.js\";\nexport { unregisterSiteDomain } from \"./ArtifactsSitesAdminV2Service/unregisterSiteDomain.js\";\nexport { updateDeployedVersion } from \"./ArtifactsSitesAdminV2Service/updateDeployedVersion.js\";","/*\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 { conjureFetch } from \"conjure-lite\";\n\n/**\n * Clears the deployed version while leaving the associated domain, visiting the associated domain in this state\n * will return an error.\n *\n * artifacts:sites:write-deployment-info permission is needed on the repository rid to call this endpoint.\n */\nexport async function clearDeployedVersion(ctx, repositoryRid) {\n return conjureFetch(ctx, `/sites/v2/admin/repository/${repositoryRid}/deployed-version`, \"DELETE\");\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Get the CSP additions configured for a repository.\n *\n * artifacts:sites:read-deployment-info permission is needed on the repository rid to call this endpoint.\n */\nexport async function getContentSecurityPolicyAdditions(ctx, repositoryRid) {\n return conjureFetch(ctx, `/sites/v2/admin/repository/${repositoryRid}/csp/additions`, \"GET\");\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Get the deployed version that will be served for a given siteasset repository.\n *\n * artifacts:sites:read-deployment-info permission is needed on the repository rid to call this endpoint.\n */\nexport async function getDeployedVersion(ctx, repositoryRid) {\n return conjureFetch(ctx, `/sites/v2/admin/repository/${repositoryRid}/deployed-version`, \"GET\");\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Get domains that have been successfully registered with the given repository. Visiting a successfully\n * registered domain should serve the registered repository assets.\n *\n * artifacts:sites:read-deployment-info permission is needed on the repository rid to call this endpoint.\n */\nexport async function getRegisteredSiteDomains(ctx, repositoryRid) {\n return conjureFetch(ctx, `/sites/v2/admin/repository/${repositoryRid}/domains/registered`, \"GET\");\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Get domains that have been requested for a given repository. For control panel domains that require\n * an approval, this will also include pending requests. Closed/rejected requests will only be included as long\n * as their domain hasn't been re-requested for another repository.\n *\n * artifacts:sites:read-deployment-info permission is needed on the repository rid to call this endpoint.\n */\nexport async function getRequestedSiteDomains(ctx, repositoryRid) {\n return conjureFetch(ctx, `/sites/v2/admin/repository/${repositoryRid}/domains/requested`, \"GET\");\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Preview what the CSP that will be served with the site looks like.\n *\n * artifacts:sites:read-deployment-info permission is needed on the repository rid to call this endpoint.\n */\nexport async function previewContentSecurityPolicy(ctx, repositoryRid, request) {\n return conjureFetch(ctx, `/sites/v2/admin/repository/${repositoryRid}/csp/preview`, \"POST\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Set the CSP additions configured for a repository.\n *\n * artifacts:sites:write-deployment-info permission is needed on the repository rid to call this endpoint.\n */\nexport async function putContentSecurityPolicyAdditions(ctx, repositoryRid, contentSecurityPolicyAdditions) {\n return conjureFetch(ctx, `/sites/v2/admin/repository/${repositoryRid}/csp/additions`, \"PUT\", contentSecurityPolicyAdditions);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Requests the registration of a domain with the provided repository, this will result in an approvals task\n * getting created for approval by an admin.\n *\n * Once the task has been approved, visiting the domain will serve the deployed version, if any is deployed.\n *\n * artifacts:sites:manage-domains permission is needed on the repository rid to call this endpoint.\n */\nexport async function requestSiteDomainForRepository(ctx, repositoryRid, request) {\n return conjureFetch(ctx, `/sites/v2/admin/repository/${repositoryRid}/domains/submit-registration`, \"POST\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Unregisters a domain from a repository, visiting the domain will no longer serve the repository assets.\n *\n * Depending on how the domain for the repository was setup, this might also result in deleting the domain\n * itself.\n *\n * artifacts:sites:manage-domains permission is needed on the repository rid to call this endpoint.\n */\nexport async function unregisterSiteDomain(ctx, repositoryRid, request) {\n return conjureFetch(ctx, `/sites/v2/admin/repository/${repositoryRid}/domains/unregister`, \"POST\", request);\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 { conjureFetch } from \"conjure-lite\";\n/**\n * Sets the asset version of the siteasset repository that will be served.\n *\n * artifacts:sites:write-deployment-info permission is needed on the repository rid to call this endpoint.\n */\nexport async function updateDeployedVersion(ctx, repositoryRid, version) {\n return conjureFetch(ctx, `/sites/v2/admin/repository/${repositoryRid}/deployed-version`, \"PUT\", version);\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 * as SiteAssetArtifactsService from \"./SiteAssetArtifactsService/index.mjs\";","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { deleteSiteVersion } from \"./deleteSiteVersion.mjs\";\nexport { fetchSiteVersions } from \"./fetchSiteVersions.mjs\";\nexport { uploadZippedSiteAsset } from \"./uploadSiteVersion.mjs\";","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ExitProcessError } from \"@osdk/cli.common\";\nimport { consola } from \"consola\";\nimport { createFetch } from \"../../createFetch.mjs\";\nimport { fetchWebsiteRepositoryRid } from \"../../third-party-application-service/fetchWebsiteRepositoryRid.mjs\";\nimport { getSiteAssetBaseUrl } from \"./getSiteAssetBaseUrl.mjs\";\nexport async function deleteSiteVersion(ctx, request) {\n const repositoryRid = await fetchWebsiteRepositoryRid(ctx, request.application);\n const url = `${getSiteAssetBaseUrl(ctx.foundryUrl, repositoryRid)}/versions/${request.version}`;\n const fetch = createFetch(ctx.tokenProvider);\n const result = await fetch(url, {\n method: \"DELETE\"\n });\n if (result.status >= 200 && result.status < 300) {\n consola.debug(`${result.status} - Status Text: '${result.statusText}'`);\n return true;\n } else {\n throw new ExitProcessError(result.status, `Unexpected response code ${result.status} (${result.statusText})`);\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\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 === \"Artifacts:ArtifactAlreadyExists\") {\n message = \"Version already exists\";\n }\n throw new ExitProcessError(1, message, tip);\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 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 { createFetch } from \"../createFetch.mjs\";\nexport async function fetchWebsiteRepositoryRid(ctx, thirdPartyAppRid) {\n const fetch = createFetch(ctx.tokenProvider);\n const url = `\n ${ctx.foundryUrl}/third-party-application-service/api/application-websites/${thirdPartyAppRid}`;\n const result = await fetch(url);\n if (result.status >= 200 && result.status < 300) {\n const repositoryRid = await result.json();\n consola.debug(`Repository RID: ${repositoryRid}`);\n return repositoryRid;\n }\n throw new ExitProcessError(result.status, `Unexpected response code ${result.status} (${result.statusText})`);\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function getSiteAssetBaseUrl(foundryBaseUrl, repositoryRid) {\n return `${foundryBaseUrl}/artifacts/api/repositories/${repositoryRid}/contents/release/siteasset`;\n}","/*\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 { createFetch } from \"../../createFetch.mjs\";\nimport { fetchWebsiteRepositoryRid } from \"../../third-party-application-service/fetchWebsiteRepositoryRid.mjs\";\nimport { getSiteAssetBaseUrl } from \"./getSiteAssetBaseUrl.mjs\";\nexport async function fetchSiteVersions(ctx, thirdPartyAppRid) {\n const repositoryRid = await fetchWebsiteRepositoryRid(ctx, thirdPartyAppRid);\n const url = `${getSiteAssetBaseUrl(ctx.foundryUrl, repositoryRid)}/versions`;\n const fetch = createFetch(ctx.tokenProvider);\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 ExitProcessError(result.status, `Unexpected response code ${result.status} (${result.statusText})`);\n }\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ExitProcessError } from \"@osdk/cli.common\";\nimport { consola } from \"consola\";\nimport { createFetch } from \"../../createFetch.mjs\";\nimport { fetchWebsiteRepositoryRid } from \"../../third-party-application-service/fetchWebsiteRepositoryRid.mjs\";\nimport { getSiteAssetBaseUrl } from \"./getSiteAssetBaseUrl.mjs\";\nexport async function uploadZippedSiteAsset(ctx, request) {\n const repositoryRid = await fetchWebsiteRepositoryRid(ctx, request.application);\n const url = `${getSiteAssetBaseUrl(ctx.foundryUrl, repositoryRid)}/versions/zip/${request.version}`;\n const fetch = createFetch(ctx.tokenProvider);\n const result = await fetch(url, {\n method: \"PUT\",\n body: request.zipFile,\n headers: {\n \"Content-Type\": \"application/octet-stream\"\n },\n duplex: \"half\" // Node hates me\n });\n if (result.status >= 200 && result.status < 300) {\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}","/*\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\";\nexport function createConjureContext(foundryUrl, servicePath, tokenProvider) {\n return {\n fetchFn: createFetch(tokenProvider),\n baseUrl: foundryUrl,\n servicePath\n };\n}","/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport function createInternalClientContext(foundryUrl, tokenProvider) {\n return {\n tokenProvider,\n foundryUrl\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 { fetchWebsiteRepositoryRid } from \"./fetchWebsiteRepositoryRid.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}"]}
@@ -0,0 +1,73 @@
1
+ 'use strict';
2
+
3
+ var consola = require('consola');
4
+ var utils = require('consola/utils');
5
+ var yargs = require('yargs');
6
+ var helpers = require('yargs/helpers');
7
+ var semver = require('semver');
8
+
9
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
10
+
11
+ var yargs__default = /*#__PURE__*/_interopDefault(yargs);
12
+
13
+ // ../cli.common/build/js/index.mjs
14
+ var ExitProcessError = class extends Error {
15
+ constructor(errorCode, msg, tip) {
16
+ super(msg);
17
+ this.errorCode = errorCode;
18
+ this.msg = msg;
19
+ this.tip = tip;
20
+ }
21
+ };
22
+ var firstTime = true;
23
+ async function logLevelMiddleware(args) {
24
+ if (firstTime) {
25
+ firstTime = false;
26
+ consola.consola.level = 3 + args.verbose;
27
+ if (consola.consola.level > 3) {
28
+ consola.consola.debug(`Verbose logging enabled (${consola.consola.level === 4 ? "debug" : "trace"})
29
+ `);
30
+ }
31
+ }
32
+ }
33
+ var YargsCheckError = class extends Error {
34
+ constructor(msg) {
35
+ super(msg);
36
+ }
37
+ };
38
+ function getYargsBase(args) {
39
+ return yargs__default.default(helpers.hideBin(args)).wrap(Math.min(150, yargs__default.default().terminalWidth())).env("OSDK").version(false).option("verbose", {
40
+ alias: "v",
41
+ type: "boolean",
42
+ description: "Enable verbose logging",
43
+ count: true
44
+ }).demandCommand().middleware(logLevelMiddleware, true).strict().fail(async (msg, err, argv) => {
45
+ if (err instanceof ExitProcessError) {
46
+ consola.consola.error(err.message);
47
+ if (err.tip != null) {
48
+ consola.consola.log(utils.colorize("bold", `\u{1F4A1} Tip: ${err.tip}`));
49
+ consola.consola.log("");
50
+ }
51
+ consola.consola.debug(err.stack);
52
+ } else {
53
+ if (err && err instanceof YargsCheckError === false) {
54
+ throw err;
55
+ } else {
56
+ argv.showHelp();
57
+ consola.consola.log("");
58
+ consola.consola.error(msg);
59
+ }
60
+ }
61
+ process.exit(1);
62
+ });
63
+ }
64
+ function isValidSemver(semverString) {
65
+ return semver.valid(semverString) != null;
66
+ }
67
+
68
+ exports.ExitProcessError = ExitProcessError;
69
+ exports.YargsCheckError = YargsCheckError;
70
+ exports.getYargsBase = getYargsBase;
71
+ exports.isValidSemver = isValidSemver;
72
+ //# sourceMappingURL=out.js.map
73
+ //# sourceMappingURL=chunk-AX5HH3ZN.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../cli.common/build/js/index.mjs"],"names":[],"mappings":";AAAA,SAAS,eAAe;AACxB,SAAS,gBAAgB;AACzB,OAAO,WAAW;AAClB,SAAS,eAAe;AACxB,SAAS,aAAa;AAGtB,IAAI,mBAAmB,cAAc,MAAM;AAAA,EACzC,YAAY,WAAW,KAAK,KAAK;AAC/B,UAAM,GAAG;AACT,SAAK,YAAY;AACjB,SAAK,MAAM;AACX,SAAK,MAAM;AAAA,EACb;AACF;AACA,IAAI,YAAY;AAChB,eAAe,mBAAmB,MAAM;AACtC,MAAI,WAAW;AACb,gBAAY;AACZ,YAAQ,QAAQ,IAAI,KAAK;AACzB,QAAI,QAAQ,QAAQ,GAAG;AACrB,cAAQ,MAAM,4BAA4B,QAAQ,UAAU,IAAI,UAAU,OAAO;AAAA,CACtF;AAAA,IACG;AAAA,EACF;AACF;AAGA,IAAI,kBAAkB,cAAc,MAAM;AAAA,EACxC,YAAY,KAAK;AACf,UAAM,GAAG;AAAA,EACX;AACF;AAGA,SAAS,aAAa,MAAM;AAC1B,SAAO,MAAM,QAAQ,IAAI,CAAC,EAAE,KAAK,KAAK,IAAI,KAAK,MAAM,EAAE,cAAc,CAAC,CAAC,EAAE,IAAI,MAAM,EAAE,QAAQ,KAAK,EAAE,OAAO,WAAW;AAAA,IACpH,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,OAAO;AAAA,EACT,CAAC,EAAE,cAAc,EAAE,WAAW,oBAAoB,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,KAAK,KAAK,SAAS;AAC9F,QAAI,eAAe,kBAAkB;AACnC,cAAQ,MAAM,IAAI,OAAO;AACzB,UAAI,IAAI,OAAO,MAAM;AACnB,gBAAQ,IAAI,SAAS,QAAQ,kBAAkB,IAAI,GAAG,EAAE,CAAC;AACzD,gBAAQ,IAAI,EAAE;AAAA,MAChB;AACA,cAAQ,MAAM,IAAI,KAAK;AAAA,IACzB,OAAO;AACL,UAAI,OAAO,eAAe,oBAAoB,OAAO;AACnD,cAAM;AAAA,MACR,OAAO;AACL,aAAK,SAAS;AACd,gBAAQ,IAAI,EAAE;AACd,gBAAQ,MAAM,GAAG;AAAA,MACnB;AAAA,IACF;AACA,YAAQ,KAAK,CAAC;AAAA,EAChB,CAAC;AACH;AACA,SAAS,cAAc,cAAc;AACnC,SAAO,MAAM,YAAY,KAAK;AAChC","sourcesContent":["import { consola } from 'consola';\nimport { colorize } from 'consola/utils';\nimport yargs from 'yargs';\nimport { hideBin } from 'yargs/helpers';\nimport { valid } from 'semver';\n\n// src/ExitProcessError.ts\nvar ExitProcessError = class extends Error {\n constructor(errorCode, msg, tip) {\n super(msg);\n this.errorCode = errorCode;\n this.msg = msg;\n this.tip = tip;\n }\n};\nvar firstTime = true;\nasync function logLevelMiddleware(args) {\n if (firstTime) {\n firstTime = false;\n consola.level = 3 + args.verbose;\n if (consola.level > 3) {\n consola.debug(`Verbose logging enabled (${consola.level === 4 ? \"debug\" : \"trace\"})\n`);\n }\n }\n}\n\n// src/YargsCheckError.ts\nvar YargsCheckError = class extends Error {\n constructor(msg) {\n super(msg);\n }\n};\n\n// src/getYargsBase.ts\nfunction getYargsBase(args) {\n return yargs(hideBin(args)).wrap(Math.min(150, yargs().terminalWidth())).env(\"OSDK\").version(false).option(\"verbose\", {\n alias: \"v\",\n type: \"boolean\",\n description: \"Enable verbose logging\",\n count: true\n }).demandCommand().middleware(logLevelMiddleware, true).strict().fail(async (msg, err, argv) => {\n if (err instanceof ExitProcessError) {\n consola.error(err.message);\n if (err.tip != null) {\n consola.log(colorize(\"bold\", `\\u{1F4A1} Tip: ${err.tip}`));\n consola.log(\"\");\n }\n consola.debug(err.stack);\n } else {\n if (err && err instanceof YargsCheckError === false) {\n throw err;\n } else {\n argv.showHelp();\n consola.log(\"\");\n consola.error(msg);\n }\n }\n process.exit(1);\n });\n}\nfunction isValidSemver(semverString) {\n return valid(semverString) != null;\n}\nexport { ExitProcessError, YargsCheckError, getYargsBase, isValidSemver };"]}
@@ -3,24 +3,20 @@
3
3
  var consola = require('consola');
4
4
  var crypto = require('crypto');
5
5
  var http = require('http');
6
- var open = require('open');
7
6
  var posix = require('path/posix');
8
7
  var process = require('process');
9
8
  var url = require('url');
9
+ var open = require('open');
10
10
 
11
11
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
12
12
 
13
13
  var consola__default = /*#__PURE__*/_interopDefault(consola);
14
14
  var open__default = /*#__PURE__*/_interopDefault(open);
15
15
 
16
- // src/commands/auth/login/loginFlow.ts
17
-
18
- // src/commands/auth/login/token.ts
16
+ // ../cli.common/build/js/public/loginFlow.mjs
19
17
  function isTokenErrorResponse(response) {
20
18
  return response.error != null;
21
19
  }
22
-
23
- // src/commands/auth/login/loginFlow.ts
24
20
  var BROWSER_PROMPT_TIME_MS = 60 * 1e3;
25
21
  async function invokeLoginFlow(args) {
26
22
  consola__default.default.start(`Authenticating using application id: ${args.clientId}`);
@@ -126,4 +122,4 @@ async function getTokenWithCodeVerifier(clientId, redirectUrl, code, baseUrl, co
126
122
 
127
123
  exports.invokeLoginFlow = invokeLoginFlow;
128
124
  //# sourceMappingURL=out.js.map
129
- //# sourceMappingURL=chunk-TZGNA5WR.cjs.map
125
+ //# sourceMappingURL=chunk-EVW4VRJL.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../cli.common/build/js/public/loginFlow.mjs"],"names":[],"mappings":";AAAA,OAAO,aAAa;AACpB,SAAS,iBAAiB,cAAc;AACxC,SAAS,oBAAoB;AAC7B,SAAS,YAAY;AACrB,SAAS,YAAY;AACrB,SAAS,aAAa;AACtB,OAAO,UAAU;AAKjB,SAAS,qBAAqB,UAAU;AACtC,SAAO,SAAS,SAAS;AAC3B;AAGA,IAAI,yBAAyB,KAAK;AAClC,eAAe,gBAAgB,MAAM;AACnC,UAA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AK,OAAO,cAAc,oBAAoB;AAC9C,OAAK,OAAO,QAAQ,IAAI;AACxB,OAAK,OAAO,gBAAgB,WAAW;AACvC,OAAK,OAAO,iBAAiB,YAAY;AACzC,QAAM,WAAW,KAAK,SAAS,aAAa,OAAO,UAAU,OAAO,IAAI,UAAU,YAAY;AAC9F,MAAI;AACF,UAAM,WAAW,MAAM,MAAM,UAAU;AAAA,MACrC,MAAM,KAAK,SAAS;AAAA,MACpB,SAAS;AAAA,QACP,gBAAgB;AAAA,MAClB;AAAA,MACA,QAAQ;AAAA,IACV,CAAC;AACD,UAAM,eAAe,MAAM,SAAS,KAAK;AACzC,WAAO;AAAA,EACT,SAAS,GAAG;AACV,UAAM,IAAI,MAAM,wBAAwB,GAAG,OAAO,SAAS,KAAK,GAAG,SAAS,KAAK,eAAe,EAAE;AAAA,EACpG;AACF","sourcesContent":["import consola from 'consola';\nimport { getRandomValues, subtle } from 'crypto';\nimport { createServer } from 'http';\nimport { join } from 'path/posix';\nimport { exit } from 'process';\nimport { parse } from 'url';\nimport open from 'open';\n\n// src/commands/auth/login/loginFlow.ts\n\n// src/commands/auth/login/token.ts\nfunction isTokenErrorResponse(response) {\n return response.error != null;\n}\n\n// src/commands/auth/login/loginFlow.ts\nvar BROWSER_PROMPT_TIME_MS = 60 * 1e3;\nasync function invokeLoginFlow(args) {\n consola.start(`Authenticating using application id: ${args.clientId}`);\n const redirectUrl = \"http://localhost:8080/auth/callback\";\n const port = parse(redirectUrl).port;\n let resolve;\n const authCode = new Promise(_res => {\n resolve = _res;\n });\n const server = createServer((req, res) => {\n const query = parse(req.url, true).query;\n res.end(\"Authenticated\");\n resolve(query[\"code\"]);\n });\n server.on(\"error\", e => {\n if (e.code === \"EADDRINUSE\") {\n consola.error(`Port ${port} is already in use, unable to perform authentication flow.`);\n server.close();\n exit(1);\n }\n });\n server.listen(port);\n const clientId = args.clientId;\n const state = generateRandomString();\n const codeVerifier = generateRandomString();\n const codeChallenge = await generateCodeChallenge(codeVerifier);\n const authorizeUrl = generateAuthorizeUrl(args.foundryUrl, clientId, state, redirectUrl, codeChallenge);\n try {\n await open(authorizeUrl);\n } catch {\n consola.warn(`Unable to open browser, please open this url in your browser to to authenticate: ${authorizeUrl}`);\n }\n const browserPrompt = setTimeout(() => {\n consola.warn(`Still waiting for the authentication to complete. Please open a browser to ${authorizeUrl}`);\n }, BROWSER_PROMPT_TIME_MS);\n const code = await authCode;\n server.close();\n clearTimeout(browserPrompt);\n const token = await getTokenWithCodeVerifier(clientId, redirectUrl, code, args.foundryUrl, codeVerifier);\n if (isTokenErrorResponse(token)) {\n consola.error(\"Unable to authenticate\", token.error, token.error_description);\n exit(1);\n }\n consola.success(`Successfully authenticated!`);\n return token;\n}\nfunction generateRandomString(length = 128) {\n const characters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~\";\n let output = [];\n let array = new Uint8Array(1);\n const maxIndex = 256 - 256 % characters.length;\n while (output.length < length) {\n getRandomValues(array);\n if (array[0] < maxIndex) {\n output.push(characters[array[0] % characters.length]);\n }\n }\n return output.join(\"\");\n}\nasync function generateCodeChallenge(codeVerifier) {\n const data = new TextEncoder().encode(codeVerifier);\n const digest = await subtle.digest(\"SHA-256\", data);\n const codeChallengeMethod = \"S256\";\n const codeChallenge = btoa(String.fromCharCode(...new Uint8Array(digest))).replace(/\\//g, \"_\").replace(/\\+/g, \"-\").replace(/=/g, \"\");\n return {\n codeChallenge,\n codeChallengeMethod\n };\n}\nfunction generateAuthorizeUrl(baseUrl, clientId, state, redirectUrl, codeChallenge) {\n const queryParams = new URLSearchParams();\n queryParams.append(\"client_id\", clientId);\n queryParams.append(\"response_type\", \"code\");\n queryParams.append(\"state\", state);\n queryParams.append(\"redirect_uri\", redirectUrl);\n queryParams.append(\"code_challenge\", codeChallenge.codeChallenge);\n queryParams.append(\"code_challenge_method\", codeChallenge.codeChallengeMethod);\n queryParams.append(\"scope\", [\"offline_access\", \"api:read-data\"].join(\" \"));\n return join(baseUrl, \"multipass\", \"api\", \"oauth2\", \"authorize\") + `?` + queryParams.toString();\n}\nasync function getTokenWithCodeVerifier(clientId, redirectUrl, code, baseUrl, codeVerifier) {\n const body = new URLSearchParams();\n body.append(\"client_id\", clientId);\n body.append(\"grant_type\", \"authorization_code\");\n body.append(\"code\", code);\n body.append(\"redirect_uri\", redirectUrl);\n body.append(\"code_verifier\", codeVerifier);\n const tokenUrl = join(baseUrl, \"multipass\", \"api\", \"oauth2\", \"token\") + `?state=${codeVerifier}`;\n try {\n const response = await fetch(tokenUrl, {\n body: body.toString(),\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\"\n },\n method: \"POST\"\n });\n const responseText = await response.json();\n return responseText;\n } catch (e) {\n throw new Error(`Failed to get token: ${e?.cause?.toString() ?? e?.toString() ?? \"Unknown error\"}`);\n }\n}\nexport { invokeLoginFlow as default };"]}
@@ -1,4 +1,4 @@
1
- import { ExitProcessError } from './chunk-CLAEREOL.mjs';
1
+ import { ExitProcessError } from './chunk-MTJA6DOB.mjs';
2
2
  import { __export } from './chunk-E2SEJZTC.mjs';
3
3
  import { conjureFetch } from 'conjure-lite';
4
4
  import { consola } from 'consola';
@@ -66,7 +66,7 @@ __export(SiteAssetArtifactsService_exports, {
66
66
  });
67
67
 
68
68
  // src/net/UserAgent.ts
69
- var USER_AGENT = `osdk-cli/${"0.14.0"}`;
69
+ var USER_AGENT = `osdk-cli/${"0.16.0"}`;
70
70
 
71
71
  // src/net/createFetch.mts
72
72
  function createFetch(tokenProvider, fetchFn = fetch) {
@@ -253,4 +253,4 @@ function isJWT(token) {
253
253
 
254
254
  export { ArtifactsSitesAdminV2Service_exports, artifacts_exports, createConjureContext, createInternalClientContext, loadToken, third_party_application_service_exports };
255
255
  //# sourceMappingURL=out.js.map
256
- //# sourceMappingURL=chunk-4ZJAXFFT.mjs.map
256
+ //# sourceMappingURL=chunk-JTZ7GUB4.mjs.map