revisium 2.4.0 → 2.5.0-alpha.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 (229) hide show
  1. package/.github/workflows/build.yml +11 -30
  2. package/.github/workflows/ci.yml +0 -6
  3. package/.github/workflows/npm-publish.yml +13 -78
  4. package/.github/workflows/release-train.yml +90 -0
  5. package/AGENTS.md +98 -0
  6. package/README.md +31 -13
  7. package/dist/e2e/utils/cli-runner.d.ts +1 -0
  8. package/dist/e2e/utils/cli-runner.js +11 -5
  9. package/dist/e2e/utils/cli-runner.js.map +1 -1
  10. package/dist/e2e/utils/matrix-fixtures.d.ts +26 -0
  11. package/dist/e2e/utils/matrix-fixtures.js +109 -0
  12. package/dist/e2e/utils/matrix-fixtures.js.map +1 -0
  13. package/dist/e2e/utils/matrix-workspace.d.ts +25 -0
  14. package/dist/e2e/utils/matrix-workspace.js +61 -0
  15. package/dist/e2e/utils/matrix-workspace.js.map +1 -0
  16. package/dist/e2e/utils/standalone-api.d.ts +53 -0
  17. package/dist/e2e/utils/standalone-api.js +146 -0
  18. package/dist/e2e/utils/standalone-api.js.map +1 -0
  19. package/dist/e2e/utils/standalone-runner.d.ts +23 -0
  20. package/dist/e2e/utils/standalone-runner.js +182 -0
  21. package/dist/e2e/utils/standalone-runner.js.map +1 -0
  22. package/dist/package.json +6 -3
  23. package/dist/src/app.module.js +51 -0
  24. package/dist/src/app.module.js.map +1 -1
  25. package/dist/src/commands/auth/auth-command.utils.d.ts +8 -0
  26. package/dist/src/commands/auth/auth-command.utils.js +28 -0
  27. package/dist/src/commands/auth/auth-command.utils.js.map +1 -0
  28. package/dist/src/commands/auth/auth-login.command.d.ts +29 -0
  29. package/dist/src/commands/auth/auth-login.command.js +155 -0
  30. package/dist/src/commands/auth/auth-login.command.js.map +1 -0
  31. package/dist/src/commands/auth/auth-logout.command.d.ts +19 -0
  32. package/dist/src/commands/auth/auth-logout.command.js +86 -0
  33. package/dist/src/commands/auth/auth-logout.command.js.map +1 -0
  34. package/dist/src/commands/auth/auth-status.command.d.ts +19 -0
  35. package/dist/src/commands/auth/auth-status.command.js +101 -0
  36. package/dist/src/commands/auth/auth-status.command.js.map +1 -0
  37. package/dist/src/commands/auth/auth.command.d.ts +5 -0
  38. package/dist/src/commands/auth/auth.command.js +35 -0
  39. package/dist/src/commands/auth/auth.command.js.map +1 -0
  40. package/dist/src/commands/base-sync.command.d.ts +2 -2
  41. package/dist/src/commands/base-sync.command.js +1 -2
  42. package/dist/src/commands/base-sync.command.js.map +1 -1
  43. package/dist/src/commands/base.command.d.ts +2 -0
  44. package/dist/src/commands/base.command.js +13 -0
  45. package/dist/src/commands/base.command.js.map +1 -1
  46. package/dist/src/commands/context/context-create.command.d.ts +28 -0
  47. package/dist/src/commands/context/context-create.command.js +172 -0
  48. package/dist/src/commands/context/context-create.command.js.map +1 -0
  49. package/dist/src/commands/context/context-list.command.d.ts +9 -0
  50. package/dist/src/commands/context/context-list.command.js +46 -0
  51. package/dist/src/commands/context/context-list.command.js.map +1 -0
  52. package/dist/src/commands/context/context-remove.command.d.ts +9 -0
  53. package/dist/src/commands/context/context-remove.command.js +48 -0
  54. package/dist/src/commands/context/context-remove.command.js.map +1 -0
  55. package/dist/src/commands/context/context-show.command.d.ts +9 -0
  56. package/dist/src/commands/context/context-show.command.js +64 -0
  57. package/dist/src/commands/context/context-show.command.js.map +1 -0
  58. package/dist/src/commands/context/context-use.command.d.ts +9 -0
  59. package/dist/src/commands/context/context-use.command.js +45 -0
  60. package/dist/src/commands/context/context-use.command.js.map +1 -0
  61. package/dist/src/commands/context/context.command.d.ts +5 -0
  62. package/dist/src/commands/context/context.command.js +43 -0
  63. package/dist/src/commands/context/context.command.js.map +1 -0
  64. package/dist/src/commands/endpoint/endpoint-ensure.command.d.ts +18 -0
  65. package/dist/src/commands/endpoint/endpoint-ensure.command.js +90 -0
  66. package/dist/src/commands/endpoint/endpoint-ensure.command.js.map +1 -0
  67. package/dist/src/commands/endpoint/endpoint-list.command.d.ts +14 -0
  68. package/dist/src/commands/endpoint/endpoint-list.command.js +62 -0
  69. package/dist/src/commands/endpoint/endpoint-list.command.js.map +1 -0
  70. package/dist/src/commands/endpoint/endpoint.command.d.ts +5 -0
  71. package/dist/src/commands/endpoint/endpoint.command.js +34 -0
  72. package/dist/src/commands/endpoint/endpoint.command.js.map +1 -0
  73. package/dist/src/commands/example/example-bootstrap.command.d.ts +24 -0
  74. package/dist/src/commands/example/example-bootstrap.command.js +133 -0
  75. package/dist/src/commands/example/example-bootstrap.command.js.map +1 -0
  76. package/dist/src/commands/example/example.command.d.ts +5 -0
  77. package/dist/src/commands/example/example.command.js +33 -0
  78. package/dist/src/commands/example/example.command.js.map +1 -0
  79. package/dist/src/commands/instance/instance-add.command.d.ts +16 -0
  80. package/dist/src/commands/instance/instance-add.command.js +83 -0
  81. package/dist/src/commands/instance/instance-add.command.js.map +1 -0
  82. package/dist/src/commands/instance/instance-list.command.d.ts +9 -0
  83. package/dist/src/commands/instance/instance-list.command.js +45 -0
  84. package/dist/src/commands/instance/instance-list.command.js.map +1 -0
  85. package/dist/src/commands/instance/instance-remove.command.d.ts +9 -0
  86. package/dist/src/commands/instance/instance-remove.command.js +54 -0
  87. package/dist/src/commands/instance/instance-remove.command.js.map +1 -0
  88. package/dist/src/commands/instance/instance-show.command.d.ts +9 -0
  89. package/dist/src/commands/instance/instance-show.command.js +50 -0
  90. package/dist/src/commands/instance/instance-show.command.js.map +1 -0
  91. package/dist/src/commands/instance/instance.command.d.ts +5 -0
  92. package/dist/src/commands/instance/instance.command.js +41 -0
  93. package/dist/src/commands/instance/instance.command.js.map +1 -0
  94. package/dist/src/commands/migration/apply-migrations.command.js +1 -0
  95. package/dist/src/commands/migration/apply-migrations.command.js.map +1 -1
  96. package/dist/src/commands/project/project-ensure.command.d.ts +16 -0
  97. package/dist/src/commands/project/project-ensure.command.js +71 -0
  98. package/dist/src/commands/project/project-ensure.command.js.map +1 -0
  99. package/dist/src/commands/project/project.command.d.ts +5 -0
  100. package/dist/src/commands/project/project.command.js +33 -0
  101. package/dist/src/commands/project/project.command.js.map +1 -0
  102. package/dist/src/services/bootstrap/bootstrap.service.d.ts +112 -0
  103. package/dist/src/services/bootstrap/bootstrap.service.js +438 -0
  104. package/dist/src/services/bootstrap/bootstrap.service.js.map +1 -0
  105. package/dist/src/services/bootstrap/index.d.ts +1 -0
  106. package/dist/src/services/bootstrap/index.js +6 -0
  107. package/dist/src/services/bootstrap/index.js.map +1 -0
  108. package/dist/src/services/connection/api-client.d.ts +4 -0
  109. package/dist/src/services/connection/api-client.js +67 -5
  110. package/dist/src/services/connection/api-client.js.map +1 -1
  111. package/dist/src/services/connection/connection-factory.service.js +4 -3
  112. package/dist/src/services/connection/connection-factory.service.js.map +1 -1
  113. package/dist/src/services/connection/connection.service.d.ts +10 -2
  114. package/dist/src/services/connection/connection.service.js +49 -4
  115. package/dist/src/services/connection/connection.service.js.map +1 -1
  116. package/dist/src/services/credentials/credential-store.service.d.ts +19 -0
  117. package/dist/src/services/credentials/credential-store.service.js +112 -0
  118. package/dist/src/services/credentials/credential-store.service.js.map +1 -0
  119. package/dist/src/services/credentials/credential-target.service.d.ts +22 -0
  120. package/dist/src/services/credentials/credential-target.service.js +107 -0
  121. package/dist/src/services/credentials/credential-target.service.js.map +1 -0
  122. package/dist/src/services/credentials/index.d.ts +2 -0
  123. package/dist/src/services/credentials/index.js +8 -0
  124. package/dist/src/services/credentials/index.js.map +1 -0
  125. package/dist/src/services/index.d.ts +3 -0
  126. package/dist/src/services/index.js +3 -0
  127. package/dist/src/services/index.js.map +1 -1
  128. package/dist/src/services/url/auth-prompt.service.d.ts +3 -1
  129. package/dist/src/services/url/auth-prompt.service.js +3 -0
  130. package/dist/src/services/url/auth-prompt.service.js.map +1 -1
  131. package/dist/src/services/url/url-builder.service.js +3 -0
  132. package/dist/src/services/url/url-builder.service.js.map +1 -1
  133. package/dist/src/services/workspace/index.d.ts +1 -0
  134. package/dist/src/services/workspace/index.js +11 -0
  135. package/dist/src/services/workspace/index.js.map +1 -0
  136. package/dist/src/services/workspace/workspace-config.service.d.ts +66 -0
  137. package/dist/src/services/workspace/workspace-config.service.js +313 -0
  138. package/dist/src/services/workspace/workspace-config.service.js.map +1 -0
  139. package/dist/tsconfig.build.tsbuildinfo +1 -1
  140. package/docs/authentication.md +69 -26
  141. package/docs/bootstrap-commands.md +105 -0
  142. package/docs/configuration.md +49 -22
  143. package/docs/url-format.md +2 -2
  144. package/docs/workspace-config.md +135 -0
  145. package/e2e/jest-matrix.json +14 -0
  146. package/e2e/matrix/M01-auth-commands.e2e-spec.ts +241 -0
  147. package/e2e/matrix/M02-instance-commands.e2e-spec.ts +213 -0
  148. package/e2e/matrix/M03-context-commands.e2e-spec.ts +279 -0
  149. package/e2e/matrix/M04-project-ensure.e2e-spec.ts +218 -0
  150. package/e2e/matrix/M05-endpoint-commands.e2e-spec.ts +172 -0
  151. package/e2e/matrix/M06-example-bootstrap.e2e-spec.ts +437 -0
  152. package/e2e/matrix/M07-migrate.e2e-spec.ts +229 -0
  153. package/e2e/matrix/M08-schema.e2e-spec.ts +163 -0
  154. package/e2e/matrix/M09-rows.e2e-spec.ts +185 -0
  155. package/e2e/matrix/M10-sync.e2e-spec.ts +224 -0
  156. package/e2e/matrix/M11-target-resolution.e2e-spec.ts +177 -0
  157. package/e2e/matrix/M12-error-paths.e2e-spec.ts +162 -0
  158. package/e2e/matrix/M13-no-auth-mode.e2e-spec.ts +119 -0
  159. package/e2e/matrix/M14-multi-instance-workspace.e2e-spec.ts +182 -0
  160. package/e2e/matrix/README.md +354 -0
  161. package/e2e/tests/07-workspace-config.e2e-spec.ts +492 -0
  162. package/e2e/tests/08-bootstrap.e2e-spec.ts +304 -0
  163. package/e2e/utils/cli-runner.ts +16 -5
  164. package/e2e/utils/matrix-fixtures.ts +141 -0
  165. package/e2e/utils/matrix-workspace.ts +106 -0
  166. package/e2e/utils/standalone-api.ts +314 -0
  167. package/e2e/utils/standalone-runner.ts +276 -0
  168. package/package.json +6 -3
  169. package/src/app.module.ts +54 -0
  170. package/src/commands/auth/__tests__/auth-command.utils.spec.ts +41 -0
  171. package/src/commands/auth/__tests__/auth-login.command.spec.ts +131 -0
  172. package/src/commands/auth/__tests__/auth-logout.command.spec.ts +85 -0
  173. package/src/commands/auth/__tests__/auth-status.command.spec.ts +106 -0
  174. package/src/commands/auth/__tests__/auth.command.spec.ts +18 -0
  175. package/src/commands/auth/auth-command.utils.ts +36 -0
  176. package/src/commands/auth/auth-login.command.ts +146 -0
  177. package/src/commands/auth/auth-logout.command.ts +71 -0
  178. package/src/commands/auth/auth-status.command.ts +89 -0
  179. package/src/commands/auth/auth.command.ts +20 -0
  180. package/src/commands/base-sync.command.ts +2 -3
  181. package/src/commands/base.command.ts +11 -0
  182. package/src/commands/context/context-create.command.ts +173 -0
  183. package/src/commands/context/context-list.command.ts +36 -0
  184. package/src/commands/context/context-remove.command.ts +35 -0
  185. package/src/commands/context/context-show.command.ts +59 -0
  186. package/src/commands/context/context-use.command.ts +31 -0
  187. package/src/commands/context/context.command.ts +28 -0
  188. package/src/commands/endpoint/__tests__/endpoint-ensure.command.spec.ts +129 -0
  189. package/src/commands/endpoint/__tests__/endpoint-list.command.spec.ts +59 -0
  190. package/src/commands/endpoint/__tests__/endpoint.command.spec.ts +14 -0
  191. package/src/commands/endpoint/endpoint-ensure.command.ts +74 -0
  192. package/src/commands/endpoint/endpoint-list.command.ts +48 -0
  193. package/src/commands/endpoint/endpoint.command.ts +19 -0
  194. package/src/commands/example/__tests__/example-bootstrap.command.spec.ts +145 -0
  195. package/src/commands/example/__tests__/example.command.spec.ts +14 -0
  196. package/src/commands/example/example-bootstrap.command.ts +122 -0
  197. package/src/commands/example/example.command.ts +18 -0
  198. package/src/commands/instance/instance-add.command.ts +72 -0
  199. package/src/commands/instance/instance-list.command.ts +31 -0
  200. package/src/commands/instance/instance-remove.command.ts +44 -0
  201. package/src/commands/instance/instance-show.command.ts +35 -0
  202. package/src/commands/instance/instance.command.ts +26 -0
  203. package/src/commands/migration/apply-migrations.command.ts +1 -0
  204. package/src/commands/project/__tests__/project-ensure.command.spec.ts +119 -0
  205. package/src/commands/project/__tests__/project.command.spec.ts +14 -0
  206. package/src/commands/project/project-ensure.command.ts +61 -0
  207. package/src/commands/project/project.command.ts +18 -0
  208. package/src/services/bootstrap/__tests__/bootstrap.service.spec.ts +798 -0
  209. package/src/services/bootstrap/bootstrap.service.ts +698 -0
  210. package/src/services/bootstrap/index.ts +12 -0
  211. package/src/services/connection/__tests__/api-client.spec.ts +262 -0
  212. package/src/services/connection/__tests__/connection-factory.service.spec.ts +2 -0
  213. package/src/services/connection/__tests__/connection.service.spec.ts +161 -0
  214. package/src/services/connection/api-client.ts +88 -5
  215. package/src/services/connection/connection-factory.service.ts +4 -3
  216. package/src/services/connection/connection.service.ts +74 -3
  217. package/src/services/credentials/__tests__/credential-store.service.spec.ts +128 -0
  218. package/src/services/credentials/__tests__/credential-target.service.spec.ts +126 -0
  219. package/src/services/credentials/credential-store.service.ts +145 -0
  220. package/src/services/credentials/credential-target.service.ts +145 -0
  221. package/src/services/credentials/index.ts +9 -0
  222. package/src/services/index.ts +3 -0
  223. package/src/services/url/__tests__/url-builder.service.spec.ts +17 -0
  224. package/src/services/url/auth-prompt.service.ts +6 -1
  225. package/src/services/url/url-builder.service.ts +4 -0
  226. package/src/services/workspace/__tests__/workspace-config.service.spec.ts +378 -0
  227. package/src/services/workspace/index.ts +14 -0
  228. package/src/services/workspace/workspace-config.service.ts +467 -0
  229. package/.github/workflows/bump-version.yml +0 -86
