feat(client): add rich domain classes, helpers, and refactor GitLabClient internals

This commit is contained in:
2026-03-02 13:10:54 +00:00
parent 4d90bb01cf
commit 7ba0fc984e
13 changed files with 1587 additions and 392 deletions

View File

@@ -0,0 +1,50 @@
import type { IGitLabVariable, IGitLabPipelineVariable } from './gitlab.interfaces.js';
export class GitLabVariable {
public readonly key: string;
public readonly value: string;
public readonly variableType: string;
public readonly protected: boolean;
public readonly masked: boolean;
public readonly environmentScope: string;
constructor(raw: IGitLabVariable) {
this.key = raw.key || '';
this.value = raw.value || '';
this.variableType = raw.variable_type || 'env_var';
this.protected = raw.protected ?? false;
this.masked = raw.masked ?? false;
this.environmentScope = raw.environment_scope || '*';
}
toJSON(): IGitLabVariable {
return {
key: this.key,
value: this.value,
variable_type: this.variableType,
protected: this.protected,
masked: this.masked,
environment_scope: this.environmentScope,
};
}
}
export class GitLabPipelineVariable {
public readonly key: string;
public readonly value: string;
public readonly variableType: string;
constructor(raw: IGitLabPipelineVariable) {
this.key = raw.key || '';
this.value = raw.value || '';
this.variableType = raw.variable_type || 'env_var';
}
toJSON(): IGitLabPipelineVariable {
return {
key: this.key,
value: this.value,
variable_type: this.variableType,
};
}
}