@osdk/cli 0.24.0-beta.12 → 0.24.0-beta.13

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 (420) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/build/browser/cli.d.ts +7 -0
  3. package/build/browser/cli.d.ts.map +1 -0
  4. package/build/browser/cli.js +42 -0
  5. package/build/browser/cli.js.map +1 -0
  6. package/build/browser/commands/auth/index.d.ts +5 -0
  7. package/build/browser/commands/auth/index.d.ts.map +1 -0
  8. package/build/browser/commands/auth/index.js +34 -0
  9. package/build/browser/commands/auth/index.js.map +1 -0
  10. package/build/browser/commands/auth/login/index.d.ts +5 -0
  11. package/build/browser/commands/auth/login/index.d.ts.map +1 -0
  12. package/build/browser/commands/auth/login/index.js +34 -0
  13. package/build/browser/commands/auth/login/index.js.map +1 -0
  14. package/build/browser/commands/site/CommonSiteArgs.d.ts +9 -0
  15. package/build/browser/commands/site/CommonSiteArgs.d.ts.map +1 -0
  16. package/build/browser/commands/site/CommonSiteArgs.js +17 -0
  17. package/build/browser/commands/site/CommonSiteArgs.js.map +1 -0
  18. package/build/browser/commands/site/deploy/SiteDeployArgs.d.ts +10 -0
  19. package/build/browser/commands/site/deploy/SiteDeployArgs.d.ts.map +1 -0
  20. package/build/browser/commands/site/deploy/SiteDeployArgs.js +17 -0
  21. package/build/browser/commands/site/deploy/SiteDeployArgs.js.map +1 -0
  22. package/build/browser/commands/site/deploy/index.d.ts +6 -0
  23. package/build/browser/commands/site/deploy/index.d.ts.map +1 -0
  24. package/build/browser/commands/site/deploy/index.js +108 -0
  25. package/build/browser/commands/site/deploy/index.js.map +1 -0
  26. package/build/browser/commands/site/deploy/logDeployCommandConfigFileOverride.d.ts +5 -0
  27. package/build/browser/commands/site/deploy/logDeployCommandConfigFileOverride.d.ts.map +1 -0
  28. package/build/browser/commands/site/deploy/logDeployCommandConfigFileOverride.js +28 -0
  29. package/build/browser/commands/site/deploy/logDeployCommandConfigFileOverride.js.map +1 -0
  30. package/build/browser/commands/site/deploy/siteDeployCommand.d.mts +10 -0
  31. package/build/browser/commands/site/deploy/siteDeployCommand.d.mts.map +1 -0
  32. package/build/browser/commands/site/deploy/siteDeployCommand.js +98 -0
  33. package/build/browser/commands/site/deploy/siteDeployCommand.js.map +1 -0
  34. package/build/browser/commands/site/deploy/siteDeployCommand.mjs +90 -0
  35. package/build/browser/commands/site/index.d.ts +6 -0
  36. package/build/browser/commands/site/index.d.ts.map +1 -0
  37. package/build/browser/commands/site/index.js +69 -0
  38. package/build/browser/commands/site/index.js.map +1 -0
  39. package/build/browser/commands/site/logSiteCommandConfigFileOverride.d.ts +5 -0
  40. package/build/browser/commands/site/logSiteCommandConfigFileOverride.d.ts.map +1 -0
  41. package/build/browser/commands/site/logSiteCommandConfigFileOverride.js +25 -0
  42. package/build/browser/commands/site/logSiteCommandConfigFileOverride.js.map +1 -0
  43. package/build/browser/commands/site/version/delete/VersionDeleteArgs.d.ts +6 -0
  44. package/build/browser/commands/site/version/delete/VersionDeleteArgs.d.ts.map +1 -0
  45. package/build/browser/commands/site/version/delete/VersionDeleteArgs.js +17 -0
  46. package/build/browser/commands/site/version/delete/VersionDeleteArgs.js.map +1 -0
  47. package/build/browser/commands/site/version/delete/index.d.ts +6 -0
  48. package/build/browser/commands/site/version/delete/index.d.ts.map +1 -0
  49. package/build/browser/commands/site/version/delete/index.js +36 -0
  50. package/build/browser/commands/site/version/delete/index.js.map +1 -0
  51. package/build/browser/commands/site/version/delete/versionDeleteCommand.d.mts +3 -0
  52. package/build/browser/commands/site/version/delete/versionDeleteCommand.d.mts.map +1 -0
  53. package/build/browser/commands/site/version/delete/versionDeleteCommand.js +41 -0
  54. package/build/browser/commands/site/version/delete/versionDeleteCommand.js.map +1 -0
  55. package/build/browser/commands/site/version/delete/versionDeleteCommand.mjs +32 -0
  56. package/build/browser/commands/site/version/get/VersionGetArgs.d.ts +4 -0
  57. package/build/browser/commands/site/version/get/VersionGetArgs.d.ts.map +1 -0
  58. package/build/browser/commands/site/version/get/VersionGetArgs.js +17 -0
  59. package/build/browser/commands/site/version/get/VersionGetArgs.js.map +1 -0
  60. package/build/browser/commands/site/version/get/index.d.ts +6 -0
  61. package/build/browser/commands/site/version/get/index.d.ts.map +1 -0
  62. package/build/browser/commands/site/version/get/index.js +28 -0
  63. package/build/browser/commands/site/version/get/index.js.map +1 -0
  64. package/build/browser/commands/site/version/get/versionGetCommand.d.mts +3 -0
  65. package/build/browser/commands/site/version/get/versionGetCommand.d.mts.map +1 -0
  66. package/build/browser/commands/site/version/get/versionGetCommand.js +36 -0
  67. package/build/browser/commands/site/version/get/versionGetCommand.js.map +1 -0
  68. package/build/browser/commands/site/version/get/versionGetCommand.mjs +32 -0
  69. package/build/browser/commands/site/version/index.d.ts +5 -0
  70. package/build/browser/commands/site/version/index.d.ts.map +1 -0
  71. package/build/browser/commands/site/version/index.js +30 -0
  72. package/build/browser/commands/site/version/index.js.map +1 -0
  73. package/build/browser/commands/site/version/list/VersionListArgs.d.ts +4 -0
  74. package/build/browser/commands/site/version/list/VersionListArgs.d.ts.map +1 -0
  75. package/build/browser/commands/site/version/list/VersionListArgs.js +17 -0
  76. package/build/browser/commands/site/version/list/VersionListArgs.js.map +1 -0
  77. package/build/browser/commands/site/version/list/index.d.ts +6 -0
  78. package/build/browser/commands/site/version/list/index.d.ts.map +1 -0
  79. package/build/browser/commands/site/version/list/index.js +28 -0
  80. package/build/browser/commands/site/version/list/index.js.map +1 -0
  81. package/build/browser/commands/site/version/list/versionListCommand.d.mts +3 -0
  82. package/build/browser/commands/site/version/list/versionListCommand.d.mts.map +1 -0
  83. package/build/browser/commands/site/version/list/versionListCommand.js +41 -0
  84. package/build/browser/commands/site/version/list/versionListCommand.js.map +1 -0
  85. package/build/browser/commands/site/version/list/versionListCommand.mjs +42 -0
  86. package/build/browser/commands/site/version/set/VersionSetArgs.d.ts +5 -0
  87. package/build/browser/commands/site/version/set/VersionSetArgs.d.ts.map +1 -0
  88. package/build/browser/commands/site/version/set/VersionSetArgs.js +17 -0
  89. package/build/browser/commands/site/version/set/VersionSetArgs.js.map +1 -0
  90. package/build/browser/commands/site/version/set/index.d.ts +6 -0
  91. package/build/browser/commands/site/version/set/index.d.ts.map +1 -0
  92. package/build/browser/commands/site/version/set/index.js +32 -0
  93. package/build/browser/commands/site/version/set/index.js.map +1 -0
  94. package/build/browser/commands/site/version/set/versionSetCommand.d.mts +3 -0
  95. package/build/browser/commands/site/version/set/versionSetCommand.d.mts.map +1 -0
  96. package/build/browser/commands/site/version/set/versionSetCommand.js +36 -0
  97. package/build/browser/commands/site/version/set/versionSetCommand.js.map +1 -0
  98. package/build/browser/commands/site/version/set/versionSetCommand.mjs +28 -0
  99. package/build/browser/commands/site/version/unset/VersionUnsetArgs.d.ts +5 -0
  100. package/build/browser/commands/site/version/unset/VersionUnsetArgs.d.ts.map +1 -0
  101. package/build/browser/commands/site/version/unset/VersionUnsetArgs.js +17 -0
  102. package/build/browser/commands/site/version/unset/VersionUnsetArgs.js.map +1 -0
  103. package/build/browser/commands/site/version/unset/index.d.ts +6 -0
  104. package/build/browser/commands/site/version/unset/index.d.ts.map +1 -0
  105. package/build/browser/commands/site/version/unset/index.js +32 -0
  106. package/build/browser/commands/site/version/unset/index.js.map +1 -0
  107. package/build/browser/commands/site/version/unset/versionUnsetCommand.d.mts +3 -0
  108. package/build/browser/commands/site/version/unset/versionUnsetCommand.d.mts.map +1 -0
  109. package/build/browser/commands/site/version/unset/versionUnsetCommand.js +40 -0
  110. package/build/browser/commands/site/version/unset/versionUnsetCommand.js.map +1 -0
  111. package/build/browser/commands/site/version/unset/versionUnsetCommand.mjs +32 -0
  112. package/build/browser/consola/handlePromptCancel.d.ts +2 -0
  113. package/build/browser/consola/handlePromptCancel.d.ts.map +1 -0
  114. package/build/browser/consola/handlePromptCancel.js +25 -0
  115. package/build/browser/consola/handlePromptCancel.js.map +1 -0
  116. package/build/browser/index.d.ts +2 -0
  117. package/build/browser/index.d.ts.map +1 -0
  118. package/build/browser/index.js +16 -588
  119. package/build/browser/index.js.map +1 -1
  120. package/build/browser/net/ThirdPartyAppRid.d.ts +2 -0
  121. package/build/browser/net/ThirdPartyAppRid.d.ts.map +1 -0
  122. package/build/browser/net/ThirdPartyAppRid.js +17 -0
  123. package/build/browser/net/ThirdPartyAppRid.js.map +1 -0
  124. package/build/browser/net/UserAgent.d.ts +2 -0
  125. package/build/browser/net/UserAgent.d.ts.map +1 -0
  126. package/build/browser/net/UserAgent.js +17 -0
  127. package/build/browser/net/UserAgent.js.map +1 -0
  128. package/build/browser/net/createFetch.d.mts +2 -0
  129. package/build/browser/net/createFetch.d.mts.map +1 -0
  130. package/build/browser/net/createFetch.js +66 -0
  131. package/build/browser/net/createFetch.js.map +1 -0
  132. package/build/browser/net/createFetch.mjs +71 -0
  133. package/build/browser/net/createInternalClientContext.d.mts +3 -0
  134. package/build/browser/net/createInternalClientContext.d.mts.map +1 -0
  135. package/build/browser/net/createInternalClientContext.js +22 -0
  136. package/build/browser/net/createInternalClientContext.js.map +1 -0
  137. package/build/browser/net/createInternalClientContext.mjs +21 -0
  138. package/build/browser/net/index.d.mts +3 -0
  139. package/build/browser/net/index.d.mts.map +1 -0
  140. package/build/browser/net/index.js +18 -0
  141. package/build/browser/net/index.js.map +1 -0
  142. package/build/browser/net/index.mjs +17 -0
  143. package/build/browser/net/internalClientContext.d.mts +5 -0
  144. package/build/browser/net/internalClientContext.d.mts.map +1 -0
  145. package/build/browser/net/internalClientContext.js +17 -0
  146. package/build/browser/net/internalClientContext.js.map +1 -0
  147. package/build/browser/net/internalClientContext.mjs +16 -0
  148. package/build/browser/net/third-party-applications/DeployWebsiteRequest.d.mts +4 -0
  149. package/build/browser/net/third-party-applications/DeployWebsiteRequest.d.mts.map +1 -0
  150. package/build/browser/net/third-party-applications/DeployWebsiteRequest.js +17 -0
  151. package/build/browser/net/third-party-applications/DeployWebsiteRequest.js.map +1 -0
  152. package/build/browser/net/third-party-applications/DeployWebsiteRequest.mjs +16 -0
  153. package/build/browser/net/third-party-applications/ListVersionsResponse.d.mts +6 -0
  154. package/build/browser/net/third-party-applications/ListVersionsResponse.d.mts.map +1 -0
  155. package/build/browser/net/third-party-applications/ListVersionsResponse.js +17 -0
  156. package/build/browser/net/third-party-applications/ListVersionsResponse.js.map +1 -0
  157. package/build/browser/net/third-party-applications/ListVersionsResponse.mjs +16 -0
  158. package/build/browser/net/third-party-applications/Version.d.mts +4 -0
  159. package/build/browser/net/third-party-applications/Version.d.mts.map +1 -0
  160. package/build/browser/net/third-party-applications/Version.js +17 -0
  161. package/build/browser/net/third-party-applications/Version.js.map +1 -0
  162. package/build/browser/net/third-party-applications/Version.mjs +16 -0
  163. package/build/browser/net/third-party-applications/Website.d.mts +5 -0
  164. package/build/browser/net/third-party-applications/Website.d.mts.map +1 -0
  165. package/build/browser/net/third-party-applications/Website.js +17 -0
  166. package/build/browser/net/third-party-applications/Website.js.map +1 -0
  167. package/build/browser/net/third-party-applications/Website.mjs +16 -0
  168. package/build/browser/net/third-party-applications/deleteVersion.d.mts +4 -0
  169. package/build/browser/net/third-party-applications/deleteVersion.d.mts.map +1 -0
  170. package/build/browser/net/third-party-applications/deleteVersion.js +24 -0
  171. package/build/browser/net/third-party-applications/deleteVersion.js.map +1 -0
  172. package/build/browser/net/third-party-applications/deleteVersion.mjs +23 -0
  173. package/build/browser/net/third-party-applications/deployWebsite.d.mts +6 -0
  174. package/build/browser/net/third-party-applications/deployWebsite.d.mts.map +1 -0
  175. package/build/browser/net/third-party-applications/deployWebsite.js +29 -0
  176. package/build/browser/net/third-party-applications/deployWebsite.js.map +1 -0
  177. package/build/browser/net/third-party-applications/deployWebsite.mjs +28 -0
  178. package/build/browser/net/third-party-applications/getWebsite.d.mts +5 -0
  179. package/build/browser/net/third-party-applications/getWebsite.d.mts.map +1 -0
  180. package/build/browser/net/third-party-applications/getWebsite.js +33 -0
  181. package/build/browser/net/third-party-applications/getWebsite.js.map +1 -0
  182. package/build/browser/net/third-party-applications/getWebsite.mjs +35 -0
  183. package/build/browser/net/third-party-applications/index.d.mts +11 -0
  184. package/build/browser/net/third-party-applications/index.d.mts.map +1 -0
  185. package/build/browser/net/third-party-applications/index.js +22 -0
  186. package/build/browser/net/third-party-applications/index.js.map +1 -0
  187. package/build/browser/net/third-party-applications/index.mjs +21 -0
  188. package/build/browser/net/third-party-applications/listVersions.d.mts +5 -0
  189. package/build/browser/net/third-party-applications/listVersions.d.mts.map +1 -0
  190. package/build/browser/net/third-party-applications/listVersions.js +23 -0
  191. package/build/browser/net/third-party-applications/listVersions.js.map +1 -0
  192. package/build/browser/net/third-party-applications/listVersions.mjs +22 -0
  193. package/build/browser/net/third-party-applications/undeployWebsite.d.mts +4 -0
  194. package/build/browser/net/third-party-applications/undeployWebsite.d.mts.map +1 -0
  195. package/build/browser/net/third-party-applications/undeployWebsite.js +24 -0
  196. package/build/browser/net/third-party-applications/undeployWebsite.js.map +1 -0
  197. package/build/browser/net/third-party-applications/undeployWebsite.mjs +23 -0
  198. package/build/browser/net/third-party-applications/uploadVersion.d.mts +5 -0
  199. package/build/browser/net/third-party-applications/uploadVersion.d.mts.map +1 -0
  200. package/build/browser/net/third-party-applications/uploadVersion.js +30 -0
  201. package/build/browser/net/third-party-applications/uploadVersion.js.map +1 -0
  202. package/build/browser/net/third-party-applications/uploadVersion.mjs +29 -0
  203. package/build/browser/util/autoVersion.d.ts +9 -0
  204. package/build/browser/util/autoVersion.d.ts.map +1 -0
  205. package/build/browser/util/autoVersion.js +62 -0
  206. package/build/browser/util/autoVersion.js.map +1 -0
  207. package/build/browser/util/autoVersion.test.d.ts +2 -0
  208. package/build/browser/util/autoVersion.test.d.ts.map +1 -0
  209. package/build/browser/util/autoVersion.test.js +71 -0
  210. package/build/browser/util/autoVersion.test.js.map +1 -0
  211. package/build/browser/util/config.d.ts +26 -0
  212. package/build/browser/util/config.d.ts.map +1 -0
  213. package/build/browser/util/config.js +102 -0
  214. package/build/browser/util/config.js.map +1 -0
  215. package/build/browser/util/config.test.d.ts +2 -0
  216. package/build/browser/util/config.test.d.ts.map +1 -0
  217. package/build/browser/util/config.test.js +110 -0
  218. package/build/browser/util/config.test.js.map +1 -0
  219. package/build/browser/util/configLoader.d.ts +4 -0
  220. package/build/browser/util/configLoader.d.ts.map +1 -0
  221. package/build/browser/util/configLoader.js +25 -0
  222. package/build/browser/util/configLoader.js.map +1 -0
  223. package/build/browser/util/isValidSemver.test.d.ts +2 -0
  224. package/build/browser/util/isValidSemver.test.d.ts.map +1 -0
  225. package/build/browser/util/isValidSemver.test.js +41 -0
  226. package/build/browser/util/isValidSemver.test.js.map +1 -0
  227. package/build/browser/util/token.d.ts +22 -0
  228. package/build/browser/util/token.d.ts.map +1 -0
  229. package/build/browser/util/token.js +84 -0
  230. package/build/browser/util/token.js.map +1 -0
  231. package/build/browser/util/token.test.d.ts +2 -0
  232. package/build/browser/util/token.test.d.ts.map +1 -0
  233. package/build/browser/util/token.test.js +62 -0
  234. package/build/browser/util/token.test.js.map +1 -0
  235. package/build/browser/yargs/logConfigFileMiddleware.d.ts +2 -0
  236. package/build/browser/yargs/logConfigFileMiddleware.d.ts.map +1 -0
  237. package/build/browser/yargs/logConfigFileMiddleware.js +29 -0
  238. package/build/browser/yargs/logConfigFileMiddleware.js.map +1 -0
  239. package/build/esm/cli.js +42 -0
  240. package/build/esm/cli.js.map +1 -0
  241. package/build/esm/commands/auth/index.js +34 -0
  242. package/build/esm/commands/auth/index.js.map +1 -0
  243. package/build/esm/commands/auth/login/index.js +34 -0
  244. package/build/esm/commands/auth/login/index.js.map +1 -0
  245. package/build/esm/commands/site/CommonSiteArgs.js +17 -0
  246. package/build/esm/commands/site/CommonSiteArgs.js.map +1 -0
  247. package/build/esm/commands/site/deploy/SiteDeployArgs.js +17 -0
  248. package/build/esm/commands/site/deploy/SiteDeployArgs.js.map +1 -0
  249. package/build/esm/commands/site/deploy/index.js +108 -0
  250. package/build/esm/commands/site/deploy/index.js.map +1 -0
  251. package/build/esm/commands/site/deploy/logDeployCommandConfigFileOverride.js +28 -0
  252. package/build/esm/commands/site/deploy/logDeployCommandConfigFileOverride.js.map +1 -0
  253. package/build/esm/commands/site/deploy/siteDeployCommand.js +98 -0
  254. package/build/esm/commands/site/deploy/siteDeployCommand.js.map +1 -0
  255. package/build/esm/commands/site/deploy/siteDeployCommand.mjs +90 -0
  256. package/build/esm/commands/site/index.js +69 -0
  257. package/build/esm/commands/site/index.js.map +1 -0
  258. package/build/esm/commands/site/logSiteCommandConfigFileOverride.js +25 -0
  259. package/build/esm/commands/site/logSiteCommandConfigFileOverride.js.map +1 -0
  260. package/build/esm/commands/site/version/delete/VersionDeleteArgs.js +17 -0
  261. package/build/esm/commands/site/version/delete/VersionDeleteArgs.js.map +1 -0
  262. package/build/esm/commands/site/version/delete/index.js +36 -0
  263. package/build/esm/commands/site/version/delete/index.js.map +1 -0
  264. package/build/esm/commands/site/version/delete/versionDeleteCommand.js +41 -0
  265. package/build/esm/commands/site/version/delete/versionDeleteCommand.js.map +1 -0
  266. package/build/esm/commands/site/version/delete/versionDeleteCommand.mjs +32 -0
  267. package/build/esm/commands/site/version/get/VersionGetArgs.js +17 -0
  268. package/build/esm/commands/site/version/get/VersionGetArgs.js.map +1 -0
  269. package/build/esm/commands/site/version/get/index.js +28 -0
  270. package/build/esm/commands/site/version/get/index.js.map +1 -0
  271. package/build/esm/commands/site/version/get/versionGetCommand.js +36 -0
  272. package/build/esm/commands/site/version/get/versionGetCommand.js.map +1 -0
  273. package/build/esm/commands/site/version/get/versionGetCommand.mjs +32 -0
  274. package/build/esm/commands/site/version/index.js +30 -0
  275. package/build/esm/commands/site/version/index.js.map +1 -0
  276. package/build/esm/commands/site/version/list/VersionListArgs.js +17 -0
  277. package/build/esm/commands/site/version/list/VersionListArgs.js.map +1 -0
  278. package/build/esm/commands/site/version/list/index.js +28 -0
  279. package/build/esm/commands/site/version/list/index.js.map +1 -0
  280. package/build/esm/commands/site/version/list/versionListCommand.js +41 -0
  281. package/build/esm/commands/site/version/list/versionListCommand.js.map +1 -0
  282. package/build/esm/commands/site/version/list/versionListCommand.mjs +42 -0
  283. package/build/esm/commands/site/version/set/VersionSetArgs.js +17 -0
  284. package/build/esm/commands/site/version/set/VersionSetArgs.js.map +1 -0
  285. package/build/esm/commands/site/version/set/index.js +32 -0
  286. package/build/esm/commands/site/version/set/index.js.map +1 -0
  287. package/build/esm/commands/site/version/set/versionSetCommand.js +36 -0
  288. package/build/esm/commands/site/version/set/versionSetCommand.js.map +1 -0
  289. package/build/esm/commands/site/version/set/versionSetCommand.mjs +28 -0
  290. package/build/esm/commands/site/version/unset/VersionUnsetArgs.js +17 -0
  291. package/build/esm/commands/site/version/unset/VersionUnsetArgs.js.map +1 -0
  292. package/build/esm/commands/site/version/unset/index.js +32 -0
  293. package/build/esm/commands/site/version/unset/index.js.map +1 -0
  294. package/build/esm/commands/site/version/unset/versionUnsetCommand.js +40 -0
  295. package/build/esm/commands/site/version/unset/versionUnsetCommand.js.map +1 -0
  296. package/build/esm/commands/site/version/unset/versionUnsetCommand.mjs +32 -0
  297. package/build/esm/consola/handlePromptCancel.js +25 -0
  298. package/build/esm/consola/handlePromptCancel.js.map +1 -0
  299. package/build/esm/index.js +16 -588
  300. package/build/esm/index.js.map +1 -1
  301. package/build/esm/net/ThirdPartyAppRid.js +17 -0
  302. package/build/esm/net/ThirdPartyAppRid.js.map +1 -0
  303. package/build/esm/net/UserAgent.js +17 -0
  304. package/build/esm/net/UserAgent.js.map +1 -0
  305. package/build/esm/net/createFetch.js +66 -0
  306. package/build/esm/net/createFetch.js.map +1 -0
  307. package/build/esm/net/createFetch.mjs +71 -0
  308. package/build/esm/net/createInternalClientContext.js +22 -0
  309. package/build/esm/net/createInternalClientContext.js.map +1 -0
  310. package/build/esm/net/createInternalClientContext.mjs +21 -0
  311. package/build/esm/net/index.js +18 -0
  312. package/build/esm/net/index.js.map +1 -0
  313. package/build/esm/net/index.mjs +17 -0
  314. package/build/esm/net/internalClientContext.js +17 -0
  315. package/build/esm/net/internalClientContext.js.map +1 -0
  316. package/build/esm/net/internalClientContext.mjs +16 -0
  317. package/build/esm/net/third-party-applications/DeployWebsiteRequest.js +17 -0
  318. package/build/esm/net/third-party-applications/DeployWebsiteRequest.js.map +1 -0
  319. package/build/esm/net/third-party-applications/DeployWebsiteRequest.mjs +16 -0
  320. package/build/esm/net/third-party-applications/ListVersionsResponse.js +17 -0
  321. package/build/esm/net/third-party-applications/ListVersionsResponse.js.map +1 -0
  322. package/build/esm/net/third-party-applications/ListVersionsResponse.mjs +16 -0
  323. package/build/esm/net/third-party-applications/Version.js +17 -0
  324. package/build/esm/net/third-party-applications/Version.js.map +1 -0
  325. package/build/esm/net/third-party-applications/Version.mjs +16 -0
  326. package/build/esm/net/third-party-applications/Website.js +17 -0
  327. package/build/esm/net/third-party-applications/Website.js.map +1 -0
  328. package/build/esm/net/third-party-applications/Website.mjs +16 -0
  329. package/build/esm/net/third-party-applications/deleteVersion.js +24 -0
  330. package/build/esm/net/third-party-applications/deleteVersion.js.map +1 -0
  331. package/build/esm/net/third-party-applications/deleteVersion.mjs +23 -0
  332. package/build/esm/net/third-party-applications/deployWebsite.js +29 -0
  333. package/build/esm/net/third-party-applications/deployWebsite.js.map +1 -0
  334. package/build/esm/net/third-party-applications/deployWebsite.mjs +28 -0
  335. package/build/esm/net/third-party-applications/getWebsite.js +33 -0
  336. package/build/esm/net/third-party-applications/getWebsite.js.map +1 -0
  337. package/build/esm/net/third-party-applications/getWebsite.mjs +35 -0
  338. package/build/esm/net/third-party-applications/index.js +22 -0
  339. package/build/esm/net/third-party-applications/index.js.map +1 -0
  340. package/build/esm/net/third-party-applications/index.mjs +21 -0
  341. package/build/esm/net/third-party-applications/listVersions.js +23 -0
  342. package/build/esm/net/third-party-applications/listVersions.js.map +1 -0
  343. package/build/esm/net/third-party-applications/listVersions.mjs +22 -0
  344. package/build/esm/net/third-party-applications/undeployWebsite.js +24 -0
  345. package/build/esm/net/third-party-applications/undeployWebsite.js.map +1 -0
  346. package/build/esm/net/third-party-applications/undeployWebsite.mjs +23 -0
  347. package/build/esm/net/third-party-applications/uploadVersion.js +30 -0
  348. package/build/esm/net/third-party-applications/uploadVersion.js.map +1 -0
  349. package/build/esm/net/third-party-applications/uploadVersion.mjs +29 -0
  350. package/build/esm/util/autoVersion.js +62 -0
  351. package/build/esm/util/autoVersion.js.map +1 -0
  352. package/build/esm/util/autoVersion.test.js +71 -0
  353. package/build/esm/util/autoVersion.test.js.map +1 -0
  354. package/build/esm/util/config.js +102 -0
  355. package/build/esm/util/config.js.map +1 -0
  356. package/build/esm/util/config.test.js +110 -0
  357. package/build/esm/util/config.test.js.map +1 -0
  358. package/build/esm/util/configLoader.js +25 -0
  359. package/build/esm/util/configLoader.js.map +1 -0
  360. package/build/esm/util/isValidSemver.test.js +41 -0
  361. package/build/esm/util/isValidSemver.test.js.map +1 -0
  362. package/build/esm/util/token.js +84 -0
  363. package/build/esm/util/token.js.map +1 -0
  364. package/build/esm/util/token.test.js +62 -0
  365. package/build/esm/util/token.test.js.map +1 -0
  366. package/build/esm/yargs/logConfigFileMiddleware.js +29 -0
  367. package/build/esm/yargs/logConfigFileMiddleware.js.map +1 -0
  368. package/package.json +8 -10
  369. package/build/browser/chunk-5AQYUXAY.js +0 -17
  370. package/build/browser/chunk-5AQYUXAY.js.map +0 -1
  371. package/build/browser/chunk-DAYFZSC6.js +0 -42
  372. package/build/browser/chunk-DAYFZSC6.js.map +0 -1
  373. package/build/browser/chunk-FHGPBDJE.js +0 -221
  374. package/build/browser/chunk-FHGPBDJE.js.map +0 -1
  375. package/build/browser/chunk-SBJIY4HI.js +0 -67
  376. package/build/browser/chunk-SBJIY4HI.js.map +0 -1
  377. package/build/browser/chunk-XJLUGCCS.js +0 -120
  378. package/build/browser/chunk-XJLUGCCS.js.map +0 -1
  379. package/build/browser/handleGenerate-5ANBXHY3-NRCPE7IO.js +0 -633
  380. package/build/browser/handleGenerate-5ANBXHY3-NRCPE7IO.js.map +0 -1
  381. package/build/browser/loginFlow-X2LB2TEP.js +0 -4
  382. package/build/browser/loginFlow-X2LB2TEP.js.map +0 -1
  383. package/build/browser/siteDeployCommand-OYNFXM4G.js +0 -140
  384. package/build/browser/siteDeployCommand-OYNFXM4G.js.map +0 -1
  385. package/build/browser/versionDeleteCommand-I6JJR3KD.js +0 -35
  386. package/build/browser/versionDeleteCommand-I6JJR3KD.js.map +0 -1
  387. package/build/browser/versionGetCommand-LVG3FBW5.js +0 -29
  388. package/build/browser/versionGetCommand-LVG3FBW5.js.map +0 -1
  389. package/build/browser/versionListCommand-VZQDE6LT.js +0 -34
  390. package/build/browser/versionListCommand-VZQDE6LT.js.map +0 -1
  391. package/build/browser/versionSetCommand-RSTHOATA.js +0 -29
  392. package/build/browser/versionSetCommand-RSTHOATA.js.map +0 -1
  393. package/build/browser/versionUnsetCommand-TCIPMVDP.js +0 -34
  394. package/build/browser/versionUnsetCommand-TCIPMVDP.js.map +0 -1
  395. package/build/esm/chunk-5AQYUXAY.js +0 -17
  396. package/build/esm/chunk-5AQYUXAY.js.map +0 -1
  397. package/build/esm/chunk-DAYFZSC6.js +0 -42
  398. package/build/esm/chunk-DAYFZSC6.js.map +0 -1
  399. package/build/esm/chunk-FHGPBDJE.js +0 -221
  400. package/build/esm/chunk-FHGPBDJE.js.map +0 -1
  401. package/build/esm/chunk-SBJIY4HI.js +0 -67
  402. package/build/esm/chunk-SBJIY4HI.js.map +0 -1
  403. package/build/esm/chunk-XJLUGCCS.js +0 -120
  404. package/build/esm/chunk-XJLUGCCS.js.map +0 -1
  405. package/build/esm/handleGenerate-5ANBXHY3-NRCPE7IO.js +0 -633
  406. package/build/esm/handleGenerate-5ANBXHY3-NRCPE7IO.js.map +0 -1
  407. package/build/esm/loginFlow-X2LB2TEP.js +0 -4
  408. package/build/esm/loginFlow-X2LB2TEP.js.map +0 -1
  409. package/build/esm/siteDeployCommand-OYNFXM4G.js +0 -140
  410. package/build/esm/siteDeployCommand-OYNFXM4G.js.map +0 -1
  411. package/build/esm/versionDeleteCommand-I6JJR3KD.js +0 -35
  412. package/build/esm/versionDeleteCommand-I6JJR3KD.js.map +0 -1
  413. package/build/esm/versionGetCommand-LVG3FBW5.js +0 -29
  414. package/build/esm/versionGetCommand-LVG3FBW5.js.map +0 -1
  415. package/build/esm/versionListCommand-VZQDE6LT.js +0 -34
  416. package/build/esm/versionListCommand-VZQDE6LT.js.map +0 -1
  417. package/build/esm/versionSetCommand-RSTHOATA.js +0 -29
  418. package/build/esm/versionSetCommand-RSTHOATA.js.map +0 -1
  419. package/build/esm/versionUnsetCommand-TCIPMVDP.js +0 -34
  420. package/build/esm/versionUnsetCommand-TCIPMVDP.js.map +0 -1
