@tearleads/client-sdk 0.1.38 → 0.1.40

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 (76) hide show
  1. package/client/Tearleads.d.ts +3 -0
  2. package/client/Tearleads.js +20 -12
  3. package/client/Tearleads.js.map +1 -1
  4. package/client/organizations/organizationGroupPresentation.d.ts +1 -12
  5. package/client/session/index.js +2 -2
  6. package/client/session/index.js.map +1 -1
  7. package/client/session/sessionOrganizationCreation.js +1 -0
  8. package/client/session/sessionOrganizationCreation.js.map +1 -1
  9. package/client/session/sessionTypes.d.ts +3 -0
  10. package/client/session/sessionTypes.js.map +1 -1
  11. package/client/workflowRuntime.d.ts +2 -0
  12. package/client/workflowRuntime.js +34 -16
  13. package/client/workflowRuntime.js.map +1 -1
  14. package/data/persistence/documents/documentDiscoveryEvidencePersistence.d.ts +16 -0
  15. package/data/persistence/documents/documentDiscoveryEvidencePersistence.js +23 -0
  16. package/data/persistence/documents/documentDiscoveryEvidencePersistence.js.map +1 -1
  17. package/data/persistence/organizations/organizationReadModelGrantPersistence.js +2 -1
  18. package/data/persistence/organizations/organizationReadModelGrantPersistence.js.map +1 -1
  19. package/data/persistence/organizations/organizationReadModelMemberLoad.d.ts +9 -0
  20. package/data/persistence/organizations/organizationReadModelMemberLoad.js +29 -21
  21. package/data/persistence/organizations/organizationReadModelMemberLoad.js.map +1 -1
  22. package/data/persistence/organizations/organizationReadModelMembershipPersistence.js +91 -46
  23. package/data/persistence/organizations/organizationReadModelMembershipPersistence.js.map +1 -1
  24. package/data/persistence/organizations/organizationReadModelPersistence.js +95 -73
  25. package/data/persistence/organizations/organizationReadModelPersistence.js.map +1 -1
  26. package/data/persistence/organizations/organizationReadModelProjection.js +78 -89
  27. package/data/persistence/organizations/organizationReadModelProjection.js.map +1 -1
  28. package/data/persistence/organizations/organizationReadModelPurge.js +14 -15
  29. package/data/persistence/organizations/organizationReadModelPurge.js.map +1 -1
  30. package/data/sqlite/organizationReadModelSchema.js +23 -28
  31. package/data/sqlite/organizationReadModelSchema.js.map +1 -1
  32. package/data/sqlite/organizationReadModelTableRegistry.d.ts +116 -263
  33. package/data/sqlite/organizationReadModelTableRegistry.js +10 -7
  34. package/data/sqlite/organizationReadModelTableRegistry.js.map +1 -1
  35. package/data/sqlite/schema.d.ts +116 -263
  36. package/data/sqlite/sqliteBindBudget.js +30 -0
  37. package/data/sqlite/sqliteBindBudget.js.map +1 -0
  38. package/data/trustedUserIdentity/index.d.ts +1 -1
  39. package/data/trustedUserIdentity/index.js +1 -1
  40. package/data/trustedUserIdentity/index.js.map +1 -1
  41. package/data/trustedUserIdentity/service.d.ts +12 -1
  42. package/data/trustedUserIdentity/service.js +27 -3
  43. package/data/trustedUserIdentity/service.js.map +1 -1
  44. package/internal/validators/operation/organizations.d.ts +0 -16
  45. package/internal/validators/response/index.d.ts +1 -1
  46. package/internal/validators/response/index.js.map +1 -1
  47. package/internal/validators/response/organizationReadModel.d.ts +10 -48
  48. package/internal/validators/response/organizationReadModel.js +9 -1
  49. package/internal/validators/response/organizationReadModel.js.map +1 -1
  50. package/package.json +1 -1
  51. package/workflows/organizations/createOrganization.d.ts +3 -0
  52. package/workflows/organizations/createOrganization.js +1 -0
  53. package/workflows/organizations/createOrganization.js.map +1 -1
  54. package/workflows/organizations/readModel.d.ts +8 -3
  55. package/workflows/organizations/readModel.js.map +1 -1
  56. package/workflows/organizations/readModelProjection.d.ts +2 -12
  57. package/workflows/organizations/readModelProjection.js +1 -1
  58. package/workflows/organizations/readModelProjection.js.map +1 -1
  59. package/workflows/registration/organizationProvisioningPersistence.d.ts +3 -0
  60. package/workflows/registration/organizationProvisioningPersistence.js +27 -1
  61. package/workflows/registration/organizationProvisioningPersistence.js.map +1 -1
  62. package/workflows/registration/persistRegistrationBootstrap.d.ts +3 -0
  63. package/workflows/registration/persistRegistrationBootstrap.js +7 -1
  64. package/workflows/registration/persistRegistrationBootstrap.js.map +1 -1
  65. package/workflows/registration/provisionedPrincipalHistory.d.ts +45 -0
  66. package/workflows/registration/provisionedPrincipalHistory.js +104 -0
  67. package/workflows/registration/provisionedPrincipalHistory.js.map +1 -0
  68. package/workflows/registration/provisioningAcknowledgement.js +18 -0
  69. package/workflows/registration/provisioningAcknowledgement.js.map +1 -1
  70. package/workflows/registration/registerIdentity.d.ts +3 -0
  71. package/workflows/registration/registerIdentity.js +1 -0
  72. package/workflows/registration/registerIdentity.js.map +1 -1
  73. package/workflows/sync/remoteReset.js +1 -3
  74. package/workflows/sync/remoteReset.js.map +1 -1
  75. package/data/persistence/organizations/organizationReadModelPolicyHeadPersistence.js +0 -64
  76. package/data/persistence/organizations/organizationReadModelPolicyHeadPersistence.js.map +0 -1
@@ -1,10 +1,20 @@
1
1
  import { integer, primaryKey, sqliteTable, text, } from "drizzle-orm/sqlite-core";