@@ -3,36 +3,17 @@ name: Build
3
3
  on:
4
4
  workflow_dispatch:
5
5
 
6
- env:
7
- IMAGE_NAME: ${{ github.event.repository.name }}
6
+ permissions:
7
+ contents: read
8
8
 
9
9
  jobs:
10
10
  build-and-push-image:
11
- runs-on: ubuntu-latest
12
- permissions:
13
- contents: read
14
- packages: write
15
-
16
- steps:
17
- - name: Checkout repository
18
- uses: actions/checkout@v4
19
-
20
- - name: Log in to the Container registry
21
- uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 #docker/login-action@v3
22
- with:
23
- username: ${{ secrets.DOCKERHUB_USERNAME }}
24
- password: ${{ secrets.DOCKERHUB_TOKEN }}
25
-
26
- - name: Extract metadata (tags, labels) for Docker
27
- id: meta
28
- uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f #docker/metadata-action@v5
29
- with:
30
- images: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}
31
-
32
- - name: Build and push Docker image
33
- uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 #docker/build-push-action@v5
34
- with:
35
- context: .
36
- push: true
37
- tags: ${{ steps.meta.outputs.tags }}
38
- labels: ${{ steps.meta.outputs.labels }}
11
+ uses: revisium/revisium-actions/.github/workflows/docker-build.yml@184b609dcbc1e23f14021141f29226d4e6a0f1ac # v0.3.6
12
+ with:
13
+ image_name: ${{ github.event.repository.name }}
14
+ context: .
15
+ dockerfile: Dockerfile
16
+ emit_latest_tag: ${{ startsWith(github.ref, 'refs/tags/v') }}
17
+ secrets:
18
+ DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
19
+ DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
@@ -88,9 +88,3 @@ jobs:
88
88
  uses: SonarSource/sonarqube-scan-action@8c71dc039c2dd71d3821e89a2b58ecc7fee6ced9 #SonarSource/sonarqube-scan-action@v5
