@tstdl/base 0.90.92 → 0.91.0-beta10

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 (253) hide show
  1. package/api/types.d.ts +1 -1
  2. package/authentication/authentication.api.d.ts +56 -57
  3. package/authentication/authentication.api.js +1 -6
  4. package/authentication/client/api.client.d.ts +4 -5
  5. package/authentication/client/api.client.js +1 -2
  6. package/authentication/client/http-client.middleware.d.ts +1 -1
  7. package/browser/pdf-options.js +8 -9
  8. package/errors/custom.error.d.ts +5 -5
  9. package/examples/api/basic-overview.js +4 -4
  10. package/http/client/http-client-request.d.ts +1 -2
  11. package/http/client/module.d.ts +1 -1
  12. package/image-service/image-service.js +4 -7
  13. package/mail/mail.client.d.ts +2 -2
  14. package/mail/mail.client.js +3 -5
  15. package/orm/decorators.d.ts +1 -0
  16. package/orm/decorators.js +4 -0
  17. package/orm/entity.js +1 -1
  18. package/orm/index.d.ts +4 -0
  19. package/orm/index.js +4 -0
  20. package/orm/repository.d.ts +6 -8
  21. package/orm/repository.js +7 -0
  22. package/orm/schema-converter.d.ts +99 -0
  23. package/orm/schema-converter.js +74 -0
  24. package/orm/schema.d.ts +3 -0
  25. package/orm/schema.js +1 -0
  26. package/orm/types.d.ts +8 -0
  27. package/orm/types.js +6 -0
  28. package/package.json +7 -5
  29. package/reflection/registry.d.ts +1 -1
  30. package/reflection/utils.d.ts +2 -2
  31. package/schema/decorators/class.d.ts +1 -1
  32. package/schema/decorators/index.d.ts +0 -2
  33. package/schema/decorators/index.js +0 -2
  34. package/schema/decorators/property.d.ts +6 -5
  35. package/schema/decorators/property.js +10 -14
  36. package/schema/decorators/types.d.ts +7 -12
  37. package/schema/decorators/utils.d.ts +2 -15
  38. package/schema/decorators/utils.js +4 -43
  39. package/schema/index.d.ts +1 -6
  40. package/schema/index.js +15 -6
  41. package/schema/schema.d.ts +89 -14
  42. package/schema/schema.error.d.ts +4 -6
  43. package/schema/schema.error.js +6 -10
  44. package/schema/schema.js +74 -276
  45. package/schema/schemas/any.d.ts +7 -5
  46. package/schema/schemas/any.js +10 -6
  47. package/schema/schemas/array.d.ts +11 -12
  48. package/schema/schemas/array.js +29 -19
  49. package/schema/schemas/bigint.d.ts +9 -0
  50. package/schema/schemas/bigint.js +19 -0
  51. package/schema/schemas/boolean.d.ts +11 -5
  52. package/schema/schemas/boolean.js +41 -6
  53. package/schema/schemas/date.d.ts +9 -7
  54. package/schema/schemas/date.js +24 -18
  55. package/schema/schemas/defaulted.d.ts +11 -6
  56. package/schema/schemas/defaulted.js +23 -8
  57. package/schema/schemas/enumeration.d.ts +10 -5
  58. package/schema/schemas/enumeration.js +25 -15
  59. package/schema/schemas/function.d.ts +8 -0
  60. package/schema/schemas/function.js +14 -0
  61. package/schema/schemas/index.d.ts +5 -6
  62. package/schema/schemas/index.js +5 -6
  63. package/schema/schemas/instance.d.ts +11 -3
  64. package/schema/schemas/instance.js +25 -4
  65. package/schema/schemas/literal.d.ts +10 -5
  66. package/schema/schemas/literal.js +25 -15
  67. package/schema/schemas/never.d.ts +6 -0
  68. package/schema/schemas/never.js +11 -0
  69. package/schema/schemas/nullable.d.ts +11 -6
  70. package/schema/schemas/nullable.js +24 -7
  71. package/schema/schemas/number.d.ts +9 -7
  72. package/schema/schemas/number.js +28 -23
  73. package/schema/schemas/object.d.ts +84 -7
  74. package/schema/schemas/object.js +180 -6
  75. package/schema/schemas/one-or-many.d.ts +10 -7
  76. package/schema/schemas/one-or-many.js +18 -11
  77. package/schema/schemas/optional.d.ts +11 -7
  78. package/schema/schemas/optional.js +24 -6
  79. package/schema/schemas/readable-stream.d.ts +8 -6
  80. package/schema/schemas/readable-stream.js +10 -5
  81. package/schema/schemas/regexp.d.ts +8 -6
  82. package/schema/schemas/regexp.js +24 -6
  83. package/schema/schemas/simple.d.ts +27 -0
  84. package/schema/schemas/simple.js +57 -0
  85. package/schema/schemas/string.d.ts +9 -21
  86. package/schema/schemas/string.js +20 -34
  87. package/schema/schemas/symbol.d.ts +8 -0
  88. package/schema/schemas/symbol.js +19 -0
  89. package/schema/schemas/transform.d.ts +9 -5
  90. package/schema/schemas/transform.js +19 -6
  91. package/schema/schemas/uint8-array.d.ts +9 -5
  92. package/schema/schemas/uint8-array.js +17 -26
  93. package/schema/schemas/union.d.ts +14 -7
  94. package/schema/schemas/union.js +30 -11
  95. package/schema/schemas/unknown.d.ts +7 -5
  96. package/schema/schemas/unknown.js +11 -7
  97. package/schema/testable.d.ts +3 -0
  98. package/schema/testable.js +33 -0
  99. package/schema/types.d.ts +31 -0
  100. package/schema/types.js +1 -0
  101. package/schema-old/decorators/class.d.ts +3 -0
  102. package/schema-old/decorators/class.js +5 -0
  103. package/schema-old/decorators/index.d.ts +6 -0
  104. package/schema-old/decorators/index.js +6 -0
  105. package/schema-old/decorators/property.d.ts +6 -0
  106. package/schema-old/decorators/property.js +17 -0
  107. package/schema-old/decorators/types.d.ts +19 -0
  108. package/schema-old/decorators/types.js +1 -0
  109. package/schema-old/decorators/utils.d.ts +15 -0
  110. package/schema-old/decorators/utils.js +48 -0
  111. package/schema-old/index.d.ts +10 -0
  112. package/schema-old/index.js +10 -0
  113. package/schema-old/schema.d.ts +15 -0
  114. package/schema-old/schema.error.d.ts +26 -0
  115. package/schema-old/schema.error.js +64 -0
  116. package/schema-old/schema.js +283 -0
  117. package/schema-old/schemas/any.d.ts +5 -0
  118. package/schema-old/schemas/any.js +9 -0
  119. package/schema-old/schemas/array.d.ts +12 -0
  120. package/schema-old/schemas/array.js +23 -0
  121. package/schema-old/schemas/boolean.d.ts +5 -0
  122. package/schema-old/schemas/boolean.js +9 -0
  123. package/schema-old/schemas/date.d.ts +8 -0
  124. package/schema-old/schemas/date.js +22 -0
  125. package/schema-old/schemas/defaulted.d.ts +6 -0
  126. package/schema-old/schemas/defaulted.js +10 -0
  127. package/schema-old/schemas/enumeration.d.ts +6 -0
  128. package/schema-old/schemas/enumeration.js +17 -0
  129. package/schema-old/schemas/index.d.ts +26 -0
  130. package/schema-old/schemas/index.js +26 -0
  131. package/schema-old/schemas/instance.d.ts +3 -0
  132. package/schema-old/schemas/instance.js +5 -0
  133. package/schema-old/schemas/literal.d.ts +5 -0
  134. package/schema-old/schemas/literal.js +17 -0
  135. package/schema-old/schemas/nullable.d.ts +6 -0
  136. package/schema-old/schemas/nullable.js +9 -0
  137. package/schema-old/schemas/number.d.ts +9 -0
  138. package/schema-old/schemas/number.js +27 -0
  139. package/schema-old/schemas/object.d.ts +7 -0
  140. package/schema-old/schemas/object.js +12 -0
  141. package/schema-old/schemas/one-or-many.d.ts +9 -0
  142. package/schema-old/schemas/one-or-many.js +15 -0
  143. package/schema-old/schemas/optional.d.ts +7 -0
  144. package/schema-old/schemas/optional.js +8 -0
  145. package/schema-old/schemas/readable-stream.d.ts +6 -0
  146. package/schema-old/schemas/readable-stream.js +9 -0
  147. package/schema-old/schemas/regexp.d.ts +6 -0
  148. package/schema-old/schemas/regexp.js +9 -0
  149. package/schema-old/schemas/string.d.ts +22 -0
  150. package/schema-old/schemas/string.js +38 -0
  151. package/schema-old/schemas/transform.d.ts +5 -0
  152. package/schema-old/schemas/transform.js +7 -0
  153. package/schema-old/schemas/uint8-array.d.ts +10 -0
  154. package/schema-old/schemas/uint8-array.js +29 -0
  155. package/schema-old/schemas/union.d.ts +7 -0
  156. package/schema-old/schemas/union.js +13 -0
  157. package/schema-old/schemas/unknown.d.ts +5 -0
  158. package/schema-old/schemas/unknown.js +9 -0
  159. package/templates/resolvers/string.template-resolver.d.ts +0 -1
  160. package/templates/resolvers/string.template-resolver.js +1 -5
  161. package/templates/template.model.js +1 -1
  162. package/types.d.ts +2 -0
  163. package/utils/type-guards.js +1 -1
  164. /package/{schema → schema-old}/array-constraints/index.d.ts +0 -0
  165. /package/{schema → schema-old}/array-constraints/index.js +0 -0
  166. /package/{schema → schema-old}/array-constraints/maximum-length.d.ts +0 -0
  167. /package/{schema → schema-old}/array-constraints/maximum-length.js +0 -0
  168. /package/{schema → schema-old}/array-constraints/minimum-length.d.ts +0 -0
  169. /package/{schema → schema-old}/array-constraints/minimum-length.js +0 -0
  170. /package/{schema → schema-old}/coercers/boolean.coercer.d.ts +0 -0
  171. /package/{schema → schema-old}/coercers/boolean.coercer.js +0 -0
  172. /package/{schema → schema-old}/coercers/date.coercer.d.ts +0 -0
  173. /package/{schema → schema-old}/coercers/date.coercer.js +0 -0
  174. /package/{schema → schema-old}/coercers/index.d.ts +0 -0
  175. /package/{schema → schema-old}/coercers/index.js +0 -0
  176. /package/{schema → schema-old}/coercers/number.coercer.d.ts +0 -0
  177. /package/{schema → schema-old}/coercers/number.coercer.js +0 -0
  178. /package/{schema → schema-old}/coercers/regexp.coercer.d.ts +0 -0
  179. /package/{schema → schema-old}/coercers/regexp.coercer.js +0 -0
  180. /package/{schema → schema-old}/coercers/string.coercer.d.ts +0 -0
  181. /package/{schema → schema-old}/coercers/string.coercer.js +0 -0
  182. /package/{schema → schema-old}/coercers/uint8-array.coercer.d.ts +0 -0
  183. /package/{schema → schema-old}/coercers/uint8-array.coercer.js +0 -0
  184. /package/{schema → schema-old}/constraints/enumeration.d.ts +0 -0
  185. /package/{schema → schema-old}/constraints/enumeration.js +0 -0
  186. /package/{schema → schema-old}/constraints/generic.d.ts +0 -0
  187. /package/{schema → schema-old}/constraints/generic.js +0 -0
  188. /package/{schema → schema-old}/constraints/index.d.ts +0 -0
  189. /package/{schema → schema-old}/constraints/index.js +0 -0
  190. /package/{schema → schema-old}/constraints/integer.d.ts +0 -0
  191. /package/{schema → schema-old}/constraints/integer.js +0 -0
  192. /package/{schema → schema-old}/constraints/length.d.ts +0 -0
  193. /package/{schema → schema-old}/constraints/length.js +0 -0
  194. /package/{schema → schema-old}/constraints/literal.d.ts +0 -0
  195. /package/{schema → schema-old}/constraints/literal.js +0 -0
  196. /package/{schema → schema-old}/constraints/maximum-date.d.ts +0 -0
  197. /package/{schema → schema-old}/constraints/maximum-date.js +0 -0
  198. /package/{schema → schema-old}/constraints/maximum-length.d.ts +0 -0
  199. /package/{schema → schema-old}/constraints/maximum-length.js +0 -0
  200. /package/{schema → schema-old}/constraints/maximum.d.ts +0 -0
  201. /package/{schema → schema-old}/constraints/maximum.js +0 -0
  202. /package/{schema → schema-old}/constraints/minimum-date.d.ts +0 -0
  203. /package/{schema → schema-old}/constraints/minimum-date.js +0 -0
  204. /package/{schema → schema-old}/constraints/minimum-length.d.ts +0 -0
  205. /package/{schema → schema-old}/constraints/minimum-length.js +0 -0
  206. /package/{schema → schema-old}/constraints/minimum.d.ts +0 -0
  207. /package/{schema → schema-old}/constraints/minimum.js +0 -0
  208. /package/{schema → schema-old}/constraints/pattern.d.ts +0 -0
  209. /package/{schema → schema-old}/constraints/pattern.js +0 -0
  210. /package/{schema → schema-old}/decorators/coerce.d.ts +0 -0
  211. /package/{schema → schema-old}/decorators/coerce.js +0 -0
  212. /package/{schema → schema-old}/decorators/constraint.d.ts +0 -0
  213. /package/{schema → schema-old}/decorators/constraint.js +0 -0
  214. /package/{schema → schema-old}/schemas/assign.d.ts +0 -0
  215. /package/{schema → schema-old}/schemas/assign.js +0 -0
  216. /package/{schema → schema-old}/schemas/constraint.d.ts +0 -0
  217. /package/{schema → schema-old}/schemas/constraint.js +0 -0
  218. /package/{schema → schema-old}/schemas/omit.d.ts +0 -0
  219. /package/{schema → schema-old}/schemas/omit.js +0 -0
  220. /package/{schema → schema-old}/schemas/partial.d.ts +0 -0
  221. /package/{schema → schema-old}/schemas/partial.js +0 -0
  222. /package/{schema → schema-old}/schemas/pick.d.ts +0 -0
  223. /package/{schema → schema-old}/schemas/pick.js +0 -0
  224. /package/{schema → schema-old}/schemas/record.d.ts +0 -0
  225. /package/{schema → schema-old}/schemas/record.js +0 -0
  226. /package/{schema → schema-old}/transformers/generic.d.ts +0 -0
  227. /package/{schema → schema-old}/transformers/generic.js +0 -0
  228. /package/{schema → schema-old}/transformers/index.d.ts +0 -0
  229. /package/{schema → schema-old}/transformers/index.js +0 -0
  230. /package/{schema → schema-old}/transformers/lowercase.d.ts +0 -0
  231. /package/{schema → schema-old}/transformers/lowercase.js +0 -0
  232. /package/{schema → schema-old}/transformers/trim.d.ts +0 -0
  233. /package/{schema → schema-old}/transformers/trim.js +0 -0
  234. /package/{schema → schema-old}/transformers/uppercase.d.ts +0 -0
  235. /package/{schema → schema-old}/transformers/uppercase.js +0 -0
  236. /package/{schema → schema-old}/types/index.d.ts +0 -0
  237. /package/{schema → schema-old}/types/index.js +0 -0
  238. /package/{schema → schema-old}/types/schema-array-constraint.d.ts +0 -0
  239. /package/{schema → schema-old}/types/schema-array-constraint.js +0 -0
  240. /package/{schema → schema-old}/types/schema-value-coercer.d.ts +0 -0
  241. /package/{schema → schema-old}/types/schema-value-coercer.js +0 -0
  242. /package/{schema → schema-old}/types/schema-value-constraint.d.ts +0 -0
  243. /package/{schema → schema-old}/types/schema-value-constraint.js +0 -0
  244. /package/{schema → schema-old}/types/schema-value-transformer.d.ts +0 -0
  245. /package/{schema → schema-old}/types/schema-value-transformer.js +0 -0
  246. /package/{schema → schema-old}/types/types.d.ts +0 -0
  247. /package/{schema → schema-old}/types/types.js +0 -0
  248. /package/{schema → schema-old}/utils/index.d.ts +0 -0
  249. /package/{schema → schema-old}/utils/index.js +0 -0
  250. /package/{schema → schema-old}/utils/schema.d.ts +0 -0
  251. /package/{schema → schema-old}/utils/schema.js +0 -0
  252. /package/{schema → schema-old}/utils/value-type.d.ts +0 -0
  253. /package/{schema → schema-old}/utils/value-type.js +0 -0
