@stratal/framework 0.0.18 → 0.0.19
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/access-control/index.d.mts +180 -0
- package/dist/access-control/index.d.mts.map +1 -0
- package/dist/access-control/index.mjs +71 -0
- package/dist/access-control/index.mjs.map +1 -0
- package/dist/access.service-BjYVtUJw.mjs +145 -0
- package/dist/access.service-BjYVtUJw.mjs.map +1 -0
- package/dist/auth/index.d.mts +122 -4
- package/dist/auth/index.d.mts.map +1 -1
- package/dist/auth/index.mjs +237 -65
- package/dist/auth/index.mjs.map +1 -1
- package/dist/{auth-context-BD2ApWg1.d.mts → auth-context-BXSkiJ56.d.mts} +14 -1
- package/dist/auth-context-BXSkiJ56.d.mts.map +1 -0
- package/dist/{auth-context-BfekHvM9.mjs → auth-context-BberoPal.mjs} +25 -4
- package/dist/auth-context-BberoPal.mjs.map +1 -0
- package/dist/context/index.d.mts +1 -1
- package/dist/context/index.mjs +2 -2
- package/dist/database/index.d.mts +3 -3
- package/dist/database/index.mjs +49 -43
- package/dist/database/index.mjs.map +1 -1
- package/dist/{decorate-C12QolJF.mjs → decorate-CdfCRvAc.mjs} +1 -1
- package/dist/{decorateMetadata-rWbWGUuO.mjs → decorateMetadata-CqtSx3_1.mjs} +1 -1
- package/dist/decorateParam-Dc5DGEpb.mjs +18 -0
- package/dist/decorateParam-Dc5DGEpb.mjs.map +1 -0
- package/dist/{errors-C_KIIU1v.mjs → errors-B1vVXc1T.mjs} +1 -1
- package/dist/{errors-C_KIIU1v.mjs.map → errors-B1vVXc1T.mjs.map} +1 -1
- package/dist/factory/index.d.mts +1 -1
- package/dist/guards/index.d.mts +7 -6
- package/dist/guards/index.d.mts.map +1 -1
- package/dist/guards/index.mjs +38 -29
- package/dist/guards/index.mjs.map +1 -1
- package/dist/{index-B1iGBJcO.d.mts → index-CpFBG0Ws.d.mts} +23 -41
- package/dist/index-CpFBG0Ws.d.mts.map +1 -0
- package/dist/index.d.mts +2 -2
- package/dist/insufficient-permissions.error-CRnOHYvq.mjs +23 -0
- package/dist/insufficient-permissions.error-CRnOHYvq.mjs.map +1 -0
- package/dist/types-BLyu9dAd.d.mts +11 -0
- package/dist/types-BLyu9dAd.d.mts.map +1 -0
- package/dist/types-BZlcRR2M.d.mts +92 -0
- package/dist/types-BZlcRR2M.d.mts.map +1 -0
- package/package.json +22 -22
- package/dist/auth-context-BD2ApWg1.d.mts.map +0 -1
- package/dist/auth-context-BfekHvM9.mjs.map +0 -1
- package/dist/decorateParam-WGqsyT5s.mjs +0 -8
- package/dist/index-B1iGBJcO.d.mts.map +0 -1
- package/dist/rbac/index.d.mts +0 -206
- package/dist/rbac/index.d.mts.map +0 -1
- package/dist/rbac/index.mjs +0 -346
- package/dist/rbac/index.mjs.map +0 -1
- package/dist/tokens-Di1ofovy.mjs +0 -32
- package/dist/tokens-Di1ofovy.mjs.map +0 -1
- package/dist/types-Gjk0d2qB.d.mts +0 -47
- package/dist/types-Gjk0d2qB.d.mts.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tokens-Di1ofovy.mjs","names":[],"sources":["../src/rbac/errors/insufficient-permissions.error.ts","../src/rbac/tokens.ts"],"sourcesContent":["import { ApplicationError, ERROR_CODES } from 'stratal/errors'\n\n/**\n * InsufficientPermissionsError\n *\n * Thrown when a user attempts to perform an action without the required permissions.\n * This error is used by the auth guard after authorization check fails.\n *\n * HTTP Status: 403 Forbidden\n * Error Code: 3102 (AUTHZ.INSUFFICIENT_PERMISSIONS)\n */\nexport class InsufficientPermissionsError extends ApplicationError {\n constructor(requiredScopes: string[], userId?: string) {\n super('errors.insufficientPermissions', ERROR_CODES.AUTHZ.INSUFFICIENT_PERMISSIONS, {\n requiredScopes: requiredScopes.join(', '),\n userId: userId ?? 'unknown',\n })\n }\n}\n","/**\n * RBAC DI Tokens\n */\nexport const RBAC_TOKENS = {\n /** Request-scoped Casbin service with auto context resolution */\n CasbinService: Symbol.for('stratal:rbac:casbin:service'),\n /** RBAC module options (model, policies, hierarchy) */\n Options: Symbol.for('stratal:rbac:options'),\n} as const\n"],"mappings":";;;;;;;;;;;AAWA,IAAa,+BAAb,cAAkD,iBAAiB;CACjE,YAAY,gBAA0B,QAAiB;AACrD,QAAM,kCAAkC,YAAY,MAAM,0BAA0B;GAClF,gBAAgB,eAAe,KAAK,KAAK;GACzC,QAAQ,UAAU;GACnB,CAAC;;;;;;;;ACbN,MAAa,cAAc;CAEzB,eAAe,OAAO,IAAI,8BAA8B;CAExD,SAAS,OAAO,IAAI,uBAAuB;CAC5C"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { SchemaDef } from "@zenstackhq/schema";
|
|
2
|
-
|
|
3
|
-
//#region src/database/types.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* Augment with per-connection schemas and default connection.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```typescript
|
|
9
|
-
* declare module '@stratal/framework/database' {
|
|
10
|
-
* interface StratalDatabase {
|
|
11
|
-
* schemas: {
|
|
12
|
-
* main: MainSchemaType
|
|
13
|
-
* tenant: TenantSchemaType
|
|
14
|
-
* }
|
|
15
|
-
* defaultConnection: 'main'
|
|
16
|
-
* }
|
|
17
|
-
* }
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
interface StratalDatabase {}
|
|
21
|
-
/** Infer schema type for a specific connection */
|
|
22
|
-
type InferConnectionSchema<K extends string> = StratalDatabase extends {
|
|
23
|
-
schemas: infer R;
|
|
24
|
-
} ? K extends keyof R ? R[K] extends SchemaDef ? R[K] : SchemaDef : SchemaDef : SchemaDef;
|
|
25
|
-
/** Union of ALL schemas across connections (for events) */
|
|
26
|
-
type InferAnySchema = StratalDatabase extends {
|
|
27
|
-
schemas: infer R;
|
|
28
|
-
} ? R[keyof R] extends SchemaDef ? R[keyof R] : SchemaDef : SchemaDef;
|
|
29
|
-
/** Connection name — derived from schemas keys */
|
|
30
|
-
type ConnectionName = StratalDatabase extends {
|
|
31
|
-
schemas: infer R;
|
|
32
|
-
} ? keyof R extends never ? string : Extract<keyof R, string> : string;
|
|
33
|
-
/** Default connection name */
|
|
34
|
-
type DefaultConnectionName = StratalDatabase extends {
|
|
35
|
-
defaultConnection: infer N extends string;
|
|
36
|
-
} ? N : string;
|
|
37
|
-
/**
|
|
38
|
-
* Internal context used by database service for dynamic event emission
|
|
39
|
-
* @internal
|
|
40
|
-
*/
|
|
41
|
-
interface InternalDatabaseEventContext {
|
|
42
|
-
data: unknown;
|
|
43
|
-
result?: unknown;
|
|
44
|
-
}
|
|
45
|
-
//#endregion
|
|
46
|
-
export { InternalDatabaseEventContext as a, InferConnectionSchema as i, DefaultConnectionName as n, StratalDatabase as o, InferAnySchema as r, ConnectionName as t };
|
|
47
|
-
//# sourceMappingURL=types-Gjk0d2qB.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types-Gjk0d2qB.d.mts","names":[],"sources":["../src/database/types.ts"],"mappings":";;;;;AAkBA;;;;;AAGA;;;;;;;;;UAHiB,eAAA;;KAGL,qBAAA,qBACV,eAAA;EAA0B,OAAA;AAAA,IACtB,CAAA,eAAgB,CAAA,GAAI,CAAA,CAAE,CAAA,UAAW,SAAA,GAAY,CAAA,CAAE,CAAA,IAAK,SAAA,GAAY,SAAA,GAChE,SAAA;;KAGM,cAAA,GACV,eAAA;EAA0B,OAAA;AAAA,IACtB,CAAA,OAAQ,CAAA,UAAW,SAAA,GAAY,CAAA,OAAQ,CAAA,IAAK,SAAA,GAC5C,SAAA;;KAGM,cAAA,GACV,eAAA;EAA0B,OAAA;AAAA,UAChB,CAAA,0BAA2B,OAAA,OAAc,CAAA;;KAIzC,qBAAA,GACV,eAAA;EAA0B,iBAAA;AAAA,IAA8C,CAAA;;;;;UAMzD,4BAAA;EACf,IAAA;EACA,MAAA;AAAA"}
|