2
- /** Cursor and lane-level fields for one locally projected organization. */
2
+ /**
3
+ * Cursor and lane-level fields for one locally projected organization: the
4
+ * exact organization policy head, and the state hash of the reserved Members
5
+ * group's membership head, which the group catalog does not list.
6
+ */
3
7
  export const organizationReadModelState = sqliteTable("organization_read_model_state", {
4
8
  organizationId: text("organization_id").notNull(),
5
9
  cursor: text("cursor").notNull(),
6
10
  profileDocumentId: text("profile_document_id"),
7
11
  memberGroupId: text("member_group_id").notNull(),
12
+ memberGroupStateHash: text("member_group_state_hash").notNull(),
13
+ organizationStateHash: text("organization_state_hash").notNull(),
14
+ organizationStateVersion: integer("organization_state_version").notNull(),
15
+ organizationKeyEpoch: integer("organization_key_epoch").notNull(),
16
+ organizationKeyFingerprint: text("organization_key_fingerprint").notNull(),
17
+ organizationMemberCount: integer("organization_member_count").notNull(),
8
18
  updatedAt: text("updated_at").notNull(),
9
19
  }, (table) => [primaryKey({ columns: [table.organizationId] })]);
10
20
  /** Requester-scoped fields that must not become organization-global state. */
@@ -34,7 +44,12 @@ export const organizationReadModelDirectoryUsers = sqliteTable("organization_rea
34
44
  disabledAt: text("disabled_at"),
35
45
  disabledByUserId: text("disabled_by_user_id"),
36
46
  }, (table) => [primaryKey({ columns: [table.organizationId, table.userId] })]);
