mega-framework 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/mega-ws-hub.js +2 -2
- package/package.json +32 -8
- package/sample/crud/.env +1 -1
- package/sample/crud/.env.example +1 -1
- package/sample/crud/.mega/journal/history/20260612092543-create-users.json +261 -0
- package/sample/crud/.mega/journal/snapshot.json +261 -0
- package/sample/crud/apps/main/controllers/auth-controller.js +22 -14
- package/sample/crud/apps/main/controllers/web-controller.js +7 -5
- package/sample/crud/apps/main/migrations/20260606000001-create-users.js +91 -13
- package/sample/crud/apps/main/migrations/20260606000002-create-boards.js +165 -0
- package/sample/crud/apps/main/migrations/20260606000003-create-logs.js +107 -0
- package/sample/crud/apps/main/models/log-partition-model.js +105 -0
- package/sample/crud/apps/main/models/note-model.js +79 -0
- package/sample/crud/apps/main/models/user-level-model.js +24 -0
- package/sample/crud/apps/main/models/user-model.js +146 -0
- package/sample/crud/apps/main/models/user-type-model.js +21 -0
- package/sample/crud/apps/main/models/wallet-model.js +24 -0
- package/sample/crud/apps/main/routes/users.js +55 -10
- package/sample/crud/apps/main/schedules/log-partition-schedule.js +33 -0
- package/sample/crud/apps/main/services/auth-service.js +39 -24
- package/sample/crud/apps/main/services/log-partition-service.js +101 -0
- package/sample/crud/apps/main/services/note-service.js +6 -6
- package/sample/crud/apps/main/services/redis-demo-service.js +3 -3
- package/sample/crud/apps/main/services/user-service.js +62 -21
- package/sample/crud/apps/main/views/auth/login.ejs +6 -6
- package/sample/crud/apps/main/views/auth/register.ejs +46 -5
- package/sample/crud/apps/main/views/users/edit.ejs +42 -5
- package/sample/crud/apps/main/views/users/list.ejs +6 -2
- package/sample/crud/apps/main/views/users/new.ejs +56 -4
- package/sample/crud/docs/log_partition_design.mm.md +23 -0
- package/sample/crud/mega.config.js +3 -2
- package/sample/crud/package.json +1 -1
- package/sample/crud/scripts/start-ws-hub.sh +2 -2
- package/sample/simple/package.json +2 -2
- package/src/adapters/adapter-manager.js +2 -1
- package/src/adapters/adapter-options.js +30 -0
- package/src/adapters/maria-adapter.js +26 -3
- package/src/adapters/mega-db-adapter.js +7 -1
- package/src/adapters/mongo-adapter.js +19 -1
- package/src/adapters/postgres-adapter.js +25 -2
- package/src/adapters/sqlite-adapter.js +20 -1
- package/src/cli/commands/new.js +13 -3
- package/src/cli/commands/scaffold.js +137 -33
- package/src/cli/generators/index.js +82 -2
- package/src/cli/index.js +353 -100
- package/src/core/ajv-mapper.js +27 -2
- package/src/core/boot.js +464 -245
- package/src/core/cluster-metrics.js +13 -4
- package/src/core/ctx-builder.js +6 -2
- package/src/core/envelope.js +112 -12
- package/src/core/hub-link.js +65 -4
- package/src/core/i18n.js +11 -1
- package/src/core/index.js +6 -2
- package/src/core/mega-app.js +201 -463
- package/src/core/mega-cluster.js +4 -1
- package/src/core/mega-server.js +40 -9
- package/src/core/migration/dialect-registry.js +107 -0
- package/src/core/migration/dialects/README.md +62 -0
- package/src/core/migration/dialects/maria.js +496 -0
- package/src/core/migration/dialects/mongo.js +824 -0
- package/src/core/migration/dialects/postgres.js +563 -0
- package/src/core/migration/dialects/sqlite.js +476 -0
- package/src/core/migration/differ.js +456 -0
- package/src/core/migration/generate.js +508 -0
- package/src/core/migration/journal.js +167 -0
- package/src/core/migration/model-scan.js +84 -0
- package/src/core/migration/mongo-migration-db.js +97 -0
- package/src/core/migration/schema-builder.js +400 -0
- package/src/core/migration/schema-validator.js +315 -0
- package/src/core/migration-lock.js +205 -0
- package/src/core/migration-runner.js +166 -38
- package/src/core/multipart.js +28 -5
- package/src/core/pipeline.js +129 -0
- package/src/core/router.js +70 -65
- package/src/core/security.js +67 -9
- package/src/core/workers-manager.js +12 -1
- package/src/core/ws-cluster.js +10 -3
- package/src/core/ws-message.js +48 -4
- package/src/core/ws-presence.js +624 -0
- package/src/core/ws-roster.js +4 -1
- package/src/core/ws-upgrade.js +118 -12
- package/src/index.js +1 -1
- package/src/lib/hub-protocol.js +29 -0
- package/src/lib/mega-health.js +25 -4
- package/src/lib/mega-job-queue.js +98 -21
- package/src/lib/mega-job.js +29 -0
- package/src/lib/mega-metrics.js +3 -12
- package/src/lib/mega-plugin.js +34 -3
- package/src/lib/mega-schedule.js +40 -22
- package/src/lib/mega-shutdown.js +114 -39
- package/src/lib/mega-tracing.js +66 -19
- package/src/lib/mega-worker.js +5 -1
- package/src/lib/otel-resource.js +36 -0
- package/src/{cli → lib}/ws-hub.js +51 -8
- package/src/models/crud-sql-builder.js +133 -0
- package/src/models/mega-model.js +82 -2
- package/src/models/model-crud.js +483 -0
- package/src/models/mongo-crud.js +285 -0
- package/templates/model/code-mongo.tpl +35 -0
- package/templates/model/code.tpl +15 -1
- package/templates/model/test-mongo.tpl +38 -0
- package/templates/model/test.tpl +4 -0
- package/types/adapters/adapter-manager.d.ts +95 -0
- package/types/adapters/adapter-options.d.ts +91 -0
- package/types/adapters/file-adapter.d.ts +94 -0
- package/types/adapters/file-session-adapter.d.ts +101 -0
- package/types/adapters/index.d.ts +20 -0
- package/types/adapters/maria-adapter.d.ts +115 -0
- package/types/adapters/mega-adapter.d.ts +215 -0
- package/types/adapters/mega-bus-adapter.d.ts +45 -0
- package/types/adapters/mega-cache-adapter.d.ts +47 -0
- package/types/adapters/mega-db-adapter.d.ts +47 -0
- package/types/adapters/mega-lock-adapter.d.ts +62 -0
- package/types/adapters/mega-log-sink-adapter.d.ts +15 -0
- package/types/adapters/mega-session-adapter.d.ts +32 -0
- package/types/adapters/mongo-adapter.d.ts +139 -0
- package/types/adapters/nats-adapter.d.ts +108 -0
- package/types/adapters/postgres-adapter.d.ts +139 -0
- package/types/adapters/redis-adapter.d.ts +70 -0
- package/types/adapters/redis-session-adapter.d.ts +82 -0
- package/types/adapters/redlock-adapter.d.ts +149 -0
- package/types/adapters/registry.d.ts +46 -0
- package/types/adapters/sqlite-adapter.d.ts +106 -0
- package/types/auth/index.d.ts +24 -0
- package/types/cli/commands/console-cmd.d.ts +37 -0
- package/types/cli/commands/new.d.ts +16 -0
- package/types/cli/commands/routes.d.ts +36 -0
- package/types/cli/commands/scaffold.d.ts +78 -0
- package/types/cli/commands/test-cmd.d.ts +14 -0
- package/types/cli/generators/index.d.ts +112 -0
- package/types/cli/index.d.ts +249 -0
- package/types/cli/template-engine.d.ts +40 -0
- package/types/core/ajv-mapper.d.ts +27 -0
- package/types/core/boot.d.ts +233 -0
- package/types/core/cluster-metrics.d.ts +52 -0
- package/types/core/config-loader.d.ts +13 -0
- package/types/core/config-validator.d.ts +30 -0
- package/types/core/ctx-builder.d.ts +80 -0
- package/types/core/envelope.d.ts +79 -0
- package/types/core/error-mapper.d.ts +17 -0
- package/types/core/formbody.d.ts +41 -0
- package/types/core/hub-link.d.ts +264 -0
- package/types/core/i18n.d.ts +178 -0
- package/types/core/index.d.ts +28 -0
- package/types/core/mega-app.d.ts +529 -0
- package/types/core/mega-cluster.d.ts +104 -0
- package/types/core/mega-server.d.ts +91 -0
- package/types/core/mega-service.d.ts +31 -0
- package/types/core/migration/dialect-registry.d.ts +22 -0
- package/types/core/migration/dialects/maria.d.ts +99 -0
- package/types/core/migration/dialects/mongo.d.ts +89 -0
- package/types/core/migration/dialects/postgres.d.ts +117 -0
- package/types/core/migration/dialects/sqlite.d.ts +111 -0
- package/types/core/migration/differ.d.ts +47 -0
- package/types/core/migration/generate.d.ts +56 -0
- package/types/core/migration/journal.d.ts +52 -0
- package/types/core/migration/model-scan.d.ts +19 -0
- package/types/core/migration/mongo-migration-db.d.ts +7 -0
- package/types/core/migration/schema-builder.d.ts +197 -0
- package/types/core/migration/schema-validator.d.ts +20 -0
- package/types/core/migration-lock.d.ts +33 -0
- package/types/core/migration-runner.d.ts +101 -0
- package/types/core/multipart.d.ts +86 -0
- package/types/core/openapi.d.ts +62 -0
- package/types/core/pipeline.d.ts +92 -0
- package/types/core/router.d.ts +159 -0
- package/types/core/routes-loader.d.ts +21 -0
- package/types/core/scope-registry.d.ts +14 -0
- package/types/core/security.d.ts +77 -0
- package/types/core/services-loader.d.ts +27 -0
- package/types/core/session-cleanup-schedule.d.ts +19 -0
- package/types/core/session-store.d.ts +18 -0
- package/types/core/session.d.ts +77 -0
- package/types/core/static-assets.d.ts +73 -0
- package/types/core/template.d.ts +106 -0
- package/types/core/workers-manager.d.ts +79 -0
- package/types/core/ws-cluster.d.ts +208 -0
- package/types/core/ws-compression.d.ts +112 -0
- package/types/core/ws-controller.d.ts +65 -0
- package/types/core/ws-message.d.ts +106 -0
- package/types/core/ws-presence.d.ts +273 -0
- package/types/core/ws-roster.d.ts +96 -0
- package/types/core/ws-upgrade.d.ts +231 -0
- package/types/errors/config-error.d.ts +10 -0
- package/types/errors/http-errors.d.ts +120 -0
- package/types/errors/index.d.ts +3 -0
- package/types/errors/mega-error.d.ts +32 -0
- package/types/index.d.ts +39 -0
- package/types/lib/asp/config.d.ts +49 -0
- package/types/lib/asp/crypto.d.ts +43 -0
- package/types/lib/asp/errors.d.ts +30 -0
- package/types/lib/asp/nonce-cache.d.ts +52 -0
- package/types/lib/asp/plugin.d.ts +30 -0
- package/types/lib/asp/ws-terminator.d.ts +45 -0
- package/types/lib/env-mapper.d.ts +14 -0
- package/types/lib/hub-protocol.d.ts +106 -0
- package/types/lib/index.d.ts +22 -0
- package/types/lib/logger/telegram-core.d.ts +104 -0
- package/types/lib/logger/telegram-transport.d.ts +45 -0
- package/types/lib/mega-brute-force.d.ts +66 -0
- package/types/lib/mega-circuit-breaker.d.ts +241 -0
- package/types/lib/mega-cron.d.ts +66 -0
- package/types/lib/mega-hash.d.ts +32 -0
- package/types/lib/mega-health.d.ts +41 -0
- package/types/lib/mega-job-queue.d.ts +176 -0
- package/types/lib/mega-job-worker.d.ts +130 -0
- package/types/lib/mega-job.d.ts +138 -0
- package/types/lib/mega-logger.d.ts +45 -0
- package/types/lib/mega-metrics.d.ts +285 -0
- package/types/lib/mega-plugin.d.ts +245 -0
- package/types/lib/mega-retry.d.ts +85 -0
- package/types/lib/mega-schedule.d.ts +260 -0
- package/types/lib/mega-shutdown.d.ts +135 -0
- package/types/lib/mega-tracing.d.ts +224 -0
- package/types/lib/mega-worker.d.ts +127 -0
- package/types/lib/otel-resource.d.ts +16 -0
- package/types/lib/worker-runner/process-entry.d.ts +1 -0
- package/types/lib/worker-runner/task-dispatch.d.ts +28 -0
- package/types/lib/worker-runner/thread-entry.d.ts +1 -0
- package/types/lib/ws-hub.d.ts +234 -0
- package/types/models/crud-sql-builder.d.ts +48 -0
- package/types/models/index.d.ts +1 -0
- package/types/models/mega-model.d.ts +138 -0
- package/types/models/model-crud.d.ts +82 -0
- package/types/models/mongo-crud.d.ts +59 -0
- package/types/test/index.d.ts +84 -0
- package/.env +0 -127
- package/sample/crud/apps/main/migrations/20260606000002-add-auth-to-users.js +0 -30
- package/sample/crud/apps/main/models/note.js +0 -71
- package/sample/crud/apps/main/models/user.js +0 -86
- package/sample/crud/package-lock.json +0 -5665
- package/sample/crud/yarn.lock +0 -2142
- package/sample/simple/package-lock.json +0 -1851
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* i18n 등록 결과 요약(디버그·테스트용).
|
|
3
|
+
* @typedef {Object} I18nSummary
|
|
4
|
+
* @property {boolean} enabled - 등록 여부.
|
|
5
|
+
* @property {string} default - 기본 언어.
|
|
6
|
+
* @property {string} fallback - fallback 언어.
|
|
7
|
+
* @property {string[]} available - 지원 언어 목록.
|
|
8
|
+
* @property {string} cookieName - locale 쿠키 이름.
|
|
9
|
+
* @property {boolean} autoComplete - saveMissing(dev 자동 키 생성) 활성 여부.
|
|
10
|
+
* @property {import('i18next').i18n | null} instance - 생성된 i18next 인스턴스(미등록 시 null).
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* 정규화된 i18n 설정.
|
|
14
|
+
* @typedef {Object} NormalizedI18n
|
|
15
|
+
* @property {string} default
|
|
16
|
+
* @property {string} fallback
|
|
17
|
+
* @property {string[]} available
|
|
18
|
+
* @property {string} cookieName
|
|
19
|
+
* @property {{ enabled: boolean, dir: string|null, debounceMs: number }} autoComplete
|
|
20
|
+
* @property {string|null} localesDir
|
|
21
|
+
* @property {Record<string, any>} resources
|
|
22
|
+
* @property {boolean} exposeTranslations
|
|
23
|
+
* @property {string} translationsPath
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* 앱 `i18n` config 를 정규화한다. falsy 면 미옵트인(`null`).
|
|
27
|
+
*
|
|
28
|
+
* 잘못된 형태는 **fail-fast** 로 throw 한다(silent 보정 X). `available` 이 배열이 아니거나 비었으면
|
|
29
|
+
* 부팅 에러로 드러내, locale 미설정이 런타임에 조용히 fallback 으로 뭉개지지 않게 한다.
|
|
30
|
+
*
|
|
31
|
+
* @param {unknown} i18n - `MegaI18nAppConfig`(default/available/fallback/cookieName/autoComplete/...).
|
|
32
|
+
* @returns {NormalizedI18n | null}
|
|
33
|
+
* @throws {Error} `available` 가 비-배열/빈 배열 등 명백한 오설정.
|
|
34
|
+
*/
|
|
35
|
+
export function normalizeI18n(i18n: unknown): NormalizedI18n | null;
|
|
36
|
+
/**
|
|
37
|
+
* `<dir>/<scope>/<lng>.json` 디렉터리 구조에서 locale 리소스를 로드한다(ADR-039 scope 분리 레이아웃,
|
|
38
|
+
* 04-data-models §768). 파일이 없으면 건너뛴다(빈 namespace). 부팅 시 1회 동기 읽기.
|
|
39
|
+
*
|
|
40
|
+
* @param {string|null} dir - locale 루트 디렉터리. null 이면 빈 리소스.
|
|
41
|
+
* @param {object} opts
|
|
42
|
+
* @param {string[]} opts.available - 로드할 언어 목록.
|
|
43
|
+
* @param {{ warn?: Function }} [opts.logger]
|
|
44
|
+
* @returns {Record<string, Record<string, object>>} `{ <lng>: { <scope>: {...} } }` i18next resources 형태.
|
|
45
|
+
*/
|
|
46
|
+
export function loadLocaleResources(dir: string | null, { available, logger }?: {
|
|
47
|
+
available: string[];
|
|
48
|
+
logger?: {
|
|
49
|
+
warn?: Function;
|
|
50
|
+
};
|
|
51
|
+
}): Record<string, Record<string, object>>;
|
|
52
|
+
/**
|
|
53
|
+
* saveMissing 디바운스 writer 를 만든다 — axion 패턴(ADR-037).
|
|
54
|
+
*
|
|
55
|
+
* `(lng, scope, key, value)` 누락 키를 모아 `<dir>/<scope>/<lng>.json` 파일에 **기존 키 보존**하며
|
|
56
|
+
* 병합 저장한다. 같은 파일의 연속 호출은 `debounceMs` 동안 흡수(타이머 1개)하고, flush 시:
|
|
57
|
+
* 1. 기존 파일 읽어 base 로(없으면 {}),
|
|
58
|
+
* 2. 모아둔 누락 키를 dot-notation 으로 set(기존 키 안 건드림),
|
|
59
|
+
* 3. tmp 파일 작성 → `rename`(원자적 쓰기 — 부분 파일 노출 방지),
|
|
60
|
+
* 4. `timer.unref()` 라 보류 중 타이머가 프로세스 종료를 막지 않음.
|
|
61
|
+
*
|
|
62
|
+
* 쓰기 실패는 비치명적(dev 편의 기능) — warn 후 다음 호출에 재시도.
|
|
63
|
+
*
|
|
64
|
+
* @param {object} opts
|
|
65
|
+
* @param {string} opts.dir - locale 루트 디렉터리.
|
|
66
|
+
* @param {number} opts.debounceMs
|
|
67
|
+
* @param {{ debug?: Function, warn?: Function }} [opts.logger]
|
|
68
|
+
* @returns {{ enqueue: (lng: string, scope: string, key: string, value: string) => void, flushAll: () => Promise<void>, _pendingCount: () => number }}
|
|
69
|
+
*/
|
|
70
|
+
export function createMissingKeyWriter({ dir, debounceMs, logger }: {
|
|
71
|
+
dir: string;
|
|
72
|
+
debounceMs: number;
|
|
73
|
+
logger?: {
|
|
74
|
+
debug?: Function;
|
|
75
|
+
warn?: Function;
|
|
76
|
+
};
|
|
77
|
+
}): {
|
|
78
|
+
enqueue: (lng: string, scope: string, key: string, value: string) => void;
|
|
79
|
+
flushAll: () => Promise<void>;
|
|
80
|
+
_pendingCount: () => number;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* 요청 Cookie 헤더에서 locale 쿠키를 읽어 유효 언어로 결정한다(ADR-038 — 쿠키만).
|
|
84
|
+
*
|
|
85
|
+
* 쿠키가 없거나 `available` 에 없는 값이면 `default` 로 폴백한다(조용한 클램프 — 변조·구식 쿠키 방어).
|
|
86
|
+
*
|
|
87
|
+
* @param {string|undefined} cookieHeader - `req.headers.cookie`.
|
|
88
|
+
* @param {object} opts
|
|
89
|
+
* @param {string} opts.cookieName
|
|
90
|
+
* @param {string[]} opts.available
|
|
91
|
+
* @param {string} opts.default
|
|
92
|
+
* @returns {string} 결정된 언어.
|
|
93
|
+
*/
|
|
94
|
+
export function detectLocale(cookieHeader: string | undefined, { cookieName, available, default: def }: {
|
|
95
|
+
cookieName: string;
|
|
96
|
+
available: string[];
|
|
97
|
+
default: string;
|
|
98
|
+
}): string;
|
|
99
|
+
/**
|
|
100
|
+
* Fastify 인스턴스에 i18n(`i18next`) 을 자동 등록한다 — 요청별 언어 결정·`req.t`·scope 번들·관측성.
|
|
101
|
+
*
|
|
102
|
+
* `i18n` 이 falsy 면 **미등록**(옵트인). session.js / multipart.js 형제 패턴. 호출 순서는 라우트 등록
|
|
103
|
+
* 이전 어디든 무방하다(onRequest hook + request 부착이라 라우트 순서와 무관).
|
|
104
|
+
*
|
|
105
|
+
* @param {import('fastify').FastifyInstance} fastify - 대상 앱 Fastify 인스턴스.
|
|
106
|
+
* @param {Object} opts
|
|
107
|
+
* @param {unknown} opts.i18n - `MegaI18nAppConfig`. falsy 면 미등록.
|
|
108
|
+
* @param {string} [opts.appName] - 앱 이름(메트릭 라벨·로그용).
|
|
109
|
+
* @param {{ debug?: Function, warn?: Function }} [opts.logger] - 흐름 길목 debug 로그(선택).
|
|
110
|
+
* @returns {I18nSummary}
|
|
111
|
+
*/
|
|
112
|
+
export function registerI18n(fastify: import("fastify").FastifyInstance, { i18n, appName, logger }?: {
|
|
113
|
+
i18n: unknown;
|
|
114
|
+
appName?: string;
|
|
115
|
+
logger?: {
|
|
116
|
+
debug?: Function;
|
|
117
|
+
warn?: Function;
|
|
118
|
+
};
|
|
119
|
+
}): I18nSummary;
|
|
120
|
+
/** locale 쿠키 기본 이름 (04-data-models §394 `cookieName: 'mega.lang'`). */
|
|
121
|
+
export const DEFAULT_I18N_COOKIE: "mega.lang";
|
|
122
|
+
/** scope 분리 고정 namespace 2종 (ADR-039). server=에러·검증, client=SPA UI. */
|
|
123
|
+
export const I18N_SCOPES: readonly string[];
|
|
124
|
+
/** server scope = 기본 namespace — `ctx.t()` 가 자동 선택(ADR-039). */
|
|
125
|
+
export const DEFAULT_SCOPE: "server";
|
|
126
|
+
/** saveMissing 디바운스 기본값 (ms, ADR-037 axion 패턴). */
|
|
127
|
+
export const DEFAULT_DEBOUNCE_MS: 500;
|
|
128
|
+
/**
|
|
129
|
+
* i18n 등록 결과 요약(디버그·테스트용).
|
|
130
|
+
*/
|
|
131
|
+
export type I18nSummary = {
|
|
132
|
+
/**
|
|
133
|
+
* - 등록 여부.
|
|
134
|
+
*/
|
|
135
|
+
enabled: boolean;
|
|
136
|
+
/**
|
|
137
|
+
* - 기본 언어.
|
|
138
|
+
*/
|
|
139
|
+
default: string;
|
|
140
|
+
/**
|
|
141
|
+
* - fallback 언어.
|
|
142
|
+
*/
|
|
143
|
+
fallback: string;
|
|
144
|
+
/**
|
|
145
|
+
* - 지원 언어 목록.
|
|
146
|
+
*/
|
|
147
|
+
available: string[];
|
|
148
|
+
/**
|
|
149
|
+
* - locale 쿠키 이름.
|
|
150
|
+
*/
|
|
151
|
+
cookieName: string;
|
|
152
|
+
/**
|
|
153
|
+
* - saveMissing(dev 자동 키 생성) 활성 여부.
|
|
154
|
+
*/
|
|
155
|
+
autoComplete: boolean;
|
|
156
|
+
/**
|
|
157
|
+
* - 생성된 i18next 인스턴스(미등록 시 null).
|
|
158
|
+
*/
|
|
159
|
+
instance: import("i18next").i18n | null;
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* 정규화된 i18n 설정.
|
|
163
|
+
*/
|
|
164
|
+
export type NormalizedI18n = {
|
|
165
|
+
default: string;
|
|
166
|
+
fallback: string;
|
|
167
|
+
available: string[];
|
|
168
|
+
cookieName: string;
|
|
169
|
+
autoComplete: {
|
|
170
|
+
enabled: boolean;
|
|
171
|
+
dir: string | null;
|
|
172
|
+
debounceMs: number;
|
|
173
|
+
};
|
|
174
|
+
localesDir: string | null;
|
|
175
|
+
resources: Record<string, any>;
|
|
176
|
+
exposeTranslations: boolean;
|
|
177
|
+
translationsPath: string;
|
|
178
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export { MegaApp } from "./mega-app.js";
|
|
2
|
+
export { MegaWsPresence } from "./ws-presence.js";
|
|
3
|
+
export { MegaServer } from "./mega-server.js";
|
|
4
|
+
export { MegaService } from "./mega-service.js";
|
|
5
|
+
export { MegaCluster } from "./mega-cluster.js";
|
|
6
|
+
export { loadRoutes } from "./routes-loader.js";
|
|
7
|
+
export { buildErrorHandler } from "./error-mapper.js";
|
|
8
|
+
export { loadAndValidateConfig } from "./config-loader.js";
|
|
9
|
+
export { MegaWebSocketController } from "./ws-controller.js";
|
|
10
|
+
export { MegaHubLink } from "./hub-link.js";
|
|
11
|
+
export { createSessionCleanupSchedule } from "./session-cleanup-schedule.js";
|
|
12
|
+
export { Router, MegaRouteError } from "./router.js";
|
|
13
|
+
export { bootApp, buildBootContext } from "./boot.js";
|
|
14
|
+
export { wrapEnvelope, errorEnvelope, synthesizeEnvelopeResponseSchema, ENVELOPE_MARK } from "./envelope.js";
|
|
15
|
+
export { buildHttpPipeline, wrapPreHandler, composeTransform, composeAfter } from "./pipeline.js";
|
|
16
|
+
export { ajvErrorToValidationError, MAX_VALIDATION_DETAILS } from "./ajv-mapper.js";
|
|
17
|
+
export { buildHttpCtx, getHttpCtx, buildAdapterAccessors } from "./ctx-builder.js";
|
|
18
|
+
export { createWsMessage, validateWsMessage, parseWsMessage, generateMessageId, WS_MESSAGE_SCHEMA, WS_PROTOCOL_VERSION, WS_TYPE_PATTERN } from "./ws-message.js";
|
|
19
|
+
export { MegaWsConnection, driveWsConnection, createPlainCodec, createAspCodec, rejectUpgrade, CLOSE_CODE_DECRYPT_FAILED, CLOSE_CODE_INTERNAL_ERROR } from "./ws-upgrade.js";
|
|
20
|
+
export { buildPerMessageDeflate, checkCompressionConfig, COMPRESSION_DEFAULTS } from "./ws-compression.js";
|
|
21
|
+
export { validateGlobalConfig, validateAppConfig, validateHostCollisions } from "./config-validator.js";
|
|
22
|
+
export { registerSecurityPlugins, DEFAULT_RATE_LIMIT } from "./security.js";
|
|
23
|
+
export { registerSession, generateSid, readSession } from "./session.js";
|
|
24
|
+
export { createSessionStore, SESSION_STORE_DRIVERS } from "./session-store.js";
|
|
25
|
+
export { registerI18n, normalizeI18n, detectLocale, loadLocaleResources, createMissingKeyWriter, DEFAULT_I18N_COOKIE, I18N_SCOPES } from "./i18n.js";
|
|
26
|
+
export { registerTemplate, MegaTemplate, normalizeViews, resolveViewPath, renderView, VIEW_ENGINE } from "./template.js";
|
|
27
|
+
export { registerStaticAssets, normalizeStaticAssets, DEFAULT_STATIC_PREFIX } from "./static-assets.js";
|
|
28
|
+
export { registerOpenapi, normalizeOpenapi, DEFAULT_OPENAPI_PATH } from "./openapi.js";
|