@taicode/common-server 3.7.13 → 4.0.0-beta.1

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.
Files changed (130) hide show
  1. package/output/app/auth.test.d.ts +2 -0
  2. package/output/app/auth.test.d.ts.map +1 -0
  3. package/output/app/auth.test.js +148 -0
  4. package/output/app/boot.d.ts +48 -0
  5. package/output/app/boot.d.ts.map +1 -0
  6. package/output/app/boot.js +123 -0
  7. package/output/app/config.test.d.ts +2 -0
  8. package/output/app/config.test.d.ts.map +1 -0
  9. package/output/app/config.test.js +132 -0
  10. package/output/app/context.d.ts +68 -0
  11. package/output/app/context.d.ts.map +1 -0
  12. package/output/app/context.js +73 -0
  13. package/output/app/core/cookie.d.ts +25 -0
  14. package/output/app/core/cookie.d.ts.map +1 -0
  15. package/output/app/core/cookie.js +22 -0
  16. package/output/app/core/identity.d.ts +12 -0
  17. package/output/app/core/identity.d.ts.map +1 -0
  18. package/output/app/core/identity.js +14 -0
  19. package/output/app/core/index.d.ts +44 -0
  20. package/output/app/core/index.d.ts.map +1 -0
  21. package/output/app/core/index.js +57 -0
  22. package/output/app/core/logging.d.ts +13 -0
  23. package/output/app/core/logging.d.ts.map +1 -0
  24. package/output/app/core/logging.js +29 -0
  25. package/output/app/core/openapi.d.ts +17 -0
  26. package/output/app/core/openapi.d.ts.map +1 -0
  27. package/output/app/core/openapi.js +42 -0
  28. package/output/app/core/request-id.d.ts +36 -0
  29. package/output/app/core/request-id.d.ts.map +1 -0
  30. package/output/app/core/request-id.js +66 -0
  31. package/output/app/core/response.d.ts +41 -0
  32. package/output/app/core/response.d.ts.map +1 -0
  33. package/output/app/core/response.js +89 -0
  34. package/output/app/define-server.negative-cases.d.ts +32 -0
  35. package/output/app/define-server.negative-cases.d.ts.map +1 -0
  36. package/output/app/define-server.negative-cases.js +209 -0
  37. package/output/app/define-server.test.d.ts +2 -0
  38. package/output/app/define-server.test.d.ts.map +1 -0
  39. package/output/app/define-server.test.js +97 -0
  40. package/output/app/entries.d.ts +29 -0
  41. package/output/app/entries.d.ts.map +1 -0
  42. package/output/app/entries.js +64 -0
  43. package/output/app/env.d.ts +59 -0
  44. package/output/app/env.d.ts.map +1 -0
  45. package/output/app/env.js +66 -0
  46. package/output/app/env.test.d.ts +2 -0
  47. package/output/app/env.test.d.ts.map +1 -0
  48. package/output/app/env.test.js +124 -0
  49. package/output/app/error-contract.test.d.ts +2 -0
  50. package/output/app/error-contract.test.d.ts.map +1 -0
  51. package/output/app/error-contract.test.js +125 -0
  52. package/output/app/errors.d.ts +20 -0
  53. package/output/app/errors.d.ts.map +1 -0
  54. package/output/app/errors.js +51 -0
  55. package/output/app/generate-openapi.test.d.ts +2 -0
  56. package/output/app/generate-openapi.test.d.ts.map +1 -0
  57. package/output/app/generate-openapi.test.js +123 -0
  58. package/output/app/index.d.ts +16 -0
  59. package/output/app/index.d.ts.map +1 -0
  60. package/output/app/index.js +18 -0
  61. package/output/app/lifecycle-logging.test.d.ts +2 -0
  62. package/output/app/lifecycle-logging.test.d.ts.map +1 -0
  63. package/output/app/lifecycle-logging.test.js +155 -0
  64. package/output/app/lifecycle.d.ts +70 -0
  65. package/output/app/lifecycle.d.ts.map +1 -0
  66. package/output/app/lifecycle.js +99 -0
  67. package/output/app/lifecycle.test.d.ts +2 -0
  68. package/output/app/lifecycle.test.d.ts.map +1 -0
  69. package/output/app/lifecycle.test.js +152 -0
  70. package/output/app/middleware/auth.d.ts +71 -0
  71. package/output/app/middleware/auth.d.ts.map +1 -0
  72. package/output/app/middleware/auth.js +190 -0
  73. package/output/app/middleware/context.d.ts +13 -0
  74. package/output/app/middleware/context.d.ts.map +1 -0
  75. package/output/app/middleware/context.js +15 -0
  76. package/output/app/middleware/cors.d.ts +14 -0
  77. package/output/app/middleware/cors.d.ts.map +1 -0
  78. package/output/app/middleware/cors.js +30 -0
  79. package/output/app/middleware/index.d.ts +17 -0
  80. package/output/app/middleware/index.d.ts.map +1 -0
  81. package/output/app/middleware/index.js +16 -0
  82. package/output/app/middleware/rate-limit.d.ts +24 -0
  83. package/output/app/middleware/rate-limit.d.ts.map +1 -0
  84. package/output/app/middleware/rate-limit.js +46 -0
  85. package/output/app/middleware-order.test.d.ts +2 -0
  86. package/output/app/middleware-order.test.d.ts.map +1 -0
  87. package/output/app/middleware-order.test.js +148 -0
  88. package/output/app/permission-operations.d.ts +48 -0
  89. package/output/app/permission-operations.d.ts.map +1 -0
  90. package/output/app/permission-operations.js +77 -0
  91. package/output/app/permission-operations.test.d.ts +2 -0
  92. package/output/app/permission-operations.test.d.ts.map +1 -0
  93. package/output/app/permission-operations.test.js +72 -0
  94. package/output/app/permission-registration.test.d.ts +2 -0
  95. package/output/app/permission-registration.test.d.ts.map +1 -0
  96. package/output/app/permission-registration.test.js +138 -0
  97. package/output/app/redis.d.ts +45 -0
  98. package/output/app/redis.d.ts.map +1 -0
  99. package/output/app/redis.js +61 -0
  100. package/output/app/registered-operations.test.d.ts +2 -0
  101. package/output/app/registered-operations.test.d.ts.map +1 -0
  102. package/output/app/registered-operations.test.js +57 -0
  103. package/output/app/request-id.test.d.ts +2 -0
  104. package/output/app/request-id.test.d.ts.map +1 -0
  105. package/output/app/request-id.test.js +130 -0
  106. package/output/app/resources.test.d.ts +2 -0
  107. package/output/app/resources.test.d.ts.map +1 -0
  108. package/output/app/resources.test.js +197 -0
  109. package/output/app/shutdown.d.ts +22 -0
  110. package/output/app/shutdown.d.ts.map +1 -0
  111. package/output/app/shutdown.js +30 -0
  112. package/output/app/shutdown.test.d.ts +2 -0
  113. package/output/app/shutdown.test.d.ts.map +1 -0
  114. package/output/app/shutdown.test.js +103 -0
  115. package/output/app/signal.d.ts +12 -0
  116. package/output/app/signal.d.ts.map +1 -0
  117. package/output/app/signal.js +45 -0
  118. package/output/app/smoke.test.d.ts +2 -0
  119. package/output/app/smoke.test.d.ts.map +1 -0
  120. package/output/app/smoke.test.js +210 -0
  121. package/output/app/test-support.d.ts +21 -0
  122. package/output/app/test-support.d.ts.map +1 -0
  123. package/output/app/test-support.js +24 -0
  124. package/output/app/type-augment.d.ts +34 -0
  125. package/output/app/type-augment.d.ts.map +1 -0
  126. package/output/app/type-augment.js +7 -0
  127. package/output/app/types.d.ts +211 -0
  128. package/output/app/types.d.ts.map +1 -0
  129. package/output/app/types.js +2 -0
  130. package/package.json +12 -5