package/api/types.d.ts CHANGED
@@ -91,7 +91,7 @@ export type ApiEndpointParametersSchema<T extends ApiDefinition, K extends ApiEn
91
91
  export type ApiEndpointBodySchema<T extends ApiDefinition, K extends ApiEndpointKeys<T>> = NonUndefinable<ApiEndpoint<T, K>['body']>;
92
92
  export type ApiEndpointResultSchema<T extends ApiDefinition, K extends ApiEndpointKeys<T>> = NonUndefinable<ApiEndpoint<T, K>['result']>;
93
93
  export type ApiBinaryType = typeof Uint8Array | typeof Blob | typeof ReadableStream<any>;
94
- export type ApiInputType<T extends SchemaTestable> = T extends ApiBinaryType ? (Uint8Array | Blob | ReadableStream<Uint8Array>) : T extends typeof ServerSentEvents ? ServerSentEventsSource : T extends SchemaTestable ? SchemaOutput<T> : never;
94
+ export type ApiInputType<T extends SchemaTestable> = T extends ApiBinaryType ? InstanceType<ApiBinaryType> : T extends typeof ServerSentEvents ? ServerSentEventsSource : T extends SchemaTestable ? SchemaOutput<T> : never;
95
95
  export type ApiOutputType<T extends SchemaTestable> = T extends typeof ReadableStream ? ReadableStream<Uint8Array> : T extends SchemaTestable ? SchemaOutput<T> : never;
