@develit-services/rbac 0.1.0 → 0.1.2
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/export/worker.cjs +1 -1
- package/dist/export/worker.d.cts +1 -1
- package/dist/export/worker.d.mts +1 -1
- package/dist/export/worker.d.ts +1 -1
- package/dist/export/worker.mjs +1 -1
- package/dist/shared/{rbac.UWPYxd4e.d.ts → rbac.B1vCgI3K.d.ts} +9 -14
- package/dist/shared/{rbac.CnJxCt2K.cjs → rbac.B2KUW5xp.cjs} +44 -23
- package/dist/shared/{rbac.NtS5ARz0.mjs → rbac.CUCczegz.mjs} +44 -23
- package/dist/shared/{rbac.Du34seOj.d.cts → rbac.KXG-DTdB.d.cts} +9 -14
- package/dist/shared/{rbac.Dtso4lIl.d.mts → rbac.XOKvv3pp.d.mts} +9 -14
- package/dist/types.cjs +1 -1
- package/dist/types.d.cts +1 -1
- package/dist/types.d.mts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.mjs +1 -1
- package/package.json +1 -1
package/dist/export/worker.cjs
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
6
6
|
const database_schema = require('../shared/rbac.Cra1T2nC.cjs');
|
|
7
7
|
const drizzleOrm = require('drizzle-orm');
|
|
8
|
-
const verifyScope = require('../shared/rbac.
|
|
8
|
+
const verifyScope = require('../shared/rbac.B2KUW5xp.cjs');
|
|
9
9
|
const zod = require('zod');
|
|
10
10
|
const cloudflare_workers = require('cloudflare:workers');
|
|
11
11
|
const d1 = require('drizzle-orm/d1');
|
package/dist/export/worker.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
2
2
|
import { IRPCResponse } from '@develit-io/backend-sdk';
|
|
3
|
-
import { L as LabeledScope, t as tables, C as CreateRoleInput, a as CreateRoleOutput, A as AssignRoleToUserInput, b as AssignRoleToUserOutput, c as AssignRolesToUserInput, d as AssignRolesToUserOutput, R as RevokeRoleFromUserInput, e as RevokeRoleFromUserOutput, G as GrantScopeToUserInput, f as GrantScopeToUserOutput, g as GrantScopesToUserInput, h as GrantScopesToUserOutput, i as RevokeScopeFromUserInput, j as RevokeScopeFromUserOutput, k as GrantScopeToRoleInput, l as GrantScopeToRoleOutput, m as RevokeScopeFromRoleInput, n as RevokeScopeFromRoleOutput, o as GetPermissionsOutput, p as GetUserPermissionsInput, q as GetUserPermissionsOutput, V as VerifyAccessInput, r as VerifyAccessOutput, D as DeleteRoleInput, s as DeleteRoleOutput, U as UpdateRoleInput, u as UpdateRoleOutput } from '../shared/rbac.
|
|
3
|
+
import { L as LabeledScope, t as tables, C as CreateRoleInput, a as CreateRoleOutput, A as AssignRoleToUserInput, b as AssignRoleToUserOutput, c as AssignRolesToUserInput, d as AssignRolesToUserOutput, R as RevokeRoleFromUserInput, e as RevokeRoleFromUserOutput, G as GrantScopeToUserInput, f as GrantScopeToUserOutput, g as GrantScopesToUserInput, h as GrantScopesToUserOutput, i as RevokeScopeFromUserInput, j as RevokeScopeFromUserOutput, k as GrantScopeToRoleInput, l as GrantScopeToRoleOutput, m as RevokeScopeFromRoleInput, n as RevokeScopeFromRoleOutput, o as GetPermissionsOutput, p as GetUserPermissionsInput, q as GetUserPermissionsOutput, V as VerifyAccessInput, r as VerifyAccessOutput, D as DeleteRoleInput, s as DeleteRoleOutput, U as UpdateRoleInput, u as UpdateRoleOutput } from '../shared/rbac.KXG-DTdB.cjs';
|
|
4
4
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
5
5
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
6
6
|
import 'zod';
|
package/dist/export/worker.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
2
2
|
import { IRPCResponse } from '@develit-io/backend-sdk';
|
|
3
|
-
import { L as LabeledScope, t as tables, C as CreateRoleInput, a as CreateRoleOutput, A as AssignRoleToUserInput, b as AssignRoleToUserOutput, c as AssignRolesToUserInput, d as AssignRolesToUserOutput, R as RevokeRoleFromUserInput, e as RevokeRoleFromUserOutput, G as GrantScopeToUserInput, f as GrantScopeToUserOutput, g as GrantScopesToUserInput, h as GrantScopesToUserOutput, i as RevokeScopeFromUserInput, j as RevokeScopeFromUserOutput, k as GrantScopeToRoleInput, l as GrantScopeToRoleOutput, m as RevokeScopeFromRoleInput, n as RevokeScopeFromRoleOutput, o as GetPermissionsOutput, p as GetUserPermissionsInput, q as GetUserPermissionsOutput, V as VerifyAccessInput, r as VerifyAccessOutput, D as DeleteRoleInput, s as DeleteRoleOutput, U as UpdateRoleInput, u as UpdateRoleOutput } from '../shared/rbac.
|
|
3
|
+
import { L as LabeledScope, t as tables, C as CreateRoleInput, a as CreateRoleOutput, A as AssignRoleToUserInput, b as AssignRoleToUserOutput, c as AssignRolesToUserInput, d as AssignRolesToUserOutput, R as RevokeRoleFromUserInput, e as RevokeRoleFromUserOutput, G as GrantScopeToUserInput, f as GrantScopeToUserOutput, g as GrantScopesToUserInput, h as GrantScopesToUserOutput, i as RevokeScopeFromUserInput, j as RevokeScopeFromUserOutput, k as GrantScopeToRoleInput, l as GrantScopeToRoleOutput, m as RevokeScopeFromRoleInput, n as RevokeScopeFromRoleOutput, o as GetPermissionsOutput, p as GetUserPermissionsInput, q as GetUserPermissionsOutput, V as VerifyAccessInput, r as VerifyAccessOutput, D as DeleteRoleInput, s as DeleteRoleOutput, U as UpdateRoleInput, u as UpdateRoleOutput } from '../shared/rbac.XOKvv3pp.mjs';
|
|
4
4
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
5
5
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
6
6
|
import 'zod';
|
package/dist/export/worker.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
2
2
|
import { IRPCResponse } from '@develit-io/backend-sdk';
|
|
3
|
-
import { L as LabeledScope, t as tables, C as CreateRoleInput, a as CreateRoleOutput, A as AssignRoleToUserInput, b as AssignRoleToUserOutput, c as AssignRolesToUserInput, d as AssignRolesToUserOutput, R as RevokeRoleFromUserInput, e as RevokeRoleFromUserOutput, G as GrantScopeToUserInput, f as GrantScopeToUserOutput, g as GrantScopesToUserInput, h as GrantScopesToUserOutput, i as RevokeScopeFromUserInput, j as RevokeScopeFromUserOutput, k as GrantScopeToRoleInput, l as GrantScopeToRoleOutput, m as RevokeScopeFromRoleInput, n as RevokeScopeFromRoleOutput, o as GetPermissionsOutput, p as GetUserPermissionsInput, q as GetUserPermissionsOutput, V as VerifyAccessInput, r as VerifyAccessOutput, D as DeleteRoleInput, s as DeleteRoleOutput, U as UpdateRoleInput, u as UpdateRoleOutput } from '../shared/rbac.
|
|
3
|
+
import { L as LabeledScope, t as tables, C as CreateRoleInput, a as CreateRoleOutput, A as AssignRoleToUserInput, b as AssignRoleToUserOutput, c as AssignRolesToUserInput, d as AssignRolesToUserOutput, R as RevokeRoleFromUserInput, e as RevokeRoleFromUserOutput, G as GrantScopeToUserInput, f as GrantScopeToUserOutput, g as GrantScopesToUserInput, h as GrantScopesToUserOutput, i as RevokeScopeFromUserInput, j as RevokeScopeFromUserOutput, k as GrantScopeToRoleInput, l as GrantScopeToRoleOutput, m as RevokeScopeFromRoleInput, n as RevokeScopeFromRoleOutput, o as GetPermissionsOutput, p as GetUserPermissionsInput, q as GetUserPermissionsOutput, V as VerifyAccessInput, r as VerifyAccessOutput, D as DeleteRoleInput, s as DeleteRoleOutput, U as UpdateRoleInput, u as UpdateRoleOutput } from '../shared/rbac.B1vCgI3K.js';
|
|
4
4
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
5
5
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
6
6
|
import 'zod';
|
package/dist/export/worker.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { uuidv4, first, createInternalError, develitWorker, action, service } from '@develit-io/backend-sdk';
|
|
2
2
|
import { s as schema } from '../shared/rbac.D5OV7UPA.mjs';
|
|
3
3
|
import { eq, and, count, inArray } from 'drizzle-orm';
|
|
4
|
-
import { c as createRoleInputSchema, a as assignRoleToUserInputSchema, b as assignRolesToUserInputSchema, r as revokeRoleFromUserInputSchema, f as grantScopeToUserInputSchema, h as grantScopesToUserInputSchema, j as revokeScopeFromUserInputSchema, e as grantScopeToRoleInputSchema, i as revokeScopeFromRoleInputSchema, g as getUserPermissionsInputSchema, v as verifyAccessInputSchema, d as deleteRoleInputSchema, u as updateRoleInputSchema } from '../shared/rbac.
|
|
4
|
+
import { c as createRoleInputSchema, a as assignRoleToUserInputSchema, b as assignRolesToUserInputSchema, r as revokeRoleFromUserInputSchema, f as grantScopeToUserInputSchema, h as grantScopesToUserInputSchema, j as revokeScopeFromUserInputSchema, e as grantScopeToRoleInputSchema, i as revokeScopeFromRoleInputSchema, g as getUserPermissionsInputSchema, v as verifyAccessInputSchema, d as deleteRoleInputSchema, u as updateRoleInputSchema } from '../shared/rbac.CUCczegz.mjs';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
7
7
|
import { drizzle } from 'drizzle-orm/d1';
|
|
@@ -197,32 +197,27 @@ declare const verifyAccessInputSchema: z.ZodObject<{
|
|
|
197
197
|
email: z.ZodOptional<z.ZodString>;
|
|
198
198
|
role: z.ZodOptional<z.ZodString>;
|
|
199
199
|
}, z.core.$strip>>;
|
|
200
|
-
createdAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
201
|
-
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
202
|
-
deletedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
203
|
-
lastSignInAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
204
|
-
emailConfirmedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
205
|
-
confirmationSentAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
206
|
-
recoverySentAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
207
|
-
emailChangeSentAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
208
200
|
user: z.ZodObject<{
|
|
209
201
|
id: z.ZodUUID;
|
|
210
|
-
|
|
202
|
+
createdBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
203
|
+
updatedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
204
|
+
deletedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
211
205
|
role: z.ZodString;
|
|
212
206
|
email: z.ZodEmail;
|
|
213
207
|
rawAppMetaData: z.ZodAny;
|
|
214
208
|
rawUserMetaData: z.ZodAny;
|
|
215
209
|
isSuperAdmin: z.ZodDefault<z.ZodBoolean>;
|
|
216
210
|
isSsoUser: z.ZodDefault<z.ZodBoolean>;
|
|
217
|
-
confirmationSentAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
218
|
-
recoverySentAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
219
211
|
emailChangeToken: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
220
|
-
emailChangeSentAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
221
212
|
isBanned: z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodBoolean>>>;
|
|
222
|
-
createdAt: z.
|
|
223
|
-
updatedAt: z.
|
|
213
|
+
createdAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
214
|
+
updatedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
215
|
+
deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
224
216
|
lastSignInAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
225
217
|
emailConfirmedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
218
|
+
confirmationSentAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
219
|
+
recoverySentAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
220
|
+
emailChangeSentAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
226
221
|
}, z.core.$strip>;
|
|
227
222
|
}, z.core.$strip>>;
|
|
228
223
|
}, z.core.$strip>;
|
|
@@ -73,13 +73,38 @@ const userDataSchema = zod.z.object({
|
|
|
73
73
|
email: zod.z.string().optional(),
|
|
74
74
|
role: zod.z.string().optional()
|
|
75
75
|
});
|
|
76
|
+
const jwtUserSchema = zod.z.object({
|
|
77
|
+
id: zod.z.uuid(),
|
|
78
|
+
createdAt: zod.z.date().nullable(),
|
|
79
|
+
createdBy: zod.z.string().nullable().optional(),
|
|
80
|
+
updatedAt: zod.z.date().nullable(),
|
|
81
|
+
updatedBy: zod.z.string().nullable().optional(),
|
|
82
|
+
deletedAt: zod.z.date().nullable(),
|
|
83
|
+
deletedBy: zod.z.string().nullable().optional(),
|
|
84
|
+
role: zod.z.string(),
|
|
85
|
+
email: zod.z.email(),
|
|
86
|
+
rawAppMetaData: zod.z.any(),
|
|
87
|
+
rawUserMetaData: zod.z.any(),
|
|
88
|
+
isSuperAdmin: zod.z.boolean().default(false),
|
|
89
|
+
isSsoUser: zod.z.boolean().default(false),
|
|
90
|
+
lastSignInAt: zod.z.date().nullable().optional(),
|
|
91
|
+
emailConfirmedAt: zod.z.date().nullable().optional(),
|
|
92
|
+
confirmationSentAt: zod.z.date().nullable().optional(),
|
|
93
|
+
recoverySentAt: zod.z.date().nullable().optional(),
|
|
94
|
+
emailChangeToken: zod.z.string().nullable().optional(),
|
|
95
|
+
emailChangeSentAt: zod.z.date().nullable().optional(),
|
|
96
|
+
isBanned: zod.z.boolean().default(false).nullable().optional()
|
|
97
|
+
});
|
|
76
98
|
const jwtPayloadSchema = zod.z.object({
|
|
77
99
|
sub: zod.z.string(),
|
|
78
100
|
user: zod.z.object({
|
|
79
101
|
id: zod.z.uuid(),
|
|
80
102
|
createdAt: zod.z.date().nullable(),
|
|
103
|
+
createdBy: zod.z.string().nullable().optional(),
|
|
81
104
|
updatedAt: zod.z.date().nullable(),
|
|
105
|
+
updatedBy: zod.z.string().nullable().optional(),
|
|
82
106
|
deletedAt: zod.z.date().nullable(),
|
|
107
|
+
deletedBy: zod.z.string().nullable().optional(),
|
|
83
108
|
role: zod.z.string(),
|
|
84
109
|
email: zod.z.email(),
|
|
85
110
|
rawAppMetaData: zod.z.any(),
|
|
@@ -99,33 +124,29 @@ const jwtPayloadSchema = zod.z.object({
|
|
|
99
124
|
userData: userDataSchema.optional()
|
|
100
125
|
});
|
|
101
126
|
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
127
|
+
const coercedUserSchema = jwtUserSchema.extend({
|
|
128
|
+
createdAt: zod.z.coerce.date().nullable(),
|
|
129
|
+
updatedAt: zod.z.coerce.date().nullable(),
|
|
130
|
+
deletedAt: zod.z.coerce.date().nullable(),
|
|
131
|
+
lastSignInAt: zod.z.coerce.date().nullable().optional(),
|
|
132
|
+
emailConfirmedAt: zod.z.coerce.date().nullable().optional(),
|
|
133
|
+
confirmationSentAt: zod.z.coerce.date().nullable().optional(),
|
|
134
|
+
recoverySentAt: zod.z.coerce.date().nullable().optional(),
|
|
135
|
+
emailChangeSentAt: zod.z.coerce.date().nullable().optional()
|
|
136
|
+
});
|
|
137
|
+
const coercedJwtPayloadSchema = jwtPayloadSchema.extend({
|
|
138
|
+
user: coercedUserSchema
|
|
109
139
|
});
|
|
110
140
|
const verifyAccessInputSchema = zod.z.object({
|
|
111
141
|
userId: zod.z.uuid(),
|
|
112
|
-
accessRequests: zod.z.array(
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
lastSignInAt: zod.z.coerce.date().nullable().optional(),
|
|
118
|
-
emailConfirmedAt: zod.z.coerce.date().nullable().optional(),
|
|
119
|
-
confirmationSentAt: zod.z.coerce.date().nullable().optional(),
|
|
120
|
-
recoverySentAt: zod.z.coerce.date().nullable().optional(),
|
|
121
|
-
emailChangeSentAt: zod.z.coerce.date().nullable().optional(),
|
|
122
|
-
user: jwtPayloadSchema.shape.user.extend({
|
|
123
|
-
createdAt: zod.z.coerce.date().nullable().optional(),
|
|
124
|
-
updatedAt: zod.z.coerce.date().nullable().optional(),
|
|
125
|
-
lastSignInAt: zod.z.coerce.date().nullable().optional(),
|
|
126
|
-
emailConfirmedAt: zod.z.coerce.date().nullable().optional()
|
|
142
|
+
accessRequests: zod.z.array(
|
|
143
|
+
zod.z.object({
|
|
144
|
+
scope: zod.z.string(),
|
|
145
|
+
resourceId: zod.z.string().optional(),
|
|
146
|
+
resourcePath: zod.z.string().optional()
|
|
127
147
|
})
|
|
128
|
-
|
|
148
|
+
),
|
|
149
|
+
jwt: coercedJwtPayloadSchema.optional()
|
|
129
150
|
});
|
|
130
151
|
|
|
131
152
|
const verifyScopeInputSchema = zod.z.object({
|
|
@@ -71,13 +71,38 @@ const userDataSchema = z.object({
|
|
|
71
71
|
email: z.string().optional(),
|
|
72
72
|
role: z.string().optional()
|
|
73
73
|
});
|
|
74
|
+
const jwtUserSchema = z.object({
|
|
75
|
+
id: z.uuid(),
|
|
76
|
+
createdAt: z.date().nullable(),
|
|
77
|
+
createdBy: z.string().nullable().optional(),
|
|
78
|
+
updatedAt: z.date().nullable(),
|
|
79
|
+
updatedBy: z.string().nullable().optional(),
|
|
80
|
+
deletedAt: z.date().nullable(),
|
|
81
|
+
deletedBy: z.string().nullable().optional(),
|
|
82
|
+
role: z.string(),
|
|
83
|
+
email: z.email(),
|
|
84
|
+
rawAppMetaData: z.any(),
|
|
85
|
+
rawUserMetaData: z.any(),
|
|
86
|
+
isSuperAdmin: z.boolean().default(false),
|
|
87
|
+
isSsoUser: z.boolean().default(false),
|
|
88
|
+
lastSignInAt: z.date().nullable().optional(),
|
|
89
|
+
emailConfirmedAt: z.date().nullable().optional(),
|
|
90
|
+
confirmationSentAt: z.date().nullable().optional(),
|
|
91
|
+
recoverySentAt: z.date().nullable().optional(),
|
|
92
|
+
emailChangeToken: z.string().nullable().optional(),
|
|
93
|
+
emailChangeSentAt: z.date().nullable().optional(),
|
|
94
|
+
isBanned: z.boolean().default(false).nullable().optional()
|
|
95
|
+
});
|
|
74
96
|
const jwtPayloadSchema = z.object({
|
|
75
97
|
sub: z.string(),
|
|
76
98
|
user: z.object({
|
|
77
99
|
id: z.uuid(),
|
|
78
100
|
createdAt: z.date().nullable(),
|
|
101
|
+
createdBy: z.string().nullable().optional(),
|
|
79
102
|
updatedAt: z.date().nullable(),
|
|
103
|
+
updatedBy: z.string().nullable().optional(),
|
|
80
104
|
deletedAt: z.date().nullable(),
|
|
105
|
+
deletedBy: z.string().nullable().optional(),
|
|
81
106
|
role: z.string(),
|
|
82
107
|
email: z.email(),
|
|
83
108
|
rawAppMetaData: z.any(),
|
|
@@ -97,33 +122,29 @@ const jwtPayloadSchema = z.object({
|
|
|
97
122
|
userData: userDataSchema.optional()
|
|
98
123
|
});
|
|
99
124
|
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
125
|
+
const coercedUserSchema = jwtUserSchema.extend({
|
|
126
|
+
createdAt: z.coerce.date().nullable(),
|
|
127
|
+
updatedAt: z.coerce.date().nullable(),
|
|
128
|
+
deletedAt: z.coerce.date().nullable(),
|
|
129
|
+
lastSignInAt: z.coerce.date().nullable().optional(),
|
|
130
|
+
emailConfirmedAt: z.coerce.date().nullable().optional(),
|
|
131
|
+
confirmationSentAt: z.coerce.date().nullable().optional(),
|
|
132
|
+
recoverySentAt: z.coerce.date().nullable().optional(),
|
|
133
|
+
emailChangeSentAt: z.coerce.date().nullable().optional()
|
|
134
|
+
});
|
|
135
|
+
const coercedJwtPayloadSchema = jwtPayloadSchema.extend({
|
|
136
|
+
user: coercedUserSchema
|
|
107
137
|
});
|
|
108
138
|
const verifyAccessInputSchema = z.object({
|
|
109
139
|
userId: z.uuid(),
|
|
110
|
-
accessRequests: z.array(
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
lastSignInAt: z.coerce.date().nullable().optional(),
|
|
116
|
-
emailConfirmedAt: z.coerce.date().nullable().optional(),
|
|
117
|
-
confirmationSentAt: z.coerce.date().nullable().optional(),
|
|
118
|
-
recoverySentAt: z.coerce.date().nullable().optional(),
|
|
119
|
-
emailChangeSentAt: z.coerce.date().nullable().optional(),
|
|
120
|
-
user: jwtPayloadSchema.shape.user.extend({
|
|
121
|
-
createdAt: z.coerce.date().nullable().optional(),
|
|
122
|
-
updatedAt: z.coerce.date().nullable().optional(),
|
|
123
|
-
lastSignInAt: z.coerce.date().nullable().optional(),
|
|
124
|
-
emailConfirmedAt: z.coerce.date().nullable().optional()
|
|
140
|
+
accessRequests: z.array(
|
|
141
|
+
z.object({
|
|
142
|
+
scope: z.string(),
|
|
143
|
+
resourceId: z.string().optional(),
|
|
144
|
+
resourcePath: z.string().optional()
|
|
125
145
|
})
|
|
126
|
-
|
|
146
|
+
),
|
|
147
|
+
jwt: coercedJwtPayloadSchema.optional()
|
|
127
148
|
});
|
|
128
149
|
|
|
129
150
|
const verifyScopeInputSchema = z.object({
|
|
@@ -197,32 +197,27 @@ declare const verifyAccessInputSchema: z.ZodObject<{
|
|
|
197
197
|
email: z.ZodOptional<z.ZodString>;
|
|
198
198
|
role: z.ZodOptional<z.ZodString>;
|
|
199
199
|
}, z.core.$strip>>;
|
|
200
|
-
createdAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
201
|
-
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
202
|
-
deletedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
203
|
-
lastSignInAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
204
|
-
emailConfirmedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
205
|
-
confirmationSentAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
206
|
-
recoverySentAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
207
|
-
emailChangeSentAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
208
200
|
user: z.ZodObject<{
|
|
209
201
|
id: z.ZodUUID;
|
|
210
|
-
|
|
202
|
+
createdBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
203
|
+
updatedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
204
|
+
deletedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
211
205
|
role: z.ZodString;
|
|
212
206
|
email: z.ZodEmail;
|
|
213
207
|
rawAppMetaData: z.ZodAny;
|
|
214
208
|
rawUserMetaData: z.ZodAny;
|
|
215
209
|
isSuperAdmin: z.ZodDefault<z.ZodBoolean>;
|
|
216
210
|
isSsoUser: z.ZodDefault<z.ZodBoolean>;
|
|
217
|
-
confirmationSentAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
218
|
-
recoverySentAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
219
211
|
emailChangeToken: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
220
|
-
emailChangeSentAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
221
212
|
isBanned: z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodBoolean>>>;
|
|
222
|
-
createdAt: z.
|
|
223
|
-
updatedAt: z.
|
|
213
|
+
createdAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
214
|
+
updatedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
215
|
+
deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
224
216
|
lastSignInAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
225
217
|
emailConfirmedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
218
|
+
confirmationSentAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
219
|
+
recoverySentAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
220
|
+
emailChangeSentAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
226
221
|
}, z.core.$strip>;
|
|
227
222
|
}, z.core.$strip>>;
|
|
228
223
|
}, z.core.$strip>;
|
|
@@ -197,32 +197,27 @@ declare const verifyAccessInputSchema: z.ZodObject<{
|
|
|
197
197
|
email: z.ZodOptional<z.ZodString>;
|
|
198
198
|
role: z.ZodOptional<z.ZodString>;
|
|
199
199
|
}, z.core.$strip>>;
|
|
200
|
-
createdAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
201
|
-
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
202
|
-
deletedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
203
|
-
lastSignInAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
204
|
-
emailConfirmedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
205
|
-
confirmationSentAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
206
|
-
recoverySentAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
207
|
-
emailChangeSentAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
208
200
|
user: z.ZodObject<{
|
|
209
201
|
id: z.ZodUUID;
|
|
210
|
-
|
|
202
|
+
createdBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
203
|
+
updatedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
204
|
+
deletedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
211
205
|
role: z.ZodString;
|
|
212
206
|
email: z.ZodEmail;
|
|
213
207
|
rawAppMetaData: z.ZodAny;
|
|
214
208
|
rawUserMetaData: z.ZodAny;
|
|
215
209
|
isSuperAdmin: z.ZodDefault<z.ZodBoolean>;
|
|
216
210
|
isSsoUser: z.ZodDefault<z.ZodBoolean>;
|
|
217
|
-
confirmationSentAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
218
|
-
recoverySentAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
219
211
|
emailChangeToken: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
220
|
-
emailChangeSentAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
221
212
|
isBanned: z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodBoolean>>>;
|
|
222
|
-
createdAt: z.
|
|
223
|
-
updatedAt: z.
|
|
213
|
+
createdAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
214
|
+
updatedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
215
|
+
deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
224
216
|
lastSignInAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
225
217
|
emailConfirmedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
218
|
+
confirmationSentAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
219
|
+
recoverySentAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
220
|
+
emailChangeSentAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
226
221
|
}, z.core.$strip>;
|
|
227
222
|
}, z.core.$strip>>;
|
|
228
223
|
}, z.core.$strip>;
|
package/dist/types.cjs
CHANGED
package/dist/types.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AssignRoleToUserInput, b as AssignRoleToUserOutput, c as AssignRolesToUserInput, d as AssignRolesToUserOutput, C as CreateRoleInput, a as CreateRoleOutput, D as DeleteRoleInput, s as DeleteRoleOutput, o as GetPermissionsOutput, p as GetUserPermissionsInput, q as GetUserPermissionsOutput, k as GrantScopeToRoleInput, l as GrantScopeToRoleOutput, G as GrantScopeToUserInput, f as GrantScopeToUserOutput, g as GrantScopesToUserInput, h as GrantScopesToUserOutput, L as LabeledScope, R as RevokeRoleFromUserInput, e as RevokeRoleFromUserOutput, m as RevokeScopeFromRoleInput, n as RevokeScopeFromRoleOutput, i as RevokeScopeFromUserInput, j as RevokeScopeFromUserOutput, y as RoleInsertType, w as RoleScopeInsertType, v as RoleScopeSelectType, x as RoleSelectType, S as Scope, U as UpdateRoleInput, u as UpdateRoleOutput, B as UserRoleInsertType, z as UserRoleSelectType, F as UserScopeInsertType, E as UserScopeSelectType, V as VerifyAccessInput, r as VerifyAccessOutput, H as assignRoleToUserInputSchema, I as assignRolesToUserInputSchema, J as createRoleInputSchema, K as deleteRoleInputSchema, M as getUserPermissionsInputSchema, N as grantScopeToRoleInputSchema, O as grantScopeToUserInputSchema, P as grantScopesToUserInputSchema, Q as revokeRoleFromUserInputSchema, T as revokeScopeFromRoleInputSchema, W as revokeScopeFromUserInputSchema, X as updateRoleInputSchema, Y as verifyAccessInputSchema } from './shared/rbac.
|
|
1
|
+
export { A as AssignRoleToUserInput, b as AssignRoleToUserOutput, c as AssignRolesToUserInput, d as AssignRolesToUserOutput, C as CreateRoleInput, a as CreateRoleOutput, D as DeleteRoleInput, s as DeleteRoleOutput, o as GetPermissionsOutput, p as GetUserPermissionsInput, q as GetUserPermissionsOutput, k as GrantScopeToRoleInput, l as GrantScopeToRoleOutput, G as GrantScopeToUserInput, f as GrantScopeToUserOutput, g as GrantScopesToUserInput, h as GrantScopesToUserOutput, L as LabeledScope, R as RevokeRoleFromUserInput, e as RevokeRoleFromUserOutput, m as RevokeScopeFromRoleInput, n as RevokeScopeFromRoleOutput, i as RevokeScopeFromUserInput, j as RevokeScopeFromUserOutput, y as RoleInsertType, w as RoleScopeInsertType, v as RoleScopeSelectType, x as RoleSelectType, S as Scope, U as UpdateRoleInput, u as UpdateRoleOutput, B as UserRoleInsertType, z as UserRoleSelectType, F as UserScopeInsertType, E as UserScopeSelectType, V as VerifyAccessInput, r as VerifyAccessOutput, H as assignRoleToUserInputSchema, I as assignRolesToUserInputSchema, J as createRoleInputSchema, K as deleteRoleInputSchema, M as getUserPermissionsInputSchema, N as grantScopeToRoleInputSchema, O as grantScopeToUserInputSchema, P as grantScopesToUserInputSchema, Q as revokeRoleFromUserInputSchema, T as revokeScopeFromRoleInputSchema, W as revokeScopeFromUserInputSchema, X as updateRoleInputSchema, Y as verifyAccessInputSchema } from './shared/rbac.KXG-DTdB.cjs';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
export { b as RbacServiceEnv, a as RbacServiceEnvironmentConfig, R as RbacServiceWranglerConfig } from './shared/rbac.ClMKyW8J.cjs';
|
|
4
4
|
import 'drizzle-orm';
|
package/dist/types.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AssignRoleToUserInput, b as AssignRoleToUserOutput, c as AssignRolesToUserInput, d as AssignRolesToUserOutput, C as CreateRoleInput, a as CreateRoleOutput, D as DeleteRoleInput, s as DeleteRoleOutput, o as GetPermissionsOutput, p as GetUserPermissionsInput, q as GetUserPermissionsOutput, k as GrantScopeToRoleInput, l as GrantScopeToRoleOutput, G as GrantScopeToUserInput, f as GrantScopeToUserOutput, g as GrantScopesToUserInput, h as GrantScopesToUserOutput, L as LabeledScope, R as RevokeRoleFromUserInput, e as RevokeRoleFromUserOutput, m as RevokeScopeFromRoleInput, n as RevokeScopeFromRoleOutput, i as RevokeScopeFromUserInput, j as RevokeScopeFromUserOutput, y as RoleInsertType, w as RoleScopeInsertType, v as RoleScopeSelectType, x as RoleSelectType, S as Scope, U as UpdateRoleInput, u as UpdateRoleOutput, B as UserRoleInsertType, z as UserRoleSelectType, F as UserScopeInsertType, E as UserScopeSelectType, V as VerifyAccessInput, r as VerifyAccessOutput, H as assignRoleToUserInputSchema, I as assignRolesToUserInputSchema, J as createRoleInputSchema, K as deleteRoleInputSchema, M as getUserPermissionsInputSchema, N as grantScopeToRoleInputSchema, O as grantScopeToUserInputSchema, P as grantScopesToUserInputSchema, Q as revokeRoleFromUserInputSchema, T as revokeScopeFromRoleInputSchema, W as revokeScopeFromUserInputSchema, X as updateRoleInputSchema, Y as verifyAccessInputSchema } from './shared/rbac.
|
|
1
|
+
export { A as AssignRoleToUserInput, b as AssignRoleToUserOutput, c as AssignRolesToUserInput, d as AssignRolesToUserOutput, C as CreateRoleInput, a as CreateRoleOutput, D as DeleteRoleInput, s as DeleteRoleOutput, o as GetPermissionsOutput, p as GetUserPermissionsInput, q as GetUserPermissionsOutput, k as GrantScopeToRoleInput, l as GrantScopeToRoleOutput, G as GrantScopeToUserInput, f as GrantScopeToUserOutput, g as GrantScopesToUserInput, h as GrantScopesToUserOutput, L as LabeledScope, R as RevokeRoleFromUserInput, e as RevokeRoleFromUserOutput, m as RevokeScopeFromRoleInput, n as RevokeScopeFromRoleOutput, i as RevokeScopeFromUserInput, j as RevokeScopeFromUserOutput, y as RoleInsertType, w as RoleScopeInsertType, v as RoleScopeSelectType, x as RoleSelectType, S as Scope, U as UpdateRoleInput, u as UpdateRoleOutput, B as UserRoleInsertType, z as UserRoleSelectType, F as UserScopeInsertType, E as UserScopeSelectType, V as VerifyAccessInput, r as VerifyAccessOutput, H as assignRoleToUserInputSchema, I as assignRolesToUserInputSchema, J as createRoleInputSchema, K as deleteRoleInputSchema, M as getUserPermissionsInputSchema, N as grantScopeToRoleInputSchema, O as grantScopeToUserInputSchema, P as grantScopesToUserInputSchema, Q as revokeRoleFromUserInputSchema, T as revokeScopeFromRoleInputSchema, W as revokeScopeFromUserInputSchema, X as updateRoleInputSchema, Y as verifyAccessInputSchema } from './shared/rbac.XOKvv3pp.mjs';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
export { b as RbacServiceEnv, a as RbacServiceEnvironmentConfig, R as RbacServiceWranglerConfig } from './shared/rbac.ClMKyW8J.mjs';
|
|
4
4
|
import 'drizzle-orm';
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AssignRoleToUserInput, b as AssignRoleToUserOutput, c as AssignRolesToUserInput, d as AssignRolesToUserOutput, C as CreateRoleInput, a as CreateRoleOutput, D as DeleteRoleInput, s as DeleteRoleOutput, o as GetPermissionsOutput, p as GetUserPermissionsInput, q as GetUserPermissionsOutput, k as GrantScopeToRoleInput, l as GrantScopeToRoleOutput, G as GrantScopeToUserInput, f as GrantScopeToUserOutput, g as GrantScopesToUserInput, h as GrantScopesToUserOutput, L as LabeledScope, R as RevokeRoleFromUserInput, e as RevokeRoleFromUserOutput, m as RevokeScopeFromRoleInput, n as RevokeScopeFromRoleOutput, i as RevokeScopeFromUserInput, j as RevokeScopeFromUserOutput, y as RoleInsertType, w as RoleScopeInsertType, v as RoleScopeSelectType, x as RoleSelectType, S as Scope, U as UpdateRoleInput, u as UpdateRoleOutput, B as UserRoleInsertType, z as UserRoleSelectType, F as UserScopeInsertType, E as UserScopeSelectType, V as VerifyAccessInput, r as VerifyAccessOutput, H as assignRoleToUserInputSchema, I as assignRolesToUserInputSchema, J as createRoleInputSchema, K as deleteRoleInputSchema, M as getUserPermissionsInputSchema, N as grantScopeToRoleInputSchema, O as grantScopeToUserInputSchema, P as grantScopesToUserInputSchema, Q as revokeRoleFromUserInputSchema, T as revokeScopeFromRoleInputSchema, W as revokeScopeFromUserInputSchema, X as updateRoleInputSchema, Y as verifyAccessInputSchema } from './shared/rbac.
|
|
1
|
+
export { A as AssignRoleToUserInput, b as AssignRoleToUserOutput, c as AssignRolesToUserInput, d as AssignRolesToUserOutput, C as CreateRoleInput, a as CreateRoleOutput, D as DeleteRoleInput, s as DeleteRoleOutput, o as GetPermissionsOutput, p as GetUserPermissionsInput, q as GetUserPermissionsOutput, k as GrantScopeToRoleInput, l as GrantScopeToRoleOutput, G as GrantScopeToUserInput, f as GrantScopeToUserOutput, g as GrantScopesToUserInput, h as GrantScopesToUserOutput, L as LabeledScope, R as RevokeRoleFromUserInput, e as RevokeRoleFromUserOutput, m as RevokeScopeFromRoleInput, n as RevokeScopeFromRoleOutput, i as RevokeScopeFromUserInput, j as RevokeScopeFromUserOutput, y as RoleInsertType, w as RoleScopeInsertType, v as RoleScopeSelectType, x as RoleSelectType, S as Scope, U as UpdateRoleInput, u as UpdateRoleOutput, B as UserRoleInsertType, z as UserRoleSelectType, F as UserScopeInsertType, E as UserScopeSelectType, V as VerifyAccessInput, r as VerifyAccessOutput, H as assignRoleToUserInputSchema, I as assignRolesToUserInputSchema, J as createRoleInputSchema, K as deleteRoleInputSchema, M as getUserPermissionsInputSchema, N as grantScopeToRoleInputSchema, O as grantScopeToUserInputSchema, P as grantScopesToUserInputSchema, Q as revokeRoleFromUserInputSchema, T as revokeScopeFromRoleInputSchema, W as revokeScopeFromUserInputSchema, X as updateRoleInputSchema, Y as verifyAccessInputSchema } from './shared/rbac.B1vCgI3K.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
export { b as RbacServiceEnv, a as RbacServiceEnvironmentConfig, R as RbacServiceWranglerConfig } from './shared/rbac.ClMKyW8J.js';
|
|
4
4
|
import 'drizzle-orm';
|
package/dist/types.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { a as assignRoleToUserInputSchema, b as assignRolesToUserInputSchema, c as createRoleInputSchema, d as deleteRoleInputSchema, g as getUserPermissionsInputSchema, e as grantScopeToRoleInputSchema, f as grantScopeToUserInputSchema, h as grantScopesToUserInputSchema, r as revokeRoleFromUserInputSchema, i as revokeScopeFromRoleInputSchema, j as revokeScopeFromUserInputSchema, u as updateRoleInputSchema, v as verifyAccessInputSchema, k as verifyScopeInputSchema, l as verifyScopeOutputSchema } from './shared/rbac.
|
|
1
|
+
export { a as assignRoleToUserInputSchema, b as assignRolesToUserInputSchema, c as createRoleInputSchema, d as deleteRoleInputSchema, g as getUserPermissionsInputSchema, e as grantScopeToRoleInputSchema, f as grantScopeToUserInputSchema, h as grantScopesToUserInputSchema, r as revokeRoleFromUserInputSchema, i as revokeScopeFromRoleInputSchema, j as revokeScopeFromUserInputSchema, u as updateRoleInputSchema, v as verifyAccessInputSchema, k as verifyScopeInputSchema, l as verifyScopeOutputSchema } from './shared/rbac.CUCczegz.mjs';
|
|
2
2
|
import 'zod';
|