@@ -0,0 +1,22 @@
1
+ import cookie from '@fastify/cookie'; // eslint-disable-line import/default -- @fastify/cookie 是 CJS `export =`,esModuleInterop 下默认导入即正确用法
2
+ /** 从 `readConfig('server')` 的返回值读取 cookie 名列表(缺省 `['token']`,对齐四家现状) */
3
+ export function resolveCookieNames(server) {
4
+ const names = server?.cookieNames;
5
+ return Array.isArray(names) && names.length > 0 ? names : ['token'];
6
+ }
7
+ /** 从 `readConfig('server')` 的返回值读取 cookie domain */
8
+ export function resolveCookieDomain(server) {
9
+ return server?.domain;
10
+ }
11
+ export function registerCookie(app, options) {
12
+ app.register(cookie);
13
+ app.decorateReply('setAuthCookie', function setAuthCookie(name, value, cookieOptions = {}) {
14
+ this.setCookie(name, value, {
15
+ path: cookieOptions.path ?? '/',
16
+ maxAge: cookieOptions.maxAge,
17
+ domain: cookieOptions.domain ?? resolveCookieDomain(options.readConfig('server')),
18
+ sameSite: 'lax',
19
+ secure: options.env.ENV === 'production',
20
+ });
21
+ });
22
+ }
@@ -0,0 +1,12 @@
1
+ import type { AppIdentity } from '../types.js';
2
+ /**
3
+ * 身份块在 `app` 上的存放键(Symbol,**不进公共契约**)。
4
+ *
5
+ * `defineServer({ app })` 的身份块只属于定义产物;`middlewares` / `routers` 的 ctx 里没有它
6
+ * (可见性按需收窄),框架内置单元(`auth` 权限自注册 / `rateLimit` 前缀)需要 `service` /
7
+ * `version` 时从这里读。
8
+ */
9
+ export declare const SERVER_IDENTITY: unique symbol;
10
+ export declare function attachServerIdentity(app: unknown, identity: AppIdentity): void;
11
+ export declare function readServerIdentity(app: unknown): AppIdentity | undefined;
12
+ //# sourceMappingURL=identity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../source/app/core/identity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,eAAwC,CAAA;AAEpE,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,GAAG,IAAI,CAE9E;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,WAAW,GAAG,SAAS,CAExE"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * 身份块在 `app` 上的存放键(Symbol,**不进公共契约**)。
3
+ *
4
+ * `defineServer({ app })` 的身份块只属于定义产物;`middlewares` / `routers` 的 ctx 里没有它
5
+ * (可见性按需收窄),框架内置单元(`auth` 权限自注册 / `rateLimit` 前缀)需要 `service` /
6
+ * `version` 时从这里读。
7
+ */
8
+ export const SERVER_IDENTITY = Symbol.for('taicode.server/identity');
9
+ export function attachServerIdentity(app, identity) {
10
+ Object.defineProperty(app, SERVER_IDENTITY, { value: identity, enumerable: false, configurable: true });
11
+ }
12
+ export function readServerIdentity(app) {
13
+ return app?.[SERVER_IDENTITY];
14
+ }
@@ -0,0 +1,44 @@
1
+ import type { ErrorClassifier } from './response.js';
2
+ import type { ConfigEnv } from '../env.js';
3
+ import type { AppIdentity } from '../types.js';
4
+ import type { FastifyInstance } from 'fastify';
5
+ export { registerCookie, resolveCookieNames, resolveCookieDomain } from './cookie.js';
6
+ export { registerResponse, createSuccessResponse, createErrorResponse } from './response.js';
7
+ export { registerOpenApi, DOC_ROUTE_PREFIX, DOC_SPEC_ROUTE } from './openapi.js';
8
+ export { registerRequestId, REQUEST_ID_HEADER, REQUEST_ID_LOG_LABEL } from './request-id.js';
9
+ export { createLoggerOptions, LOG_REDACT_PATHS } from './logging.js';
10
+ export { SERVER_IDENTITY, attachServerIdentity, readServerIdentity } from './identity.js';
11
+ export type { AuthCookieOptions, CookieCoreOptions } from './cookie.js';
12
+ export type { ResponseCoreOptions, ResponseEnvelope } from './response.js';
13
+ export type { OpenApiCoreOptions } from './openapi.js';
14
+ /**
15
+ * core `schema`(设计 §5.1)——**框架内置、锁定、不可替换/修改**。
16
+ *
17
+ * 装配 `fastify-type-provider-zod` 的 validator / serializer compiler;响应 schema 由框架统一
18
+ * 生成(业务侧用 `../schema/index.js` 的 `responseSchema`)。
19
+ */
20
+ export declare function registerSchema(app: FastifyInstance): void;
21
+ /**
22
+ * core 步骤 `createFastify`(`prepare`)。
23
+ *
24
+ * **总是**建 pino logger(level = `LOG_LEVEL`,默认 `info`) + 内置 `requestId`(入站 `x-request-id`
25
+ * 复用 / `randomUUID`,日志字段 `requestId`)。`trustProxy: true` 与四家现状一致。
26
+ */
27
+ export declare function createFastify(env: ConfigEnv): FastifyInstance;
28
+ /** core 装配入参 */
29
+ export interface CoreRegistrationOptions {
30
+ /** 身份块(`service` / `title` / `version`):openapi + 内置单元从这里读 */
31
+ identity: AppIdentity;
32
+ env: ConfigEnv;
33
+ /** 数据层错误分类(资源包提供;缺省 = 落 `UNKNOWN_ERROR`) */
34
+ classifyError?: ErrorClassifier;
35
+ /** 取**已加载**配置中某个键的访问器(cookie domain 等**惰性**取值;不得在构造期调用) */
36
+ readConfig: (key: string) => unknown;
37
+ }
38
+ /**
39
+ * core 装配:`schema` → `cookie` → `response` → `openapi` → 路由注册表。
40
+ * `requestId` 的响应回吐 hook 一并注册。**构造期不读配置**(`cookie` 的 domain 在请求期惰性读取),
41
+ * 故出 spec 路径(`readConfig` 不可用)不会触发。
42
+ */
43
+ export declare function registerCore(app: FastifyInstance, options: CoreRegistrationOptions): Promise<void>;
44
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../source/app/core/index.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AACrF,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AAC5F,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAChF,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAC5F,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AACpE,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAEzF,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AACvE,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAC1E,YAAY,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAEtD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI,CAMzD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,SAAS,GAAG,eAAe,CAM7D;AAED,gBAAgB;AAChB,MAAM,WAAW,uBAAuB;IACtC,8DAA8D;IAC9D,QAAQ,EAAE,WAAW,CAAA;IACrB,GAAG,EAAE,SAAS,CAAA;IACd,4CAA4C;IAC5C,aAAa,CAAC,EAAE,eAAe,CAAA;IAC/B,2DAA2D;IAC3D,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAA;CACrC;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,GAAG,EAAE,eAAe,EAAE,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAaxG"}
@@ -0,0 +1,57 @@
1
+ import Fastify from 'fastify';
2
+ import { serializerCompiler, validatorCompiler } from 'fastify-type-provider-zod';
3
+ import { installRegisteredOperations } from '../permission-operations.js';
4
+ import { registerCookie } from './cookie.js';
5
+ import { attachServerIdentity } from './identity.js';
6
+ import { createLoggerOptions } from './logging.js';
7
+ import { registerOpenApi } from './openapi.js';
8
+ import { createRequestIdOptions, registerRequestId } from './request-id.js';
9
+ import { registerResponse } from './response.js';
10
+ export { registerCookie, resolveCookieNames, resolveCookieDomain } from './cookie.js';
11
+ export { registerResponse, createSuccessResponse, createErrorResponse } from './response.js';
12
+ export { registerOpenApi, DOC_ROUTE_PREFIX, DOC_SPEC_ROUTE } from './openapi.js';
13
+ export { registerRequestId, REQUEST_ID_HEADER, REQUEST_ID_LOG_LABEL } from './request-id.js';
14
+ export { createLoggerOptions, LOG_REDACT_PATHS } from './logging.js';
15
+ export { SERVER_IDENTITY, attachServerIdentity, readServerIdentity } from './identity.js';
16
+ /**
17
+ * core `schema`(设计 §5.1)——**框架内置、锁定、不可替换/修改**。
18
+ *
19
+ * 装配 `fastify-type-provider-zod` 的 validator / serializer compiler;响应 schema 由框架统一
20
+ * 生成(业务侧用 `../schema/index.js` 的 `responseSchema`)。
21
+ */
22
+ export function registerSchema(app) {
23
+ app.setValidatorCompiler(validatorCompiler);
24
+ app.setSerializerCompiler(serializerCompiler);
25
+ }
26
+ /**
27
+ * core 步骤 `createFastify`(`prepare`)。
28
+ *
29
+ * **总是**建 pino logger(level = `LOG_LEVEL`,默认 `info`) + 内置 `requestId`(入站 `x-request-id`
30
+ * 复用 / `randomUUID`,日志字段 `requestId`)。`trustProxy: true` 与四家现状一致。
31
+ */
32
+ export function createFastify(env) {
33
+ return Fastify({
34
+ trustProxy: true,
35
+ logger: createLoggerOptions(env),
36
+ ...createRequestIdOptions(),
37
+ });
38
+ }
39
+ /**
40
+ * core 装配:`schema` → `cookie` → `response` → `openapi` → 路由注册表。
41
+ * `requestId` 的响应回吐 hook 一并注册。**构造期不读配置**(`cookie` 的 domain 在请求期惰性读取),
42
+ * 故出 spec 路径(`readConfig` 不可用)不会触发。
43
+ */
44
+ export async function registerCore(app, options) {
45
+ attachServerIdentity(app, options.identity);
46
+ registerSchema(app); // schema → zod compiler
47
+ registerCookie(app, { env: options.env, readConfig: options.readConfig });
48
+ registerResponse(app, { classifyError: options.classifyError });
49
+ // await:确定性冲刷插件队列,保证 swagger 的 root `onRoute` 钩子在路由注册之前就位
50
+ await registerOpenApi(app, {
51
+ title: options.identity.title,
52
+ version: options.identity.version,
53
+ });
54
+ // 路由注册表:在 routers 阶段之前挂 root `onRoute`,供 `auth` 权限自注册读取(与 swagger 解耦)
55
+ installRegisteredOperations(app);
56
+ registerRequestId(app); // 响应回吐 x-request-id
57
+ }
@@ -0,0 +1,13 @@
1
+ import type { ConfigEnv } from '../env.js';
2
+ import type { FastifyServerOptions } from 'fastify';
3
+ /**
4
+ * core `logging`(设计 §5.1)——**框架内置、锁定、不可替换/修改**。
5
+ *
6
+ * `createFastify` **总是**建 pino logger(级别取 `LOG_LEVEL`,默认 `info`);原 `logging: false`
7
+ * 开关随 `CoreOptions` 一并删除,日志始终开启,不再由 `debug` 控制。
8
+ */
9
+ /** 默认 `redact` 路径(设计 §5.1) */
10
+ export declare const LOG_REDACT_PATHS: readonly ["authorization", "cookie", "set-cookie", "req.headers.authorization", "req.headers.cookie", "*.token", "*.password", "*.secretKey", "*.secretValue"];
11
+ /** 构造 Fastify 的 logger 选项 */
12
+ export declare function createLoggerOptions(env: ConfigEnv): FastifyServerOptions['logger'];
13
+ //# sourceMappingURL=logging.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../../source/app/core/logging.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAEnD;;;;;GAKG;AAEH,8BAA8B;AAC9B,eAAO,MAAM,gBAAgB,gKAUnB,CAAA;AAEV,6BAA6B;AAC7B,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,SAAS,GAAG,oBAAoB,CAAC,QAAQ,CAAC,CAQlF"}
@@ -0,0 +1,29 @@
1
+ import { DEFAULT_LOG_LEVEL } from '../env.js';
2
+ /**
3
+ * core `logging`(设计 §5.1)——**框架内置、锁定、不可替换/修改**。
4
+ *
5
+ * `createFastify` **总是**建 pino logger(级别取 `LOG_LEVEL`,默认 `info`);原 `logging: false`
6
+ * 开关随 `CoreOptions` 一并删除,日志始终开启,不再由 `debug` 控制。
7
+ */
8
+ /** 默认 `redact` 路径(设计 §5.1) */
9
+ export const LOG_REDACT_PATHS = [
10
+ 'authorization',
11
+ 'cookie',
12
+ 'set-cookie',
13
+ 'req.headers.authorization',
14
+ 'req.headers.cookie',
15
+ '*.token',
16
+ '*.password',
17
+ '*.secretKey',
18
+ '*.secretValue',
19
+ ];
20
+ /** 构造 Fastify 的 logger 选项 */
21
+ export function createLoggerOptions(env) {
22
+ return {
23
+ level: env.LOG_LEVEL || DEFAULT_LOG_LEVEL,
24
+ redact: {
25
+ paths: [...LOG_REDACT_PATHS],
26
+ censor: '[Redacted]',
27
+ },
28
+ };
29
+ }
@@ -0,0 +1,17 @@
1
+ import type { FastifyInstance } from 'fastify';
2
+ /**
3
+ * core `openapi`(设计 §5.1)——**框架内置、锁定、不可替换/修改**。
4
+ *
5
+ * `@fastify/swagger` + `@scalar/fastify-api-reference`;`/reference` 与 `/reference/openapi.json`;
6
+ * `servers: [{ url: '/' }]`(构建期不依赖 env / DB);`version` 取 `app.version`(必填,无默认);
7
+ * `securitySchemes.bearerAuth`;`onListen` 打印实际地址。
8
+ */
9
+ export declare const DOC_ROUTE_PREFIX = "/reference";
10
+ export declare const DOC_SPEC_ROUTE = "/reference/openapi.json";
11
+ export declare const OPENAPI_SPEC_VERSION = "3.0.3";
12
+ export interface OpenApiCoreOptions {
13
+ title: string;
14
+ version: string;
15
+ }
16
+ export declare function registerOpenApi(app: FastifyInstance, options: OpenApiCoreOptions): Promise<void>;
17
+ //# sourceMappingURL=openapi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../../source/app/core/openapi.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C;;;;;;GAMG;AAEH,eAAO,MAAM,gBAAgB,eAAe,CAAA;AAC5C,eAAO,MAAM,cAAc,4BAA4B,CAAA;AACvD,eAAO,MAAM,oBAAoB,UAAU,CAAA;AAE3C,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,wBAAsB,eAAe,CAAC,GAAG,EAAE,eAAe,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CA+BtG"}
@@ -0,0 +1,42 @@
1
+ import scalar from '@scalar/fastify-api-reference';
2
+ import swagger from '@fastify/swagger';
3
+ import { createJsonSchemaTransform } from 'fastify-type-provider-zod';
4
+ /**
5
+ * core `openapi`(设计 §5.1)——**框架内置、锁定、不可替换/修改**。
6
+ *
7
+ * `@fastify/swagger` + `@scalar/fastify-api-reference`;`/reference` 与 `/reference/openapi.json`;
8
+ * `servers: [{ url: '/' }]`(构建期不依赖 env / DB);`version` 取 `app.version`(必填,无默认);
9
+ * `securitySchemes.bearerAuth`;`onListen` 打印实际地址。
10
+ */
11
+ export const DOC_ROUTE_PREFIX = '/reference';
12
+ export const DOC_SPEC_ROUTE = '/reference/openapi.json';
13
+ export const OPENAPI_SPEC_VERSION = '3.0.3';
14
+ export async function registerOpenApi(app, options) {
15
+ app.register(swagger, {
16
+ openapi: {
17
+ openapi: OPENAPI_SPEC_VERSION,
18
+ info: {
19
+ title: options.title,
20
+ version: options.version,
21
+ },
22
+ // 构建期不依赖 env / DB(设计 §5.1 / §3.2 规则 A/B)
23
+ servers: [{ url: '/' }],
24
+ components: {
25
+ securitySchemes: {
26
+ bearerAuth: { type: 'http', scheme: 'bearer' },
27
+ },
28
+ },
29
+ security: [{ bearerAuth: [] }],
30
+ },
31
+ transform: createJsonSchemaTransform({ skipList: [] }),
32
+ });
33
+ app.register(scalar, { routePrefix: DOC_ROUTE_PREFIX });
34
+ // 确定性冲刷插件队列:让 swagger / scalar 的插件体在**任何路由注册之前**执行完——
35
+ // @fastify/swagger 经 fastify-plugin 在 root 上挂 `onRoute` 钩子,只有它先就位,
36
+ // 后续 `routers` 阶段注册的路由才会被采集进文档。不得依赖「恰好有 cors 等其它
37
+ // `app.register` 顺带冲刷队列」这种隐式巧合(设计 §5.2 / §10-18)。
38
+ await app.after();
39
+ app.addHook('onListen', () => {
40
+ app.log.info({ docPath: DOC_SPEC_ROUTE }, '[openapi] api reference ready');
41
+ });
42
+ }
@@ -0,0 +1,36 @@
1
+ import type { FastifyInstance } from 'fastify';
2
+ /**
3
+ * core `requestId`(设计 §5.1 / §8)——**框架内置、锁定、不可替换/修改**。
4
+ *
5
+ * 入站 header(固定 `x-request-id`)存在且**非空** → 复用,否则用 `randomUUID` 写入 `request.id`;
6
+ * **响应统一回吐 `reply.header('x-request-id', request.id)`**(进日志 + 进响应 header,
7
+ * **不进响应体**);日志字段键名统一为全拼 `requestId`。
8
+ *
9
+ * 归一语义(实现裁定 §10-8):入站值 **trim 后为空**视为缺失 → 重新生成 `randomUUID`;
10
+ * 非空则 **trim 后复用**。Fastify 的 `requestIdHeader` 对**已存在**的 header 直接取用
11
+ * (`headers[name] || genReqId`),故空白串(`' '`)会原样透传、带空格的也会保留——由下面的
12
+ * `onRequest` 钩子在链路最前补齐归一,并同步 `request.id` / 日志字段 / 响应 header。
13
+ */
14
+ export declare const REQUEST_ID_HEADER = "x-request-id";
15
+ export declare const REQUEST_ID_LOG_LABEL = "requestId";
16
+ /** 归一化入站 header 值(设计 §5.1):数组取首个;**trim 后为空视为缺失**(返回 `undefined`) */
17
+ export declare function normalizeInboundRequestId(inbound: string | string[] | undefined): string | undefined;
18
+ /** 传给 `Fastify()` 的 requestId 相关选项 */
19
+ export declare function createRequestIdOptions(): {
20
+ requestIdHeader: string;
21
+ requestIdLogLabel: string;
22
+ genReqId: (request: {
23
+ headers: Record<string, string | string[] | undefined>;
24
+ }) => string;
25
+ };
26
+ /**
27
+ * 注册 `requestId` 钩子(设计 §5.1 / §8):
28
+ *
29
+ * ① `onRequest` 归一化入站 `x-request-id`——`trim` 后为空 → 重新 `randomUUID`,非空 → `trim` 后复用。
30
+ * ② `onSend` 响应统一回吐 `x-request-id`(进日志 + 进响应 header,**不进响应体**)。
31
+ *
32
+ * Fastify 在 `onRequest` **之前**已用原始值建好 child logger,故归一后须重绑日志,才能保证
33
+ * 入口 `request.id`、日志字段 `requestId`、响应 header 三处一致。
34
+ */
35
+ export declare function registerRequestId(app: FastifyInstance): void;
36
+ //# sourceMappingURL=request-id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request-id.d.ts","sourceRoot":"","sources":["../../../source/app/core/request-id.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,iBAAiB,iBAAiB,CAAA;AAC/C,eAAO,MAAM,oBAAoB,cAAc,CAAA;AAE/C,qEAAqE;AACrE,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAOpG;AAED,sCAAsC;AACtC,wBAAgB,sBAAsB,IAAI;IACxC,eAAe,EAAE,MAAM,CAAA;IACvB,iBAAiB,EAAE,MAAM,CAAA;IACzB,QAAQ,EAAE,CAAC,OAAO,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,CAAA;KAAE,KAAK,MAAM,CAAA;CAC1F,CAOA;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI,CAwB5D"}
@@ -0,0 +1,66 @@
1
+ import { randomUUID } from 'node:crypto';
2
+ /**
3
+ * core `requestId`(设计 §5.1 / §8)——**框架内置、锁定、不可替换/修改**。
4
+ *
5
+ * 入站 header(固定 `x-request-id`)存在且**非空** → 复用,否则用 `randomUUID` 写入 `request.id`;
6
+ * **响应统一回吐 `reply.header('x-request-id', request.id)`**(进日志 + 进响应 header,
7
+ * **不进响应体**);日志字段键名统一为全拼 `requestId`。
8
+ *
9
+ * 归一语义(实现裁定 §10-8):入站值 **trim 后为空**视为缺失 → 重新生成 `randomUUID`;
10
+ * 非空则 **trim 后复用**。Fastify 的 `requestIdHeader` 对**已存在**的 header 直接取用
11
+ * (`headers[name] || genReqId`),故空白串(`' '`)会原样透传、带空格的也会保留——由下面的
12
+ * `onRequest` 钩子在链路最前补齐归一,并同步 `request.id` / 日志字段 / 响应 header。
13
+ */
14
+ export const REQUEST_ID_HEADER = 'x-request-id';
15
+ export const REQUEST_ID_LOG_LABEL = 'requestId';
16
+ /** 归一化入站 header 值(设计 §5.1):数组取首个;**trim 后为空视为缺失**(返回 `undefined`) */
17
+ export function normalizeInboundRequestId(inbound) {
18
+ const value = Array.isArray(inbound) ? inbound[0] : inbound;
19
+ if (typeof value !== 'string') {
20
+ return undefined;
21
+ }
22
+ const trimmed = value.trim();
23
+ return trimmed === '' ? undefined : trimmed;
24
+ }
25
+ /** 传给 `Fastify()` 的 requestId 相关选项 */
26
+ export function createRequestIdOptions() {
27
+ return {
28
+ requestIdHeader: REQUEST_ID_HEADER,
29
+ requestIdLogLabel: REQUEST_ID_LOG_LABEL,
30
+ // Fastify 仅在「入站 header 缺失 / 为空串」时调用它(空白串为真值,走 `requestIdHeader` 短路)
31
+ genReqId: (request) => normalizeInboundRequestId(request.headers[REQUEST_ID_HEADER]) ?? randomUUID(),
32
+ };
33
+ }
34
+ /**
35
+ * 注册 `requestId` 钩子(设计 §5.1 / §8):
36
+ *
37
+ * ① `onRequest` 归一化入站 `x-request-id`——`trim` 后为空 → 重新 `randomUUID`,非空 → `trim` 后复用。
38
+ * ② `onSend` 响应统一回吐 `x-request-id`(进日志 + 进响应 header,**不进响应体**)。
39
+ *
40
+ * Fastify 在 `onRequest` **之前**已用原始值建好 child logger,故归一后须重绑日志,才能保证
41
+ * 入口 `request.id`、日志字段 `requestId`、响应 header 三处一致。
42
+ */
43
+ export function registerRequestId(app) {
44
+ app.addHook('onRequest', (request, reply, done) => {
45
+ const inbound = request.headers[REQUEST_ID_HEADER];
46
+ if (inbound === undefined) {
47
+ // 缺失:`genReqId` 已生成 `randomUUID`
48
+ done();
49
+ return;
50
+ }
51
+ const normalized = normalizeInboundRequestId(inbound) ?? randomUUID();
52
+ if (normalized !== request.id) {
53
+ request.id = normalized;
54
+ // 从根 logger 重建(而非在原 child 上再 child,避免 JSON 出现重复 `requestId` 键),
55
+ // 效果等同「入站 header 一开始就是干净值」;请求侧与响应侧同步,保证三处一致。
56
+ const log = request.server.log.child({ [REQUEST_ID_LOG_LABEL]: normalized });
57
+ request.log = log;
58
+ reply.log = log;
59
+ }
60
+ done();
61
+ });
62
+ app.addHook('onSend', (request, reply, payload, done) => {
63
+ reply.header(REQUEST_ID_HEADER, request.id);
64
+ done(null, payload);
65
+ });
66
+ }
@@ -0,0 +1,41 @@
1
+ import { SystemError } from '../errors.js';
2
+ import type { FastifyInstance } from 'fastify';
3
+ /**
4
+ * core `response`(设计 §5.1 / §8,错误契约 D7)——**框架内置、锁定、不可替换/修改**。
5
+ *
6
+ * - 成功信封 `{ status: 'SUCCESS', message: 'ok', data }`(由 `preSerialization` 统一包裹)。
7
+ * - 错误信封 `{ status: <错误码字符串>, message, data: null }`。
8
+ * - `setErrorHandler` 固定分支:`UserError`→400(`error.status` 字面量)/ `SystemError`→500 /
9
+ * zod→400 / serde→500 / 数据层(资源包的 `classifyError`)→500 / 未知→500;**禁止按 `error.type` 细分**。
10
+ * - `setNotFoundHandler` → 404 + `NOT_IMPLEMENTED`(落 `warn`,文案对齐 expense/notice)。
11
+ * - 错误日志分级:`UserError` / zod → `warn`,其余 → `error`(带 stack)。
12
+ * - **错误只给稳定码**(`status` 放错误码字符串),文案不归框架(由前端 / i18n 决定,§10-6)。
13
+ */
14
+ export declare const SUCCESS_STATUS = "SUCCESS";
15
+ export declare const NOT_IMPLEMENTED_STATUS = "NOT_IMPLEMENTED";
16
+ export declare const INVALID_INPUT_STATUS = "INVALID_INPUT";
17
+ export declare const SERIALIZATION_ERROR_STATUS = "RESPONSE_SERIALIZATION_ERROR";
18
+ export declare const UNKNOWN_ERROR_STATUS = "UNKNOWN_ERROR";
19
+ /** 通用兜底文案(仅在 `error.message` 为空时使用) */
20
+ export declare const DEFAULT_USER_MESSAGE = "\u8BF7\u6C42\u5931\u8D25";
21
+ export declare const DEFAULT_SYSTEM_MESSAGE = "\u7CFB\u7EDF\u9519\u8BEF";
22
+ export interface ResponseEnvelope<T> {
23
+ status: string;
24
+ message: string;
25
+ data: T;
26
+ }
27
+ export declare function createSuccessResponse<T>(data: T): ResponseEnvelope<T>;
28
+ export declare function createErrorResponse(status: string, message: string): ResponseEnvelope<null>;
29
+ /**
30
+ * 数据层错误分类器(资源包里带 `classifyError` 的值的裸函数形态)。
31
+ *
32
+ * 资源包(`resources` 槽位返回值)里任何提供 `classifyError` 的值都会被用作响应错误分类;
33
+ * 都没有时错误落 `UNKNOWN_ERROR` 兜底。
34
+ */
35
+ export type ErrorClassifier = (error: unknown) => SystemError | null;
36
+ export interface ResponseCoreOptions {
37
+ /** Prisma / 数据层错误分类(缺省 = 不做数据层分类) */
38
+ classifyError?: ErrorClassifier;
39
+ }
40
+ export declare function registerResponse(app: FastifyInstance, options?: ResponseCoreOptions): void;
41
+ //# sourceMappingURL=response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../source/app/core/response.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAa,MAAM,cAAc,CAAA;AAErD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,cAAc,YAAY,CAAA;AACvC,eAAO,MAAM,sBAAsB,oBAAoB,CAAA;AACvD,eAAO,MAAM,oBAAoB,kBAAkB,CAAA;AACnD,eAAO,MAAM,0BAA0B,iCAAiC,CAAA;AACxE,eAAO,MAAM,oBAAoB,kBAAkB,CAAA;AAEnD,uCAAuC;AACvC,eAAO,MAAM,oBAAoB,6BAAS,CAAA;AAC1C,eAAO,MAAM,sBAAsB,6BAAS,CAAA;AAE5C,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,CAAC,CAAA;CACR;AAED,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAErE;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAE3F;AAsBD;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,OAAO,KAAK,WAAW,GAAG,IAAI,CAAA;AAEpE,MAAM,WAAW,mBAAmB;IAClC,qCAAqC;IACrC,aAAa,CAAC,EAAE,eAAe,CAAA;CAChC;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,eAAe,EAAE,OAAO,GAAE,mBAAwB,GAAG,IAAI,CAyD9F"}
@@ -0,0 +1,89 @@
1
+ import { hasZodFastifySchemaValidationErrors, isResponseSerializationError } from 'fastify-type-provider-zod';
2
+ import { SystemError, UserError } from '../errors.js';
3
+ /**
4
+ * core `response`(设计 §5.1 / §8,错误契约 D7)——**框架内置、锁定、不可替换/修改**。
5
+ *
6
+ * - 成功信封 `{ status: 'SUCCESS', message: 'ok', data }`(由 `preSerialization` 统一包裹)。
7
+ * - 错误信封 `{ status: <错误码字符串>, message, data: null }`。
8
+ * - `setErrorHandler` 固定分支:`UserError`→400(`error.status` 字面量)/ `SystemError`→500 /
9
+ * zod→400 / serde→500 / 数据层(资源包的 `classifyError`)→500 / 未知→500;**禁止按 `error.type` 细分**。
10
+ * - `setNotFoundHandler` → 404 + `NOT_IMPLEMENTED`(落 `warn`,文案对齐 expense/notice)。
11
+ * - 错误日志分级:`UserError` / zod → `warn`,其余 → `error`(带 stack)。
12
+ * - **错误只给稳定码**(`status` 放错误码字符串),文案不归框架(由前端 / i18n 决定,§10-6)。
13
+ */
14
+ export const SUCCESS_STATUS = 'SUCCESS';
15
+ export const NOT_IMPLEMENTED_STATUS = 'NOT_IMPLEMENTED';
16
+ export const INVALID_INPUT_STATUS = 'INVALID_INPUT';
17
+ export const SERIALIZATION_ERROR_STATUS = 'RESPONSE_SERIALIZATION_ERROR';
18
+ export const UNKNOWN_ERROR_STATUS = 'UNKNOWN_ERROR';
19
+ /** 通用兜底文案(仅在 `error.message` 为空时使用) */
20
+ export const DEFAULT_USER_MESSAGE = '请求失败';
21
+ export const DEFAULT_SYSTEM_MESSAGE = '系统错误';
22
+ export function createSuccessResponse(data) {
23
+ return { status: SUCCESS_STATUS, message: 'ok', data };
24
+ }
25
+ export function createErrorResponse(status, message) {
26
+ return { status, message, data: null };
27
+ }
28
+ function isEnvelope(payload) {
29
+ return (typeof payload === 'object' &&
30
+ payload !== null &&
31
+ typeof payload.status === 'string' &&
32
+ typeof payload.message === 'string' &&
33
+ 'data' in payload);
34
+ }
35
+ function resolveMessage(error) {
36
+ const explicit = typeof error.message === 'string' ? error.message : '';
37
+ return explicit || DEFAULT_SYSTEM_MESSAGE;
38
+ }
39
+ export function registerResponse(app, options = {}) {
40
+ // 成功信封:统一包裹非信封载荷(错误 / 404 已自带信封,不会被二次包裹)
41
+ app.addHook('preSerialization', (_request, _reply, payload, done) => {
42
+ if (payload === undefined || payload === null || isEnvelope(payload)) {
43
+ done(null, payload);
44
+ return;
45
+ }
46
+ done(null, createSuccessResponse(payload));
47
+ });
48
+ app.setNotFoundHandler((request, reply) => {
49
+ request.log.warn({ url: request.url }, '[response] route not found');
50
+ return reply
51
+ .code(404)
52
+ .send(createErrorResponse(NOT_IMPLEMENTED_STATUS, `接口不存在:${request.method} ${request.url}`));
53
+ });
54
+ app.setErrorHandler((error, request, reply) => {
55
+ // ① UserError → 400
56
+ if (UserError.is(error)) {
57
+ request.log.warn({ err: error }, '[response] user error');
58
+ return reply.code(error.status).send(createErrorResponse(error.type, resolveMessage(error)));
59
+ }
60
+ // ② SystemError → 500
61
+ if (SystemError.is(error)) {
62
+ request.log.error({ err: error }, '[response] system error');
63
+ return reply.code(error.status).send(createErrorResponse(error.type, resolveMessage(error)));
64
+ }
65
+ // ③ zod 校验失败 → 400
66
+ if (hasZodFastifySchemaValidationErrors(error)) {
67
+ request.log.warn({ err: error }, '[response] zod validation error');
68
+ return reply.code(400).send(createErrorResponse(INVALID_INPUT_STATUS, error.message));
69
+ }
70
+ // ④ 响应序列化失败 → 500
71
+ if (isResponseSerializationError(error)) {
72
+ request.log.error({ err: error }, '[response] response serialization error');
73
+ return reply.code(500).send(createErrorResponse(SERIALIZATION_ERROR_STATUS, error.message));
74
+ }
75
+ // ⑤ 数据层(Prisma 等)分类 → 500
76
+ const databaseError = options.classifyError?.(error);
77
+ if (databaseError) {
78
+ request.log.error({ err: error }, '[response] database error');
79
+ return reply
80
+ .code(500)
81
+ .send(createErrorResponse(databaseError.type, resolveMessage(databaseError)));
82
+ }
83
+ // ⑥ 未知 → 500
84
+ request.log.error({ err: error }, '[response] unknown error');
85
+ const cause = error;
86
+ const message = typeof cause.message === 'string' && cause.message ? cause.message : DEFAULT_SYSTEM_MESSAGE;
87
+ return reply.code(500).send(createErrorResponse(UNKNOWN_ERROR_STATUS, message));
88
+ });
89
+ }
@@ -0,0 +1,32 @@
1
+ import type { ServerConfig } from './types.js';
2
+ /** #1 `resources` 看不到 `config` */
3
+ export declare function resourcesCannotSeeConfig(): void;
4
+ /** #2 `resources` 看不到 `services` */
5
+ export declare function resourcesCannotSeeServices(): void;
6
+ /** #3 `config` 看不到 `services` */
7
+ export declare function configCannotSeeServices(): void;
8
+ /** #4 `services` 看不到 `services`(禁 service 互依) */
9
+ export declare function servicesCannotSeeServices(): void;
10
+ /** #5 `routers` 看不到 `resources`(禁绕层直连数据层) */
11
+ export declare function routersCannotSeeResources(): void;
12
+ /** #6 `routers` 看不到 `config` */
13
+ export declare function routersCannotSeeConfig(): void;
14
+ /** #7 service 值声明 `dependsOn` → 该值塌成 `never` */
15
+ export declare function serviceValueCannotDeclareDependsOn(): void;
16
+ /** #8 service 值是原始类型 → 被拒(防把配置塞进 services) */
17
+ export declare function serviceValueCannotBePrimitive(): void;
18
+ /** #9 `startServer` 只接受品牌产物,裸 `ServerConfig` 编译失败 */
19
+ export declare function startServerRejectsBareConfig(bare: ServerConfig<unknown, unknown, unknown>): void;
20
+ /** #10 `app.version` 必填 */
21
+ export declare function appVersionIsRequired(): void;
22
+ /** #11 `cache: false` 静态关闭:键被 `Live<>` 从资源视图剔除 */
23
+ export declare function staticallyDisabledResourceIsRemoved(): void;
24
+ /** #12 `config` 看不到 `app` */
25
+ export declare function configCannotSeeApp(): void;
26
+ /** #13 `middlewares` 看不到 `resources`(中间件禁直连数据层) */
27
+ export declare function middlewaresCannotSeeResources(): void;
28
+ /** #14 `middlewares` 看不到 `env` */
29
+ export declare function middlewaresCannotSeeEnv(): void;
30
+ /** #15 `services` 看不到 `env`(服务层禁读 env) */
31
+ export declare function servicesCannotSeeEnv(): void;
32
+ //# sourceMappingURL=define-server.negative-cases.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define-server.negative-cases.d.ts","sourceRoot":"","sources":["../../source/app/define-server.negative-cases.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAgB9C,kCAAkC;AAClC,wBAAgB,wBAAwB,IAAI,IAAI,CAU/C;AAED,oCAAoC;AACpC,wBAAgB,0BAA0B,IAAI,IAAI,CAUjD;AAED,iCAAiC;AACjC,wBAAgB,uBAAuB,IAAI,IAAI,CAa9C;AAED,iDAAiD;AACjD,wBAAgB,yBAAyB,IAAI,IAAI,CAahD;AAED,6CAA6C;AAC7C,wBAAgB,yBAAyB,IAAI,IAAI,CAYhD;AAED,gCAAgC;AAChC,wBAAgB,sBAAsB,IAAI,IAAI,CAY7C;AAED,gDAAgD;AAChD,wBAAgB,kCAAkC,IAAI,IAAI,CAUzD;AAED,8CAA8C;AAC9C,wBAAgB,6BAA6B,IAAI,IAAI,CAUpD;AAED,qDAAqD;AACrD,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,IAAI,CAGhG;AAED,2BAA2B;AAC3B,wBAAgB,oBAAoB,IAAI,IAAI,CAU3C;AAED,kDAAkD;AAClD,wBAAgB,mCAAmC,IAAI,IAAI,CAa1D;AAED,6BAA6B;AAC7B,wBAAgB,kBAAkB,IAAI,IAAI,CAazC;AAED,mDAAmD;AACnD,wBAAgB,6BAA6B,IAAI,IAAI,CAapD;AAED,kCAAkC;AAClC,wBAAgB,uBAAuB,IAAI,IAAI,CAa9C;AAED,0CAA0C;AAC1C,wBAAgB,oBAAoB,IAAI,IAAI,CAa3C"}