@@ -0,0 +1,84 @@
1
+ /*
2
+ * Copyright 2023 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { ExitProcessError } from "@osdk/cli.common";
17
+ import { consola } from "consola";
18
+ import { promises as fsPromises } from "node:fs";
19
+ import path from "node:path";
20
+ const TOKEN_ENV_VARS = ["FOUNDRY_TOKEN", "FOUNDRY_SDK_AUTH_TOKEN"];
21
+ /**
22
+ * Loads a JWT Auth Token from an argument, a file, or environment variable returning the first found.
23
+ * @param token The token as a string.
24
+ * @param tokenFile The path to the token file.
25
+ * @returns The token as a string.
26
+ * @throws An error if no token is found.
27
+ */
28
+ export async function loadToken(token, tokenFile) {
29
+ if (token) {
30
+ consola.debug(`Using token from --token option`);
31
+ validate(token);
32
+ return token;
33
+ }
34
+ if (tokenFile) {
35
+ const loadedToken = await loadTokenFile(tokenFile);
36
+ consola.debug(`Using token from --tokenFile=${loadedToken.filePath} option`);
37
+ validate(loadedToken.token);
38
+ return loadedToken.token;
39
+ }
40
+ for (const envVar of TOKEN_ENV_VARS) {
41
+ const environmentToken = process.env[envVar];
42
+ if (environmentToken) {
43
+ consola.debug(`Using token from ${envVar} environment variable`);
44
+ validate(environmentToken);
45
+ if (envVar === "FOUNDRY_SDK_AUTH_TOKEN") {
46
+ consola.warn(`Using FOUNDRY_SDK_AUTH_TOKEN environment variable is deprecated. Please use FOUNDRY_TOKEN instead.`);
47
+ }
48
+ return environmentToken;
49
+ }
50
+ }
51
+ 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`);
52
+ }
53
+ /**
54
+ * Reads a JWT Auth Token from a file.
55
+ * @param filePath The path to the token file.
56
+ * @returns The token as a string.
57
+ * @throws An error if the file cannot be read.
58
+ */
59
+ export async function loadTokenFile(filePath) {
60
+ let token;
61
+ let resolvedPath;
62
+ try {
63
+ resolvedPath = path.resolve(filePath);
64
+ token = await fsPromises.readFile(resolvedPath, "utf8");
65
+ token = token.trim();
66
+ } catch (error) {
67
+ throw new ExitProcessError(2, `Unable to read token file "${filePath}": ${error}`);
68
+ }
69
+ return {
70
+ filePath: resolvedPath,
71
+ token
72
+ };
73
+ }
74
+ export function validate(token) {
75
+ if (!isJWT(token)) {
76
+ throw new ExitProcessError(2, `Token does not appear to be a JWT`);
77
+ }
78
+ }
79
+ function isJWT(token) {
80
+ // https://stackoverflow.com/a/65755789
81
+
82
+ return /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/.test(token);
83
+ }
84
+ //# sourceMappingURL=token.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token.js","names":["ExitProcessError","consola","promises","fsPromises","path","TOKEN_ENV_VARS","loadToken","token","tokenFile","debug","validate","loadedToken","loadTokenFile","filePath","envVar","environmentToken","process","env","warn","resolvedPath","resolve","readFile","trim","error","isJWT","test"],"sources":["token.js"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\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 * 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 }\n catch (error) {\n throw new ExitProcessError(2, `Unable to read token file \"${filePath}\": ${error}`);\n }\n return { filePath: resolvedPath, token };\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}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,gBAAgB,QAAQ,kBAAkB;AACnD,SAASC,OAAO,QAAQ,SAAS;AACjC,SAASC,QAAQ,IAAIC,UAAU,QAAQ,SAAS;AAChD,OAAOC,IAAI,MAAM,WAAW;AAC5B,MAAMC,cAAc,GAAG,CAAC,eAAe,EAAE,wBAAwB,CAAC;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,SAASA,CAACC,KAAK,EAAEC,SAAS,EAAE;EAC9C,IAAID,KAAK,EAAE;IACPN,OAAO,CAACQ,KAAK,CAAC,iCAAiC,CAAC;IAChDC,QAAQ,CAACH,KAAK,CAAC;IACf,OAAOA,KAAK;EAChB;EACA,IAAIC,SAAS,EAAE;IACX,MAAMG,WAAW,GAAG,MAAMC,aAAa,CAACJ,SAAS,CAAC;IAClDP,OAAO,CAACQ,KAAK,CAAC,gCAAgCE,WAAW,CAACE,QAAQ,SAAS,CAAC;IAC5EH,QAAQ,CAACC,WAAW,CAACJ,KAAK,CAAC;IAC3B,OAAOI,WAAW,CAACJ,KAAK;EAC5B;EACA,KAAK,MAAMO,MAAM,IAAIT,cAAc,EAAE;IACjC,MAAMU,gBAAgB,GAAGC,OAAO,CAACC,GAAG,CAACH,MAAM,CAAC;IAC5C,IAAIC,gBAAgB,EAAE;MAClBd,OAAO,CAACQ,KAAK,CAAC,oBAAoBK,MAAM,uBAAuB,CAAC;MAChEJ,QAAQ,CAACK,gBAAgB,CAAC;MAC1B,IAAID,MAAM,KAAK,wBAAwB,EAAE;QACrCb,OAAO,CAACiB,IAAI,CAAC,oGAAoG,CAAC;MACtH;MACA,OAAOH,gBAAgB;IAC3B;EACJ;EACA,MAAM,IAAIf,gBAAgB,CAAC,CAAC,EAAE,iBAAiB,EAAE,+DAA+DK,cAAc,CAAC,CAAC,CAAC,uBAAuB,CAAC;AAC7J;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeO,aAAaA,CAACC,QAAQ,EAAE;EAC1C,IAAIN,KAAK;EACT,IAAIY,YAAY;EAChB,IAAI;IACAA,YAAY,GAAGf,IAAI,CAACgB,OAAO,CAACP,QAAQ,CAAC;IACrCN,KAAK,GAAG,MAAMJ,UAAU,CAACkB,QAAQ,CAACF,YAAY,EAAE,MAAM,CAAC;IACvDZ,KAAK,GAAGA,KAAK,CAACe,IAAI,CAAC,CAAC;EACxB,CAAC,CACD,OAAOC,KAAK,EAAE;IACV,MAAM,IAAIvB,gBAAgB,CAAC,CAAC,EAAE,8BAA8Ba,QAAQ,MAAMU,KAAK,EAAE,CAAC;EACtF;EACA,OAAO;IAAEV,QAAQ,EAAEM,YAAY;IAAEZ;EAAM,CAAC;AAC5C;AACA,OAAO,SAASG,QAAQA,CAACH,KAAK,EAAE;EAC5B,IAAI,CAACiB,KAAK,CAACjB,KAAK,CAAC,EAAE;IACf,MAAM,IAAIP,gBAAgB,CAAC,CAAC,EAAE,mCAAmC,CAAC;EACtE;AACJ;AACA,SAASwB,KAAKA,CAACjB,KAAK,EAAE;EAClB;;EAEA,OADmB,kDAAkD,CACnDkB,IAAI,CAAClB,KAAK,CAAC;AACjC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=token.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token.test.d.ts","sourceRoot":"","sources":["../../../src/util/token.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,62 @@
1
+ /*
2
+ * Copyright 2023 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { promises as fsPromises } from "node:fs";
17
+ import { afterEach, describe, expect, it, vi } from "vitest";
18
+ import { loadToken, loadTokenFile, validate } from "./token.js";
19
+ vi.mock("node:fs");
20
+ // {"header": {"alg":"HS256","typ":"JWT"}, "payload": {"sub":"1234567890","name":"TestUser","iat":1516239022}}
21
+ const validToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IlRlc3RVc2VyIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c";
22
+ describe("loadToken", () => {
23
+ it("should load a valid token from a direct argument", async () => {
24
+ const token = await loadToken(validToken);
25
+ expect(token).toBe(validToken);
26
+ });
27
+ it("should load a valid token from a file", async () => {
28
+ vi.mocked(fsPromises.readFile).mockResolvedValue(validToken);
29
+ const token = await loadToken(undefined, "valid-token.txt");
30
+ expect(token).toBe(validToken);
31
+ });
32
+ it("should load a valid token from the FOUNDRY_TOKEN environment variable", async () => {
33
+ vi.stubEnv("FOUNDRY_TOKEN", validToken);
34
+ vi.stubEnv("FOUNDRY_SDK_AUTH_TOKEN", "");
35
+ expect(await loadToken()).toBe(validToken);
36
+ });
37
+ it("should load a valid token from the deprecated FOUNDRY_SDK_AUTH_TOKEN environment variable", async () => {
38
+ vi.stubEnv("FOUNDRY_TOKEN", "");
39
+ vi.stubEnv("FOUNDRY_SDK_AUTH_TOKEN", validToken);
40
+ expect(await loadToken()).toBe(validToken);
41
+ });
42
+ it("should throw an error if no token is found", async () => {
43
+ vi.stubEnv("FOUNDRY_TOKEN", "");
44
+ vi.stubEnv("FOUNDRY_SDK_AUTH_TOKEN", "");
45
+ await expect(() => loadToken()).rejects.toThrow("No token found.");
46
+ });
47
+ afterEach(() => {
48
+ vi.unstubAllEnvs();
49
+ vi.restoreAllMocks();
50
+ });
51
+ });
52
+ describe("loadTokenFile", () => {
53
+ it("should throw an error if the token file is not found", async () => {
54
+ await expect(() => loadTokenFile("does-not-exist.txt")).rejects.toThrow(`Unable to read token file "does-not-exist.txt"`);
55
+ });
56
+ });
57
+ describe("validate", () => {
58
+ it("should throw an error if the token is invalid", () => {
59
+ expect(() => validate("token")).toThrow(`Token does not appear to be a JWT`);
60
+ });
61
+ });
62
+ //# sourceMappingURL=token.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token.test.js","names":["promises","fsPromises","afterEach","describe","expect","it","vi","loadToken","loadTokenFile","validate","mock","validToken","token","toBe","mocked","readFile","mockResolvedValue","undefined","stubEnv","rejects","toThrow","unstubAllEnvs","restoreAllMocks"],"sources":["token.test.js"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { promises as fsPromises } from \"node:fs\";\nimport { afterEach, describe, expect, it, vi } from \"vitest\";\nimport { loadToken, loadTokenFile, validate } from \"./token.js\";\nvi.mock(\"node:fs\");\n// {\"header\": {\"alg\":\"HS256\",\"typ\":\"JWT\"}, \"payload\": {\"sub\":\"1234567890\",\"name\":\"TestUser\",\"iat\":1516239022}}\nconst validToken = \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IlRlc3RVc2VyIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c\";\ndescribe(\"loadToken\", () => {\n it(\"should load a valid token from a direct argument\", async () => {\n const token = await loadToken(validToken);\n expect(token).toBe(validToken);\n });\n it(\"should load a valid token from a file\", async () => {\n vi.mocked(fsPromises.readFile).mockResolvedValue(validToken);\n const token = await loadToken(undefined, \"valid-token.txt\");\n expect(token).toBe(validToken);\n });\n it(\"should load a valid token from the FOUNDRY_TOKEN environment variable\", async () => {\n vi.stubEnv(\"FOUNDRY_TOKEN\", validToken);\n vi.stubEnv(\"FOUNDRY_SDK_AUTH_TOKEN\", \"\");\n expect(await loadToken()).toBe(validToken);\n });\n it(\"should load a valid token from the deprecated FOUNDRY_SDK_AUTH_TOKEN environment variable\", async () => {\n vi.stubEnv(\"FOUNDRY_TOKEN\", \"\");\n vi.stubEnv(\"FOUNDRY_SDK_AUTH_TOKEN\", validToken);\n expect(await loadToken()).toBe(validToken);\n });\n it(\"should throw an error if no token is found\", async () => {\n vi.stubEnv(\"FOUNDRY_TOKEN\", \"\");\n vi.stubEnv(\"FOUNDRY_SDK_AUTH_TOKEN\", \"\");\n await expect(() => loadToken()).rejects.toThrow(\"No token found.\");\n });\n afterEach(() => {\n vi.unstubAllEnvs();\n vi.restoreAllMocks();\n });\n});\ndescribe(\"loadTokenFile\", () => {\n it(\"should throw an error if the token file is not found\", async () => {\n await expect(() => loadTokenFile(\"does-not-exist.txt\"))\n .rejects.toThrow(`Unable to read token file \"does-not-exist.txt\"`);\n });\n});\ndescribe(\"validate\", () => {\n it(\"should throw an error if the token is invalid\", () => {\n expect(() => validate(\"token\"))\n .toThrow(`Token does not appear to be a JWT`);\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,QAAQ,IAAIC,UAAU,QAAQ,SAAS;AAChD,SAASC,SAAS,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,EAAEC,EAAE,QAAQ,QAAQ;AAC5D,SAASC,SAAS,EAAEC,aAAa,EAAEC,QAAQ,QAAQ,YAAY;AAC/DH,EAAE,CAACI,IAAI,CAAC,SAAS,CAAC;AAClB;AACA,MAAMC,UAAU,GAAG,6JAA6J;AAChLR,QAAQ,CAAC,WAAW,EAAE,MAAM;EACxBE,EAAE,CAAC,kDAAkD,EAAE,YAAY;IAC/D,MAAMO,KAAK,GAAG,MAAML,SAAS,CAACI,UAAU,CAAC;IACzCP,MAAM,CAACQ,KAAK,CAAC,CAACC,IAAI,CAACF,UAAU,CAAC;EAClC,CAAC,CAAC;EACFN,EAAE,CAAC,uCAAuC,EAAE,YAAY;IACpDC,EAAE,CAACQ,MAAM,CAACb,UAAU,CAACc,QAAQ,CAAC,CAACC,iBAAiB,CAACL,UAAU,CAAC;IAC5D,MAAMC,KAAK,GAAG,MAAML,SAAS,CAACU,SAAS,EAAE,iBAAiB,CAAC;IAC3Db,MAAM,CAACQ,KAAK,CAAC,CAACC,IAAI,CAACF,UAAU,CAAC;EAClC,CAAC,CAAC;EACFN,EAAE,CAAC,uEAAuE,EAAE,YAAY;IACpFC,EAAE,CAACY,OAAO,CAAC,eAAe,EAAEP,UAAU,CAAC;IACvCL,EAAE,CAACY,OAAO,CAAC,wBAAwB,EAAE,EAAE,CAAC;IACxCd,MAAM,CAAC,MAAMG,SAAS,CAAC,CAAC,CAAC,CAACM,IAAI,CAACF,UAAU,CAAC;EAC9C,CAAC,CAAC;EACFN,EAAE,CAAC,2FAA2F,EAAE,YAAY;IACxGC,EAAE,CAACY,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC;IAC/BZ,EAAE,CAACY,OAAO,CAAC,wBAAwB,EAAEP,UAAU,CAAC;IAChDP,MAAM,CAAC,MAAMG,SAAS,CAAC,CAAC,CAAC,CAACM,IAAI,CAACF,UAAU,CAAC;EAC9C,CAAC,CAAC;EACFN,EAAE,CAAC,4CAA4C,EAAE,YAAY;IACzDC,EAAE,CAACY,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC;IAC/BZ,EAAE,CAACY,OAAO,CAAC,wBAAwB,EAAE,EAAE,CAAC;IACxC,MAAMd,MAAM,CAAC,MAAMG,SAAS,CAAC,CAAC,CAAC,CAACY,OAAO,CAACC,OAAO,CAAC,iBAAiB,CAAC;EACtE,CAAC,CAAC;EACFlB,SAAS,CAAC,MAAM;IACZI,EAAE,CAACe,aAAa,CAAC,CAAC;IAClBf,EAAE,CAACgB,eAAe,CAAC,CAAC;EACxB,CAAC,CAAC;AACN,CAAC,CAAC;AACFnB,QAAQ,CAAC,eAAe,EAAE,MAAM;EAC5BE,EAAE,CAAC,sDAAsD,EAAE,YAAY;IACnE,MAAMD,MAAM,CAAC,MAAMI,aAAa,CAAC,oBAAoB,CAAC,CAAC,CAClDW,OAAO,CAACC,OAAO,CAAC,gDAAgD,CAAC;EAC1E,CAAC,CAAC;AACN,CAAC,CAAC;AACFjB,QAAQ,CAAC,UAAU,EAAE,MAAM;EACvBE,EAAE,CAAC,+CAA+C,EAAE,MAAM;IACtDD,MAAM,CAAC,MAAMK,QAAQ,CAAC,OAAO,CAAC,CAAC,CAC1BW,OAAO,CAAC,mCAAmC,CAAC;EACrD,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export declare function logConfigFileMiddleware(): Promise<void>;
2
+ //# sourceMappingURL=logConfigFileMiddleware.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logConfigFileMiddleware.d.ts","sourceRoot":"","sources":["../../../src/yargs/logConfigFileMiddleware.ts"],"names":[],"mappings":"AAoBA,wBAAsB,uBAAuB,kBAW5C"}
@@ -0,0 +1,29 @@
1
+ /*
2
+ * Copyright 2023 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { consola } from "consola";
17
+ import getConfig from "../util/configLoader.js";
18
+ let firstTime = true;
19
+ export async function logConfigFileMiddleware() {
20
+ if (firstTime) {
21
+ firstTime = false;
22
+ const config = getConfig();
23
+ const configFilePath = (await config)?.configFilePath;
24
+ if (configFilePath) {
25
+ consola.debug(`Using configuration from file: "${configFilePath}"`);
26
+ }
27
+ }
28
+ }
29
+ //# sourceMappingURL=logConfigFileMiddleware.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logConfigFileMiddleware.js","names":["consola","getConfig","firstTime","logConfigFileMiddleware","config","configFilePath","debug"],"sources":["logConfigFileMiddleware.js"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { consola } from \"consola\";\nimport getConfig from \"../util/configLoader.js\";\nlet firstTime = true;\nexport async function logConfigFileMiddleware() {\n if (firstTime) {\n firstTime = false;\n const config = getConfig();\n const configFilePath = (await config)?.configFilePath;\n if (configFilePath) {\n consola.debug(`Using configuration from file: \"${configFilePath}\"`);\n }\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,SAAS;AACjC,OAAOC,SAAS,MAAM,yBAAyB;AAC/C,IAAIC,SAAS,GAAG,IAAI;AACpB,OAAO,eAAeC,uBAAuBA,CAAA,EAAG;EAC5C,IAAID,SAAS,EAAE;IACXA,SAAS,GAAG,KAAK;IACjB,MAAME,MAAM,GAAGH,SAAS,CAAC,CAAC;IAC1B,MAAMI,cAAc,GAAG,CAAC,MAAMD,MAAM,GAAGC,cAAc;IACrD,IAAIA,cAAc,EAAE;MAChBL,OAAO,CAACM,KAAK,CAAC,mCAAmCD,cAAc,GAAG,CAAC;IACvE;EACJ;AACJ","ignoreList":[]}
@@ -0,0 +1,42 @@
1
+ /*
2
+ * Copyright 2023 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import typescript from "@osdk/cli.cmd.typescript";
17
+ import { ExitProcessError, getYargsBase } from "@osdk/cli.common";
18
+ import { consola } from "consola";
19
+ import auth from "./commands/auth/index.js";
20
+ import site from "./commands/site/index.js";
21
+ import { logConfigFileMiddleware } from "./yargs/logConfigFileMiddleware.js";
22
+ export async function cli(args = process.argv) {
23
+ consola.info(`Palantir OSDK CLI ${"0.24.0-beta.13"}\n`);
24
+ const base = getYargsBase(args);
25
+ // Special handling where failures happen before yargs does its error handling within .fail
26
+ try {
27
+ return await base.middleware(logConfigFileMiddleware).command(site).command({
28
+ command: "unstable",
29
+ aliases: ["experimental"],
30
+ describe: "Unstable commands",
31
+ builder: async argv => {
32
+ return argv.command(typescript).command(auth).demandCommand();
33
+ },
34
+ handler: () => {}
35
+ }).parseAsync();
36
+ } catch (err) {
37
+ if (err instanceof ExitProcessError) {
38
+ consola.error(err);
39
+ }
40
+ }
41
+ }
42
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","names":["typescript","ExitProcessError","getYargsBase","consola","auth","site","logConfigFileMiddleware","cli","args","process","argv","info","base","middleware","command","aliases","describe","builder","demandCommand","handler","parseAsync","err","error"],"sources":["cli.js"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport typescript from \"@osdk/cli.cmd.typescript\";\nimport { ExitProcessError, getYargsBase } from \"@osdk/cli.common\";\nimport { consola } from \"consola\";\nimport auth from \"./commands/auth/index.js\";\nimport site from \"./commands/site/index.js\";\nimport { logConfigFileMiddleware } from \"./yargs/logConfigFileMiddleware.js\";\nexport async function cli(args = process.argv) {\n consola.info(`Palantir OSDK CLI ${process.env.PACKAGE_VERSION}\\n`);\n const base = getYargsBase(args);\n // Special handling where failures happen before yargs does its error handling within .fail\n try {\n return await base\n .middleware(logConfigFileMiddleware)\n .command(site)\n .command({\n command: \"unstable\",\n aliases: [\"experimental\"],\n describe: \"Unstable commands\",\n builder: async (argv) => {\n return argv\n .command(typescript)\n .command(auth)\n .demandCommand();\n },\n handler: (_args) => { },\n }).parseAsync();\n }\n catch (err) {\n if (err instanceof ExitProcessError) {\n consola.error(err);\n }\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,0BAA0B;AACjD,SAASC,gBAAgB,EAAEC,YAAY,QAAQ,kBAAkB;AACjE,SAASC,OAAO,QAAQ,SAAS;AACjC,OAAOC,IAAI,MAAM,0BAA0B;AAC3C,OAAOC,IAAI,MAAM,0BAA0B;AAC3C,SAASC,uBAAuB,QAAQ,oCAAoC;AAC5E,OAAO,eAAeC,GAAGA,CAACC,IAAI,GAAGC,OAAO,CAACC,IAAI,EAAE;EAC3CP,OAAO,CAACQ,IAAI,CAAC,yCAAoD,CAAC;EAClE,MAAMC,IAAI,GAAGV,YAAY,CAACM,IAAI,CAAC;EAC/B;EACA,IAAI;IACA,OAAO,MAAMI,IAAI,CACZC,UAAU,CAACP,uBAAuB,CAAC,CACnCQ,OAAO,CAACT,IAAI,CAAC,CACbS,OAAO,CAAC;MACTA,OAAO,EAAE,UAAU;MACnBC,OAAO,EAAE,CAAC,cAAc,CAAC;MACzBC,QAAQ,EAAE,mBAAmB;MAC7BC,OAAO,EAAE,MAAOP,IAAI,IAAK;QACrB,OAAOA,IAAI,CACNI,OAAO,CAACd,UAAU,CAAC,CACnBc,OAAO,CAACV,IAAI,CAAC,CACbc,aAAa,CAAC,CAAC;MACxB,CAAC;MACDC,OAAO,EAAEA,CAAA,KAAW,CAAE;IAC1B,CAAC,CAAC,CAACC,UAAU,CAAC,CAAC;EACnB,CAAC,CACD,OAAOC,GAAG,EAAE;IACR,IAAIA,GAAG,YAAYpB,gBAAgB,EAAE;MACjCE,OAAO,CAACmB,KAAK,CAACD,GAAG,CAAC;IACtB;EACJ;AACJ","ignoreList":[]}
@@ -0,0 +1,34 @@
1
+ /*
2
+ * Copyright 2023 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import login from "./login/index.js";
17
+ const auth = {
18
+ command: "auth",
19
+ describe: "Manage your session",
20
+ builder: argv => {
21
+ return argv.options({
22
+ foundryUrl: {
23
+ type: "string",
24
+ demandOption: true,
25
+ alias: "baseUrl",
26
+ // for backwards compatibility
27
+ describe: "URL for the Foundry stack"
28
+ }
29
+ }).command(login).demandCommand();
30
+ },
31
+ handler: async () => {}
32
+ };
33
+ export default auth;
34
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["login","auth","command","describe","builder","argv","options","foundryUrl","type","demandOption","alias","demandCommand","handler"],"sources":["index.js"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport login from \"./login/index.js\";\nconst auth = {\n command: \"auth\",\n describe: \"Manage your session\",\n builder: (argv) => {\n return argv\n .options({\n foundryUrl: {\n type: \"string\",\n demandOption: true,\n alias: \"baseUrl\", // for backwards compatibility\n describe: \"URL for the Foundry stack\",\n },\n })\n .command(login)\n .demandCommand();\n },\n handler: async (args) => {\n },\n};\nexport default auth;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,kBAAkB;AACpC,MAAMC,IAAI,GAAG;EACTC,OAAO,EAAE,MAAM;EACfC,QAAQ,EAAE,qBAAqB;EAC/BC,OAAO,EAAGC,IAAI,IAAK;IACf,OAAOA,IAAI,CACNC,OAAO,CAAC;MACTC,UAAU,EAAE;QACRC,IAAI,EAAE,QAAQ;QACdC,YAAY,EAAE,IAAI;QAClBC,KAAK,EAAE,SAAS;QAAE;QAClBP,QAAQ,EAAE;MACd;IACJ,CAAC,CAAC,CACGD,OAAO,CAACF,KAAK,CAAC,CACdW,aAAa,CAAC,CAAC;EACxB,CAAC;EACDC,OAAO,EAAE,MAAAA,CAAA,KAAgB,CACzB;AACJ,CAAC;AACD,eAAeX,IAAI","ignoreList":[]}
@@ -0,0 +1,34 @@
1
+ /*
2
+ * Copyright 2023 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export const command = {
17
+ command: "login",
18
+ describe: "Authenticate with an application ID",
19
+ builder: argv => {
20
+ return argv.option("clientId", {
21
+ alias: "applicationId",
22
+ // for backwards compatibility
23
+ type: "string",
24
+ demandOption: true,
25
+ describe: "OAuth client ID for application"
26
+ });
27
+ },
28
+ handler: async args => {
29
+ const command = await import("@osdk/cli.common/loginFlow");
30
+ await command.default(args);
31
+ }
32
+ };
33
+ export default command;
34
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["command","describe","builder","argv","option","alias","type","demandOption","handler","args","default"],"sources":["index.js"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport const command = {\n command: \"login\",\n describe: \"Authenticate with an application ID\",\n builder: (argv) => {\n return argv\n .option(\"clientId\", {\n alias: \"applicationId\", // for backwards compatibility\n type: \"string\",\n demandOption: true,\n describe: \"OAuth client ID for application\",\n });\n },\n handler: async (args) => {\n const command = await import(\"@osdk/cli.common/loginFlow\");\n await command.default(args);\n },\n};\nexport default command;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,OAAO,GAAG;EACnBA,OAAO,EAAE,OAAO;EAChBC,QAAQ,EAAE,qCAAqC;EAC/CC,OAAO,EAAGC,IAAI,IAAK;IACf,OAAOA,IAAI,CACNC,MAAM,CAAC,UAAU,EAAE;MACpBC,KAAK,EAAE,eAAe;MAAE;MACxBC,IAAI,EAAE,QAAQ;MACdC,YAAY,EAAE,IAAI;MAClBN,QAAQ,EAAE;IACd,CAAC,CAAC;EACN,CAAC;EACDO,OAAO,EAAE,MAAOC,IAAI,IAAK;IACrB,MAAMT,OAAO,GAAG,MAAM,MAAM,CAAC,4BAA4B,CAAC;IAC1D,MAAMA,OAAO,CAACU,OAAO,CAACD,IAAI,CAAC;EAC/B;AACJ,CAAC;AACD,eAAeT,OAAO","ignoreList":[]}
@@ -0,0 +1,17 @@
1
+ /*
2
+ * Copyright 2023 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export {};
17
+ //# sourceMappingURL=CommonSiteArgs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommonSiteArgs.js","names":[],"sources":["CommonSiteArgs.js"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport {};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -0,0 +1,17 @@
1
+ /*
2
+ * Copyright 2023 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export {};
17
+ //# sourceMappingURL=SiteDeployArgs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SiteDeployArgs.js","names":[],"sources":["SiteDeployArgs.js"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport {};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -0,0 +1,108 @@
1
+ /*
2
+ * Copyright 2023 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { isValidSemver, YargsCheckError } from "@osdk/cli.common";
17
+ import configLoader from "../../../util/configLoader.js";
18
+ import { logDeployCommandConfigFileOverride } from "./logDeployCommandConfigFileOverride.js";
19
+ const command = {
20
+ command: "deploy",
21
+ describe: "Deploy a new site version",
22
+ builder: async argv => {
23
+ const config = await configLoader();
24
+ const siteConfig = config?.foundryConfig.site;
25
+ const directory = siteConfig?.directory;
26
+ const autoVersion = siteConfig?.autoVersion;
27
+ const gitTagPrefix = autoVersion?.tagPrefix;
28
+ return argv.options({
29
+ directory: {
30
+ type: "string",
31
+ description: "Directory containing site files",
32
+ ...(directory ? {
33
+ default: directory
34
+ } : {
35
+ demandOption: true
36
+ })
37
+ },
38
+ uploadOnly: {
39
+ type: "boolean",
40
+ description: "Upload new site version only without setting as live",
41
+ default: false
42
+ },
43
+ version: {
44
+ type: "string",
45
+ description: "New version of site to deploy",
46
+ ...(autoVersion == null ? {
47
+ conflicts: "autoVersion"
48
+ } : {})
49
+ },
50
+ autoVersion: {
51
+ coerce: autoVersion => autoVersion,
52
+ type: "string",
53
+ choices: ["git-describe"],
54
+ description: "Enable auto versioning",
55
+ ...(autoVersion != null ? {
56
+ default: autoVersion.type
57
+ } : {
58
+ conflicts: "version"
59
+ })
60
+ },
61
+ gitTagPrefix: {
62
+ type: "string",
63
+ description: "Prefix to match git tags on when 'git-describe' auto versioning is used. If not provided, all tags are matched and the prefix 'v' is stripped if present.",
64
+ ...(gitTagPrefix ? {
65
+ default: gitTagPrefix
66
+ } : {})
67
+ }
68
+ }).group(["directory", "version", "uploadOnly"], "Deploy Options").group(["autoVersion", "gitTagPrefix"], "Auto Version Options").check(args => {
69
+ // This is required because we can't use demandOption with conflicts. conflicts protects us against the case where both are provided.
70
+ // So this case is for when nothing is provided.
71
+ if (autoVersion == null && args.autoVersion == null && args.version == null) {
72
+ throw new YargsCheckError("One of --version or --autoVersion must be specified");
73
+ }
74
+ if (args.version != null && !isValidSemver(args.version)) {
75
+ throw new YargsCheckError(`--version "${args.version}" must be a valid SemVer string`);
76
+ }
77
+ const autoVersionType = args.autoVersion ?? autoVersion;
78
+ if (autoVersionType !== "git-describe") {
79
+ throw new YargsCheckError(`Only 'git-describe' is supported for autoVersion`);
80
+ }
81
+ const gitTagPrefixValue = args.gitTagPrefix ?? gitTagPrefix;
82
+ // Future proofing for when we support other autoVersion types
83
+ if (gitTagPrefixValue != null && autoVersionType !== "git-describe") {
84
+ throw new YargsCheckError(`--gitTagPrefix is only supported when --autoVersion=git-describe`);
85
+ }
86
+ return true;
87
+ }).middleware(args => logDeployCommandConfigFileOverride(args, siteConfig));
88
+ },
89
+ handler: async args => {
90
+ const command = await import("./siteDeployCommand.mjs");
91
+ const {
92
+ version,
93
+ autoVersion,
94
+ gitTagPrefix,
95
+ ...restArgs
96
+ } = args;
97
+ const selectedVersion = args.version != null ? args.version : {
98
+ type: args.autoVersion,
99
+ tagPrefix: args.gitTagPrefix
100
+ };
101
+ await command.default({
102
+ ...restArgs,
103
+ selectedVersion
104
+ });
105
+ }
106
+ };
107
+ export default command;
108
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["isValidSemver","YargsCheckError","configLoader","logDeployCommandConfigFileOverride","command","describe","builder","argv","config","siteConfig","foundryConfig","site","directory","autoVersion","gitTagPrefix","tagPrefix","options","type","description","default","demandOption","uploadOnly","version","conflicts","coerce","choices","group","check","args","autoVersionType","gitTagPrefixValue","middleware","handler","restArgs","selectedVersion"],"sources":["index.js"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { isValidSemver, YargsCheckError } from \"@osdk/cli.common\";\nimport configLoader from \"../../../util/configLoader.js\";\nimport { logDeployCommandConfigFileOverride } from \"./logDeployCommandConfigFileOverride.js\";\nconst command = {\n command: \"deploy\",\n describe: \"Deploy a new site version\",\n builder: async (argv) => {\n const config = await configLoader();\n const siteConfig = config?.foundryConfig.site;\n const directory = siteConfig?.directory;\n const autoVersion = siteConfig?.autoVersion;\n const gitTagPrefix = autoVersion?.tagPrefix;\n return argv\n .options({\n directory: {\n type: \"string\",\n description: \"Directory containing site files\",\n ...directory\n ? { default: directory }\n : { demandOption: true },\n },\n uploadOnly: {\n type: \"boolean\",\n description: \"Upload new site version only without setting as live\",\n default: false,\n },\n version: {\n type: \"string\",\n description: \"New version of site to deploy\",\n ...autoVersion == null\n ? { conflicts: \"autoVersion\" }\n : {},\n },\n autoVersion: {\n coerce: (autoVersion) => autoVersion,\n type: \"string\",\n choices: [\"git-describe\"],\n description: \"Enable auto versioning\",\n ...(autoVersion != null)\n ? { default: autoVersion.type }\n : { conflicts: \"version\" },\n },\n gitTagPrefix: {\n type: \"string\",\n description: \"Prefix to match git tags on when 'git-describe' auto versioning is used. If not provided, all tags are matched and the prefix 'v' is stripped if present.\",\n ...gitTagPrefix\n ? { default: gitTagPrefix }\n : {},\n },\n })\n .group([\"directory\", \"version\", \"uploadOnly\"], \"Deploy Options\")\n .group([\"autoVersion\", \"gitTagPrefix\"], \"Auto Version Options\")\n .check((args) => {\n // This is required because we can't use demandOption with conflicts. conflicts protects us against the case where both are provided.\n // So this case is for when nothing is provided.\n if (autoVersion == null && args.autoVersion == null\n && args.version == null) {\n throw new YargsCheckError(\"One of --version or --autoVersion must be specified\");\n }\n if (args.version != null && !isValidSemver(args.version)) {\n throw new YargsCheckError(`--version \"${args.version}\" must be a valid SemVer string`);\n }\n const autoVersionType = args.autoVersion ?? autoVersion;\n if (autoVersionType !== \"git-describe\") {\n throw new YargsCheckError(`Only 'git-describe' is supported for autoVersion`);\n }\n const gitTagPrefixValue = args.gitTagPrefix ?? gitTagPrefix;\n // Future proofing for when we support other autoVersion types\n if (gitTagPrefixValue != null && autoVersionType !== \"git-describe\") {\n throw new YargsCheckError(`--gitTagPrefix is only supported when --autoVersion=git-describe`);\n }\n return true;\n }).middleware((args) => logDeployCommandConfigFileOverride(args, siteConfig));\n },\n handler: async (args) => {\n const command = await import(\"./siteDeployCommand.mjs\");\n const { version, autoVersion, gitTagPrefix, ...restArgs } = args;\n const selectedVersion = args.version != null\n ? args.version\n : {\n type: args.autoVersion,\n tagPrefix: args.gitTagPrefix,\n };\n await command.default({ ...restArgs, selectedVersion });\n },\n};\nexport default command;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,aAAa,EAAEC,eAAe,QAAQ,kBAAkB;AACjE,OAAOC,YAAY,MAAM,+BAA+B;AACxD,SAASC,kCAAkC,QAAQ,yCAAyC;AAC5F,MAAMC,OAAO,GAAG;EACZA,OAAO,EAAE,QAAQ;EACjBC,QAAQ,EAAE,2BAA2B;EACrCC,OAAO,EAAE,MAAOC,IAAI,IAAK;IACrB,MAAMC,MAAM,GAAG,MAAMN,YAAY,CAAC,CAAC;IACnC,MAAMO,UAAU,GAAGD,MAAM,EAAEE,aAAa,CAACC,IAAI;IAC7C,MAAMC,SAAS,GAAGH,UAAU,EAAEG,SAAS;IACvC,MAAMC,WAAW,GAAGJ,UAAU,EAAEI,WAAW;IAC3C,MAAMC,YAAY,GAAGD,WAAW,EAAEE,SAAS;IAC3C,OAAOR,IAAI,CACNS,OAAO,CAAC;MACTJ,SAAS,EAAE;QACPK,IAAI,EAAE,QAAQ;QACdC,WAAW,EAAE,iCAAiC;QAC9C,IAAGN,SAAS,GACN;UAAEO,OAAO,EAAEP;QAAU,CAAC,GACtB;UAAEQ,YAAY,EAAE;QAAK,CAAC;MAChC,CAAC;MACDC,UAAU,EAAE;QACRJ,IAAI,EAAE,SAAS;QACfC,WAAW,EAAE,sDAAsD;QACnEC,OAAO,EAAE;MACb,CAAC;MACDG,OAAO,EAAE;QACLL,IAAI,EAAE,QAAQ;QACdC,WAAW,EAAE,+BAA+B;QAC5C,IAAGL,WAAW,IAAI,IAAI,GAChB;UAAEU,SAAS,EAAE;QAAc,CAAC,GAC5B,CAAC,CAAC;MACZ,CAAC;MACDV,WAAW,EAAE;QACTW,MAAM,EAAGX,WAAW,IAAKA,WAAW;QACpCI,IAAI,EAAE,QAAQ;QACdQ,OAAO,EAAE,CAAC,cAAc,CAAC;QACzBP,WAAW,EAAE,wBAAwB;QACrC,IAAIL,WAAW,IAAI,IAAI,GACjB;UAAEM,OAAO,EAAEN,WAAW,CAACI;QAAK,CAAC,GAC7B;UAAEM,SAAS,EAAE;QAAU,CAAC;MAClC,CAAC;MACDT,YAAY,EAAE;QACVG,IAAI,EAAE,QAAQ;QACdC,WAAW,EAAE,2JAA2J;QACxK,IAAGJ,YAAY,GACT;UAAEK,OAAO,EAAEL;QAAa,CAAC,GACzB,CAAC,CAAC;MACZ;IACJ,CAAC,CAAC,CACGY,KAAK,CAAC,CAAC,WAAW,EAAE,SAAS,EAAE,YAAY,CAAC,EAAE,gBAAgB,CAAC,CAC/DA,KAAK,CAAC,CAAC,aAAa,EAAE,cAAc,CAAC,EAAE,sBAAsB,CAAC,CAC9DC,KAAK,CAAEC,IAAI,IAAK;MACjB;MACA;MACA,IAAIf,WAAW,IAAI,IAAI,IAAIe,IAAI,CAACf,WAAW,IAAI,IAAI,IAC5Ce,IAAI,CAACN,OAAO,IAAI,IAAI,EAAE;QACzB,MAAM,IAAIrB,eAAe,CAAC,qDAAqD,CAAC;MACpF;MACA,IAAI2B,IAAI,CAACN,OAAO,IAAI,IAAI,IAAI,CAACtB,aAAa,CAAC4B,IAAI,CAACN,OAAO,CAAC,EAAE;QACtD,MAAM,IAAIrB,eAAe,CAAC,cAAc2B,IAAI,CAACN,OAAO,iCAAiC,CAAC;MAC1F;MACA,MAAMO,eAAe,GAAGD,IAAI,CAACf,WAAW,IAAIA,WAAW;MACvD,IAAIgB,eAAe,KAAK,cAAc,EAAE;QACpC,MAAM,IAAI5B,eAAe,CAAC,kDAAkD,CAAC;MACjF;MACA,MAAM6B,iBAAiB,GAAGF,IAAI,CAACd,YAAY,IAAIA,YAAY;MAC3D;MACA,IAAIgB,iBAAiB,IAAI,IAAI,IAAID,eAAe,KAAK,cAAc,EAAE;QACjE,MAAM,IAAI5B,eAAe,CAAC,kEAAkE,CAAC;MACjG;MACA,OAAO,IAAI;IACf,CAAC,CAAC,CAAC8B,UAAU,CAAEH,IAAI,IAAKzB,kCAAkC,CAACyB,IAAI,EAAEnB,UAAU,CAAC,CAAC;EACjF,CAAC;EACDuB,OAAO,EAAE,MAAOJ,IAAI,IAAK;IACrB,MAAMxB,OAAO,GAAG,MAAM,MAAM,CAAC,yBAAyB,CAAC;IACvD,MAAM;MAAEkB,OAAO;MAAET,WAAW;MAAEC,YAAY;MAAE,GAAGmB;IAAS,CAAC,GAAGL,IAAI;IAChE,MAAMM,eAAe,GAAGN,IAAI,CAACN,OAAO,IAAI,IAAI,GACtCM,IAAI,CAACN,OAAO,GACZ;MACEL,IAAI,EAAEW,IAAI,CAACf,WAAW;MACtBE,SAAS,EAAEa,IAAI,CAACd;IACpB,CAAC;IACL,MAAMV,OAAO,CAACe,OAAO,CAAC;MAAE,GAAGc,QAAQ;MAAEC;IAAgB,CAAC,CAAC;EAC3D;AACJ,CAAC;AACD,eAAe9B,OAAO","ignoreList":[]}
@@ -0,0 +1,28 @@
1
+ /*
2
+ * Copyright 2023 Palantir Technologies, Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { consola } from "consola";
17
+ export async function logDeployCommandConfigFileOverride(args, config) {
18
+ if (config?.autoVersion != null && args.autoVersion !== config?.autoVersion.type) {
19
+ consola.debug(`Overriding "autoVersion" from config file with ${args.autoVersion}`);
20
+ }
21
+ if (config?.directory != null && args.directory !== config?.directory) {
22
+ consola.debug(`Overriding "directory" from config file with ${args.directory}`);
23
+ }
24
+ if (config?.autoVersion?.tagPrefix != null && args.gitTagPrefix != null && args.gitTagPrefix !== config?.autoVersion.tagPrefix) {
25
+ consola.debug(`Overriding "gitTagPrefix" from config file with ${args.gitTagPrefix}`);
26
+ }
27
+ }
28
+ //# sourceMappingURL=logDeployCommandConfigFileOverride.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logDeployCommandConfigFileOverride.js","names":["consola","logDeployCommandConfigFileOverride","args","config","autoVersion","type","debug","directory","tagPrefix","gitTagPrefix"],"sources":["logDeployCommandConfigFileOverride.js"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { consola } from \"consola\";\nexport async function logDeployCommandConfigFileOverride(args, config) {\n if (config?.autoVersion != null && args.autoVersion !== config?.autoVersion.type) {\n consola.debug(`Overriding \"autoVersion\" from config file with ${args.autoVersion}`);\n }\n if (config?.directory != null && args.directory !== config?.directory) {\n consola.debug(`Overriding \"directory\" from config file with ${args.directory}`);\n }\n if (config?.autoVersion?.tagPrefix != null\n && args.gitTagPrefix != null\n && args.gitTagPrefix !== config?.autoVersion.tagPrefix) {\n consola.debug(`Overriding \"gitTagPrefix\" from config file with ${args.gitTagPrefix}`);\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,SAAS;AACjC,OAAO,eAAeC,kCAAkCA,CAACC,IAAI,EAAEC,MAAM,EAAE;EACnE,IAAIA,MAAM,EAAEC,WAAW,IAAI,IAAI,IAAIF,IAAI,CAACE,WAAW,KAAKD,MAAM,EAAEC,WAAW,CAACC,IAAI,EAAE;IAC9EL,OAAO,CAACM,KAAK,CAAC,kDAAkDJ,IAAI,CAACE,WAAW,EAAE,CAAC;EACvF;EACA,IAAID,MAAM,EAAEI,SAAS,IAAI,IAAI,IAAIL,IAAI,CAACK,SAAS,KAAKJ,MAAM,EAAEI,SAAS,EAAE;IACnEP,OAAO,CAACM,KAAK,CAAC,gDAAgDJ,IAAI,CAACK,SAAS,EAAE,CAAC;EACnF;EACA,IAAIJ,MAAM,EAAEC,WAAW,EAAEI,SAAS,IAAI,IAAI,IACnCN,IAAI,CAACO,YAAY,IAAI,IAAI,IACzBP,IAAI,CAACO,YAAY,KAAKN,MAAM,EAAEC,WAAW,CAACI,SAAS,EAAE;IACxDR,OAAO,CAACM,KAAK,CAAC,mDAAmDJ,IAAI,CAACO,YAAY,EAAE,CAAC;EACzF;AACJ","ignoreList":[]}