@usehercules/convex 0.0.0

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.
Files changed (67) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +478 -0
  3. package/dist/_generated/component.d.ts +184 -0
  4. package/dist/_generated/component.d.ts.map +1 -0
  5. package/dist/_generated/component.js +11 -0
  6. package/dist/_generated/component.js.map +1 -0
  7. package/dist/checker/cli.d.ts +3 -0
  8. package/dist/checker/cli.d.ts.map +1 -0
  9. package/dist/checker/cli.js +71 -0
  10. package/dist/checker/cli.js.map +1 -0
  11. package/dist/checker/index.d.ts +28 -0
  12. package/dist/checker/index.d.ts.map +1 -0
  13. package/dist/checker/index.js +1928 -0
  14. package/dist/checker/index.js.map +1 -0
  15. package/dist/client/access-admin.d.ts +818 -0
  16. package/dist/client/access-admin.d.ts.map +1 -0
  17. package/dist/client/access-admin.js +1830 -0
  18. package/dist/client/access-admin.js.map +1 -0
  19. package/dist/client/http.d.ts +19 -0
  20. package/dist/client/http.d.ts.map +1 -0
  21. package/dist/client/http.js +76 -0
  22. package/dist/client/http.js.map +1 -0
  23. package/dist/client/index.d.ts +440 -0
  24. package/dist/client/index.d.ts.map +1 -0
  25. package/dist/client/index.js +654 -0
  26. package/dist/client/index.js.map +1 -0
  27. package/dist/component/authz.d.ts +114 -0
  28. package/dist/component/authz.d.ts.map +1 -0
  29. package/dist/component/authz.js +168 -0
  30. package/dist/component/authz.js.map +1 -0
  31. package/dist/component/checks.d.ts +86 -0
  32. package/dist/component/checks.d.ts.map +1 -0
  33. package/dist/component/checks.js +184 -0
  34. package/dist/component/checks.js.map +1 -0
  35. package/dist/component/convex.config.d.ts +3 -0
  36. package/dist/component/convex.config.d.ts.map +1 -0
  37. package/dist/component/convex.config.js +3 -0
  38. package/dist/component/convex.config.js.map +1 -0
  39. package/dist/component/effective.d.ts +82 -0
  40. package/dist/component/effective.d.ts.map +1 -0
  41. package/dist/component/effective.js +757 -0
  42. package/dist/component/effective.js.map +1 -0
  43. package/dist/component/queries.d.ts +170 -0
  44. package/dist/component/queries.d.ts.map +1 -0
  45. package/dist/component/queries.js +633 -0
  46. package/dist/component/queries.js.map +1 -0
  47. package/dist/component/schema.d.ts +258 -0
  48. package/dist/component/schema.d.ts.map +1 -0
  49. package/dist/component/schema.js +222 -0
  50. package/dist/component/schema.js.map +1 -0
  51. package/dist/component/sync.d.ts +85 -0
  52. package/dist/component/sync.d.ts.map +1 -0
  53. package/dist/component/sync.js +851 -0
  54. package/dist/component/sync.js.map +1 -0
  55. package/dist/shared/projection-protocol.d.ts +1624 -0
  56. package/dist/shared/projection-protocol.d.ts.map +1 -0
  57. package/dist/shared/projection-protocol.js +561 -0
  58. package/dist/shared/projection-protocol.js.map +1 -0
  59. package/dist/shared/sync.d.ts +24 -0
  60. package/dist/shared/sync.d.ts.map +1 -0
  61. package/dist/shared/sync.js +18 -0
  62. package/dist/shared/sync.js.map +1 -0
  63. package/dist/shared/token.d.ts +5 -0
  64. package/dist/shared/token.d.ts.map +1 -0
  65. package/dist/shared/token.js +19 -0
  66. package/dist/shared/token.js.map +1 -0
  67. package/package.json +89 -0