96
96
  export type ApiParameters<T extends ApiDefinition, K extends ApiEndpointKeys<T>> = ApiInputType<ApiEndpointParametersSchema<T, K>>;
97
97
  export type ApiClientBody<T extends ApiDefinition, K extends ApiEndpointKeys<T>> = ApiInputType<ApiEndpointBodySchema<T, K>>;
@@ -1,10 +1,9 @@
1
- import type { ApiDefinition } from '../api/types.js';
1
+ import { type ApiDefinition } from '../api/types.js';
2
+ import { type ObjectSchema, type ObjectSchemaOrType } from '../schema/index.js';
2
3
  import type { SchemaTestable } from '../schema/schema.js';
3
- import type { ObjectSchema, ObjectSchemaOrType } from '../schema/types/types.js';
4
4
  import type { Record } from '../types.js';
5
5
  import type { TokenPayload } from './index.js';
6
6
  import { SecretCheckResult } from './models/secret-check-result.model.js';
7
- import { TokenPayloadBase } from './models/token-payload-base.model.js';
8
7
  export declare const dontWaitForValidToken: unique symbol;
9
8
  type GetAuthenticationApiEndpointsDefinition<AdditionalTokenPayload extends Record = Record<never>, AuthenticationData = void, AdditionalInitSecretResetData extends Record = Record<never>> = typeof getAuthenticationApiEndpointsDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>;
