@sync-in/server
Version:
The secure, open-source platform for file storage, sharing, collaboration, and sync
54 lines (53 loc) • 2.13 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
});
Object.defineProperty(exports, "WebSocketConfig", {
enumerable: true,
get: function() {
return WebSocketConfig;
}
});
const _classvalidator = require("class-validator");
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 WebSocketConfig = class WebSocketConfig {
constructor(){
this.adapter = 'cluster';
this.// requires optional dependency: @socket.io/redis-adapter
redis = 'redis://127.0.0.1:6379';
this.corsOrigin = '*';
}
};
_ts_decorate([
(0, _classvalidator.IsString)(),
(0, _classvalidator.IsNotEmpty)(),
(0, _classvalidator.IsIn)([
'redis',
'cluster'
]),
_ts_metadata("design:type", String)
], WebSocketConfig.prototype, "adapter", void 0);
_ts_decorate([
(0, _classvalidator.ValidateIf)((o)=>o.adapter === 'redis'),
(0, _classvalidator.IsString)(),
(0, _classvalidator.IsNotEmpty)(),
_ts_metadata("design:type", String)
], WebSocketConfig.prototype, "redis", void 0);
_ts_decorate([
(0, _classvalidator.IsString)(),
(0, _classvalidator.IsNotEmpty)(),
_ts_metadata("design:type", String)
], WebSocketConfig.prototype, "corsOrigin", void 0);
//# sourceMappingURL=web-socket.config.js.map