indraq_cli 2.2.4 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/README.md +158 -21
  2. package/cloud-api/.env.example +10 -0
  3. package/cloud-api/README.md +32 -3
  4. package/cloud-api/dist/index.js +840 -13
  5. package/cloud-api/package.json +5 -3
  6. package/cloud-api/scripts/check-dev-deps.mjs +11 -0
  7. package/cloud-api/sql/011_environment_internal_ipv4.sql +14 -0
  8. package/cloud-api/sql/012_mobile_ota.sql +139 -0
  9. package/cloud-api/src/index.ts +629 -13
  10. package/dist/cli/create-program.d.ts +1 -1
  11. package/dist/cli/create-program.d.ts.map +1 -1
  12. package/dist/cli/create-program.js +126 -46
  13. package/dist/cli/create-program.js.map +1 -1
  14. package/dist/cli/help-content.d.ts +1 -1
  15. package/dist/cli/help-content.d.ts.map +1 -1
  16. package/dist/cli/help-content.js +150 -32
  17. package/dist/cli/help-content.js.map +1 -1
  18. package/dist/index.js +55 -14
  19. package/dist/index.js.map +1 -1
  20. package/dist/modules/access/index.d.ts +1 -1
  21. package/dist/modules/access/index.d.ts.map +1 -1
  22. package/dist/modules/access/index.js +2 -3
  23. package/dist/modules/access/index.js.map +1 -1
  24. package/dist/modules/aws/commands/dns.command.js +4 -4
  25. package/dist/modules/aws/commands/dns.command.js.map +1 -1
  26. package/dist/modules/aws/index.d.ts +1 -1
  27. package/dist/modules/aws/index.d.ts.map +1 -1
  28. package/dist/modules/aws/index.js +18 -42
  29. package/dist/modules/aws/index.js.map +1 -1
  30. package/dist/modules/aws/services/route53-lookup.service.d.ts.map +1 -1
  31. package/dist/modules/aws/services/route53-lookup.service.js +2 -3
  32. package/dist/modules/aws/services/route53-lookup.service.js.map +1 -1
  33. package/dist/modules/aws/services/route53-sdk.d.ts +2 -0
  34. package/dist/modules/aws/services/route53-sdk.d.ts.map +1 -0
  35. package/dist/modules/aws/services/route53-sdk.js +12 -0
  36. package/dist/modules/aws/services/route53-sdk.js.map +1 -0
  37. package/dist/modules/cloud/commands/cloud.command.d.ts +2 -0
  38. package/dist/modules/cloud/commands/cloud.command.d.ts.map +1 -1
  39. package/dist/modules/cloud/commands/cloud.command.js +165 -17
  40. package/dist/modules/cloud/commands/cloud.command.js.map +1 -1
  41. package/dist/modules/cloud/commands/environment.command.d.ts.map +1 -1
  42. package/dist/modules/cloud/commands/environment.command.js +10 -6
  43. package/dist/modules/cloud/commands/environment.command.js.map +1 -1
  44. package/dist/modules/cloud/index.d.ts +1 -1
  45. package/dist/modules/cloud/index.d.ts.map +1 -1
  46. package/dist/modules/cloud/index.js +48 -52
  47. package/dist/modules/cloud/index.js.map +1 -1
  48. package/dist/modules/cloud/services/cloud-api.service.d.ts +1 -0
  49. package/dist/modules/cloud/services/cloud-api.service.d.ts.map +1 -1
  50. package/dist/modules/cloud/services/cloud-api.service.js +41 -1
  51. package/dist/modules/cloud/services/cloud-api.service.js.map +1 -1
  52. package/dist/modules/cloud/services/cloud-jenkins.service.d.ts +1 -0
  53. package/dist/modules/cloud/services/cloud-jenkins.service.d.ts.map +1 -1
  54. package/dist/modules/cloud/services/cloud-jenkins.service.js +5 -1
  55. package/dist/modules/cloud/services/cloud-jenkins.service.js.map +1 -1
  56. package/dist/modules/cloud/services/environment.service.d.ts +7 -1
  57. package/dist/modules/cloud/services/environment.service.d.ts.map +1 -1
  58. package/dist/modules/cloud/services/environment.service.js +5 -1
  59. package/dist/modules/cloud/services/environment.service.js.map +1 -1
  60. package/dist/modules/cloud/services/project-cloud.service.d.ts +2 -1
  61. package/dist/modules/cloud/services/project-cloud.service.d.ts.map +1 -1
  62. package/dist/modules/cloud/services/project-cloud.service.js +9 -1
  63. package/dist/modules/cloud/services/project-cloud.service.js.map +1 -1
  64. package/dist/modules/deploy/commands/build.command.d.ts +2 -1
  65. package/dist/modules/deploy/commands/build.command.d.ts.map +1 -1
  66. package/dist/modules/deploy/commands/build.command.js +120 -75
  67. package/dist/modules/deploy/commands/build.command.js.map +1 -1
  68. package/dist/modules/deploy/index.d.ts +1 -1
  69. package/dist/modules/deploy/index.d.ts.map +1 -1
  70. package/dist/modules/deploy/index.js +67 -36
  71. package/dist/modules/deploy/index.js.map +1 -1
  72. package/dist/modules/dockerfile/index.d.ts +1 -1
  73. package/dist/modules/dockerfile/index.d.ts.map +1 -1
  74. package/dist/modules/dockerfile/index.js +3 -2
  75. package/dist/modules/dockerfile/index.js.map +1 -1
  76. package/dist/modules/jenkins/commands/create-deployment.command.d.ts.map +1 -1
  77. package/dist/modules/jenkins/commands/create-deployment.command.js +7 -11
  78. package/dist/modules/jenkins/commands/create-deployment.command.js.map +1 -1
  79. package/dist/modules/jenkins/index.d.ts +1 -1
  80. package/dist/modules/jenkins/index.d.ts.map +1 -1
  81. package/dist/modules/jenkins/index.js +13 -22
  82. package/dist/modules/jenkins/index.js.map +1 -1
  83. package/dist/modules/mobile/commands/build-mobile.command.d.ts.map +1 -1
  84. package/dist/modules/mobile/commands/build-mobile.command.js +44 -5
  85. package/dist/modules/mobile/commands/build-mobile.command.js.map +1 -1
  86. package/dist/modules/mobile/commands/configure-mobile.command.d.ts.map +1 -1
  87. package/dist/modules/mobile/commands/configure-mobile.command.js +3 -12
  88. package/dist/modules/mobile/commands/configure-mobile.command.js.map +1 -1
  89. package/dist/modules/mobile/commands/mobile-environment.command.d.ts +5 -0
  90. package/dist/modules/mobile/commands/mobile-environment.command.d.ts.map +1 -0
  91. package/dist/modules/mobile/commands/mobile-environment.command.js +67 -0
  92. package/dist/modules/mobile/commands/mobile-environment.command.js.map +1 -0
  93. package/dist/modules/mobile/commands/mobile-prebuild.command.d.ts +6 -0
  94. package/dist/modules/mobile/commands/mobile-prebuild.command.d.ts.map +1 -0
  95. package/dist/modules/mobile/commands/mobile-prebuild.command.js +134 -0
  96. package/dist/modules/mobile/commands/mobile-prebuild.command.js.map +1 -0
  97. package/dist/modules/mobile/commands/ota.command.d.ts +8 -0
  98. package/dist/modules/mobile/commands/ota.command.d.ts.map +1 -0
  99. package/dist/modules/mobile/commands/ota.command.js +190 -0
  100. package/dist/modules/mobile/commands/ota.command.js.map +1 -0
  101. package/dist/modules/mobile/config/mobile-config.d.ts +26 -1
  102. package/dist/modules/mobile/config/mobile-config.d.ts.map +1 -1
  103. package/dist/modules/mobile/config/mobile-config.js +52 -9
  104. package/dist/modules/mobile/config/mobile-config.js.map +1 -1
  105. package/dist/modules/mobile/index.d.ts.map +1 -1
  106. package/dist/modules/mobile/index.js +27 -18
  107. package/dist/modules/mobile/index.js.map +1 -1
  108. package/dist/modules/mobile/services/jenkins-mobile.service.js +1 -1
  109. package/dist/modules/mobile/services/jenkins-mobile.service.js.map +1 -1
  110. package/dist/modules/mobile/services/mobile-cloud.service.d.ts +120 -0
  111. package/dist/modules/mobile/services/mobile-cloud.service.d.ts.map +1 -0
  112. package/dist/modules/mobile/services/mobile-cloud.service.js +53 -0
  113. package/dist/modules/mobile/services/mobile-cloud.service.js.map +1 -0
  114. package/dist/modules/mobile/services/ota-export.service.d.ts +14 -0
  115. package/dist/modules/mobile/services/ota-export.service.d.ts.map +1 -0
  116. package/dist/modules/mobile/services/ota-export.service.js +68 -0
  117. package/dist/modules/mobile/services/ota-export.service.js.map +1 -0
  118. package/dist/modules/mobile/services/ota-setup.service.d.ts +18 -0
  119. package/dist/modules/mobile/services/ota-setup.service.d.ts.map +1 -0
  120. package/dist/modules/mobile/services/ota-setup.service.js +374 -0
  121. package/dist/modules/mobile/services/ota-setup.service.js.map +1 -0
  122. package/dist/modules/prebuild/commands/prebuild.command.d.ts +3 -2
  123. package/dist/modules/prebuild/commands/prebuild.command.d.ts.map +1 -1
  124. package/dist/modules/prebuild/commands/prebuild.command.js +79 -56
  125. package/dist/modules/prebuild/commands/prebuild.command.js.map +1 -1
  126. package/dist/modules/prebuild/index.d.ts +1 -1
  127. package/dist/modules/prebuild/index.d.ts.map +1 -1
  128. package/dist/modules/prebuild/index.js +3 -2
  129. package/dist/modules/prebuild/index.js.map +1 -1
  130. package/dist/modules/proxy/commands/proxy.command.js +3 -3
  131. package/dist/modules/proxy/commands/proxy.command.js.map +1 -1
  132. package/dist/modules/proxy/index.d.ts +1 -1
  133. package/dist/modules/proxy/index.d.ts.map +1 -1
  134. package/dist/modules/proxy/index.js +8 -10
  135. package/dist/modules/proxy/index.js.map +1 -1
  136. package/dist/modules/scaffold/commands/init.command.d.ts.map +1 -1
  137. package/dist/modules/scaffold/commands/init.command.js +52 -18
  138. package/dist/modules/scaffold/commands/init.command.js.map +1 -1
  139. package/dist/modules/scaffold/index.d.ts +1 -1
  140. package/dist/modules/scaffold/index.d.ts.map +1 -1
  141. package/dist/modules/scaffold/index.js +4 -2
  142. package/dist/modules/scaffold/index.js.map +1 -1
  143. package/dist/modules/scaffold/project-topology.d.ts +14 -0
  144. package/dist/modules/scaffold/project-topology.d.ts.map +1 -0
  145. package/dist/modules/scaffold/project-topology.js +59 -0
  146. package/dist/modules/scaffold/project-topology.js.map +1 -0
  147. package/dist/modules/scaffold/types.d.ts +14 -1
  148. package/dist/modules/scaffold/types.d.ts.map +1 -1
  149. package/dist/modules/scopes/commands/scope.command.d.ts.map +1 -1
  150. package/dist/modules/scopes/commands/scope.command.js +18 -11
  151. package/dist/modules/scopes/commands/scope.command.js.map +1 -1
  152. package/dist/modules/scopes/index.d.ts +1 -1
  153. package/dist/modules/scopes/index.d.ts.map +1 -1
  154. package/dist/modules/scopes/index.js +15 -15
  155. package/dist/modules/scopes/index.js.map +1 -1
  156. package/dist/modules/setup/commands/setup.command.d.ts +2 -0
  157. package/dist/modules/setup/commands/setup.command.d.ts.map +1 -0
  158. package/dist/modules/setup/commands/setup.command.js +107 -0
  159. package/dist/modules/setup/commands/setup.command.js.map +1 -0
  160. package/dist/modules/setup/index.d.ts +3 -0
  161. package/dist/modules/setup/index.d.ts.map +1 -0
  162. package/dist/modules/setup/index.js +9 -0
  163. package/dist/modules/setup/index.js.map +1 -0
  164. package/dist/modules/users/index.d.ts +1 -1
  165. package/dist/modules/users/index.d.ts.map +1 -1
  166. package/dist/modules/users/index.js +10 -25
  167. package/dist/modules/users/index.js.map +1 -1
  168. package/dist/modules/users/providers/aws-user.provider.js +1 -1
  169. package/dist/modules/users/providers/aws-user.provider.js.map +1 -1
  170. package/docs/ARCHITECTURE.md +85 -29
  171. package/package.json +21 -5
  172. package/cloud-api/package-lock.json +0 -2250