89
89
  env:
90
90
  SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
91
-
92
- - name: Upload results to Codecov
93
- uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 #codecov/codecov-action@v5
94
- with:
95
- token: ${{ secrets.CODECOV_TOKEN }}
96
- files: ./coverage/lcov.info
@@ -6,84 +6,19 @@ on:
6
6
  - 'v*'
7
7
 
8
8
  jobs:
9
- validate-and-publish:
10
- runs-on: ubuntu-latest
9
+ publish:
11
10
  permissions:
12
11
  contents: write
13
12
  id-token: write
14
- steps:
15
- - name: Checkout repository
16
- uses: actions/checkout@v4
17
-
18
- - name: Setup Node.js
19
- uses: actions/setup-node@v4
20
- with:
21
- node-version-file: '.nvmrc'
22
- registry-url: 'https://registry.npmjs.org'
23
-
24
- - name: Validate tag format
25
- run: |
26
- TAG=${GITHUB_REF#refs/tags/}
27
- echo "📌 Publishing for tag: $TAG"
28
-
29
- if [[ ! $TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.]+)?$ ]]; then
30
- echo "❌ Invalid tag format: $TAG (expected: vX.Y.Z or vX.Y.Z-prerelease)"
31
- exit 1
32
- fi
33
-
34
- VERSION=${TAG#v}
35
- echo "version=$VERSION" >> $GITHUB_ENV
36
-
37
- - name: Install dependencies
38
- run: npm ci
39
-
40
- - name: Validate package.json version matches tag
41
- run: |
42
- PACKAGE_VERSION=$(node -p "require('./package.json').version")
43
- TAG_VERSION=${{ env.version }}
44
-
45
- echo "📦 package.json version: $PACKAGE_VERSION"
46
- echo "🏷️ Tag version: $TAG_VERSION"
47
-
48
- if [[ "$PACKAGE_VERSION" != "$TAG_VERSION" ]]; then
49
- echo "❌ Version mismatch: package.json ($PACKAGE_VERSION) != tag ($TAG_VERSION)"
50
- exit 1
51
- fi
52
-
53
- echo "✅ Version validation passed"
54
-
55
- - name: Determine npm tag
56
- id: npm-tag
57
- run: |
58
- VERSION=$(node -p "require('./package.json').version")
59
- if [[ "$VERSION" =~ -alpha ]]; then
60
- echo "tag=alpha" >> $GITHUB_OUTPUT
61
- elif [[ "$VERSION" =~ -beta ]]; then
62
- echo "tag=beta" >> $GITHUB_OUTPUT
63
- elif [[ "$VERSION" =~ -rc ]]; then
64
- echo "tag=rc" >> $GITHUB_OUTPUT
65
- else
66
- echo "tag=latest" >> $GITHUB_OUTPUT
67
- fi
68
-
69
- - name: Publish to NPM
70
- run: npm publish --provenance --access public --tag ${{ steps.npm-tag.outputs.tag }}
71
-
72
- - name: Create GitHub Release
73
- uses: softprops/action-gh-release@v1
74
- with:
75
- tag_name: ${{ github.ref_name }}
76
- name: Release ${{ github.ref_name }}
77
- body: |
78
- ## Changes in ${{ github.ref_name }}
79
-
80
- This release was automatically generated from tag ${{ github.ref_name }}.
81
-
82
- ### Installation
83
- ```bash
84
- npm install -g revisium@${{ env.version }}
85
- ```
86
- draft: false
87
- prerelease: false
88
- env:
89
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13
+ uses: revisium/revisium-actions/.github/workflows/npm-publish.yml@184b609dcbc1e23f14021141f29226d4e6a0f1ac # v0.3.6
14
+ with:
15
+ node_version: 24.11.1
16
+ install_command: npm ci
17
+ pre_publish_commands: |
18
+ npm run tsc
19
+ npm run build
20
+ npm_access: public
21
+ publish_auth: token
22
+ create_github_release: true
23
+ secrets:
24
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -0,0 +1,90 @@
1
+ name: Release Train
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ action:
7
+ description: Release train transition
8
+ required: true
9
+ type: choice
10
+ options:
11
+ - start-minor-alpha
12
+ - start-major-alpha
13
+ - start-minor-rc
14
+ - start-major-rc
15
+ - start-minor-stable
16
+ - start-major-stable
17
+ - alpha-bump
18
+ - promote-rc
19
+ - rc-bump
20
+ - stable
21
+ - patch
22
+ - patch-alpha-start
23
+ - patch-rc-start
24
+ dry_run:
25
+ description: Validate and show the computed release without pushing.
26
+ required: false
27
+ default: false
28
+ type: boolean
29
+
30
+ concurrency:
31
+ group: ${{ github.repository }}-release-train
32
+ cancel-in-progress: false
33
+
34
+ permissions:
35
+ actions: read
36
+ contents: read
37
+
38
+ jobs:
39
+ release-train:
40
+ name: Release train
41
+ uses: revisium/revisium-actions/.github/workflows/release-train.yml@184b609dcbc1e23f14021141f29226d4e6a0f1ac # v0.3.6
42
+ with:
43
+ action: ${{ inputs.action }}
44
+ dry_run: ${{ inputs.dry_run }}
45
+ base_branch: master
46
+ node_version: 24.11.1
47
+ install_command: npm ci
48
+ validate_command: |
49
+ cleanup() {
50
+ status=$?
51
+ if [ -f .e2e-test.pid ]; then
52
+ kill "$(cat .e2e-test.pid)" 2>/dev/null || true
53
+ rm -f .e2e-test.pid
54
+ fi
55
+ rm -rf .e2e-test
56
+ if [ "$status" -ne 0 ] && [ -f revisium.log ]; then
57
+ cat revisium.log
58
+ fi
59
+ exit "$status"
60
+ }
61
+ trap cleanup EXIT
62
+
63
+ npm run lint:ci
64
+ npm run tsc
65
+ rm -rf dist
66
+
67
+ FILE_PLUGIN_PUBLIC_ENDPOINT=https://cdn.example.com npx @revisium/standalone --auth --port 8082 --data .e2e-test > revisium.log 2>&1 &
68
+ echo $! > .e2e-test.pid
69
+
70
+ for i in $(seq 1 300); do
71
+ revisium_pid="$(cat .e2e-test.pid)"
72
+ if ! kill -0 "$revisium_pid" 2>/dev/null; then
73
+ echo "Revisium exited before becoming ready"
74
+ exit 1
75
+ fi
76
+ if curl -sf http://localhost:8082/health/readiness > /dev/null 2>&1; then
77
+ echo "Revisium ready after ${i}s"
78
+ break
79
+ fi
80
+ if [ "$i" = 300 ]; then
81
+ echo "Timed out waiting for Revisium"
82
+ exit 1
83
+ fi
84
+ sleep 1
85
+ done
86
+
87
+ npm run test:all
88
+ npm run build
89
+ secrets:
90
+ RELEASE_BOT_PRIVATE_KEY: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}
package/AGENTS.md ADDED
@@ -0,0 +1,98 @@
1
+ # revisium-cli — Agent Guide
2
+
3
+ Context for AI coding assistants (Claude, Cursor, Copilot Workspace, Aider, etc.) working on this repository. Keep edits minimal and scoped; verify with the commands listed below.
4
+
5
+ ## What this is
6
+
7
+ `revisium-cli` is a NestJS / `nest-commander` CLI for managing Revisium instances: schema export/import, migrations, row sync, project/endpoint bootstrap, workspace configuration, and saved API-key auth. It ships as the `revisium` npm binary.
8
+
9
+ Primary command groups:
10
+
11
+ - `migrate save/apply` — schema migrations
12
+ - `schema save/create-migrations` — schema export + offline migration generation
13
+ - `rows save/upload` — data export/import
14
+ - `sync schema/data/all` — direct project-to-project sync
15
+ - `instance add/list/show/remove` — workspace instance config
16
+ - `context create/list/show/use/remove` — workspace contexts
17
+ - `auth login/status/logout` — saved API-key credentials (OS keyring)
18
+ - `project ensure` — idempotent project + branch creation
19
+ - `endpoint ensure/list` — generated REST/GraphQL endpoints
20
+ - `example bootstrap` — end-to-end project seeding from a config file
21
+
22
+ ## Commands
23
+
24
+ | Goal | Command |
25
+ | ----------------- | ------------------------------------------------------------------------------------------------ |
26
+ | Type-check | `npm run tsc` |
27
+ | Lint (CI mode) | `npm run lint:ci` |
28
+ | Lint + autofix | `npm run lint` |
29
+ | Unit tests | `npm test -- --runInBand` |
30
+ | Unit + coverage | `npm run test:cov` |
31
+ | Build the binary | `npm run build` (outputs `dist/src/main.js`) |
32
+ | E2E (default) | `npm run test:e2e` (expects standalone running on `localhost:8082`; bring it up with `test:e2e:up`/`test:e2e:down`) |
33
+ | E2E matrix | `npm run test:e2e:matrix` — opt-in; see `e2e/matrix/README.md` |
34
+
35
+ Local CLI invocation: `node dist/src/main.js <command>` (the `revisium` shim points at the same file).
36
+
37
+ ## Code layout
38
+
39
+ ```
40
+ src/
41
+ app.module.ts # NestJS module wiring all commands + services
42
+ main.ts # CommandFactory entry point
43
+ commands/
44
+ auth/ # auth login/status/logout, AuthCommandTarget helpers
45
+ instance/ # instance add/list/show/remove
46
+ context/ # context create/list/show/use/remove
47
+ project/ # project ensure
48
+ endpoint/ # endpoint ensure/list
49
+ example/ # example bootstrap
50
+ migration/ # migrate save/apply
51
+ schema/ # schema save / create-migrations
52
+ rows/ # rows save / upload
53
+ sync/ # sync schema / data / all
54
+ base.command.ts # shared --url / --context options
55
+ base-sync.command.ts # shared sync flags
56
+ services/
57
+ bootstrap/ # BootstrapService: ensureProject / ensureTable / ensureRow / ensureEndpoint / bootstrapExample
58
+ connection/ # RevisiumApiClient + ConnectionService
59
+ credentials/ # OS keyring-backed API key store + credential-target resolver
60
+ sync/ # sync orchestration helpers
61
+ url/ # URL parsing / building, AuthPromptService
62
+ workspace/ # .revisium/revisium-cli.config.json reader/writer
63
+ common/ # logging, JSON validation, interactive prompts
64
+ utils/ # parse-boolean, env-config, error formatter, stats
65
+ e2e/
66
+ tests/ # default e2e suite (legacy, hits docker-compose standalone)
67
+ matrix/ # opt-in matrix; each suite owns a fresh @revisium/standalone
68
+ utils/ # cli-runner, standalone-runner, standalone-api, fixtures, workspace helpers
69
+ docs/ # public docs surfaced from README.md
70
+ ```
71
+
72
+ ## Conventions
73
+
74
+ - **Strict ESLint config** with `--max-warnings 0` and Prettier integration. Run `npm run lint` after edits — auto-fix handles most issues.
75
+ - **Tests live in `__tests__/` next to the code** and end in `.spec.ts`. Existing patterns: instantiate the command/service directly with hand-rolled fakes (no Nest test module overhead). See `src/commands/auth/__tests__/auth-status.command.spec.ts` for a representative example.
76
+ - **Coverage threshold:** SonarCloud requires `new_coverage ≥ 80%` on each PR. Add tests for new branches in the same PR.
77
+ - **Validation errors** thrown for config-shape problems use `TypeError` (Sonar S7786). Operational errors stay as plain `Error`.
78
+ - **No `--no-input` plumbing yet.** A common-flags PR is planned; until then, don't expose `--no-input` as a per-command option (it would be dead code).
79
+ - **OS keyring service name** can be overridden via `REVISIUM_CREDENTIAL_STORE_SERVICE` for tests so saved keys don't bleed into the developer's keyring.
80
+
81
+ ## Trust-but-verify checklist
82
+
83
+ After making changes, run **all** of:
84
+
85
+ ```sh
86
+ npm run tsc
87
+ npm run lint:ci
88
+ npm test -- --runInBand
89
+ npm run build
90
+ ```
91
+
92
+ If touching e2e helpers or matrix specs, ensure the additions still type-check and lint clean (the matrix is intentionally not run on default CI).
93
+
94
+ ## When to update this file
95
+
96
+ Whenever a convention changes — e.g., a new command surface, a non-obvious testing pattern, a new lint rule — update both the relevant section and the commands table.
97
+
98
+ > Tools that look for `CLAUDE.md` will follow the symlink in repo root to this file. Treat `AGENTS.md` as the single source of truth.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  # Revisium CLI
4
4
 
