@sync-in/server
Version:
The secure, open-source platform for file storage, sharing, collaboration, and sync
130 lines (129 loc) • 5.42 kB
JavaScript
/*
* Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>
* This file is part of Sync-in | The open source file sync and share solution
* See the LICENSE file for licensing details
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: Object.getOwnPropertyDescriptor(all, name).get
});
}
_export(exports, {
get SyncPathDto () {
return SyncPathDto;
},
get SyncPathUpdateDto () {
return SyncPathUpdateDto;
}
});
const _classtransformer = require("class-transformer");
const _classvalidator = require("class-validator");
const _sync = require("../constants/sync");
function _ts_decorate(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;
}
function _ts_metadata(k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
}
let SyncPathSchedulerDto = class SyncPathSchedulerDto {
};
_ts_decorate([
(0, _classvalidator.IsInt)(),
_ts_metadata("design:type", Number)
], SyncPathSchedulerDto.prototype, "value", void 0);
_ts_decorate([
(0, _classvalidator.IsEnum)(_sync.SYNC_PATH_SCHEDULER_UNIT),
_ts_metadata("design:type", typeof _sync.SYNC_PATH_SCHEDULER_UNIT === "undefined" ? Object : _sync.SYNC_PATH_SCHEDULER_UNIT)
], SyncPathSchedulerDto.prototype, "unit", void 0);
let SyncPathDto = class SyncPathDto {
};
_ts_decorate([
(0, _classvalidator.IsOptional)(),
(0, _classvalidator.IsInt)(),
_ts_metadata("design:type", Number)
], SyncPathDto.prototype, "id", void 0);
_ts_decorate([
(0, _classvalidator.IsNotEmpty)(),
(0, _classvalidator.IsString)(),
_ts_metadata("design:type", String)
], SyncPathDto.prototype, "name", void 0);
_ts_decorate([
(0, _classvalidator.IsNotEmpty)(),
(0, _classvalidator.IsString)(),
_ts_metadata("design:type", String)
], SyncPathDto.prototype, "localPath", void 0);
_ts_decorate([
(0, _classvalidator.IsNotEmpty)(),
(0, _classvalidator.IsString)(),
_ts_metadata("design:type", String)
], SyncPathDto.prototype, "remotePath", void 0);
_ts_decorate([
(0, _classvalidator.IsOptional)(),
(0, _classvalidator.IsString)(),
_ts_metadata("design:type", String)
], SyncPathDto.prototype, "permissions", void 0);
_ts_decorate([
(0, _classtransformer.Transform)(({ value })=>value.toLowerCase()),
(0, _classvalidator.IsEnum)(_sync.SYNC_PATH_MODE),
_ts_metadata("design:type", typeof _sync.SYNC_PATH_MODE === "undefined" ? Object : _sync.SYNC_PATH_MODE)
], SyncPathDto.prototype, "mode", void 0);
_ts_decorate([
(0, _classtransformer.Transform)(({ value })=>value.toLowerCase()),
(0, _classvalidator.IsEnum)(_sync.SYNC_PATH_DIFF_MODE),
_ts_metadata("design:type", typeof _sync.SYNC_PATH_DIFF_MODE === "undefined" ? Object : _sync.SYNC_PATH_DIFF_MODE)
], SyncPathDto.prototype, "diffMode", void 0);
_ts_decorate([
(0, _classtransformer.Transform)(({ value })=>value.toLowerCase()),
(0, _classvalidator.IsEnum)(_sync.SYNC_PATH_CONFLICT_MODE),
_ts_metadata("design:type", typeof _sync.SYNC_PATH_CONFLICT_MODE === "undefined" ? Object : _sync.SYNC_PATH_CONFLICT_MODE)
], SyncPathDto.prototype, "conflictMode", void 0);
_ts_decorate([
(0, _classvalidator.IsArray)(),
(0, _classvalidator.IsString)({
each: true
}),
_ts_metadata("design:type", Array)
], SyncPathDto.prototype, "filters", void 0);
_ts_decorate([
(0, _classtransformer.Transform)(({ value })=>value ? value : {
value: 0,
unit: _sync.SYNC_PATH_SCHEDULER_UNIT.DISABLED
}),
(0, _classvalidator.ValidateNested)(),
(0, _classtransformer.Type)(()=>SyncPathSchedulerDto),
_ts_metadata("design:type", typeof SyncPathSchedulerDto === "undefined" ? Object : SyncPathSchedulerDto)
], SyncPathDto.prototype, "scheduler", void 0);
_ts_decorate([
(0, _classvalidator.IsInt)(),
_ts_metadata("design:type", Number)
], SyncPathDto.prototype, "timestamp", void 0);
_ts_decorate([
(0, _classvalidator.IsBoolean)(),
_ts_metadata("design:type", Boolean)
], SyncPathDto.prototype, "enabled", void 0);
_ts_decorate([
(0, _classvalidator.IsOptional)(),
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
], SyncPathDto.prototype, "lastSync", void 0);
let SyncPathUpdateDto = class SyncPathUpdateDto extends SyncPathDto {
};
_ts_decorate([
(0, _classvalidator.IsOptional)(),
_ts_metadata("design:type", String)
], SyncPathUpdateDto.prototype, "localPath", void 0);
_ts_decorate([
(0, _classvalidator.IsOptional)(),
_ts_metadata("design:type", String)
], SyncPathUpdateDto.prototype, "remotePath", void 0);
_ts_decorate([
(0, _classvalidator.IsOptional)(),
_ts_metadata("design:type", Number)
], SyncPathUpdateDto.prototype, "timestamp", void 0);
//# sourceMappingURL=sync-path.dto.js.map