@@ -0,0 +1,258 @@
1
+ declare const _default: import("convex/server").SchemaDefinition<{
2
+ sync_state: import("convex/server").TableDefinition<import("convex/values").VObject<{
3
+ lastEventId?: string | undefined;
4
+ lastError?: string | undefined;
5
+ sourceVersion: number;
6
+ expectedIssuer: string;
7
+ lastSyncedAt: number;
8
+ }, {
9
+ sourceVersion: import("convex/values").VFloat64<number, "required">;
10
+ expectedIssuer: import("convex/values").VString<string, "required">;
11
+ lastEventId: import("convex/values").VString<string | undefined, "optional">;
12
+ lastSyncedAt: import("convex/values").VFloat64<number, "required">;
13
+ lastError: import("convex/values").VString<string | undefined, "optional">;
14
+ }, "required", "sourceVersion" | "expectedIssuer" | "lastEventId" | "lastSyncedAt" | "lastError">, {}, {}, {}>;
15
+ users: import("convex/server").TableDefinition<import("convex/values").VObject<{
16
+ image?: string | undefined;
17
+ phone?: string | undefined;
18
+ herculesAuthUserId: string;
19
+ name: string;
20
+ email: string;
21
+ emailVerified: boolean;
22
+ phoneVerified: boolean;
23
+ updatedAt: number;
24
+ }, {
25
+ herculesAuthUserId: import("convex/values").VString<string, "required">;
26
+ name: import("convex/values").VString<string, "required">;
27
+ email: import("convex/values").VString<string, "required">;
28
+ emailVerified: import("convex/values").VBoolean<boolean, "required">;
29
+ image: import("convex/values").VString<string | undefined, "optional">;
30
+ phone: import("convex/values").VString<string | undefined, "optional">;
31
+ phoneVerified: import("convex/values").VBoolean<boolean, "required">;
32
+ updatedAt: import("convex/values").VFloat64<number, "required">;
33
+ }, "required", "herculesAuthUserId" | "name" | "email" | "emailVerified" | "image" | "phone" | "phoneVerified" | "updatedAt">, {
34
+ by_auth_user_id: ["herculesAuthUserId", "_creationTime"];
35
+ }, {}, {}>;
36
+ scopes: import("convex/server").TableDefinition<import("convex/values").VObject<{
37
+ name: string;
38
+ updatedAt: number;
39
+ accessScopeId: string;
40
+ kind: "default" | "org" | "suite";
41
+ status: "active" | "disabled";
42
+ accountEntryMode: "open" | "allowlisted_only" | "invite_only" | "approval_required";
43
+ defaultRoleId: string;
44
+ }, {
45
+ accessScopeId: import("convex/values").VString<string, "required">;
46
+ name: import("convex/values").VString<string, "required">;
47
+ kind: import("convex/values").VUnion<"default" | "org" | "suite", [import("convex/values").VLiteral<"default", "required">, import("convex/values").VLiteral<"org", "required">, import("convex/values").VLiteral<"suite", "required">], "required", never>;
48
+ status: import("convex/values").VUnion<"active" | "disabled", [import("convex/values").VLiteral<"active", "required">, import("convex/values").VLiteral<"disabled", "required">], "required", never>;
49
+ accountEntryMode: import("convex/values").VUnion<"open" | "allowlisted_only" | "invite_only" | "approval_required", [import("convex/values").VLiteral<"open", "required">, import("convex/values").VLiteral<"allowlisted_only", "required">, import("convex/values").VLiteral<"invite_only", "required">, import("convex/values").VLiteral<"approval_required", "required">], "required", never>;
50
+ defaultRoleId: import("convex/values").VString<string, "required">;
51
+ updatedAt: import("convex/values").VFloat64<number, "required">;
52
+ }, "required", "name" | "updatedAt" | "accessScopeId" | "kind" | "status" | "accountEntryMode" | "defaultRoleId">, {
53
+ by_scope_id: ["accessScopeId", "_creationTime"];
54
+ by_kind: ["kind", "_creationTime"];
55
+ }, {}, {}>;
56
+ organizations: import("convex/server").TableDefinition<import("convex/values").VObject<{
57
+ name: string;
58
+ updatedAt: number;
59
+ accessScopeId: string;
60
+ status: "active" | "disabled";
61
+ accountEntryMode: "open" | "allowlisted_only" | "invite_only" | "approval_required";
62
+ }, {
63
+ accessScopeId: import("convex/values").VString<string, "required">;
64
+ name: import("convex/values").VString<string, "required">;
65
+ status: import("convex/values").VUnion<"active" | "disabled", [import("convex/values").VLiteral<"active", "required">, import("convex/values").VLiteral<"disabled", "required">], "required", never>;
66
+ accountEntryMode: import("convex/values").VUnion<"open" | "allowlisted_only" | "invite_only" | "approval_required", [import("convex/values").VLiteral<"open", "required">, import("convex/values").VLiteral<"allowlisted_only", "required">, import("convex/values").VLiteral<"invite_only", "required">, import("convex/values").VLiteral<"approval_required", "required">], "required", never>;
67
+ updatedAt: import("convex/values").VFloat64<number, "required">;
68
+ }, "required", "name" | "updatedAt" | "accessScopeId" | "status" | "accountEntryMode">, {
69
+ by_scope_id: ["accessScopeId", "_creationTime"];
70
+ }, {}, {}>;
71
+ principals: import("convex/server").TableDefinition<import("convex/values").VObject<{
72
+ herculesAuthUserId?: string | undefined;
73
+ name?: string | undefined;
74
+ type: "user" | "group";
75
+ updatedAt: number;
76
+ accessScopeId: string;
77
+ status: "active" | "blocked" | "suspended" | "pending_approval" | "removed";
78
+ principalId: string;
79
+ joinedAt: number;
80
+ }, {
81
+ accessScopeId: import("convex/values").VString<string, "required">;
82
+ principalId: import("convex/values").VString<string, "required">;
83
+ type: import("convex/values").VUnion<"user" | "group", [import("convex/values").VLiteral<"user", "required">, import("convex/values").VLiteral<"group", "required">], "required", never>;
84
+ herculesAuthUserId: import("convex/values").VString<string | undefined, "optional">;
85
+ name: import("convex/values").VString<string | undefined, "optional">;
86
+ status: import("convex/values").VUnion<"active" | "blocked" | "suspended" | "pending_approval" | "removed", [import("convex/values").VLiteral<"active", "required">, import("convex/values").VLiteral<"blocked", "required">, import("convex/values").VLiteral<"suspended", "required">, import("convex/values").VLiteral<"pending_approval", "required">, import("convex/values").VLiteral<"removed", "required">], "required", never>;
87
+ joinedAt: import("convex/values").VFloat64<number, "required">;
88
+ updatedAt: import("convex/values").VFloat64<number, "required">;
89
+ }, "required", "type" | "herculesAuthUserId" | "name" | "updatedAt" | "accessScopeId" | "status" | "principalId" | "joinedAt">, {
90
+ by_principal_id: ["principalId", "_creationTime"];
91
+ by_scope: ["accessScopeId", "_creationTime"];
92
+ by_scope_auth_user: ["accessScopeId", "herculesAuthUserId", "_creationTime"];
93
+ by_auth_user: ["herculesAuthUserId", "_creationTime"];
94
+ by_scope_type: ["accessScopeId", "type", "_creationTime"];
95
+ by_scope_status: ["accessScopeId", "status", "_creationTime"];
96
+ by_scope_status_type: ["accessScopeId", "status", "type", "_creationTime"];
97
+ }, {}, {}>;
98
+ principal_memberships: import("convex/server").TableDefinition<import("convex/values").VObject<{
99
+ updatedAt: number;
100
+ accessScopeId: string;
101
+ groupPrincipalId: string;
102
+ memberPrincipalId: string;
103
+ }, {
104
+ accessScopeId: import("convex/values").VString<string, "required">;
105
+ groupPrincipalId: import("convex/values").VString<string, "required">;
106
+ memberPrincipalId: import("convex/values").VString<string, "required">;
107
+ updatedAt: import("convex/values").VFloat64<number, "required">;
108
+ }, "required", "updatedAt" | "accessScopeId" | "groupPrincipalId" | "memberPrincipalId">, {
109
+ by_scope: ["accessScopeId", "_creationTime"];
110
+ by_group: ["accessScopeId", "groupPrincipalId", "_creationTime"];
111
+ by_member: ["accessScopeId", "memberPrincipalId", "_creationTime"];
112
+ by_group_member: ["accessScopeId", "groupPrincipalId", "memberPrincipalId", "_creationTime"];
113
+ }, {}, {}>;
114
+ roles: import("convex/server").TableDefinition<import("convex/values").VObject<{
115
+ accessScopeId?: string | undefined;
116
+ name: string;
117
+ updatedAt: number;
118
+ roleId: string;
119
+ key: string;
120
+ source: "system" | "iam" | "tenant";
121
+ baseWildcard: "none" | "immutable" | "default";
122
+ }, {
123
+ roleId: import("convex/values").VString<string, "required">;
124
+ key: import("convex/values").VString<string, "required">;
125
+ source: import("convex/values").VUnion<"system" | "iam" | "tenant", [import("convex/values").VLiteral<"system", "required">, import("convex/values").VLiteral<"iam", "required">, import("convex/values").VLiteral<"tenant", "required">], "required", never>;
126
+ name: import("convex/values").VString<string, "required">;
127
+ baseWildcard: import("convex/values").VUnion<"none" | "immutable" | "default", [import("convex/values").VLiteral<"none", "required">, import("convex/values").VLiteral<"immutable", "required">, import("convex/values").VLiteral<"default", "required">], "required", never>;
128
+ accessScopeId: import("convex/values").VString<string | undefined, "optional">;
129
+ updatedAt: import("convex/values").VFloat64<number, "required">;
130
+ }, "required", "name" | "updatedAt" | "roleId" | "key" | "source" | "baseWildcard" | "accessScopeId">, {
131
+ by_role_id: ["roleId", "_creationTime"];
132
+ by_scope: ["accessScopeId", "_creationTime"];
133
+ by_scope_key: ["accessScopeId", "key", "_creationTime"];
134
+ by_source: ["source", "_creationTime"];
135
+ }, {}, {}>;
136
+ permissions: import("convex/server").TableDefinition<import("convex/values").VObject<{
137
+ updatedAt: number;
138
+ key: string;
139
+ permissionId: string;
140
+ resourceType: string;
141
+ action: string;
142
+ classification: "delegable" | "owner_only";
143
+ tenantAssignable: boolean;
144
+ accessScopeId: string;
145
+ }, {
146
+ accessScopeId: import("convex/values").VString<string, "required">;
147
+ permissionId: import("convex/values").VString<string, "required">;
148
+ key: import("convex/values").VString<string, "required">;
149
+ resourceType: import("convex/values").VString<string, "required">;
150
+ action: import("convex/values").VString<string, "required">;
151
+ classification: import("convex/values").VUnion<"delegable" | "owner_only", [import("convex/values").VLiteral<"delegable", "required">, import("convex/values").VLiteral<"owner_only", "required">], "required", never>;
152
+ tenantAssignable: import("convex/values").VBoolean<boolean, "required">;
153
+ updatedAt: import("convex/values").VFloat64<number, "required">;
154
+ }, "required", "updatedAt" | "key" | "permissionId" | "resourceType" | "action" | "classification" | "tenantAssignable" | "accessScopeId">, {
155
+ by_permission_id: ["permissionId", "_creationTime"];
156
+ by_scope: ["accessScopeId", "_creationTime"];
157
+ by_scope_key: ["accessScopeId", "key", "_creationTime"];
158
+ by_scope_resource_action: ["accessScopeId", "resourceType", "action", "_creationTime"];
159
+ }, {}, {}>;
160
+ role_permissions: import("convex/server").TableDefinition<import("convex/values").VObject<{
161
+ updatedAt: number;
162
+ roleId: string;
163
+ permissionId: string;
164
+ effect: "allow" | "deny";
165
+ }, {
166
+ roleId: import("convex/values").VString<string, "required">;
167
+ permissionId: import("convex/values").VString<string, "required">;
168
+ effect: import("convex/values").VUnion<"allow" | "deny", [import("convex/values").VLiteral<"allow", "required">, import("convex/values").VLiteral<"deny", "required">], "required", never>;
169
+ updatedAt: import("convex/values").VFloat64<number, "required">;
170
+ }, "required", "updatedAt" | "roleId" | "permissionId" | "effect">, {
171
+ by_role: ["roleId", "_creationTime"];
172
+ by_permission: ["permissionId", "_creationTime"];
173
+ by_role_permission: ["roleId", "permissionId", "_creationTime"];
174
+ }, {}, {}>;
175
+ role_permission_overrides: import("convex/server").TableDefinition<import("convex/values").VObject<{
176
+ updatedAt: number;
177
+ roleId: string;
178
+ permissionId: string;
179
+ effect: "allow" | "deny";
180
+ accessScopeId: string;
181
+ }, {
182
+ accessScopeId: import("convex/values").VString<string, "required">;
183
+ roleId: import("convex/values").VString<string, "required">;
184
+ permissionId: import("convex/values").VString<string, "required">;
185
+ effect: import("convex/values").VUnion<"allow" | "deny", [import("convex/values").VLiteral<"allow", "required">, import("convex/values").VLiteral<"deny", "required">], "required", never>;
186
+ updatedAt: import("convex/values").VFloat64<number, "required">;
187
+ }, "required", "updatedAt" | "roleId" | "permissionId" | "effect" | "accessScopeId">, {
188
+ by_scope: ["accessScopeId", "_creationTime"];
189
+ by_scope_role: ["accessScopeId", "roleId", "_creationTime"];
190
+ by_permission: ["permissionId", "_creationTime"];
191
+ by_role: ["roleId", "_creationTime"];
192
+ by_scope_role_permission: ["accessScopeId", "roleId", "permissionId", "_creationTime"];
193
+ }, {}, {}>;
194
+ role_bindings: import("convex/server").TableDefinition<import("convex/values").VObject<{
195
+ resourceType?: string | undefined;
196
+ resourceId?: string | undefined;
197
+ expiresAt?: number | undefined;
198
+ updatedAt: number;
199
+ roleId: string;
200
+ accessScopeId: string;
201
+ bindingId: string;
202
+ subjectPrincipalId: string;
203
+ appliesTo: "self" | "self_and_descendants";
204
+ }, {
205
+ bindingId: import("convex/values").VString<string, "required">;
206
+ subjectPrincipalId: import("convex/values").VString<string, "required">;
207
+ roleId: import("convex/values").VString<string, "required">;
208
+ accessScopeId: import("convex/values").VString<string, "required">;
209
+ resourceType: import("convex/values").VString<string | undefined, "optional">;
210
+ resourceId: import("convex/values").VString<string | undefined, "optional">;
211
+ appliesTo: import("convex/values").VUnion<"self" | "self_and_descendants", [import("convex/values").VLiteral<"self", "required">, import("convex/values").VLiteral<"self_and_descendants", "required">], "required", never>;
212
+ expiresAt: import("convex/values").VFloat64<number | undefined, "optional">;
213
+ updatedAt: import("convex/values").VFloat64<number, "required">;
214
+ }, "required", "updatedAt" | "roleId" | "resourceType" | "accessScopeId" | "bindingId" | "subjectPrincipalId" | "resourceId" | "appliesTo" | "expiresAt">, {
215
+ by_binding_id: ["bindingId", "_creationTime"];
216
+ by_scope: ["accessScopeId", "_creationTime"];
217
+ by_subject_scope_resource: ["subjectPrincipalId", "accessScopeId", "resourceType", "resourceId", "_creationTime"];
218
+ by_scope_resource: ["accessScopeId", "resourceType", "resourceId", "_creationTime"];
219
+ by_role: ["roleId", "_creationTime"];
220
+ by_subject_principal: ["subjectPrincipalId", "_creationTime"];
221
+ }, {}, {}>;
222
+ permission_bindings: import("convex/server").TableDefinition<import("convex/values").VObject<{
223
+ resourceType?: string | undefined;
224
+ subjectPrincipalId?: string | undefined;
225
+ resourceId?: string | undefined;
226
+ expiresAt?: number | undefined;
227
+ subjectRoleId?: string | undefined;
228
+ updatedAt: number;
229
+ permissionId: string;
230
+ effect: "allow" | "deny";
231
+ accessScopeId: string;
232
+ bindingId: string;
233
+ appliesTo: "self" | "self_and_descendants";
234
+ }, {
235
+ bindingId: import("convex/values").VString<string, "required">;
236
+ subjectPrincipalId: import("convex/values").VString<string | undefined, "optional">;
237
+ subjectRoleId: import("convex/values").VString<string | undefined, "optional">;
238
+ permissionId: import("convex/values").VString<string, "required">;
239
+ effect: import("convex/values").VUnion<"allow" | "deny", [import("convex/values").VLiteral<"allow", "required">, import("convex/values").VLiteral<"deny", "required">], "required", never>;
240
+ accessScopeId: import("convex/values").VString<string, "required">;
241
+ resourceType: import("convex/values").VString<string | undefined, "optional">;
242
+ resourceId: import("convex/values").VString<string | undefined, "optional">;
243
+ appliesTo: import("convex/values").VUnion<"self" | "self_and_descendants", [import("convex/values").VLiteral<"self", "required">, import("convex/values").VLiteral<"self_and_descendants", "required">], "required", never>;
244
+ expiresAt: import("convex/values").VFloat64<number | undefined, "optional">;
245
+ updatedAt: import("convex/values").VFloat64<number, "required">;
246
+ }, "required", "updatedAt" | "permissionId" | "resourceType" | "effect" | "accessScopeId" | "bindingId" | "subjectPrincipalId" | "resourceId" | "appliesTo" | "expiresAt" | "subjectRoleId">, {
247
+ by_binding_id: ["bindingId", "_creationTime"];
248
+ by_scope: ["accessScopeId", "_creationTime"];
249
+ by_subject_principal_scope_resource: ["subjectPrincipalId", "accessScopeId", "resourceType", "resourceId", "_creationTime"];
250
+ by_subject_role_scope_resource: ["subjectRoleId", "accessScopeId", "resourceType", "resourceId", "_creationTime"];
251
+ by_scope_resource: ["accessScopeId", "resourceType", "resourceId", "_creationTime"];
252
+ by_permission: ["permissionId", "_creationTime"];
253
+ by_subject_principal: ["subjectPrincipalId", "_creationTime"];
254
+ by_subject_role: ["subjectRoleId", "_creationTime"];
255
+ }, {}, {}>;
256
+ }, true>;
257
+ export default _default;
258
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/component/schema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,wBAsNG"}
@@ -0,0 +1,222 @@
1
+ import { defineSchema, defineTable } from "convex/server";
2
+ import { v } from "convex/values";
3
+ // Access Control projection mirror — v3 deployment-scoped storage.
4
+ //
5
+ // The deployment-wide catalog (reusable roles, permissions, base role
6
+ // permissions) and deployment-wide users are stored ONCE (never duplicated per
7
+ // scope). Each scope owns its runtime state: principals, memberships, tenant
8
+ // roles, per-scope role-permission overrides, role bindings, and permission
9
+ // bindings. The old polymorphic `grants` table is split into `role_bindings`
10
+ // (role membership) and `permission_bindings` (direct permission authority).
11
+ const effectValidator = v.union(v.literal("allow"), v.literal("deny"));
12
+ const bindingAppliesToValidator = v.union(v.literal("self"), v.literal("self_and_descendants"));
13
+ const wildcardValidator = v.union(v.literal("none"), v.literal("immutable"), v.literal("default"));
14
+ const scopeKindValidator = v.union(v.literal("default"), v.literal("org"), v.literal("suite"));
15
+ const scopeStatusValidator = v.union(v.literal("active"), v.literal("disabled"));
16
+ const accountEntryModeValidator = v.union(v.literal("open"), v.literal("allowlisted_only"), v.literal("invite_only"), v.literal("approval_required"));
17
+ const principalStatusValidator = v.union(v.literal("active"), v.literal("blocked"), v.literal("suspended"), v.literal("pending_approval"), v.literal("removed"));
18
+ export default defineSchema({
19
+ // Single-row version/ack state for the signed sync channel. PRESERVED from v2.
20
+ sync_state: defineTable({
21
+ sourceVersion: v.number(),
22
+ expectedIssuer: v.string(),
23
+ lastEventId: v.optional(v.string()),
24
+ lastSyncedAt: v.number(),
25
+ lastError: v.optional(v.string()),
26
+ }),
27
+ // Deployment-wide user identity/profile (ProjectionUser). Populated from the
28
+ // top-level `users[]` snapshot array / `users` event delta — NOT per scope.
29
+ users: defineTable({
30
+ herculesAuthUserId: v.string(),
31
+ name: v.string(),
32
+ email: v.string(),
33
+ emailVerified: v.boolean(),
34
+ image: v.optional(v.string()),
35
+ phone: v.optional(v.string()),
36
+ phoneVerified: v.boolean(),
37
+ updatedAt: v.number(),
38
+ }).index("by_auth_user_id", ["herculesAuthUserId"]),
39
+ scopes: defineTable({
40
+ accessScopeId: v.string(),
41
+ name: v.string(),
42
+ kind: scopeKindValidator,
43
+ status: scopeStatusValidator,
44
+ accountEntryMode: accountEntryModeValidator,
45
+ defaultRoleId: v.string(),
46
+ updatedAt: v.number(),
47
+ })
48
+ .index("by_scope_id", ["accessScopeId"])
49
+ .index("by_kind", ["kind"]),
50
+ // Product-facing organization rows derived from org/suite scopes.
51
+ organizations: defineTable({
52
+ accessScopeId: v.string(),
53
+ name: v.string(),
54
+ status: scopeStatusValidator,
55
+ accountEntryMode: accountEntryModeValidator,
56
+ updatedAt: v.number(),
57
+ }).index("by_scope_id", ["accessScopeId"]),
58
+ principals: defineTable({
59
+ accessScopeId: v.string(),
60
+ principalId: v.string(),
61
+ type: v.union(v.literal("user"), v.literal("group")),
62
+ herculesAuthUserId: v.optional(v.string()),
63
+ // Display name for a `group` principal. A user principal's display name
64
+ // comes from the deployment-wide `users` table, never from this row.
65
+ name: v.optional(v.string()),
66
+ status: principalStatusValidator,
67
+ joinedAt: v.number(),
68
+ updatedAt: v.number(),
69
+ })
70
+ .index("by_principal_id", ["principalId"])
71
+ .index("by_scope", ["accessScopeId"])
72
+ .index("by_scope_auth_user", ["accessScopeId", "herculesAuthUserId"])
73
+ .index("by_auth_user", ["herculesAuthUserId"])
74
+ .index("by_scope_type", ["accessScopeId", "type"])
75
+ .index("by_scope_status", ["accessScopeId", "status"])
76
+ .index("by_scope_status_type", ["accessScopeId", "status", "type"]),
77
+ principal_memberships: defineTable({
78
+ accessScopeId: v.string(),
79
+ groupPrincipalId: v.string(),
80
+ memberPrincipalId: v.string(),
81
+ updatedAt: v.number(),
82
+ })
83
+ .index("by_scope", ["accessScopeId"])
84
+ .index("by_group", ["accessScopeId", "groupPrincipalId"])
85
+ .index("by_member", ["accessScopeId", "memberPrincipalId"])
86
+ .index("by_group_member", ["accessScopeId", "groupPrincipalId", "memberPrincipalId"]),
87
+ // Unified role table holding BOTH deployment-wide catalog roles (source
88
+ // system|iam, accessScopeId undefined) and per-scope tenant roles (source
89
+ // tenant, accessScopeId set). `baseWildcard` is the role's INTRINSIC wildcard
90
+ // mode (Owner=immutable, Admin=default, everything else=none). The EFFECTIVE
91
+ // wildcard is DERIVED per scope at evaluation time (base role-permissions
92
+ // UNION that scope's overrides) — never stored here.
93
+ roles: defineTable({
94
+ roleId: v.string(),
95
+ key: v.string(),
96
+ source: v.union(v.literal("system"), v.literal("iam"), v.literal("tenant")),
97
+ name: v.string(),
98
+ baseWildcard: wildcardValidator,
99
+ // Undefined for catalog (reusable) roles; the owning org/suite scope for
100
+ // tenant roles. Catalog roles are NEVER per-scope duplicated.
101
+ accessScopeId: v.optional(v.string()),
102
+ updatedAt: v.number(),
103
+ })
104
+ .index("by_role_id", ["roleId"])
105
+ .index("by_scope", ["accessScopeId"])
106
+ .index("by_scope_key", ["accessScopeId", "key"])
107
+ .index("by_source", ["source"]),
108
+ // Deployment-owned permission catalog (ProjectionCatalogPermission). Lives at
109
+ // the top level (no per-scope duplication). `accessScopeId` is retained and
110
+ // pinned to the default scope id so the existing default-scope lookups
111
+ // (by_scope / by_scope_key) keep working without re-plumbing every reader.
112
+ permissions: defineTable({
113
+ accessScopeId: v.string(),
114
+ permissionId: v.string(),
115
+ key: v.string(),
116
+ resourceType: v.string(),
117
+ action: v.string(),
118
+ classification: v.union(v.literal("delegable"), v.literal("owner_only")),
119
+ // tenantAssignable=false hides this permission from org-admin role editors.
120
+ tenantAssignable: v.boolean(),
121
+ updatedAt: v.number(),
122
+ })
123
+ .index("by_permission_id", ["permissionId"])
124
+ .index("by_scope", ["accessScopeId"])
125
+ .index("by_scope_key", ["accessScopeId", "key"])
126
+ .index("by_scope_resource_action", ["accessScopeId", "resourceType", "action"]),
127
+ // BASE role->permission map (deployment-wide; the catalog definition).
128
+ // Identity is (roleId, permissionId) — effect is MUTABLE and is NOT part of
129
+ // the identity (an allow<->deny flip is an upsert of the same row).
130
+ role_permissions: defineTable({
131
+ roleId: v.string(),
132
+ permissionId: v.string(),
133
+ effect: effectValidator,
134
+ updatedAt: v.number(),
135
+ })
136
+ .index("by_role", ["roleId"])
137
+ .index("by_permission", ["permissionId"])
138
+ .index("by_role_permission", ["roleId", "permissionId"]),
139
+ // One scope's override of a reusable role's base mapping. Identity is
140
+ // (accessScopeId, roleId, permissionId); effect is mutable (not in identity).
141
+ // Layered over the base map during evaluation.
142
+ role_permission_overrides: defineTable({
143
+ accessScopeId: v.string(),
144
+ roleId: v.string(),
145
+ permissionId: v.string(),
146
+ effect: effectValidator,
147
+ updatedAt: v.number(),
148
+ })
149
+ .index("by_scope", ["accessScopeId"])
150
+ .index("by_scope_role", ["accessScopeId", "roleId"])
151
+ .index("by_permission", ["permissionId"])
152
+ .index("by_role", ["roleId"])
153
+ .index("by_scope_role_permission", ["accessScopeId", "roleId", "permissionId"]),
154
+ // Role assigned to a principal (the role half of the old `grants`). The
155
+ // (resourceType, resourceId) target tuple replaces the old object addressing:
156
+ // (undefined, undefined) = the scope, (type, undefined) = every resource of
157
+ // a type, (type, id) = one exact resource.
158
+ role_bindings: defineTable({
159
+ bindingId: v.string(),
160
+ subjectPrincipalId: v.string(),
161
+ roleId: v.string(),
162
+ accessScopeId: v.string(),
163
+ resourceType: v.optional(v.string()),
164
+ resourceId: v.optional(v.string()),
165
+ appliesTo: bindingAppliesToValidator,
166
+ expiresAt: v.optional(v.number()),
167
+ updatedAt: v.number(),
168
+ })
169
+ .index("by_binding_id", ["bindingId"])
170
+ .index("by_scope", ["accessScopeId"])
171
+ // Scope-object role lookup (resourceType undefined): who has which role on a
172
+ // scope. Used by collectGrantContributions + collectPrincipalScopeRoles.
173
+ .index("by_subject_scope_resource", [
174
+ "subjectPrincipalId",
175
+ "accessScopeId",
176
+ "resourceType",
177
+ "resourceId",
178
+ ])
179
+ // Reverse: "who has a direct role binding on this resource" (membership UIs).
180
+ .index("by_scope_resource", ["accessScopeId", "resourceType", "resourceId"])
181
+ .index("by_role", ["roleId"])
182
+ .index("by_subject_principal", ["subjectPrincipalId"]),
183
+ // Direct permission authority (the direct-permission half of the old
184
+ // `grants`). Exactly one subject: subjectPrincipalId XOR subjectRoleId. Same
185
+ // nullable (resourceType, resourceId) target shape as role_bindings.
186
+ permission_bindings: defineTable({
187
+ bindingId: v.string(),
188
+ subjectPrincipalId: v.optional(v.string()),
189
+ subjectRoleId: v.optional(v.string()),
190
+ permissionId: v.string(),
191
+ effect: effectValidator,
192
+ accessScopeId: v.string(),
193
+ resourceType: v.optional(v.string()),
194
+ resourceId: v.optional(v.string()),
195
+ appliesTo: bindingAppliesToValidator,
196
+ expiresAt: v.optional(v.number()),
197
+ updatedAt: v.number(),
198
+ })
199
+ .index("by_binding_id", ["bindingId"])
200
+ .index("by_scope", ["accessScopeId"])
201
+ // Principal-subject scope/resource lookups.
202
+ .index("by_subject_principal_scope_resource", [
203
+ "subjectPrincipalId",
204
+ "accessScopeId",
205
+ "resourceType",
206
+ "resourceId",
207
+ ])
208
+ // Role-subject scope/resource lookups (a rule applying to every holder of a
209
+ // role).
210
+ .index("by_subject_role_scope_resource", [
211
+ "subjectRoleId",
212
+ "accessScopeId",
213
+ "resourceType",
214
+ "resourceId",
215
+ ])
216
+ // Reverse: "who has a direct permission binding on this resource".
217
+ .index("by_scope_resource", ["accessScopeId", "resourceType", "resourceId"])
218
+ .index("by_permission", ["permissionId"])
219
+ .index("by_subject_principal", ["subjectPrincipalId"])
220
+ .index("by_subject_role", ["subjectRoleId"]),
221
+ });
222
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/component/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAElC,mEAAmE;AACnE,EAAE;AACF,sEAAsE;AACtE,+EAA+E;AAC/E,6EAA6E;AAC7E,4EAA4E;AAC5E,6EAA6E;AAC7E,6EAA6E;AAE7E,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;AACvE,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CACvC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EACjB,CAAC,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAClC,CAAC;AACF,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;AACnG,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;AAC/F,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CA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{
2
+ mode?: "initialize" | "reset" | undefined;
3
+ expectedIssuer?: string | undefined;
4
+ catalog?: any;
5
+ users?: any;
6
+ scopes?: any[] | undefined;
7
+ type: "access.projection.snapshot" | "access.projection.event";
8
+ schemaVersion: number;
9
+ eventId: string;
10
+ sourceVersion: number;
11
+ }, Promise<{
12
+ ok: false;
13
+ status: "unsupported_schema";
14
+ acknowledgedVersion?: undefined;
15
+ currentVersion?: undefined;
16
+ expectedVersion?: undefined;
17
+ receivedVersion?: undefined;
18
+ } | {
19
+ ok: false;
20
+ status: "default_scope_required";
21
+ acknowledgedVersion?: undefined;
22
+ currentVersion?: undefined;
23
+ expectedVersion?: undefined;
24
+ receivedVersion?: undefined;
25
+ } | {
26
+ ok: false;
27
+ status: "invalid_payload";
28
+ acknowledgedVersion?: undefined;
29
+ currentVersion?: undefined;
30
+ expectedVersion?: undefined;
31
+ receivedVersion?: undefined;
32
+ } | {
33
+ ok: true;
34
+ status: "duplicate";
35
+ acknowledgedVersion: number;
36
+ currentVersion?: undefined;
37
+ expectedVersion?: undefined;
38
+ receivedVersion?: undefined;
39
+ } | {
40
+ ok: false;
41
+ status: "not_ready";
42
+ currentVersion: number;
43
+ acknowledgedVersion?: undefined;
44
+ expectedVersion?: undefined;
45
+ receivedVersion?: undefined;
46
+ } | {
47
+ ok: false;
48
+ status: "version_gap";
49
+ currentVersion: number;
50
+ expectedVersion: number;
51
+ receivedVersion: number;
52
+ acknowledgedVersion?: undefined;
53
+ } | {
54
+ ok: false;
55
+ status: "reset_required";
56
+ currentVersion: number;
57
+ acknowledgedVersion?: undefined;
58
+ expectedVersion?: undefined;
59
+ receivedVersion?: undefined;
60
+ } | {
61
+ ok: false;
62
+ status: "issuer_mismatch";
63
+ acknowledgedVersion?: undefined;
64
+ currentVersion?: undefined;
65
+ expectedVersion?: undefined;
66
+ receivedVersion?: undefined;
67
+ } | {
68
+ ok: true;
69
+ status: "applied";
70
+ acknowledgedVersion: number;
71
+ currentVersion?: undefined;
72
+ expectedVersion?: undefined;
73
+ receivedVersion?: undefined;
74
+ }>>;
75
+ export declare const expireRoleBinding: import("convex/server").RegisteredMutation<"internal", {
76
+ updatedAt: number;
77
+ bindingId: string;
78
+ expiresAt: number;
79
+ }, Promise<void>>;
80
+ export declare const expirePermissionBinding: import("convex/server").RegisteredMutation<"internal", {
81
+ updatedAt: number;
82
+ bindingId: string;
83
+ expiresAt: number;
84
+ }, Promise<void>>;
85
+ //# sourceMappingURL=sync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/component/sync.ts"],"names":[],"mappings":"AAqEA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAy4BpB,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;iBAgB5B,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;iBAgBlC,CAAC"}