@venturekit-pro/tenancy 0.0.0-dev.20260522121000 → 0.0.0-dev.20260525024212
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/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/middleware/index.d.ts +2 -0
- package/dist/middleware/index.d.ts.map +1 -1
- package/dist/middleware/index.js +1 -0
- package/dist/middleware/index.js.map +1 -1
- package/dist/middleware/runtime-tenant-middleware.d.ts +114 -0
- package/dist/middleware/runtime-tenant-middleware.d.ts.map +1 -0
- package/dist/middleware/runtime-tenant-middleware.js +84 -0
- package/dist/middleware/runtime-tenant-middleware.js.map +1 -0
- package/package.json +11 -2
package/dist/index.d.ts
CHANGED
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export * from './types/index.js';
|
|
8
8
|
export { TenantContext, createTenantContext, getCurrentTenant, resolveTenant, } from './context/index.js';
|
|
9
|
-
export
|
|
9
|
+
export * from './middleware/index.js';
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,kBAAkB,CAAC;AAGjC,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,GACd,MAAM,oBAAoB,CAAC;AAG5B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,kBAAkB,CAAC;AAGjC,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,GACd,MAAM,oBAAoB,CAAC;AAG5B,cAAc,uBAAuB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -9,5 +9,5 @@ export * from './types/index.js';
|
|
|
9
9
|
// Context
|
|
10
10
|
export { createTenantContext, getCurrentTenant, resolveTenant, } from './context/index.js';
|
|
11
11
|
// Middleware
|
|
12
|
-
export
|
|
12
|
+
export * from './middleware/index.js';
|
|
13
13
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,QAAQ;AACR,cAAc,kBAAkB,CAAC;AAEjC,UAAU;AACV,OAAO,EAEL,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,GACd,MAAM,oBAAoB,CAAC;AAE5B,aAAa;AACb,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,QAAQ;AACR,cAAc,kBAAkB,CAAC;AAEjC,UAAU;AACV,OAAO,EAEL,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,GACd,MAAM,oBAAoB,CAAC;AAE5B,aAAa;AACb,cAAc,uBAAuB,CAAC"}
|
|
@@ -3,4 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export { createTenantMiddleware, TenantNotFoundError, TenantSuspendedError, TenantInactiveError, } from './tenant-middleware.js';
|
|
5
5
|
export { createQuotaMiddleware, QuotaExceededError, checkQuotas } from './quota-middleware.js';
|
|
6
|
+
export { createRuntimeTenantMiddleware, hostPrefixDomainResolver, } from './runtime-tenant-middleware.js';
|
|
7
|
+
export type { RuntimeTenantResolver, RuntimeTenantMiddlewareOptions, HostPrefixDomainResolverOptions, } from './runtime-tenant-middleware.js';
|
|
6
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/middleware/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/middleware/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC/F,OAAO,EACL,6BAA6B,EAC7B,wBAAwB,GACzB,MAAM,gCAAgC,CAAC;AACxC,YAAY,EACV,qBAAqB,EACrB,8BAA8B,EAC9B,+BAA+B,GAChC,MAAM,gCAAgC,CAAC"}
|
package/dist/middleware/index.js
CHANGED
|
@@ -3,4 +3,5 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export { createTenantMiddleware, TenantNotFoundError, TenantSuspendedError, TenantInactiveError, } from './tenant-middleware.js';
|
|
5
5
|
export { createQuotaMiddleware, QuotaExceededError, checkQuotas } from './quota-middleware.js';
|
|
6
|
+
export { createRuntimeTenantMiddleware, hostPrefixDomainResolver, } from './runtime-tenant-middleware.js';
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/middleware/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/middleware/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC/F,OAAO,EACL,6BAA6B,EAC7B,wBAAwB,GACzB,MAAM,gCAAgC,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime-aware tenant middleware.
|
|
3
|
+
*
|
|
4
|
+
* The pre-existing {@link createTenantMiddleware} in this package is
|
|
5
|
+
* built around a generic `TenantRequest` shape and an
|
|
6
|
+
* AsyncLocalStorage-backed `TenantContext`. That works for the
|
|
7
|
+
* runtime-agnostic usage (Fastify, generic Node servers) it was
|
|
8
|
+
* originally designed for, but does **not** integrate with
|
|
9
|
+
* `@venturekit/runtime`'s `RequestContext.tenant` field.
|
|
10
|
+
*
|
|
11
|
+
* This module fills that gap. It exposes a `Middleware<RequestContext>`
|
|
12
|
+
* compatible with `handler({ middleware: [...] })` that:
|
|
13
|
+
*
|
|
14
|
+
* 1. Calls a caller-provided async resolver with the live
|
|
15
|
+
* `RequestContext` (so the resolver can read headers, query
|
|
16
|
+
* params, JWT claims, and the raw API Gateway event).
|
|
17
|
+
* 2. Populates `ctx.tenant` with the resolved tenant.
|
|
18
|
+
* 3. 404s with {@link TenantNotFoundError} on miss — protecting
|
|
19
|
+
* multi-tenant Lambdas from leaking the platform's existence to
|
|
20
|
+
* hostnames that aren't configured.
|
|
21
|
+
*
|
|
22
|
+
* A common case — derive the tenant from a host like `api.<domain>`
|
|
23
|
+
* with a `domains` table lookup — is built on top of this primitive
|
|
24
|
+
* via {@link hostPrefixDomainResolver}. Apps that need different rules
|
|
25
|
+
* (path prefix, JWT claim, header, …) plug their own resolver in.
|
|
26
|
+
*/
|
|
27
|
+
import type { Middleware, RequestContext, TenantContext } from '@venturekit/runtime';
|
|
28
|
+
export interface RuntimeTenantResolver {
|
|
29
|
+
(ctx: RequestContext): Promise<TenantContext | null> | TenantContext | null;
|
|
30
|
+
}
|
|
31
|
+
export interface RuntimeTenantMiddlewareOptions {
|
|
32
|
+
/**
|
|
33
|
+
* Function that produces the tenant for the current request. Return
|
|
34
|
+
* `null` to signal "no tenant matched"; the middleware will throw
|
|
35
|
+
* {@link TenantNotFoundError} (404) unless `optional: true`.
|
|
36
|
+
*
|
|
37
|
+
* The resolver receives the full `RequestContext` so it can read
|
|
38
|
+
* `rawEvent.headers`, `queryParams`, `user`, etc.
|
|
39
|
+
*/
|
|
40
|
+
resolver: RuntimeTenantResolver;
|
|
41
|
+
/**
|
|
42
|
+
* If `true`, missing tenants pass through with `ctx.tenant = null`
|
|
43
|
+
* instead of 404-ing. Use for routes that legitimately work
|
|
44
|
+
* un-scoped (e.g. health checks, platform-level admin).
|
|
45
|
+
*
|
|
46
|
+
* Default: `false`.
|
|
47
|
+
*/
|
|
48
|
+
optional?: boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Build a `@venturekit/runtime`-compatible middleware that resolves
|
|
52
|
+
* the current request's tenant and stashes it on `ctx.tenant`.
|
|
53
|
+
*
|
|
54
|
+
* Place this **before** any tenant-scoped logic in your middleware
|
|
55
|
+
* stack.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* import { handler } from '@venturekit/runtime';
|
|
60
|
+
* import {
|
|
61
|
+
* createRuntimeTenantMiddleware,
|
|
62
|
+
* hostPrefixDomainResolver,
|
|
63
|
+
* } from '@venturekit-pro/tenancy';
|
|
64
|
+
*
|
|
65
|
+
* const tenancy = createRuntimeTenantMiddleware({
|
|
66
|
+
* resolver: hostPrefixDomainResolver({
|
|
67
|
+
* prefix: 'api.',
|
|
68
|
+
* lookup: async (domain) => loadCommunityByDomain(domain),
|
|
69
|
+
* }),
|
|
70
|
+
* });
|
|
71
|
+
*
|
|
72
|
+
* export const main = handler(async (_b, ctx) => ({
|
|
73
|
+
* tenant: ctx.tenant!.slug,
|
|
74
|
+
* }), { middleware: [tenancy] });
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
export declare function createRuntimeTenantMiddleware(options: RuntimeTenantMiddlewareOptions): Middleware<RequestContext>;
|
|
78
|
+
export interface HostPrefixDomainResolverOptions<T extends TenantContext> {
|
|
79
|
+
/**
|
|
80
|
+
* Prefix to strip from the request's `Host` header before looking
|
|
81
|
+
* up. Defaults to `'api.'` — so `api.insea.pro` resolves the tenant
|
|
82
|
+
* whose domain is `insea.pro`.
|
|
83
|
+
*/
|
|
84
|
+
prefix?: string;
|
|
85
|
+
/**
|
|
86
|
+
* Caller-supplied DB lookup. Receives the post-strip hostname
|
|
87
|
+
* (without port) and returns the tenant or `null`.
|
|
88
|
+
*/
|
|
89
|
+
lookup: (domain: string, ctx: RequestContext) => Promise<T | null> | T | null;
|
|
90
|
+
/**
|
|
91
|
+
* Dev-only overrides honored when `process.env.STAGE === 'dev'`.
|
|
92
|
+
* Lets `vk dev` serve tenanted routes from `localhost:3001` by
|
|
93
|
+
* accepting an explicit slug from a header or query param.
|
|
94
|
+
*
|
|
95
|
+
* Defaults: header `X-Tenant-Slug`, query `tenant`. Set to `false`
|
|
96
|
+
* to disable.
|
|
97
|
+
*/
|
|
98
|
+
devOverrides?: false | {
|
|
99
|
+
headerName?: string;
|
|
100
|
+
queryName?: string;
|
|
101
|
+
lookupBySlug: (slug: string, ctx: RequestContext) => Promise<T | null> | T | null;
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Build a {@link RuntimeTenantResolver} that derives the tenant from
|
|
106
|
+
* the request's `Host` header by stripping a prefix (default `api.`)
|
|
107
|
+
* and looking the remainder up in a caller-supplied store.
|
|
108
|
+
*
|
|
109
|
+
* Encapsulates the "every API hostname is `api.<tenant-domain>`"
|
|
110
|
+
* convention many multi-tenant VentureKit apps share, including the
|
|
111
|
+
* dev-only `X-Tenant-Slug` / `?tenant=` overrides for `vk dev`.
|
|
112
|
+
*/
|
|
113
|
+
export declare function hostPrefixDomainResolver<T extends TenantContext>(options: HostPrefixDomainResolverOptions<T>): RuntimeTenantResolver;
|
|
114
|
+
//# sourceMappingURL=runtime-tenant-middleware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-tenant-middleware.d.ts","sourceRoot":"","sources":["../../src/middleware/runtime-tenant-middleware.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAIrF,MAAM,WAAW,qBAAqB;IACpC,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,GAAG,aAAa,GAAG,IAAI,CAAC;CAC7E;AAED,MAAM,WAAW,8BAA8B;IAC7C;;;;;;;OAOG;IACH,QAAQ,EAAE,qBAAqB,CAAC;IAEhC;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,8BAA8B,GACtC,UAAU,CAAC,cAAc,CAAC,CAiB5B;AAED,MAAM,WAAW,+BAA+B,CAAC,CAAC,SAAS,aAAa;IACtE;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,MAAM,EAAE,CACN,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,cAAc,KAChB,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;IAClC;;;;;;;OAOG;IACH,YAAY,CAAC,EACT,KAAK,GACL;QACE,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,CACZ,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,cAAc,KAChB,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;KACnC,CAAC;CACP;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,SAAS,aAAa,EAC9D,OAAO,EAAE,+BAA+B,CAAC,CAAC,CAAC,GAC1C,qBAAqB,CAgCvB"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { TenantNotFoundError } from './tenant-middleware.js';
|
|
2
|
+
/**
|
|
3
|
+
* Build a `@venturekit/runtime`-compatible middleware that resolves
|
|
4
|
+
* the current request's tenant and stashes it on `ctx.tenant`.
|
|
5
|
+
*
|
|
6
|
+
* Place this **before** any tenant-scoped logic in your middleware
|
|
7
|
+
* stack.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { handler } from '@venturekit/runtime';
|
|
12
|
+
* import {
|
|
13
|
+
* createRuntimeTenantMiddleware,
|
|
14
|
+
* hostPrefixDomainResolver,
|
|
15
|
+
* } from '@venturekit-pro/tenancy';
|
|
16
|
+
*
|
|
17
|
+
* const tenancy = createRuntimeTenantMiddleware({
|
|
18
|
+
* resolver: hostPrefixDomainResolver({
|
|
19
|
+
* prefix: 'api.',
|
|
20
|
+
* lookup: async (domain) => loadCommunityByDomain(domain),
|
|
21
|
+
* }),
|
|
22
|
+
* });
|
|
23
|
+
*
|
|
24
|
+
* export const main = handler(async (_b, ctx) => ({
|
|
25
|
+
* tenant: ctx.tenant!.slug,
|
|
26
|
+
* }), { middleware: [tenancy] });
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export function createRuntimeTenantMiddleware(options) {
|
|
30
|
+
const { resolver, optional = false } = options;
|
|
31
|
+
return {
|
|
32
|
+
name: 'runtime-tenant',
|
|
33
|
+
fn: async (ctx, next) => {
|
|
34
|
+
const tenant = await resolver(ctx);
|
|
35
|
+
if (!tenant) {
|
|
36
|
+
if (optional) {
|
|
37
|
+
ctx.tenant = null;
|
|
38
|
+
return next();
|
|
39
|
+
}
|
|
40
|
+
throw new TenantNotFoundError('unknown');
|
|
41
|
+
}
|
|
42
|
+
ctx.tenant = tenant;
|
|
43
|
+
return next();
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Build a {@link RuntimeTenantResolver} that derives the tenant from
|
|
49
|
+
* the request's `Host` header by stripping a prefix (default `api.`)
|
|
50
|
+
* and looking the remainder up in a caller-supplied store.
|
|
51
|
+
*
|
|
52
|
+
* Encapsulates the "every API hostname is `api.<tenant-domain>`"
|
|
53
|
+
* convention many multi-tenant VentureKit apps share, including the
|
|
54
|
+
* dev-only `X-Tenant-Slug` / `?tenant=` overrides for `vk dev`.
|
|
55
|
+
*/
|
|
56
|
+
export function hostPrefixDomainResolver(options) {
|
|
57
|
+
const prefix = options.prefix ?? 'api.';
|
|
58
|
+
const dev = options.devOverrides;
|
|
59
|
+
return async (ctx) => {
|
|
60
|
+
const headers = ctx.rawEvent.headers ?? {};
|
|
61
|
+
if (process.env.STAGE === 'dev' && dev !== false) {
|
|
62
|
+
const headerName = (dev?.headerName ?? 'x-tenant-slug').toLowerCase();
|
|
63
|
+
const queryName = dev?.queryName ?? 'tenant';
|
|
64
|
+
const headerValue = headers[headerName] ??
|
|
65
|
+
headers[headerName.toUpperCase()] ??
|
|
66
|
+
headers[headerName
|
|
67
|
+
.split('-')
|
|
68
|
+
.map((p) => p.charAt(0).toUpperCase() + p.slice(1))
|
|
69
|
+
.join('-')];
|
|
70
|
+
const querySlug = ctx.queryParams?.[queryName];
|
|
71
|
+
const slug = headerValue ?? querySlug;
|
|
72
|
+
if (slug && dev?.lookupBySlug) {
|
|
73
|
+
return (await dev.lookupBySlug(slug, ctx)) ?? null;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const rawHost = (headers['host'] ?? headers['Host'] ?? '').toLowerCase();
|
|
77
|
+
if (!rawHost)
|
|
78
|
+
return null;
|
|
79
|
+
const host = rawHost.split(':', 1)[0];
|
|
80
|
+
const domain = host.startsWith(prefix) ? host.slice(prefix.length) : host;
|
|
81
|
+
return (await options.lookup(domain, ctx)) ?? null;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=runtime-tenant-middleware.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-tenant-middleware.js","sourceRoot":"","sources":["../../src/middleware/runtime-tenant-middleware.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@venturekit-pro/tenancy",
|
|
3
|
-
"version": "0.0.0-dev.
|
|
3
|
+
"version": "0.0.0-dev.20260525024212",
|
|
4
4
|
"description": "Multi-tenant utilities for VentureKit",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -26,10 +26,19 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@venturekit/core": "0.0.0-dev.
|
|
29
|
+
"@venturekit/core": "0.0.0-dev.20260525024212"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"@venturekit/runtime": "0.0.0-dev.20260525024212"
|
|
33
|
+
},
|
|
34
|
+
"peerDependenciesMeta": {
|
|
35
|
+
"@venturekit/runtime": {
|
|
36
|
+
"optional": true
|
|
37
|
+
}
|
|
30
38
|
},
|
|
31
39
|
"devDependencies": {
|
|
32
40
|
"@types/node": "^25.6.0",
|
|
41
|
+
"@venturekit/runtime": "0.0.0-dev.20260525024212",
|
|
33
42
|
"typescript": "^5.3.0"
|
|
34
43
|
},
|
|
35
44
|
"scripts": {
|