tina4-nodejs 3.13.104 → 3.13.108
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/CLAUDE.md +16 -2
- package/README.md +3 -4
- package/package.json +1 -1
- package/packages/cli/dist/bin.js +233 -43
- package/packages/core/dist/index.js +233 -43
- package/packages/core/public/js/tina4js.min.js +3 -3
- package/packages/core/src/authGate.ts +61 -1
- package/packages/core/src/queue.ts +75 -18
- package/packages/core/src/queueBackends/liteBackend.ts +17 -1
- package/packages/core/src/queueBackends/mongoBackend.ts +80 -14
- package/packages/core/src/router.ts +38 -0
- package/packages/core/src/server.ts +29 -1
- package/packages/core/src/types.ts +4 -0
- package/packages/orm/dist/index.js +233 -43
- package/packages/orm/src/baseModel.ts +18 -5
- package/packages/orm/src/migration.ts +14 -5
- package/types/core/src/authGate.d.ts +3 -0
- package/types/core/src/queue.d.ts +41 -4
- package/types/core/src/queueBackends/liteBackend.d.ts +7 -1
- package/types/core/src/queueBackends/mongoBackend.d.ts +7 -2
- package/types/core/src/router.d.ts +16 -0
- package/types/core/src/types.d.ts +4 -0
- package/types/orm/src/baseModel.d.ts +10 -5
|
@@ -17,6 +17,8 @@ interface MatchResult {
|
|
|
17
17
|
secure?: boolean;
|
|
18
18
|
cached?: boolean;
|
|
19
19
|
noAuth?: boolean;
|
|
20
|
+
requiredRoles?: string[][];
|
|
21
|
+
requiredPerms?: string[][];
|
|
20
22
|
}
|
|
21
23
|
interface CompiledRoute {
|
|
22
24
|
pattern: string;
|
|
@@ -36,6 +38,9 @@ interface CompiledRoute {
|
|
|
36
38
|
}>;
|
|
37
39
|
cacheTtl?: number;
|
|
38
40
|
template?: string;
|
|
41
|
+
/** RBAC guard groups (Feature 138): OR within a group, AND across groups. */
|
|
42
|
+
requiredRoles?: string[][];
|
|
43
|
+
requiredPerms?: string[][];
|
|
39
44
|
}
|
|
40
45
|
/**
|
|
41
46
|
* Thin reference to a registered WebSocket route, enabling chained modifiers
|
|
@@ -63,6 +68,17 @@ export declare class RouteRef {
|
|
|
63
68
|
secure(): this;
|
|
64
69
|
/** Opt out of secure-by-default auth (for public write routes). */
|
|
65
70
|
noAuth(): this;
|
|
71
|
+
/**
|
|
72
|
+
* RBAC: require ONE of the named roles (OR). Reads the verified JWT `roles`
|
|
73
|
+
* claim. Chain .role()/.can() for AND. Implies auth. Feature 138 / ADR-0058.
|
|
74
|
+
*/
|
|
75
|
+
role(...names: string[]): this;
|
|
76
|
+
/**
|
|
77
|
+
* RBAC: require ONE of the named permissions (OR). Reads the verified JWT
|
|
78
|
+
* `permissions` claim; granted-side wildcards (`posts.*`, `*`) satisfy a
|
|
79
|
+
* concrete requirement. Chain for AND. Implies auth. Feature 138.
|
|
80
|
+
*/
|
|
81
|
+
can(...permissions: string[]): this;
|
|
66
82
|
/** Mark this route's response as cacheable. */
|
|
67
83
|
cache(): this;
|
|
68
84
|
/**
|
|
@@ -146,6 +146,10 @@ export interface RouteDefinition {
|
|
|
146
146
|
cached?: boolean;
|
|
147
147
|
/** Opt out of secure-by-default auth on write routes */
|
|
148
148
|
noAuth?: boolean;
|
|
149
|
+
/** RBAC role guard groups (Feature 138): OR within a group, AND across groups */
|
|
150
|
+
requiredRoles?: string[][];
|
|
151
|
+
/** RBAC permission guard groups (Feature 138) */
|
|
152
|
+
requiredPerms?: string[][];
|
|
149
153
|
}
|
|
150
154
|
export interface RouteMeta {
|
|
151
155
|
summary?: string;
|
|
@@ -339,11 +339,16 @@ export declare class BaseModel {
|
|
|
339
339
|
/**
|
|
340
340
|
* Invalidate every cached query that touches this model's table.
|
|
341
341
|
*
|
|
342
|
-
* Tag-scoped
|
|
343
|
-
* this table is busted too
|
|
344
|
-
* never touches this table is left intact
|
|
345
|
-
*
|
|
346
|
-
*
|
|
342
|
+
* Tag-scoped in the ORM layer (a cached JOIN on another model that reads
|
|
343
|
+
* this table is busted too because it carries this table's tag; a query
|
|
344
|
+
* that never touches this table is left intact), then cascaded to the
|
|
345
|
+
* DB layer on this model's bound connection so an out-of-band write /
|
|
346
|
+
* deliberate refresh / race-with-another-process cannot leave stale rows
|
|
347
|
+
* in db.fetch()'s persistent cache. Called after every ORM write
|
|
348
|
+
* (save/delete/forceDelete/restore) so a read-after-write never serves
|
|
349
|
+
* a stale/deleted row (CACHE-DEC-01). PY-06-22 (3.13.105) added the
|
|
350
|
+
* DB-layer cascade -- previously the two cache layers disagreed under
|
|
351
|
+
* TINA4_AUTO_CACHING=true + TINA4_DB_CACHE=true.
|
|
347
352
|
*/
|
|
348
353
|
static clearCache(): void;
|
|
349
354
|
/**
|