@@ -1,29 +1,85 @@
1
- # IndraQ Architecture
2
-
3
- ## Control plane
4
-
5
- IndraQ CLI communicates with IndraQ Cloud API. PostgreSQL stores identities, roles, projects, shared environments, encrypted user provider credentials, infrastructure associations, managed AWS IAM credentials, and audit logs.
6
-
7
- ## Credential ownership
8
-
9
- AWS, NPM, Jenkins, and GHCR credentials belong to an individual IndraQ user and are reusable across that user's projects.
10
-
11
- They are not organization-wide global secrets and are not copied into each project folder.
12
-
13
- ## Shared environments
14
-
15
- Admins can create any number of shared environments with arbitrary names. An environment is a reusable named target containing an IP and optional region. Health-check protocol, endpoint, port, path, interval, threshold, latency measurement, and SNI are Route53-resource settings selected when DNS is configured.
16
-
17
- PRIMARY/SECONDARY is not an environment property. A FAILOVER DNS resource chooses which environment is PRIMARY and which is SECONDARY for that particular Route53 record.
18
-
19
- ## Project resources
20
-
21
- Projects keep intent and external-resource associations, including GHCR image repositories, Jenkins jobs, Route53 routing/health checks, and NPM proxy hosts. Project membership controls who can discover/re-link a project. Resource grants record access to individual AWS, NPM, and Jenkins resources and are audited.
22
-
23
- ## Prebuild
24
-
25
- Prebuild reconciles rather than blindly creates. It validates user provider configuration, checks existing project associations, asks for the Route53 routing policy first (SIMPLE, FAILOVER, WEIGHTED, or LATENCY), validates Jenkins host ports, configures/repairs Route53 according to that policy, verifies DNS before NPM, and creates/repairs NPM proxy hosts. SIMPLE records never receive a health check; FAILOVER uses PRIMARY/SECONDARY health checks; WEIGHTED/LATENCY may use health checks when requested.
26
-
27
- ## Local state
28
-
29
- The project folder stores the Cloud project ID in `.indraq/project.json`. Reusable provider secrets are resolved from the authenticated user's Cloud account only when required.
1
+ # IndraQ Architecture — v2.3
2
+
3
+ ## Control plane
4
+
5
+ IndraQ CLI communicates with the IndraQ Cloud API. PostgreSQL stores identities, roles, projects, shared environments, provider scopes, encrypted per-user scope credentials, project/environment scope bindings, infrastructure associations, managed AWS IAM credentials, persistent sessions, and audit logs.
6
+
7
+ ## Project components — what is built
8
+
9
+ A project may contain one or multiple independently deployable components. Legacy frontend/backend/fullstack metadata is normalized at runtime, so older projects remain compatible.
10
+
11
+ Supported presets include:
12
+
13
+ - frontend
14
+ - backend
15
+ - frontend + backend
16
+ - user frontend + admin frontend + backend (`multiweb`)
17
+ - mobile
18
+
19
+ Each web component has its own path, framework, image name, ports and health endpoint. GHCR/Jenkins resources are keyed by component and environment.
20
+
21
+ ## Deployment topology — where it runs
22
+
23
+ Deployment topology is separate from project type. A project can target one shared environment/server or several. Topology is stored in the existing `projects.config` JSONB document; v2.3 does not require a new SQL migration.
24
+
25
+ Each target stores:
26
+
27
+ - shared environment name
28
+ - topology role: primary / secondary / replica
29
+ - Jenkins stage: dev / prod
30
+
31
+ The Jenkins stage is explicit so a production backup named `backup-server` cannot accidentally resolve to Jenkins DEV.
32
+
33
+ ## Provider scopes and credentials
34
+
35
+ AWS, NPM, Jenkins and GHCR are organization provider scopes. Users see/use only assigned scopes. Their native/provider credentials are resolved only when required and are not copied into project folders.
36
+
37
+ A project can bind different provider scopes for each environment. This allows the same component/pipeline name to exist on Jenkins A for the primary server and Jenkins B for the backup server, with separate NPM instances as well.
38
+
39
+ ## Shared environments
40
+
41
+ Admins can create any number of shared environments with arbitrary names. Each environment contains:
42
+
43
+ - external/public IPv4 — used by Route53/DNS
44
+ - internal/private IPv4 — used by Nginx Proxy Manager upstreams
45
+ - optional region/metadata
46
+
47
+ Route53 PRIMARY/SECONDARY remains a DNS-resource decision. Project topology primary/secondary describes intended deployment ordering/relationship and does not silently rewrite DNS policy.
48
+
49
+ ## Multi-environment deployment
50
+
51
+ For one or more selected components, IndraQ:
52
+
53
+ 1. builds the component image once
54
+ 2. pushes the selected tag(s) once to GHCR
55
+ 3. resolves the immutable image digest
56
+ 4. verifies all selected environments point at the same logical GHCR image
57
+ 5. triggers each environment's own Jenkins controller sequentially with the same tag + digest
58
+ 6. stops on the first failed target and reports that environment
59
+
60
+ This prevents primary/backup servers from receiving different image bytes during one CLI deployment.
61
+
62
+ ## Project resources
63
+
64
+ Projects keep intent and external-resource associations, including GHCR image repositories, Jenkins jobs, Route53 routing/health checks, and NPM proxy hosts. Project membership controls who can discover/re-link a project. Resource grants record access to individual AWS, NPM, and Jenkins resources and are audited.
65
+
66
+ ## Prebuild
67
+
68
+ Prebuild reconciles rather than blindly creates. Required infrastructure is GHCR + Jenkins. Route53/NPM remain optional.
69
+
70
+ v2.3 adds:
71
+
72
+ - `--required-only` — reconcile GHCR/Jenkins only
73
+ - `--all-targets` — reconcile every configured project deployment environment
74
+
75
+ Provider scope selection is environment-specific. If there is one unambiguous eligible missing scope, it can be linked directly; real choices are still presented interactively.
76
+
77
+ ## Startup/performance model
78
+
79
+ The CLI router loads only the requested command family. Command-family indexes then lazy-load implementation modules only when an action executes. Large providers such as the AWS SDK are kept behind lazy boundaries when possible.
80
+
81
+ `indraq -V` remains a zero-initialization fast path. Lightweight help commands do not initialize Cloud/provider clients.
82
+
83
+ ## Local state
84
+
85
+ The project folder stores the Cloud project ID in `.indraq/project.json`. Reusable provider secrets and project topology live in the Cloud control plane, not in application source.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "indraq_cli",
3
- "version": "2.2.4",
4
- "description": "IndraQ scope-first cloud CLI with least-privilege deployment control planes, live Jenkins console streaming, and Jenkins-compatible parameter prompting",
3
+ "version": "2.4.0",
4
+ "description": "IndraQ cloud/devops CLI with component deployments, mobile Jenkins environments, and self-hosted OTA updates",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
7
7
  "indraq": "dist/index.js"
