prisma-generator-express 1.62.4 → 1.63.0
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/README.md +234 -95
- package/dist/generators/generateRouteConfigType.js +26 -6
- package/dist/generators/generateRouteConfigType.js.map +1 -1
- package/dist/generators/generateRouter.js +192 -27
- package/dist/generators/generateRouter.js.map +1 -1
- package/dist/generators/generateRouterFastify.js +100 -28
- package/dist/generators/generateRouterFastify.js.map +1 -1
- package/dist/generators/generateRouterHono.js +104 -36
- package/dist/generators/generateRouterHono.js.map +1 -1
- package/dist/utils/copyFiles.js +2 -0
- package/dist/utils/copyFiles.js.map +1 -1
- package/package.json +1 -1
- package/src/copy/docsRenderer.ts +1 -0
- package/src/copy/guardVariantError.ts +28 -0
- package/src/copy/guardVariantRouting.ts +109 -0
- package/src/copy/projectionDefaults.ts +5 -6
- package/src/copy/routeConfig.hono.ts +15 -5
- package/src/copy/routeConfig.ts +220 -27
- package/src/generators/generateRouteConfigType.ts +37 -6
- package/src/generators/generateRouter.ts +192 -27
- package/src/generators/generateRouterFastify.ts +100 -28
- package/src/generators/generateRouterHono.ts +104 -36
- package/src/utils/copyFiles.ts +2 -0
|
@@ -105,9 +105,17 @@ import type {
|
|
|
105
105
|
import { parseQueryParams } from '../parseQueryParams${ext}'
|
|
106
106
|
import { normalizePrefix, getEnv, sanitizeKeys, isPlainObject } from '../misc${ext}'
|
|
107
107
|
import { buildModelOpenApi } from '../buildModelOpenApi${ext}'
|
|
108
|
-
import {
|
|
108
|
+
import {
|
|
109
|
+
normalizeOperation,
|
|
110
|
+
resolveOperationVariantKey,
|
|
111
|
+
validateCountSourceWhere,
|
|
112
|
+
validateOperationConfig,
|
|
113
|
+
validateUpdateEachConfig,
|
|
114
|
+
} from '../routeConfig${ext}'
|
|
115
|
+
import type { NormalizedOperationConfig } from '../routeConfig${ext}'
|
|
109
116
|
import { transformResult } from '../operationRuntime${ext}'
|
|
110
117
|
import { mapError } from '../errorMapper${ext}'
|
|
118
|
+
import { formatGuardVariantResolutionError } from '../guardVariantError${ext}'
|
|
111
119
|
import { mergePaginationConfig } from '../pagination${ext}'
|
|
112
120
|
import { applyDroppedGuard } from '../projectionDefaults${ext}'
|
|
113
121
|
import type { OpKind } from '../projectionDefaults${ext}'
|
|
@@ -129,14 +137,28 @@ type JsonLike =
|
|
|
129
137
|
type OperationConfigLike<TEnv extends HonoEnvBase> = {
|
|
130
138
|
before?: HonoBeforeHook<TEnv>[]
|
|
131
139
|
after?: HonoAfterHook<TEnv>[]
|
|
132
|
-
shape?:
|
|
140
|
+
shape?: unknown
|
|
141
|
+
variants?: Record<
|
|
142
|
+
string,
|
|
143
|
+
{
|
|
144
|
+
shape?: unknown
|
|
145
|
+
before?: HonoBeforeHook<TEnv>[]
|
|
146
|
+
after?: HonoAfterHook<TEnv>[]
|
|
147
|
+
}
|
|
148
|
+
>
|
|
133
149
|
pagination?: Partial<PaginationConfig>
|
|
134
150
|
}
|
|
135
151
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
152
|
+
type NormalizedOp<TEnv extends HonoEnvBase> = NormalizedOperationConfig<
|
|
153
|
+
HonoBeforeHook<TEnv>,
|
|
154
|
+
HonoAfterHook<TEnv>
|
|
155
|
+
>
|
|
156
|
+
|
|
157
|
+
function normalizeHonoOperation<TEnv extends HonoEnvBase>(
|
|
158
|
+
config: OperationConfigLike<TEnv> | undefined,
|
|
159
|
+
): NormalizedOp<TEnv> {
|
|
160
|
+
return normalizeOperation<HonoBeforeHook<TEnv>, HonoAfterHook<TEnv>>(config)
|
|
161
|
+
}
|
|
140
162
|
|
|
141
163
|
type HandlerContext = Context<{ Variables: HonoInternalVariables }>
|
|
142
164
|
|
|
@@ -188,7 +210,7 @@ async function parseUpdateEachBodyMiddleware(c: HandlerContext): Promise<void> {
|
|
|
188
210
|
|
|
189
211
|
function makeShapeMiddleware<TCtx, TPrisma, TEnv extends HonoEnvBase>(
|
|
190
212
|
config: ${modelName}RouteConfig<TCtx, TPrisma, TEnv>,
|
|
191
|
-
opConfig:
|
|
213
|
+
opConfig: NormalizedOp<TEnv>,
|
|
192
214
|
opKind: OpKind,
|
|
193
215
|
) {
|
|
194
216
|
return async (c: Context<GeneratedHonoEnv<TEnv>>): Promise<void> => {
|
|
@@ -198,19 +220,31 @@ function makeShapeMiddleware<TCtx, TPrisma, TEnv extends HonoEnvBase>(
|
|
|
198
220
|
const headerName = config.guard?.variantHeader || 'x-api-variant'
|
|
199
221
|
const headerValue = c.req.header(headerName)
|
|
200
222
|
const caller = config.guard?.resolveVariant?.(c) ?? headerValue ?? undefined
|
|
201
|
-
if (caller) c.set('guardCaller', caller)
|
|
223
|
+
if (typeof caller === 'string') c.set('guardCaller', caller)
|
|
224
|
+
|
|
225
|
+
const resolution = resolveOperationVariantKey(opConfig.guardRouting, caller)
|
|
226
|
+
if (!resolution.ok) {
|
|
227
|
+
c.set('guardVariantFailure', resolution)
|
|
228
|
+
return
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
const resolvedKey =
|
|
232
|
+
opConfig.guardRouting.kind === 'named'
|
|
233
|
+
? resolution.key
|
|
234
|
+
: undefined
|
|
235
|
+
if (resolvedKey !== undefined) c.set('guardVariantKey', resolvedKey)
|
|
202
236
|
|
|
203
|
-
if (opConfig.
|
|
237
|
+
if (opConfig.guardShape) {
|
|
204
238
|
if (!DROP_GUARD) {
|
|
205
|
-
c.set('guardShape', opConfig.
|
|
239
|
+
c.set('guardShape', opConfig.guardShape)
|
|
206
240
|
} else {
|
|
207
241
|
const resolveCtx = typeof config.resolveContext === 'function'
|
|
208
242
|
? () => (config.resolveContext as (ctx: Context<GeneratedHonoEnv<TEnv>>) => unknown | Promise<unknown>)(c)
|
|
209
243
|
: undefined
|
|
210
244
|
|
|
211
245
|
await applyDroppedGuard(
|
|
212
|
-
opConfig.
|
|
213
|
-
|
|
246
|
+
opConfig.guardShape,
|
|
247
|
+
resolvedKey,
|
|
214
248
|
resolveCtx,
|
|
215
249
|
opKind,
|
|
216
250
|
{
|
|
@@ -242,7 +276,7 @@ function makeShapeMiddleware<TCtx, TPrisma, TEnv extends HonoEnvBase>(
|
|
|
242
276
|
}
|
|
243
277
|
|
|
244
278
|
async function runBeforeHooks<TEnv extends HonoEnvBase>(
|
|
245
|
-
hooks: HonoBeforeHook<TEnv>[],
|
|
279
|
+
hooks: readonly HonoBeforeHook<TEnv>[],
|
|
246
280
|
c: Context<GeneratedHonoEnv<TEnv>>,
|
|
247
281
|
): Promise<Response | undefined> {
|
|
248
282
|
for (const hook of hooks) {
|
|
@@ -253,7 +287,7 @@ async function runBeforeHooks<TEnv extends HonoEnvBase>(
|
|
|
253
287
|
}
|
|
254
288
|
|
|
255
289
|
async function runAfterHooks<TEnv extends HonoEnvBase>(
|
|
256
|
-
hooks: HonoAfterHook<TEnv>[],
|
|
290
|
+
hooks: readonly HonoAfterHook<TEnv>[],
|
|
257
291
|
c: Context<GeneratedHonoEnv<TEnv>>,
|
|
258
292
|
): Promise<Response | undefined> {
|
|
259
293
|
for (const hook of hooks) {
|
|
@@ -352,7 +386,7 @@ export function ${routerFunctionName}<TCtx = unknown, TPrisma = any, TEnv extend
|
|
|
352
386
|
}
|
|
353
387
|
|
|
354
388
|
const handleRead = (
|
|
355
|
-
opConfig:
|
|
389
|
+
opConfig: NormalizedOp<TEnv>,
|
|
356
390
|
handlerFn: (c: HandlerContext) => Promise<void>,
|
|
357
391
|
parseFn: (c: HandlerContext) => Promise<void>,
|
|
358
392
|
opKind: OpKind,
|
|
@@ -360,12 +394,27 @@ export function ${routerFunctionName}<TCtx = unknown, TPrisma = any, TEnv extend
|
|
|
360
394
|
try {
|
|
361
395
|
await parseFn(c as unknown as HandlerContext)
|
|
362
396
|
await makeShapeMiddleware<TCtx, TPrisma, TEnv>(config, opConfig, opKind)(c)
|
|
363
|
-
const
|
|
364
|
-
|
|
365
|
-
|
|
397
|
+
const operationBefore = await runBeforeHooks<TEnv>(opConfig.operationBefore, c)
|
|
398
|
+
if (operationBefore) return operationBefore
|
|
399
|
+
|
|
400
|
+
const failure = c.get('guardVariantFailure')
|
|
401
|
+
if (failure) {
|
|
402
|
+
throw new HTTPException(400, {
|
|
403
|
+
message: formatGuardVariantResolutionError(failure),
|
|
404
|
+
})
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
const key = c.get('guardVariantKey')
|
|
408
|
+
const variantHooks =
|
|
409
|
+
key !== undefined ? opConfig.variantHooks[key] : undefined
|
|
410
|
+
|
|
411
|
+
const variantBefore = await runBeforeHooks<TEnv>(variantHooks?.before ?? [], c)
|
|
412
|
+
if (variantBefore) return variantBefore
|
|
366
413
|
await handlerFn(c as unknown as HandlerContext)
|
|
367
|
-
const
|
|
368
|
-
if (
|
|
414
|
+
const variantAfter = await runAfterHooks<TEnv>(variantHooks?.after ?? [], c)
|
|
415
|
+
if (variantAfter) return variantAfter
|
|
416
|
+
const operationAfter = await runAfterHooks<TEnv>(opConfig.operationAfter, c)
|
|
417
|
+
if (operationAfter) return operationAfter
|
|
369
418
|
return sendResult(c as unknown as HandlerContext)
|
|
370
419
|
} catch (error: unknown) {
|
|
371
420
|
return sendError(c as unknown as HandlerContext, error)
|
|
@@ -373,28 +422,46 @@ export function ${routerFunctionName}<TCtx = unknown, TPrisma = any, TEnv extend
|
|
|
373
422
|
}
|
|
374
423
|
|
|
375
424
|
const handleWrite = (
|
|
376
|
-
opConfig:
|
|
425
|
+
opConfig: NormalizedOp<TEnv>,
|
|
377
426
|
handlerFn: (c: HandlerContext) => Promise<void>,
|
|
378
427
|
opKind: OpKind,
|
|
379
428
|
) => async (c: Context<GeneratedHonoEnv<TEnv>>): Promise<Response> => {
|
|
380
429
|
try {
|
|
381
430
|
await parseWriteBodyMiddleware(c as unknown as HandlerContext)
|
|
382
431
|
await makeShapeMiddleware<TCtx, TPrisma, TEnv>(config, opConfig, opKind)(c)
|
|
383
|
-
const
|
|
384
|
-
|
|
385
|
-
|
|
432
|
+
const operationBefore = await runBeforeHooks<TEnv>(opConfig.operationBefore, c)
|
|
433
|
+
if (operationBefore) return operationBefore
|
|
434
|
+
|
|
435
|
+
const failure = c.get('guardVariantFailure')
|
|
436
|
+
if (failure) {
|
|
437
|
+
throw new HTTPException(400, {
|
|
438
|
+
message: formatGuardVariantResolutionError(failure),
|
|
439
|
+
})
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
const key = c.get('guardVariantKey')
|
|
443
|
+
const variantHooks =
|
|
444
|
+
key !== undefined ? opConfig.variantHooks[key] : undefined
|
|
445
|
+
|
|
446
|
+
const variantBefore = await runBeforeHooks<TEnv>(variantHooks?.before ?? [], c)
|
|
447
|
+
if (variantBefore) return variantBefore
|
|
386
448
|
await handlerFn(c as unknown as HandlerContext)
|
|
387
|
-
const
|
|
388
|
-
if (
|
|
449
|
+
const variantAfter = await runAfterHooks<TEnv>(variantHooks?.after ?? [], c)
|
|
450
|
+
if (variantAfter) return variantAfter
|
|
451
|
+
const operationAfter = await runAfterHooks<TEnv>(opConfig.operationAfter, c)
|
|
452
|
+
if (operationAfter) return operationAfter
|
|
389
453
|
return sendResult(c as unknown as HandlerContext)
|
|
390
454
|
} catch (error: unknown) {
|
|
391
455
|
return sendError(c as unknown as HandlerContext, error)
|
|
392
456
|
}
|
|
393
457
|
}
|
|
394
458
|
|
|
395
|
-
const opFor = <K extends keyof ${modelName}RouteConfig<TCtx, TPrisma, TEnv>>(
|
|
396
|
-
|
|
397
|
-
|
|
459
|
+
const opFor = <K extends keyof ${modelName}RouteConfig<TCtx, TPrisma, TEnv>>(
|
|
460
|
+
key: K,
|
|
461
|
+
): NormalizedOp<TEnv> => {
|
|
462
|
+
const raw = config[key] as unknown as OperationConfigLike<TEnv> | undefined
|
|
463
|
+
validateOperationConfig(raw, '${modelName}.' + String(key))
|
|
464
|
+
return normalizeHonoOperation(raw)
|
|
398
465
|
}
|
|
399
466
|
|
|
400
467
|
${readOpBlocks}
|
|
@@ -402,8 +469,10 @@ ${readOpBlocks}
|
|
|
402
469
|
${writeOpBlocks}
|
|
403
470
|
|
|
404
471
|
if (config.updateEach) {
|
|
405
|
-
const
|
|
406
|
-
|
|
472
|
+
const rawUpdateEach = config.updateEach as unknown as OperationConfigLike<TEnv>
|
|
473
|
+
validateUpdateEachConfig(rawUpdateEach, '${modelName}.updateEach')
|
|
474
|
+
const opConfig = normalizeHonoOperation(rawUpdateEach)
|
|
475
|
+
if (opConfig.operationBefore.length === 0 && _env.NODE_ENV !== 'production') {
|
|
407
476
|
console.warn(
|
|
408
477
|
'[${modelName}Router] updateEach is enabled without a before hook. ' +
|
|
409
478
|
'This endpoint bypasses guard shapes and should be protected by authentication middleware.',
|
|
@@ -414,12 +483,11 @@ ${writeOpBlocks}
|
|
|
414
483
|
try {
|
|
415
484
|
await parseUpdateEachBodyMiddleware(c as unknown as HandlerContext)
|
|
416
485
|
await makeShapeMiddleware<TCtx, TPrisma, TEnv>(config, opConfig, 'noop')(c)
|
|
417
|
-
const
|
|
418
|
-
|
|
419
|
-
if (beforeResp) return beforeResp
|
|
486
|
+
const beforeResponse = await runBeforeHooks<TEnv>(opConfig.operationBefore, c)
|
|
487
|
+
if (beforeResponse) return beforeResponse
|
|
420
488
|
await ${modelName}UpdateEach(c as unknown as HandlerContext)
|
|
421
|
-
const
|
|
422
|
-
if (
|
|
489
|
+
const afterResponse = await runAfterHooks<TEnv>(opConfig.operationAfter, c)
|
|
490
|
+
if (afterResponse) return afterResponse
|
|
423
491
|
return sendResult(c as unknown as HandlerContext)
|
|
424
492
|
} catch (error: unknown) {
|
|
425
493
|
return sendError(c as unknown as HandlerContext, error)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateRouterHono.js","sourceRoot":"","sources":["../../src/generators/generateRouterHono.ts"],"names":[],"mappings":";;AAkFA,
|
|
1
|
+
{"version":3,"file":"generateRouterHono.js","sourceRoot":"","sources":["../../src/generators/generateRouterHono.ts"],"names":[],"mappings":";;AAkFA,gEA2bC;AA5gBD,u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CACR,SAAS,WAAW,GAAG;;EAEpE,IAAA,iDAAuB,EAAC,SAAS,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,CAAC;;;qBAGzE,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAqFlB,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAyGH,kBAAkB,mFAAmF,SAAS;8DAClE,SAAS;;;OAGhE,SAAS;;;;;;;;4DAQ4C,cAAc;;;;;;;;;;;;;;;WAe/D,SAAS;;;;4CAIwB,aAAa;;;;;;;;;WAS9C,SAAS;;;;4CAIwB,aAAa;;;;;;;;UAQ/C,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCA0FgB,SAAS;;;;oCAIR,SAAS;;;;EAI3C,YAAY;;EAEZ,aAAa;;;;+CAIgC,SAAS;;;;YAI5C,SAAS;;;;;;;;;;;gBAWL,SAAS;;;;;;;;;;;;CAYxB,CAAA;AACD,CAAC"}
|
package/dist/utils/copyFiles.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copyFiles.js","sourceRoot":"","sources":["../../src/utils/copyFiles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"copyFiles.js","sourceRoot":"","sources":["../../src/utils/copyFiles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoHA,8BAmDC;AAtKD,uCAAwB;AACxB,2CAA4B;AAG5B,2CAAuC;AAEvC,MAAM,YAAY,GAAG;IACnB,q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C,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CACb,iBAAiB,GAAG,MAAM,CAAC,MAAM,GAAG,sBAAsB;YAC1D,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;YACxC,gBAAgB,GAAG,QAAQ,GAAG,iBAAiB,GAAG,SAAS,CAC5D,CAAA;IACH,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAA;AACtD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prisma-generator-express",
|
|
3
3
|
"description": "Prisma generator for Express, Fastify, and Hono CRUD APIs with OpenAPI documentation",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.63.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "MIT",
|
package/src/copy/docsRenderer.ts
CHANGED
|
@@ -1109,6 +1109,7 @@ export function renderDocs(
|
|
|
1109
1109
|
escapeHtml(guardVariantHeader) +
|
|
1110
1110
|
'</span> header or a custom resolver function.',
|
|
1111
1111
|
'Forced values (literals instead of true) are injected server-side and cannot be overridden by the client.',
|
|
1112
|
+
'Operation hooks run before variant hooks. After the handler, variant hooks run before operation hooks. A terminal response or error stops the remaining hooks in that phase; operation after-hooks are not guaranteed cleanup handlers.',
|
|
1112
1113
|
]
|
|
1113
1114
|
|
|
1114
1115
|
const writeStrategyNotes =
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { GuardVariantResolution } from './guardVariantRouting'
|
|
2
|
+
|
|
3
|
+
export function formatGuardVariantResolutionError(
|
|
4
|
+
resolution: Extract<GuardVariantResolution, { ok: false }>,
|
|
5
|
+
): string {
|
|
6
|
+
const keys = resolution.keys.map((key) => `"${key}"`).join(', ')
|
|
7
|
+
|
|
8
|
+
if (resolution.code === 'reserved-key') {
|
|
9
|
+
return `Caller key "${resolution.key}" collides with reserved guard shape key. Rename the caller path.`
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (resolution.code === 'missing-caller') {
|
|
13
|
+
return (
|
|
14
|
+
`Missing caller. This guard uses named shape routing with keys: ${keys}. ` +
|
|
15
|
+
'Provide caller via guard(input, caller).'
|
|
16
|
+
)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (resolution.code === 'ambiguous-caller') {
|
|
20
|
+
const matches = (resolution.matches ?? [])
|
|
21
|
+
.map((pattern) => `"${pattern}"`)
|
|
22
|
+
.join(', ')
|
|
23
|
+
|
|
24
|
+
return `Ambiguous caller "${resolution.caller}" matches multiple patterns: ${matches}`
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return `Unknown caller: "${resolution.caller}". Allowed: ${keys}`
|
|
28
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
export type GuardVariantResolutionInput =
|
|
2
|
+
| { kind: 'single' }
|
|
3
|
+
| {
|
|
4
|
+
kind: 'named'
|
|
5
|
+
keys: readonly string[]
|
|
6
|
+
caller?: string
|
|
7
|
+
reservedKeys: ReadonlySet<string>
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type GuardVariantResolution =
|
|
11
|
+
| { ok: true; key: string }
|
|
12
|
+
| {
|
|
13
|
+
ok: false
|
|
14
|
+
code:
|
|
15
|
+
| 'reserved-key'
|
|
16
|
+
| 'missing-caller'
|
|
17
|
+
| 'ambiguous-caller'
|
|
18
|
+
| 'unknown-caller'
|
|
19
|
+
caller?: string
|
|
20
|
+
key?: string
|
|
21
|
+
keys: readonly string[]
|
|
22
|
+
matches?: readonly string[]
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function matchVariantPatterns(
|
|
26
|
+
keys: readonly string[],
|
|
27
|
+
caller: string,
|
|
28
|
+
): string[] {
|
|
29
|
+
const callerParts = caller.split('/')
|
|
30
|
+
const matches: string[] = []
|
|
31
|
+
|
|
32
|
+
for (const pattern of keys) {
|
|
33
|
+
if (!pattern.includes(':')) continue
|
|
34
|
+
|
|
35
|
+
const patternParts = pattern.split('/')
|
|
36
|
+
if (patternParts.length !== callerParts.length) continue
|
|
37
|
+
|
|
38
|
+
let matchesCaller = true
|
|
39
|
+
|
|
40
|
+
for (let index = 0; index < patternParts.length; index++) {
|
|
41
|
+
if (patternParts[index].startsWith(':')) continue
|
|
42
|
+
if (patternParts[index] !== callerParts[index]) {
|
|
43
|
+
matchesCaller = false
|
|
44
|
+
break
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (matchesCaller) matches.push(pattern)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return matches
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function resolveGuardVariantKey(
|
|
55
|
+
input: GuardVariantResolutionInput,
|
|
56
|
+
): GuardVariantResolution {
|
|
57
|
+
if (input.kind === 'single') {
|
|
58
|
+
return { ok: true, key: '_default' }
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const { keys, caller, reservedKeys } = input
|
|
62
|
+
|
|
63
|
+
for (const key of keys) {
|
|
64
|
+
if (reservedKeys.has(key)) {
|
|
65
|
+
return {
|
|
66
|
+
ok: false,
|
|
67
|
+
code: 'reserved-key',
|
|
68
|
+
key,
|
|
69
|
+
keys,
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const hasDefault = keys.includes('default')
|
|
75
|
+
|
|
76
|
+
if (typeof caller !== 'string') {
|
|
77
|
+
if (hasDefault) return { ok: true, key: 'default' }
|
|
78
|
+
return { ok: false, code: 'missing-caller', keys }
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (caller.trim().length === 0) {
|
|
82
|
+
if (hasDefault) return { ok: true, key: 'default' }
|
|
83
|
+
return { ok: false, code: 'unknown-caller', caller, keys }
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (keys.includes(caller)) {
|
|
87
|
+
return { ok: true, key: caller }
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const matches = matchVariantPatterns(keys, caller)
|
|
91
|
+
|
|
92
|
+
if (matches.length === 1) {
|
|
93
|
+
return { ok: true, key: matches[0] }
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (matches.length > 1) {
|
|
97
|
+
return {
|
|
98
|
+
ok: false,
|
|
99
|
+
code: 'ambiguous-caller',
|
|
100
|
+
caller,
|
|
101
|
+
keys,
|
|
102
|
+
matches,
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (hasDefault) return { ok: true, key: 'default' }
|
|
107
|
+
|
|
108
|
+
return { ok: false, code: 'unknown-caller', caller, keys }
|
|
109
|
+
}
|
|
@@ -88,7 +88,7 @@ async function callShapeFn(
|
|
|
88
88
|
|
|
89
89
|
async function resolveShape(
|
|
90
90
|
input: unknown,
|
|
91
|
-
|
|
91
|
+
resolvedKey: string | undefined,
|
|
92
92
|
resolveContext: ContextResolver | undefined,
|
|
93
93
|
): Promise<Record<string, unknown> | null> {
|
|
94
94
|
if (!input) return null
|
|
@@ -100,9 +100,8 @@ async function resolveShape(
|
|
|
100
100
|
if (!isPlainObject(input)) return null
|
|
101
101
|
if (isDirectGuardShape(input)) return input
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
if (entry === undefined && 'default' in input) entry = input['default']
|
|
103
|
+
if (resolvedKey === undefined) return null
|
|
104
|
+
const entry = input[resolvedKey]
|
|
106
105
|
if (entry === undefined) return null
|
|
107
106
|
|
|
108
107
|
if (typeof entry === 'function') {
|
|
@@ -376,7 +375,7 @@ function applyForcedWhere(opts: WhereMergeOptions): void {
|
|
|
376
375
|
|
|
377
376
|
export async function applyDroppedGuard(
|
|
378
377
|
shape: unknown,
|
|
379
|
-
|
|
378
|
+
resolvedKey: string | undefined,
|
|
380
379
|
resolveContext: ContextResolver | undefined,
|
|
381
380
|
opKind: OpKind,
|
|
382
381
|
targets: {
|
|
@@ -386,7 +385,7 @@ export async function applyDroppedGuard(
|
|
|
386
385
|
ensureReadTarget: () => Record<string, unknown>,
|
|
387
386
|
ensureWriteTarget: () => Record<string, unknown>,
|
|
388
387
|
): Promise<void> {
|
|
389
|
-
const resolved = await resolveShape(shape,
|
|
388
|
+
const resolved = await resolveShape(shape, resolvedKey, resolveContext)
|
|
390
389
|
if (!resolved) return
|
|
391
390
|
|
|
392
391
|
const projection = buildDefaultProjectionBody(resolved)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Context } from 'hono'
|
|
2
|
+
import type { GuardVariantResolution } from './guardVariantRouting'
|
|
2
3
|
import type {
|
|
3
4
|
BaseOperationConfig,
|
|
4
5
|
BaseRouteConfig,
|
|
@@ -35,6 +36,8 @@ export type HonoInternalVariables = {
|
|
|
35
36
|
routeConfig?: { pagination?: PaginationConfig }
|
|
36
37
|
guardShape?: Record<string, unknown>
|
|
37
38
|
guardCaller?: string
|
|
39
|
+
guardVariantKey?: string
|
|
40
|
+
guardVariantFailure?: Extract<GuardVariantResolution, { ok: false }>
|
|
38
41
|
resultData?: unknown
|
|
39
42
|
resultStatus?: number
|
|
40
43
|
}
|
|
@@ -58,10 +61,11 @@ export type HonoHookHandler<TEnv extends HonoEnvBase = HonoEnvBase> = HonoBefore
|
|
|
58
61
|
export type OperationConfig<
|
|
59
62
|
TShape = Record<string, unknown>,
|
|
60
63
|
TEnv extends HonoEnvBase = HonoEnvBase,
|
|
61
|
-
> =
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
> = BaseOperationConfig<
|
|
65
|
+
HonoBeforeHook<TEnv>,
|
|
66
|
+
TShape,
|
|
67
|
+
HonoAfterHook<TEnv>
|
|
68
|
+
>
|
|
65
69
|
|
|
66
70
|
export type UpdateEachConfig<TEnv extends HonoEnvBase = HonoEnvBase> = {
|
|
67
71
|
before?: HonoBeforeHook<TEnv>[]
|
|
@@ -94,7 +98,13 @@ export type RouteConfig<
|
|
|
94
98
|
TCtx = unknown,
|
|
95
99
|
TEnv extends HonoEnvBase = HonoEnvBase,
|
|
96
100
|
> = Omit<
|
|
97
|
-
BaseRouteConfig<
|
|
101
|
+
BaseRouteConfig<
|
|
102
|
+
HonoBeforeHook<TEnv>,
|
|
103
|
+
Context<GeneratedHonoEnv<TEnv>>,
|
|
104
|
+
TShape,
|
|
105
|
+
TCtx,
|
|
106
|
+
HonoAfterHook<TEnv>
|
|
107
|
+
>,
|
|
98
108
|
HonoOpKeys
|
|
99
109
|
> & {
|
|
100
110
|
findUnique?: OperationConfig<TShape, TEnv> | false
|