glasswork 0.13.3 → 1.0.1
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/CHANGELOG.md +80 -0
- package/README.md +6 -2
- package/dist/auth/abilities.d.ts +9 -6
- package/dist/auth/abilities.d.ts.map +1 -1
- package/dist/auth/abilities.js +15 -19
- package/dist/auth/abilities.js.map +1 -1
- package/dist/auth/assert.d.ts +3 -3
- package/dist/auth/assert.d.ts.map +1 -1
- package/dist/auth/casl-bridge.d.ts +19 -0
- package/dist/auth/casl-bridge.d.ts.map +1 -0
- package/dist/auth/casl-bridge.js +29 -0
- package/dist/auth/casl-bridge.js.map +1 -0
- package/dist/auth/index.d.ts +1 -0
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +1 -0
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/middleware.d.ts +3 -3
- package/dist/auth/middleware.d.ts.map +1 -1
- package/dist/auth/middleware.js +2 -2
- package/dist/auth/middleware.js.map +1 -1
- package/dist/auth/types.d.ts +2 -2
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.js +1 -1
- package/dist/core/bootstrap.d.ts +0 -17
- package/dist/core/bootstrap.d.ts.map +1 -1
- package/dist/core/bootstrap.js +4 -240
- package/dist/core/bootstrap.js.map +1 -1
- package/dist/core/index.d.ts +19 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +15 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/lifecycle.d.ts +7 -0
- package/dist/core/lifecycle.d.ts.map +1 -0
- package/dist/core/lifecycle.js +28 -0
- package/dist/core/lifecycle.js.map +1 -0
- package/dist/core/module-graph.d.ts +21 -0
- package/dist/core/module-graph.d.ts.map +1 -0
- package/dist/core/module-graph.js +169 -0
- package/dist/core/module-graph.js.map +1 -0
- package/dist/core/route-factory.d.ts +20 -0
- package/dist/core/route-factory.d.ts.map +1 -0
- package/dist/core/route-factory.js +2 -0
- package/dist/core/route-factory.js.map +1 -0
- package/dist/core/types.d.ts +4 -14
- package/dist/core/types.d.ts.map +1 -1
- package/dist/email/compiler/compile-templates.d.ts +3 -8
- package/dist/email/compiler/compile-templates.d.ts.map +1 -1
- package/dist/email/compiler/compile-templates.js +3 -3
- package/dist/email/compiler/compile-templates.js.map +1 -1
- package/dist/email/compiler/compiler.d.ts +5 -2
- package/dist/email/compiler/compiler.d.ts.map +1 -1
- package/dist/email/compiler/compiler.js +2 -21
- package/dist/email/compiler/compiler.js.map +1 -1
- package/dist/email/transports/ses-transport.d.ts.map +1 -1
- package/dist/email/transports/ses-transport.js +11 -18
- package/dist/email/transports/ses-transport.js.map +1 -1
- package/dist/email/webhooks/handler-factory.d.ts +1 -1
- package/dist/email/webhooks/handler-factory.js +1 -1
- package/dist/email/webhooks/notification-parser.d.ts +1 -1
- package/dist/email/webhooks/notification-parser.js +1 -1
- package/dist/email/webhooks/signature-verification.d.ts +1 -1
- package/dist/email/webhooks/signature-verification.js +1 -1
- package/dist/email/webhooks/subscription-handler.d.ts +1 -1
- package/dist/email/webhooks/subscription-handler.js +1 -1
- package/dist/hono-context.d.ts +13 -0
- package/dist/hono-context.d.ts.map +1 -0
- package/dist/hono-context.js +2 -0
- package/dist/hono-context.js.map +1 -0
- package/dist/http/index.d.ts +18 -0
- package/dist/http/index.d.ts.map +1 -0
- package/dist/http/index.js +15 -0
- package/dist/http/index.js.map +1 -0
- package/dist/http/route-authorization.d.ts +9 -0
- package/dist/http/route-authorization.d.ts.map +1 -0
- package/dist/http/route-authorization.js +19 -0
- package/dist/http/route-authorization.js.map +1 -0
- package/dist/http/route-context.d.ts +8 -0
- package/dist/http/route-context.d.ts.map +1 -0
- package/dist/http/route-context.js +26 -0
- package/dist/http/route-context.js.map +1 -0
- package/dist/http/route-helpers.d.ts +6 -419
- package/dist/http/route-helpers.d.ts.map +1 -1
- package/dist/http/route-helpers.js +7 -462
- package/dist/http/route-helpers.js.map +1 -1
- package/dist/http/route-openapi-context.d.ts +27 -0
- package/dist/http/route-openapi-context.d.ts.map +1 -0
- package/dist/http/route-openapi-context.js +16 -0
- package/dist/http/route-openapi-context.js.map +1 -0
- package/dist/http/route-openapi.d.ts +5 -0
- package/dist/http/route-openapi.d.ts.map +1 -0
- package/dist/http/route-openapi.js +112 -0
- package/dist/http/route-openapi.js.map +1 -0
- package/dist/http/route-response.d.ts +5 -0
- package/dist/http/route-response.d.ts.map +1 -0
- package/dist/http/route-response.js +78 -0
- package/dist/http/route-response.js.map +1 -0
- package/dist/http/route-types.d.ts +93 -0
- package/dist/http/route-types.d.ts.map +1 -0
- package/dist/http/route-types.js +22 -0
- package/dist/http/route-types.js.map +1 -0
- package/dist/http/route-validation.d.ts +11 -0
- package/dist/http/route-validation.d.ts.map +1 -0
- package/dist/http/route-validation.js +24 -0
- package/dist/http/route-validation.js.map +1 -0
- package/dist/index.d.ts +7 -45
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -65
- package/dist/index.js.map +1 -1
- package/dist/jobs/drivers/eventbridge-scheduler-driver.d.ts.map +1 -1
- package/dist/jobs/drivers/eventbridge-scheduler-driver.js +1 -3
- package/dist/jobs/drivers/eventbridge-scheduler-driver.js.map +1 -1
- package/dist/jobs/drivers/sqs-driver.d.ts +1 -1
- package/dist/jobs/drivers/sqs-driver.d.ts.map +1 -1
- package/dist/jobs/drivers/sqs-driver.js +1 -3
- package/dist/jobs/drivers/sqs-driver.js.map +1 -1
- package/dist/jobs/worker.d.ts.map +1 -1
- package/dist/jobs/worker.js +3 -14
- package/dist/jobs/worker.js.map +1 -1
- package/dist/list-query/builder.d.ts +26 -5
- package/dist/list-query/builder.d.ts.map +1 -1
- package/dist/list-query/builder.js +18 -10
- package/dist/list-query/builder.js.map +1 -1
- package/dist/list-query/casl.d.ts +20 -4
- package/dist/list-query/casl.d.ts.map +1 -1
- package/dist/list-query/casl.js +3 -12
- package/dist/list-query/casl.js.map +1 -1
- package/dist/list-query/filter-value-schemas.d.ts +16 -0
- package/dist/list-query/filter-value-schemas.d.ts.map +1 -0
- package/dist/list-query/filter-value-schemas.js +46 -0
- package/dist/list-query/filter-value-schemas.js.map +1 -0
- package/dist/list-query/index.d.ts +7 -1
- package/dist/list-query/index.d.ts.map +1 -1
- package/dist/list-query/index.js +6 -2
- package/dist/list-query/index.js.map +1 -1
- package/dist/list-query/list-params.d.ts +17 -0
- package/dist/list-query/list-params.d.ts.map +1 -0
- package/dist/list-query/list-params.js +2 -0
- package/dist/list-query/list-params.js.map +1 -0
- package/dist/list-query/parse-filter-values.d.ts +21 -0
- package/dist/list-query/parse-filter-values.d.ts.map +1 -0
- package/dist/list-query/parse-filter-values.js +177 -0
- package/dist/list-query/parse-filter-values.js.map +1 -0
- package/dist/list-query/prisma-builder.d.ts.map +1 -1
- package/dist/list-query/prisma-builder.js +3 -50
- package/dist/list-query/prisma-builder.js.map +1 -1
- package/dist/list-query/prisma-executor.d.ts +63 -0
- package/dist/list-query/prisma-executor.d.ts.map +1 -0
- package/dist/list-query/prisma-executor.js +88 -0
- package/dist/list-query/prisma-executor.js.map +1 -0
- package/dist/list-query/schema-helpers.d.ts +37 -17
- package/dist/list-query/schema-helpers.d.ts.map +1 -1
- package/dist/list-query/schema-helpers.js +87 -24
- package/dist/list-query/schema-helpers.js.map +1 -1
- package/dist/list-query/sort-field-types.d.ts +21 -0
- package/dist/list-query/sort-field-types.d.ts.map +1 -0
- package/dist/list-query/sort-field-types.js +2 -0
- package/dist/list-query/sort-field-types.js.map +1 -0
- package/dist/list-query/unrestricted-schemas.d.ts +13 -0
- package/dist/list-query/unrestricted-schemas.d.ts.map +1 -0
- package/dist/list-query/unrestricted-schemas.js +9 -0
- package/dist/list-query/unrestricted-schemas.js.map +1 -0
- package/dist/list-query/validator.d.ts +2 -2
- package/dist/list-query/validator.d.ts.map +1 -1
- package/dist/observability/exception-tracking.d.ts +5 -4
- package/dist/observability/exception-tracking.d.ts.map +1 -1
- package/dist/observability/exception-tracking.js +4 -3
- package/dist/observability/exception-tracking.js.map +1 -1
- package/dist/observability/index.d.ts +8 -0
- package/dist/observability/index.d.ts.map +1 -0
- package/dist/observability/index.js +8 -0
- package/dist/observability/index.js.map +1 -0
- package/dist/observability/pino-logger.d.ts +3 -3
- package/dist/observability/pino-logger.js +3 -3
- package/dist/observability/request-context.d.ts +4 -4
- package/dist/observability/request-context.js +4 -4
- package/package.json +93 -53
- package/dist/authorization/ability-middleware.d.ts +0 -61
- package/dist/authorization/ability-middleware.d.ts.map +0 -1
- package/dist/authorization/ability-middleware.js +0 -74
- package/dist/authorization/ability-middleware.js.map +0 -1
- package/dist/authorization/index.d.ts +0 -46
- package/dist/authorization/index.d.ts.map +0 -1
- package/dist/authorization/index.js +0 -46
- package/dist/authorization/index.js.map +0 -1
- package/dist/authorization/route-helpers.d.ts +0 -106
- package/dist/authorization/route-helpers.d.ts.map +0 -1
- package/dist/authorization/route-helpers.js +0 -136
- package/dist/authorization/route-helpers.js.map +0 -1
- package/dist/authorization/service-proxy.d.ts +0 -59
- package/dist/authorization/service-proxy.d.ts.map +0 -1
- package/dist/authorization/service-proxy.js +0 -110
- package/dist/authorization/service-proxy.js.map +0 -1
- package/dist/authorization/types.d.ts +0 -58
- package/dist/authorization/types.d.ts.map +0 -1
- package/dist/authorization/types.js +0 -7
- package/dist/authorization/types.js.map +0 -1
- package/dist/hooks/authorization-hook.d.ts +0 -100
- package/dist/hooks/authorization-hook.d.ts.map +0 -1
- package/dist/hooks/authorization-hook.js +0 -93
- package/dist/hooks/authorization-hook.js.map +0 -1
- package/dist/hooks/index.d.ts +0 -54
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/hooks/index.js +0 -55
- package/dist/hooks/index.js.map +0 -1
- package/dist/hooks/service-hooks.d.ts +0 -82
- package/dist/hooks/service-hooks.d.ts.map +0 -1
- package/dist/hooks/service-hooks.js +0 -158
- package/dist/hooks/service-hooks.js.map +0 -1
- package/dist/hooks/types.d.ts +0 -151
- package/dist/hooks/types.d.ts.map +0 -1
- package/dist/hooks/types.js +0 -2
- package/dist/hooks/types.js.map +0 -1
- package/dist/openapi/hooks.d.ts +0 -14
- package/dist/openapi/hooks.d.ts.map +0 -1
- package/dist/openapi/hooks.js +0 -83
- package/dist/openapi/hooks.js.map +0 -1
- package/dist/openapi/openapi-transformer.d.ts +0 -13
- package/dist/openapi/openapi-transformer.d.ts.map +0 -1
- package/dist/openapi/openapi-transformer.js +0 -87
- package/dist/openapi/openapi-transformer.js.map +0 -1
- package/dist/utils/pagination.d.ts +0 -48
- package/dist/utils/pagination.d.ts.map +0 -1
- package/dist/utils/pagination.js +0 -42
- package/dist/utils/pagination.js.map +0 -1
- package/dist/utils/serialize-dates.d.ts +0 -27
- package/dist/utils/serialize-dates.d.ts.map +0 -1
- package/dist/utils/serialize-dates.js +0 -39
- package/dist/utils/serialize-dates.js.map +0 -1
|
@@ -12,7 +12,7 @@ export const requestContextStorage = new AsyncLocalStorage();
|
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
14
|
* ```typescript
|
|
15
|
-
* import { getRequestContext } from 'glasswork';
|
|
15
|
+
* import { getRequestContext } from 'glasswork/observability';
|
|
16
16
|
*
|
|
17
17
|
* function someUtility() {
|
|
18
18
|
* const ctx = getRequestContext();
|
|
@@ -35,7 +35,7 @@ export function getRequestContext() {
|
|
|
35
35
|
*
|
|
36
36
|
* @example
|
|
37
37
|
* ```typescript
|
|
38
|
-
* import { getRequestId } from 'glasswork';
|
|
38
|
+
* import { getRequestId } from 'glasswork/observability';
|
|
39
39
|
*
|
|
40
40
|
* class UserService {
|
|
41
41
|
* async create(data: CreateUserDto) {
|
|
@@ -57,7 +57,7 @@ export function getRequestId() {
|
|
|
57
57
|
*
|
|
58
58
|
* @example
|
|
59
59
|
* ```typescript
|
|
60
|
-
* import { setRequestUser } from 'glasswork';
|
|
60
|
+
* import { setRequestUser } from 'glasswork/observability';
|
|
61
61
|
*
|
|
62
62
|
* // In auth middleware
|
|
63
63
|
* const user = await validateToken(token);
|
|
@@ -79,7 +79,7 @@ export function setRequestUser(userId) {
|
|
|
79
79
|
*
|
|
80
80
|
* @example
|
|
81
81
|
* ```typescript
|
|
82
|
-
* import { setRequestContext } from 'glasswork';
|
|
82
|
+
* import { setRequestContext } from 'glasswork/observability';
|
|
83
83
|
*
|
|
84
84
|
* // Add tenant ID for multi-tenant apps
|
|
85
85
|
* setRequestContext('tenantId', tenant.id);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "glasswork",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "A transparent, Lambda-optimized web framework for building OpenAPI-compliant REST APIs.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -11,12 +11,53 @@
|
|
|
11
11
|
"import": "./dist/index.js",
|
|
12
12
|
"default": "./dist/index.js"
|
|
13
13
|
},
|
|
14
|
+
"./core": {
|
|
15
|
+
"types": "./dist/core/index.d.ts",
|
|
16
|
+
"import": "./dist/core/index.js",
|
|
17
|
+
"default": "./dist/core/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./http": {
|
|
20
|
+
"types": "./dist/http/index.d.ts",
|
|
21
|
+
"import": "./dist/http/index.js",
|
|
22
|
+
"default": "./dist/http/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./auth": {
|
|
25
|
+
"types": "./dist/auth/index.d.ts",
|
|
26
|
+
"import": "./dist/auth/index.js",
|
|
27
|
+
"default": "./dist/auth/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./list-query": {
|
|
30
|
+
"types": "./dist/list-query/index.d.ts",
|
|
31
|
+
"import": "./dist/list-query/index.js",
|
|
32
|
+
"default": "./dist/list-query/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./jobs": {
|
|
35
|
+
"types": "./dist/jobs/index.d.ts",
|
|
36
|
+
"import": "./dist/jobs/index.js",
|
|
37
|
+
"default": "./dist/jobs/index.js"
|
|
38
|
+
},
|
|
39
|
+
"./email": {
|
|
40
|
+
"types": "./dist/email/index.d.ts",
|
|
41
|
+
"import": "./dist/email/index.js",
|
|
42
|
+
"default": "./dist/email/index.js"
|
|
43
|
+
},
|
|
44
|
+
"./uploads": {
|
|
45
|
+
"types": "./dist/uploads/index.d.ts",
|
|
46
|
+
"import": "./dist/uploads/index.js",
|
|
47
|
+
"default": "./dist/uploads/index.js"
|
|
48
|
+
},
|
|
49
|
+
"./observability": {
|
|
50
|
+
"types": "./dist/observability/index.d.ts",
|
|
51
|
+
"import": "./dist/observability/index.js",
|
|
52
|
+
"default": "./dist/observability/index.js"
|
|
53
|
+
},
|
|
14
54
|
"./package.json": "./package.json"
|
|
15
55
|
},
|
|
16
56
|
"files": [
|
|
17
57
|
"dist",
|
|
18
58
|
"README.md",
|
|
19
|
-
"LICENSE"
|
|
59
|
+
"LICENSE",
|
|
60
|
+
"CHANGELOG.md"
|
|
20
61
|
],
|
|
21
62
|
"sideEffects": false,
|
|
22
63
|
"engines": {
|
|
@@ -53,7 +94,10 @@
|
|
|
53
94
|
"lint": "biome check . --write",
|
|
54
95
|
"lint:ci": "biome check .",
|
|
55
96
|
"typecheck": "tsc --noEmit",
|
|
56
|
-
"
|
|
97
|
+
"typecheck:strict": "tsc --noEmit -p tsconfig.strict.json",
|
|
98
|
+
"smoke:pack": "node scripts/smoke-pack-consumer.mjs",
|
|
99
|
+
"verify": "pnpm run typecheck && pnpm run lint:ci && pnpm run build && pnpm run test && pnpm run smoke:pack",
|
|
100
|
+
"prepublishOnly": "npm run verify",
|
|
57
101
|
"docs:dev": "vitepress dev docs",
|
|
58
102
|
"docs:build": "vitepress build docs",
|
|
59
103
|
"docs:preview": "vitepress preview docs"
|
|
@@ -62,25 +106,25 @@
|
|
|
62
106
|
"access": "public"
|
|
63
107
|
},
|
|
64
108
|
"peerDependencies": {
|
|
65
|
-
"@aws-sdk/client-cloudwatch": "^3.
|
|
66
|
-
"@aws-sdk/client-dynamodb": "^3.
|
|
67
|
-
"@aws-sdk/client-s3": "^3.
|
|
68
|
-
"@aws-sdk/client-scheduler": "^3.
|
|
69
|
-
"@aws-sdk/client-sesv2": "^3.
|
|
70
|
-
"@aws-sdk/client-sqs": "^3.
|
|
71
|
-
"@aws-sdk/client-ssm": "^3.
|
|
72
|
-
"@aws-sdk/lib-dynamodb": "^3.
|
|
73
|
-
"@aws-sdk/s3-request-presigner": "^3.
|
|
74
|
-
"@casl/ability": "^
|
|
75
|
-
"@casl/prisma": "^
|
|
76
|
-
"@hono/swagger-ui": "^0.
|
|
77
|
-
"@prisma/client": "^
|
|
78
|
-
"awilix": "^
|
|
79
|
-
"better-auth": "^1.
|
|
80
|
-
"dotenv": "^
|
|
81
|
-
"hono": "^4.
|
|
82
|
-
"hono-openapi": "^1.
|
|
83
|
-
"valibot": "^1.
|
|
109
|
+
"@aws-sdk/client-cloudwatch": "^3.1000.0",
|
|
110
|
+
"@aws-sdk/client-dynamodb": "^3.1000.0",
|
|
111
|
+
"@aws-sdk/client-s3": "^3.1000.0",
|
|
112
|
+
"@aws-sdk/client-scheduler": "^3.1000.0",
|
|
113
|
+
"@aws-sdk/client-sesv2": "^3.1000.0",
|
|
114
|
+
"@aws-sdk/client-sqs": "^3.1000.0",
|
|
115
|
+
"@aws-sdk/client-ssm": "^3.1000.0",
|
|
116
|
+
"@aws-sdk/lib-dynamodb": "^3.1000.0",
|
|
117
|
+
"@aws-sdk/s3-request-presigner": "^3.1000.0",
|
|
118
|
+
"@casl/ability": "^7.0.0",
|
|
119
|
+
"@casl/prisma": "^2.0.0",
|
|
120
|
+
"@hono/swagger-ui": "^0.6.0",
|
|
121
|
+
"@prisma/client": "^7.0.0",
|
|
122
|
+
"awilix": "^13.0.0",
|
|
123
|
+
"better-auth": "^1.6.0",
|
|
124
|
+
"dotenv": "^17.0.0",
|
|
125
|
+
"hono": "^4.12.0",
|
|
126
|
+
"hono-openapi": "^1.3.0",
|
|
127
|
+
"valibot": "^1.4.0"
|
|
84
128
|
},
|
|
85
129
|
"peerDependenciesMeta": {
|
|
86
130
|
"@aws-sdk/client-scheduler": {
|
|
@@ -130,47 +174,43 @@
|
|
|
130
174
|
}
|
|
131
175
|
},
|
|
132
176
|
"devDependencies": {
|
|
133
|
-
"@aws-sdk/client-cloudwatch": "^3.
|
|
134
|
-
"@aws-sdk/client-dynamodb": "^3.
|
|
135
|
-
"@aws-sdk/client-s3": "^3.
|
|
136
|
-
"@aws-sdk/client-scheduler": "^3.
|
|
137
|
-
"@aws-sdk/client-sesv2": "^3.
|
|
138
|
-
"@aws-sdk/client-sqs": "^3.
|
|
139
|
-
"@aws-sdk/client-ssm": "^3.
|
|
140
|
-
"@aws-sdk/lib-dynamodb": "^3.
|
|
141
|
-
"@aws-sdk/s3-request-presigner": "^3.
|
|
142
|
-
"@biomejs/biome": "^2.4.
|
|
143
|
-
"@casl/ability": "^
|
|
144
|
-
"@casl/prisma": "^
|
|
145
|
-
"@hono/swagger-ui": "^0.
|
|
146
|
-
"@prisma/client": "^7.
|
|
147
|
-
"@types/aws-lambda": "^8.10.
|
|
148
|
-
"@types/
|
|
149
|
-
"@
|
|
150
|
-
"@vitest/coverage-v8": "^4.0.18",
|
|
177
|
+
"@aws-sdk/client-cloudwatch": "^3.1065.0",
|
|
178
|
+
"@aws-sdk/client-dynamodb": "^3.1065.0",
|
|
179
|
+
"@aws-sdk/client-s3": "^3.1065.0",
|
|
180
|
+
"@aws-sdk/client-scheduler": "^3.1064.0",
|
|
181
|
+
"@aws-sdk/client-sesv2": "^3.1064.0",
|
|
182
|
+
"@aws-sdk/client-sqs": "^3.1064.0",
|
|
183
|
+
"@aws-sdk/client-ssm": "^3.1064.0",
|
|
184
|
+
"@aws-sdk/lib-dynamodb": "^3.1065.0",
|
|
185
|
+
"@aws-sdk/s3-request-presigner": "^3.1065.0",
|
|
186
|
+
"@biomejs/biome": "^2.4.16",
|
|
187
|
+
"@casl/ability": "^7.0.0",
|
|
188
|
+
"@casl/prisma": "^2.0.1",
|
|
189
|
+
"@hono/swagger-ui": "^0.6.1",
|
|
190
|
+
"@prisma/client": "^7.8.0",
|
|
191
|
+
"@types/aws-lambda": "^8.10.162",
|
|
192
|
+
"@types/node": "^24.13.1",
|
|
193
|
+
"@vitest/coverage-v8": "^4.1.8",
|
|
151
194
|
"awilix": "^13.0.3",
|
|
152
|
-
"dotenv": "^17.
|
|
153
|
-
"hono": "^4.12.
|
|
195
|
+
"dotenv": "^17.4.2",
|
|
196
|
+
"hono": "^4.12.25",
|
|
154
197
|
"hono-openapi": "^1.3.0",
|
|
155
|
-
"
|
|
156
|
-
"
|
|
157
|
-
"mjml": "^4.18.0",
|
|
198
|
+
"mermaid": "^11.15.0",
|
|
199
|
+
"mjml": "^5.3.0",
|
|
158
200
|
"typescript": "^5.9.3",
|
|
159
|
-
"valibot": "^1.
|
|
201
|
+
"valibot": "^1.4.1",
|
|
160
202
|
"vitepress": "^1.6.4",
|
|
161
|
-
"vitepress-plugin-llms": "^1.
|
|
203
|
+
"vitepress-plugin-llms": "^1.13.1",
|
|
162
204
|
"vitepress-plugin-mermaid": "^2.0.17",
|
|
163
|
-
"vitest": "^4.
|
|
164
|
-
"vue": "^3.5.
|
|
205
|
+
"vitest": "^4.1.8",
|
|
206
|
+
"vue": "^3.5.35"
|
|
165
207
|
},
|
|
166
208
|
"dependencies": {
|
|
167
209
|
"@hono/standard-validator": "^0.2.2",
|
|
168
210
|
"@hono/valibot-validator": "^0.6.1",
|
|
169
|
-
"@
|
|
170
|
-
"@standard-community/standard-openapi": "^0.2.9",
|
|
171
|
-
"@valibot/to-json-schema": "^1.5.0",
|
|
211
|
+
"@valibot/to-json-schema": "^1.7.1",
|
|
172
212
|
"deepmerge": "^4.3.1",
|
|
173
|
-
"nanoid": "^5.1.
|
|
213
|
+
"nanoid": "^5.1.11",
|
|
174
214
|
"openapi-types": "^12.1.3"
|
|
175
215
|
}
|
|
176
216
|
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import type { Context, MiddlewareHandler } from 'hono';
|
|
2
|
-
import type { AbilityConfig, BaseAbility } from './types.js';
|
|
3
|
-
/**
|
|
4
|
-
* Creates Hono middleware that attaches a CASL ability to the request context.
|
|
5
|
-
*
|
|
6
|
-
* This middleware is transparent - it exposes the CASL ability directly in the
|
|
7
|
-
* Hono context, making it accessible to route handlers. All CASL features
|
|
8
|
-
* remain available.
|
|
9
|
-
*
|
|
10
|
-
* @param config - Ability configuration with factory function
|
|
11
|
-
* @returns Hono middleware that creates and attaches the ability
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```typescript
|
|
15
|
-
* import { createPrismaAbility } from '@casl/prisma';
|
|
16
|
-
* import { AbilityBuilder } from '@casl/ability';
|
|
17
|
-
*
|
|
18
|
-
* const abilityMiddleware = withAbility({
|
|
19
|
-
* factory: (c) => {
|
|
20
|
-
* const user = c.get('user');
|
|
21
|
-
* const { can, build } = new AbilityBuilder(createPrismaAbility);
|
|
22
|
-
*
|
|
23
|
-
* if (user.role === 'admin') {
|
|
24
|
-
* can('manage', 'all');
|
|
25
|
-
* } else {
|
|
26
|
-
* can('read', 'User', { id: user.id });
|
|
27
|
-
* }
|
|
28
|
-
*
|
|
29
|
-
* return build();
|
|
30
|
-
* }
|
|
31
|
-
* });
|
|
32
|
-
*
|
|
33
|
-
* app.use('*', abilityMiddleware);
|
|
34
|
-
* ```
|
|
35
|
-
*/
|
|
36
|
-
export declare function withAbility<T extends BaseAbility = BaseAbility>(config: AbilityConfig<T>): MiddlewareHandler;
|
|
37
|
-
/**
|
|
38
|
-
* Helper to retrieve the ability from Hono context.
|
|
39
|
-
* This provides type-safe access to the CASL ability stored by `withAbility`.
|
|
40
|
-
*
|
|
41
|
-
* @param context - Hono context
|
|
42
|
-
* @param contextKey - The key used to store the ability (default: 'ability')
|
|
43
|
-
* @returns The CASL ability instance
|
|
44
|
-
* @throws Error if ability is not found in context
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* ```typescript
|
|
48
|
-
* router.get('/users', async (c) => {
|
|
49
|
-
* const ability = getAbility(c);
|
|
50
|
-
*
|
|
51
|
-
* // Use CASL ability directly
|
|
52
|
-
* if (ability.can('read', 'User')) {
|
|
53
|
-
* return c.json(users);
|
|
54
|
-
* }
|
|
55
|
-
*
|
|
56
|
-
* return c.json({ error: 'Forbidden' }, 403);
|
|
57
|
-
* });
|
|
58
|
-
* ```
|
|
59
|
-
*/
|
|
60
|
-
export declare function getAbility<T extends BaseAbility = BaseAbility>(context: Context, contextKey?: string): T;
|
|
61
|
-
//# sourceMappingURL=ability-middleware.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ability-middleware.d.ts","sourceRoot":"","sources":["../../src/authorization/ability-middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,EAC7D,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,GACvB,iBAAiB,CAYnB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,EAC5D,OAAO,EAAE,OAAO,EAChB,UAAU,SAAY,GACrB,CAAC,CAUH"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates Hono middleware that attaches a CASL ability to the request context.
|
|
3
|
-
*
|
|
4
|
-
* This middleware is transparent - it exposes the CASL ability directly in the
|
|
5
|
-
* Hono context, making it accessible to route handlers. All CASL features
|
|
6
|
-
* remain available.
|
|
7
|
-
*
|
|
8
|
-
* @param config - Ability configuration with factory function
|
|
9
|
-
* @returns Hono middleware that creates and attaches the ability
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```typescript
|
|
13
|
-
* import { createPrismaAbility } from '@casl/prisma';
|
|
14
|
-
* import { AbilityBuilder } from '@casl/ability';
|
|
15
|
-
*
|
|
16
|
-
* const abilityMiddleware = withAbility({
|
|
17
|
-
* factory: (c) => {
|
|
18
|
-
* const user = c.get('user');
|
|
19
|
-
* const { can, build } = new AbilityBuilder(createPrismaAbility);
|
|
20
|
-
*
|
|
21
|
-
* if (user.role === 'admin') {
|
|
22
|
-
* can('manage', 'all');
|
|
23
|
-
* } else {
|
|
24
|
-
* can('read', 'User', { id: user.id });
|
|
25
|
-
* }
|
|
26
|
-
*
|
|
27
|
-
* return build();
|
|
28
|
-
* }
|
|
29
|
-
* });
|
|
30
|
-
*
|
|
31
|
-
* app.use('*', abilityMiddleware);
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
34
|
-
export function withAbility(config) {
|
|
35
|
-
const contextKey = config.contextKey || 'ability';
|
|
36
|
-
return async (c, next) => {
|
|
37
|
-
// Create ability using factory
|
|
38
|
-
const ability = await config.factory(c);
|
|
39
|
-
// Store in Hono context
|
|
40
|
-
c.set(contextKey, ability);
|
|
41
|
-
await next();
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Helper to retrieve the ability from Hono context.
|
|
46
|
-
* This provides type-safe access to the CASL ability stored by `withAbility`.
|
|
47
|
-
*
|
|
48
|
-
* @param context - Hono context
|
|
49
|
-
* @param contextKey - The key used to store the ability (default: 'ability')
|
|
50
|
-
* @returns The CASL ability instance
|
|
51
|
-
* @throws Error if ability is not found in context
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* ```typescript
|
|
55
|
-
* router.get('/users', async (c) => {
|
|
56
|
-
* const ability = getAbility(c);
|
|
57
|
-
*
|
|
58
|
-
* // Use CASL ability directly
|
|
59
|
-
* if (ability.can('read', 'User')) {
|
|
60
|
-
* return c.json(users);
|
|
61
|
-
* }
|
|
62
|
-
*
|
|
63
|
-
* return c.json({ error: 'Forbidden' }, 403);
|
|
64
|
-
* });
|
|
65
|
-
* ```
|
|
66
|
-
*/
|
|
67
|
-
export function getAbility(context, contextKey = 'ability') {
|
|
68
|
-
const ability = context.get(contextKey);
|
|
69
|
-
if (!ability) {
|
|
70
|
-
throw new Error(`Ability not found in context. Did you forget to use withAbility() middleware?`);
|
|
71
|
-
}
|
|
72
|
-
return ability;
|
|
73
|
-
}
|
|
74
|
-
//# sourceMappingURL=ability-middleware.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ability-middleware.js","sourceRoot":"","sources":["../../src/authorization/ability-middleware.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,UAAU,WAAW,CACzB,MAAwB;IAExB,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,IAAI,SAAS,CAAC;IAElD,OAAO,KAAK,EAAE,CAAU,EAAE,IAAI,EAAE,EAAE;QAChC,+BAA+B;QAC/B,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAExC,wBAAwB;QACxB,CAAC,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAE3B,MAAM,IAAI,EAAE,CAAC;IACf,CAAC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,UAAU,CACxB,OAAgB,EAChB,UAAU,GAAG,SAAS;IAEtB,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAExC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,+EAA+E,CAChF,CAAC;IACJ,CAAC;IAED,OAAO,OAAY,CAAC;AACtB,CAAC"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Authorization module for integrating CASL with Glasswork.
|
|
3
|
-
*
|
|
4
|
-
* This module provides transparent integration with CASL while maintaining framework principles.
|
|
5
|
-
*
|
|
6
|
-
* ## Recommended Approach: Service Hooks
|
|
7
|
-
*
|
|
8
|
-
* Configure authorization globally using the hooks system:
|
|
9
|
-
*
|
|
10
|
-
* ```typescript
|
|
11
|
-
* import { authorizationHook, defineServiceMetadata, defineAuthorize } from 'glasswork';
|
|
12
|
-
*
|
|
13
|
-
* const authServiceMeta = defineServiceMetadata({
|
|
14
|
-
* deleteSession: { authorize: defineAuthorize('delete', 'Session') }
|
|
15
|
-
* });
|
|
16
|
-
*
|
|
17
|
-
* bootstrap(AppModule, {
|
|
18
|
-
* serviceHooks: [authorizationHook],
|
|
19
|
-
* serviceMetadata: { authService: authServiceMeta }
|
|
20
|
-
* });
|
|
21
|
-
*
|
|
22
|
-
* // In routes - authorization happens automatically!
|
|
23
|
-
* await services.authService.deleteSession(token);
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
* ## Alternative: Explicit Authorization
|
|
27
|
-
*
|
|
28
|
-
* For fine-grained control, use explicit authorize() calls:
|
|
29
|
-
*
|
|
30
|
-
* ```typescript
|
|
31
|
-
* router.delete('/sessions/:id', async (c) => {
|
|
32
|
-
* authorize(c, 'delete', 'Session', { id: c.req.param('id') });
|
|
33
|
-
* await sessionService.delete(c.req.param('id'));
|
|
34
|
-
* });
|
|
35
|
-
* ```
|
|
36
|
-
*
|
|
37
|
-
* @module authorization
|
|
38
|
-
* @see https://casl.js.org/ for CASL documentation
|
|
39
|
-
* @see HOOKS_SYSTEM.md for hooks documentation
|
|
40
|
-
*/
|
|
41
|
-
export type { PureAbility } from '@casl/ability';
|
|
42
|
-
export { ForbiddenError, subject } from '@casl/ability';
|
|
43
|
-
export { getAbility, withAbility } from './ability-middleware.js';
|
|
44
|
-
export { accessibleWhere, authorize, can, cannot } from './route-helpers.js';
|
|
45
|
-
export type { AbilityConfig, AbilityFactory, BaseAbility } from './types.js';
|
|
46
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/authorization/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAGH,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE7E,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Authorization module for integrating CASL with Glasswork.
|
|
3
|
-
*
|
|
4
|
-
* This module provides transparent integration with CASL while maintaining framework principles.
|
|
5
|
-
*
|
|
6
|
-
* ## Recommended Approach: Service Hooks
|
|
7
|
-
*
|
|
8
|
-
* Configure authorization globally using the hooks system:
|
|
9
|
-
*
|
|
10
|
-
* ```typescript
|
|
11
|
-
* import { authorizationHook, defineServiceMetadata, defineAuthorize } from 'glasswork';
|
|
12
|
-
*
|
|
13
|
-
* const authServiceMeta = defineServiceMetadata({
|
|
14
|
-
* deleteSession: { authorize: defineAuthorize('delete', 'Session') }
|
|
15
|
-
* });
|
|
16
|
-
*
|
|
17
|
-
* bootstrap(AppModule, {
|
|
18
|
-
* serviceHooks: [authorizationHook],
|
|
19
|
-
* serviceMetadata: { authService: authServiceMeta }
|
|
20
|
-
* });
|
|
21
|
-
*
|
|
22
|
-
* // In routes - authorization happens automatically!
|
|
23
|
-
* await services.authService.deleteSession(token);
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
* ## Alternative: Explicit Authorization
|
|
27
|
-
*
|
|
28
|
-
* For fine-grained control, use explicit authorize() calls:
|
|
29
|
-
*
|
|
30
|
-
* ```typescript
|
|
31
|
-
* router.delete('/sessions/:id', async (c) => {
|
|
32
|
-
* authorize(c, 'delete', 'Session', { id: c.req.param('id') });
|
|
33
|
-
* await sessionService.delete(c.req.param('id'));
|
|
34
|
-
* });
|
|
35
|
-
* ```
|
|
36
|
-
*
|
|
37
|
-
* @module authorization
|
|
38
|
-
* @see https://casl.js.org/ for CASL documentation
|
|
39
|
-
* @see HOOKS_SYSTEM.md for hooks documentation
|
|
40
|
-
*/
|
|
41
|
-
export { ForbiddenError, subject } from '@casl/ability';
|
|
42
|
-
// Ability middleware (attaches CASL abilities to context)
|
|
43
|
-
export { getAbility, withAbility } from './ability-middleware.js';
|
|
44
|
-
// Route helpers (explicit authorization - recommended for fine-grained control)
|
|
45
|
-
export { accessibleWhere, authorize, can, cannot } from './route-helpers.js';
|
|
46
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/authorization/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAIH,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxD,0DAA0D;AAC1D,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAClE,gFAAgF;AAChF,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import type { Context } from 'hono';
|
|
2
|
-
import type { BaseAbility } from './types.js';
|
|
3
|
-
/**
|
|
4
|
-
* Authorizes an action on a subject using the CASL ability from context.
|
|
5
|
-
* Throws ForbiddenError if the action is not permitted.
|
|
6
|
-
*
|
|
7
|
-
* This is a thin wrapper around CASL's authorize functionality, exposing
|
|
8
|
-
* the native CASL API while providing convenient access to the ability
|
|
9
|
-
* stored in Hono context.
|
|
10
|
-
*
|
|
11
|
-
* @param context - Hono context containing the ability
|
|
12
|
-
* @param action - CASL action (e.g., 'create', 'read', 'update', 'delete')
|
|
13
|
-
* @param subjectType - Subject type string (e.g., 'User', 'Post')
|
|
14
|
-
* @param subjectData - Optional subject instance data
|
|
15
|
-
* @throws ForbiddenError from CASL if action is not permitted
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```typescript
|
|
19
|
-
* router.delete('/sessions/:id', async (c) => {
|
|
20
|
-
* const sessionId = c.req.param('id');
|
|
21
|
-
* const user = c.get('user');
|
|
22
|
-
*
|
|
23
|
-
* // Explicit authorization - clear and obvious
|
|
24
|
-
* authorize(c, 'delete', 'Session', { userId: user.id, sessionId });
|
|
25
|
-
*
|
|
26
|
-
* await sessionService.delete(sessionId);
|
|
27
|
-
* return c.json({ success: true });
|
|
28
|
-
* });
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
export declare function authorize<T extends BaseAbility = BaseAbility>(context: Context, action: string, subjectType: string, subjectData?: object): void;
|
|
32
|
-
/**
|
|
33
|
-
* Checks if an action is permitted without throwing an error.
|
|
34
|
-
* Returns boolean indicating if the action is allowed.
|
|
35
|
-
*
|
|
36
|
-
* @param context - Hono context containing the ability
|
|
37
|
-
* @param action - CASL action
|
|
38
|
-
* @param subjectType - Subject type string
|
|
39
|
-
* @param subjectData - Optional subject instance data
|
|
40
|
-
* @returns True if action is permitted, false otherwise
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* ```typescript
|
|
44
|
-
* router.get('/users', async (c) => {
|
|
45
|
-
* if (!can(c, 'read', 'User')) {
|
|
46
|
-
* return c.json({ error: 'Forbidden' }, 403);
|
|
47
|
-
* }
|
|
48
|
-
*
|
|
49
|
-
* const users = await userService.findAll();
|
|
50
|
-
* return c.json(users);
|
|
51
|
-
* });
|
|
52
|
-
* ```
|
|
53
|
-
*/
|
|
54
|
-
export declare function can<T extends BaseAbility = BaseAbility>(context: Context, action: string, subjectType: string, subjectData?: object): boolean;
|
|
55
|
-
/**
|
|
56
|
-
* Checks if an action is forbidden (opposite of can).
|
|
57
|
-
*
|
|
58
|
-
* @param context - Hono context containing the ability
|
|
59
|
-
* @param action - CASL action
|
|
60
|
-
* @param subjectType - Subject type string
|
|
61
|
-
* @param subjectData - Optional subject instance data
|
|
62
|
-
* @returns True if action is forbidden, false if permitted
|
|
63
|
-
*
|
|
64
|
-
* @example
|
|
65
|
-
* ```typescript
|
|
66
|
-
* router.post('/admin/users', async (c) => {
|
|
67
|
-
* if (cannot(c, 'create', 'User')) {
|
|
68
|
-
* return c.json({ error: 'Forbidden' }, 403);
|
|
69
|
-
* }
|
|
70
|
-
*
|
|
71
|
-
* // ... create user
|
|
72
|
-
* });
|
|
73
|
-
* ```
|
|
74
|
-
*/
|
|
75
|
-
export declare function cannot<T extends BaseAbility = BaseAbility>(context: Context, action: string, subjectType: string, subjectData?: object): boolean;
|
|
76
|
-
/**
|
|
77
|
-
* Creates a Prisma where clause using CASL's accessibleBy helper.
|
|
78
|
-
* This is a transparent wrapper that exposes @casl/prisma functionality.
|
|
79
|
-
*
|
|
80
|
-
* Requires @casl/prisma to be installed as a peer dependency.
|
|
81
|
-
*
|
|
82
|
-
* @param context - Hono context containing the ability
|
|
83
|
-
* @param subjectType - Prisma model name (e.g., 'User', 'Post')
|
|
84
|
-
* @param additionalWhere - Optional additional where conditions to combine
|
|
85
|
-
* @returns Prisma where clause that filters by ability permissions
|
|
86
|
-
*
|
|
87
|
-
* @example
|
|
88
|
-
* ```typescript
|
|
89
|
-
* import { accessibleBy } from '@casl/prisma';
|
|
90
|
-
*
|
|
91
|
-
* router.get('/posts', async (c) => {
|
|
92
|
-
* const ability = getAbility(c);
|
|
93
|
-
*
|
|
94
|
-
* // Use CASL Prisma integration directly
|
|
95
|
-
* const posts = await prisma.post.findMany({
|
|
96
|
-
* where: accessibleBy(ability).Post
|
|
97
|
-
* });
|
|
98
|
-
*
|
|
99
|
-
* return c.json(posts);
|
|
100
|
-
* });
|
|
101
|
-
* ```
|
|
102
|
-
*
|
|
103
|
-
* @see https://casl.js.org/v6/en/package/casl-prisma
|
|
104
|
-
*/
|
|
105
|
-
export declare function accessibleWhere<T extends BaseAbility = BaseAbility>(context: Context, subjectType: string, additionalWhere?: object): object;
|
|
106
|
-
//# sourceMappingURL=route-helpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"route-helpers.d.ts","sourceRoot":"","sources":["../../src/authorization/route-helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,EAC3D,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,WAAW,CAAC,EAAE,MAAM,GACnB,IAAI,CAUN;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,EACrD,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAKT;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,EACxD,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAET;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,EACjE,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,MAAM,EACnB,eAAe,CAAC,EAAE,MAAM,GACvB,MAAM,CAuBR"}
|