@codiac.io/codiac-cli 1.2.127 → 1.2.129

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 (310) hide show
  1. package/lib/apis/codiac-relay/gen/client.d.ts +1 -1
  2. package/lib/apis/codiac-relay/gen/client.js +13 -13
  3. package/lib/apis/codiac-relay/gen/client.js.map +1 -1
  4. package/lib/cli-common/ImagesList.d.ts +0 -0
  5. package/lib/cli-common/ImagesList.js +67 -0
  6. package/lib/cli-common/ImagesList.js.map +1 -0
  7. package/lib/cli-common/argument-manager.d.ts +28 -0
  8. package/lib/cli-common/argument-manager.js +195 -0
  9. package/lib/cli-common/argument-manager.js.map +1 -0
  10. package/lib/cli-common/built-in-cli-user-input.d.ts +18 -0
  11. package/lib/cli-common/built-in-cli-user-input.js +310 -0
  12. package/lib/cli-common/built-in-cli-user-input.js.map +1 -0
  13. package/lib/cli-common/cli-interfaces.d.ts +0 -0
  14. package/lib/cli-common/cli-interfaces.js +7 -0
  15. package/lib/cli-common/cli-interfaces.js.map +1 -0
  16. package/lib/cli-common/command-base.d.ts +74 -0
  17. package/lib/cli-common/command-base.js +173 -0
  18. package/lib/cli-common/command-base.js.map +1 -0
  19. package/lib/cli-common/entities/index.d.ts +1 -0
  20. package/lib/cli-common/entities/index.js +5 -0
  21. package/lib/cli-common/entities/index.js.map +1 -0
  22. package/lib/cli-common/entities/prompt-choice.d.ts +7 -0
  23. package/lib/cli-common/entities/prompt-choice.js +3 -0
  24. package/lib/cli-common/entities/prompt-choice.js.map +1 -0
  25. package/lib/cli-common/file-selector.d.ts +48 -0
  26. package/lib/cli-common/file-selector.js +187 -0
  27. package/lib/cli-common/file-selector.js.map +1 -0
  28. package/lib/cli-common/i-user-input-provider.d.ts +0 -0
  29. package/lib/cli-common/i-user-input-provider.js +19 -0
  30. package/lib/cli-common/i-user-input-provider.js.map +1 -0
  31. package/lib/cli-common/index.d.ts +4 -0
  32. package/lib/cli-common/index.js +11 -0
  33. package/lib/cli-common/index.js.map +1 -0
  34. package/lib/cli-common/mock-ui.d.ts +27 -0
  35. package/lib/cli-common/mock-ui.js +83 -0
  36. package/lib/cli-common/mock-ui.js.map +1 -0
  37. package/lib/cli-common/prompt-select-fuzzy.d.ts +19 -0
  38. package/lib/cli-common/prompt-select-fuzzy.js +119 -0
  39. package/lib/cli-common/prompt-select-fuzzy.js.map +1 -0
  40. package/lib/cli-common/tenant-contextualizer.d.ts +0 -0
  41. package/lib/cli-common/tenant-contextualizer.js +436 -0
  42. package/lib/cli-common/tenant-contextualizer.js.map +1 -0
  43. package/lib/cli-common/test/tenant-contextualizer.spec.d.ts +0 -0
  44. package/lib/cli-common/test/tenant-contextualizer.spec.js +143 -0
  45. package/lib/cli-common/test/tenant-contextualizer.spec.js.map +1 -0
  46. package/lib/command-base-enterprise.d.ts +3 -18
  47. package/lib/command-base-enterprise.js +8 -69
  48. package/lib/command-base-enterprise.js.map +1 -1
  49. package/lib/command-base-tenantless.d.ts +3 -3
  50. package/lib/command-base-tenantless.js +16 -16
  51. package/lib/command-base-tenantless.js.map +1 -1
  52. package/lib/commands/asset/create.js +2 -2
  53. package/lib/commands/asset/create.js.map +1 -1
  54. package/lib/commands/build.js +2 -2
  55. package/lib/commands/build.js.map +1 -1
  56. package/lib/commands/cabinet/create.js +2 -2
  57. package/lib/commands/cabinet/create.js.map +1 -1
  58. package/lib/commands/cabinet/obliterate.js +1 -1
  59. package/lib/commands/cabinet/obliterate.js.map +1 -1
  60. package/lib/commands/commit.js +1 -1
  61. package/lib/commands/commit.js.map +1 -1
  62. package/lib/commands/enterprise/create.js +2 -2
  63. package/lib/commands/enterprise/create.js.map +1 -1
  64. package/lib/commands/environment/create.js +2 -2
  65. package/lib/commands/environment/create.js.map +1 -1
  66. package/lib/commands/filestore/capture.d.ts +0 -2
  67. package/lib/commands/filestore/capture.js +34 -31
  68. package/lib/commands/filestore/capture.js.map +1 -1
  69. package/lib/commands/identity/delete.js +2 -2
  70. package/lib/commands/identity/delete.js.map +1 -1
  71. package/lib/commands/identity.js +3 -3
  72. package/lib/commands/identity.js.map +1 -1
  73. package/lib/commands/init.js +4 -4
  74. package/lib/commands/init.js.map +1 -1
  75. package/lib/commands/login.js +1 -1
  76. package/lib/commands/login.js.map +1 -1
  77. package/lib/commands/publish.d.ts +3 -0
  78. package/lib/commands/publish.js +7 -3
  79. package/lib/commands/publish.js.map +1 -1
  80. package/lib/commands/pull.js +1 -1
  81. package/lib/commands/pull.js.map +1 -1
  82. package/lib/commands/push.js +1 -1
  83. package/lib/commands/push.js.map +1 -1
  84. package/lib/commands/run.js +6 -6
  85. package/lib/commands/run.js.map +1 -1
  86. package/lib/commands/sync.js +1 -1
  87. package/lib/commands/sync.js.map +1 -1
  88. package/lib/commands/tenant/create.js +4 -4
  89. package/lib/commands/tenant/create.js.map +1 -1
  90. package/lib/commands/tenant/switch.js +4 -4
  91. package/lib/commands/tenant/switch.js.map +1 -1
  92. package/lib/ops/INTERFACES_CLI.d.ts +3 -0
  93. package/lib/ops/INTERFACES_CLI.js +8 -0
  94. package/lib/ops/INTERFACES_CLI.js.map +1 -0
  95. package/lib/ops/LocalOps.d.ts +444 -0
  96. package/lib/ops/LocalOps.js +3184 -0
  97. package/lib/ops/LocalOps.js.map +1 -0
  98. package/lib/ops/azure-container-registry-client/azure-container-registry-client.d.ts +0 -0
  99. package/lib/ops/azure-container-registry-client/azure-container-registry-client.js +148 -0
  100. package/lib/ops/azure-container-registry-client/azure-container-registry-client.js.map +1 -0
  101. package/lib/ops/cli-path-walker.d.ts +0 -0
  102. package/lib/ops/cli-path-walker.js +55 -0
  103. package/lib/ops/cli-path-walker.js.map +1 -0
  104. package/lib/ops/codiac-entities/dependency.d.ts +5 -0
  105. package/lib/ops/codiac-entities/dependency.js +11 -0
  106. package/lib/ops/codiac-entities/dependency.js.map +1 -0
  107. package/lib/ops/codiac-entities/index.d.ts +1 -0
  108. package/lib/ops/codiac-entities/index.js +5 -0
  109. package/lib/ops/codiac-entities/index.js.map +1 -0
  110. package/lib/ops/composite-image-registry-client.d.ts +0 -0
  111. package/lib/ops/composite-image-registry-client.js +74 -0
  112. package/lib/ops/composite-image-registry-client.js.map +1 -0
  113. package/lib/ops/data/cli-context-repo.d.ts +61 -0
  114. package/lib/ops/data/cli-context-repo.js +270 -0
  115. package/lib/ops/data/cli-context-repo.js.map +1 -0
  116. package/lib/ops/data/index.d.ts +2 -0
  117. package/lib/ops/data/index.js +6 -0
  118. package/lib/ops/data/index.js.map +1 -0
  119. package/lib/ops/data/npm-config-repo.d.ts +13 -0
  120. package/lib/ops/data/npm-config-repo.js +65 -0
  121. package/lib/ops/data/npm-config-repo.js.map +1 -0
  122. package/lib/ops/docker-config.d.ts +0 -0
  123. package/lib/ops/docker-config.js +131 -0
  124. package/lib/ops/docker-config.js.map +1 -0
  125. package/lib/ops/docker-constants.d.ts +0 -0
  126. package/lib/ops/docker-constants.js +22 -0
  127. package/lib/ops/docker-constants.js.map +1 -0
  128. package/lib/ops/docker-credentials-store.d.ts +0 -0
  129. package/lib/ops/docker-credentials-store.js +238 -0
  130. package/lib/ops/docker-credentials-store.js.map +1 -0
  131. package/lib/ops/docker-registry-api-client/docker-registry-api-client.d.ts +0 -0
  132. package/lib/ops/docker-registry-api-client/docker-registry-api-client.js +289 -0
  133. package/lib/ops/docker-registry-api-client/docker-registry-api-client.js.map +1 -0
  134. package/lib/ops/docker-registry-api-client/entities/blob-sum.d.ts +7 -0
  135. package/lib/ops/docker-registry-api-client/entities/blob-sum.js +13 -0
  136. package/lib/ops/docker-registry-api-client/entities/blob-sum.js.map +1 -0
  137. package/lib/ops/docker-registry-api-client/entities/docker-access-actions-enum.d.ts +5 -0
  138. package/lib/ops/docker-registry-api-client/entities/docker-access-actions-enum.js +10 -0
  139. package/lib/ops/docker-registry-api-client/entities/docker-access-actions-enum.js.map +1 -0
  140. package/lib/ops/docker-registry-api-client/entities/docker-auth-token-criteria.d.ts +30 -0
  141. package/lib/ops/docker-registry-api-client/entities/docker-auth-token-criteria.js +36 -0
  142. package/lib/ops/docker-registry-api-client/entities/docker-auth-token-criteria.js.map +1 -0
  143. package/lib/ops/docker-registry-api-client/entities/i-docker-error-response.d.ts +55 -0
  144. package/lib/ops/docker-registry-api-client/entities/i-docker-error-response.js +52 -0
  145. package/lib/ops/docker-registry-api-client/entities/i-docker-error-response.js.map +1 -0
  146. package/lib/ops/docker-registry-api-client/entities/i-docker-list-response.d.ts +7 -0
  147. package/lib/ops/docker-registry-api-client/entities/i-docker-list-response.js +3 -0
  148. package/lib/ops/docker-registry-api-client/entities/i-docker-list-response.js.map +1 -0
  149. package/lib/ops/docker-registry-api-client/entities/image-repository.d.ts +31 -0
  150. package/lib/ops/docker-registry-api-client/entities/image-repository.js +30 -0
  151. package/lib/ops/docker-registry-api-client/entities/image-repository.js.map +1 -0
  152. package/lib/ops/docker-registry-api-client/entities/image-tag-criteria.d.ts +8 -0
  153. package/lib/ops/docker-registry-api-client/entities/image-tag-criteria.js +14 -0
  154. package/lib/ops/docker-registry-api-client/entities/image-tag-criteria.js.map +1 -0
  155. package/lib/ops/docker-registry-api-client/entities/image-tag-list.d.ts +7 -0
  156. package/lib/ops/docker-registry-api-client/entities/image-tag-list.js +13 -0
  157. package/lib/ops/docker-registry-api-client/entities/image-tag-list.js.map +1 -0
  158. package/lib/ops/docker-registry-api-client/entities/manifest-criteria.d.ts +9 -0
  159. package/lib/ops/docker-registry-api-client/entities/manifest-criteria.js +15 -0
  160. package/lib/ops/docker-registry-api-client/entities/manifest-criteria.js.map +1 -0
  161. package/lib/ops/docker-registry-api-client/entities/manifest.d.ts +15 -0
  162. package/lib/ops/docker-registry-api-client/entities/manifest.js +21 -0
  163. package/lib/ops/docker-registry-api-client/entities/manifest.js.map +1 -0
  164. package/lib/ops/docker-registry-api-client/entities/repository-criteria.d.ts +16 -0
  165. package/lib/ops/docker-registry-api-client/entities/repository-criteria.js +24 -0
  166. package/lib/ops/docker-registry-api-client/entities/repository-criteria.js.map +1 -0
  167. package/lib/ops/docker-registry-api-client/entities/token-response.d.ts +15 -0
  168. package/lib/ops/docker-registry-api-client/entities/token-response.js +15 -0
  169. package/lib/ops/docker-registry-api-client/entities/token-response.js.map +1 -0
  170. package/lib/ops/docker-registry-api-client/entities/token.d.ts +17 -0
  171. package/lib/ops/docker-registry-api-client/entities/token.js +22 -0
  172. package/lib/ops/docker-registry-api-client/entities/token.js.map +1 -0
  173. package/lib/ops/docker-registry-api-client/entities/version-check-criteria.d.ts +4 -0
  174. package/lib/ops/docker-registry-api-client/entities/version-check-criteria.js +10 -0
  175. package/lib/ops/docker-registry-api-client/entities/version-check-criteria.js.map +1 -0
  176. package/lib/ops/dx-constants.d.ts +26 -0
  177. package/lib/ops/dx-constants.js +43 -0
  178. package/lib/ops/dx-constants.js.map +1 -0
  179. package/lib/ops/entities/ImageBuildContext.d.ts +12 -0
  180. package/lib/ops/entities/ImageBuildContext.js +19 -0
  181. package/lib/ops/entities/ImageBuildContext.js.map +1 -0
  182. package/lib/ops/entities/PipelineContext.d.ts +21 -0
  183. package/lib/ops/entities/PipelineContext.js +23 -0
  184. package/lib/ops/entities/PipelineContext.js.map +1 -0
  185. package/lib/ops/entities/TenantContext.d.ts +10 -0
  186. package/lib/ops/entities/TenantContext.js +16 -0
  187. package/lib/ops/entities/TenantContext.js.map +1 -0
  188. package/lib/ops/entities/ThaulConfig.d.ts +0 -0
  189. package/lib/ops/entities/ThaulConfig.js +30 -0
  190. package/lib/ops/entities/ThaulConfig.js.map +1 -0
  191. package/lib/ops/entities/azure-service-principal.d.ts +23 -0
  192. package/lib/ops/entities/azure-service-principal.js +24 -0
  193. package/lib/ops/entities/azure-service-principal.js.map +1 -0
  194. package/lib/ops/entities/better-logger.d.ts +0 -0
  195. package/lib/ops/entities/better-logger.js +2 -0
  196. package/lib/ops/entities/better-logger.js.map +1 -0
  197. package/lib/ops/entities/branch.d.ts +13 -0
  198. package/lib/ops/entities/branch.js +16 -0
  199. package/lib/ops/entities/branch.js.map +1 -0
  200. package/lib/ops/entities/cli-config.d.ts +48 -0
  201. package/lib/ops/entities/cli-config.js +61 -0
  202. package/lib/ops/entities/cli-config.js.map +1 -0
  203. package/lib/ops/entities/docker-image.d.ts +60 -0
  204. package/lib/ops/entities/docker-image.js +3 -0
  205. package/lib/ops/entities/docker-image.js.map +1 -0
  206. package/lib/ops/entities/helm-spec.d.ts +15 -0
  207. package/lib/ops/entities/helm-spec.js +23 -0
  208. package/lib/ops/entities/helm-spec.js.map +1 -0
  209. package/lib/ops/entities/index.d.ts +3 -0
  210. package/lib/ops/entities/index.js +11 -0
  211. package/lib/ops/entities/index.js.map +1 -0
  212. package/lib/ops/entities/scaffolding.d.ts +19 -0
  213. package/lib/ops/entities/scaffolding.js +21 -0
  214. package/lib/ops/entities/scaffolding.js.map +1 -0
  215. package/lib/ops/extensions/azart-identity-adapter.d.ts +19 -0
  216. package/lib/ops/extensions/azart-identity-adapter.js +97 -0
  217. package/lib/ops/extensions/azart-identity-adapter.js.map +1 -0
  218. package/lib/ops/extensions/npm-identity-adapter-base.d.ts +13 -0
  219. package/lib/ops/extensions/npm-identity-adapter-base.js +3 -0
  220. package/lib/ops/extensions/npm-identity-adapter-base.js.map +1 -0
  221. package/lib/ops/extensions/npmjs-identity-adapter.d.ts +13 -0
  222. package/lib/ops/extensions/npmjs-identity-adapter.js +64 -0
  223. package/lib/ops/extensions/npmjs-identity-adapter.js.map +1 -0
  224. package/lib/ops/git-ops.d.ts +8 -0
  225. package/lib/ops/git-ops.js +14 -0
  226. package/lib/ops/git-ops.js.map +1 -0
  227. package/lib/ops/i-client-for-image-registry.d.ts +0 -0
  228. package/lib/ops/i-client-for-image-registry.js +17 -0
  229. package/lib/ops/i-client-for-image-registry.js.map +1 -0
  230. package/lib/ops/i-identity-handler.d.ts +33 -0
  231. package/lib/ops/i-identity-handler.js +165 -0
  232. package/lib/ops/i-identity-handler.js.map +1 -0
  233. package/lib/ops/i-output-styler.d.ts +0 -0
  234. package/lib/ops/i-output-styler.js +17 -0
  235. package/lib/ops/i-output-styler.js.map +1 -0
  236. package/lib/ops/index.d.ts +12 -0
  237. package/lib/ops/index.js +15 -0
  238. package/lib/ops/index.js.map +1 -0
  239. package/lib/ops/json-utils.d.ts +0 -0
  240. package/lib/ops/json-utils.js +59 -0
  241. package/lib/ops/json-utils.js.map +1 -0
  242. package/lib/ops/no-style-output-styler.d.ts +0 -0
  243. package/lib/ops/no-style-output-styler.js +30 -0
  244. package/lib/ops/no-style-output-styler.js.map +1 -0
  245. package/lib/ops/oauth2-client.ts/oauth2-client.d.ts +23 -0
  246. package/lib/ops/oauth2-client.ts/oauth2-client.js +64 -0
  247. package/lib/ops/oauth2-client.ts/oauth2-client.js.map +1 -0
  248. package/lib/ops/project-initializer.d.ts +36 -0
  249. package/lib/ops/project-initializer.js +219 -0
  250. package/lib/ops/project-initializer.js.map +1 -0
  251. package/lib/ops/scaffolding/base-scaffolding.d.ts +7 -0
  252. package/lib/ops/scaffolding/base-scaffolding.js +21 -0
  253. package/lib/ops/scaffolding/base-scaffolding.js.map +1 -0
  254. package/lib/ops/scaffolding/codiac-api-scaffolding.d.ts +7 -0
  255. package/lib/ops/scaffolding/codiac-api-scaffolding.js +64 -0
  256. package/lib/ops/scaffolding/codiac-api-scaffolding.js.map +1 -0
  257. package/lib/ops/scaffolding/typescript-scaffolding.d.ts +15 -0
  258. package/lib/ops/scaffolding/typescript-scaffolding.js +163 -0
  259. package/lib/ops/scaffolding/typescript-scaffolding.js.map +1 -0
  260. package/lib/ops/test/mock-ui.d.ts +26 -0
  261. package/lib/ops/test/mock-ui.js +88 -0
  262. package/lib/ops/test/mock-ui.js.map +1 -0
  263. package/lib/ops/test/test-extensions.d.ts +13 -0
  264. package/lib/ops/test/test-extensions.js +71 -0
  265. package/lib/ops/test/test-extensions.js.map +1 -0
  266. package/lib/ops/test/when-a-recursive-file-search-is-run.spec.d.ts +2 -0
  267. package/lib/ops/test/when-a-recursive-file-search-is-run.spec.js +55 -0
  268. package/lib/ops/test/when-a-recursive-file-search-is-run.spec.js.map +1 -0
  269. package/lib/ops/test/when-git-branchline-is-attempted.spec.d.ts +2 -0
  270. package/lib/ops/test/when-git-branchline-is-attempted.spec.js +38 -0
  271. package/lib/ops/test/when-git-branchline-is-attempted.spec.js.map +1 -0
  272. package/lib/ops/test/when-versions-are-parsed.spec.d.ts +2 -0
  273. package/lib/ops/test/when-versions-are-parsed.spec.js +60 -0
  274. package/lib/ops/test/when-versions-are-parsed.spec.js.map +1 -0
  275. package/lib/ops/throwing-user-input-provider.d.ts +0 -0
  276. package/lib/ops/throwing-user-input-provider.js +37 -0
  277. package/lib/ops/throwing-user-input-provider.js.map +1 -0
  278. package/lib/relay/relay-container.js +1 -1
  279. package/lib/uilogic/build-configurator.d.ts +1 -1
  280. package/lib/uilogic/build-configurator.js +2 -2
  281. package/lib/uilogic/build-configurator.js.map +1 -1
  282. package/lib/uilogic/cloud-provider-contextualizer.d.ts +2 -1
  283. package/lib/uilogic/cloud-provider-contextualizer.js +8 -4
  284. package/lib/uilogic/cloud-provider-contextualizer.js.map +1 -1
  285. package/lib/uilogic/cloud-resource-configurators/aws-resource-configurator.d.ts +1 -1
  286. package/lib/uilogic/cloud-resource-configurators/aws-resource-configurator.js +1 -1
  287. package/lib/uilogic/cloud-resource-configurators/aws-resource-configurator.js.map +1 -1
  288. package/lib/uilogic/cloud-resource-configurators/az-acr-cli-authenticator.d.ts +0 -16
  289. package/lib/uilogic/cloud-resource-configurators/az-acr-cli-authenticator.js +76 -83
  290. package/lib/uilogic/cloud-resource-configurators/az-acr-cli-authenticator.js.map +1 -1
  291. package/lib/uilogic/cloud-resource-configurators/azure-resource-configurator.d.ts +1 -1
  292. package/lib/uilogic/cloud-resource-configurators/azure-resource-configurator.js +4 -4
  293. package/lib/uilogic/cloud-resource-configurators/azure-resource-configurator.js.map +1 -1
  294. package/lib/uilogic/cloud-resource-configurators/docker-hub-resource-configurator.d.ts +1 -1
  295. package/lib/uilogic/cloud-resource-configurators/docker-hub-resource-configurator.js +1 -1
  296. package/lib/uilogic/cloud-resource-configurators/docker-hub-resource-configurator.js.map +1 -1
  297. package/lib/uilogic/enterprise-contextualizer.d.ts +1 -1
  298. package/lib/uilogic/enterprise-contextualizer.js +6 -1
  299. package/lib/uilogic/enterprise-contextualizer.js.map +1 -1
  300. package/lib/uilogic/i-login-configurator.d.ts +1 -1
  301. package/lib/uilogic/image-configurator.d.ts +0 -1
  302. package/lib/uilogic/image-configurator.js +27 -47
  303. package/lib/uilogic/image-configurator.js.map +1 -1
  304. package/lib/uilogic/image-contextualizer.js +2 -2
  305. package/lib/uilogic/image-contextualizer.js.map +1 -1
  306. package/lib/uilogic/tenant-contextualizer.d.ts +1 -1
  307. package/lib/uilogic/tenant-contextualizer.js +3 -3
  308. package/lib/uilogic/tenant-contextualizer.js.map +1 -1
  309. package/oclif.manifest.json +1 -1
  310. package/package.json +4 -4