5
5
  [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=revisium_revisium-cli&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=revisium_revisium-cli)
6
- [![codecov](https://codecov.io/gh/revisium/revisium-cli/branch/master/graph/badge.svg?token=8XI9VJ6EQR)](https://codecov.io/gh/revisium/revisium-cli)
6
+ [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=revisium_revisium-cli&metric=coverage)](https://sonarcloud.io/summary/new_code?id=revisium_revisium-cli)
7
7
  [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=revisium_revisium-cli&metric=bugs)](https://sonarcloud.io/summary/new_code?id=revisium_revisium-cli)
8
8
  [![GitHub License](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/revisium/revisium-cli/blob/master/LICENSE)
9
9
  [![GitHub Release](https://img.shields.io/github/v/release/revisium/revisium-cli)](https://github.com/revisium/revisium-cli/releases)
@@ -133,21 +133,37 @@ revisium sync all \
133
133
 
134
134
  ## Commands
135
135
 
136
- | Command | Description | Documentation |
137
- |---------|-------------|---------------|
138
- | `schema save` | Export table schemas to JSON files | [Schema Commands](docs/schema-commands.md) |
139
- | `schema create-migrations` | Convert schemas to migration format | [Schema Commands](docs/schema-commands.md) |
140
- | `migrate save` | Export migrations to JSON file | [Migrate Commands](docs/migrate-commands.md) |
141
- | `migrate apply` | Apply migrations from JSON file | [Migrate Commands](docs/migrate-commands.md) |
142
- | `rows save` | Export table data to JSON files | [Rows Commands](docs/rows-commands.md) |
143
- | `rows upload` | Upload table data from JSON files | [Rows Commands](docs/rows-commands.md) |
144
- | `sync schema` | Sync schema between projects | [Sync Commands](docs/sync-commands.md) |
145
- | `sync data` | Sync data between projects | [Sync Commands](docs/sync-commands.md) |
146
- | `sync all` | Full sync (schema + data) | [Sync Commands](docs/sync-commands.md) |
136
+ | Command | Description | Documentation |
137
+ | ------------------------------------- | -------------------------------------- | ------------------------------------------------ |
138
+ | `schema save` | Export table schemas to JSON files | [Schema Commands](docs/schema-commands.md) |
139
+ | `schema create-migrations` | Convert schemas to migration format | [Schema Commands](docs/schema-commands.md) |
140
+ | `migrate save` | Export migrations to JSON file | [Migrate Commands](docs/migrate-commands.md) |
141
+ | `migrate apply` | Apply migrations from JSON file | [Migrate Commands](docs/migrate-commands.md) |
142
+ | `rows save` | Export table data to JSON files | [Rows Commands](docs/rows-commands.md) |
143
+ | `rows upload` | Upload table data from JSON files | [Rows Commands](docs/rows-commands.md) |
144
+ | `sync schema` | Sync schema between projects | [Sync Commands](docs/sync-commands.md) |
145
+ | `sync data` | Sync data between projects | [Sync Commands](docs/sync-commands.md) |
146
+ | `sync all` | Full sync (schema + data) | [Sync Commands](docs/sync-commands.md) |
147
+ | `instance add/list/show/remove` | Manage workspace Revisium instances | [Workspace Config](docs/workspace-config.md) |
148
+ | `context create/list/show/use/remove` | Manage workspace Revisium contexts | [Workspace Config](docs/workspace-config.md) |
149
+ | `auth login/status/logout` | Manage saved API-key credentials | [Authentication](docs/authentication.md) |
150
+ | `project ensure` | Ensure a project and branch exist | [Bootstrap Commands](docs/bootstrap-commands.md) |
151
+ | `endpoint ensure/list` | Ensure or list generated endpoints | [Bootstrap Commands](docs/bootstrap-commands.md) |
152
+ | `example bootstrap` | Bootstrap example projects from config | [Bootstrap Commands](docs/bootstrap-commands.md) |
147
153
 
148
154
  ## Configuration
149
155
 
150
- Configure via environment variables or `.env` file:
156
+ Configure via workspace config, environment variables, or `.env` file:
157
+
158
+ ```bash
159
+ # Workspace-local standalone example without auth
160
+ revisium instance add local --url revisium://localhost:9222 --auth none
161
+ revisium context create dictionary-local \
162
+ --url revisium://localhost:9222/admin/dictionary/master
163
+ revisium context use dictionary-local
164
+ ```
165
+
166
+ Then single-target commands can omit `--url` in that workspace.
151
167
 
152
168
  ```env
153
169
  # Recommended: URL + Token
@@ -178,6 +194,8 @@ See [Configuration](docs/configuration.md) and [URL Format](docs/url-format.md)
178
194
  ## Documentation
179
195
 
180
196
  - [Configuration](docs/configuration.md) - Environment variables and .env files
197
+ - [Workspace Config](docs/workspace-config.md) - non-secret instances and contexts
198
+ - [Bootstrap Commands](docs/bootstrap-commands.md) - project, endpoint, and example bootstrap workflows
181
199
  - [URL Format](docs/url-format.md) - Revisium URL syntax
182
200
  - [Authentication](docs/authentication.md) - Token, API key, and password auth
183
201
  - [Schema Commands](docs/schema-commands.md) - schema save, create-migrations
@@ -7,6 +7,7 @@ export interface CliOptions {
7
7
  env?: Record<string, string>;
8
8
  timeout?: number;
9
9
  cwd?: string;
10
+ stdin?: string;
10
11
  }
11
12
  export declare function runCli(args: string[], options?: CliOptions): Promise<CliResult>;
12
13
  export declare function buildUrl(projectName: string, options?: {
@@ -6,12 +6,11 @@ const child_process_1 = require("child_process");
6
6
  const fs = require("fs");
7
7
  const path = require("path");
8
8
  async function runCli(args, options = {}) {
9
- const { env = {}, timeout = 60000, cwd = process.cwd() } = options;
9
+ const { env = {}, timeout = 60000, cwd = process.cwd(), stdin } = options;
10
10
  const isInstrumented = process.env.E2E_INSTRUMENTED === '1';
11
- const mainPath = isInstrumented
12
- ? 'dist-instrumented/src/main.js'
13
- : 'dist/src/main.js';
14
- const nycOutputDir = path.join(cwd, '.nyc_output');
11
+ const projectRoot = process.cwd();
12
+ const mainPath = path.join(projectRoot, isInstrumented ? 'dist-instrumented/src/main.js' : 'dist/src/main.js');
13
+ const nycOutputDir = path.join(projectRoot, '.nyc_output');
15
14
  if (isInstrumented && !fs.existsSync(nycOutputDir)) {
16
15
  fs.mkdirSync(nycOutputDir, { recursive: true });
17
16
  }
@@ -25,6 +24,13 @@ async function runCli(args, options = {}) {
25
24
  },
26
25
  stdio: ['pipe', 'pipe', 'pipe'],
27
26
  });
27
+ if (stdin !== undefined) {
28
+ child.stdin?.write(stdin);
29
+ child.stdin?.end();
30
+ }
31
+ else {
32
+ child.stdin?.end();
33
+ }
28
34
  let stdout = '';
29
35
  let stderr = '';
30
36
  child.stdout.on('data', (data) => {
@@ -1 +1 @@
1
- {"version":3,"file":"cli-runner.js","sourceRoot":"","sources":["../../../e2e/utils/cli-runner.ts"],"names":[],"mappings":";;AAgBA,wBA0DC;AAED,4BA8BC;AA1GD,iDAAsC;AACtC,yBAAyB;AACzB,6BAA6B;AActB,KAAK,UAAU,MAAM,CAC1B,IAAc,EACd,UAAsB,EAAE;IAExB,MAAM,EAAE,GAAG,GAAG,EAAE,EAAE,OAAO,GAAG,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC;IAEnE,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,KAAK,GAAG,CAAC;IAC5D,MAAM,QAAQ,GAAG,cAAc;QAC7B,CAAC,CAAC,+BAA+B;QACjC,CAAC,CAAC,kBAAkB,CAAC;IAEvB,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;IACnD,IAAI,cAAc,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QACnD,EAAE,CAAC,SAAS,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAClD,CAAC;IAED,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,KAAK,GAAG,IAAA,qBAAK,EAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,EAAE;YAC/C,GAAG;YACH,GAAG,EAAE;gBACH,GAAG,OAAO,CAAC,GAAG;gBACd,GAAG,GAAG;gBAEN,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC5D;YACD,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;SAChC,CAAC,CA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,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE;YAC7B,YAAY,CAAC,SAAS,CAAC,CAAC;YACxB,OAAO,CAAC;gBACN,MAAM;gBACN,MAAM;gBACN,QAAQ,EAAE,QAAQ,IAAI,CAAC;aACxB,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YAC1B,YAAY,CAAC,SAAS,CAAC,CAAC;YACxB,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,QAAQ,CACtB,WAAmB,EACnB,UAMI,EAAE;IAEN,MAAM,EACJ,KAAK,GAAG,OAAO,EACf,MAAM,GAAG,QAAQ,EACjB,QAAQ,EACR,KAAK,EACL,QAAQ,GACT,GAAG,OAAO,CAAC;IAEZ,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,YAAY,QAAQ,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC;IAC9D,IAAI,GAAG,GAAG,GAAG,MAAM,qBAAqB,KAAK,IAAI,WAAW,IAAI,MAAM,EAAE,CAAC;IAEzE,IAAI,QAAQ,EAAE,CAAC;QACb,GAAG,IAAI,IAAI,QAAQ,EAAE,CAAC;IACxB,CAAC;IAED,IAAI,KAAK,EAAE,CAAC;QACV,GAAG,IAAI,UAAU,KAAK,EAAE,CAAC;IAC3B,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,26 @@
1
+ export interface BootstrapTableConfig {
2
+ id: string;
3
+ schema: object;
4
+ }
5
+ export interface BootstrapRowConfig {
6
+ tableId: string;
7
+ rowId: string;
8
+ data: object;
9
+ }
10
+ export interface BootstrapConfigShape {
11
+ projectName?: string;
12
+ branchName?: string;
13
+ endpoints?: Array<'REST_API' | 'GRAPHQL'>;
14
+ tables?: BootstrapTableConfig[];
15
+ rows?: BootstrapRowConfig[];
16
+ commitMessage?: string;
17
+ }
18
+ export declare function tagSchema(): object;
19
+ export declare function faqSchema(): object;
20
+ export declare function questSchema(): object;
21
+ export declare function tagRows(count?: number): BootstrapRowConfig[];
22
+ export declare function faqRows(): BootstrapRowConfig[];
23
+ export declare function questRows(count?: number): BootstrapRowConfig[];
24
+ export declare function bootstrapConfig(partial?: BootstrapConfigShape): BootstrapConfigShape;
25
+ export declare function tagBootstrapConfig(projectName: string): BootstrapConfigShape;
26
+ export declare function faqBootstrapConfig(projectName: string): BootstrapConfigShape;
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tagSchema = tagSchema;
4
+ exports.faqSchema = faqSchema;
5
+ exports.questSchema = questSchema;
6
+ exports.tagRows = tagRows;
7
+ exports.faqRows = faqRows;
8
+ exports.questRows = questRows;
9
+ exports.bootstrapConfig = bootstrapConfig;
10
+ exports.tagBootstrapConfig = tagBootstrapConfig;
11
+ exports.faqBootstrapConfig = faqBootstrapConfig;
12
+ function tagSchema() {
13
+ return clone({
14
+ type: 'object',
15
+ required: ['label'],
16
+ additionalProperties: false,
17
+ properties: {
18
+ label: { type: 'string', default: '' },
19
+ slug: { type: 'string', default: '' },
20
+ },
21
+ });
22
+ }
23
+ function faqSchema() {
24
+ return clone({
25
+ type: 'object',
26
+ required: ['name'],
27
+ additionalProperties: false,
28
+ properties: {
29
+ name: { type: 'string', default: '' },
30
+ summary: { type: 'string', default: '' },
31
+ },
32
+ });
33
+ }
34
+ function questSchema() {
35
+ return clone({
36
+ type: 'object',
37
+ required: ['title'],
38
+ additionalProperties: false,
39
+ properties: {
40
+ title: { type: 'string', default: '' },
41
+ points: { type: 'integer', default: 0 },
42
+ published: { type: 'boolean', default: false },
43
+ },
44
+ });
45
+ }
46
+ function tagRows(count = 3) {
47
+ return Array.from({ length: count }, (_, i) => ({
48
+ tableId: 'Tag',
49
+ rowId: `tag-${i + 1}`,
50
+ data: { label: `Tag ${i + 1}`, slug: `tag-${i + 1}` },
51
+ }));
52
+ }
53
+ function faqRows() {
54
+ return [
55
+ {
56
+ tableId: 'FaqCategory',
57
+ rowId: 'billing',
58
+ data: { name: 'Billing', summary: 'Payments and invoices' },
59
+ },
60
+ {
61
+ tableId: 'FaqCategory',
62
+ rowId: 'general',
63
+ data: { name: 'General', summary: 'Anything else' },
64
+ },
65
+ ];
66
+ }
67
+ function questRows(count = 50) {
68
+ return Array.from({ length: count }, (_, i) => ({
69
+ tableId: 'Quest',
70
+ rowId: `quest-${String(i + 1).padStart(3, '0')}`,
71
+ data: {
72
+ title: `Quest ${i + 1}`,
73
+ points: (i + 1) * 10,
74
+ published: i % 2 === 0,
75
+ },
76
+ }));
77
+ }
78
+ function bootstrapConfig(partial = {}) {
79
+ return clone({
80
+ endpoints: ['REST_API', 'GRAPHQL'],
81
+ tables: [],
82
+ rows: [],
83
+ ...partial,
84
+ });
85
+ }
86
+ function tagBootstrapConfig(projectName) {
87
+ return bootstrapConfig({
88
+ projectName,
89
+ branchName: 'master',
90
+ endpoints: ['REST_API'],
91
+ tables: [{ id: 'Tag', schema: tagSchema() }],
92
+ rows: tagRows(3),
93
+ commitMessage: 'Bootstrap tag fixture',
94
+ });
95
+ }
96
+ function faqBootstrapConfig(projectName) {
97
+ return bootstrapConfig({
98
+ projectName,
99
+ branchName: 'master',
100
+ endpoints: ['REST_API', 'GRAPHQL'],
101
+ tables: [{ id: 'FaqCategory', schema: faqSchema() }],
102
+ rows: faqRows(),
103
+ commitMessage: 'Bootstrap faq fixture',
104
+ });
105
+ }
106
+ function clone(value) {
107
+ return JSON.parse(JSON.stringify(value));
108
+ }
109
+ //# sourceMappingURL=matrix-fixtures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matrix-fixtures.js","sourceRoot":"","sources":["../../../e2e/utils/matrix-fixtures.ts"],"names":[],"mappings":";;AA2BA,8BAUC;AAED,8BAUC;AAED,kCAWC;AAID,0B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,IAAI,EAAE,EAAE;QACR,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,kBAAkB,CAAC,WAAmB;IACpD,OAAO,eAAe,CAAC;QACrB,WAAW;QACX,UAAU,EAAE,QAAQ;QACpB,SAAS,EAAE,CAAC,UAAU,CAAC;QACvB,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,CAAC;QAC5C,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;QAChB,aAAa,EAAE,uBAAuB;KACvC,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,kBAAkB,CAAC,WAAmB;IACpD,OAAO,eAAe,CAAC;QACrB,WAAW;QACX,UAAU,EAAE,QAAQ;QACpB,SAAS,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC;QAClC,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,CAAC;QACpD,IAAI,EAAE,OAAO,EAAE;QACf,aAAa,EAAE,uBAAuB;KACvC,CAAC,CAAC;AACL,CAAC;AAID,SAAS,KAAK,CAAI,KAAQ;IACxB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAM,CAAC;AAChD,CAAC"}
@@ -0,0 +1,25 @@
1
+ export declare const CLEAR_REVISIUM_ENV: Record<string, string>;
2
+ export interface WorkspaceInstanceConfig {
3
+ baseUrl: string;
4
+ authMode?: 'none' | 'stored';
5
+ }
6
+ export interface WorkspaceContextConfig {
7
+ instance: string;
8
+ organization?: string;
9
+ project?: string;
10
+ branch?: string;
11
+ revision?: string;
12
+ credential?: string;
13
+ }
14
+ export interface WorkspaceConfigShape {
15
+ version?: number;
16
+ currentContext?: string;
17
+ instances?: Record<string, WorkspaceInstanceConfig>;
18
+ contexts?: Record<string, WorkspaceContextConfig>;
19
+ }
20
+ export declare function createWorkspace(prefix?: string): string;
21
+ export declare function writeWorkspaceConfig(workspace: string, config: WorkspaceConfigShape): string;
22
+ export declare function workspaceFile(workspace: string, ...segments: string[]): string;
23
+ export declare function uniqueCredentialStoreService(prefix?: string): string;
24
+ export declare function removeWorkspace(workspace: string): void;
25
+ export declare function writeBootstrapConfigFile(workspace: string, data: unknown, filename?: string): string;