glasswork 1.5.0 → 1.6.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.
- package/CHANGELOG.md +62 -1
- package/README.md +6 -2
- package/dist/audit/audit-logger.d.ts +6 -1
- package/dist/audit/audit-logger.d.ts.map +1 -1
- package/dist/audit/audit-logger.js +6 -1
- package/dist/audit/audit-logger.js.map +1 -1
- package/dist/auth/assert.d.ts +4 -0
- package/dist/auth/assert.d.ts.map +1 -1
- package/dist/auth/assert.js +7 -3
- package/dist/auth/assert.js.map +1 -1
- package/dist/auth/better-auth-provider.js +13 -4
- package/dist/auth/better-auth-provider.js.map +1 -1
- package/dist/auth/errors.d.ts +17 -0
- package/dist/auth/errors.d.ts.map +1 -0
- package/dist/auth/errors.js +23 -0
- package/dist/auth/errors.js.map +1 -0
- package/dist/auth/index.d.ts +2 -1
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +1 -0
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/middleware.d.ts +13 -0
- package/dist/auth/middleware.d.ts.map +1 -1
- package/dist/auth/middleware.js +19 -8
- package/dist/auth/middleware.js.map +1 -1
- package/dist/auth/types.d.ts +4 -0
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/config/providers.d.ts.map +1 -1
- package/dist/config/providers.js +5 -4
- package/dist/config/providers.js.map +1 -1
- package/dist/core/bootstrap.d.ts +2 -2
- package/dist/core/bootstrap.d.ts.map +1 -1
- package/dist/core/bootstrap.js +142 -68
- package/dist/core/bootstrap.js.map +1 -1
- package/dist/core/contract.d.ts +9 -2
- package/dist/core/contract.d.ts.map +1 -1
- package/dist/core/contract.js +2 -1
- package/dist/core/contract.js.map +1 -1
- package/dist/core/errors.d.ts +16 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +31 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/glasswork-config.d.ts +42 -0
- package/dist/core/glasswork-config.d.ts.map +1 -0
- package/dist/core/glasswork-config.js +2 -0
- package/dist/core/glasswork-config.js.map +1 -0
- package/dist/core/index.d.ts +6 -3
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +4 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/job-services.d.ts +16 -0
- package/dist/core/job-services.d.ts.map +1 -0
- package/dist/core/job-services.js +19 -0
- package/dist/core/job-services.js.map +1 -0
- package/dist/core/lifecycle.d.ts +29 -1
- package/dist/core/lifecycle.d.ts.map +1 -1
- package/dist/core/lifecycle.js +98 -15
- package/dist/core/lifecycle.js.map +1 -1
- package/dist/core/module-graph.d.ts +2 -0
- package/dist/core/module-graph.d.ts.map +1 -1
- package/dist/core/module-graph.js +63 -10
- package/dist/core/module-graph.js.map +1 -1
- package/dist/core/module-inspection.d.ts +44 -0
- package/dist/core/module-inspection.d.ts.map +1 -0
- package/dist/core/module-inspection.js +114 -0
- package/dist/core/module-inspection.js.map +1 -0
- package/dist/core/module-runtime.d.ts +8 -0
- package/dist/core/module-runtime.d.ts.map +1 -1
- package/dist/core/module-runtime.js +60 -6
- package/dist/core/module-runtime.js.map +1 -1
- package/dist/core/request-scope.js +1 -1
- package/dist/core/request-scope.js.map +1 -1
- package/dist/core/types.d.ts +98 -7
- package/dist/core/types.d.ts.map +1 -1
- package/dist/email/compiler/compiler.d.ts.map +1 -1
- package/dist/email/compiler/compiler.js +52 -43
- package/dist/email/compiler/compiler.js.map +1 -1
- package/dist/email/ses.d.ts +7 -0
- package/dist/email/ses.d.ts.map +1 -0
- package/dist/email/ses.js +6 -0
- package/dist/email/ses.js.map +1 -0
- package/dist/email/smtp.d.ts +7 -0
- package/dist/email/smtp.d.ts.map +1 -0
- package/dist/email/smtp.js +6 -0
- package/dist/email/smtp.js.map +1 -0
- package/dist/email/transports/ses-transport.d.ts.map +1 -1
- package/dist/email/transports/ses-transport.js +6 -4
- package/dist/email/transports/ses-transport.js.map +1 -1
- package/dist/email/transports/smtp-transport.d.ts +40 -0
- package/dist/email/transports/smtp-transport.d.ts.map +1 -0
- package/dist/email/transports/smtp-transport.js +67 -0
- package/dist/email/transports/smtp-transport.js.map +1 -0
- package/dist/http/error-handler.d.ts +7 -1
- package/dist/http/error-handler.d.ts.map +1 -1
- package/dist/http/error-handler.js +18 -6
- package/dist/http/error-handler.js.map +1 -1
- package/dist/http/error-response.dto.d.ts +6 -0
- package/dist/http/error-response.dto.d.ts.map +1 -1
- package/dist/http/error-response.dto.js +6 -0
- package/dist/http/error-response.dto.js.map +1 -1
- package/dist/http/errors.d.ts +12 -0
- package/dist/http/errors.d.ts.map +1 -1
- package/dist/http/errors.js +35 -23
- package/dist/http/errors.js.map +1 -1
- package/dist/http/index.d.ts +1 -1
- package/dist/http/index.d.ts.map +1 -1
- package/dist/http/index.js +1 -1
- package/dist/http/index.js.map +1 -1
- package/dist/http/route-authorization.d.ts.map +1 -1
- package/dist/http/route-authorization.js +3 -3
- package/dist/http/route-authorization.js.map +1 -1
- package/dist/http/route-helpers.d.ts +2 -1
- package/dist/http/route-helpers.d.ts.map +1 -1
- package/dist/http/route-helpers.js +29 -2
- package/dist/http/route-helpers.js.map +1 -1
- package/dist/http/route-openapi-context.d.ts +15 -1
- package/dist/http/route-openapi-context.d.ts.map +1 -1
- package/dist/http/route-openapi-context.js.map +1 -1
- package/dist/http/route-response.d.ts +6 -2
- package/dist/http/route-response.d.ts.map +1 -1
- package/dist/http/route-response.js +36 -16
- package/dist/http/route-response.js.map +1 -1
- package/dist/http/route-types.d.ts +12 -4
- package/dist/http/route-types.d.ts.map +1 -1
- package/dist/http/route-types.js.map +1 -1
- package/dist/http/route-validation.d.ts.map +1 -1
- package/dist/http/route-validation.js +21 -1
- package/dist/http/route-validation.js.map +1 -1
- package/dist/jobs/drivers/eventbridge-scheduler-driver.d.ts +1 -0
- package/dist/jobs/drivers/eventbridge-scheduler-driver.d.ts.map +1 -1
- package/dist/jobs/drivers/eventbridge-scheduler-driver.js +12 -2
- package/dist/jobs/drivers/eventbridge-scheduler-driver.js.map +1 -1
- package/dist/jobs/drivers/mock-driver.d.ts +4 -0
- package/dist/jobs/drivers/mock-driver.d.ts.map +1 -1
- package/dist/jobs/drivers/mock-driver.js +10 -3
- package/dist/jobs/drivers/mock-driver.js.map +1 -1
- package/dist/jobs/drivers/sqs-driver.d.ts +1 -1
- package/dist/jobs/drivers/sqs-driver.d.ts.map +1 -1
- package/dist/jobs/drivers/sqs-driver.js +8 -2
- package/dist/jobs/drivers/sqs-driver.js.map +1 -1
- package/dist/jobs/errors.d.ts +14 -1
- package/dist/jobs/errors.d.ts.map +1 -1
- package/dist/jobs/errors.js +19 -2
- package/dist/jobs/errors.js.map +1 -1
- package/dist/jobs/index.d.ts +3 -3
- package/dist/jobs/index.d.ts.map +1 -1
- package/dist/jobs/index.js +1 -1
- package/dist/jobs/index.js.map +1 -1
- package/dist/jobs/job-service.d.ts +46 -7
- package/dist/jobs/job-service.d.ts.map +1 -1
- package/dist/jobs/job-service.js +63 -9
- package/dist/jobs/job-service.js.map +1 -1
- package/dist/jobs/scheduler.d.ts +6 -0
- package/dist/jobs/scheduler.d.ts.map +1 -0
- package/dist/jobs/scheduler.js +6 -0
- package/dist/jobs/scheduler.js.map +1 -0
- package/dist/jobs/sqs.d.ts +7 -0
- package/dist/jobs/sqs.d.ts.map +1 -0
- package/dist/jobs/sqs.js +7 -0
- package/dist/jobs/sqs.js.map +1 -0
- package/dist/jobs/types.d.ts +6 -1
- package/dist/jobs/types.d.ts.map +1 -1
- package/dist/jobs/utils.d.ts +6 -0
- package/dist/jobs/utils.d.ts.map +1 -1
- package/dist/jobs/utils.js +8 -0
- package/dist/jobs/utils.js.map +1 -1
- package/dist/middleware/rate-limit.d.ts.map +1 -1
- package/dist/middleware/rate-limit.js +5 -4
- package/dist/middleware/rate-limit.js.map +1 -1
- package/dist/observability/exception-tracking.d.ts +23 -0
- package/dist/observability/exception-tracking.d.ts.map +1 -1
- package/dist/observability/exception-tracking.js +101 -6
- package/dist/observability/exception-tracking.js.map +1 -1
- package/dist/observability/index.d.ts +1 -1
- package/dist/observability/index.d.ts.map +1 -1
- package/dist/observability/index.js +1 -1
- package/dist/observability/index.js.map +1 -1
- package/dist/observability/sanitizers.d.ts.map +1 -1
- package/dist/observability/sanitizers.js +2 -0
- package/dist/observability/sanitizers.js.map +1 -1
- package/dist/openapi/drift.d.ts +17 -2
- package/dist/openapi/drift.d.ts.map +1 -1
- package/dist/openapi/drift.js +79 -5
- package/dist/openapi/drift.js.map +1 -1
- package/dist/openapi/openapi.d.ts.map +1 -1
- package/dist/openapi/openapi.js +2 -1
- package/dist/openapi/openapi.js.map +1 -1
- package/dist/utils/environment.d.ts +10 -2
- package/dist/utils/environment.d.ts.map +1 -1
- package/dist/utils/environment.js +20 -3
- package/dist/utils/environment.js.map +1 -1
- package/dist/utils/module-interop.d.ts +9 -0
- package/dist/utils/module-interop.d.ts.map +1 -0
- package/dist/utils/module-interop.js +16 -0
- package/dist/utils/module-interop.js.map +1 -0
- package/dist/utils/optional-dependency.d.ts +6 -0
- package/dist/utils/optional-dependency.d.ts.map +1 -0
- package/dist/utils/optional-dependency.js +16 -0
- package/dist/utils/optional-dependency.js.map +1 -0
- package/dist/utils/serialize-prisma-types.d.ts +51 -15
- package/dist/utils/serialize-prisma-types.d.ts.map +1 -1
- package/dist/utils/serialize-prisma-types.js +47 -16
- package/dist/utils/serialize-prisma-types.js.map +1 -1
- package/package.json +56 -12
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Named exports of a dynamically imported module.
|
|
3
|
+
*
|
|
4
|
+
* Node exposes the named exports of a CommonJS package through `import()`, but a bundler that
|
|
5
|
+
* turns the package into an ESM chunk may expose them only as `default`. Optional peers such
|
|
6
|
+
* as the AWS SDK clients are CommonJS packages, so read their exports from either place.
|
|
7
|
+
*/
|
|
8
|
+
export function namedExports(module) {
|
|
9
|
+
// Check first: module mocks may throw for an export they do not define.
|
|
10
|
+
const fallback = 'default' in module ? module.default : undefined;
|
|
11
|
+
if (fallback === null || (typeof fallback !== 'object' && typeof fallback !== 'function')) {
|
|
12
|
+
return module;
|
|
13
|
+
}
|
|
14
|
+
return { ...fallback, ...module };
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=module-interop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-interop.js","sourceRoot":"","sources":["../../src/utils/module-interop.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAmB,MAAS;IACtD,wEAAwE;IACxE,MAAM,QAAQ,GAAG,SAAS,IAAI,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IAClE,IAAI,QAAQ,KAAK,IAAI,IAAI,CAAC,OAAO,QAAQ,KAAK,QAAQ,IAAI,OAAO,QAAQ,KAAK,UAAU,CAAC,EAAE,CAAC;QAC1F,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,OAAO,EAAE,GAAG,QAAQ,EAAE,GAAG,MAAM,EAAO,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loads an optional peer the first time an adapter needs it, so importing the adapter's entry
|
|
3
|
+
* point works without the peer installed. A missing peer fails with an install hint.
|
|
4
|
+
*/
|
|
5
|
+
export declare function optionalDependency<T extends object>(name: string, user: string, load: () => Promise<T>): () => Promise<T>;
|
|
6
|
+
//# sourceMappingURL=optional-dependency.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"optional-dependency.d.ts","sourceRoot":"","sources":["../../src/utils/optional-dependency.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,MAAM,EACjD,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACrB,MAAM,OAAO,CAAC,CAAC,CAAC,CASlB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { namedExports } from './module-interop.js';
|
|
2
|
+
/**
|
|
3
|
+
* Loads an optional peer the first time an adapter needs it, so importing the adapter's entry
|
|
4
|
+
* point works without the peer installed. A missing peer fails with an install hint.
|
|
5
|
+
*/
|
|
6
|
+
export function optionalDependency(name, user, load) {
|
|
7
|
+
let loading;
|
|
8
|
+
return () => {
|
|
9
|
+
loading ??= load().then(namedExports, (cause) => {
|
|
10
|
+
loading = undefined;
|
|
11
|
+
throw new Error(`${user} requires ${name}. Install it with: npm install ${name}`, { cause });
|
|
12
|
+
});
|
|
13
|
+
return loading;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=optional-dependency.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"optional-dependency.js","sourceRoot":"","sources":["../../src/utils/optional-dependency.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAChC,IAAY,EACZ,IAAY,EACZ,IAAsB;IAEtB,IAAI,OAA+B,CAAC;IACpC,OAAO,GAAG,EAAE;QACV,OAAO,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,KAAc,EAAE,EAAE;YACvD,OAAO,GAAG,SAAS,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,aAAa,IAAI,kCAAkC,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QAC/F,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC;IACjB,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,34 +1,62 @@
|
|
|
1
|
+
import type { ConfiguredDecimalSerialization, DecimalSerialization } from '../core/glasswork-config.js';
|
|
1
2
|
/**
|
|
2
3
|
* Type helper to recursively convert Date and Decimal fields in an object type
|
|
3
4
|
* - Date → string (ISO 8601)
|
|
4
|
-
* - Decimal → number
|
|
5
|
+
* - Decimal → number, or string when `TDecimals` is `'string'`
|
|
5
6
|
*
|
|
6
7
|
* Note: Decimal is from Prisma's Decimal.js, but we don't import the type
|
|
7
|
-
* to avoid hard dependency on @prisma/client
|
|
8
|
+
* to avoid hard dependency on @prisma/client. It is matched structurally through
|
|
9
|
+
* {@link PrismaDecimalLike}.
|
|
8
10
|
*/
|
|
9
|
-
export type SerializedTypes<T> = T extends Date ? string : T extends {
|
|
11
|
+
export type SerializedTypes<T, TDecimals extends DecimalSerialization = 'number'> = T extends Date ? string : T extends PrismaDecimalLike | {
|
|
10
12
|
constructor: {
|
|
11
13
|
name: 'Decimal';
|
|
12
14
|
};
|
|
13
|
-
} ? number : T extends Array<infer U> ? Array<SerializedTypes<U>> : T extends object ? {
|
|
14
|
-
[K in keyof T]: SerializedTypes<T[K]>;
|
|
15
|
+
} ? TDecimals extends 'string' ? string : number : T extends Array<infer U> ? Array<SerializedTypes<U, TDecimals>> : T extends object ? {
|
|
16
|
+
[K in keyof T]: SerializedTypes<T[K], TDecimals>;
|
|
15
17
|
} : T;
|
|
16
18
|
/**
|
|
17
19
|
* Type for a transformer function that converts a value to a serializable type
|
|
18
20
|
*/
|
|
19
21
|
export type TypeTransformer = (value: unknown) => unknown;
|
|
20
22
|
/**
|
|
21
|
-
* Configuration for type serialization
|
|
23
|
+
* Configuration for type serialization. Build one with {@link createSerializationConfig}, or
|
|
24
|
+
* list the transformers directly.
|
|
22
25
|
*/
|
|
23
|
-
export interface SerializationConfig {
|
|
26
|
+
export interface SerializationConfig<TDecimals extends DecimalSerialization = 'number'> {
|
|
24
27
|
/**
|
|
25
28
|
* Custom transformers to apply to specific types
|
|
26
29
|
* The function should return the transformed value or undefined if not applicable
|
|
27
30
|
*/
|
|
28
31
|
transformers: TypeTransformer[];
|
|
32
|
+
/**
|
|
33
|
+
* How the built-in transformer serializes Decimal values; `'number'` when absent. Set by
|
|
34
|
+
* {@link createSerializationConfig}, which picks the matching transformer.
|
|
35
|
+
*/
|
|
36
|
+
decimals?: TDecimals;
|
|
29
37
|
}
|
|
30
38
|
/**
|
|
31
|
-
*
|
|
39
|
+
* Build a serialization configuration: your transformers first, then the built-in Date and
|
|
40
|
+
* Decimal handling. `bootstrap()` builds the application-wide configuration this way from its
|
|
41
|
+
* `serialization` option; use this for calls to `serializePrismaTypes()` outside routes.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```typescript
|
|
45
|
+
* const config = createSerializationConfig({
|
|
46
|
+
* decimals: 'string',
|
|
47
|
+
* transformers: [moneyTransformer],
|
|
48
|
+
* });
|
|
49
|
+
*
|
|
50
|
+
* serializePrismaTypes({ price: new Decimal('10.50') }, config);
|
|
51
|
+
* // { price: '10.50' }
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export declare function createSerializationConfig<TDecimals extends DecimalSerialization = 'number'>(options?: {
|
|
55
|
+
decimals?: TDecimals;
|
|
56
|
+
transformers?: TypeTransformer[];
|
|
57
|
+
}): SerializationConfig<TDecimals>;
|
|
58
|
+
/**
|
|
59
|
+
* Default configuration with built-in transformers for Date and Decimal types (as numbers).
|
|
32
60
|
* Export this if you want to extend it with custom transformers.
|
|
33
61
|
*
|
|
34
62
|
* @example
|
|
@@ -51,7 +79,7 @@ export declare const defaultConfig: SerializationConfig;
|
|
|
51
79
|
*
|
|
52
80
|
* This utility handles the mismatch between Prisma's data types and API response DTOs:
|
|
53
81
|
* - Date objects → ISO 8601 strings
|
|
54
|
-
* - Decimal objects → numbers
|
|
82
|
+
* - Decimal objects → numbers, or strings with a `decimals: 'string'` configuration
|
|
55
83
|
*
|
|
56
84
|
* It preserves null values and handles nested objects and arrays.
|
|
57
85
|
* You can extend it with custom transformers for additional types.
|
|
@@ -62,8 +90,9 @@ export declare const defaultConfig: SerializationConfig;
|
|
|
62
90
|
* you'll need to use type assertions or `strictTypes: true` in your route handlers.
|
|
63
91
|
*
|
|
64
92
|
* @template T - The type of data to transform
|
|
93
|
+
* @template TDecimals - The Decimal serialization of `config`, which decides the result type
|
|
65
94
|
* @param data - The data to transform (object, array, or primitive)
|
|
66
|
-
* @param config - Optional configuration
|
|
95
|
+
* @param config - Optional configuration, see {@link createSerializationConfig}
|
|
67
96
|
* @returns The same structure with Prisma types converted to JSON-serializable types
|
|
68
97
|
*
|
|
69
98
|
* @example
|
|
@@ -103,7 +132,7 @@ export declare const defaultConfig: SerializationConfig;
|
|
|
103
132
|
* }
|
|
104
133
|
* ```
|
|
105
134
|
*/
|
|
106
|
-
export declare function serializePrismaTypes<T>(data: T, config?: SerializationConfig
|
|
135
|
+
export declare function serializePrismaTypes<T, TDecimals extends DecimalSerialization = 'number'>(data: T, config?: SerializationConfig<TDecimals>, _depth?: number, _ancestors?: WeakSet<object>): SerializedTypes<T, TDecimals>;
|
|
107
136
|
/**
|
|
108
137
|
* Type representing Prisma's Decimal type structure.
|
|
109
138
|
* We use a structural type to avoid importing from @prisma/client.
|
|
@@ -136,6 +165,8 @@ type DateFieldPattern = `${string}At` | `${string}Date` | `${string}Time` | `${s
|
|
|
136
165
|
* - For Date fields: Only string fields with conventional date names (ending in `At`, `Date`, `Time`, etc.)
|
|
137
166
|
* accept Date objects. Other string fields only accept strings.
|
|
138
167
|
* - For Decimal fields: All number fields accept Decimal-like objects (see rationale below).
|
|
168
|
+
* When `GlassworkConfig` declares `decimals: 'string'`, the non-date string fields accept
|
|
169
|
+
* them instead, because Decimals then serialize to strings.
|
|
139
170
|
* - Recursively applies to objects and arrays.
|
|
140
171
|
*
|
|
141
172
|
* **Date Field Detection:**
|
|
@@ -208,12 +239,17 @@ type DateFieldPattern = `${string}At` | `${string}Date` | `${string}Time` | `${s
|
|
|
208
239
|
*/
|
|
209
240
|
type WithDateSupport<T> = T extends string | infer Rest ? string | Date | Rest : T;
|
|
210
241
|
/**
|
|
211
|
-
*
|
|
212
|
-
|
|
242
|
+
* The type a Decimal serializes into, as declared in `GlassworkConfig` (`number` by default).
|
|
243
|
+
*/
|
|
244
|
+
type DecimalField = ConfiguredDecimalSerialization extends 'string' ? string : number;
|
|
245
|
+
/**
|
|
246
|
+
* Helper type to add Decimal support to the fields Decimals serialize into (including nullable
|
|
247
|
+
* ones). Preserves null and undefined in unions. Literal unions such as `'open' | 'closed'`
|
|
248
|
+
* and `1 | 2` stay as they are, because a Decimal never serializes into one of them.
|
|
213
249
|
*/
|
|
214
|
-
type WithDecimalSupport<T> =
|
|
250
|
+
type WithDecimalSupport<T> = DecimalField extends T ? T | PrismaDecimalLike : T;
|
|
215
251
|
export type AcceptPrismaTypes<T, AdditionalDatePatterns extends string = never> = T extends object ? T extends Array<infer U> ? Array<AcceptPrismaTypes<U, AdditionalDatePatterns>> : {
|
|
216
|
-
[K in keyof T]: K extends string ? K extends DateFieldPattern | AdditionalDatePatterns ? T[K] extends string | null | undefined ? WithDateSupport<T[K]> : AcceptPrismaTypes<T[K], AdditionalDatePatterns> : T[K] extends
|
|
252
|
+
[K in keyof T]: K extends string ? K extends DateFieldPattern | AdditionalDatePatterns ? T[K] extends string | null | undefined ? WithDateSupport<T[K]> : AcceptPrismaTypes<T[K], AdditionalDatePatterns> : T[K] extends DecimalField | null | undefined ? WithDecimalSupport<T[K]> : AcceptPrismaTypes<T[K], AdditionalDatePatterns> : AcceptPrismaTypes<T[K], AdditionalDatePatterns>;
|
|
217
253
|
} : T;
|
|
218
254
|
export {};
|
|
219
255
|
//# sourceMappingURL=serialize-prisma-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialize-prisma-types.d.ts","sourceRoot":"","sources":["../../src/utils/serialize-prisma-types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"serialize-prisma-types.d.ts","sourceRoot":"","sources":["../../src/utils/serialize-prisma-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,8BAA8B,EAC9B,oBAAoB,EACrB,MAAM,6BAA6B,CAAC;AAErC;;;;;;;;G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AC,SAAS,gBAAgB,GAAG,sBAAsB,GACjD,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,IAAI,GAAG,SAAS,GACpC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACrB,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,sBAAsB,CAAC,GACjD,CAAC,CAAC,CAAC,CAAC,SAAS,YAAY,GAAG,IAAI,GAAG,SAAS,GAC1C,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACxB,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,sBAAsB,CAAC,GACnD,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,sBAAsB,CAAC;CACpD,GACH,CAAC,CAAC"}
|
|
@@ -38,19 +38,51 @@ function isDecimal(value) {
|
|
|
38
38
|
return hasDecimalStructure || hasDecimalConstructor;
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
41
|
+
* Serialize a Decimal in plain notation with every digit and the stored scale. `toString()`
|
|
42
|
+
* and `toJSON()` switch to exponential notation for large and small values.
|
|
42
43
|
*/
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return
|
|
51
|
-
|
|
44
|
+
function decimalToString(value) {
|
|
45
|
+
return typeof value.toFixed === 'function' ? value.toFixed() : String(value);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Build the transformer that handles Date and Decimal types
|
|
49
|
+
*/
|
|
50
|
+
function createDefaultTransformer(decimals) {
|
|
51
|
+
return (value) => {
|
|
52
|
+
if (value instanceof Date) {
|
|
53
|
+
return value.toISOString();
|
|
54
|
+
}
|
|
55
|
+
if (isDecimal(value)) {
|
|
56
|
+
return decimals === 'string' ? decimalToString(value) : value.toNumber();
|
|
57
|
+
}
|
|
58
|
+
return undefined; // Not handled by this transformer
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Build a serialization configuration: your transformers first, then the built-in Date and
|
|
63
|
+
* Decimal handling. `bootstrap()` builds the application-wide configuration this way from its
|
|
64
|
+
* `serialization` option; use this for calls to `serializePrismaTypes()` outside routes.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```typescript
|
|
68
|
+
* const config = createSerializationConfig({
|
|
69
|
+
* decimals: 'string',
|
|
70
|
+
* transformers: [moneyTransformer],
|
|
71
|
+
* });
|
|
72
|
+
*
|
|
73
|
+
* serializePrismaTypes({ price: new Decimal('10.50') }, config);
|
|
74
|
+
* // { price: '10.50' }
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
export function createSerializationConfig(options = {}) {
|
|
78
|
+
const decimals = (options.decimals ?? 'number');
|
|
79
|
+
return {
|
|
80
|
+
decimals,
|
|
81
|
+
transformers: [...(options.transformers ?? []), createDefaultTransformer(decimals)],
|
|
82
|
+
};
|
|
83
|
+
}
|
|
52
84
|
/**
|
|
53
|
-
* Default configuration with built-in transformers for Date and Decimal types.
|
|
85
|
+
* Default configuration with built-in transformers for Date and Decimal types (as numbers).
|
|
54
86
|
* Export this if you want to extend it with custom transformers.
|
|
55
87
|
*
|
|
56
88
|
* @example
|
|
@@ -67,15 +99,13 @@ const defaultTransformer = (value) => {
|
|
|
67
99
|
* serializePrismaTypes(data, customConfig);
|
|
68
100
|
* ```
|
|
69
101
|
*/
|
|
70
|
-
export const defaultConfig =
|
|
71
|
-
transformers: [defaultTransformer],
|
|
72
|
-
};
|
|
102
|
+
export const defaultConfig = createSerializationConfig();
|
|
73
103
|
/**
|
|
74
104
|
* Recursively converts Prisma types to JSON-serializable equivalents.
|
|
75
105
|
*
|
|
76
106
|
* This utility handles the mismatch between Prisma's data types and API response DTOs:
|
|
77
107
|
* - Date objects → ISO 8601 strings
|
|
78
|
-
* - Decimal objects → numbers
|
|
108
|
+
* - Decimal objects → numbers, or strings with a `decimals: 'string'` configuration
|
|
79
109
|
*
|
|
80
110
|
* It preserves null values and handles nested objects and arrays.
|
|
81
111
|
* You can extend it with custom transformers for additional types.
|
|
@@ -86,8 +116,9 @@ export const defaultConfig = {
|
|
|
86
116
|
* you'll need to use type assertions or `strictTypes: true` in your route handlers.
|
|
87
117
|
*
|
|
88
118
|
* @template T - The type of data to transform
|
|
119
|
+
* @template TDecimals - The Decimal serialization of `config`, which decides the result type
|
|
89
120
|
* @param data - The data to transform (object, array, or primitive)
|
|
90
|
-
* @param config - Optional configuration
|
|
121
|
+
* @param config - Optional configuration, see {@link createSerializationConfig}
|
|
91
122
|
* @returns The same structure with Prisma types converted to JSON-serializable types
|
|
92
123
|
*
|
|
93
124
|
* @example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialize-prisma-types.js","sourceRoot":"","sources":["../../src/utils/serialize-prisma-types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"serialize-prisma-types.js","sourceRoot":"","sources":["../../src/utils/serialize-prisma-types.ts"],"names":[],"mappings":"AA8DA;;;GAGG;AACH,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAEnC;;;;;;;;;GASG;AACH,SAAS,SAAS,CAAC,KAAc;IAC/B,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAChD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,4BAA4B;IAC5B,IAAI,CAAC,CAAC,UAAU,IAAI,KAAK,CAAC,IAAI,OAAQ,KAAgC,CAAC,QAAQ,KAAK,UAAU,EAAE,CAAC;QAC/F,OAAO,KAAK,CAAC;IACf,CAAC;IAED,oEAAoE;IACpE,MAAM,mBAAmB,GACvB,GAAG,IAAI,KAAK;QACZ,GAAG,IAAI,KAAK;QACZ,GAAG,IAAI,KAAK;QACZ,OAAQ,KAAyB,CAAC,CAAC,KAAK,QAAQ;QAChD,OAAQ,KAAyB,CAAC,CAAC,KAAK,QAAQ;QAChD,KA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,CAC/B,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC,EAAE,UAAU,CAAC,CACjD,CAAC;QACZ,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,kCAAkC;QAC3D,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,iBAAiB;IACjB,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACrB,MAAM,MAAM,GAA4B,EAAE,CAAC;QAC3C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YAChD,MAAM,CAAC,GAAG,CAAC,GAAG,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC,EAAE,UAAU,CAAC,CAAC;QAC5E,CAAC;QACD,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,kCAAkC;QAC3D,OAAO,MAAgB,CAAC;IAC1B,CAAC;IAED,0BAA0B;IAC1B,OAAO,IAAc,CAAC;AACxB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "glasswork",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "A transparent, Lambda-optimized web framework for building OpenAPI-compliant REST APIs.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -41,11 +41,41 @@
|
|
|
41
41
|
"import": "./dist/jobs/index.js",
|
|
42
42
|
"default": "./dist/jobs/index.js"
|
|
43
43
|
},
|
|
44
|
+
"./jobs/sqs": {
|
|
45
|
+
"types": "./dist/jobs/sqs.d.ts",
|
|
46
|
+
"import": "./dist/jobs/sqs.js",
|
|
47
|
+
"default": "./dist/jobs/sqs.js"
|
|
48
|
+
},
|
|
49
|
+
"./jobs/scheduler": {
|
|
50
|
+
"types": "./dist/jobs/scheduler.d.ts",
|
|
51
|
+
"import": "./dist/jobs/scheduler.js",
|
|
52
|
+
"default": "./dist/jobs/scheduler.js"
|
|
53
|
+
},
|
|
44
54
|
"./email": {
|
|
45
55
|
"types": "./dist/email/index.d.ts",
|
|
46
56
|
"import": "./dist/email/index.js",
|
|
47
57
|
"default": "./dist/email/index.js"
|
|
48
58
|
},
|
|
59
|
+
"./email/ses": {
|
|
60
|
+
"types": "./dist/email/ses.d.ts",
|
|
61
|
+
"import": "./dist/email/ses.js",
|
|
62
|
+
"default": "./dist/email/ses.js"
|
|
63
|
+
},
|
|
64
|
+
"./email/smtp": {
|
|
65
|
+
"types": "./dist/email/smtp.d.ts",
|
|
66
|
+
"import": "./dist/email/smtp.js",
|
|
67
|
+
"default": "./dist/email/smtp.js"
|
|
68
|
+
},
|
|
69
|
+
"./email/compiler": {
|
|
70
|
+
"types": "./dist/email/compiler/index.d.ts",
|
|
71
|
+
"import": "./dist/email/compiler/index.js",
|
|
72
|
+
"default": "./dist/email/compiler/index.js"
|
|
73
|
+
},
|
|
74
|
+
"./email/webhooks": {
|
|
75
|
+
"types": "./dist/email/webhooks/index.d.ts",
|
|
76
|
+
"import": "./dist/email/webhooks/index.js",
|
|
77
|
+
"default": "./dist/email/webhooks/index.js"
|
|
78
|
+
},
|
|
49
79
|
"./uploads": {
|
|
50
80
|
"types": "./dist/uploads/index.d.ts",
|
|
51
81
|
"import": "./dist/uploads/index.js",
|
|
@@ -120,9 +150,10 @@
|
|
|
120
150
|
"lint": "biome check . --write",
|
|
121
151
|
"lint:ci": "biome check .",
|
|
122
152
|
"typecheck": "prisma generate --schema test/rls/fixtures/schema.prisma && tsc --noEmit && tsc --noEmit -p tsconfig.rls-tests.json && tsc --noEmit -p tsconfig.scripts.json",
|
|
123
|
-
"typecheck:strict": "tsc --noEmit -p tsconfig.strict.json",
|
|
153
|
+
"typecheck:strict": "prisma generate --schema test/rls/fixtures/schema.prisma && tsc --noEmit -p tsconfig.strict.json",
|
|
124
154
|
"smoke:pack": "npm run build:scripts && node .scripts/smoke-pack-consumer.js",
|
|
125
|
-
"
|
|
155
|
+
"consumer:reference": "npm run build:scripts && node .scripts/reference-consumer.js",
|
|
156
|
+
"verify": "npm run typecheck && npm run typecheck:strict && npm run lint:ci && npm run build && npm run test && npm run smoke:pack",
|
|
126
157
|
"prepublishOnly": "npm run verify",
|
|
127
158
|
"docs:dev": "vitepress dev docs",
|
|
128
159
|
"docs:build": "vitepress build docs",
|
|
@@ -150,6 +181,7 @@
|
|
|
150
181
|
"dotenv": "^17.0.0",
|
|
151
182
|
"hono": "^4.12.0",
|
|
152
183
|
"hono-openapi": "^1.3.0",
|
|
184
|
+
"nodemailer": ">=7.0.0",
|
|
153
185
|
"valibot": "^1.4.0"
|
|
154
186
|
},
|
|
155
187
|
"peerDependenciesMeta": {
|
|
@@ -197,6 +229,9 @@
|
|
|
197
229
|
},
|
|
198
230
|
"dotenv": {
|
|
199
231
|
"optional": true
|
|
232
|
+
},
|
|
233
|
+
"nodemailer": {
|
|
234
|
+
"optional": true
|
|
200
235
|
}
|
|
201
236
|
},
|
|
202
237
|
"devDependencies": {
|
|
@@ -213,26 +248,28 @@
|
|
|
213
248
|
"@casl/ability": "^7.0.1",
|
|
214
249
|
"@casl/prisma": "^2.0.2",
|
|
215
250
|
"@hono/swagger-ui": "^0.6.1",
|
|
216
|
-
"@prisma/adapter-pg": "7.10.
|
|
217
|
-
"@prisma/client": "^7.10.
|
|
251
|
+
"@prisma/adapter-pg": "7.10.1",
|
|
252
|
+
"@prisma/client": "^7.10.1",
|
|
218
253
|
"@types/aws-lambda": "^8.10.163",
|
|
219
254
|
"@types/node": "^26.5.0",
|
|
220
|
-
"@
|
|
255
|
+
"@types/swagger-ui-dist": "^3.30.6",
|
|
256
|
+
"@vitest/coverage-v8": "^4.1.12",
|
|
221
257
|
"awilix": "^13.0.5",
|
|
222
|
-
"better-auth": "^1.7.
|
|
258
|
+
"better-auth": "^1.7.15",
|
|
223
259
|
"dotenv": "^17.4.2",
|
|
224
|
-
"hono": "^4.13.
|
|
260
|
+
"hono": "^4.13.16",
|
|
225
261
|
"hono-openapi": "^1.3.2",
|
|
226
262
|
"mermaid": "^11.17.2",
|
|
227
|
-
"mjml": "^5.4.
|
|
263
|
+
"mjml": "^5.4.1",
|
|
264
|
+
"nodemailer": "^10.1.7",
|
|
228
265
|
"postal-mime": "^2.7.6",
|
|
229
|
-
"prisma": "7.10.
|
|
266
|
+
"prisma": "7.10.1",
|
|
230
267
|
"typescript": "^7.0.2",
|
|
231
268
|
"valibot": "^1.4.2",
|
|
232
269
|
"vitepress": "^1.6.4",
|
|
233
270
|
"vitepress-plugin-llms": "^1.13.5",
|
|
234
271
|
"vitepress-plugin-mermaid": "^2.0.17",
|
|
235
|
-
"vitest": "^4.1.
|
|
272
|
+
"vitest": "^4.1.12",
|
|
236
273
|
"vue": "^3.5.42",
|
|
237
274
|
"yaml": "^2.9.1"
|
|
238
275
|
},
|
|
@@ -240,8 +277,15 @@
|
|
|
240
277
|
"@hono/standard-validator": "^0.2.3",
|
|
241
278
|
"@hono/valibot-validator": "^0.6.1",
|
|
242
279
|
"@valibot/to-json-schema": "^1.7.1",
|
|
243
|
-
"deepmerge": "^4.3.1",
|
|
244
280
|
"nanoid": "^5.1.16",
|
|
245
281
|
"openapi-types": "^12.1.3"
|
|
282
|
+
},
|
|
283
|
+
"overrides": {
|
|
284
|
+
"vitepress": {
|
|
285
|
+
"vite": "^6.4.5"
|
|
286
|
+
},
|
|
287
|
+
"mermaid": {
|
|
288
|
+
"katex": "^0.18.2"
|
|
289
|
+
}
|
|
246
290
|
}
|
|
247
291
|
}
|