@@ -13,7 +13,7 @@
13
13
  "dev": "ts-node src/index.ts",
14
14
  "watch": "nodemon --exec ts-node src/index.ts",
15
15
  "build:cloud": "npm --prefix cloud-api install --no-audit --no-fund && npm --prefix cloud-api run build",
16
- "test": "npm run test:cloud-endpoint && npm run test:user-credentials && npm run test:infrastructure && npm run test:platform && npm run test:project-access && npm run test:project-create && npm run test:jenkins-crumb && npm run test:jenkins-port && npm run test:prebuild && npm run test:docker-context && npm run test:identity-security && npm run test:user-lifecycle-jenkins && npm run test:v2-lifecycle && npm run test:v21-scopes && npm run test:v22 && npm run test:v221 && npm run test:v222 && npm run test:v222-runtime && npm run test:v223 && npm run test:v224",
16
+ "test": "npm run test:cloud-endpoint && npm run test:user-credentials && npm run test:infrastructure && npm run test:platform && npm run test:project-access && npm run test:project-create && npm run test:jenkins-crumb && npm run test:jenkins-port && npm run test:prebuild && npm run test:docker-context && npm run test:identity-security && npm run test:user-lifecycle-jenkins && npm run test:v2-lifecycle && npm run test:v21-scopes && npm run test:v22 && npm run test:v221 && npm run test:v222 && npm run test:v222-runtime && npm run test:v223 && npm run test:v224 && npm run test:v225 && npm run test:v226 && npm run test:v230 && npm run test:v240",
17
17
  "test:user-credentials": "node tests/cloud-user-credential-regression.cjs",
