@contractspec/lib.identity-rbac 3.7.16 → 3.7.18
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/browser/contracts/index.js +1 -1045
- package/dist/browser/contracts/organization.js +1 -655
- package/dist/browser/contracts/rbac.js +1 -599
- package/dist/browser/contracts/user.js +1 -235
- package/dist/browser/entities/index.js +1 -464
- package/dist/browser/entities/organization.js +1 -150
- package/dist/browser/entities/rbac.js +1 -124
- package/dist/browser/entities/user.js +1 -168
- package/dist/browser/events.js +1 -374
- package/dist/browser/identity-rbac.capability.js +1 -31
- package/dist/browser/identity-rbac.feature.js +1 -67
- package/dist/browser/index.js +1 -2099
- package/dist/browser/policies/engine.js +1 -154
- package/dist/browser/policies/index.js +1 -154
- package/dist/contracts/index.js +1 -1045
- package/dist/contracts/organization.js +1 -655
- package/dist/contracts/rbac.js +1 -599
- package/dist/contracts/user.js +1 -235
- package/dist/entities/index.js +1 -464
- package/dist/entities/organization.js +1 -150
- package/dist/entities/rbac.js +1 -124
- package/dist/entities/user.js +1 -168
- package/dist/events.js +1 -374
- package/dist/identity-rbac.capability.js +1 -31
- package/dist/identity-rbac.feature.js +1 -67
- package/dist/index.js +1 -2099
- package/dist/node/contracts/index.js +1 -1045
- package/dist/node/contracts/organization.js +1 -655
- package/dist/node/contracts/rbac.js +1 -599
- package/dist/node/contracts/user.js +1 -235
- package/dist/node/entities/index.js +1 -464
- package/dist/node/entities/organization.js +1 -150
- package/dist/node/entities/rbac.js +1 -124
- package/dist/node/entities/user.js +1 -168
- package/dist/node/events.js +1 -374
- package/dist/node/identity-rbac.capability.js +1 -31
- package/dist/node/identity-rbac.feature.js +1 -67
- package/dist/node/index.js +1 -2099
- package/dist/node/policies/engine.js +1 -154
- package/dist/node/policies/index.js +1 -154
- package/dist/policies/engine.js +1 -154
- package/dist/policies/index.js +1 -154
- package/package.json +7 -7
package/dist/entities/rbac.js
CHANGED
|
@@ -1,125 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import { defineEntity, field, index } from "@contractspec/lib.schema";
|
|
4
|
-
var RoleEntity = defineEntity({
|
|
5
|
-
name: "Role",
|
|
6
|
-
description: "A role defines a named set of permissions.",
|
|
7
|
-
schema: "lssm_sigil",
|
|
8
|
-
map: "role",
|
|
9
|
-
fields: {
|
|
10
|
-
id: field.id(),
|
|
11
|
-
name: field.string({ isUnique: true, description: "Unique role name" }),
|
|
12
|
-
description: field.string({
|
|
13
|
-
isOptional: true,
|
|
14
|
-
description: "Role description"
|
|
15
|
-
}),
|
|
16
|
-
permissions: field.string({
|
|
17
|
-
isArray: true,
|
|
18
|
-
description: "Array of permission names"
|
|
19
|
-
}),
|
|
20
|
-
createdAt: field.createdAt(),
|
|
21
|
-
updatedAt: field.updatedAt(),
|
|
22
|
-
policyBindings: field.hasMany("PolicyBinding")
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
var PermissionEntity = defineEntity({
|
|
26
|
-
name: "Permission",
|
|
27
|
-
description: "A permission represents an atomic access right.",
|
|
28
|
-
schema: "lssm_sigil",
|
|
29
|
-
map: "permission",
|
|
30
|
-
fields: {
|
|
31
|
-
id: field.id(),
|
|
32
|
-
name: field.string({
|
|
33
|
-
isUnique: true,
|
|
34
|
-
description: "Unique permission name"
|
|
35
|
-
}),
|
|
36
|
-
description: field.string({
|
|
37
|
-
isOptional: true,
|
|
38
|
-
description: "Permission description"
|
|
39
|
-
}),
|
|
40
|
-
createdAt: field.createdAt(),
|
|
41
|
-
updatedAt: field.updatedAt()
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
var PolicyBindingEntity = defineEntity({
|
|
45
|
-
name: "PolicyBinding",
|
|
46
|
-
description: "Binds roles to principals (users or organizations).",
|
|
47
|
-
schema: "lssm_sigil",
|
|
48
|
-
map: "policy_binding",
|
|
49
|
-
fields: {
|
|
50
|
-
id: field.id(),
|
|
51
|
-
roleId: field.foreignKey(),
|
|
52
|
-
targetType: field.string({ description: '"user" or "organization"' }),
|
|
53
|
-
targetId: field.string({ description: "ID of User or Organization" }),
|
|
54
|
-
expiresAt: field.dateTime({
|
|
55
|
-
isOptional: true,
|
|
56
|
-
description: "When binding expires"
|
|
57
|
-
}),
|
|
58
|
-
createdAt: field.createdAt(),
|
|
59
|
-
userId: field.string({ isOptional: true }),
|
|
60
|
-
organizationId: field.string({ isOptional: true }),
|
|
61
|
-
role: field.belongsTo("Role", ["roleId"], ["id"], { onDelete: "Cascade" }),
|
|
62
|
-
user: field.belongsTo("User", ["userId"], ["id"]),
|
|
63
|
-
organization: field.belongsTo("Organization", ["organizationId"], ["id"])
|
|
64
|
-
},
|
|
65
|
-
indexes: [index.on(["targetType", "targetId"])]
|
|
66
|
-
});
|
|
67
|
-
var ApiKeyEntity = defineEntity({
|
|
68
|
-
name: "ApiKey",
|
|
69
|
-
description: "API keys for programmatic access.",
|
|
70
|
-
schema: "lssm_sigil",
|
|
71
|
-
map: "api_key",
|
|
72
|
-
fields: {
|
|
73
|
-
id: field.id(),
|
|
74
|
-
name: field.string({ description: "API key name" }),
|
|
75
|
-
start: field.string({
|
|
76
|
-
description: "Starting characters for identification"
|
|
77
|
-
}),
|
|
78
|
-
prefix: field.string({ description: "API key prefix" }),
|
|
79
|
-
key: field.string({ description: "Hashed API key" }),
|
|
80
|
-
userId: field.foreignKey(),
|
|
81
|
-
refillInterval: field.int({ description: "Refill interval in ms" }),
|
|
82
|
-
refillAmount: field.int({ description: "Amount to refill" }),
|
|
83
|
-
lastRefillAt: field.dateTime(),
|
|
84
|
-
remaining: field.int({ description: "Remaining requests" }),
|
|
85
|
-
requestCount: field.int({ description: "Total requests made" }),
|
|
86
|
-
lastRequest: field.dateTime(),
|
|
87
|
-
enabled: field.boolean({ default: true }),
|
|
88
|
-
rateLimitEnabled: field.boolean({ default: true }),
|
|
89
|
-
rateLimitTimeWindow: field.int({ description: "Rate limit window in ms" }),
|
|
90
|
-
rateLimitMax: field.int({ description: "Max requests in window" }),
|
|
91
|
-
expiresAt: field.dateTime(),
|
|
92
|
-
permissions: field.string({ isArray: true }),
|
|
93
|
-
metadata: field.json({ isOptional: true }),
|
|
94
|
-
createdAt: field.createdAt(),
|
|
95
|
-
updatedAt: field.updatedAt(),
|
|
96
|
-
user: field.belongsTo("User", ["userId"], ["id"], { onDelete: "Cascade" })
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
var PasskeyEntity = defineEntity({
|
|
100
|
-
name: "Passkey",
|
|
101
|
-
description: "WebAuthn passkeys for passwordless authentication.",
|
|
102
|
-
schema: "lssm_sigil",
|
|
103
|
-
map: "passkey",
|
|
104
|
-
fields: {
|
|
105
|
-
id: field.id(),
|
|
106
|
-
name: field.string({ description: "Passkey name" }),
|
|
107
|
-
publicKey: field.string({ description: "Public key" }),
|
|
108
|
-
userId: field.foreignKey(),
|
|
109
|
-
credentialID: field.string({ description: "Credential ID" }),
|
|
110
|
-
counter: field.int({ description: "Counter" }),
|
|
111
|
-
deviceType: field.string({ description: "Device type" }),
|
|
112
|
-
backedUp: field.boolean({ description: "Whether passkey is backed up" }),
|
|
113
|
-
transports: field.string({ description: "Transports" }),
|
|
114
|
-
aaguid: field.string({ description: "Authenticator GUID" }),
|
|
115
|
-
createdAt: field.createdAt(),
|
|
116
|
-
user: field.belongsTo("User", ["userId"], ["id"], { onDelete: "Cascade" })
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
export {
|
|
120
|
-
RoleEntity,
|
|
121
|
-
PolicyBindingEntity,
|
|
122
|
-
PermissionEntity,
|
|
123
|
-
PasskeyEntity,
|
|
124
|
-
ApiKeyEntity
|
|
125
|
-
};
|
|
2
|
+
import{defineEntity as j,field as g,index as q}from"@contractspec/lib.schema";var w=j({name:"Role",description:"A role defines a named set of permissions.",schema:"lssm_sigil",map:"role",fields:{id:g.id(),name:g.string({isUnique:!0,description:"Unique role name"}),description:g.string({isOptional:!0,description:"Role description"}),permissions:g.string({isArray:!0,description:"Array of permission names"}),createdAt:g.createdAt(),updatedAt:g.updatedAt(),policyBindings:g.hasMany("PolicyBinding")}}),z=j({name:"Permission",description:"A permission represents an atomic access right.",schema:"lssm_sigil",map:"permission",fields:{id:g.id(),name:g.string({isUnique:!0,description:"Unique permission name"}),description:g.string({isOptional:!0,description:"Permission description"}),createdAt:g.createdAt(),updatedAt:g.updatedAt()}}),B=j({name:"PolicyBinding",description:"Binds roles to principals (users or organizations).",schema:"lssm_sigil",map:"policy_binding",fields:{id:g.id(),roleId:g.foreignKey(),targetType:g.string({description:'"user" or "organization"'}),targetId:g.string({description:"ID of User or Organization"}),expiresAt:g.dateTime({isOptional:!0,description:"When binding expires"}),createdAt:g.createdAt(),userId:g.string({isOptional:!0}),organizationId:g.string({isOptional:!0}),role:g.belongsTo("Role",["roleId"],["id"],{onDelete:"Cascade"}),user:g.belongsTo("User",["userId"],["id"]),organization:g.belongsTo("Organization",["organizationId"],["id"])},indexes:[q.on(["targetType","targetId"])]}),C=j({name:"ApiKey",description:"API keys for programmatic access.",schema:"lssm_sigil",map:"api_key",fields:{id:g.id(),name:g.string({description:"API key name"}),start:g.string({description:"Starting characters for identification"}),prefix:g.string({description:"API key prefix"}),key:g.string({description:"Hashed API key"}),userId:g.foreignKey(),refillInterval:g.int({description:"Refill interval in ms"}),refillAmount:g.int({description:"Amount to refill"}),lastRefillAt:g.dateTime(),remaining:g.int({description:"Remaining requests"}),requestCount:g.int({description:"Total requests made"}),lastRequest:g.dateTime(),enabled:g.boolean({default:!0}),rateLimitEnabled:g.boolean({default:!0}),rateLimitTimeWindow:g.int({description:"Rate limit window in ms"}),rateLimitMax:g.int({description:"Max requests in window"}),expiresAt:g.dateTime(),permissions:g.string({isArray:!0}),metadata:g.json({isOptional:!0}),createdAt:g.createdAt(),updatedAt:g.updatedAt(),user:g.belongsTo("User",["userId"],["id"],{onDelete:"Cascade"})}}),D=j({name:"Passkey",description:"WebAuthn passkeys for passwordless authentication.",schema:"lssm_sigil",map:"passkey",fields:{id:g.id(),name:g.string({description:"Passkey name"}),publicKey:g.string({description:"Public key"}),userId:g.foreignKey(),credentialID:g.string({description:"Credential ID"}),counter:g.int({description:"Counter"}),deviceType:g.string({description:"Device type"}),backedUp:g.boolean({description:"Whether passkey is backed up"}),transports:g.string({description:"Transports"}),aaguid:g.string({description:"Authenticator GUID"}),createdAt:g.createdAt(),user:g.belongsTo("User",["userId"],["id"],{onDelete:"Cascade"})}});export{w as RoleEntity,B as PolicyBindingEntity,z as PermissionEntity,D as PasskeyEntity,C as ApiKeyEntity};
|
package/dist/entities/user.js
CHANGED
|
@@ -1,169 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import { defineEntity, field, index } from "@contractspec/lib.schema";
|
|
4
|
-
var UserEntity = defineEntity({
|
|
5
|
-
name: "User",
|
|
6
|
-
description: "A user of the platform. Users hold core profile information and authenticate via Account records.",
|
|
7
|
-
schema: "lssm_sigil",
|
|
8
|
-
map: "user",
|
|
9
|
-
fields: {
|
|
10
|
-
id: field.id({ description: "Unique user identifier" }),
|
|
11
|
-
email: field.email({ isUnique: true, description: "User email address" }),
|
|
12
|
-
emailVerified: field.boolean({
|
|
13
|
-
default: false,
|
|
14
|
-
description: "Whether email has been verified"
|
|
15
|
-
}),
|
|
16
|
-
name: field.string({ isOptional: true, description: "Display name" }),
|
|
17
|
-
firstName: field.string({ isOptional: true, description: "First name" }),
|
|
18
|
-
lastName: field.string({ isOptional: true, description: "Last name" }),
|
|
19
|
-
locale: field.string({
|
|
20
|
-
isOptional: true,
|
|
21
|
-
description: 'User locale (e.g., "en-US")'
|
|
22
|
-
}),
|
|
23
|
-
timezone: field.string({
|
|
24
|
-
isOptional: true,
|
|
25
|
-
description: 'Olson timezone (e.g., "Europe/Paris")'
|
|
26
|
-
}),
|
|
27
|
-
imageUrl: field.url({
|
|
28
|
-
isOptional: true,
|
|
29
|
-
description: "URL of avatar or profile picture"
|
|
30
|
-
}),
|
|
31
|
-
image: field.string({
|
|
32
|
-
isOptional: true,
|
|
33
|
-
description: "Legacy image field"
|
|
34
|
-
}),
|
|
35
|
-
metadata: field.json({
|
|
36
|
-
isOptional: true,
|
|
37
|
-
description: "Arbitrary user metadata"
|
|
38
|
-
}),
|
|
39
|
-
onboardingCompleted: field.boolean({
|
|
40
|
-
default: false,
|
|
41
|
-
description: "Whether onboarding is complete"
|
|
42
|
-
}),
|
|
43
|
-
onboardingStep: field.string({
|
|
44
|
-
isOptional: true,
|
|
45
|
-
description: "Current onboarding step"
|
|
46
|
-
}),
|
|
47
|
-
whitelistedAt: field.dateTime({
|
|
48
|
-
isOptional: true,
|
|
49
|
-
description: "When user was whitelisted"
|
|
50
|
-
}),
|
|
51
|
-
role: field.string({
|
|
52
|
-
isOptional: true,
|
|
53
|
-
default: '"user"',
|
|
54
|
-
description: "User role (user, admin)"
|
|
55
|
-
}),
|
|
56
|
-
banned: field.boolean({
|
|
57
|
-
default: false,
|
|
58
|
-
description: "Whether user is banned"
|
|
59
|
-
}),
|
|
60
|
-
banReason: field.string({
|
|
61
|
-
isOptional: true,
|
|
62
|
-
description: "Reason for ban"
|
|
63
|
-
}),
|
|
64
|
-
banExpires: field.dateTime({
|
|
65
|
-
isOptional: true,
|
|
66
|
-
description: "When ban expires"
|
|
67
|
-
}),
|
|
68
|
-
phoneNumber: field.string({
|
|
69
|
-
isOptional: true,
|
|
70
|
-
isUnique: true,
|
|
71
|
-
description: "Phone number"
|
|
72
|
-
}),
|
|
73
|
-
phoneNumberVerified: field.boolean({
|
|
74
|
-
default: false,
|
|
75
|
-
description: "Whether phone is verified"
|
|
76
|
-
}),
|
|
77
|
-
createdAt: field.createdAt(),
|
|
78
|
-
updatedAt: field.updatedAt(),
|
|
79
|
-
sessions: field.hasMany("Session"),
|
|
80
|
-
accounts: field.hasMany("Account"),
|
|
81
|
-
memberships: field.hasMany("Member"),
|
|
82
|
-
invitations: field.hasMany("Invitation"),
|
|
83
|
-
teamMemberships: field.hasMany("TeamMember"),
|
|
84
|
-
policyBindings: field.hasMany("PolicyBinding"),
|
|
85
|
-
apiKeys: field.hasMany("ApiKey"),
|
|
86
|
-
passkeys: field.hasMany("Passkey")
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
var SessionEntity = defineEntity({
|
|
90
|
-
name: "Session",
|
|
91
|
-
description: "Represents a login session (e.g., web session or API token).",
|
|
92
|
-
schema: "lssm_sigil",
|
|
93
|
-
map: "session",
|
|
94
|
-
fields: {
|
|
95
|
-
id: field.id(),
|
|
96
|
-
userId: field.foreignKey(),
|
|
97
|
-
expiresAt: field.dateTime({ description: "Session expiration time" }),
|
|
98
|
-
token: field.string({ isUnique: true, description: "Session token" }),
|
|
99
|
-
ipAddress: field.string({
|
|
100
|
-
isOptional: true,
|
|
101
|
-
description: "Client IP address"
|
|
102
|
-
}),
|
|
103
|
-
userAgent: field.string({
|
|
104
|
-
isOptional: true,
|
|
105
|
-
description: "Client user agent"
|
|
106
|
-
}),
|
|
107
|
-
impersonatedBy: field.string({
|
|
108
|
-
isOptional: true,
|
|
109
|
-
description: "Admin impersonating this session"
|
|
110
|
-
}),
|
|
111
|
-
activeOrganizationId: field.string({
|
|
112
|
-
isOptional: true,
|
|
113
|
-
description: "Active org context"
|
|
114
|
-
}),
|
|
115
|
-
activeTeamId: field.string({
|
|
116
|
-
isOptional: true,
|
|
117
|
-
description: "Active team context"
|
|
118
|
-
}),
|
|
119
|
-
createdAt: field.createdAt(),
|
|
120
|
-
updatedAt: field.updatedAt(),
|
|
121
|
-
user: field.belongsTo("User", ["userId"], ["id"], { onDelete: "Cascade" })
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
var AccountEntity = defineEntity({
|
|
125
|
-
name: "Account",
|
|
126
|
-
description: "External authentication accounts (OAuth, password, etc.).",
|
|
127
|
-
schema: "lssm_sigil",
|
|
128
|
-
map: "account",
|
|
129
|
-
fields: {
|
|
130
|
-
id: field.id(),
|
|
131
|
-
accountId: field.string({ description: "Account ID from provider" }),
|
|
132
|
-
providerId: field.string({ description: "Provider identifier" }),
|
|
133
|
-
userId: field.foreignKey(),
|
|
134
|
-
accessToken: field.string({ isOptional: true }),
|
|
135
|
-
refreshToken: field.string({ isOptional: true }),
|
|
136
|
-
idToken: field.string({ isOptional: true }),
|
|
137
|
-
accessTokenExpiresAt: field.dateTime({ isOptional: true }),
|
|
138
|
-
refreshTokenExpiresAt: field.dateTime({ isOptional: true }),
|
|
139
|
-
scope: field.string({ isOptional: true }),
|
|
140
|
-
password: field.string({
|
|
141
|
-
isOptional: true,
|
|
142
|
-
description: "Hashed password for password providers"
|
|
143
|
-
}),
|
|
144
|
-
createdAt: field.createdAt(),
|
|
145
|
-
updatedAt: field.updatedAt(),
|
|
146
|
-
user: field.belongsTo("User", ["userId"], ["id"], { onDelete: "Cascade" })
|
|
147
|
-
},
|
|
148
|
-
indexes: [index.unique(["accountId", "providerId"])]
|
|
149
|
-
});
|
|
150
|
-
var VerificationEntity = defineEntity({
|
|
151
|
-
name: "Verification",
|
|
152
|
-
description: "Verification tokens for email/phone confirmation.",
|
|
153
|
-
schema: "lssm_sigil",
|
|
154
|
-
map: "verification",
|
|
155
|
-
fields: {
|
|
156
|
-
id: field.uuid(),
|
|
157
|
-
identifier: field.string({ description: "Email or phone being verified" }),
|
|
158
|
-
value: field.string({ description: "Verification code/token" }),
|
|
159
|
-
expiresAt: field.dateTime({ description: "Token expiration" }),
|
|
160
|
-
createdAt: field.createdAt(),
|
|
161
|
-
updatedAt: field.updatedAt()
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
export {
|
|
165
|
-
VerificationEntity,
|
|
166
|
-
UserEntity,
|
|
167
|
-
SessionEntity,
|
|
168
|
-
AccountEntity
|
|
169
|
-
};
|
|
2
|
+
import{defineEntity as j,field as g,index as q}from"@contractspec/lib.schema";var w=j({name:"User",description:"A user of the platform. Users hold core profile information and authenticate via Account records.",schema:"lssm_sigil",map:"user",fields:{id:g.id({description:"Unique user identifier"}),email:g.email({isUnique:!0,description:"User email address"}),emailVerified:g.boolean({default:!1,description:"Whether email has been verified"}),name:g.string({isOptional:!0,description:"Display name"}),firstName:g.string({isOptional:!0,description:"First name"}),lastName:g.string({isOptional:!0,description:"Last name"}),locale:g.string({isOptional:!0,description:'User locale (e.g., "en-US")'}),timezone:g.string({isOptional:!0,description:'Olson timezone (e.g., "Europe/Paris")'}),imageUrl:g.url({isOptional:!0,description:"URL of avatar or profile picture"}),image:g.string({isOptional:!0,description:"Legacy image field"}),metadata:g.json({isOptional:!0,description:"Arbitrary user metadata"}),onboardingCompleted:g.boolean({default:!1,description:"Whether onboarding is complete"}),onboardingStep:g.string({isOptional:!0,description:"Current onboarding step"}),whitelistedAt:g.dateTime({isOptional:!0,description:"When user was whitelisted"}),role:g.string({isOptional:!0,default:'"user"',description:"User role (user, admin)"}),banned:g.boolean({default:!1,description:"Whether user is banned"}),banReason:g.string({isOptional:!0,description:"Reason for ban"}),banExpires:g.dateTime({isOptional:!0,description:"When ban expires"}),phoneNumber:g.string({isOptional:!0,isUnique:!0,description:"Phone number"}),phoneNumberVerified:g.boolean({default:!1,description:"Whether phone is verified"}),createdAt:g.createdAt(),updatedAt:g.updatedAt(),sessions:g.hasMany("Session"),accounts:g.hasMany("Account"),memberships:g.hasMany("Member"),invitations:g.hasMany("Invitation"),teamMemberships:g.hasMany("TeamMember"),policyBindings:g.hasMany("PolicyBinding"),apiKeys:g.hasMany("ApiKey"),passkeys:g.hasMany("Passkey")}}),z=j({name:"Session",description:"Represents a login session (e.g., web session or API token).",schema:"lssm_sigil",map:"session",fields:{id:g.id(),userId:g.foreignKey(),expiresAt:g.dateTime({description:"Session expiration time"}),token:g.string({isUnique:!0,description:"Session token"}),ipAddress:g.string({isOptional:!0,description:"Client IP address"}),userAgent:g.string({isOptional:!0,description:"Client user agent"}),impersonatedBy:g.string({isOptional:!0,description:"Admin impersonating this session"}),activeOrganizationId:g.string({isOptional:!0,description:"Active org context"}),activeTeamId:g.string({isOptional:!0,description:"Active team context"}),createdAt:g.createdAt(),updatedAt:g.updatedAt(),user:g.belongsTo("User",["userId"],["id"],{onDelete:"Cascade"})}}),A=j({name:"Account",description:"External authentication accounts (OAuth, password, etc.).",schema:"lssm_sigil",map:"account",fields:{id:g.id(),accountId:g.string({description:"Account ID from provider"}),providerId:g.string({description:"Provider identifier"}),userId:g.foreignKey(),accessToken:g.string({isOptional:!0}),refreshToken:g.string({isOptional:!0}),idToken:g.string({isOptional:!0}),accessTokenExpiresAt:g.dateTime({isOptional:!0}),refreshTokenExpiresAt:g.dateTime({isOptional:!0}),scope:g.string({isOptional:!0}),password:g.string({isOptional:!0,description:"Hashed password for password providers"}),createdAt:g.createdAt(),updatedAt:g.updatedAt(),user:g.belongsTo("User",["userId"],["id"],{onDelete:"Cascade"})},indexes:[q.unique(["accountId","providerId"])]}),B=j({name:"Verification",description:"Verification tokens for email/phone confirmation.",schema:"lssm_sigil",map:"verification",fields:{id:g.uuid(),identifier:g.string({description:"Email or phone being verified"}),value:g.string({description:"Verification code/token"}),expiresAt:g.dateTime({description:"Token expiration"}),createdAt:g.createdAt(),updatedAt:g.updatedAt()}});export{B as VerificationEntity,w as UserEntity,z as SessionEntity,A as AccountEntity};
|