37
- /** Normalized organization group summaries and their current state heads. */
47
+ /**
48
+ * Normalized visible organization group summaries. The state columns are the
49
+ * group's exact policy head, all null for a stateless group.
50
+ * `members_state_hash` is the state hash of the membership head delivered for
51
+ * the group, null until the groupMemberships lane covers it.
52
+ */
38
53
  export const organizationReadModelGroups = sqliteTable("organization_read_model_groups", {
39
54
  organizationId: text("organization_id").notNull(),
40
55
  groupId: text("group_id").notNull(),
@@ -45,30 +60,14 @@ export const organizationReadModelGroups = sqliteTable("organization_read_model_
45
60
  stateHash: text("state_hash"),
46
61
  stateVersion: integer("state_version"),
47
62
  keyEpoch: integer("key_epoch"),
63
+ keyFingerprint: text("key_fingerprint"),
48
64
  memberCount: integer("member_count"),
65
+ membersStateHash: text("members_state_hash"),
49
66
  }, (table) => [primaryKey({ columns: [table.organizationId, table.groupId] })]);
50
- /** Exact policy-state heads used to bind locally projected cryptographic data. */
51
- export const organizationReadModelPolicyHeads = sqliteTable("organization_read_model_policy_heads", {
52
- organizationId: text("organization_id").notNull(),
53
- principalType: text("principal_type").notNull(),
54
- principalId: text("principal_id").notNull(),
55
- stateHash: text("state_hash").notNull(),
56
- stateVersion: integer("state_version").notNull(),
57
- keyEpoch: integer("key_epoch").notNull(),
58
- keyFingerprint: text("key_fingerprint").notNull(),
59
- memberCount: integer("member_count").notNull(),
60
- }, (table) => [
61
- primaryKey({
62
- columns: [table.organizationId, table.principalType, table.principalId],
63
- }),
64
- ]);
65
- /** State-hash-bound completeness rows for each projected group membership. */
66
- export const organizationReadModelGroupMemberships = sqliteTable("organization_read_model_group_memberships", {
67
- organizationId: text("organization_id").notNull(),
68
- groupId: text("group_id").notNull(),
69
- stateHash: text("state_hash").notNull(),
70
- }, (table) => [primaryKey({ columns: [table.organizationId, table.groupId] })]);
71
- /** Direct users bound to the exact state in the membership completeness row. */
67
+ /**
68
+ * Direct users bound to the exact state of their group's membership head.
69
+ * Public keys are not repeated here; the directory lane holds them per user.
70
+ */
72
71
  export const organizationReadModelGroupMembers = sqliteTable("organization_read_model_group_members", {
73
72
  organizationId: text("organization_id").notNull(),
74
73
  groupId: text("group_id").notNull(),
@@ -76,10 +75,6 @@ export const organizationReadModelGroupMembers = sqliteTable("organization_read_
76
75
  sortOrder: integer("sort_order").notNull(),
77
76
  stateHash: text("state_hash").notNull(),
78
77
  role: text("role").notNull(),
79
- signingKeyFingerprint: text("signing_key_fingerprint"),
80
- signingPublicKey: text("signing_public_key"),
81
- encapsulationPublicKey: text("encapsulation_public_key"),
82
- encapsulationKeyFingerprint: text("encapsulation_key_fingerprint"),
83
78
  }, (table) => [
84
79
  primaryKey({
85
80
  columns: [table.organizationId, table.groupId, table.userId],
@@ -1 +1 @@
1
- {"version":3,"file":"organizationReadModelSchema.js","sourceRoot":"","sources":["organizationReadModelSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,UAAU,EACV,WAAW,EACX,IAAI,GACL,MAAM,yBAAyB,CAAC;AAEjC,2EAA2E;AAC3E,MAAM,CAAC,MAAM,0BAA0B,GAAG,WAAW,CACnD,+BAA+B,EAC/B;IACE,cAAc,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC,OAAO,EAAE;IACjD,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE;IAChC,iBAAiB,EAAE,IAAI,CAAC,qBAAqB,CAAC;IAC9C,aAAa,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC,OAAO,EAAE;IAChD,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;CACxC,EACD,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAC7D,CAAC;AAEF,8EAA8E;AAC9E,MAAM,CAAC,MAAM,+BAA+B,GAAG,WAAW,CACxD,oCAA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AAW;YACjB,KAAK,CAAC,SAAS;SAChB;KACF,CAAC;CACH,CACF,CAAC","sourcesContent":["import {\n integer,\n primaryKey,\n sqliteTable,\n text,\n} from \"drizzle-orm/sqlite-core\";\n\n/** Cursor and lane-level fields for one locally projected organization. */\nexport const organizationReadModelState = sqliteTable(\n \"organization_read_model_state\",\n {\n organizationId: text(\"organization_id\").notNull(),\n cursor: text(\"cursor\").notNull(),\n profileDocumentId: text(\"profile_document_id\"),\n memberGroupId: text(\"member_group_id\").notNull(),\n updatedAt: text(\"updated_at\").notNull(),\n },\n (table) => [primaryKey({ columns: [table.organizationId] })],\n);\n\n/** Requester-scoped fields that must not become organization-global state. */\nexport const organizationReadModelRequesters = sqliteTable(\n \"organization_read_model_requesters\",\n {\n organizationId: text(\"organization_id\").notNull(),\n userId: text(\"user_id\").notNull(),\n isOrgAdmin: integer(\"is_org_admin\", { mode: \"boolean\" }).notNull(),\n updatedAt: text(\"updated_at\").notNull(),\n },\n (table) => [primaryKey({ columns: [table.organizationId, table.userId] })],\n);\n\n/** Normalized organization directory rows. `isSelf` is derived at read time. */\nexport const organizationReadModelDirectoryUsers = sqliteTable(\n \"organization_read_model_directory_users\",\n {\n organizationId: text(\"organization_id\").notNull(),\n userId: text(\"user_id\").notNull(),\n sortOrder: integer(\"sort_order\").notNull(),\n signingKeyFingerprint: text(\"signing_key_fingerprint\").notNull(),\n signingPublicKey: text(\"signing_public_key\").notNull(),\n encapsulationPublicKey: text(\"encapsulation_public_key\").notNull(),\n encapsulationKeyFingerprint: text(\n \"encapsulation_key_fingerprint\",\n ).notNull(),\n isPersonalOrganizationOwner: integer(\"is_personal_organization_owner\", {\n mode: \"boolean\",\n }).notNull(),\n createdAt: text(\"created_at\").notNull(),\n status: text(\"status\").notNull(),\n profileDocumentId: text(\"profile_document_id\"),\n joinedAt: text(\"joined_at\").notNull(),\n updatedAt: text(\"updated_at\").notNull(),\n disabledAt: text(\"disabled_at\"),\n disabledByUserId: text(\"disabled_by_user_id\"),\n },\n (table) => [primaryKey({ columns: [table.organizationId, table.userId] })],\n);\n\n/** Normalized organization group summaries and their current state heads. */\nexport const organizationReadModelGroups = sqliteTable(\n \"organization_read_model_groups\",\n {\n organizationId: text(\"organization_id\").notNull(),\n groupId: text(\"group_id\").notNull(),\n sortOrder: integer(\"sort_order\").notNull(),\n name: text(\"name\").notNull(),\n createdAt: text(\"created_at\").notNull(),\n isBuiltin: integer(\"is_builtin\", { mode: \"boolean\" }).notNull(),\n stateHash: text(\"state_hash\"),\n stateVersion: integer(\"state_version\"),\n keyEpoch: integer(\"key_epoch\"),\n memberCount: integer(\"member_count\"),\n },\n (table) => [primaryKey({ columns: [table.organizationId, table.groupId] })],\n);\n\n/** Exact policy-state heads used to bind locally projected cryptographic data. */\nexport const organizationReadModelPolicyHeads = sqliteTable(\n \"organization_read_model_policy_heads\",\n {\n organizationId: text(\"organization_id\").notNull(),\n principalType: text(\"principal_type\").notNull(),\n principalId: text(\"principal_id\").notNull(),\n stateHash: text(\"state_hash\").notNull(),\n stateVersion: integer(\"state_version\").notNull(),\n keyEpoch: integer(\"key_epoch\").notNull(),\n keyFingerprint: text(\"key_fingerprint\").notNull(),\n memberCount: integer(\"member_count\").notNull(),\n },\n (table) => [\n primaryKey({\n columns: [table.organizationId, table.principalType, table.principalId],\n }),\n ],\n);\n\n/** State-hash-bound completeness rows for each projected group membership. */\nexport const organizationReadModelGroupMemberships = sqliteTable(\n \"organization_read_model_group_memberships\",\n {\n organizationId: text(\"organization_id\").notNull(),\n groupId: text(\"group_id\").notNull(),\n stateHash: text(\"state_hash\").notNull(),\n },\n (table) => [primaryKey({ columns: [table.organizationId, table.groupId] })],\n);\n\n/** Direct users bound to the exact state in the membership completeness row. */\nexport const organizationReadModelGroupMembers = sqliteTable(\n \"organization_read_model_group_members\",\n {\n organizationId: text(\"organization_id\").notNull(),\n groupId: text(\"group_id\").notNull(),\n userId: text(\"user_id\").notNull(),\n sortOrder: integer(\"sort_order\").notNull(),\n stateHash: text(\"state_hash\").notNull(),\n role: text(\"role\").notNull(),\n signingKeyFingerprint: text(\"signing_key_fingerprint\"),\n signingPublicKey: text(\"signing_public_key\"),\n encapsulationPublicKey: text(\"encapsulation_public_key\"),\n encapsulationKeyFingerprint: text(\"encapsulation_key_fingerprint\"),\n },\n (table) => [\n primaryKey({\n columns: [table.organizationId, table.groupId, table.userId],\n }),\n ],\n);\n\n/**\n * Durable record of a server 403/404 for one requester's presentation\n * projection. Written before the revoked rows are purged so a purge failure\n * followed by an offline restart cannot serve the revoked projection; cleared\n * only by a successful authoritative reconcile for the same scope.\n */\nexport const organizationPresentationDenials = sqliteTable(\n \"organization_presentation_denials\",\n {\n organizationId: text(\"organization_id\").notNull(),\n requesterUserId: text(\"requester_user_id\").notNull(),\n projection: text(\"projection\").notNull(),\n deniedAt: text(\"denied_at\").notNull(),\n },\n (table) => [\n primaryKey({\n columns: [table.organizationId, table.requesterUserId, table.projection],\n }),\n ],\n);\n\n/** Whole-lane container grants used only by organization presentation reads. */\nexport const organizationReadModelContainerGrants = sqliteTable(\n \"organization_read_model_container_grants\",\n {\n organizationId: text(\"organization_id\").notNull(),\n containerId: text(\"container_id\").notNull(),\n subjectType: text(\"subject_type\").notNull(),\n subjectId: text(\"subject_id\").notNull(),\n sortOrder: integer(\"sort_order\").notNull(),\n accessLevel: text(\"access_level\").notNull(),\n createdAt: text(\"created_at\").notNull(),\n depth: integer(\"depth\").notNull(),\n isBuiltin: integer(\"is_builtin\", { mode: \"boolean\" }).notNull(),\n metadataAccessEpoch: integer(\"metadata_access_epoch\").notNull(),\n metadataAccessStateHash: text(\"metadata_access_state_hash\").notNull(),\n metadataDocumentId: text(\"metadata_document_id\"),\n parentId: text(\"parent_id\"),\n updatedAt: text(\"updated_at\").notNull(),\n userId: text(\"user_id\"),\n signingKeyFingerprint: text(\"signing_key_fingerprint\"),\n groupId: text(\"group_id\"),\n },\n (table) => [\n primaryKey({\n columns: [\n table.organizationId,\n table.containerId,\n table.subjectType,\n table.subject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drizzle-orm/sqlite-core\";\n\n/**\n * Cursor and lane-level fields for one locally projected organization: the\n * exact organization policy head, and the state hash of the reserved Members\n * group's membership head, which the group catalog does not list.\n */\nexport const organizationReadModelState = sqliteTable(\n \"organization_read_model_state\",\n {\n organizationId: text(\"organization_id\").notNull(),\n cursor: text(\"cursor\").notNull(),\n profileDocumentId: text(\"profile_document_id\"),\n memberGroupId: text(\"member_group_id\").notNull(),\n memberGroupStateHash: text(\"member_group_state_hash\").notNull(),\n organizationStateHash: text(\"organization_state_hash\").notNull(),\n organizationStateVersion: integer(\"organization_state_version\").notNull(),\n organizationKeyEpoch: integer(\"organization_key_epoch\").notNull(),\n organizationKeyFingerprint: text(\"organization_key_fingerprint\").notNull(),\n organizationMemberCount: integer(\"organization_member_count\").notNull(),\n updatedAt: text(\"updated_at\").notNull(),\n },\n (table) => [primaryKey({ columns: [table.organizationId] })],\n);\n\n/** Requester-scoped fields that must not become organization-global state. */\nexport const organizationReadModelRequesters = sqliteTable(\n \"organization_read_model_requesters\",\n {\n organizationId: text(\"organization_id\").notNull(),\n userId: text(\"user_id\").notNull(),\n isOrgAdmin: integer(\"is_org_admin\", { mode: \"boolean\" }).notNull(),\n updatedAt: text(\"updated_at\").notNull(),\n },\n (table) => [primaryKey({ columns: [table.organizationId, table.userId] })],\n);\n\n/** Normalized organization directory rows. `isSelf` is derived at read time. */\nexport const organizationReadModelDirectoryUsers = sqliteTable(\n \"organization_read_model_directory_users\",\n {\n organizationId: text(\"organization_id\").notNull(),\n userId: text(\"user_id\").notNull(),\n sortOrder: integer(\"sort_order\").notNull(),\n signingKeyFingerprint: text(\"signing_key_fingerprint\").notNull(),\n signingPublicKey: text(\"signing_public_key\").notNull(),\n encapsulationPublicKey: text(\"encapsulation_public_key\").notNull(),\n encapsulationKeyFingerprint: text(\n \"encapsulation_key_fingerprint\",\n ).notNull(),\n isPersonalOrganizationOwner: integer(\"is_personal_organization_owner\", {\n mode: \"boolean\",\n }).notNull(),\n createdAt: text(\"created_at\").notNull(),\n status: text(\"status\").notNull(),\n profileDocumentId: text(\"profile_document_id\"),\n joinedAt: text(\"joined_at\").notNull(),\n updatedAt: text(\"updated_at\").notNull(),\n disabledAt: text(\"disabled_at\"),\n disabledByUserId: text(\"disabled_by_user_id\"),\n },\n (table) => [primaryKey({ columns: [table.organizationId, table.userId] })],\n);\n\n/**\n * Normalized visible organization group summaries. The state columns are the\n * group's exact policy head, all null for a stateless group.\n * `members_state_hash` is the state hash of the membership head delivered for\n * the group, null until the groupMemberships lane covers it.\n */\nexport const organizationReadModelGroups = sqliteTable(\n \"organization_read_model_groups\",\n {\n organizationId: text(\"organization_id\").notNull(),\n groupId: text(\"group_id\").notNull(),\n sortOrder: integer(\"sort_order\").notNull(),\n name: text(\"name\").notNull(),\n createdAt: text(\"created_at\").notNull(),\n isBuiltin: integer(\"is_builtin\", { mode: \"boolean\" }).notNull(),\n stateHash: text(\"state_hash\"),\n stateVersion: integer(\"state_version\"),\n keyEpoch: integer(\"key_epoch\"),\n keyFingerprint: text(\"key_fingerprint\"),\n memberCount: integer(\"member_count\"),\n membersStateHash: text(\"members_state_hash\"),\n },\n (table) => [primaryKey({ columns: [table.organizationId, table.groupId] })],\n);\n\n/**\n * Direct users bound to the exact state of their group's membership head.\n * Public keys are not repeated here; the directory lane holds them per user.\n */\nexport const organizationReadModelGroupMembers = sqliteTable(\n \"organization_read_model_group_members\",\n {\n organizationId: text(\"organization_id\").notNull(),\n groupId: text(\"group_id\").notNull(),\n userId: text(\"user_id\").notNull(),\n sortOrder: integer(\"sort_order\").notNull(),\n stateHash: text(\"state_hash\").notNull(),\n role: text(\"role\").notNull(),\n },\n (table) => [\n primaryKey({\n columns: [table.organizationId, table.groupId, table.userId],\n }),\n ],\n);\n\n/**\n * Durable record of a server 403/404 for one requester's presentation\n * projection. Written before the revoked rows are purged so a purge failure\n * followed by an offline restart cannot serve the revoked projection; cleared\n * only by a successful authoritative reconcile for the same scope.\n */\nexport const organizationPresentationDenials = sqliteTable(\n \"organization_presentation_denials\",\n {\n organizationId: text(\"organization_id\").notNull(),\n requesterUserId: text(\"requester_user_id\").notNull(),\n projection: text(\"projection\").notNull(),\n deniedAt: text(\"denied_at\").notNull(),\n },\n (table) => [\n primaryKey({\n columns: [table.organizationId, table.requesterUserId, table.projection],\n }),\n ],\n);\n\n/** Whole-lane container grants used only by organization presentation reads. */\nexport const organizationReadModelContainerGrants = sqliteTable(\n \"organization_read_model_container_grants\",\n {\n organizationId: text(\"organization_id\").notNull(),\n containerId: text(\"container_id\").notNull(),\n subjectType: text(\"subject_type\").notNull(),\n subjectId: text(\"subject_id\").notNull(),\n sortOrder: integer(\"sort_order\").notNull(),\n accessLevel: text(\"access_level\").notNull(),\n createdAt: text(\"created_at\").notNull(),\n depth: integer(\"depth\").notNull(),\n isBuiltin: integer(\"is_builtin\", { mode: \"boolean\" }).notNull(),\n metadataAccessEpoch: integer(\"metadata_access_epoch\").notNull(),\n metadataAccessStateHash: text(\"metadata_access_state_hash\").notNull(),\n metadataDocumentId: text(\"metadata_document_id\"),\n parentId: text(\"parent_id\"),\n updatedAt: text(\"updated_at\").notNull(),\n userId: text(\"user_id\"),\n signingKeyFingerprint: text(\"signing_key_fingerprint\"),\n groupId: text(\"group_id\"),\n },\n (table) => [\n primaryKey({\n columns: [\n table.organizationId,\n table.containerId,\n table.subjectType,\n table.subjectId,\n ],\n }),\n ],\n);\n"]}
@@ -81,6 +81,114 @@ export declare const organizationReadModelSQLiteSchema: {
81
81
  }, {}, {
82
82
  length: number | undefined;
83
83
  }>;
84
+ memberGroupStateHash: import("drizzle-orm/sqlite-core").SQLiteColumn<{
85
+ name: "member_group_state_hash";
86
+ tableName: "organization_read_model_state";
87
+ dataType: "string";
88
+ columnType: "SQLiteText";
89
+ data: string;
90
+ driverParam: string;
91
+ notNull: true;
92
+ hasDefault: false;
93
+ isPrimaryKey: false;
94
+ isAutoincrement: false;
95
+ hasRuntimeDefault: false;
96
+ enumValues: [string, ...string[]];
97
+ baseColumn: never;
98
+ identity: undefined;
99
+ generated: undefined;
100
+ }, {}, {
101
+ length: number | undefined;
102
+ }>;
103
+ organizationStateHash: import("drizzle-orm/sqlite-core").SQLiteColumn<{
104
+ name: "organization_state_hash";
105
+ tableName: "organization_read_model_state";
106
+ dataType: "string";
107
+ columnType: "SQLiteText";
108
+ data: string;
109
+ driverParam: string;
110
+ notNull: true;
111
+ hasDefault: false;
112
+ isPrimaryKey: false;
113
+ isAutoincrement: false;
114
+ hasRuntimeDefault: false;
115
+ enumValues: [string, ...string[]];
116
+ baseColumn: never;
117
+ identity: undefined;
118
+ generated: undefined;
119
+ }, {}, {
120
+ length: number | undefined;
121
+ }>;
122
+ organizationStateVersion: import("drizzle-orm/sqlite-core").SQLiteColumn<{
123
+ name: "organization_state_version";
124
+ tableName: "organization_read_model_state";
125
+ dataType: "number";
126
+ columnType: "SQLiteInteger";
127
+ data: number;
128
+ driverParam: number;
129
+ notNull: true;
130
+ hasDefault: false;
131
+ isPrimaryKey: false;
132
+ isAutoincrement: false;
133
+ hasRuntimeDefault: false;
134
+ enumValues: undefined;
135
+ baseColumn: never;
136
+ identity: undefined;
137
+ generated: undefined;
138
+ }, {}, {}>;
139
+ organizationKeyEpoch: import("drizzle-orm/sqlite-core").SQLiteColumn<{
140
+ name: "organization_key_epoch";
141
+ tableName: "organization_read_model_state";
142
+ dataType: "number";
143
+ columnType: "SQLiteInteger";
144
+ data: number;
145
+ driverParam: number;
146
+ notNull: true;
147
+ hasDefault: false;
148
+ isPrimaryKey: false;
149
+ isAutoincrement: false;
150
+ hasRuntimeDefault: false;
151
+ enumValues: undefined;
152
+ baseColumn: never;
153
+ identity: undefined;
154
+ generated: undefined;
155
+ }, {}, {}>;
156
+ organizationKeyFingerprint: import("drizzle-orm/sqlite-core").SQLiteColumn<{
157
+ name: "organization_key_fingerprint";
158
+ tableName: "organization_read_model_state";
159
+ dataType: "string";
160
+ columnType: "SQLiteText";
161
+ data: string;
162
+ driverParam: string;
163
+ notNull: true;
164
+ hasDefault: false;
165
+ isPrimaryKey: false;
166
+ isAutoincrement: false;
167
+ hasRuntimeDefault: false;
168
+ enumValues: [string, ...string[]];
169
+ baseColumn: never;
170
+ identity: undefined;
171
+ generated: undefined;
172
+ }, {}, {
173
+ length: number | undefined;
174
+ }>;
175
+ organizationMemberCount: import("drizzle-orm/sqlite-core").SQLiteColumn<{
176
+ name: "organization_member_count";
177
+ tableName: "organization_read_model_state";
178
+ dataType: "number";
179
+ columnType: "SQLiteInteger";
180
+ data: number;
181
+ driverParam: number;
182
+ notNull: true;
183
+ hasDefault: false;
184
+ isPrimaryKey: false;
185
+ isAutoincrement: false;
186
+ hasRuntimeDefault: false;
187
+ enumValues: undefined;
188
+ baseColumn: never;
189
+ identity: undefined;
190
+ generated: undefined;
191
+ }, {}, {}>;
84
192
  updatedAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
85
193
  name: "updated_at";
86
194
  tableName: "organization_read_model_state";
@@ -639,148 +747,14 @@ export declare const organizationReadModelSQLiteSchema: {
639
747
  identity: undefined;
640
748
  generated: undefined;
641
749
  }, {}, {}>;
642
- memberCount: import("drizzle-orm/sqlite-core").SQLiteColumn<{
643
- name: "member_count";
644
- tableName: "organization_read_model_groups";
645
- dataType: "number";
646
- columnType: "SQLiteInteger";
647
- data: number;
648
- driverParam: number;
649
- notNull: false;
650
- hasDefault: false;
651
- isPrimaryKey: false;
652
- isAutoincrement: false;
653
- hasRuntimeDefault: false;
654
- enumValues: undefined;
655
- baseColumn: never;
656
- identity: undefined;
657
- generated: undefined;
658
- }, {}, {}>;
659
- };
660
- dialect: "sqlite";
661
- }>;
662
- organizationReadModelPolicyHeads: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
663
- name: "organization_read_model_policy_heads";
664
- schema: undefined;
665
- columns: {
666
- organizationId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
667
- name: "organization_id";
668
- tableName: "organization_read_model_policy_heads";
669
- dataType: "string";
670
- columnType: "SQLiteText";
671
- data: string;
672
- driverParam: string;
673
- notNull: true;
674
- hasDefault: false;
675
- isPrimaryKey: false;
676
- isAutoincrement: false;
677
- hasRuntimeDefault: false;
678
- enumValues: [string, ...string[]];
679
- baseColumn: never;
680
- identity: undefined;
681
- generated: undefined;
682
- }, {}, {
683
- length: number | undefined;
684
- }>;
685
- principalType: import("drizzle-orm/sqlite-core").SQLiteColumn<{
686
- name: "principal_type";
687
- tableName: "organization_read_model_policy_heads";
688
- dataType: "string";
689
- columnType: "SQLiteText";
690
- data: string;
691
- driverParam: string;
692
- notNull: true;
693
- hasDefault: false;
694
- isPrimaryKey: false;
695
- isAutoincrement: false;
696
- hasRuntimeDefault: false;
697
- enumValues: [string, ...string[]];
698
- baseColumn: never;
699
- identity: undefined;
700
- generated: undefined;
701
- }, {}, {
702
- length: number | undefined;
703
- }>;
704
- principalId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
705
- name: "principal_id";
706
- tableName: "organization_read_model_policy_heads";
707
- dataType: "string";
708
- columnType: "SQLiteText";
709
- data: string;
710
- driverParam: string;
711
- notNull: true;
712
- hasDefault: false;
713
- isPrimaryKey: false;
714
- isAutoincrement: false;
715
- hasRuntimeDefault: false;
716
- enumValues: [string, ...string[]];
717
- baseColumn: never;
718
- identity: undefined;
719
- generated: undefined;
720
- }, {}, {
721
- length: number | undefined;
722
- }>;
723
- stateHash: import("drizzle-orm/sqlite-core").SQLiteColumn<{
724
- name: "state_hash";
725
- tableName: "organization_read_model_policy_heads";
726
- dataType: "string";
727
- columnType: "SQLiteText";
728
- data: string;
729
- driverParam: string;
730
- notNull: true;
731
- hasDefault: false;
732
- isPrimaryKey: false;
733
- isAutoincrement: false;
734
- hasRuntimeDefault: false;
735
- enumValues: [string, ...string[]];
736
- baseColumn: never;
737
- identity: undefined;
738
- generated: undefined;
739
- }, {}, {
740
- length: number | undefined;
741
- }>;
742
- stateVersion: import("drizzle-orm/sqlite-core").SQLiteColumn<{
743
- name: "state_version";
744
- tableName: "organization_read_model_policy_heads";
745
- dataType: "number";
746
- columnType: "SQLiteInteger";
747
- data: number;
748
- driverParam: number;
749
- notNull: true;
750
- hasDefault: false;
751
- isPrimaryKey: false;
752
- isAutoincrement: false;
753
- hasRuntimeDefault: false;
754
- enumValues: undefined;
755
- baseColumn: never;
756
- identity: undefined;
757
- generated: undefined;
758
- }, {}, {}>;
759
- keyEpoch: import("drizzle-orm/sqlite-core").SQLiteColumn<{
760
- name: "key_epoch";
761
- tableName: "organization_read_model_policy_heads";
762
- dataType: "number";
763
- columnType: "SQLiteInteger";
764
- data: number;
765
- driverParam: number;
766
- notNull: true;
767
- hasDefault: false;
768
- isPrimaryKey: false;
769
- isAutoincrement: false;
770
- hasRuntimeDefault: false;
771
- enumValues: undefined;
772
- baseColumn: never;
773
- identity: undefined;
774
- generated: undefined;
775
- }, {}, {}>;
776
750
  keyFingerprint: import("drizzle-orm/sqlite-core").SQLiteColumn<{
777
751
  name: "key_fingerprint";
778
- tableName: "organization_read_model_policy_heads";
752
+ tableName: "organization_read_model_groups";
779
753
  dataType: "string";
780
754
  columnType: "SQLiteText";
781
755
  data: string;
782
756
  driverParam: string;
783
- notNull: true;
757
+ notNull: false;
784
758
  hasDefault: false;
785
759
  isPrimaryKey: false;
786
760
  isAutoincrement: false;
@@ -794,12 +768,12 @@ export declare const organizationReadModelSQLiteSchema: {
794
768
  }>;
795
769
  memberCount: import("drizzle-orm/sqlite-core").SQLiteColumn<{
796
770
  name: "member_count";
797
- tableName: "organization_read_model_policy_heads";
771
+ tableName: "organization_read_model_groups";
798
772
  dataType: "number";
799
773
  columnType: "SQLiteInteger";
800
774
  data: number;
801
775
  driverParam: number;
802
- notNull: true;
776
+ notNull: false;
803
777
  hasDefault: false;
804
778
  isPrimaryKey: false;
805
779
  isAutoincrement: false;
@@ -809,59 +783,14 @@ export declare const organizationReadModelSQLiteSchema: {
809
783
  identity: undefined;
810
784
  generated: undefined;
811
785
  }, {}, {}>;
812
- };
813
- dialect: "sqlite";
814
- }>;
815
- organizationReadModelGroupMemberships: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
816
- name: "organization_read_model_group_memberships";
817
- schema: undefined;
818
- columns: {
819
- organizationId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
820
- name: "organization_id";
821
- tableName: "organization_read_model_group_memberships";
822
- dataType: "string";
823
- columnType: "SQLiteText";
824
- data: string;
825
- driverParam: string;
826
- notNull: true;
827
- hasDefault: false;
828
- isPrimaryKey: false;
829
- isAutoincrement: false;
830
- hasRuntimeDefault: false;
831
- enumValues: [string, ...string[]];
832
- baseColumn: never;
833
- identity: undefined;
834
- generated: undefined;
835
- }, {}, {
836
- length: number | undefined;
837
- }>;
838
- groupId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
839
- name: "group_id";
840
- tableName: "organization_read_model_group_memberships";
841
- dataType: "string";
842
- columnType: "SQLiteText";
843
- data: string;
844
- driverParam: string;
845
- notNull: true;
846
- hasDefault: false;
847
- isPrimaryKey: false;
848
- isAutoincrement: false;
849
- hasRuntimeDefault: false;
850
- enumValues: [string, ...string[]];
851
- baseColumn: never;
852
- identity: undefined;
853
- generated: undefined;
854
- }, {}, {
855
- length: number | undefined;
856
- }>;
857
- stateHash: import("drizzle-orm/sqlite-core").SQLiteColumn<{
858
- name: "state_hash";
859
- tableName: "organization_read_model_group_memberships";
786
+ membersStateHash: import("drizzle-orm/sqlite-core").SQLiteColumn<{
787
+ name: "members_state_hash";
788
+ tableName: "organization_read_model_groups";
860
789
  dataType: "string";
861
790
  columnType: "SQLiteText";
862
791
  data: string;
863
792
  driverParam: string;
864
- notNull: true;
793
+ notNull: false;
865
794
  hasDefault: false;
866
795
  isPrimaryKey: false;
867
796
  isAutoincrement: false;
@@ -992,82 +921,6 @@ export declare const organizationReadModelSQLiteSchema: {
992
921
  }, {}, {
993
922
  length: number | undefined;
994
923
  }>;
995
- signingKeyFingerprint: import("drizzle-orm/sqlite-core").SQLiteColumn<{
996
- name: "signing_key_fingerprint";
997
- tableName: "organization_read_model_group_members";
998
- dataType: "string";
999
- columnType: "SQLiteText";
1000
- data: string;
1001
- driverParam: string;
1002
- notNull: false;
1003
- hasDefault: false;
1004
- isPrimaryKey: false;
1005
- isAutoincrement: false;
1006
- hasRuntimeDefault: false;
1007
- enumValues: [string, ...string[]];
1008
- baseColumn: never;
1009
- identity: undefined;
1010
- generated: undefined;
1011
- }, {}, {
1012
- length: number | undefined;
1013
- }>;
1014
- signingPublicKey: import("drizzle-orm/sqlite-core").SQLiteColumn<{
1015
- name: "signing_public_key";
1016
- tableName: "organization_read_model_group_members";
1017
- dataType: "string";
1018
- columnType: "SQLiteText";
1019
- data: string;
1020
- driverParam: string;
1021
- notNull: false;
1022
- hasDefault: false;
1023
- isPrimaryKey: false;
1024
- isAutoincrement: false;
1025
- hasRuntimeDefault: false;
1026
- enumValues: [string, ...string[]];
1027
- baseColumn: never;
1028
- identity: undefined;
1029
- generated: undefined;
1030
- }, {}, {
1031
- length: number | undefined;
1032
- }>;
1033
- encapsulationPublicKey: import("drizzle-orm/sqlite-core").SQLiteColumn<{
1034
- name: "encapsulation_public_key";
1035
- tableName: "organization_read_model_group_members";
1036
- dataType: "string";
1037
- columnType: "SQLiteText";
1038
- data: string;
1039
- driverParam: string;
1040
- notNull: false;
1041
- hasDefault: false;
1042
- isPrimaryKey: false;
1043
- isAutoincrement: false;
1044
- hasRuntimeDefault: false;
1045
- enumValues: [string, ...string[]];
1046
- baseColumn: never;
1047
- identity: undefined;
1048
- generated: undefined;
1049
- }, {}, {
1050
- length: number | undefined;
1051
- }>;
1052
- encapsulationKeyFingerprint: import("drizzle-orm/sqlite-core").SQLiteColumn<{
1053
- name: "encapsulation_key_fingerprint";
1054
- tableName: "organization_read_model_group_members";
1055
- dataType: "string";
1056
- columnType: "SQLiteText";
1057
- data: string;
1058
- driverParam: string;
1059
- notNull: false;
1060
- hasDefault: false;
1061
- isPrimaryKey: false;
1062
- isAutoincrement: false;
1063
- hasRuntimeDefault: false;
1064
- enumValues: [string, ...string[]];
1065
- baseColumn: never;
1066
- identity: undefined;
1067
- generated: undefined;
1068
- }, {}, {
1069
- length: number | undefined;
1070
- }>;
1071
924
  };
1072
925
  dialect: "sqlite";
1073
926
  }>;
@@ -1,15 +1,20 @@
1
- import { organizationPresentationDenials, organizationReadModelContainerGrants, organizationReadModelDirectoryUsers, organizationReadModelGroupMembers, organizationReadModelGroupMemberships, organizationReadModelGroups, organizationReadModelPolicyHeads, organizationReadModelRequesters, organizationReadModelState, } from "./organizationReadModelSchema.js";
1
+ import { organizationPresentationDenials, organizationReadModelContainerGrants, organizationReadModelDirectoryUsers, organizationReadModelGroupMembers, organizationReadModelGroups, organizationReadModelRequesters, organizationReadModelState, } from "./organizationReadModelSchema.js";
2
2
  import { defineSqlTableSchema } from "./sqlTableSchema.js";
3
3
  export const organizationReadModelTables = [
4
- defineSqlTableSchema(organizationReadModelState),
4
+ // Lane heads folded into these rows (#2522); an older local shape must reset.
5
+ {
6
+ ...defineSqlTableSchema(organizationReadModelState),
7
+ requiredColumns: ["member_group_state_hash", "organization_state_hash"],
8
+ },
5
9
  defineSqlTableSchema(organizationReadModelRequesters),
6
10
  {
7
11
  ...defineSqlTableSchema(organizationReadModelDirectoryUsers),
8
12
  requiredColumns: ["is_personal_organization_owner"],
9
13
  },
10
- defineSqlTableSchema(organizationReadModelGroups),
11
- defineSqlTableSchema(organizationReadModelPolicyHeads),
12
- defineSqlTableSchema(organizationReadModelGroupMemberships),
14
+ {
15
+ ...defineSqlTableSchema(organizationReadModelGroups),
16
+ requiredColumns: ["key_fingerprint", "members_state_hash"],
17
+ },
13
18
  defineSqlTableSchema(organizationReadModelGroupMembers),
14
19
  defineSqlTableSchema(organizationReadModelContainerGrants),
15
20
  defineSqlTableSchema(organizationPresentationDenials),
@@ -19,8 +24,6 @@ export const organizationReadModelSQLiteSchema = {
19
24
  organizationReadModelRequesters,
20
25
  organizationReadModelDirectoryUsers,
21
26
  organizationReadModelGroups,
22
- organizationReadModelPolicyHeads,
23
- organizationReadModelGroupMemberships,
24
27
  organizationReadModelGroupMembers,
25
28
  organizationReadModelContainerGrants,
26
29
  organizationPresentationDenials,
@@ -1 +1 @@
1
- {"version":3,"file":"organizationReadModelTableRegistry.js","sourceRoot":"","sources":["organizationReadModelTableRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,EAC/B,oCAAoC,EACpC,mCAAmC,EACnC,iCAAiC,EACjC,qCAAqC,EACrC,2BAA2B,EAC3B,gCAAgC,EAChC,+BAA+B,EAC/B,0BAA0B,GAC3B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAuB,MAAM,kBAAkB,CAAC;AAE7E,MAAM,CAAC,MAAM,2BAA2B,GAAkC;IACxE,oBAAoB,CAAC,0BAA0B,CAAC;IAChD,oBAAoB,CAAC,+BAA+B,CAAC;IACrD;QACE,GAAG,oBAAoB,CAAC,mCAAmC,CAAC;QAC5D,eAAe,EAAE,CAAC,gCAAgC,CAAC;KACpD;IACD,oBAAoB,CAAC,2BAA2B,CAAC;IACjD,oBAAoB,CAAC,gCAAgC,CAAC;IACtD,oBAAoB,CAAC,qCAAqC,CAAC;IAC3D,oBAAoB,CAAC,iCAAiC,CAAC;IACvD,oBAAoB,CAAC,oCAAoC,CAAC;IAC1D,oBAAoB,CAAC,+BAA+B,CAAC;CACtD,CAAC;AAEF,MAAM,CAAC,MAAM,iCAAiC,GAAG;IAC/C,0BAA0B;IAC1B,+BAA+B;IAC/B,mCAAmC;IACnC,2BAA2B;IAC3B,gCAAgC;IAChC,qCAAqC;IACrC,iCAAiC;IACjC,oCAAoC;IACpC,+BAA+B;CAChC,CAAC","sourcesContent":["import {\n organizationPresentationDenials,\n organizationReadModelContainerGrants,\n organizationReadModelDirectoryUsers,\n organizationReadModelGroupMembers,\n organizationReadModelGroupMemberships,\n organizationReadModelGroups,\n organizationReadModelPolicyHeads,\n organizationReadModelRequesters,\n organizationReadModelState,\n} from \"./organizationReadModelSchema\";\nimport { defineSqlTableSchema, type SqlTableSchema } from \"./sqlTableSchema\";\n\nexport const organizationReadModelTables: ReadonlyArray<SqlTableSchema> = [\n defineSqlTableSchema(organizationReadModelState),\n defineSqlTableSchema(organizationReadModelRequesters),\n {\n ...defineSqlTableSchema(organizationReadModelDirectoryUsers),\n requiredColumns: [\"is_personal_organization_owner\"],\n },\n defineSqlTableSchema(organizationReadModelGroups),\n defineSqlTableSchema(organizationReadModelPolicyHeads),\n defineSqlTableSchema(organizationReadModelGroupMemberships),\n defineSqlTableSchema(organizationReadModelGroupMembers),\n defineSqlTableSchema(organizationReadModelContainerGrants),\n defineSqlTableSchema(organizationPresentationDenials),\n];\n\nexport const organizationReadModelSQLiteSchema = {\n organizationReadModelState,\n organizationReadModelRequesters,\n organizationReadModelDirectoryUsers,\n organizationReadModelGroups,\n organizationReadModelPolicyHeads,\n organizationReadModelGroupMemberships,\n organizationReadModelGroupMembers,\n organizationReadModelContainerGrants,\n organizationPresentationDenials,\n};\n"]}
1
+ {"version":3,"file":"organizationReadModelTableRegistry.js","sourceRoot":"","sources":["organizationReadModelTableRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,EAC/B,oCAAoC,EACpC,mCAAmC,EACnC,iCAAiC,EACjC,2BAA2B,EAC3B,+BAA+B,EAC/B,0BAA0B,GAC3B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAuB,MAAM,kBAAkB,CAAC;AAE7E,MAAM,CAAC,MAAM,2BAA2B,GAAkC;IACxE,8EAA8E;IAC9E;QACE,GAAG,oBAAoB,CAAC,0BAA0B,CAAC;QACnD,eAAe,EAAE,CAAC,yBAAyB,EAAE,yBAAyB,CAAC;KACxE;IACD,oBAAoB,CAAC,+BAA+B,CAAC;IACrD;QACE,GAAG,oBAAoB,CAAC,mCAAmC,CAAC;QAC5D,eAAe,EAAE,CAAC,gCAAgC,CAAC;KACpD;IACD;QACE,GAAG,oBAAoB,CAAC,2BAA2B,CAAC;QACpD,eAAe,EAAE,CAAC,iBAAiB,EAAE,oBAAoB,CAAC;KAC3D;IACD,oBAAoB,CAAC,iCAAiC,CAAC;IACvD,oBAAoB,CAAC,oCAAoC,CAAC;IAC1D,oBAAoB,CAAC,+BAA+B,CAAC;CACtD,CAAC;AAEF,MAAM,CAAC,MAAM,iCAAiC,GAAG;IAC/C,0BAA0B;IAC1B,+BAA+B;IAC/B,mCAAmC;IACnC,2BAA2B;IAC3B,iCAAiC;IACjC,oCAAoC;IACpC,+BAA+B;CAChC,CAAC","sourcesContent":["import {\n organizationPresentationDenials,\n organizationReadModelContainerGrants,\n organizationReadModelDirectoryUsers,\n organizationReadModelGroupMembers,\n organizationReadModelGroups,\n organizationReadModelRequesters,\n organizationReadModelState,\n} from \"./organizationReadModelSchema\";\nimport { defineSqlTableSchema, type SqlTableSchema } from \"./sqlTableSchema\";\n\nexport const organizationReadModelTables: ReadonlyArray<SqlTableSchema> = [\n // Lane heads folded into these rows (#2522); an older local shape must reset.\n {\n ...defineSqlTableSchema(organizationReadModelState),\n requiredColumns: [\"member_group_state_hash\", \"organization_state_hash\"],\n },\n defineSqlTableSchema(organizationReadModelRequesters),\n {\n ...defineSqlTableSchema(organizationReadModelDirectoryUsers),\n requiredColumns: [\"is_personal_organization_owner\"],\n },\n {\n ...defineSqlTableSchema(organizationReadModelGroups),\n requiredColumns: [\"key_fingerprint\", \"members_state_hash\"],\n },\n defineSqlTableSchema(organizationReadModelGroupMembers),\n defineSqlTableSchema(organizationReadModelContainerGrants),\n defineSqlTableSchema(organizationPresentationDenials),\n];\n\nexport const organizationReadModelSQLiteSchema = {\n organizationReadModelState,\n organizationReadModelRequesters,\n organizationReadModelDirectoryUsers,\n organizationReadModelGroups,\n organizationReadModelGroupMembers,\n organizationReadModelContainerGrants,\n organizationPresentationDenials,\n};\n"]}