10
9
  type AuthenticationApiEndpointsDefinition<AdditionalTokenPayload extends Record = Record<never>, AuthenticationData = void, AdditionalInitSecretResetData extends Record = Record<never>> = ReturnType<GetAuthenticationApiEndpointsDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>>;
@@ -16,11 +15,11 @@ export declare const authenticationApiDefinition: {
16
15
  resource: string;
17
16
  method: "POST";
18
17
  parameters: ObjectSchema<{
19
- subject: string;
20
- secret: string;
21
- data: unknown;
18
+ readonly subject: string;
19
+ readonly secret: string;
20
+ readonly data: unknown;
22
21
  }>;
23
- result: ObjectSchema<TokenPayloadBase>;
22
+ result: ObjectSchema<TokenPayload<import("type-fest").EmptyObject>>;
24
23
  credentials: true;
25
24
  data: {
26
25
  [dontWaitForValidToken]: boolean;
@@ -30,9 +29,9 @@ export declare const authenticationApiDefinition: {
30
29
  resource: string;
31
30
  method: "POST";
32
31
  parameters: ObjectSchema<{
33
- data: unknown;
32
+ readonly data: unknown;
34
33
  }>;
35
- result: ObjectSchema<TokenPayloadBase>;
34
+ result: ObjectSchema<TokenPayload<import("type-fest").EmptyObject>>;
36
35
  credentials: true;
37
36
  data: {
38
37
  [dontWaitForValidToken]: boolean;
@@ -42,10 +41,10 @@ export declare const authenticationApiDefinition: {
42
41
  resource: string;
43
42
  method: "POST";
44
43
  parameters: ObjectSchema<{
45
- subject: string;
46
- data: unknown;
44
+ readonly subject: string;
45
+ readonly data: unknown;
47
46
  }>;
48
- result: ObjectSchema<TokenPayloadBase>;
47
+ result: ObjectSchema<TokenPayload<import("type-fest").EmptyObject>>;
49
48
  credentials: true;
50
49
  data: {
51
50
  [dontWaitForValidToken]: boolean;
@@ -55,9 +54,9 @@ export declare const authenticationApiDefinition: {
55
54
  resource: string;
56
55
  method: "POST";
57
56
  parameters: ObjectSchema<{
58
- data: unknown;
57
+ readonly data: unknown;
59
58
  }>;
60
- result: ObjectSchema<TokenPayloadBase>;
59
+ result: ObjectSchema<TokenPayload<import("type-fest").EmptyObject>>;
61
60
  credentials: true;
62
61
  data: {
63
62
  [dontWaitForValidToken]: boolean;
@@ -66,7 +65,7 @@ export declare const authenticationApiDefinition: {
66
65
  endSession: {
67
66
  resource: string;
68
67
  method: "POST";
69
- result: import("../schema/types/types.js").ValueSchema<"ok">;
68
+ result: import("../schema/index.js").LiteralSchema<"ok">;
70
69
  credentials: true;
71
70
  data: {
72
71
  [dontWaitForValidToken]: boolean;
@@ -76,44 +75,44 @@ export declare const authenticationApiDefinition: {
76
75
  resource: string;
77
76
  method: "POST";
78
77
  parameters: ObjectSchema<{
79
- subject: string;
80
- data: import("../types.js").ObjectLiteral;
78
+ readonly subject: string;
79
+ readonly data: import("type-fest").EmptyObject;
81
80
  }>;
82
- result: import("../schema/types/types.js").ValueSchema<"ok">;
81
+ result: import("../schema/index.js").LiteralSchema<"ok">;
83
82
  };
84
83
  resetSecret: {
85
84
  resource: string;
86
85
  method: "POST";
87
86
  parameters: ObjectSchema<{
88
- token: string;
89
- newSecret: string;
87
+ readonly token: string;
88
+ readonly newSecret: string;
90
89
  }>;
91
- result: import("../schema/types/types.js").ValueSchema<"ok">;
90
+ result: import("../schema/index.js").LiteralSchema<"ok">;
92
91
  };
93
92
  checkSecret: {
94
93
  resource: string;
95
94
  method: "POST";
96
95
  parameters: ObjectSchema<{
97
- secret: string;
96
+ readonly secret: string;
98
97
  }>;
99
98
  result: typeof SecretCheckResult;
100
99
  };
101
100
  timestamp: {
102
101
  resource: string;
103
- result: import("../schema/types/types.js").ValueSchema<number>;
102
+ result: import("../schema/index.js").NumberSchema;
104
103
  };
105
104
  };
106
105
  };
107
- export declare function getAuthenticationApiDefinition<AdditionalTokenPayload extends Record, AuthenticationData, AdditionalInitSecretResetData, AdditionalEndpoints>(additionalTokenPayloadSchema: ObjectSchemaOrType<AdditionalTokenPayload>, authenticationDataSchema: SchemaTestable<AuthenticationData>, initSecretResetDataSchema: ObjectSchemaOrType<AdditionalInitSecretResetData>, resource?: string, additionalEndpoints?: AdditionalEndpoints): {
106
+ export declare function getAuthenticationApiDefinition<AdditionalTokenPayload extends Record, AuthenticationData, AdditionalInitSecretResetData extends Record, AdditionalEndpoints>(additionalTokenPayloadSchema: ObjectSchemaOrType<AdditionalTokenPayload>, authenticationDataSchema: SchemaTestable<AuthenticationData>, initSecretResetDataSchema: ObjectSchemaOrType<AdditionalInitSecretResetData>, resource?: string, additionalEndpoints?: AdditionalEndpoints): {
108
107
  resource: string;
109
108
  endpoints: {
110
109
  getToken: {
111
110
  resource: string;
112
111
  method: "POST";
113
112
  parameters: ObjectSchema<{
114
- subject: string;
115
- secret: string;
116
- data: AuthenticationData;
113
+ readonly subject: string;
114
+ readonly secret: string;
115
+ readonly data: AuthenticationData;
117
116
  }>;
118
117
  result: ObjectSchema<TokenPayload<AdditionalTokenPayload>>;
119
118
  credentials: true;
@@ -125,7 +124,7 @@ export declare function getAuthenticationApiDefinition<AdditionalTokenPayload ex
125
124
  resource: string;
126
125
  method: "POST";
127
126
  parameters: ObjectSchema<{
128
- data: AuthenticationData;
127
+ readonly data: AuthenticationData;
129
128
  }>;
130
129
  result: ObjectSchema<TokenPayload<AdditionalTokenPayload>>;
131
130
  credentials: true;
@@ -137,8 +136,8 @@ export declare function getAuthenticationApiDefinition<AdditionalTokenPayload ex
137
136
  resource: string;
138
137
  method: "POST";
139
138
  parameters: ObjectSchema<{
140
- subject: string;
141
- data: AuthenticationData;
139
+ readonly subject: string;
140
+ readonly data: AuthenticationData;
142
141
  }>;
143
142
  result: ObjectSchema<TokenPayload<AdditionalTokenPayload>>;
144
143
  credentials: true;
@@ -150,7 +149,7 @@ export declare function getAuthenticationApiDefinition<AdditionalTokenPayload ex
150
149
  resource: string;
151
150
  method: "POST";
152
151
  parameters: ObjectSchema<{
153
- data: AuthenticationData;
152
+ readonly data: AuthenticationData;
154
153
  }>;
155
154
  result: ObjectSchema<TokenPayload<AdditionalTokenPayload>>;
156
155
  credentials: true;
@@ -161,7 +160,7 @@ export declare function getAuthenticationApiDefinition<AdditionalTokenPayload ex
161
160
  endSession: {
162
161
  resource: string;
163
162
  method: "POST";
164
- result: import("../schema/types/types.js").ValueSchema<"ok">;
163
+ result: import("../schema/index.js").LiteralSchema<"ok">;
165
164
  credentials: true;
166
165
  data: {
167
166
  [dontWaitForValidToken]: boolean;
@@ -171,42 +170,42 @@ export declare function getAuthenticationApiDefinition<AdditionalTokenPayload ex
171
170
  resource: string;
172
171
  method: "POST";
173
172
  parameters: ObjectSchema<{
174
- subject: string;
175
- data: AdditionalInitSecretResetData;
173
+ readonly subject: string;
174
+ readonly data: AdditionalInitSecretResetData;
176
175
  }>;
177
- result: import("../schema/types/types.js").ValueSchema<"ok">;
176
+ result: import("../schema/index.js").LiteralSchema<"ok">;
178
177
  };
179
178
  resetSecret: {
180
179
  resource: string;
181
180
  method: "POST";
182
181
  parameters: ObjectSchema<{
183
- token: string;
184
- newSecret: string;
182
+ readonly token: string;
183
+ readonly newSecret: string;
185
184
  }>;
186
- result: import("../schema/types/types.js").ValueSchema<"ok">;
185
+ result: import("../schema/index.js").LiteralSchema<"ok">;
187
186
  };
188
187
  checkSecret: {
189
188
  resource: string;
190
189
  method: "POST";
191
190
  parameters: ObjectSchema<{
192
- secret: string;
191
+ readonly secret: string;
193
192
  }>;
194
193
  result: typeof SecretCheckResult;
195
194
  };
196
195
  timestamp: {
197
196
  resource: string;
198
- result: import("../schema/types/types.js").ValueSchema<number>;
197
+ result: import("../schema/index.js").NumberSchema;
199
198
  };
200
199
  };
201
200
  };
202
- export declare function getAuthenticationApiEndpointsDefinition<AdditionalTokenPayload extends Record, AuthenticationData, AdditionalInitSecretResetData>(additionalTokenPayloadSchema: ObjectSchemaOrType<AdditionalTokenPayload>, authenticationDataSchema: SchemaTestable<AuthenticationData>, additionalInitSecretResetDataSchema: ObjectSchemaOrType<AdditionalInitSecretResetData>): {
201
+ export declare function getAuthenticationApiEndpointsDefinition<AdditionalTokenPayload extends Record, AuthenticationData, AdditionalInitSecretResetData extends Record>(additionalTokenPayloadSchema: ObjectSchemaOrType<AdditionalTokenPayload>, authenticationDataSchema: SchemaTestable<AuthenticationData>, additionalInitSecretResetDataSchema: ObjectSchemaOrType<AdditionalInitSecretResetData>): {
203
202
  getToken: {
204
203
  resource: string;
205
204
  method: "POST";
206
205
  parameters: ObjectSchema<{
207
- subject: string;
208
- secret: string;
209
- data: AuthenticationData;
206
+ readonly subject: string;
207
+ readonly secret: string;
208
+ readonly data: AuthenticationData;
210
209
  }>;
211
210
  result: ObjectSchema<TokenPayload<AdditionalTokenPayload>>;
212
211
  credentials: true;
@@ -218,7 +217,7 @@ export declare function getAuthenticationApiEndpointsDefinition<AdditionalTokenP
218
217
  resource: string;
219
218
  method: "POST";
220
219
  parameters: ObjectSchema<{
221
- data: AuthenticationData;
220
+ readonly data: AuthenticationData;
222
221
  }>;
223
222
  result: ObjectSchema<TokenPayload<AdditionalTokenPayload>>;
224
223
  credentials: true;
@@ -230,8 +229,8 @@ export declare function getAuthenticationApiEndpointsDefinition<AdditionalTokenP
230
229
  resource: string;
231
230
  method: "POST";
232
231
  parameters: ObjectSchema<{
233
- subject: string;
234
- data: AuthenticationData;
232
+ readonly subject: string;
233
+ readonly data: AuthenticationData;
235
234
  }>;
236
235
  result: ObjectSchema<TokenPayload<AdditionalTokenPayload>>;
237
236
  credentials: true;
@@ -243,7 +242,7 @@ export declare function getAuthenticationApiEndpointsDefinition<AdditionalTokenP
243
242
  resource: string;
244
243
  method: "POST";
245
244
  parameters: ObjectSchema<{
246
- data: AuthenticationData;
245
+ readonly data: AuthenticationData;
247
246
  }>;
248
247
  result: ObjectSchema<TokenPayload<AdditionalTokenPayload>>;
249
248
  credentials: true;
@@ -254,7 +253,7 @@ export declare function getAuthenticationApiEndpointsDefinition<AdditionalTokenP
254
253
  endSession: {
255
254
  resource: string;
256
255
  method: "POST";
257
- result: import("../schema/types/types.js").ValueSchema<"ok">;
256
+ result: import("../schema/index.js").LiteralSchema<"ok">;
258
257
  credentials: true;
259
258
  data: {
260
259
  [dontWaitForValidToken]: boolean;
@@ -264,31 +263,31 @@ export declare function getAuthenticationApiEndpointsDefinition<AdditionalTokenP
264
263
  resource: string;
265
264
  method: "POST";
266
265
  parameters: ObjectSchema<{
267
- subject: string;
268
- data: AdditionalInitSecretResetData;
266
+ readonly subject: string;
267
+ readonly data: AdditionalInitSecretResetData;
269
268
  }>;
270
- result: import("../schema/types/types.js").ValueSchema<"ok">;
269
+ result: import("../schema/index.js").LiteralSchema<"ok">;
271
270
  };
272
271
  resetSecret: {
273
272
  resource: string;
274
273
  method: "POST";
275
274
  parameters: ObjectSchema<{
276
- token: string;
277
- newSecret: string;
275
+ readonly token: string;
276
+ readonly newSecret: string;
278
277
  }>;
279
- result: import("../schema/types/types.js").ValueSchema<"ok">;
278
+ result: import("../schema/index.js").LiteralSchema<"ok">;
280
279
  };
281
280
  checkSecret: {
282
281
  resource: string;
283
282
  method: "POST";
284
283
  parameters: ObjectSchema<{
285
- secret: string;
284
+ readonly secret: string;
286
285
  }>;
287
286
  result: typeof SecretCheckResult;
288
287
  };
289
288
  timestamp: {
290
289
  resource: string;
291
- result: import("../schema/types/types.js").ValueSchema<number>;
290
+ result: import("../schema/index.js").NumberSchema;
292
291
  };
293
292
  };
294
293
  export {};
@@ -1,10 +1,5 @@
1
1
  import { defineApi } from '../api/types.js';
2
- import { assign } from '../schema/schemas/assign.js';
3
- import { literal } from '../schema/schemas/literal.js';
4
- import { number } from '../schema/schemas/number.js';
5
- import { emptyObjectSchema, explicitObject, object } from '../schema/schemas/object.js';
6
- import { string } from '../schema/schemas/string.js';
7
- import { unknown } from '../schema/schemas/unknown.js';
2
+ import { assign, emptyObjectSchema, explicitObject, literal, number, object, string, unknown } from '../schema/index.js';
8
3
  import { SecretCheckResult } from './models/secret-check-result.model.js';
9
4
  import { TokenPayloadBase } from './models/token-payload-base.model.js';
10
5
  export const dontWaitForValidToken = Symbol('dontWaitForValidToken');
@@ -1,10 +1,9 @@
1
- import type { ApiClient } from '../../api/client/index.js';
2
- import type { SchemaTestable } from '../../schema/schema.js';
3
- import type { ObjectSchemaOrType } from '../../schema/types/types.js';
1
+ import { ApiClient } from '../../api/client/index.js';
2
+ import { ObjectSchemaOrType, SchemaTestable } from '../../schema/index.js';
4
3
  import type { Record } from '../../types.js';
5
- import type { AuthenticationApiDefinition } from '../authentication.api.js';
4
+ import { AuthenticationApiDefinition } from '../authentication.api.js';
6
5
  export declare function getAuthenticationApiClient<AdditionalTokenPayload extends Record, AuthenticationData, AdditionalInitSecretResetData extends Record>(additionalTokenPayloadSchema: ObjectSchemaOrType<AdditionalTokenPayload>, authenticationDataSchema: SchemaTestable<AuthenticationData>, additionalInitSecretResetData: ObjectSchemaOrType<AdditionalInitSecretResetData>): ApiClient<AuthenticationApiDefinition<AdditionalTokenPayload, AuthenticationData, AdditionalInitSecretResetData>>;
7
- declare const defaultAuthenticationApiClient: ApiClient<AuthenticationApiDefinition<import("../../types.js").ObjectLiteral, unknown, import("../../types.js").ObjectLiteral>>;
6
+ declare const defaultAuthenticationApiClient: ApiClient<AuthenticationApiDefinition<import("type-fest").EmptyObject, unknown, import("type-fest").EmptyObject>>;
8
7
  export declare class AuthenticationApiClient extends defaultAuthenticationApiClient {
9
8
  }
10
9
  export {};
@@ -6,8 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  import { compileClient } from '../../api/client/index.js';
8
8
  import { ReplaceClass, Singleton } from '../../injector/index.js';
9
- import { emptyObjectSchema } from '../../schema/schemas/object.js';
10
- import { unknown } from '../../schema/schemas/unknown.js';
9
+ import { emptyObjectSchema, unknown } from '../../schema/index.js';
11
10
  import { getAuthenticationApiDefinition } from '../authentication.api.js';
12
11
  export function getAuthenticationApiClient(additionalTokenPayloadSchema, authenticationDataSchema, additionalInitSecretResetData) {
13
12
  const definition = getAuthenticationApiDefinition(additionalTokenPayloadSchema, authenticationDataSchema, additionalInitSecretResetData);
@@ -1,4 +1,4 @@
1
1
  import type { HttpClientMiddleware } from '../../http/client/middleware.js';
2
- import type { ValueOrAsyncProvider } from '../../utils/value-or-provider.js';
2
+ import { type ValueOrAsyncProvider } from '../../utils/value-or-provider.js';
3
3
  import type { AuthenticationClientService } from './authentication.service.js';
4
4
  export declare function waitForAuthenticationCredentialsMiddleware(authenticationServiceOrProvider: ValueOrAsyncProvider<AuthenticationClientService>): HttpClientMiddleware;
@@ -7,8 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
- import { Enumeration } from '../schema/schemas/enumeration.js';
11
- import { Optional } from '../schema/schemas/optional.js';
10
+ import { Enumeration, Optional, Union } from '../schema/index.js';
12
11
  export var PdfFormat;
13
12
  (function (PdfFormat) {
14
13
  PdfFormat["Letter"] = "letter";
@@ -30,19 +29,19 @@ export class PdfMarginObject {
30
29
  left;
31
30
  }
32
31
  __decorate([
33
- Optional([Number, String]),
32
+ Union(Number, String, { optional: true }),
34
33
  __metadata("design:type", Object)
35
34
  ], PdfMarginObject.prototype, "top", void 0);
36
35
  __decorate([
37
- Optional([Number, String]),
36
+ Union(Number, String, { optional: true }),
38
37
  __metadata("design:type", Object)
39
38
  ], PdfMarginObject.prototype, "bottom", void 0);
40
39
  __decorate([
41
- Optional([Number, String]),
40
+ Union(Number, String, { optional: true }),
42
41
  __metadata("design:type", Object)
43
42
  ], PdfMarginObject.prototype, "right", void 0);
44
43
  __decorate([
45
- Optional([Number, String]),
44
+ Union(Number, String, { optional: true }),
46
45
  __metadata("design:type", Object)
47
46
  ], PdfMarginObject.prototype, "left", void 0);
48
47
  export class PdfRenderOptions {
@@ -75,11 +74,11 @@ __decorate([
75
74
  __metadata("design:type", String)
76
75
  ], PdfRenderOptions.prototype, "format", void 0);
77
76
  __decorate([
78
- Optional([String, Number]),
77
+ Union(String, Number, { optional: true }),
79
78
  __metadata("design:type", Object)
80
79
  ], PdfRenderOptions.prototype, "width", void 0);
81
80
  __decorate([
82
- Optional([String, Number]),
81
+ Union(String, Number, { optional: true }),
83
82
  __metadata("design:type", Object)
84
83
  ], PdfRenderOptions.prototype, "height", void 0);
85
84
  __decorate([
@@ -87,7 +86,7 @@ __decorate([
87
86
  __metadata("design:type", Number)
88
87
  ], PdfRenderOptions.prototype, "scale", void 0);
89
88
  __decorate([
90
- Optional([String, Number, PdfMarginObject]),
89
+ Union(String, Number, PdfMarginObject, { optional: true }),
91
90
  __metadata("design:type", Object)
92
91
  ], PdfRenderOptions.prototype, "margin", void 0);
93
92
  __decorate([
@@ -1,23 +1,23 @@
1
1
  export type CustomErrorOptions = {
2
2
  /**
3
- * name of error
3
+ * Name of error
4
4
  *
5
5
  * defaults to static {@link CustomErrorStatic.errorName} if set and constructor (class) name if unset.
6
6
  */
7
7
  name?: string;
8
8
  /**
9
- * error message
9
+ * Error message
10
10
  */
11
11
  message?: string;
12
12
  /**
13
- * stack trace
13
+ * Stack trace
14
14
  */
15
15
  stack?: string;
16
16
  /**
17
- * cause for error
17
+ * Cause for error
18
18
  */
19
19
  cause?: Error;
20
- /** skip {@link Error} super call, which improves speed but looses stack trace */
20
+ /** Skip {@link Error} super call, which improves speed but looses stack trace */
21
21
  fast?: boolean | undefined;
22
22
  };
23
23
  export declare abstract class CustomError extends Error {
@@ -18,7 +18,7 @@ import { configureHttpClient } from '../../http/client/module.js';
18
18
  import { configureNodeHttpServer } from '../../http/server/node/module.js';
19
19
  import { inject } from '../../injector/inject.js';
20
20
  import { WebServerModule } from '../../module/modules/web-server.module.js';
21
- import { Property, array, boolean, number, object } from '../../schema/index.js';
21
+ import { NumberProperty, Property, array, boolean, number, object } from '../../schema/index.js';
22
22
  import { timeout } from '../../utils/timing.js';
23
23
  import { Agent } from 'undici';
24
24
  class User {
@@ -26,7 +26,7 @@ class User {
26
26
  name;
27
27
  }
28
28
  __decorate([
29
- Property({ coerce: true }),
29
+ NumberProperty({ coerce: true }),
30
30
  __metadata("design:type", Number)
31
31
  ], User.prototype, "id", void 0);
32
32
  __decorate([
@@ -92,11 +92,11 @@ async function clientTest() {
92
92
  console.log(allUsersAfterDelete);
93
93
  Application.requestShutdown();
94
94
  }
95
- async function main() {
95
+ function main() {
96
96
  configureNodeHttpServer();
97
97
  configureApiServer({ controllers: [UserApi] });
98
98
  configureUndiciHttpClientAdapter({ dispatcher: new Agent({ keepAliveMaxTimeout: 1 }) });
99
99
  configureHttpClient({ baseUrl: 'http://localhost:8000' });
100
100
  Application.run(WebServerModule, clientTest);
101
101
  }
102
- void main();
102
+ main();
@@ -1,7 +1,6 @@
1
1
  import { type CancellationSignal } from '../../cancellation/index.js';
2
2
  import { dispose, type Disposable } from '../../disposable/index.js';
3
- import type { OneOrMany } from '../../schema/index.js';
4
- import type { Record, TypedOmit, UndefinableJson, UndefinableJsonObject } from '../../types.js';
3
+ import type { OneOrMany, Record, TypedOmit, UndefinableJson, UndefinableJsonObject } from '../../types.js';
5
4
  import { HttpForm, type HttpFormObject } from '../http-form.js';
6
5
  import { HttpHeaders, type HttpHeadersObject } from '../http-headers.js';
7
6
  import { HttpQuery, type HttpQueryObject } from '../http-query.js';
@@ -5,7 +5,7 @@ import type { HttpClientMiddleware } from './middleware.js';
5
5
  export type HttpClientModuleConfig = HttpClientOptions & {
6
6
  adapter?: Type<HttpClientAdapter>;
7
7
  /**
8
- * middlewares to add
8
+ * Middlewares to add
9
9
  */
10
10
  middleware?: OneOrMany<HttpClientMiddleware>;
11
11
  };
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
- import { Coerce, Enumeration, Optional } from '../schema/index.js';
10
+ import { Enumeration, NumberProperty, Optional } from '../schema/index.js';
11
11
  export var ImageResizeMode;
12
12
  (function (ImageResizeMode) {
13
13
  ImageResizeMode["Fit"] = "fit";
@@ -49,13 +49,11 @@ __decorate([
49
49
  __metadata("design:type", String)
50
50
  ], ImageOptions.prototype, "resizeMode", void 0);
51
51
  __decorate([
52
- Optional(),
53
- Coerce(),
52
+ NumberProperty({ optional: true, coerce: true }),
54
53
  __metadata("design:type", Number)
55
54
  ], ImageOptions.prototype, "width", void 0);
56
55
  __decorate([
57
- Optional(),
58
- Coerce(),
56
+ NumberProperty({ optional: true, coerce: true }),
59
57
  __metadata("design:type", Number)
60
58
  ], ImageOptions.prototype, "height", void 0);
61
59
  __decorate([
@@ -64,8 +62,7 @@ __decorate([
64
62
  __metadata("design:type", String)
65
63
  ], ImageOptions.prototype, "origin", void 0);
66
64
  __decorate([
67
- Optional(),
68
- Coerce(),
65
+ NumberProperty({ optional: true, coerce: true }),
69
66
  __metadata("design:type", Number)
70
67
  ], ImageOptions.prototype, "quality", void 0);
71
68
  __decorate([
@@ -1,5 +1,4 @@
1
- import type { Resolvable } from '../injector/index.js';
2
- import { resolveArgumentType } from '../injector/index.js';
1
+ import { resolveArgumentType, type Resolvable } from '../injector/index.js';
3
2
  import type { MailData, MailSendResult } from './models/index.js';
4
3
  export declare class MailClientAuthConfig {
5
4
  user: string;
@@ -8,6 +7,7 @@ export declare class MailClientAuthConfig {
8
7
  export declare class MailClientConfig {
9
8
  host: string;
10
9
  port: number;
10
+ /** Enable TLS (if not defined it is automatically set depending on port) */
11
11
  secure?: boolean;
12
12
  auth?: MailClientAuthConfig;
13
13
  }
@@ -8,7 +8,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
10
  import { Property } from '../schema/decorators/property.js';
11
- import { BooleanProperty } from '../schema/schemas/boolean.js';
11
+ import { BooleanProperty } from '../schema/index.js';
12
12
  import { Optional } from '../schema/schemas/optional.js';
13
13
  export class MailClientAuthConfig {
14
14
  user;
@@ -25,7 +25,7 @@ __decorate([
25
25
  export class MailClientConfig {
26
26
  host;
27
27
  port;
28
- /* enable TLS (if not defined it is automatically set depending on port) */
28
+ /** Enable TLS (if not defined it is automatically set depending on port) */
29
29
  secure;
30
30
  auth;
31
31
  }
@@ -38,9 +38,7 @@ __decorate([
38
38
  __metadata("design:type", Number)
39
39
  ], MailClientConfig.prototype, "port", void 0);
40
40
  __decorate([
41
- BooleanProperty({ optional: true })
42
- /* enable TLS (if not defined it is automatically set depending on port) */
43
- ,
41
+ BooleanProperty({ optional: true }),
44
42
  __metadata("design:type", Boolean)
45
43
  ], MailClientConfig.prototype, "secure", void 0);
46
44
  __decorate([
@@ -0,0 +1 @@
1
+ export declare function PrimaryKey(): PropertyDecorator;
@@ -0,0 +1,4 @@
1
+ import { createPropertyDecorator } from '../reflection/utils.js';
2
+ export function PrimaryKey() {
3
+ return createPropertyDecorator({ data: { orm: { primaryKey: true } }, mergeData: true });
4
+ }
package/orm/entity.js CHANGED
@@ -32,7 +32,7 @@ __decorate([
32
32
  __metadata("design:type", Object)
33
33
  ], EntityMetadata.prototype, "deleteTimestamp", void 0);
34
34
  __decorate([
35
- Property({ schema: record(any(), any()) }),
35
+ Property(record(any(), any())),
36
36
  __metadata("design:type", Object)
37
37
  ], EntityMetadata.prototype, "attributes", void 0);
38
38
  export class Entity {
package/orm/index.d.ts CHANGED
@@ -1,3 +1,7 @@
1
+ export * from './decorators.js';
1
2
  export * from './entity.js';
2
3
  export * from './query.js';
3
4
  export * from './repository.js';
5
+ export * from './schema-converter.js';
6
+ export * from './schema.js';
7
+ export * from './types.js';
package/orm/index.js CHANGED
@@ -1,3 +1,7 @@
1
+ export * from './decorators.js';
1
2
  export * from './entity.js';
2
3
  export * from './query.js';
3
4
  export * from './repository.js';
5
+ export * from './schema-converter.js';
6
+ export * from './schema.js';
7
+ export * from './types.js';