@adaptivestone/framework 5.0.0-beta.45 → 5.0.0-beta.48

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 (110) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/codegen/appTypes.d.ts +19 -0
  3. package/dist/codegen/appTypes.js +49 -0
  4. package/dist/codegen/appTypes.js.map +1 -0
  5. package/dist/codegen/collectMetadata.d.ts +39 -0
  6. package/dist/codegen/collectMetadata.js +59 -0
  7. package/dist/codegen/collectMetadata.js.map +1 -0
  8. package/dist/codegen/emit.d.ts +29 -0
  9. package/dist/codegen/emit.js +247 -0
  10. package/dist/codegen/emit.js.map +1 -0
  11. package/dist/codegen/index.d.ts +16 -0
  12. package/dist/codegen/index.js +18 -0
  13. package/dist/codegen/index.js.map +1 -0
  14. package/dist/codegen/routeTypes.d.ts +13 -0
  15. package/dist/codegen/routeTypes.js +126 -0
  16. package/dist/codegen/routeTypes.js.map +1 -0
  17. package/dist/commands/GenerateTypes.d.ts +0 -4
  18. package/dist/commands/GenerateTypes.js +4 -42
  19. package/dist/commands/GenerateTypes.js.map +1 -1
  20. package/dist/controllers/Auth.d.ts +15 -124
  21. package/dist/controllers/Auth.js.map +1 -1
  22. package/dist/controllers/Auth.routes.gen.d.ts +57 -0
  23. package/dist/controllers/Auth.routes.gen.js +10 -0
  24. package/dist/controllers/Auth.routes.gen.js.map +1 -0
  25. package/dist/controllers/Home.routes.gen.d.ts +14 -0
  26. package/dist/controllers/Home.routes.gen.js +10 -0
  27. package/dist/controllers/Home.routes.gen.js.map +1 -0
  28. package/dist/controllers/index.d.ts +23 -3
  29. package/dist/controllers/index.js +355 -8
  30. package/dist/controllers/index.js.map +1 -1
  31. package/dist/helpers/files.js +2 -0
  32. package/dist/helpers/files.js.map +1 -1
  33. package/dist/models/Sequence.js +1 -1
  34. package/dist/models/Sequence.js.map +1 -1
  35. package/dist/models/User.d.ts +28 -28
  36. package/dist/models/UserOld.d.ts +16 -6
  37. package/dist/modules/AbstractController.d.ts +7 -29
  38. package/dist/modules/AbstractController.js +1 -253
  39. package/dist/modules/AbstractController.js.map +1 -1
  40. package/dist/server.d.ts +0 -1
  41. package/dist/server.js +11 -1
  42. package/dist/server.js.map +1 -1
  43. package/dist/services/http/HttpServer.d.ts +9 -0
  44. package/dist/services/http/HttpServer.js +20 -9
  45. package/dist/services/http/HttpServer.js.map +1 -1
  46. package/dist/services/http/middleware/AbstractMiddleware.d.ts +19 -4
  47. package/dist/services/http/middleware/AbstractMiddleware.js +16 -5
  48. package/dist/services/http/middleware/AbstractMiddleware.js.map +1 -1
  49. package/dist/services/http/middleware/GetUserByToken.d.ts +9 -0
  50. package/dist/services/http/middleware/GetUserByToken.js +9 -0
  51. package/dist/services/http/middleware/GetUserByToken.js.map +1 -1
  52. package/dist/services/http/middleware/Pagination.d.ts +1 -0
  53. package/dist/services/http/middleware/Pagination.js +3 -0
  54. package/dist/services/http/middleware/Pagination.js.map +1 -1
  55. package/dist/services/http/routing/ExpressAdapter.d.ts +12 -0
  56. package/dist/services/http/routing/ExpressAdapter.js +93 -0
  57. package/dist/services/http/routing/ExpressAdapter.js.map +1 -0
  58. package/dist/services/http/routing/RouteNode.d.ts +99 -0
  59. package/dist/services/http/routing/RouteNode.js +21 -0
  60. package/dist/services/http/routing/RouteNode.js.map +1 -0
  61. package/dist/services/http/routing/RouteRegistry.d.ts +37 -0
  62. package/dist/services/http/routing/RouteRegistry.js +207 -0
  63. package/dist/services/http/routing/RouteRegistry.js.map +1 -0
  64. package/dist/services/http/routing/formatTree.d.ts +23 -0
  65. package/dist/services/http/routing/formatTree.js +158 -0
  66. package/dist/services/http/routing/formatTree.js.map +1 -0
  67. package/dist/services/http/routing/match.d.ts +30 -0
  68. package/dist/services/http/routing/match.js +128 -0
  69. package/dist/services/http/routing/match.js.map +1 -0
  70. package/dist/services/http/routing/middlewareNormalization.d.ts +16 -0
  71. package/dist/services/http/routing/middlewareNormalization.js +28 -0
  72. package/dist/services/http/routing/middlewareNormalization.js.map +1 -0
  73. package/dist/services/http/types.d.ts +74 -0
  74. package/dist/services/http/types.js +8 -0
  75. package/dist/services/http/types.js.map +1 -0
  76. package/dist/services/validate/ValidateService.d.ts +46 -23
  77. package/dist/services/validate/ValidateService.js +101 -74
  78. package/dist/services/validate/ValidateService.js.map +1 -1
  79. package/dist/services/validate/ValidationError.d.ts +35 -0
  80. package/dist/services/validate/ValidationError.js +77 -0
  81. package/dist/services/validate/ValidationError.js.map +1 -0
  82. package/dist/services/validate/drivers/StandardSchemaDriver.d.ts +15 -0
  83. package/dist/services/validate/drivers/StandardSchemaDriver.js +34 -0
  84. package/dist/services/validate/drivers/StandardSchemaDriver.js.map +1 -0
  85. package/dist/services/validate/drivers/YupDriver.d.ts +21 -0
  86. package/dist/services/validate/drivers/YupDriver.js +66 -0
  87. package/dist/services/validate/drivers/YupDriver.js.map +1 -0
  88. package/dist/services/validate/types.d.ts +104 -0
  89. package/dist/services/validate/types.js +11 -0
  90. package/dist/services/validate/types.js.map +1 -0
  91. package/dist/tests/testHelpers.d.ts +18 -16
  92. package/package.json +17 -8
  93. package/dist/commands/Documentation.d.ts +0 -5
  94. package/dist/commands/Documentation.js +0 -15
  95. package/dist/commands/Documentation.js.map +0 -1
  96. package/dist/commands/GetOpenApiJson.d.ts +0 -17
  97. package/dist/commands/GetOpenApiJson.js +0 -272
  98. package/dist/commands/GetOpenApiJson.js.map +0 -1
  99. package/dist/services/documentation/DocumentationGenerator.d.ts +0 -11
  100. package/dist/services/documentation/DocumentationGenerator.js +0 -130
  101. package/dist/services/documentation/DocumentationGenerator.js.map +0 -1
  102. package/dist/services/validate/drivers/AbstractValidator.d.ts +0 -14
  103. package/dist/services/validate/drivers/AbstractValidator.js +0 -29
  104. package/dist/services/validate/drivers/AbstractValidator.js.map +0 -1
  105. package/dist/services/validate/drivers/CustomValidator.d.ts +0 -14
  106. package/dist/services/validate/drivers/CustomValidator.js +0 -48
  107. package/dist/services/validate/drivers/CustomValidator.js.map +0 -1
  108. package/dist/services/validate/drivers/YupValidator.d.ts +0 -13
  109. package/dist/services/validate/drivers/YupValidator.js +0 -86
  110. package/dist/services/validate/drivers/YupValidator.js.map +0 -1