@@ -0,0 +1,270 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProjectContextRepo = exports.CliGlobalConfigRepo = exports.JsonFileRepoFor = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const path = require("path");
6
+ const fs = require("fs");
7
+ const Case = require("case");
8
+ const codiac_common_1 = require("@codiac.io/codiac-common");
9
+ const codiac_relay_contracts_1 = require("@codiac.io/codiac-relay-contracts");
10
+ const codiac_ops_common_1 = require("@codiac.io/codiac-ops-common");
11
+ const entities_1 = require("../entities");
12
+ const dx_constants_1 = require("../dx-constants");
13
+ const inversify_1 = require("inversify");
14
+ /** Performs cruds on an entity stored on the local hard drive as single json file.
15
+ */
16
+ let JsonFileRepoFor = class JsonFileRepoFor {
17
+ constructor(settings) {
18
+ this.settings = settings;
19
+ }
20
+ };
21
+ JsonFileRepoFor = tslib_1.__decorate([
22
+ (0, inversify_1.injectable)(),
23
+ tslib_1.__param(0, (0, inversify_1.unmanaged)()),
24
+ tslib_1.__metadata("design:paramtypes", [Object])
25
+ ], JsonFileRepoFor);
26
+ exports.JsonFileRepoFor = JsonFileRepoFor;
27
+ let CliGlobalConfigRepo = class CliGlobalConfigRepo extends JsonFileRepoFor {
28
+ constructor(cliEnviro) {
29
+ super({ parentFolder: cliEnviro.cliConfigDir, fileName: entities_1.CliConfig.FILENAME });
30
+ this.entityTypeName = (0, codiac_common_1.typeNameOf)(entities_1.CliConfig);
31
+ }
32
+ // tryCreate(entity: T, options?: IRepoOptions): Promise<contracts.SingleResult<T>>;
33
+ /** Returns an empty config object when undefined.
34
+ * TODO: Consider changing signature to also return undefined.
35
+ */
36
+ read() {
37
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
38
+ return new Promise((resolve, reject) => tslib_1.__awaiter(this, void 0, void 0, function* () {
39
+ try {
40
+ let pathName = path.join(this.settings.parentFolder, this.settings.fileName);
41
+ let config = codiac_ops_common_1.JsonUtils.deserializeJsonFile(pathName);
42
+ if (!config)
43
+ config = new entities_1.CliConfig();
44
+ resolve(config);
45
+ }
46
+ catch (err) {
47
+ reject(new Error(`Error reading ${this.entityTypeName}: ${err.message || err.stderr || ""}.\n${err}`));
48
+ }
49
+ }));
50
+ });
51
+ }
52
+ // tryUpdate(entity: T, options?: IRepoOptions): Promise<contracts.SingleResult<T>>;
53
+ upsert(entity) {
54
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
55
+ return new Promise((resolve, reject) => tslib_1.__awaiter(this, void 0, void 0, function* () {
56
+ try {
57
+ let pathName = path.join(this.settings.parentFolder, this.settings.fileName);
58
+ codiac_ops_common_1.JsonUtils.serializeJsonFile(entity, pathName);
59
+ resolve(entity);
60
+ }
61
+ catch (err) {
62
+ reject(new Error(`Error writing ${this.entityTypeName}: ${err.message || err.stderr || ""}.\n${err}`));
63
+ }
64
+ }));
65
+ });
66
+ }
67
+ // tryUpdatePartial(entity: Partial<T>, options?: IRepoOptions): Promise<contracts.SingleResult<Partial<T>>>;
68
+ // tryPatch(operations: contracts.PatchSpecForOne<T>, options?: IRepoOptions): Promise<contracts.SingleResult<T>>;
69
+ // tryDelete(idSpec: contracts.IdSpec, options?: IRepoOptions): Promise<contracts.SingleResult<T>>;
70
+ /** Deserializes the global Codiac CLI configuration file.
71
+ * @deprecated Use cliGlobalConfigRepo.read() instead.
72
+ */
73
+ read_sync() {
74
+ // cli.log(`Reading cli config from: ${path.join(this.cliConfigDir, CliConfig.FILENAME)}`);
75
+ // let config = JsonUtils.deserializeJsonFile<CliConfig>(path.join(this.cliEnviro.cliConfigDir, CliConfig.FILENAME));
76
+ let config = codiac_ops_common_1.JsonUtils.deserializeJsonFile(path.join(this.settings.parentFolder, this.settings.fileName));
77
+ // TODO: trim off any properties that dont exist on the CliConfig prototype.
78
+ return config;
79
+ }
80
+ /** Serializes the global Codiac CLI configuration object.
81
+ *
82
+ * @deprecated Use cliGlobalConfigRepo.upsert() instead.
83
+ */
84
+ write_sync(config) {
85
+ // JsonUtils.serializeJsonFile(config, path.join(this.cliEnviro.cliConfigDir, CliConfig.FILENAME));
86
+ codiac_ops_common_1.JsonUtils.serializeJsonFile(config, path.join(this.settings.parentFolder, this.settings.fileName));
87
+ }
88
+ };
89
+ CliGlobalConfigRepo = tslib_1.__decorate([
90
+ (0, inversify_1.injectable)(),
91
+ tslib_1.__param(0, (0, inversify_1.inject)(entities_1.CliEnviro)),
92
+ tslib_1.__metadata("design:paramtypes", [entities_1.CliEnviro])
93
+ ], CliGlobalConfigRepo);
94
+ exports.CliGlobalConfigRepo = CliGlobalConfigRepo;
95
+ // /** TODO: Move this to codiac-cli-common
96
+ // * Legacy methods extracted from ProjectContextRepo (formerly CliContextRepo)
97
+ // *
98
+ // */
99
+ // @injectable()
100
+ // export class CliGlobalConfigRepo_sync {
101
+ // constructor(@inject(CliEnviro) private cliEnviro: CliEnviro) {
102
+ // }
103
+ // // =========================================================================================== //
104
+ // // //
105
+ // // CLI CONFIG //
106
+ // // //
107
+ // // =========================================================================================== //
108
+ // }
109
+ /** Primary source for reading and writing project config files
110
+ * for the current context of the project.
111
+ * That is: the project config and project-user config...
112
+ * @param projRoot Fully qualified path to the folder containing the project declaration file from which to scope method calls for this class. */
113
+ let ProjectContextRepo = class ProjectContextRepo {
114
+ constructor(projectEnviro) {
115
+ this.projRoot = projectEnviro.projectRoot;
116
+ }
117
+ // Commented out bc moved to UserContextManagger in codiac-ops-enterprise
118
+ // // =========================================================================================== //
119
+ // // //
120
+ // // USER CONFIG //
121
+ // // //
122
+ // // =========================================================================================== //
123
+ // /** Attempts to load the user and all of their tenant tokens persisted locally by the Toyhauler CLI.
124
+ // * Returns undefined for not found and throws any encountered exceptions. */
125
+ // public loadUserContext(tenantCode: string): UserContext | undefined {
126
+ // // this.logger.trace(`Reading ${path.join("~/", LocalOps.CLI_CONFIG_FOLDER_NAME, LocalOps.USER_CONTEXT_FILENAME)}`)
127
+ // let context = JsonUtils.deserializeJsonFile<UserContext>(path.join("~/", DxConstants.CLI_CONFIG_FOLDER_NAME, DxConstants.USER_CONTEXT_FILENAME));
128
+ // // if (context) {
129
+ // // this.logger.trace(`Current user context (from cache). User: ${context.userName}, TenantCode: ${context.currentTenantCode}`)
130
+ // // }
131
+ // return context;
132
+ // }
133
+ // /** Writes the given UserContext to the Toyhauler user config folder on the local machine.
134
+ // * TODO: Consider writing this to the cache folder instead of the config folder.
135
+ // * Throws any encountered exceptions. */
136
+ // public writeUserContext(userContext: UserContext): void {
137
+ // let pathName = path.join("~/", DxConstants.CLI_CONFIG_FOLDER_NAME, DxConstants.USER_CONTEXT_FILENAME);
138
+ // // this.logger.debug(`Writing UserContext to ${pathName}`);
139
+ // JsonUtils.serializeJsonFile(userContext, pathName);
140
+ // }
141
+ // /** Persists the current user, its token, and its tenantCode to the user context
142
+ // * and the userContext file stored on the local machine. */
143
+ // public async saveToUserContext(currentContext: UserContext | undefined, userName: string, token: string, tenantCode?: string, tokenExpiration?: Date): Promise<UserContext> {
144
+ // return new Promise<UserContext>(async (resolve, reject) => {
145
+ // try {
146
+ // // if (userName) {
147
+ // if (!currentContext) { // wanna load it here? this._cntx = await this.loadUserContext(user.tenantCode);
148
+ // currentContext = new UserContext(userName, tenantCode, token, tokenExpiration);
149
+ // } else {
150
+ // currentContext.userName = userName;
151
+ // currentContext.currentTenantCode = tenantCode;
152
+ // currentContext.currentToken = token;
153
+ // currentContext.tokenExpiration = tokenExpiration;
154
+ // if (tenantCode) currentContext.tokens[tenantCode] = token
155
+ // }
156
+ // await this.writeUserContext(currentContext);
157
+ // // } else {
158
+ // // // null input - do nothing.
159
+ // // TODO: Consider either throwing an error here OR changing signature to return an undefined.
160
+ // // }
161
+ // resolve(currentContext);
162
+ // } catch (err) {
163
+ // reject(err);
164
+ // }
165
+ // });
166
+ // }
167
+ // =========================================================================================== //
168
+ // //
169
+ // PROJECT CONFIG //
170
+ // //
171
+ // =========================================================================================== //
172
+ /** Deserializes the Toyhauler config file in scope for the current working directory.
173
+ * Throws if none is defined up the folder tree. */
174
+ readProjectConfig(folder) {
175
+ let root = folder ? codiac_ops_common_1.CliPathWalker.getProjectRoot(folder) : this.projRoot;
176
+ let targetFile = path.join(root, codiac_ops_common_1.OpsConstants.PROJECT_CONFIG_FILENAME);
177
+ let contents = fs.readFileSync(targetFile, { encoding: "utf-8" });
178
+ let raw = JSON.parse(contents); // this doesnt run the ctor.
179
+ let config = Object.assign(new codiac_relay_contracts_1.ProjectConfig(raw.name, raw.tenantCode, dx_constants_1.DxConstants.DEFAULT_INIT_CODE_VERSION), raw);
180
+ return config;
181
+ }
182
+ /** Instantiates a fresh config object with default values.
183
+ * Assumes the project has been initialized.
184
+ * @param apiName Friendly title for the api project (defaults to the name of the project folder)
185
+ * @param tenantCode identifier for the tenant that owns this projeect.
186
+ */
187
+ createDefaultProjectConfig(apiName, tenantCode) {
188
+ let actualName = apiName;
189
+ if (!actualName) {
190
+ // let folder = projectRoot.split(path.sep).pop();
191
+ let folder = path.basename(this.projRoot);
192
+ if (!folder)
193
+ throw new Error("Your project does not appear to have a parent folder. Please initialize your project in its own folder.");
194
+ actualName = Case.kebab(folder);
195
+ }
196
+ let cfg = new codiac_relay_contracts_1.ProjectConfig(actualName, tenantCode || dx_constants_1.DxConstants.UNREGISTERED_TENANT_CODE, dx_constants_1.DxConstants.DEFAULT_INIT_CODE_VERSION);
197
+ return cfg;
198
+ }
199
+ /** Serializes the given config to its file. Throws if the project root hasnt been initialized. */
200
+ updateProjectConfigFile(config) {
201
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
202
+ return new Promise((resolve, reject) => tslib_1.__awaiter(this, void 0, void 0, function* () {
203
+ try {
204
+ let pathName = path.join(this.projRoot, codiac_ops_common_1.OpsConstants.PROJECT_CONFIG_FILENAME);
205
+ codiac_ops_common_1.JsonUtils.serializeJsonFile(config, pathName);
206
+ resolve();
207
+ }
208
+ catch (err) {
209
+ reject(err);
210
+ }
211
+ }));
212
+ });
213
+ }
214
+ /** News up a project config object and serializes
215
+ * to a file in the current working directory,
216
+ * thus establishing it as a project root. */
217
+ writeNewProjectConfig(seed) {
218
+ let folder = process.cwd();
219
+ let projectName = Case.kebab(path.basename(folder));
220
+ let config = seed || new codiac_relay_contracts_1.ProjectConfig(projectName, dx_constants_1.DxConstants.UNREGISTERED_TENANT_CODE, dx_constants_1.DxConstants.DEFAULT_INIT_CODE_VERSION);
221
+ let targetFile = path.join(folder, codiac_ops_common_1.OpsConstants.PROJECT_CONFIG_FILENAME);
222
+ // try {
223
+ fs.writeFileSync(targetFile, JSON.stringify(config, undefined, ' '));
224
+ // } catch (err) {
225
+ // this.log(`Error creating ${CONFIG_NAME}: ${err}`)
226
+ // }
227
+ return config;
228
+ }
229
+ // =========================================================================================== //
230
+ // //
231
+ // PROJECT-USER CONFIG //
232
+ // //
233
+ // =========================================================================================== //
234
+ /** Reads the user-specific project config file, if it exists.
235
+ * Otherwise returns a new empty instance.
236
+ */
237
+ readProjectUserConfig() {
238
+ let projectRoot = this.projRoot; // || CliPathWalker.getProjectRoot();
239
+ let userConfigFolder = path.join(projectRoot, codiac_ops_common_1.OpsConstants.PROJECT_USER_CONFIG_FOLDER_NAME);
240
+ let sourceFile = path.join(userConfigFolder, codiac_ops_common_1.OpsConstants.PROJECT_USER_CONFIG_FILENAME);
241
+ let config = new codiac_relay_contracts_1.ProjectUserConfig();
242
+ if (fs.existsSync(sourceFile)) {
243
+ let contents = fs.readFileSync(sourceFile, { encoding: "utf-8" });
244
+ let raw = JSON.parse(contents); // this doesnt run the ctor.
245
+ config = Object.assign(new codiac_relay_contracts_1.ProjectUserConfig(), raw);
246
+ }
247
+ return config;
248
+ }
249
+ /** Serializes the given config to a file in the project user folder. */
250
+ writeProjectUserConfig(config) {
251
+ let projectRoot = this.projRoot;
252
+ let userConfigFolder = path.join(projectRoot, codiac_ops_common_1.OpsConstants.PROJECT_USER_CONFIG_FOLDER_NAME);
253
+ let targetFile = path.join(userConfigFolder, codiac_ops_common_1.OpsConstants.PROJECT_USER_CONFIG_FILENAME);
254
+ // try {
255
+ if (!fs.existsSync(userConfigFolder)) {
256
+ fs.mkdirSync(userConfigFolder, { recursive: true });
257
+ }
258
+ fs.writeFileSync(targetFile, JSON.stringify(config, undefined, ' '));
259
+ // } catch (err) {
260
+ // this.log(`Error creating ${CONFIG_NAME}: ${err}`)
261
+ // }
262
+ }
263
+ };
264
+ ProjectContextRepo = tslib_1.__decorate([
265
+ (0, inversify_1.injectable)(),
266
+ tslib_1.__param(0, (0, inversify_1.inject)(entities_1.ProjectEnviro)),
267
+ tslib_1.__metadata("design:paramtypes", [entities_1.ProjectEnviro])
268
+ ], ProjectContextRepo);
269
+ exports.ProjectContextRepo = ProjectContextRepo;
270
+ //# sourceMappingURL=cli-context-repo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-context-repo.js","sourceRoot":"","sources":["../../../src/ops/data/cli-context-repo.ts"],"names":[],"mappings":";;;;AAAA,6BAA6B;AAC7B,yBAAyB;AACzB,6BAA6B;AAE7B,4DAAsD;AACtD,8EAAqF;AACrF,oEAAsF;AAEtF,0CAAkE;AAClE,kDAA8C;AAC9C,yCAA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ADpD,kBAAkB,CA+K9B;AA/KY,gDAAkB"}
@@ -0,0 +1,2 @@
1
+ export * from './cli-context-repo';
2
+ export * from './npm-config-repo';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./cli-context-repo"), exports);
5
+ tslib_1.__exportStar(require("./npm-config-repo"), exports);
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ops/data/index.ts"],"names":[],"mappings":";;;AAAA,6DAAmC;AACnC,4DAAkC"}
@@ -0,0 +1,13 @@
1
+ /** Cruds npm config files (npmrc and package.json) */
2
+ export declare class NpmConfigRepo {
3
+ private _projectRoot;
4
+ constructor(_projectRoot: string);
5
+ /** NOTE: Returns an empty object if the file doesnt exist.
6
+ * @param scrubIdentities Removes any auth tokens or scopes from the config object.
7
+ */
8
+ loadNpmrc(absolutePathName: string, scrubIdentities?: boolean): Promise<any>;
9
+ /** Writes the given npmrc object to the given path, using the ini lib to encode it. */
10
+ saveNpmrc(npmrc: any, absolutePathName: string): Promise<void>;
11
+ /** Removes any auth tokens or scopes from the config object. */
12
+ scrubRegistriesFrom(npmrc: any): any;
13
+ }
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NpmConfigRepo = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const fs = require("fs");
6
+ const path = require("path");
7
+ const ini = require("ini");
8
+ const _ = require("lodash");
9
+ /** Cruds npm config files (npmrc and package.json) */
10
+ class NpmConfigRepo {
11
+ constructor(_projectRoot) {
12
+ this._projectRoot = _projectRoot;
13
+ }
14
+ /** NOTE: Returns an empty object if the file doesnt exist.
15
+ * @param scrubIdentities Removes any auth tokens or scopes from the config object.
16
+ */
17
+ loadNpmrc(absolutePathName, scrubIdentities = false) {
18
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
19
+ return new Promise((resolve, reject) => tslib_1.__awaiter(this, void 0, void 0, function* () {
20
+ try {
21
+ let npmrc = {};
22
+ if (fs.existsSync(absolutePathName)) {
23
+ let content = fs.readFileSync(absolutePathName, { encoding: "utf-8" }).trim();
24
+ npmrc = ini.parse(content);
25
+ if (scrubIdentities) {
26
+ npmrc = this.scrubRegistriesFrom(npmrc);
27
+ }
28
+ }
29
+ resolve(npmrc);
30
+ }
31
+ catch (err) {
32
+ reject(err);
33
+ }
34
+ }));
35
+ });
36
+ }
37
+ /** Writes the given npmrc object to the given path, using the ini lib to encode it. */
38
+ saveNpmrc(npmrc, absolutePathName) {
39
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
40
+ return new Promise((resolve, reject) => tslib_1.__awaiter(this, void 0, void 0, function* () {
41
+ try {
42
+ let targetFolder = path.dirname(absolutePathName);
43
+ if (!fs.existsSync(targetFolder)) {
44
+ fs.mkdirSync(targetFolder, { recursive: true });
45
+ }
46
+ fs.writeFileSync(absolutePathName, ini.encode(npmrc));
47
+ resolve();
48
+ }
49
+ catch (err) {
50
+ reject(err);
51
+ }
52
+ }));
53
+ });
54
+ }
55
+ /** Removes any auth tokens or scopes from the config object. */
56
+ scrubRegistriesFrom(npmrc) {
57
+ // properties ending with ":_authToken"
58
+ let cleaned = _.omitBy(npmrc, (v, k) => k.match(/.*\:_authToken$/));
59
+ // properties starting with "@scope:"
60
+ cleaned = _.omitBy(cleaned, (v, k) => k.match(/^@[\w\d\._-]+\:/));
61
+ return cleaned;
62
+ }
63
+ }
64
+ exports.NpmConfigRepo = NpmConfigRepo;
65
+ //# sourceMappingURL=npm-config-repo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"npm-config-repo.js","sourceRoot":"","sources":["../../../src/ops/data/npm-config-repo.ts"],"names":[],"mappings":";;;;AAAA,yBAAyB;AACzB,6BAA6B;AAC7B,2BAA2B;AAC3B,4BAA6B;AAG7B,sDAAsD;AACtD,MAAa,aAAa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X;gBAAC,OAAO,GAAG,EAAE;oBACZ,MAAM,CAAC,GAAG,CAAC,CAAC;iBACb;YACH,CAAC,CAAA,CAAC,CAAC;QACL,CAAC;KAAA;IAGD,gEAAgE;IACzD,mBAAmB,CAAC,KAAU;QACnC,uCAAuC;QACvC,IAAI,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,EAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC;QAEnE,qCAAqC;QACrC,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,EAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC;QAEjE,OAAO,OAAO,CAAC;IACjB,CAAC;CAEF;AAzDD,sCAyDC"}
File without changes
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+ // MOVED TO ops-common
3
+ // /** The shape of the ~/.docker/config.json file.
4
+ // * @see https://docs.docker.com/engine/reference/commandline/cli/#configuration-files Configuration files
5
+ // * @see https://docs.docker.com/engine/reference/commandline/cli/#configjson-properties config.json properties
6
+ // */
7
+ // export interface IDockerConfig {
8
+ // /** specifies a set of headers to include in all messages sent from the Docker client to the daemon.
9
+ // * Docker does not try to interpret or understand these header; it simply puts them into the messages.
10
+ // * Docker does not allow these headers to change any headers it sets for itself. */
11
+ // HttpHeaders?: string;
12
+ // /** specifies the default format for docker ps output.
13
+ // * When the --format flag is not provided with the docker ps command, Docker’s client uses this property.
14
+ // * If this property is not set, the client falls back to the default table format.
15
+ // * For a list of supported formatting directives,
16
+ // * @see https://docs.docker.com/engine/reference/commandline/ps/#formatting the Formatting section in the docker ps documentation */
17
+ // psFormat?: string;
18
+ // /** specifies the default format for docker images output.
19
+ // * When the --format flag is not provided with the docker images command,
20
+ // * Docker’s client uses this property. If this property is not set,
21
+ // * the client falls back to the default table format.
22
+ // * For a list of supported formatting directives,
23
+ // * see the Formatting section in the docker images documentation */
24
+ // imagesFormat?: string;
25
+ // /** specifies the default format for docker plugin ls output.
26
+ // * When the --format flag is not provided with the docker plugin ls command,
27
+ // * Docker’s client uses this property. If this property is not set,
28
+ // * the client falls back to the default table format.
29
+ // * For a list of supported formatting directives,
30
+ // * see the Formatting section in the docker plugin ls documentation */
31
+ // pluginsFormat?: string;
32
+ // /** specifies the default format for docker service ls output.
33
+ // * When the --format flag is not provided with the docker service ls command,
34
+ // * Docker’s client uses this property. If this property is not set,
35
+ // * the client falls back to the default json format.
36
+ // * For a list of supported formatting directives,
37
+ // * see the Formatting section in the docker service ls documentation */
38
+ // servicesFormat?: string;
39
+ // /** specifies the default format for docker service inspect output.
40
+ // * When the --format flag is not provided with the docker service inspect command,
41
+ // * Docker’s client uses this property. If this property is not set,
42
+ // * the client falls back to the default json format.
43
+ // * For a list of supported formatting directives,
44
+ // * see the Formatting section in the docker service inspect documentation */
45
+ // serviceInspectFormat?: string;
46
+ // /** specifies the default format for docker stats output.
47
+ // * When the --format flag is not provided with the docker stats command,
48
+ // * Docker’s client uses this property. If this property is not set,
49
+ // * the client falls back to the default table format.
50
+ // * For a list of supported formatting directives,
51
+ // * see Formatting section in the docker stats documentation */
52
+ // statsFormat?: string;
53
+ // /** specifies the default format for docker secret ls output.
54
+ // * When the --format flag is not provided with the docker secret ls command,
55
+ // * Docker’s client uses this property. If this property is not set,
56
+ // * the client falls back to the default table format.
57
+ // * For a list of supported formatting directives,
58
+ // * see Formatting section in the docker secret ls documentation */
59
+ // secretFormat?: string;
60
+ // /** specifies the default format for docker node ls output.
61
+ // * When the --format flag is not provided with the docker node ls command,
62
+ // * Docker’s client uses the value of nodesFormat. If the value of nodesFormat is not set,
63
+ // * the client uses the default table format.
64
+ // * For a list of supported formatting directives,
65
+ // * see the Formatting section in the docker node ls documentation */
66
+ // nodesFormat?: string;
67
+ // /** specifies the default format for docker config ls output.
68
+ // * When the --format flag is not provided with the docker config ls command,
69
+ // * Docker’s client uses this property. If this property is not set,
70
+ // * the client falls back to the default table format.
71
+ // * For a list of supported formatting directives,
72
+ // * see Formatting section in the docker config ls documentation */
73
+ // configFormat?: string;
74
+ // /** Stores credentials keyed by registry and scope
75
+ // * when neither "credHelpers" is set for the relevant registry scope
76
+ // * nor "credsStore" is set. */
77
+ // auths?: { [registry: string]: UsernamePassword };
78
+ // /** specifies an external binary to serve as the default credential store. When this property is set,
79
+ // * docker login will attempt to store credentials in the binary specified by docker-credential-<value>
80
+ // * which is visible on $PATH. If this property is not set,
81
+ // * credentials will be stored in the auths property of the config.
82
+ // * @see https://docs.docker.com/engine/reference/commandline/login/#credentials-store the Credentials store section in the docker login documentation */
83
+ // credsStore?: string;
84
+ // /** specifies a set of credential helpers to use preferentially over credsStore or auths
85
+ // * when storing and retrieving credentials for specific registries. If this property is set,
86
+ // * the binary docker-credential-<value> will be used when storing or retrieving credentials
87
+ // * for a specific registry.
88
+ // * @see https://docs.docker.com/engine/reference/commandline/login/#credential-helpers Credential helpers section in the docker login documentation */
89
+ // credHelpers?: {[registry: string]: string};
90
+ // /** specifies the default orchestrator to use when running docker stack management commands.
91
+ // * Valid values are "swarm", "kubernetes", and "all".
92
+ // * This property can be overridden with the DOCKER_STACK_ORCHESTRATOR environment variable, or the --orchestrator flag. */
93
+ // stackOrchestrator?: string;
94
+ // /** specifies proxy environment variables to be automatically set on containers,
95
+ // * and set as --build-arg on containers used during docker build.
96
+ // * A "default" set of proxies can be configured, and will be used for any docker daemon
97
+ // * that the client connects to, or a configuration per host (docker daemon),
98
+ // * for example, “https://docker-daemon1.example.com”. */
99
+ // proxies?: DockerProxyEnum[];
100
+ // /** */
101
+ // plugins?: string;
102
+ // }
103
+ // export enum DockerProxyEnum {
104
+ // /** sets the value of HTTP_PROXY and http_proxy. */
105
+ // httpProxy = "httpProxy",
106
+ // /** sets the value of HTTPS_PROXY and https_proxy. */
107
+ // httpsProxy = "httpsProxy",
108
+ // /** sets the value of FTP_PROXY and ftp_proxy. */
109
+ // ftpProxy = "ftpProxy",
110
+ // /** sets the value of NO_PROXY and no_proxy. */
111
+ // noProxy = "noProxy",
112
+ // }
113
+ // export class UsernamePassword {
114
+ // constructor(public Username: string, public Secret: string) {
115
+ // }
116
+ // }
117
+ // /** Docker's required contract for credentials returned from a credential store binary.
118
+ // * **Note the title casing of the properties**
119
+ // * @see https://docs.docker.com/engine/reference/commandline/login/#credentials-store
120
+ // */
121
+ // export class RegistryCredentials extends UsernamePassword {
122
+ // /**
123
+ // * @param Username Use "<token>" if passing an api token as the secret.
124
+ // * @param Secret Password or api token
125
+ // * @param ServerURL Registry domain name without protocol or path (though Docker's example shows this as a fully qualified url with protocol)
126
+ // */
127
+ // constructor(Username: string, Secret: string, public ServerURL: string) {
128
+ // super(Username, Secret)
129
+ // }
130
+ // }
131
+ //# sourceMappingURL=docker-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docker-config.js","sourceRoot":"","sources":["../../src/ops/docker-config.ts"],"names":[],"mappings":";AAAA,sBAAsB;AAGtB,mDAAmD;AACnD,4GAA4G;AAC5G,iHAAiH;AACjH,MAAM;AACN,mCAAmC;AACnC,0GAA0G;AAC1G,4GAA4G;AAC5G,wFAAwF;AACxF,0BAA0B;AAE1B,4DAA4D;AAC5D,+GAA+G;AAC/G,wFAAwF;AACxF,uDAAuD;AACvD,yIAAyI;AACzI,uBAAuB;AAEvB,gEAAgE;AAChE,+EAA+E;AAC/E,yEAAyE;AACzE,2DAA2D;AAC3D,uDAAuD;AACvD,wEAAwE;AACxE,2BAA2B;AAE3B,mEAAmE;AACnE,kFAAkF;AAClF,yEAAyE;AACzE,2DAA2D;AAC3D,uDAAuD;AACvD,2EAA2E;AAC3E,4BAA4B;AAE5B,oEAAoE;AACpE,mFAAmF;AACnF,yEAAyE;AACzE,0DAA0D;AAC1D,uDAAuD;AACvD,4EAA4E;AAC5E,6BAA6B;AAE7B,yEAAyE;AACzE,wFAAwF;AACxF,yEAAyE;AACzE,0DAA0D;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AAQ;AACR,8EAA8E;AAC9E,8BAA8B;AAC9B,MAAM;AACN,IAAI"}
File without changes
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ // MOVED TO ops-common
3
+ // /** Constants utilized by various Docker runtimes (cli, api, daemon, etc) that are useful to Codiac. */
4
+ // export const DOCKER_CONSTANTS = {
5
+ // /** The name of the environment variable that can be set to override the location of the docker config.json file. */
6
+ // CONFIG_PATH_ENV_VAR_NAME: "DOCKER_CONFIG",
7
+ // DEFAULT_CONFIG_FOLDER: ".docker",
8
+ // DEFAULT_CONFIG_FILE: "config.json",
9
+ // /** The first part of the conventional name of the credentials store binary.
10
+ // * @see https://docs.docker.com/engine/reference/commandline/login/#credentials-store
11
+ // */
12
+ // CRED_HELPER_PREFIX: "docker-credential-",
13
+ // /** The implied prefix for images in the official DockerHub public image library.
14
+ // * That is, images in this library do not require a scope, such as mongodb and rabbitmq, etc.
15
+ // * However, internally, Docker actually has a scope name for that library,
16
+ // * and this is that system scope name.
17
+ // *
18
+ // * eg: the true scoped name for the image we know as `postgres` is actually `library/postgres`
19
+ // */
20
+ // PUBLIC_LIBRARY_SCOPE: "library"
21
+ // } as const;
22
+ //# sourceMappingURL=docker-constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docker-constants.js","sourceRoot":"","sources":["../../src/ops/docker-constants.ts"],"names":[],"mappings":";AAAA,sBAAsB;AAEtB,2GAA2G;AAC3G,oCAAoC;AACpC,yHAAyH;AACzH,+CAA+C;AAC/C,sCAAsC;AACtC,wCAAwC;AACxC,kFAAkF;AAClF,0FAA0F;AAC1F,OAAO;AACP,8CAA8C;AAC9C,wFAAwF;AACxF,sGAAsG;AACtG,iFAAiF;AACjF,4CAA4C;AAC5C,QAAQ;AACR,oGAAoG;AACpG,QAAQ;AACR,oCAAoC;AACpC,cAAc"}
File without changes