@temporary-name/server 1.9.3-alpha.ec3bfb9dce56198911349c322c970208b21b50db → 1.9.3-alpha.fb7b7d19964e1b2def7056f4345b63d6fcacce10
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/adapters/aws-lambda/index.d.mts +2 -2
- package/dist/adapters/aws-lambda/index.d.ts +2 -2
- package/dist/adapters/fetch/index.d.mts +2 -2
- package/dist/adapters/fetch/index.d.ts +2 -2
- package/dist/adapters/node/index.d.mts +2 -2
- package/dist/adapters/node/index.d.ts +2 -2
- package/dist/adapters/standard/index.d.mts +2 -2
- package/dist/adapters/standard/index.d.ts +2 -2
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.mjs +43 -39
- package/dist/openapi/index.d.mts +10 -30
- package/dist/openapi/index.d.ts +10 -30
- package/dist/openapi/index.mjs +335 -293
- package/dist/shared/{server.D8RAzJ_p.d.ts → server.B0LJ_wu-.d.ts} +1 -1
- package/dist/shared/{server.CVhIyQ4x.d.mts → server.BQZMQrPe.d.mts} +1 -1
- package/dist/shared/{server.Cj3_Lp61.d.mts → server.DXPMDozZ.d.mts} +26 -11
- package/dist/shared/{server.Cj3_Lp61.d.ts → server.DXPMDozZ.d.ts} +26 -11
- package/package.json +9 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTTPPath, StandardResponse, StandardLazyRequest } from '@temporary-name/shared';
|
|
2
|
-
import { C as Context,
|
|
2
|
+
import { C as Context, l as Router } from './server.DXPMDozZ.js';
|
|
3
3
|
|
|
4
4
|
interface StandardHandleOptions<T extends Context> {
|
|
5
5
|
prefix?: HTTPPath;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTTPPath, StandardResponse, StandardLazyRequest } from '@temporary-name/shared';
|
|
2
|
-
import { C as Context,
|
|
2
|
+
import { C as Context, l as Router } from './server.DXPMDozZ.mjs';
|
|
3
3
|
|
|
4
4
|
interface StandardHandleOptions<T extends Context> {
|
|
5
5
|
prefix?: HTTPPath;
|
|
@@ -184,7 +184,6 @@ type MergedSchemas<T1 extends Schemas, T2 extends Partial<Schemas>> = {
|
|
|
184
184
|
outputSchema: T2['outputSchema'] extends AnySchema ? T2['outputSchema'] : T1['outputSchema'];
|
|
185
185
|
};
|
|
186
186
|
|
|
187
|
-
type DefaultProcedureHandlerOptions = ProcedureHandlerOptions<Context, Meta>;
|
|
188
187
|
interface ProcedureHandlerOptions<TCurrentContext extends Context, TMeta extends Meta> {
|
|
189
188
|
context: TCurrentContext;
|
|
190
189
|
path: readonly string[];
|
|
@@ -205,7 +204,7 @@ interface ContractDef<TSchemas extends Schemas, TMeta extends Meta> {
|
|
|
205
204
|
route: Route;
|
|
206
205
|
schemas: TSchemas;
|
|
207
206
|
middlewares: readonly AnyMiddleware[];
|
|
208
|
-
authConfigs:
|
|
207
|
+
authConfigs: AnyAuthConfig[];
|
|
209
208
|
inputValidationIndex: number;
|
|
210
209
|
outputValidationIndex: number;
|
|
211
210
|
}
|
|
@@ -232,22 +231,38 @@ type AnyProcedure = Procedure<any, any, Schemas, any>;
|
|
|
232
231
|
declare function isProcedure(item: unknown): item is AnyProcedure;
|
|
233
232
|
|
|
234
233
|
type ValidatedAuthContext = {};
|
|
235
|
-
interface
|
|
234
|
+
interface BaseAuthConfig {
|
|
235
|
+
oasDescription?: string;
|
|
236
|
+
oasName?: string;
|
|
237
|
+
}
|
|
238
|
+
interface BasicAuthConfig<TAuthContext extends ValidatedAuthContext, TCurrentContext extends Context, TMeta extends Meta> extends BaseAuthConfig {
|
|
236
239
|
tokenPrefix?: string;
|
|
237
240
|
validate: (username: string, password: string, options: ProcedureHandlerOptions<TCurrentContext, TMeta>) => Promisable<TAuthContext>;
|
|
238
241
|
}
|
|
239
|
-
interface
|
|
242
|
+
interface BearerAuthConfig<TAuthContext extends ValidatedAuthContext, TCurrentContext extends Context, TMeta extends Meta> extends TokenAuthConfig<TAuthContext, TCurrentContext, TMeta> {
|
|
243
|
+
oasBearerFormat?: string;
|
|
244
|
+
}
|
|
245
|
+
interface TokenAuthConfig<TAuthContext extends ValidatedAuthContext, TCurrentContext extends Context, TMeta extends Meta> extends BaseAuthConfig {
|
|
240
246
|
tokenPrefix?: string;
|
|
241
247
|
validate: (token: string, options: ProcedureHandlerOptions<TCurrentContext, TMeta>) => Promisable<TAuthContext>;
|
|
242
248
|
}
|
|
243
249
|
interface NamedTokenAuthConfig<TAuthContext extends ValidatedAuthContext, TCurrentContext extends Context, TMeta extends Meta> extends TokenAuthConfig<TAuthContext, TCurrentContext, TMeta> {
|
|
244
250
|
name: string;
|
|
245
251
|
}
|
|
246
|
-
type
|
|
247
|
-
type AuthConfig<
|
|
248
|
-
type
|
|
249
|
-
|
|
250
|
-
|
|
252
|
+
type AnyAuthConfig = AuthConfig<any, any, any>;
|
|
253
|
+
type AuthConfig<TAuthContext extends ValidatedAuthContext, TCurrentContext extends Context, TMeta extends Meta> = ({
|
|
254
|
+
type: 'basic';
|
|
255
|
+
} & BasicAuthConfig<TAuthContext, TCurrentContext, TMeta>) | ({
|
|
256
|
+
type: 'bearer';
|
|
257
|
+
} & BearerAuthConfig<TAuthContext, TCurrentContext, TMeta>) | ({
|
|
258
|
+
type: 'header';
|
|
259
|
+
} & NamedTokenAuthConfig<TAuthContext, TCurrentContext, TMeta>) | ({
|
|
260
|
+
type: 'query';
|
|
261
|
+
} & NamedTokenAuthConfig<TAuthContext, TCurrentContext, TMeta>) | ({
|
|
262
|
+
type: 'cookie';
|
|
263
|
+
} & NamedTokenAuthConfig<TAuthContext, TCurrentContext, TMeta>) | {
|
|
264
|
+
type: 'none';
|
|
265
|
+
};
|
|
251
266
|
|
|
252
267
|
type ContractRouter = Contract | {
|
|
253
268
|
[k: string]: ContractRouter;
|
|
@@ -369,5 +384,5 @@ declare function unlazy<T extends Lazyable<any>>(lazied: T): Promise<{
|
|
|
369
384
|
default: T extends Lazy<infer U> ? U : T;
|
|
370
385
|
}>;
|
|
371
386
|
|
|
372
|
-
export {
|
|
373
|
-
export type {
|
|
387
|
+
export { lazy as D, isLazy as F, getLazyMeta as G, unlazy as H, mergeMeta as J, Procedure as P, middlewareOutputFn as T, isProcedure as _, getRouter as a4, createAccessibleLazyRouter as a6, enhanceRouter as a7, traverseContractProcedures as ac, resolveContractProcedures as ad, unlazyRouter as af, initialSchemas as ah, Contract as b, mergeCurrentContext as w, LAZY_SYMBOL as x, lazyInternal as z };
|
|
388
|
+
export type { ContractRouter as $, AnyShape as A, BuildContextWithAuth as B, Context as C, EnhanceRouterOptions as E, InferProcedureClientInputs as I, MiddlewareResult as K, Lazyable as L, Meta as M, MiddlewareNextFn as N, MiddlewareOutputFn as O, MiddlewareOptions as Q, Route as R, Schemas as S, UnionToIntersection as U, ValidatedAuthContext as V, WrapShape as W, ProcedureHandlerOptions as X, AnyContractDef as Y, ProcedureDef as Z, InferSchemaOutput as a, InferRouterInitialContexts as a0, InferRouterCurrentContexts as a1, InferRouterInputs as a2, InferRouterOutputs as a3, AccessibleLazyRouter as a5, TraverseContractProceduresOptions as a8, TraverseContractProcedureCallbackOptions as a9, ContractProcedureCallbackOptions as aa, LazyTraverseContractProceduresOptions as ab, UnlaziedRouter as ae, TypeRest as ag, InitialSchemas as ai, MergedSchemas as c, AnySchema as d, Middleware as e, MergedCurrentContext as f, MergedInitialContext as g, AuthConfig as h, ProcedureHandler as i, InferHandlerInputs as j, InferSchemaInput as k, Router as l, EnhancedRouter as m, MapInputMiddleware as n, ContractDef as o, SchemaIssue as p, Schema as q, AnyMiddleware as r, Lazy as s, AnyProcedure as t, AnyRouter as u, InferRouterInitialContext as v, LazyMeta as y };
|
|
@@ -184,7 +184,6 @@ type MergedSchemas<T1 extends Schemas, T2 extends Partial<Schemas>> = {
|
|
|
184
184
|
outputSchema: T2['outputSchema'] extends AnySchema ? T2['outputSchema'] : T1['outputSchema'];
|
|
185
185
|
};
|
|
186
186
|
|
|
187
|
-
type DefaultProcedureHandlerOptions = ProcedureHandlerOptions<Context, Meta>;
|
|
188
187
|
interface ProcedureHandlerOptions<TCurrentContext extends Context, TMeta extends Meta> {
|
|
189
188
|
context: TCurrentContext;
|
|
190
189
|
path: readonly string[];
|
|
@@ -205,7 +204,7 @@ interface ContractDef<TSchemas extends Schemas, TMeta extends Meta> {
|
|
|
205
204
|
route: Route;
|
|
206
205
|
schemas: TSchemas;
|
|
207
206
|
middlewares: readonly AnyMiddleware[];
|
|
208
|
-
authConfigs:
|
|
207
|
+
authConfigs: AnyAuthConfig[];
|
|
209
208
|
inputValidationIndex: number;
|
|
210
209
|
outputValidationIndex: number;
|
|
211
210
|
}
|
|
@@ -232,22 +231,38 @@ type AnyProcedure = Procedure<any, any, Schemas, any>;
|
|
|
232
231
|
declare function isProcedure(item: unknown): item is AnyProcedure;
|
|
233
232
|
|
|
234
233
|
type ValidatedAuthContext = {};
|
|
235
|
-
interface
|
|
234
|
+
interface BaseAuthConfig {
|
|
235
|
+
oasDescription?: string;
|
|
236
|
+
oasName?: string;
|
|
237
|
+
}
|
|
238
|
+
interface BasicAuthConfig<TAuthContext extends ValidatedAuthContext, TCurrentContext extends Context, TMeta extends Meta> extends BaseAuthConfig {
|
|
236
239
|
tokenPrefix?: string;
|
|
237
240
|
validate: (username: string, password: string, options: ProcedureHandlerOptions<TCurrentContext, TMeta>) => Promisable<TAuthContext>;
|
|
238
241
|
}
|
|
239
|
-
interface
|
|
242
|
+
interface BearerAuthConfig<TAuthContext extends ValidatedAuthContext, TCurrentContext extends Context, TMeta extends Meta> extends TokenAuthConfig<TAuthContext, TCurrentContext, TMeta> {
|
|
243
|
+
oasBearerFormat?: string;
|
|
244
|
+
}
|
|
245
|
+
interface TokenAuthConfig<TAuthContext extends ValidatedAuthContext, TCurrentContext extends Context, TMeta extends Meta> extends BaseAuthConfig {
|
|
240
246
|
tokenPrefix?: string;
|
|
241
247
|
validate: (token: string, options: ProcedureHandlerOptions<TCurrentContext, TMeta>) => Promisable<TAuthContext>;
|
|
242
248
|
}
|
|
243
249
|
interface NamedTokenAuthConfig<TAuthContext extends ValidatedAuthContext, TCurrentContext extends Context, TMeta extends Meta> extends TokenAuthConfig<TAuthContext, TCurrentContext, TMeta> {
|
|
244
250
|
name: string;
|
|
245
251
|
}
|
|
246
|
-
type
|
|
247
|
-
type AuthConfig<
|
|
248
|
-
type
|
|
249
|
-
|
|
250
|
-
|
|
252
|
+
type AnyAuthConfig = AuthConfig<any, any, any>;
|
|
253
|
+
type AuthConfig<TAuthContext extends ValidatedAuthContext, TCurrentContext extends Context, TMeta extends Meta> = ({
|
|
254
|
+
type: 'basic';
|
|
255
|
+
} & BasicAuthConfig<TAuthContext, TCurrentContext, TMeta>) | ({
|
|
256
|
+
type: 'bearer';
|
|
257
|
+
} & BearerAuthConfig<TAuthContext, TCurrentContext, TMeta>) | ({
|
|
258
|
+
type: 'header';
|
|
259
|
+
} & NamedTokenAuthConfig<TAuthContext, TCurrentContext, TMeta>) | ({
|
|
260
|
+
type: 'query';
|
|
261
|
+
} & NamedTokenAuthConfig<TAuthContext, TCurrentContext, TMeta>) | ({
|
|
262
|
+
type: 'cookie';
|
|
263
|
+
} & NamedTokenAuthConfig<TAuthContext, TCurrentContext, TMeta>) | {
|
|
264
|
+
type: 'none';
|
|
265
|
+
};
|
|
251
266
|
|
|
252
267
|
type ContractRouter = Contract | {
|
|
253
268
|
[k: string]: ContractRouter;
|
|
@@ -369,5 +384,5 @@ declare function unlazy<T extends Lazyable<any>>(lazied: T): Promise<{
|
|
|
369
384
|
default: T extends Lazy<infer U> ? U : T;
|
|
370
385
|
}>;
|
|
371
386
|
|
|
372
|
-
export {
|
|
373
|
-
export type {
|
|
387
|
+
export { lazy as D, isLazy as F, getLazyMeta as G, unlazy as H, mergeMeta as J, Procedure as P, middlewareOutputFn as T, isProcedure as _, getRouter as a4, createAccessibleLazyRouter as a6, enhanceRouter as a7, traverseContractProcedures as ac, resolveContractProcedures as ad, unlazyRouter as af, initialSchemas as ah, Contract as b, mergeCurrentContext as w, LAZY_SYMBOL as x, lazyInternal as z };
|
|
388
|
+
export type { ContractRouter as $, AnyShape as A, BuildContextWithAuth as B, Context as C, EnhanceRouterOptions as E, InferProcedureClientInputs as I, MiddlewareResult as K, Lazyable as L, Meta as M, MiddlewareNextFn as N, MiddlewareOutputFn as O, MiddlewareOptions as Q, Route as R, Schemas as S, UnionToIntersection as U, ValidatedAuthContext as V, WrapShape as W, ProcedureHandlerOptions as X, AnyContractDef as Y, ProcedureDef as Z, InferSchemaOutput as a, InferRouterInitialContexts as a0, InferRouterCurrentContexts as a1, InferRouterInputs as a2, InferRouterOutputs as a3, AccessibleLazyRouter as a5, TraverseContractProceduresOptions as a8, TraverseContractProcedureCallbackOptions as a9, ContractProcedureCallbackOptions as aa, LazyTraverseContractProceduresOptions as ab, UnlaziedRouter as ae, TypeRest as ag, InitialSchemas as ai, MergedSchemas as c, AnySchema as d, Middleware as e, MergedCurrentContext as f, MergedInitialContext as g, AuthConfig as h, ProcedureHandler as i, InferHandlerInputs as j, InferSchemaInput as k, Router as l, EnhancedRouter as m, MapInputMiddleware as n, ContractDef as o, SchemaIssue as p, Schema as q, AnyMiddleware as r, Lazy as s, AnyProcedure as t, AnyRouter as u, InferRouterInitialContext as v, LazyMeta as y };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@temporary-name/server",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.9.3-alpha.
|
|
4
|
+
"version": "1.9.3-alpha.fb7b7d19964e1b2def7056f4345b63d6fcacce10",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://www.stainless.com/",
|
|
7
7
|
"repository": {
|
|
@@ -56,13 +56,14 @@
|
|
|
56
56
|
"cookie": "^1.0.2",
|
|
57
57
|
"rou3": "^0.7.7",
|
|
58
58
|
"zod": "^4.1.12",
|
|
59
|
-
"@temporary-name/interop": "1.9.3-alpha.
|
|
60
|
-
"@temporary-name/
|
|
61
|
-
"@temporary-name/
|
|
62
|
-
"@temporary-name/standard-server-aws-lambda": "1.9.3-alpha.
|
|
63
|
-
"@temporary-name/standard-server-fetch": "1.9.3-alpha.
|
|
64
|
-
"@temporary-name/standard-server
|
|
65
|
-
"@temporary-name/
|
|
59
|
+
"@temporary-name/interop": "1.9.3-alpha.fb7b7d19964e1b2def7056f4345b63d6fcacce10",
|
|
60
|
+
"@temporary-name/json-schema": "1.9.3-alpha.fb7b7d19964e1b2def7056f4345b63d6fcacce10",
|
|
61
|
+
"@temporary-name/shared": "1.9.3-alpha.fb7b7d19964e1b2def7056f4345b63d6fcacce10",
|
|
62
|
+
"@temporary-name/standard-server-aws-lambda": "1.9.3-alpha.fb7b7d19964e1b2def7056f4345b63d6fcacce10",
|
|
63
|
+
"@temporary-name/standard-server-fetch": "1.9.3-alpha.fb7b7d19964e1b2def7056f4345b63d6fcacce10",
|
|
64
|
+
"@temporary-name/standard-server": "1.9.3-alpha.fb7b7d19964e1b2def7056f4345b63d6fcacce10",
|
|
65
|
+
"@temporary-name/standard-server-node": "1.9.3-alpha.fb7b7d19964e1b2def7056f4345b63d6fcacce10",
|
|
66
|
+
"@temporary-name/zod": "1.9.3-alpha.fb7b7d19964e1b2def7056f4345b63d6fcacce10"
|
|
66
67
|
},
|
|
67
68
|
"devDependencies": {
|
|
68
69
|
"@types/supertest": "^6.0.3",
|