18
18
  "test:prebuild": "node tests/prebuild-cloud-regression.cjs",
19
19
  "test:jenkins-port": "node tests/jenkins-port-regression.cjs",
@@ -33,7 +33,11 @@
33
33
  "test:v222": "node tests/v222-persistent-session-regression.cjs",
34
34
  "test:v222-runtime": "node tests/v222-persistent-session-runtime-regression.cjs",
35
35
  "test:v223": "node tests/v223-logical-fixes-regression.cjs && node tests/v223-normal-user-route53-regression.cjs && node tests/v223-jenkins-build-runtime-regression.cjs",
36
- "test:v224": "node tests/v224-jenkins-build-regression.cjs"
36
+ "test:v224": "node tests/v224-jenkins-build-regression.cjs",
37
+ "test:v225": "node tests/v225-environment-addressing-regression.cjs",
38
+ "test:v226": "node tests/v226-help-version-fastpath-regression.cjs",
39
+ "test:v230": "node tests/v230-component-multienv-regression.cjs && node tests/v230-multienv-deploy-runtime.cjs",
40
+ "test:v240": "node tests/v240-mobile-ota-regression.cjs"
37
41
  },
38
42
  "keywords": [
39
43
  "indraq",
@@ -92,7 +96,19 @@
92
96
  "RELEASE_CHECKS_v2.2.3.md",
93
97
  "CHANGELOG_v2.2.4.md",
94
98
  "RELEASE_CHECKS_v2.2.4.md",
95
- "TEST_RESULTS_v2.2.4.txt"
99
+ "TEST_RESULTS_v2.2.4.txt",
100
+ "CHANGELOG_v2.2.5.md",
101
+ "RELEASE_CHECKS_v2.2.5.md",
102
+ "TEST_RESULTS_v2.2.5.txt",
103
+ "CHANGELOG_v2.2.6.md",
104
+ "RELEASE_CHECKS_v2.2.6.md",
105
+ "TEST_RESULTS_v2.2.6.txt",
106
+ "CHANGELOG_v2.3.0.md",
107
+ "RELEASE_CHECKS_v2.3.0.md",
108
+ "TEST_RESULTS_v2.3.0.txt",
109
+ "CHANGELOG_v2.4.0.md",
110
+ "RELEASE_CHECKS_v2.4.0.md",
111
+ "TEST_RESULTS_v2.4.0.txt"
96
112
  ],
97
113
  "publishConfig": {
98
114
  "access": "public",