UNPKG

@sync-in/server

Version:

The secure, open-source platform for file storage, sharing, collaboration, and sync

54 lines (53 loc) 1.69 kB
/* * 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 DB_CHARSET () { return DB_CHARSET; }, get DB_TOKEN_PROVIDER () { return DB_TOKEN_PROVIDER; }, get MIGRATIONS_PATH () { return MIGRATIONS_PATH; }, get getSchemaPath () { return getSchemaPath; } }); const _nodepath = /*#__PURE__*/ _interop_require_default(require("node:path")); const _nodefs = /*#__PURE__*/ _interop_require_default(require("node:fs")); function _interop_require_default(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const DB_CHARSET = 'utf8mb4'; const DB_TOKEN_PROVIDER = 'DB'; const MIGRATIONS_PATH = _nodepath.default.relative(process.cwd(), _nodepath.default.join(__dirname, '../../../migrations')); function getSchemaPath() { // Look for schema.ts (dev) or schema.js (production), throw if none is found const extensions = [ 'js', 'ts' ]; for (const ext of extensions){ const filePath = _nodepath.default.join(__dirname, `schema.${ext}`); if (_nodefs.default.existsSync(filePath)) { return filePath; } } throw new Error('No schema.ts or schema.js file found !'); } //# sourceMappingURL=constants.js.map