revisium 2.3.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.
- package/.github/workflows/build.yml +11 -30
- package/.github/workflows/ci.yml +0 -6
- package/.github/workflows/npm-publish.yml +13 -78
- package/.github/workflows/release-train.yml +90 -0
- package/AGENTS.md +98 -0
- package/README.md +31 -13
- package/dist/e2e/utils/cli-runner.d.ts +2 -0
- package/dist/e2e/utils/cli-runner.js +14 -7
- package/dist/e2e/utils/cli-runner.js.map +1 -1
- package/dist/e2e/utils/matrix-fixtures.d.ts +26 -0
- package/dist/e2e/utils/matrix-fixtures.js +109 -0
- package/dist/e2e/utils/matrix-fixtures.js.map +1 -0
- package/dist/e2e/utils/matrix-workspace.d.ts +25 -0
- package/dist/e2e/utils/matrix-workspace.js +61 -0
- package/dist/e2e/utils/matrix-workspace.js.map +1 -0
- package/dist/e2e/utils/standalone-api.d.ts +53 -0
- package/dist/e2e/utils/standalone-api.js +146 -0
- package/dist/e2e/utils/standalone-api.js.map +1 -0
- package/dist/e2e/utils/standalone-runner.d.ts +23 -0
- package/dist/e2e/utils/standalone-runner.js +182 -0
- package/dist/e2e/utils/standalone-runner.js.map +1 -0
- package/dist/package.json +6 -3
- package/dist/src/app.module.js +51 -0
- package/dist/src/app.module.js.map +1 -1
- package/dist/src/commands/auth/auth-command.utils.d.ts +8 -0
- package/dist/src/commands/auth/auth-command.utils.js +28 -0
- package/dist/src/commands/auth/auth-command.utils.js.map +1 -0
- package/dist/src/commands/auth/auth-login.command.d.ts +29 -0
- package/dist/src/commands/auth/auth-login.command.js +155 -0
- package/dist/src/commands/auth/auth-login.command.js.map +1 -0
- package/dist/src/commands/auth/auth-logout.command.d.ts +19 -0
- package/dist/src/commands/auth/auth-logout.command.js +86 -0
- package/dist/src/commands/auth/auth-logout.command.js.map +1 -0
- package/dist/src/commands/auth/auth-status.command.d.ts +19 -0
- package/dist/src/commands/auth/auth-status.command.js +101 -0
- package/dist/src/commands/auth/auth-status.command.js.map +1 -0
- package/dist/src/commands/auth/auth.command.d.ts +5 -0
- package/dist/src/commands/auth/auth.command.js +35 -0
- package/dist/src/commands/auth/auth.command.js.map +1 -0
- package/dist/src/commands/base-sync.command.d.ts +2 -2
- package/dist/src/commands/base-sync.command.js +1 -2
- package/dist/src/commands/base-sync.command.js.map +1 -1
- package/dist/src/commands/base.command.d.ts +2 -0
- package/dist/src/commands/base.command.js +13 -0
- package/dist/src/commands/base.command.js.map +1 -1
- package/dist/src/commands/context/context-create.command.d.ts +28 -0
- package/dist/src/commands/context/context-create.command.js +172 -0
- package/dist/src/commands/context/context-create.command.js.map +1 -0
- package/dist/src/commands/context/context-list.command.d.ts +9 -0
- package/dist/src/commands/context/context-list.command.js +46 -0
- package/dist/src/commands/context/context-list.command.js.map +1 -0
- package/dist/src/commands/context/context-remove.command.d.ts +9 -0
- package/dist/src/commands/context/context-remove.command.js +48 -0
- package/dist/src/commands/context/context-remove.command.js.map +1 -0
- package/dist/src/commands/context/context-show.command.d.ts +9 -0
- package/dist/src/commands/context/context-show.command.js +64 -0
- package/dist/src/commands/context/context-show.command.js.map +1 -0
- package/dist/src/commands/context/context-use.command.d.ts +9 -0
- package/dist/src/commands/context/context-use.command.js +45 -0
- package/dist/src/commands/context/context-use.command.js.map +1 -0
- package/dist/src/commands/context/context.command.d.ts +5 -0
- package/dist/src/commands/context/context.command.js +43 -0
- package/dist/src/commands/context/context.command.js.map +1 -0
- package/dist/src/commands/endpoint/endpoint-ensure.command.d.ts +18 -0
- package/dist/src/commands/endpoint/endpoint-ensure.command.js +90 -0
- package/dist/src/commands/endpoint/endpoint-ensure.command.js.map +1 -0
- package/dist/src/commands/endpoint/endpoint-list.command.d.ts +14 -0
- package/dist/src/commands/endpoint/endpoint-list.command.js +62 -0
- package/dist/src/commands/endpoint/endpoint-list.command.js.map +1 -0
- package/dist/src/commands/endpoint/endpoint.command.d.ts +5 -0
- package/dist/src/commands/endpoint/endpoint.command.js +34 -0
- package/dist/src/commands/endpoint/endpoint.command.js.map +1 -0
- package/dist/src/commands/example/example-bootstrap.command.d.ts +24 -0
- package/dist/src/commands/example/example-bootstrap.command.js +133 -0
- package/dist/src/commands/example/example-bootstrap.command.js.map +1 -0
- package/dist/src/commands/example/example.command.d.ts +5 -0
- package/dist/src/commands/example/example.command.js +33 -0
- package/dist/src/commands/example/example.command.js.map +1 -0
- package/dist/src/commands/instance/instance-add.command.d.ts +16 -0
- package/dist/src/commands/instance/instance-add.command.js +83 -0
- package/dist/src/commands/instance/instance-add.command.js.map +1 -0
- package/dist/src/commands/instance/instance-list.command.d.ts +9 -0
- package/dist/src/commands/instance/instance-list.command.js +45 -0
- package/dist/src/commands/instance/instance-list.command.js.map +1 -0
- package/dist/src/commands/instance/instance-remove.command.d.ts +9 -0
- package/dist/src/commands/instance/instance-remove.command.js +54 -0
- package/dist/src/commands/instance/instance-remove.command.js.map +1 -0
- package/dist/src/commands/instance/instance-show.command.d.ts +9 -0
- package/dist/src/commands/instance/instance-show.command.js +50 -0
- package/dist/src/commands/instance/instance-show.command.js.map +1 -0
- package/dist/src/commands/instance/instance.command.d.ts +5 -0
- package/dist/src/commands/instance/instance.command.js +41 -0
- package/dist/src/commands/instance/instance.command.js.map +1 -0
- package/dist/src/commands/migration/apply-migrations.command.js +1 -0
- package/dist/src/commands/migration/apply-migrations.command.js.map +1 -1
- package/dist/src/commands/project/project-ensure.command.d.ts +16 -0
- package/dist/src/commands/project/project-ensure.command.js +71 -0
- package/dist/src/commands/project/project-ensure.command.js.map +1 -0
- package/dist/src/commands/project/project.command.d.ts +5 -0
- package/dist/src/commands/project/project.command.js +33 -0
- package/dist/src/commands/project/project.command.js.map +1 -0
- package/dist/src/services/bootstrap/bootstrap.service.d.ts +112 -0
- package/dist/src/services/bootstrap/bootstrap.service.js +438 -0
- package/dist/src/services/bootstrap/bootstrap.service.js.map +1 -0
- package/dist/src/services/bootstrap/index.d.ts +1 -0
- package/dist/src/services/bootstrap/index.js +6 -0
- package/dist/src/services/bootstrap/index.js.map +1 -0
- package/dist/src/services/connection/api-client.d.ts +4 -0
- package/dist/src/services/connection/api-client.js +67 -5
- package/dist/src/services/connection/api-client.js.map +1 -1
- package/dist/src/services/connection/connection-factory.service.js +4 -3
- package/dist/src/services/connection/connection-factory.service.js.map +1 -1
- package/dist/src/services/connection/connection.service.d.ts +10 -2
- package/dist/src/services/connection/connection.service.js +49 -4
- package/dist/src/services/connection/connection.service.js.map +1 -1
- package/dist/src/services/credentials/credential-store.service.d.ts +19 -0
- package/dist/src/services/credentials/credential-store.service.js +112 -0
- package/dist/src/services/credentials/credential-store.service.js.map +1 -0
- package/dist/src/services/credentials/credential-target.service.d.ts +22 -0
- package/dist/src/services/credentials/credential-target.service.js +107 -0
- package/dist/src/services/credentials/credential-target.service.js.map +1 -0
- package/dist/src/services/credentials/index.d.ts +2 -0
- package/dist/src/services/credentials/index.js +8 -0
- package/dist/src/services/credentials/index.js.map +1 -0
- package/dist/src/services/index.d.ts +3 -0
- package/dist/src/services/index.js +3 -0
- package/dist/src/services/index.js.map +1 -1
- package/dist/src/services/url/auth-prompt.service.d.ts +3 -1
- package/dist/src/services/url/auth-prompt.service.js +3 -0
- package/dist/src/services/url/auth-prompt.service.js.map +1 -1
- package/dist/src/services/url/url-builder.service.js +3 -0
- package/dist/src/services/url/url-builder.service.js.map +1 -1
- package/dist/src/services/url/url-parser.service.d.ts +1 -1
- package/dist/src/services/url/url-parser.service.js +12 -6
- package/dist/src/services/url/url-parser.service.js.map +1 -1
- package/dist/src/services/workspace/index.d.ts +1 -0
- package/dist/src/services/workspace/index.js +11 -0
- package/dist/src/services/workspace/index.js.map +1 -0
- package/dist/src/services/workspace/workspace-config.service.d.ts +66 -0
- package/dist/src/services/workspace/workspace-config.service.js +313 -0
- package/dist/src/services/workspace/workspace-config.service.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/docs/authentication.md +69 -26
- package/docs/bootstrap-commands.md +105 -0
- package/docs/configuration.md +49 -22
- package/docs/url-format.md +27 -2
- package/docs/workspace-config.md +135 -0
- package/e2e/jest-matrix.json +14 -0
- package/e2e/matrix/M01-auth-commands.e2e-spec.ts +241 -0
- package/e2e/matrix/M02-instance-commands.e2e-spec.ts +213 -0
- package/e2e/matrix/M03-context-commands.e2e-spec.ts +279 -0
- package/e2e/matrix/M04-project-ensure.e2e-spec.ts +218 -0
- package/e2e/matrix/M05-endpoint-commands.e2e-spec.ts +172 -0
- package/e2e/matrix/M06-example-bootstrap.e2e-spec.ts +437 -0
- package/e2e/matrix/M07-migrate.e2e-spec.ts +229 -0
- package/e2e/matrix/M08-schema.e2e-spec.ts +163 -0
- package/e2e/matrix/M09-rows.e2e-spec.ts +185 -0
- package/e2e/matrix/M10-sync.e2e-spec.ts +224 -0
- package/e2e/matrix/M11-target-resolution.e2e-spec.ts +177 -0
- package/e2e/matrix/M12-error-paths.e2e-spec.ts +162 -0
- package/e2e/matrix/M13-no-auth-mode.e2e-spec.ts +119 -0
- package/e2e/matrix/M14-multi-instance-workspace.e2e-spec.ts +182 -0
- package/e2e/matrix/README.md +354 -0
- package/e2e/tests/01-auth.e2e-spec.ts +19 -0
- package/e2e/tests/07-workspace-config.e2e-spec.ts +492 -0
- package/e2e/tests/08-bootstrap.e2e-spec.ts +304 -0
- package/e2e/utils/cli-runner.ts +27 -8
- package/e2e/utils/matrix-fixtures.ts +141 -0
- package/e2e/utils/matrix-workspace.ts +106 -0
- package/e2e/utils/standalone-api.ts +314 -0
- package/e2e/utils/standalone-runner.ts +276 -0
- package/package.json +6 -3
- package/src/app.module.ts +54 -0
- package/src/commands/auth/__tests__/auth-command.utils.spec.ts +41 -0
- package/src/commands/auth/__tests__/auth-login.command.spec.ts +131 -0
- package/src/commands/auth/__tests__/auth-logout.command.spec.ts +85 -0
- package/src/commands/auth/__tests__/auth-status.command.spec.ts +106 -0
- package/src/commands/auth/__tests__/auth.command.spec.ts +18 -0
- package/src/commands/auth/auth-command.utils.ts +36 -0
- package/src/commands/auth/auth-login.command.ts +146 -0
- package/src/commands/auth/auth-logout.command.ts +71 -0
- package/src/commands/auth/auth-status.command.ts +89 -0
- package/src/commands/auth/auth.command.ts +20 -0
- package/src/commands/base-sync.command.ts +2 -3
- package/src/commands/base.command.ts +11 -0
- package/src/commands/context/context-create.command.ts +173 -0
- package/src/commands/context/context-list.command.ts +36 -0
- package/src/commands/context/context-remove.command.ts +35 -0
- package/src/commands/context/context-show.command.ts +59 -0
- package/src/commands/context/context-use.command.ts +31 -0
- package/src/commands/context/context.command.ts +28 -0
- package/src/commands/endpoint/__tests__/endpoint-ensure.command.spec.ts +129 -0
- package/src/commands/endpoint/__tests__/endpoint-list.command.spec.ts +59 -0
- package/src/commands/endpoint/__tests__/endpoint.command.spec.ts +14 -0
- package/src/commands/endpoint/endpoint-ensure.command.ts +74 -0
- package/src/commands/endpoint/endpoint-list.command.ts +48 -0
- package/src/commands/endpoint/endpoint.command.ts +19 -0
- package/src/commands/example/__tests__/example-bootstrap.command.spec.ts +145 -0
- package/src/commands/example/__tests__/example.command.spec.ts +14 -0
- package/src/commands/example/example-bootstrap.command.ts +122 -0
- package/src/commands/example/example.command.ts +18 -0
- package/src/commands/instance/instance-add.command.ts +72 -0
- package/src/commands/instance/instance-list.command.ts +31 -0
- package/src/commands/instance/instance-remove.command.ts +44 -0
- package/src/commands/instance/instance-show.command.ts +35 -0
- package/src/commands/instance/instance.command.ts +26 -0
- package/src/commands/migration/apply-migrations.command.ts +1 -0
- package/src/commands/project/__tests__/project-ensure.command.spec.ts +119 -0
- package/src/commands/project/__tests__/project.command.spec.ts +14 -0
- package/src/commands/project/project-ensure.command.ts +61 -0
- package/src/commands/project/project.command.ts +18 -0
- package/src/services/bootstrap/__tests__/bootstrap.service.spec.ts +798 -0
- package/src/services/bootstrap/bootstrap.service.ts +698 -0
- package/src/services/bootstrap/index.ts +12 -0
- package/src/services/connection/__tests__/api-client.spec.ts +262 -0
- package/src/services/connection/__tests__/connection-factory.service.spec.ts +2 -0
- package/src/services/connection/__tests__/connection.service.spec.ts +161 -0
- package/src/services/connection/api-client.ts +88 -5
- package/src/services/connection/connection-factory.service.ts +4 -3
- package/src/services/connection/connection.service.ts +74 -3
- package/src/services/credentials/__tests__/credential-store.service.spec.ts +128 -0
- package/src/services/credentials/__tests__/credential-target.service.spec.ts +126 -0
- package/src/services/credentials/credential-store.service.ts +145 -0
- package/src/services/credentials/credential-target.service.ts +145 -0
- package/src/services/credentials/index.ts +9 -0
- package/src/services/index.ts +3 -0
- package/src/services/url/__tests__/url-builder.service.spec.ts +17 -0
- package/src/services/url/__tests__/url-parser.service.spec.ts +162 -0
- package/src/services/url/auth-prompt.service.ts +6 -1
- package/src/services/url/url-builder.service.ts +4 -0
- package/src/services/url/url-parser.service.ts +21 -6
- package/src/services/workspace/__tests__/workspace-config.service.spec.ts +378 -0
- package/src/services/workspace/index.ts +14 -0
- package/src/services/workspace/workspace-config.service.ts +467 -0
- package/.github/workflows/bump-version.yml +0 -86
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/services/workspace/index.ts"],"names":[],"mappings":";;;AAAA,uEAaoC;AAZlC,0HAAA,cAAc,OAAA;AACd,8HAAA,kBAAkB,OAAA;AAClB,4HAAA,gBAAgB,OAAA;AAGhB,gIAAA,oBAAoB,OAAA;AACpB,iIAAA,qBAAqB,OAAA;AAGrB,kIAAA,sBAAsB,OAAA"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { RevisiumUrlComplete, UrlEnvConfig } from 'src/services/url';
|
|
2
|
+
import { CredentialStoreService } from 'src/services/credentials/credential-store.service';
|
|
3
|
+
import { UrlParserService } from 'src/services/url/url-parser.service';
|
|
4
|
+
export declare const WORKSPACE_CONFIG_DIR = ".revisium";
|
|
5
|
+
export declare const WORKSPACE_CONFIG_FILE = "revisium-cli.config.json";
|
|
6
|
+
export declare const DEFAULT_BRANCH = "master";
|
|
7
|
+
export declare const DEFAULT_REVISION = "draft";
|
|
8
|
+
export declare const DEFAULT_CREDENTIAL = "default";
|
|
9
|
+
export type WorkspaceAuthMode = 'none' | 'stored';
|
|
10
|
+
export interface WorkspaceInstanceConfig {
|
|
11
|
+
baseUrl: string;
|
|
12
|
+
authMode?: WorkspaceAuthMode;
|
|
13
|
+
}
|
|
14
|
+
export interface WorkspaceContextConfig {
|
|
15
|
+
instance: string;
|
|
16
|
+
credential?: string;
|
|
17
|
+
organization: string;
|
|
18
|
+
project: string;
|
|
19
|
+
branch?: string;
|
|
20
|
+
revision?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface WorkspaceConfig {
|
|
23
|
+
version: 1;
|
|
24
|
+
currentContext?: string;
|
|
25
|
+
instances: Record<string, WorkspaceInstanceConfig>;
|
|
26
|
+
contexts: Record<string, WorkspaceContextConfig>;
|
|
27
|
+
}
|
|
28
|
+
export interface LoadedWorkspaceConfig {
|
|
29
|
+
path: string;
|
|
30
|
+
config: WorkspaceConfig;
|
|
31
|
+
}
|
|
32
|
+
export interface LoadedWorkspaceContext {
|
|
33
|
+
loaded: LoadedWorkspaceConfig;
|
|
34
|
+
context: WorkspaceContextConfig;
|
|
35
|
+
}
|
|
36
|
+
export declare class WorkspaceConfigService {
|
|
37
|
+
private readonly urlParser;
|
|
38
|
+
private readonly credentialStore?;
|
|
39
|
+
constructor(urlParser: UrlParserService, credentialStore?: CredentialStoreService | undefined);
|
|
40
|
+
load(startDir?: string): Promise<LoadedWorkspaceConfig | undefined>;
|
|
41
|
+
loadOrCreate(startDir?: string): Promise<LoadedWorkspaceConfig>;
|
|
42
|
+
save(path: string, config: WorkspaceConfig): Promise<void>;
|
|
43
|
+
loadContext(name: string, startDir?: string): Promise<LoadedWorkspaceContext>;
|
|
44
|
+
findConfigPath(startDir?: string): Promise<string | undefined>;
|
|
45
|
+
getDefaultConfigPath(startDir?: string): string;
|
|
46
|
+
createEmptyConfig(): WorkspaceConfig;
|
|
47
|
+
normalizeBaseUrl(input: string): string;
|
|
48
|
+
parseContextUrl(input: string): {
|
|
49
|
+
baseUrl: string;
|
|
50
|
+
organization: string;
|
|
51
|
+
project: string;
|
|
52
|
+
branch: string;
|
|
53
|
+
revision: string;
|
|
54
|
+
};
|
|
55
|
+
findInstanceNameByBaseUrl(config: WorkspaceConfig, baseUrl: string): string | undefined;
|
|
56
|
+
resolveConnection(loaded: LoadedWorkspaceConfig, contextName: string | undefined, env: UrlEnvConfig): RevisiumUrlComplete;
|
|
57
|
+
private resolveAuth;
|
|
58
|
+
private resolveSavedCredential;
|
|
59
|
+
private resolveEnvAuth;
|
|
60
|
+
private normalizeConfig;
|
|
61
|
+
private normalizeRecord;
|
|
62
|
+
private isObject;
|
|
63
|
+
private stripTrailingSlashes;
|
|
64
|
+
private normalizeHttpBaseUrl;
|
|
65
|
+
private exists;
|
|
66
|
+
}
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.WorkspaceConfigService = exports.DEFAULT_CREDENTIAL = exports.DEFAULT_REVISION = exports.DEFAULT_BRANCH = exports.WORKSPACE_CONFIG_FILE = exports.WORKSPACE_CONFIG_DIR = void 0;
|
|
16
|
+
const promises_1 = require("node:fs/promises");
|
|
17
|
+
const node_path_1 = require("node:path");
|
|
18
|
+
const common_1 = require("@nestjs/common");
|
|
19
|
+
const credential_store_service_1 = require("../credentials/credential-store.service");
|
|
20
|
+
const url_parser_service_1 = require("../url/url-parser.service");
|
|
21
|
+
exports.WORKSPACE_CONFIG_DIR = '.revisium';
|
|
22
|
+
exports.WORKSPACE_CONFIG_FILE = 'revisium-cli.config.json';
|
|
23
|
+
exports.DEFAULT_BRANCH = 'master';
|
|
24
|
+
exports.DEFAULT_REVISION = 'draft';
|
|
25
|
+
exports.DEFAULT_CREDENTIAL = 'default';
|
|
26
|
+
let WorkspaceConfigService = class WorkspaceConfigService {
|
|
27
|
+
urlParser;
|
|
28
|
+
credentialStore;
|
|
29
|
+
constructor(urlParser, credentialStore) {
|
|
30
|
+
this.urlParser = urlParser;
|
|
31
|
+
this.credentialStore = credentialStore;
|
|
32
|
+
}
|
|
33
|
+
async load(startDir = process.cwd()) {
|
|
34
|
+
const configPath = await this.findConfigPath(startDir);
|
|
35
|
+
if (!configPath) {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
const raw = await (0, promises_1.readFile)(configPath, 'utf-8');
|
|
39
|
+
const parsed = JSON.parse(raw);
|
|
40
|
+
return {
|
|
41
|
+
path: configPath,
|
|
42
|
+
config: this.normalizeConfig(parsed, configPath),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
async loadOrCreate(startDir = process.cwd()) {
|
|
46
|
+
const loaded = await this.load(startDir);
|
|
47
|
+
if (loaded) {
|
|
48
|
+
return loaded;
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
path: this.getDefaultConfigPath(startDir),
|
|
52
|
+
config: this.createEmptyConfig(),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
async save(path, config) {
|
|
56
|
+
await (0, promises_1.mkdir)((0, node_path_1.dirname)(path), { recursive: true });
|
|
57
|
+
await (0, promises_1.writeFile)(path, `${JSON.stringify(config, null, 2)}\n`, 'utf-8');
|
|
58
|
+
}
|
|
59
|
+
async loadContext(name, startDir = process.cwd()) {
|
|
60
|
+
const loaded = await this.load(startDir);
|
|
61
|
+
if (!loaded || !Object.hasOwn(loaded.config.contexts, name)) {
|
|
62
|
+
throw new Error(`Revisium context "${name}" was not found`);
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
loaded,
|
|
66
|
+
context: loaded.config.contexts[name],
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
async findConfigPath(startDir = process.cwd()) {
|
|
70
|
+
let currentDir = (0, node_path_1.resolve)(startDir);
|
|
71
|
+
const root = (0, node_path_1.parse)(currentDir).root;
|
|
72
|
+
while (true) {
|
|
73
|
+
const candidate = this.getDefaultConfigPath(currentDir);
|
|
74
|
+
if (await this.exists(candidate)) {
|
|
75
|
+
return candidate;
|
|
76
|
+
}
|
|
77
|
+
if (currentDir === root) {
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
currentDir = (0, node_path_1.dirname)(currentDir);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
getDefaultConfigPath(startDir = process.cwd()) {
|
|
84
|
+
return (0, node_path_1.join)((0, node_path_1.resolve)(startDir), exports.WORKSPACE_CONFIG_DIR, exports.WORKSPACE_CONFIG_FILE);
|
|
85
|
+
}
|
|
86
|
+
createEmptyConfig() {
|
|
87
|
+
return {
|
|
88
|
+
version: 1,
|
|
89
|
+
instances: {},
|
|
90
|
+
contexts: {},
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
normalizeBaseUrl(input) {
|
|
94
|
+
const trimmed = input.trim();
|
|
95
|
+
if (!trimmed) {
|
|
96
|
+
throw new Error('Instance URL cannot be empty');
|
|
97
|
+
}
|
|
98
|
+
if (trimmed.startsWith('http://') || trimmed.startsWith('https://')) {
|
|
99
|
+
return this.normalizeHttpBaseUrl(trimmed, input);
|
|
100
|
+
}
|
|
101
|
+
const parsed = this.urlParser.parse(trimmed);
|
|
102
|
+
if (!parsed.baseUrl) {
|
|
103
|
+
throw new Error(`Could not parse instance URL "${input}". Use revisium://host[:port]`);
|
|
104
|
+
}
|
|
105
|
+
return this.stripTrailingSlashes(parsed.baseUrl);
|
|
106
|
+
}
|
|
107
|
+
parseContextUrl(input) {
|
|
108
|
+
const parsed = this.urlParser.parse(input);
|
|
109
|
+
if (!parsed.baseUrl || !parsed.organization || !parsed.project) {
|
|
110
|
+
throw new Error('Context URL must include host, organization, and project: revisium://host/org/project/branch[:revision]');
|
|
111
|
+
}
|
|
112
|
+
return {
|
|
113
|
+
baseUrl: this.stripTrailingSlashes(parsed.baseUrl),
|
|
114
|
+
organization: parsed.organization,
|
|
115
|
+
project: parsed.project,
|
|
116
|
+
branch: parsed.branch || exports.DEFAULT_BRANCH,
|
|
117
|
+
revision: parsed.revision || exports.DEFAULT_REVISION,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
findInstanceNameByBaseUrl(config, baseUrl) {
|
|
121
|
+
const matches = Object.entries(config.instances)
|
|
122
|
+
.filter(([, instance]) => instance.baseUrl === baseUrl)
|
|
123
|
+
.map(([name]) => name);
|
|
124
|
+
if (matches.length > 1) {
|
|
125
|
+
throw new Error(`Multiple instances use ${baseUrl}. Pass --instance to choose one.`);
|
|
126
|
+
}
|
|
127
|
+
return matches[0];
|
|
128
|
+
}
|
|
129
|
+
resolveConnection(loaded, contextName, env) {
|
|
130
|
+
const selectedContext = contextName || loaded.config.currentContext;
|
|
131
|
+
if (!selectedContext) {
|
|
132
|
+
throw new Error(`No current Revisium context is configured in ${loaded.path}. Run: revisium context use <name>`);
|
|
133
|
+
}
|
|
134
|
+
const context = loaded.config.contexts[selectedContext];
|
|
135
|
+
if (!context) {
|
|
136
|
+
throw new Error(`Revisium context "${selectedContext}" was not found in ${loaded.path}`);
|
|
137
|
+
}
|
|
138
|
+
const instance = loaded.config.instances[context.instance];
|
|
139
|
+
if (!instance) {
|
|
140
|
+
throw new Error(`Revisium instance "${context.instance}" for context "${selectedContext}" was not found in ${loaded.path}`);
|
|
141
|
+
}
|
|
142
|
+
return {
|
|
143
|
+
baseUrl: instance.baseUrl,
|
|
144
|
+
auth: this.resolveAuth(instance, context, selectedContext, env),
|
|
145
|
+
organization: context.organization,
|
|
146
|
+
project: context.project,
|
|
147
|
+
branch: context.branch || exports.DEFAULT_BRANCH,
|
|
148
|
+
revision: context.revision || exports.DEFAULT_REVISION,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
resolveAuth(instance, context, contextName, env) {
|
|
152
|
+
const envAuth = this.resolveEnvAuth(env);
|
|
153
|
+
if (envAuth) {
|
|
154
|
+
return envAuth;
|
|
155
|
+
}
|
|
156
|
+
if ((instance.authMode || 'stored') === 'none') {
|
|
157
|
+
return { method: 'none' };
|
|
158
|
+
}
|
|
159
|
+
const credential = context.credential || exports.DEFAULT_CREDENTIAL;
|
|
160
|
+
const credentialRef = {
|
|
161
|
+
baseUrl: instance.baseUrl,
|
|
162
|
+
credential,
|
|
163
|
+
};
|
|
164
|
+
const savedCredential = this.resolveSavedCredential(credentialRef, contextName, context.instance);
|
|
165
|
+
if (savedCredential) {
|
|
166
|
+
return savedCredential;
|
|
167
|
+
}
|
|
168
|
+
throw new Error(`No credentials found for context "${contextName}" credential "${credential}". ` +
|
|
169
|
+
`Run: revisium auth login --instance ${context.instance} --credential ${credential} --api-key. ` +
|
|
170
|
+
'Or set REVISIUM_API_KEY=... / REVISIUM_TOKEN=..., or configure the instance with authMode "none" for local standalone.');
|
|
171
|
+
}
|
|
172
|
+
resolveSavedCredential(ref, contextName, instanceName) {
|
|
173
|
+
try {
|
|
174
|
+
return this.credentialStore?.getCredential(ref);
|
|
175
|
+
}
|
|
176
|
+
catch (error) {
|
|
177
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
178
|
+
if (message.startsWith('Could not read Revisium credential')) {
|
|
179
|
+
throw new Error(`No credentials found for context "${contextName}" credential "${ref.credential}". ` +
|
|
180
|
+
`Could not read the OS credential store: ${message}. ` +
|
|
181
|
+
`Run: revisium auth login --instance ${instanceName} --credential ${ref.credential} --api-key. ` +
|
|
182
|
+
'Or set REVISIUM_API_KEY=... / REVISIUM_TOKEN=... for this run.');
|
|
183
|
+
}
|
|
184
|
+
throw error;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
resolveEnvAuth(env) {
|
|
188
|
+
const methods = [];
|
|
189
|
+
if (env.token) {
|
|
190
|
+
methods.push('token');
|
|
191
|
+
}
|
|
192
|
+
if (env.apikey) {
|
|
193
|
+
methods.push('apikey');
|
|
194
|
+
}
|
|
195
|
+
if (env.username || env.password) {
|
|
196
|
+
if (!env.username || !env.password) {
|
|
197
|
+
throw new Error('Both REVISIUM_USERNAME and REVISIUM_PASSWORD are required for password authentication');
|
|
198
|
+
}
|
|
199
|
+
methods.push('credentials');
|
|
200
|
+
}
|
|
201
|
+
if (methods.length > 1) {
|
|
202
|
+
throw new Error(`Multiple authentication methods specified: ${methods.join(', ')}. ` +
|
|
203
|
+
'Use only one: token, apikey, or username/password');
|
|
204
|
+
}
|
|
205
|
+
if (env.token) {
|
|
206
|
+
return { method: 'token', token: env.token };
|
|
207
|
+
}
|
|
208
|
+
if (env.apikey) {
|
|
209
|
+
return { method: 'apikey', apikey: env.apikey };
|
|
210
|
+
}
|
|
211
|
+
if (env.username && env.password) {
|
|
212
|
+
return {
|
|
213
|
+
method: 'password',
|
|
214
|
+
username: env.username,
|
|
215
|
+
password: env.password,
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
return undefined;
|
|
219
|
+
}
|
|
220
|
+
normalizeConfig(value, path) {
|
|
221
|
+
if (!this.isObject(value)) {
|
|
222
|
+
throw new TypeError(`Invalid Revisium CLI config at ${path}: expected object`);
|
|
223
|
+
}
|
|
224
|
+
const version = value.version;
|
|
225
|
+
if (version !== 1) {
|
|
226
|
+
throw new Error(`Invalid Revisium CLI config at ${path}: unsupported version ${String(version)}`);
|
|
227
|
+
}
|
|
228
|
+
const instances = this.normalizeRecord(value.instances, 'instances', path);
|
|
229
|
+
const contexts = this.normalizeRecord(value.contexts, 'contexts', path);
|
|
230
|
+
for (const [name, instance] of Object.entries(instances)) {
|
|
231
|
+
if (!this.isObject(instance) || typeof instance.baseUrl !== 'string') {
|
|
232
|
+
throw new TypeError(`Invalid Revisium CLI config at ${path}: instance "${name}" must include baseUrl`);
|
|
233
|
+
}
|
|
234
|
+
instance.baseUrl = this.normalizeBaseUrl(instance.baseUrl);
|
|
235
|
+
if (instance.authMode !== undefined &&
|
|
236
|
+
instance.authMode !== 'none' &&
|
|
237
|
+
instance.authMode !== 'stored') {
|
|
238
|
+
throw new Error(`Invalid Revisium CLI config at ${path}: instance "${name}" has unsupported authMode`);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
for (const [name, context] of Object.entries(contexts)) {
|
|
242
|
+
if (!this.isObject(context) ||
|
|
243
|
+
typeof context.instance !== 'string' ||
|
|
244
|
+
typeof context.organization !== 'string' ||
|
|
245
|
+
typeof context.project !== 'string') {
|
|
246
|
+
throw new TypeError(`Invalid Revisium CLI config at ${path}: context "${name}" must include instance, organization, and project`);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
return {
|
|
250
|
+
version: 1,
|
|
251
|
+
currentContext: typeof value.currentContext === 'string'
|
|
252
|
+
? value.currentContext
|
|
253
|
+
: undefined,
|
|
254
|
+
instances,
|
|
255
|
+
contexts,
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
normalizeRecord(value, key, path) {
|
|
259
|
+
if (value === undefined) {
|
|
260
|
+
return {};
|
|
261
|
+
}
|
|
262
|
+
if (!this.isObject(value)) {
|
|
263
|
+
throw new TypeError(`Invalid Revisium CLI config at ${path}: ${key} must be an object`);
|
|
264
|
+
}
|
|
265
|
+
return value;
|
|
266
|
+
}
|
|
267
|
+
isObject(value) {
|
|
268
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
269
|
+
}
|
|
270
|
+
stripTrailingSlashes(value) {
|
|
271
|
+
let endIndex = value.length;
|
|
272
|
+
while (endIndex > 0 && value[endIndex - 1] === '/') {
|
|
273
|
+
endIndex--;
|
|
274
|
+
}
|
|
275
|
+
return value.slice(0, endIndex);
|
|
276
|
+
}
|
|
277
|
+
normalizeHttpBaseUrl(value, originalInput) {
|
|
278
|
+
let parsed;
|
|
279
|
+
try {
|
|
280
|
+
parsed = new URL(value);
|
|
281
|
+
}
|
|
282
|
+
catch {
|
|
283
|
+
throw new Error(`Could not parse instance URL "${originalInput}". Use http(s)://host[:port]`);
|
|
284
|
+
}
|
|
285
|
+
const hasPath = parsed.pathname !== '' && parsed.pathname !== '/';
|
|
286
|
+
if (!parsed.hostname ||
|
|
287
|
+
parsed.username ||
|
|
288
|
+
parsed.password ||
|
|
289
|
+
hasPath ||
|
|
290
|
+
parsed.search ||
|
|
291
|
+
parsed.hash) {
|
|
292
|
+
throw new Error(`Could not parse instance URL "${originalInput}". Use http(s)://host[:port]`);
|
|
293
|
+
}
|
|
294
|
+
return `${parsed.protocol}//${parsed.host}`;
|
|
295
|
+
}
|
|
296
|
+
async exists(path) {
|
|
297
|
+
try {
|
|
298
|
+
await (0, promises_1.access)(path);
|
|
299
|
+
return true;
|
|
300
|
+
}
|
|
301
|
+
catch {
|
|
302
|
+
return false;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
exports.WorkspaceConfigService = WorkspaceConfigService;
|
|
307
|
+
exports.WorkspaceConfigService = WorkspaceConfigService = __decorate([
|
|
308
|
+
(0, common_1.Injectable)(),
|
|
309
|
+
__param(1, (0, common_1.Optional)()),
|
|
310
|
+
__metadata("design:paramtypes", [url_parser_service_1.UrlParserService,
|
|
311
|
+
credential_store_service_1.CredentialStoreService])
|
|
312
|
+
], WorkspaceConfigService);
|
|
313
|
+
//# sourceMappingURL=workspace-config.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-config.service.js","sourceRoot":"","sources":["../../../../src/services/workspace/workspace-config.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAsE;AACtE,yCAA0D;AAC1D,2CAAsD;AAMtD,sFAA2F;AAC3F,kEAAuE;AAE1D,QAAA,oBAAoB,GAAG,WAAW,CAAC;AACnC,QAAA,qBAAqB,GAAG,0BAA0B,CAAC;AACnD,QAAA,cAAc,GAAG,QAAQ,CAAC;AAC1B,QAAA,gBAAgB,GAAG,OAAO,CAAC;AAC3B,QAAA,kBAAkB,GAAG,SAAS,CAAC;AAoCrC,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAEd;IACY;IAF/B,YACmB,SAA2B,EACf,eAAwC;QADpD,cAAS,GAAT,SAAS,CAAkB;QACf,oBAAe,GAAf,eAAe,CAAyB;IACpE,CAAC;IAEJ,KAAK,CAAC,IAAI,CACR,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE;QAExB,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QACvD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,MAAM,GAAG,GAAG,MAAM,IAAA,mBAAQ,EAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAChD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAY,CAAC;QAE1C,OAAO;YACL,IAAI,EAAE,UAAU;YAChB,MAAM,EAAE,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,UAAU,CAAC;SACjD,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE;QACzC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC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