n8n
Version:
n8n Workflow Automation Tool
71 lines • 3.57 kB
JavaScript
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.SourceControlPreferences = void 0;
const class_validator_1 = require("class-validator");
class SourceControlPreferences {
constructor(preferences = undefined) {
this.branchName = 'main';
if (preferences)
Object.assign(this, preferences);
}
static fromJSON(json) {
return new SourceControlPreferences(json);
}
static merge(preferences, defaultPreferences) {
var _a, _b, _c, _d, _e, _f;
return new SourceControlPreferences({
connected: (_a = preferences.connected) !== null && _a !== void 0 ? _a : defaultPreferences.connected,
repositoryUrl: (_b = preferences.repositoryUrl) !== null && _b !== void 0 ? _b : defaultPreferences.repositoryUrl,
branchName: (_c = preferences.branchName) !== null && _c !== void 0 ? _c : defaultPreferences.branchName,
branchReadOnly: (_d = preferences.branchReadOnly) !== null && _d !== void 0 ? _d : defaultPreferences.branchReadOnly,
branchColor: (_e = preferences.branchColor) !== null && _e !== void 0 ? _e : defaultPreferences.branchColor,
keyGeneratorType: (_f = preferences.keyGeneratorType) !== null && _f !== void 0 ? _f : defaultPreferences.keyGeneratorType,
});
}
}
exports.SourceControlPreferences = SourceControlPreferences;
__decorate([
(0, class_validator_1.IsBoolean)(),
__metadata("design:type", Boolean)
], SourceControlPreferences.prototype, "connected", void 0);
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], SourceControlPreferences.prototype, "repositoryUrl", void 0);
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", Object)
], SourceControlPreferences.prototype, "branchName", void 0);
__decorate([
(0, class_validator_1.IsBoolean)(),
__metadata("design:type", Boolean)
], SourceControlPreferences.prototype, "branchReadOnly", void 0);
__decorate([
(0, class_validator_1.IsHexColor)(),
__metadata("design:type", String)
], SourceControlPreferences.prototype, "branchColor", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], SourceControlPreferences.prototype, "publicKey", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsBoolean)(),
__metadata("design:type", Boolean)
], SourceControlPreferences.prototype, "initRepo", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], SourceControlPreferences.prototype, "keyGeneratorType", void 0);
//# sourceMappingURL=sourceControlPreferences.js.map
;