@@ -0,0 +1,66 @@
1
+ import { ValidationError } from "../ValidationError.js";
2
+ /**
3
+ * Yup-vendor driver. Handles `body['~standard'].vendor === 'yup'`.
4
+ *
5
+ * Two yup-specific behaviors that the generic Standard Schema driver
6
+ * doesn't cover:
7
+ *
8
+ * 1. **Strip unknown.** Yup's `~standard.validate(data)` does NOT strip
9
+ * unknown fields. Today's framework calls `cast(data, {stripUnknown: true})`
10
+ * explicitly. To preserve that behavior — and avoid a security
11
+ * regression in handlers that spread `req.appInfo.request` into
12
+ * `Model.create(...)` — this driver calls yup's native validate with
13
+ * `{ stripUnknown: true, abortEarly: false }` directly. One call:
14
+ * validates + casts + strips, throws on issues.
15
+ *
16
+ * 2. **Error translation.** Yup throws its own `ValidationError` with
17
+ * `.inner[]` (one entry per failed field) and `.errors[]` (messages).
18
+ * We translate to the framework's `ValidationError` via duck-typing
19
+ * (no top-level yup import — keeps the framework runtime decoupled).
20
+ */
21
+ export const yupDriver = {
22
+ canHandle(body) {
23
+ return (typeof body === 'object' &&
24
+ body !== null &&
25
+ '~standard' in body &&
26
+ body['~standard']?.vendor === 'yup');
27
+ },
28
+ async validate(body, data) {
29
+ try {
30
+ return await body.validate(data, {
31
+ stripUnknown: true,
32
+ abortEarly: false,
33
+ });
34
+ }
35
+ catch (e) {
36
+ if (isYupValidationError(e)) {
37
+ throw fromYupError(e);
38
+ }
39
+ throw e;
40
+ }
41
+ },
42
+ toJsonSchema() {
43
+ return null;
44
+ },
45
+ };
46
+ function isYupValidationError(e) {
47
+ return (typeof e === 'object' &&
48
+ e !== null &&
49
+ e.name === 'ValidationError' &&
50
+ Array.isArray(e.inner));
51
+ }
52
+ function fromYupError(e) {
53
+ const issues = [];
54
+ const inners = Array.isArray(e.inner) && e.inner.length > 0 ? e.inner : [e];
55
+ for (const inner of inners) {
56
+ const path = inner.path ? [inner.path] : undefined;
57
+ const messages = Array.isArray(inner.errors)
58
+ ? inner.errors
59
+ : [inner.message];
60
+ for (const message of messages) {
61
+ issues.push({ message, path, params: inner.params });
62
+ }
63
+ }
64
+ return new ValidationError(issues);
65
+ }
66
+ //# sourceMappingURL=YupDriver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"YupDriver.js","sourceRoot":"","sources":["../../../../src/services/validate/drivers/YupDriver.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,SAAS,GAAoB;IACxC,SAAS,CAAC,IAAa;QACrB,OAAO,CACL,OAAO,IAAI,KAAK,QAAQ;YACxB,IAAI,KAAK,IAAI;YACb,WAAW,IAAI,IAAI;YAClB,IAAyB,CAAC,WAAW,CAAC,EAAE,MAAM,KAAK,KAAK,CAC1D,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,IAAa,EAAE,IAAa;QAOzC,IAAI,CAAC;YACH,OAAO,MAAO,IAAsB,CAAC,QAAQ,CAAC,IAAI,EAAE;gBAClD,YAAY,EAAE,IAAI;gBAClB,UAAU,EAAE,KAAK;aAClB,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,CAAU,EAAE,CAAC;YACpB,IAAI,oBAAoB,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC5B,MAAM,YAAY,CAAC,CAAC,CAAC,CAAC;YACxB,CAAC;YACD,MAAM,CAAC,CAAC;QACV,CAAC;IACH,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC;AAWF,SAAS,oBAAoB,CAAC,CAAU;IACtC,OAAO,CACL,OAAO,CAAC,KAAK,QAAQ;QACrB,CAAC,KAAK,IAAI;QACT,CAAwB,CAAC,IAAI,KAAK,iBAAiB;QACpD,KAAK,CAAC,OAAO,CAAE,CAAyB,CAAC,KAAK,CAAC,CAChD,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,CAA0B;IAC9C,MAAM,MAAM,GAAsB,EAAE,CAAC;IACrC,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAE5E,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,IAAI,GAA4B,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC5E,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC;YAC1C,CAAC,CAAC,KAAK,CAAC,MAAM;YACd,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACpB,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC/B,MAAM,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;QACvD,CAAC;IACH,CAAC;IAED,OAAO,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC;AACrC,CAAC"}
@@ -0,0 +1,104 @@
1
+ /**
2
+ * Validator type contracts.
3
+ *
4
+ * Standard Schema v1 spec types are inlined from https://standardschema.dev to
5
+ * avoid a runtime dependency. Any conforming schema (yup ≥1.7, zod ≥3.24,
6
+ * valibot, arktype, ...) plugs in as a route's `request` or `query` schema.
7
+ *
8
+ * If the upstream spec evolves, mirror it here.
9
+ */
10
+ /**
11
+ * Spec interface implemented by Standard Schema-compliant validators.
12
+ */
13
+ export interface StandardSchemaV1<Input = unknown, Output = Input> {
14
+ readonly '~standard': StandardSchemaV1.Props<Input, Output>;
15
+ }
16
+ export declare namespace StandardSchemaV1 {
17
+ interface Props<Input = unknown, Output = Input> {
18
+ readonly version: 1;
19
+ readonly vendor: string;
20
+ readonly validate: (value: unknown, options?: Options | undefined) => Result<Output> | Promise<Result<Output>>;
21
+ readonly types?: Types<Input, Output> | undefined;
22
+ }
23
+ interface Options {
24
+ readonly libraryOptions?: Record<string, unknown> | undefined;
25
+ }
26
+ type Result<Output> = SuccessResult<Output> | FailureResult;
27
+ interface SuccessResult<Output> {
28
+ readonly value: Output;
29
+ readonly issues?: undefined;
30
+ }
31
+ interface FailureResult {
32
+ readonly issues: ReadonlyArray<Issue>;
33
+ }
34
+ interface Issue {
35
+ readonly message: string;
36
+ readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
37
+ }
38
+ interface PathSegment {
39
+ readonly key: PropertyKey;
40
+ }
41
+ interface Types<Input = unknown, Output = Input> {
42
+ readonly input: Input;
43
+ readonly output: Output;
44
+ }
45
+ type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema['~standard']['types']>['input'];
46
+ type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema['~standard']['types']>['output'];
47
+ }
48
+ /**
49
+ * One validation issue surfaced to the consumer. Shape mirrors
50
+ * `StandardSchemaV1.Issue` so iterating issues from a `ValidationError`
51
+ * works the same regardless of the underlying validator.
52
+ */
53
+ export interface ValidationIssue {
54
+ readonly message: string;
55
+ readonly path?: ReadonlyArray<PropertyKey | {
56
+ readonly key: PropertyKey;
57
+ }>;
58
+ /**
59
+ * Extra context for message interpolation (e.g., yup populates `min`,
60
+ * `max`, `length` for those validators). Passed to `t(message, fallback,
61
+ * params)` when the framework auto-translates so i18n placeholders
62
+ * like `{{min}}` resolve to actual values.
63
+ */
64
+ readonly params?: Record<string, unknown>;
65
+ }
66
+ /**
67
+ * Framework-owned validation error contract. The runtime class is in
68
+ * `./ValidationError.ts`. This interface is what handler catch-blocks
69
+ * (and the top-level error boundary) read to surface field-keyed
70
+ * messages back to the client.
71
+ */
72
+ export interface ValidationError extends Error {
73
+ readonly name: 'ValidationError';
74
+ readonly issues: ReadonlyArray<ValidationIssue>;
75
+ }
76
+ /**
77
+ * JSON Schema document. Loose typing; downstream consumers (e.g., an
78
+ * OpenAPI generator) refine to a stricter shape.
79
+ */
80
+ export type JsonSchema = Record<string, unknown>;
81
+ /**
82
+ * A pluggable validator driver. The framework dispatches one driver
83
+ * per route schema; drivers handle vendor-specific quirks (yup's
84
+ * `stripUnknown` post-process, native JSON Schema export, etc.).
85
+ *
86
+ * Built-in drivers live in `./drivers/`. Users register their own via
87
+ * `ValidateService.register(driver)` to support non-Standard-Schema
88
+ * validators (raw Joi, custom shapes, ...).
89
+ *
90
+ * Concerns:
91
+ * - Runtime validation + cast → `validate`
92
+ * - JSON Schema for OpenAPI → `toJsonSchema?` (optional)
93
+ * - Compile-time TS types → schema-side, not driver — see `StandardSchemaV1.InferOutput`
94
+ */
95
+ export interface ValidatorDriver {
96
+ /** Sync dispatch; should be a fast property check. */
97
+ canHandle(body: unknown): boolean;
98
+ /** Validate + cast. Returns the cast value on success; throws `ValidationError` on failure. */
99
+ validate(body: unknown, data: unknown): Promise<unknown>;
100
+ /** Optional: emit JSON Schema. Returns null when introspection isn't supported. */
101
+ toJsonSchema?(body: unknown, opts?: {
102
+ target?: 'openapi-3.0' | 'draft-07' | 'draft-2020-12';
103
+ }): JsonSchema | null;
104
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Validator type contracts.
3
+ *
4
+ * Standard Schema v1 spec types are inlined from https://standardschema.dev to
5
+ * avoid a runtime dependency. Any conforming schema (yup ≥1.7, zod ≥3.24,
6
+ * valibot, arktype, ...) plugs in as a route's `request` or `query` schema.
7
+ *
8
+ * If the upstream spec evolves, mirror it here.
9
+ */
10
+ export {};
11
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/services/validate/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
@@ -12,13 +12,13 @@ export declare const createDefaultTestUser: () => Promise<false | {
12
12
  user: import("mongoose").Document<unknown, object, {
13
13
  isVerified: boolean;
14
14
  locale: string;
15
+ createdAt?: NativeDate | null | undefined;
16
+ updatedAt?: NativeDate | null | undefined;
15
17
  name?: {
16
18
  first?: string | null | undefined;
17
19
  last?: string | null | undefined;
18
20
  nick?: string | null | undefined;
19
21
  } | null | undefined;
20
- createdAt?: NativeDate | null | undefined;
21
- updatedAt?: NativeDate | null | undefined;
22
22
  avatar?: string | null | undefined;
23
23
  password?: string | null | undefined;
24
24
  email?: string | null | undefined;
@@ -48,13 +48,13 @@ export declare const createDefaultTestUser: () => Promise<false | {
48
48
  }, {}, import("mongoose").DefaultSchemaOptions> & Omit<{
49
49
  isVerified: boolean;
50
50
  locale: string;
51
+ createdAt?: NativeDate | null | undefined;
52
+ updatedAt?: NativeDate | null | undefined;
51
53
  name?: {
52
54
  first?: string | null | undefined;
53
55
  last?: string | null | undefined;
54
56
  nick?: string | null | undefined;
55
57
  } | null | undefined;
56
- createdAt?: NativeDate | null | undefined;
57
- updatedAt?: NativeDate | null | undefined;
58
58
  avatar?: string | null | undefined;
59
59
  password?: string | null | undefined;
60
60
  email?: string | null | undefined;
@@ -100,13 +100,13 @@ export declare const createDefaultTestUser: () => Promise<false | {
100
100
  readonly sendPasswordRecoveryEmail: (this: import("mongoose").Document<unknown, {}, {
101
101
  isVerified: boolean;
102
102
  locale: string;
103
+ createdAt?: NativeDate | null | undefined;
104
+ updatedAt?: NativeDate | null | undefined;
103
105
  name?: {
104
106
  first?: string | null | undefined;
105
107
  last?: string | null | undefined;
106
108
  nick?: string | null | undefined;
107
109
  } | null | undefined;
108
- createdAt?: NativeDate | null | undefined;
109
- updatedAt?: NativeDate | null | undefined;
110
110
  avatar?: string | null | undefined;
111
111
  password?: string | null | undefined;
112
112
  email?: string | null | undefined;
@@ -136,13 +136,13 @@ export declare const createDefaultTestUser: () => Promise<false | {
136
136
  }, {}, import("mongoose").DefaultSchemaOptions> & {
137
137
  isVerified: boolean;
138
138
  locale: string;
139
+ createdAt?: NativeDate | null | undefined;
140
+ updatedAt?: NativeDate | null | undefined;
139
141
  name?: {
140
142
  first?: string | null | undefined;
141
143
  last?: string | null | undefined;
142
144
  nick?: string | null | undefined;
143
145
  } | null | undefined;
144
- createdAt?: NativeDate | null | undefined;
145
- updatedAt?: NativeDate | null | undefined;
146
146
  avatar?: string | null | undefined;
147
147
  password?: string | null | undefined;
148
148
  email?: string | null | undefined;
@@ -182,13 +182,13 @@ export declare const createDefaultTestUser: () => Promise<false | {
182
182
  readonly sendVerificationEmail: (this: import("mongoose").Document<unknown, {}, {
183
183
  isVerified: boolean;
184
184
  locale: string;
185
+ createdAt?: NativeDate | null | undefined;
186
+ updatedAt?: NativeDate | null | undefined;
185
187
  name?: {
186
188
  first?: string | null | undefined;
187
189
  last?: string | null | undefined;
188
190
  nick?: string | null | undefined;
189
191
  } | null | undefined;
190
- createdAt?: NativeDate | null | undefined;
191
- updatedAt?: NativeDate | null | undefined;
192
192
  avatar?: string | null | undefined;
193
193
  password?: string | null | undefined;
194
194
  email?: string | null | undefined;
@@ -218,13 +218,13 @@ export declare const createDefaultTestUser: () => Promise<false | {
218
218
  }, {}, import("mongoose").DefaultSchemaOptions> & {
219
219
  isVerified: boolean;
220
220
  locale: string;
221
+ createdAt?: NativeDate | null | undefined;
222
+ updatedAt?: NativeDate | null | undefined;
221
223
  name?: {
222
224
  first?: string | null | undefined;
223
225
  last?: string | null | undefined;
224
226
  nick?: string | null | undefined;
225
227
  } | null | undefined;
226
- createdAt?: NativeDate | null | undefined;
227
- updatedAt?: NativeDate | null | undefined;
228
228
  avatar?: string | null | undefined;
229
229
  password?: string | null | undefined;
230
230
  email?: string | null | undefined;
@@ -264,13 +264,13 @@ export declare const createDefaultTestUser: () => Promise<false | {
264
264
  readonly getPublic: (this: import("mongoose").Document<unknown, {}, {
265
265
  isVerified: boolean;
266
266
  locale: string;
267
+ createdAt?: NativeDate | null | undefined;
268
+ updatedAt?: NativeDate | null | undefined;
267
269
  name?: {
268
270
  first?: string | null | undefined;
269
271
  last?: string | null | undefined;
270
272
  nick?: string | null | undefined;
271
273
  } | null | undefined;
272
- createdAt?: NativeDate | null | undefined;
273
- updatedAt?: NativeDate | null | undefined;
274
274
  avatar?: string | null | undefined;
275
275
  password?: string | null | undefined;
276
276
  email?: string | null | undefined;
@@ -300,13 +300,13 @@ export declare const createDefaultTestUser: () => Promise<false | {
300
300
  }, {}, import("mongoose").DefaultSchemaOptions> & {
301
301
  isVerified: boolean;
302
302
  locale: string;
303
+ createdAt?: NativeDate | null | undefined;
304
+ updatedAt?: NativeDate | null | undefined;
303
305
  name?: {
304
306
  first?: string | null | undefined;
305
307
  last?: string | null | undefined;
306
308
  nick?: string | null | undefined;
307
309
  } | null | undefined;
308
- createdAt?: NativeDate | null | undefined;
309
- updatedAt?: NativeDate | null | undefined;
310
310
  avatar?: string | null | undefined;
311
311
  password?: string | null | undefined;
312
312
  email?: string | null | undefined;
@@ -354,6 +354,8 @@ export declare const createDefaultTestUser: () => Promise<false | {
354
354
  };
355
355
  } & {
356
356
  id: string;
357
+ } & {
358
+ id: string;
357
359
  };
358
360
  token: string;
359
361
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptivestone/framework",
3
- "version": "5.0.0-beta.45",
3
+ "version": "5.0.0-beta.48",
4
4
  "description": "Adaptive stone node js framework",
5
5
  "type": "module",
6
6
  "engines": {
@@ -18,22 +18,26 @@
18
18
  "scripts": {
19
19
  "build": "rm -rf dist && tsc",
20
20
  "postbuild": "cp -R ./src/migrations ./dist/migrations",
21
- "check:types": "tsc --noEmit",
21
+ "check:types": "npm run gen && tsc --noEmit",
22
+ "check:types:raw": "tsc --noEmit",
22
23
  "dev": "node --watch ./src/index.ts",
23
24
  "prod": "node --watch ./src/cluster.ts",
24
25
  "test": "vitest run",
25
26
  "t": "vitest --coverage=false --reporter=default",
26
27
  "format": "biome format",
27
28
  "format:fix": "biome format --write",
28
- "knip": "knip",
29
29
  "lint": "biome lint",
30
30
  "lint:fix": "biome lint --write",
31
31
  "check": "biome check",
32
32
  "check:fix": "biome check --write",
33
- "prepublishOnly": "npm run build",
33
+ "prepublishOnly": "npm run gen && npm run build",
34
34
  "cli": "node cliCommand.ts",
35
+ "gen": "node cliCommand.ts generatetypes",
36
+ "dev:bench:realistic": "node ./benchmark/fixtures/realistic.ts",
35
37
  "benchmark": "h2load -n 10000 -c 50 -p 'http/1.1' http://localhost:3300/",
36
38
  "benchmark2": "h2load -n 10000 -c 50 https://localhost:3300/",
39
+ "benchmark:plaintext": "h2load -n 10000 -c 50 -p 'http/1.1' http://localhost:3300/bench/plaintext",
40
+ "benchmark:realistic": "h2load -n 10000 -c 50 -p 'http/1.1' 'http://localhost:3300/bench/echo?name=Alice'",
37
41
  "redis:docker": "docker run --rm -p 6379:6379 redis"
38
42
  },
39
43
  "author": "Andrei Lahunou",
@@ -46,10 +50,10 @@
46
50
  "i18next": "^26.0.1",
47
51
  "i18next-fs-backend": "^2.0.0",
48
52
  "mongoose": "^9.0.0",
49
- "rate-limiter-flexible": "^10.0.1",
53
+ "rate-limiter-flexible": "^11.0.0",
50
54
  "winston": "^3.3.3",
51
55
  "winston-transport": "^4.9.0",
52
- "yup": "^1.0.0"
56
+ "yup": "^1.7.0"
53
57
  },
54
58
  "devDependencies": {
55
59
  "@biomejs/biome": "^2.0.6",
@@ -62,12 +66,14 @@
62
66
  "lefthook": "^2.0.0",
63
67
  "mongodb-memory-server": "^11.0.0",
64
68
  "typescript": "^6.0.0",
65
- "vitest": "^4.0.0"
69
+ "vitest": "^4.0.0",
70
+ "zod": "^4.0.0"
66
71
  },
67
72
  "peerDependencies": {
68
73
  "@adaptivestone/framework-module-email": "^1.0.0",
69
74
  "@sentry/core": "^10.34.0",
70
- "@sentry/node": "^10.34.0"
75
+ "@sentry/node": "^10.34.0",
76
+ "zod": "^3.24.0 || ^4.0.0"
71
77
  },
72
78
  "peerDependenciesMeta": {
73
79
  "@adaptivestone/framework-module-email": {
@@ -78,6 +84,9 @@
78
84
  },
79
85
  "@sentry/node": {
80
86
  "optional": true
87
+ },
88
+ "zod": {
89
+ "optional": true
81
90
  }
82
91
  }
83
92
  }
@@ -1,5 +0,0 @@
1
- export default Documentation;
2
- declare class Documentation extends AbstractCommand {
3
- run(): Promise<unknown[]>;
4
- }
5
- import AbstractCommand from '../modules/AbstractCommand.ts';
@@ -1,15 +0,0 @@
1
- import ControllerManager from "../controllers/index.js";
2
- import AbstractCommand from "../modules/AbstractCommand.js";
3
- class Documentation extends AbstractCommand {
4
- static get description() {
5
- return 'Generate documentation (internal)';
6
- }
7
- async run() {
8
- const CM = new ControllerManager(this.app);
9
- this.app.documentation = [];
10
- await CM.initControllers();
11
- return this.app.documentation;
12
- }
13
- }
14
- export default Documentation;
15
- //# sourceMappingURL=Documentation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Documentation.js","sourceRoot":"","sources":["../../src/commands/Documentation.js"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AACxD,OAAO,eAAe,MAAM,+BAA+B,CAAC;AAE5D,MAAM,aAAc,SAAQ,eAAe;IACzC,MAAM,KAAK,WAAW;QACpB,OAAO,mCAAmC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,GAAG,IAAI,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC3C,IAAI,CAAC,GAAG,CAAC,aAAa,GAAG,EAAE,CAAC;QAC5B,MAAM,EAAE,CAAC,eAAe,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC;IAChC,CAAC;CACF;AAED,eAAe,aAAa,CAAC"}
@@ -1,17 +0,0 @@
1
- export default GetOpenApiJson;
2
- /**
3
- * Command for generate documentation json file openApi
4
- */
5
- declare class GetOpenApiJson extends AbstractCommand {
6
- /**
7
- * You able to add command arguments for parsing there.
8
- */
9
- static get commandArguments(): {
10
- output: {
11
- type: string;
12
- description: string;
13
- };
14
- };
15
- run(): Promise<string>;
16
- }
17
- import AbstractCommand from '../modules/AbstractCommand.ts';