@venizia/ignis-kernel 0.2.0-10 → 0.2.0-12
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/dist/cjs/base/auth/authorize/builders/policy.builder.d.ts +15 -0
- package/dist/cjs/base/auth/authorize/builders/policy.builder.d.ts.map +1 -1
- package/dist/cjs/base/auth/authorize/builders/policy.builder.js +22 -0
- package/dist/cjs/base/auth/authorize/builders/policy.builder.js.map +1 -1
- package/dist/cjs/base/events/common/constants.d.ts +32 -0
- package/dist/cjs/base/events/common/constants.d.ts.map +1 -1
- package/dist/cjs/base/events/common/constants.js +34 -1
- package/dist/cjs/base/events/common/constants.js.map +1 -1
- package/dist/cjs/base/events/common/types.d.ts +41 -3
- package/dist/cjs/base/events/common/types.d.ts.map +1 -1
- package/dist/cjs/base/events/event-bus.d.ts +45 -8
- package/dist/cjs/base/events/event-bus.d.ts.map +1 -1
- package/dist/cjs/base/events/event-bus.js +144 -24
- package/dist/cjs/base/events/event-bus.js.map +1 -1
- package/dist/cjs/base/models/common/types.d.ts +20 -0
- package/dist/cjs/base/models/common/types.d.ts.map +1 -1
- package/dist/cjs/base/models/common/types.js +9 -1
- package/dist/cjs/base/models/common/types.js.map +1 -1
- package/dist/esm/base/auth/authorize/builders/policy.builder.d.ts +15 -0
- package/dist/esm/base/auth/authorize/builders/policy.builder.d.ts.map +1 -1
- package/dist/esm/base/auth/authorize/builders/policy.builder.js +23 -1
- package/dist/esm/base/auth/authorize/builders/policy.builder.js.map +1 -1
- package/dist/esm/base/events/common/constants.d.ts +32 -0
- package/dist/esm/base/events/common/constants.d.ts.map +1 -1
- package/dist/esm/base/events/common/constants.js +32 -0
- package/dist/esm/base/events/common/constants.js.map +1 -1
- package/dist/esm/base/events/common/types.d.ts +41 -3
- package/dist/esm/base/events/common/types.d.ts.map +1 -1
- package/dist/esm/base/events/event-bus.d.ts +45 -8
- package/dist/esm/base/events/event-bus.d.ts.map +1 -1
- package/dist/esm/base/events/event-bus.js +145 -25
- package/dist/esm/base/events/event-bus.js.map +1 -1
- package/dist/esm/base/models/common/types.d.ts +20 -0
- package/dist/esm/base/models/common/types.d.ts.map +1 -1
- package/dist/esm/base/models/common/types.js +7 -0
- package/dist/esm/base/models/common/types.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,29 +1,143 @@
|
|
|
1
1
|
import { BaseHelper, getError, RetryBackoffStrategies, RetryHelper, RetryJitterModes, } from '@venizia/ignis-helpers/core';
|
|
2
2
|
import isEmpty from 'lodash/isEmpty';
|
|
3
|
-
import { EventDispatchRetry } from './common/constants.js';
|
|
3
|
+
import { EventDispatchRetry, EventHandlerTypes } from './common/constants.js';
|
|
4
4
|
/** In-process, fire-and-forget domain event bus. `TPayloadMap` keys the event names, so a wrong name
|
|
5
|
-
* or payload shape is a compile error. Delivery is always async
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* or payload shape is a compile error. Delivery is always async. Retry timing is a property of the
|
|
6
|
+
* handler's own failure mode, not of the event, so `register` may tune it per registration. But
|
|
7
|
+
* nobody awaits a fire-and-forget dispatch, so an unbounded window would let one event hold a
|
|
8
|
+
* handler - and whatever it holds open, e.g. a database connection - for an unbounded time with no
|
|
9
|
+
* one to report it. What the bus guarantees instead: a bounded MAXIMUM time a single dispatch can
|
|
10
|
+
* occupy, enforced as a hard ceiling at `register()` - see `EventDispatchRetry`. Retry makes
|
|
11
|
+
* delivery at-least-once: handlers must be idempotent, see `IEventHandler`. */
|
|
8
12
|
export class EventBus extends BaseHelper {
|
|
9
13
|
constructor(opts) {
|
|
10
14
|
super({ scope: opts.scope ?? EventBus.name });
|
|
11
15
|
this.container = opts.container;
|
|
12
|
-
this.
|
|
16
|
+
this.registrationsByName = new Map();
|
|
13
17
|
}
|
|
18
|
+
/** The pre-jitter total of every inter-attempt delay `maxAttempts`/`baseDelayMs` would produce -
|
|
19
|
+
* jitter (always on, see `dispatch`) only ever shrinks a delay, so this is a true upper bound. */
|
|
20
|
+
static computeTotalWindowMs(opts) {
|
|
21
|
+
const { maxAttempts, baseDelayMs } = opts;
|
|
22
|
+
let totalWindowMs = 0;
|
|
23
|
+
for (let attempt = 1; attempt < maxAttempts; attempt++) {
|
|
24
|
+
totalWindowMs += RetryHelper.computeBackoffDelayMs({
|
|
25
|
+
attempt,
|
|
26
|
+
backoff: {
|
|
27
|
+
strategy: RetryBackoffStrategies.EXPONENTIAL,
|
|
28
|
+
initialDelayMs: baseDelayMs,
|
|
29
|
+
jitter: RetryJitterModes.NONE,
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return totalWindowMs;
|
|
34
|
+
}
|
|
35
|
+
/** Loud rejection, never a silent clamp: a caller who believes a number the bus does not honour is
|
|
36
|
+
* worse off than one who sees the ceiling at boot. */
|
|
37
|
+
static assertValidRetry(opts) {
|
|
38
|
+
const { name, maxAttempts, baseDelayMs } = opts;
|
|
39
|
+
if (!Number.isInteger(maxAttempts) || maxAttempts < 1) {
|
|
40
|
+
throw getError({
|
|
41
|
+
message: `[EventBus][register] retry.maxAttempts must be a positive integer | name: ${name} | Got: ${maxAttempts}`,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
if (!Number.isInteger(baseDelayMs) || baseDelayMs < 1) {
|
|
45
|
+
throw getError({
|
|
46
|
+
message: `[EventBus][register] retry.baseDelayMs must be a positive integer | name: ${name} | Got: ${baseDelayMs}`,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
if (maxAttempts > EventDispatchRetry.MAX_ATTEMPTS_CEILING) {
|
|
50
|
+
throw getError({
|
|
51
|
+
message: `[EventBus][register] retry.maxAttempts exceeds the ceiling | name: ${name} | Got: ${maxAttempts} | Ceiling: ${EventDispatchRetry.MAX_ATTEMPTS_CEILING} | Lower retry.maxAttempts`,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
const totalWindowMs = EventBus.computeTotalWindowMs({ maxAttempts, baseDelayMs });
|
|
55
|
+
if (totalWindowMs > EventDispatchRetry.MAX_TOTAL_WINDOW_MS) {
|
|
56
|
+
throw getError({
|
|
57
|
+
message: `[EventBus][register] retry window exceeds the ceiling | name: ${name} | Got: ${totalWindowMs}ms | Ceiling: ${EventDispatchRetry.MAX_TOTAL_WINDOW_MS}ms | Lower retry.maxAttempts or retry.baseDelayMs`,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Turns `handler` into a uniform invoker plus a description for the exhaustion log line.
|
|
63
|
+
* `BINDING_KEY` resolves through the container INSIDE the returned closure, so every call re-reads
|
|
64
|
+
* the current binding; `FUNCTION` calls `fn` directly, so the closure IS the resolution - there is
|
|
65
|
+
* nothing left to re-read on a later attempt. The tag (`handler.type`) is what this switches on,
|
|
66
|
+
* not which field happens to be present - see `EventHandlerTypes`' doc.
|
|
67
|
+
*/
|
|
68
|
+
static buildHandlerInvoker(opts) {
|
|
69
|
+
const { container, handler, name } = opts;
|
|
70
|
+
if (isEmpty(handler)) {
|
|
71
|
+
throw getError({
|
|
72
|
+
message: `[EventBus][register] Invalid handler | name: ${name} | Got: ${handler}`,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
switch (handler.type) {
|
|
76
|
+
case EventHandlerTypes.BINDING_KEY: {
|
|
77
|
+
const { key } = handler;
|
|
78
|
+
if (isEmpty(key)) {
|
|
79
|
+
throw getError({
|
|
80
|
+
message: `[EventBus][register] Invalid handler.key | name: ${name} | Got: ${key}`,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
invokeHandler: ({ event }) => container.get({ key }).handle({ event }),
|
|
85
|
+
description: `binding-key:${key}`,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
case EventHandlerTypes.FUNCTION: {
|
|
89
|
+
const { fn } = handler;
|
|
90
|
+
if (typeof fn !== 'function') {
|
|
91
|
+
throw getError({
|
|
92
|
+
message: `[EventBus][register] Invalid handler.fn | name: ${name} | Expected a function | Got: ${typeof fn}`,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
invokeHandler: ({ event }) => fn({ event }),
|
|
97
|
+
description: `function:${fn.name || 'anonymous'}`,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
default: {
|
|
101
|
+
throw getError({
|
|
102
|
+
message: `[EventBus][register] Unknown handler.type | name: ${name} | Expected one of: ${[...EventHandlerTypes.SCHEME_SET].join(', ')} | Got: ${handler.type}`,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* `retry` is optional and per REGISTRATION, not per publish: the right window belongs to the
|
|
109
|
+
* handler's own failure mode, and two handlers on the same event name may each pick their own.
|
|
110
|
+
* Omitting it reproduces today's `EventDispatchRetry` defaults exactly. Both `maxAttempts` and the
|
|
111
|
+
* total backoff window it implies are bounded - see `EventDispatchRetry` - and exceeding either
|
|
112
|
+
* throws here, at boot where a human sees it, rather than being silently clamped at dispatch time.
|
|
113
|
+
*/
|
|
14
114
|
register(opts) {
|
|
15
|
-
const { name,
|
|
16
|
-
if (isEmpty(name)
|
|
115
|
+
const { name, handler, retry } = opts;
|
|
116
|
+
if (isEmpty(name)) {
|
|
17
117
|
throw getError({
|
|
18
|
-
message: `[EventBus][register] Invalid registration | name: ${String(name)}
|
|
118
|
+
message: `[EventBus][register] Invalid registration | name: ${String(name)}`,
|
|
19
119
|
});
|
|
20
120
|
}
|
|
21
|
-
const
|
|
121
|
+
const maxAttempts = retry?.maxAttempts ?? EventDispatchRetry.MAX_ATTEMPTS;
|
|
122
|
+
const baseDelayMs = retry?.baseDelayMs ?? EventDispatchRetry.BASE_DELAY_MS;
|
|
123
|
+
EventBus.assertValidRetry({ name, maxAttempts, baseDelayMs });
|
|
124
|
+
const { invokeHandler, description } = EventBus.buildHandlerInvoker({
|
|
125
|
+
container: this.container,
|
|
126
|
+
handler,
|
|
127
|
+
name,
|
|
128
|
+
});
|
|
129
|
+
const registration = {
|
|
130
|
+
invokeHandler,
|
|
131
|
+
description,
|
|
132
|
+
maxAttempts,
|
|
133
|
+
baseDelayMs,
|
|
134
|
+
};
|
|
135
|
+
const existing = this.registrationsByName.get(name);
|
|
22
136
|
if (existing) {
|
|
23
|
-
existing.push(
|
|
137
|
+
existing.push(registration);
|
|
24
138
|
return;
|
|
25
139
|
}
|
|
26
|
-
this.
|
|
140
|
+
this.registrationsByName.set(name, [registration]);
|
|
27
141
|
}
|
|
28
142
|
/**
|
|
29
143
|
* Never blocks and never throws back to the caller: dispatch runs outside this call's flow via
|
|
@@ -38,55 +152,61 @@ export class EventBus extends BaseHelper {
|
|
|
38
152
|
occurredAt: new Date().toISOString(),
|
|
39
153
|
traceId,
|
|
40
154
|
};
|
|
41
|
-
const
|
|
42
|
-
if (!
|
|
155
|
+
const registrations = this.registrationsByName.get(name);
|
|
156
|
+
if (!registrations?.length) {
|
|
43
157
|
// A typo is already a compile error, so at runtime this only means nobody is listening yet -
|
|
44
158
|
// a legitimate state on a fire-and-forget bus, not an incident.
|
|
45
159
|
this.logger.debug('[publish] No handler registered | name: %s | traceId: %s', name, traceId);
|
|
46
160
|
return;
|
|
47
161
|
}
|
|
48
|
-
for (const
|
|
162
|
+
for (const registration of registrations) {
|
|
49
163
|
queueMicrotask(() => {
|
|
50
164
|
// `dispatch` catches every failure path itself and never rejects - this `.catch` is an
|
|
51
165
|
// unreachable backstop, kept (and logged) rather than left floating, for the day it isn't.
|
|
52
|
-
this.dispatch({ event,
|
|
166
|
+
this.dispatch({ event, registration }).catch((error) => {
|
|
53
167
|
this.logger.error('[publish] Unexpected dispatch failure | name: %s | Error: %s', event.name, error);
|
|
54
168
|
});
|
|
55
169
|
});
|
|
56
170
|
}
|
|
57
171
|
}
|
|
58
172
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
173
|
+
* Attempts/backoff come from the registration (`EventDispatchRetry`'s defaults when omitted),
|
|
174
|
+
* always with full jitter - `RetryJitterModes.FULL` decorrelates a shared-resource pile-up hardest,
|
|
175
|
+
* so many handlers retrying the same lock do not collide on the same instant a second and third
|
|
176
|
+
* time. `invokeHandler` already encodes whether that re-resolves (`BINDING_KEY`) or was captured
|
|
177
|
+
* once (`FUNCTION`) - see `buildHandlerInvoker` - so this method calls it uniformly. A handler that
|
|
178
|
+
* throws synchronously is caught exactly like one that returns a rejected promise: `execution`
|
|
179
|
+
* here is itself `async`, and JS converts a synchronous throw inside an async function body into a
|
|
180
|
+
* rejection of that function's own promise - `RetryHelper.executeWithRetry`'s attempt loop never
|
|
181
|
+
* sees the difference.
|
|
62
182
|
*
|
|
63
183
|
* `RetryHelper.executeWithRetry` is used without its own `logger` - its internal per-attempt/exhaustion
|
|
64
184
|
* logging knows nothing about the event name or `traceId`, so it cannot be the trace anyone
|
|
65
185
|
* relies on. The one line below, logged only on final failure, is.
|
|
66
186
|
*/
|
|
67
187
|
async dispatch(opts) {
|
|
68
|
-
const { event,
|
|
188
|
+
const { event, registration } = opts;
|
|
189
|
+
const { invokeHandler, description, maxAttempts, baseDelayMs } = registration;
|
|
69
190
|
let lastAttempt = 0;
|
|
70
191
|
try {
|
|
71
192
|
await RetryHelper.executeWithRetry({
|
|
72
193
|
operation: `EventBus.dispatch:${event.name}`,
|
|
73
|
-
maxAttempts
|
|
194
|
+
maxAttempts,
|
|
74
195
|
backoff: {
|
|
75
196
|
strategy: RetryBackoffStrategies.EXPONENTIAL,
|
|
76
|
-
initialDelayMs:
|
|
77
|
-
jitter: RetryJitterModes.
|
|
197
|
+
initialDelayMs: baseDelayMs,
|
|
198
|
+
jitter: RetryJitterModes.FULL,
|
|
78
199
|
},
|
|
79
200
|
execution: async ({ attempt }) => {
|
|
80
201
|
lastAttempt = attempt;
|
|
81
|
-
|
|
82
|
-
await handler.handle({ event });
|
|
202
|
+
await invokeHandler({ event });
|
|
83
203
|
},
|
|
84
204
|
});
|
|
85
205
|
}
|
|
86
206
|
catch (error) {
|
|
87
207
|
// The only trace this failure leaves: it is caught here and never reaches the publisher, so
|
|
88
208
|
// the event name, traceId and attempt count all have to be on this one line.
|
|
89
|
-
this.logger.error('[dispatch] Handler exhausted retries | name: %s | traceId: %s | attempts: %d |
|
|
209
|
+
this.logger.error('[dispatch] Handler exhausted retries | name: %s | traceId: %s | attempts: %d | handler: %s | Error: %s', event.name, event.traceId, lastAttempt, description, error);
|
|
90
210
|
}
|
|
91
211
|
}
|
|
92
212
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-bus.js","sourceRoot":"","sources":["../../../../src/base/events/event-bus.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"event-bus.js","sourceRoot":"","sources":["../../../../src/base/events/event-bus.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,UAAU,EACV,QAAQ,EACR,sBAAsB,EACtB,WAAW,EACX,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AACrC,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAqB3E;;;;;;;+EAO+E;AAC/E,MAAM,OAAO,QAAqC,SAAQ,UAAU;IAOlE,YAAY,IAA8C;QACxD,KAAK,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;QAC9C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAChC,IAAI,CAAC,mBAAmB,GAAG,IAAI,GAAG,EAAE,CAAC;IACvC,CAAC;IAED;sGACkG;IAC1F,MAAM,CAAC,oBAAoB,CAAC,IAAkD;QACpF,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;QAC1C,IAAI,aAAa,GAAG,CAAC,CAAC;QAEtB,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,GAAG,WAAW,EAAE,OAAO,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AY,CAAC;QAC9E,IAAI,WAAW,GAAG,CAAC,CAAC;QAEpB,IAAI,CAAC;YACH,MAAM,WAAW,CAAC,gBAAgB,CAAC;gBACjC,SAAS,EAAE,qBAAqB,KAAK,CAAC,IAAI,EAAE;gBAC5C,WAAW;gBACX,OAAO,EAAE;oBACP,QAAQ,EAAE,sBAAsB,CAAC,WAAW;oBAC5C,cAAc,EAAE,WAAW;oBAC3B,MAAM,EAAE,gBAAgB,CAAC,IAAI;iBAC9B;gBACD,SAAS,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;oBAC/B,WAAW,GAAG,OAAO,CAAC;oBACtB,MAAM,aAAa,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;gBACjC,CAAC;aACF,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,4FAA4F;YAC5F,6EAA6E;YAC7E,IAAI,CAAC,MAAM,CAAC,KAAK,CACf,wGAAwG,EACxG,KAAK,CAAC,IAAI,EACV,KAAK,CAAC,OAAO,EACb,WAAW,EACX,WAAW,EACX,KAAK,CACN,CAAC;QACJ,CAAC;IACH,CAAC;CACF"}
|
|
@@ -21,6 +21,26 @@ export type NumberIdType = number;
|
|
|
21
21
|
export type StringIdType = string;
|
|
22
22
|
export type BigIntIdType = bigint;
|
|
23
23
|
export type IdType = NumberIdType | StringIdType | BigIntIdType;
|
|
24
|
+
declare const entityIdBrand: unique symbol;
|
|
25
|
+
/**
|
|
26
|
+
* A string id a plain `string` cannot be assigned to, so passing a name, code or email where an id
|
|
27
|
+
* belongs is a compile error. Opt a column in with `.$type<TEntityId>()`.
|
|
28
|
+
*
|
|
29
|
+
* IT VALIDATES NOTHING. `toEntityId` is a cast with a non-empty check; the value is making the
|
|
30
|
+
* laundering VISIBLE at each boundary, not proving the string is a real id.
|
|
31
|
+
*
|
|
32
|
+
* The cost is not optional: Drizzle derives `$inferInsert` and `$inferSelect` from the same field,
|
|
33
|
+
* so a branded column rejects every literal - `create({ data: { merchantId: 'M1' } })`, seeds,
|
|
34
|
+
* fixtures, path params - until each converts. A union with `string` would restore those but makes
|
|
35
|
+
* a plain `string` assignable again, which erases the whole guarantee. Measured, not assumed.
|
|
36
|
+
*/
|
|
37
|
+
export type TEntityId = string & {
|
|
38
|
+
readonly [entityIdBrand]: never;
|
|
39
|
+
};
|
|
40
|
+
/** The only way into `TEntityId`. Rejects an empty string - an id that is `''` collapses a `where` to no condition. */
|
|
41
|
+
export declare const toEntityId: (opts: {
|
|
42
|
+
value: string;
|
|
43
|
+
}) => TEntityId;
|
|
24
44
|
/** Path-param id shape every entity family resolves to (`AbstractEntity.getIdType()`). */
|
|
25
45
|
export type TIdSchemaType = 'number' | 'string';
|
|
26
46
|
export declare const idParamsSchema: (opts?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/base/models/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAItC;;;;;GAKG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;iBA6BpB,CAAC;AAEL,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAClC,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAClC,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAClC,MAAM,MAAM,MAAM,GAAG,YAAY,GAAG,YAAY,GAAG,YAAY,CAAC;AAEhE,0FAA0F;AAC1F,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEhD,eAAO,MAAM,cAAc,GAAI,OAAO;IAAE,MAAM,EAAE,aAAa,CAAA;CAAE;;;;iBAkC9D,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,MAAM;IACrD,MAAM,EAAE,CAAC,CAAC;IACV,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CA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Z,CAAC,CAAC,CAAC,CAAC;CACT,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,OAAO,CAAC,0SAW7D,CAAC"}
|
|
@@ -37,6 +37,13 @@ export const ErrorSchema = z
|
|
|
37
37
|
details: { url: 'http://localhost:3000/categories', path: '/categories' },
|
|
38
38
|
},
|
|
39
39
|
});
|
|
40
|
+
/** The only way into `TEntityId`. Rejects an empty string - an id that is `''` collapses a `where` to no condition. */
|
|
41
|
+
export const toEntityId = (opts) => {
|
|
42
|
+
if (opts.value.length === 0) {
|
|
43
|
+
throw getError({ message: '[toEntityId] Refusing an empty string as an entity id' });
|
|
44
|
+
}
|
|
45
|
+
return opts.value;
|
|
46
|
+
};
|
|
40
47
|
export const idParamsSchema = (opts) => {
|
|
41
48
|
const { idType = 'number' } = opts ?? {};
|
|
42
49
|
switch (idType) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/base/models/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAErD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC;KACzB,MAAM,CAAC;IACN,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,UAAU,EAAE,CAAC;SACV,MAAM,CAAC;QACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,GAA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
-
"version": "0.2.0-
|
|
3
|
+
"version": "0.2.0-12",
|
|
4
4
|
"description": "Browser-pure kernel of the IGNIS framework: dependency injection, lifecycle, REST controllers, repository and datasource abstractions, and the authentication and authorization seams. No node builtin and no server-only peer, so the same kernel serves a Bun server and a browser Worker.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"authentication",
|