@tearleads/client-sdk 0.1.43 → 0.1.45

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 (189) hide show
  1. package/client/containerDocumentDiscovery.js +71 -29
  2. package/client/containerDocumentDiscovery.js.map +1 -1
  3. package/client/deviceFirst.js +4 -5
  4. package/client/deviceFirst.js.map +1 -1
  5. package/data/persistence/container-contents/containerContentsPersistence.js +2 -3
  6. package/data/persistence/container-contents/containerContentsPersistence.js.map +1 -1
  7. package/data/persistence/container-contents/containerCreateIntentSettlement.js +16 -16
  8. package/data/persistence/container-contents/containerCreateIntentSettlement.js.map +1 -1
  9. package/data/persistence/container-contents/containerDeletionPersistence.js +5 -11
  10. package/data/persistence/container-contents/containerDeletionPersistence.js.map +1 -1
  11. package/data/persistence/container-contents/containerDocumentReassignment.js +13 -13
  12. package/data/persistence/container-contents/containerDocumentReassignment.js.map +1 -1
  13. package/data/persistence/container-contents/containerHydrationPersistence.js +7 -4
  14. package/data/persistence/container-contents/containerHydrationPersistence.js.map +1 -1
  15. package/data/persistence/container-contents/containerIntentPersistence.js +43 -42
  16. package/data/persistence/container-contents/containerIntentPersistence.js.map +1 -1
  17. package/data/persistence/container-contents/containerMetadataMutationPersistence.js +15 -20
  18. package/data/persistence/container-contents/containerMetadataMutationPersistence.js.map +1 -1
  19. package/data/persistence/container-contents/containerMoveAbandonPersistence.js +1 -6
  20. package/data/persistence/container-contents/containerMoveAbandonPersistence.js.map +1 -1
  21. package/data/persistence/container-contents/containerMoveIntentRows.js +9 -8
  22. package/data/persistence/container-contents/containerMoveIntentRows.js.map +1 -1
  23. package/data/persistence/container-contents/containerReconcilePersistence.js +4 -8
  24. package/data/persistence/container-contents/containerReconcilePersistence.js.map +1 -1
  25. package/data/persistence/container-contents/containerRecoveryPersistence.js +20 -19
  26. package/data/persistence/container-contents/containerRecoveryPersistence.js.map +1 -1
  27. package/data/persistence/container-contents/containerRemovalWork.js +10 -10
  28. package/data/persistence/container-contents/containerRemovalWork.js.map +1 -1
  29. package/data/persistence/container-contents/containerStructuralRepair.js +21 -44
  30. package/data/persistence/container-contents/containerStructuralRepair.js.map +1 -1
  31. package/data/persistence/container-contents/documentLinkRemovalRepair.js +12 -11
  32. package/data/persistence/container-contents/documentLinkRemovalRepair.js.map +1 -1
  33. package/data/persistence/container-contents/documentMoveIntentPersistence.js +53 -28
  34. package/data/persistence/container-contents/documentMoveIntentPersistence.js.map +1 -1
  35. package/data/persistence/container-contents/documentPlacementIntentEnqueue.js +9 -8
  36. package/data/persistence/container-contents/documentPlacementIntentEnqueue.js.map +1 -1
  37. package/data/persistence/container-contents/documentPurgePlacement.js +6 -6
  38. package/data/persistence/container-contents/documentPurgePlacement.js.map +1 -1
  39. package/data/persistence/container-contents/dormantContainerMetadata.js +1 -5
  40. package/data/persistence/container-contents/dormantContainerMetadata.js.map +1 -1
  41. package/data/persistence/container-contents/pendingContainerCreate.js +5 -5
  42. package/data/persistence/container-contents/pendingContainerCreate.js.map +1 -1
  43. package/data/persistence/containers/containerPersistence.js +10 -27
  44. package/data/persistence/containers/containerPersistence.js.map +1 -1
  45. package/data/persistence/containers/containerSyncWatermarkPersistence.d.ts +11 -3
  46. package/data/persistence/containers/containerSyncWatermarkPersistence.js +46 -58
  47. package/data/persistence/containers/containerSyncWatermarkPersistence.js.map +1 -1
  48. package/data/persistence/containers/documentContainerProjectionPersistence.js +2 -2
  49. package/data/persistence/containers/documentContainerProjectionPersistence.js.map +1 -1
  50. package/data/persistence/containers/documentPlacement.js +10 -10
  51. package/data/persistence/containers/documentPlacement.js.map +1 -1
  52. package/data/persistence/documents/internal/discardDocument.js +5 -5
  53. package/data/persistence/documents/internal/discardDocument.js.map +1 -1
  54. package/data/persistence/documents/internal/documentDeletionPersistence.js +7 -9
  55. package/data/persistence/documents/internal/documentDeletionPersistence.js.map +1 -1
  56. package/data/persistence/documents/internal/documentMutationPersistence.js +6 -8
  57. package/data/persistence/documents/internal/documentMutationPersistence.js.map +1 -1
  58. package/data/persistence/documents/internal/ensureDocumentsSchema.js +2 -2
  59. package/data/persistence/documents/internal/ensureDocumentsSchema.js.map +1 -1
  60. package/data/persistence/documents/internal/orphanSideRows.js +3 -22
  61. package/data/persistence/documents/internal/orphanSideRows.js.map +1 -1
  62. package/data/persistence/organizations/organizationDataUsagePersistence.js +31 -64
  63. package/data/persistence/organizations/organizationDataUsagePersistence.js.map +1 -1
  64. package/data/persistence/organizations/organizationReadModelPurge.js +1 -5
  65. package/data/persistence/organizations/organizationReadModelPurge.js.map +1 -1
  66. package/data/persistence/principalCurrentAcknowledgementPersistence.js +24 -17
  67. package/data/persistence/principalCurrentAcknowledgementPersistence.js.map +1 -1
  68. package/data/persistence/principalHistoryIncompleteRetention.js +3 -9
  69. package/data/persistence/principalHistoryIncompleteRetention.js.map +1 -1
  70. package/data/persistence/principalHistoryStagePersistence.d.ts +3 -9
  71. package/data/persistence/principalHistoryStagePersistence.js +15 -25
  72. package/data/persistence/principalHistoryStagePersistence.js.map +1 -1
  73. package/data/persistence/principalHistoryStageRetention.js +16 -15
  74. package/data/persistence/principalHistoryStageRetention.js.map +1 -1
  75. package/data/persistence/principalHistoryUnpublishedRetention.js +6 -13
  76. package/data/persistence/principalHistoryUnpublishedRetention.js.map +1 -1
  77. package/data/sqlite/containerSchema.d.ts +84 -180
  78. package/data/sqlite/containerSchema.js +14 -23
  79. package/data/sqlite/containerSchema.js.map +1 -1
  80. package/data/sqlite/documentPlacementIntentSchema.js +3 -50
  81. package/data/sqlite/documentPlacementIntentSchema.js.map +1 -1
  82. package/data/sqlite/documentSyncFailurePersistence.d.ts +16 -6
  83. package/data/sqlite/documentSyncFailurePersistence.js +44 -54
  84. package/data/sqlite/documentSyncFailurePersistence.js.map +1 -1
  85. package/data/sqlite/{documentPlacementIntentSchema.d.ts → localIntentSchema.d.ts} +162 -88
  86. package/data/sqlite/localIntentSchema.js +90 -0
  87. package/data/sqlite/localIntentSchema.js.map +1 -0
  88. package/data/sqlite/organizationDataUsageSchema.js +11 -17
  89. package/data/sqlite/organizationDataUsageSchema.js.map +1 -1
  90. package/data/sqlite/principalHistoryRetentionSchema.js +0 -15
  91. package/data/sqlite/principalHistoryRetentionSchema.js.map +1 -1
  92. package/data/sqlite/principalHistoryStageSchema.d.ts +44 -2
  93. package/data/sqlite/principalHistoryStageSchema.js +14 -2
  94. package/data/sqlite/principalHistoryStageSchema.js.map +1 -1
  95. package/data/sqlite/schema.d.ts +1019 -2284
  96. package/data/sqlite/schema.js +48 -169
  97. package/data/sqlite/schema.js.map +1 -1
  98. package/internal/api-client/ApiClient.d.ts +6 -34
  99. package/internal/api-client/ApiClient.js +8 -10
  100. package/internal/api-client/ApiClient.js.map +1 -1
  101. package/internal/api-client/apiRequestRuntime.d.ts +2 -0
  102. package/internal/api-client/apiRequestRuntime.js +4 -0
  103. package/internal/api-client/apiRequestRuntime.js.map +1 -1
  104. package/internal/api-client/requestInternals.js +7 -7
  105. package/internal/api-client/requestInternals.js.map +1 -1
  106. package/internal/api-client/routes/containers/reads.d.ts +13 -7
  107. package/internal/api-client/routes/containers/reads.js +36 -15
  108. package/internal/api-client/routes/containers/reads.js.map +1 -1
  109. package/internal/api-client/types.d.ts +1 -5
  110. package/internal/api-client/types.js.map +1 -1
  111. package/internal/validators/containerReadRefinements.js +15 -5
  112. package/internal/validators/containerReadRefinements.js.map +1 -1
  113. package/internal/validators/containerReadSchemas.d.ts +36 -0
  114. package/internal/validators/containerReadSchemas.js +64 -1
  115. package/internal/validators/containerReadSchemas.js.map +1 -1
  116. package/internal/validators/operation/containerReads.d.ts +118 -182
  117. package/internal/validators/operation/containerReads.js +20 -54
  118. package/internal/validators/operation/containerReads.js.map +1 -1
  119. package/internal/validators/operation/index.d.ts +1 -1
  120. package/internal/validators/operation/index.js +1 -1
  121. package/internal/validators/operation/index.js.map +1 -1
  122. package/internal/validators/operation/registry.d.ts +2 -2
  123. package/internal/validators/operation/registry.js +2 -2
  124. package/internal/validators/operation/registry.js.map +1 -1
  125. package/internal/validators/request/containerDocumentLanes.d.ts +23 -0
  126. package/internal/validators/request/containerDocumentLanes.js +23 -0
  127. package/internal/validators/request/containerDocumentLanes.js.map +1 -0
  128. package/internal/validators/request/containerParentLanes.js +5 -35
  129. package/internal/validators/request/containerParentLanes.js.map +1 -1
  130. package/internal/validators/request/index.d.ts +1 -0
  131. package/internal/validators/request/index.js +1 -0
  132. package/internal/validators/request/index.js.map +1 -1
  133. package/internal/validators/response/containerDocumentLanes.d.ts +82 -0
  134. package/internal/validators/response/containerDocumentLanes.js +35 -0
  135. package/internal/validators/response/containerDocumentLanes.js.map +1 -0
  136. package/internal/validators/response/containerParentLanes.js +3 -15
  137. package/internal/validators/response/containerParentLanes.js.map +1 -1
  138. package/internal/validators/response/index.d.ts +2 -1
  139. package/internal/validators/response/index.js +1 -1
  140. package/internal/validators/response/index.js.map +1 -1
  141. package/package.json +1 -1
  142. package/sync/reconciliation/knownContainerSweep.js +57 -54
  143. package/sync/reconciliation/knownContainerSweep.js.map +1 -1
  144. package/sync/reconciliation/reconcileContainer.js +49 -17
  145. package/sync/reconciliation/reconcileContainer.js.map +1 -1
  146. package/sync/reconciliation/service.js +44 -16
  147. package/sync/reconciliation/service.js.map +1 -1
  148. package/sync/reconciliation/serviceTypes.d.ts +23 -2
  149. package/sync/reconciliation/serviceTypes.js.map +1 -1
  150. package/workflows/container-contents/containerDocumentListing.js +92 -38
  151. package/workflows/container-contents/containerDocumentListing.js.map +1 -1
  152. package/workflows/container-contents/containerPersistence.d.ts +8 -2
  153. package/workflows/container-contents/containerPersistence.js +6 -7
  154. package/workflows/container-contents/containerPersistence.js.map +1 -1
  155. package/workflows/container-contents/documentDiscovery.d.ts +3 -3
  156. package/workflows/container-contents/documentDiscovery.js +24 -96
  157. package/workflows/container-contents/documentDiscovery.js.map +1 -1
  158. package/workflows/container-contents/documentDiscoveryApply.js +65 -0
  159. package/workflows/container-contents/documentDiscoveryApply.js.map +1 -0
  160. package/workflows/container-contents/documentDiscoveryLanes.js +53 -0
  161. package/workflows/container-contents/documentDiscoveryLanes.js.map +1 -0
  162. package/workflows/container-contents/documentDiscoveryTypes.d.ts +25 -19
  163. package/workflows/container-contents/documentDiscoveryTypes.js.map +1 -1
  164. package/workflows/container-contents/documentPriming.js +6 -10
  165. package/workflows/container-contents/documentPriming.js.map +1 -1
  166. package/workflows/container-contents/documentQueries/sql.js +11 -10
  167. package/workflows/container-contents/documentQueries/sql.js.map +1 -1
  168. package/workflows/container-contents/documentQueries.js +2 -2
  169. package/workflows/container-contents/documentQueries.js.map +1 -1
  170. package/workflows/container-contents/pendingDownloads.js +2 -5
  171. package/workflows/container-contents/pendingDownloads.js.map +1 -1
  172. package/workflows/container-contents/pendingWrites/deferredTails.js +3 -11
  173. package/workflows/container-contents/pendingWrites/deferredTails.js.map +1 -1
  174. package/workflows/container-contents/pendingWrites/sources.js +56 -80
  175. package/workflows/container-contents/pendingWrites/sources.js.map +1 -1
  176. package/workflows/container-contents/pendingWrites.js +6 -4
  177. package/workflows/container-contents/pendingWrites.js.map +1 -1
  178. package/workflows/container-contents/remoteContainerState.js +2 -1
  179. package/workflows/container-contents/remoteContainerState.js.map +1 -1
  180. package/workflows/container-contents/remoteHydration/laneFetchMarkers.js +11 -17
  181. package/workflows/container-contents/remoteHydration/laneFetchMarkers.js.map +1 -1
  182. package/workflows/sync/remoteReset.js +16 -23
  183. package/workflows/sync/remoteReset.js.map +1 -1
  184. package/workflows/sync/remoteResetCursorScope.js +10 -18
  185. package/workflows/sync/remoteResetCursorScope.js.map +1 -1
  186. package/workflows/sync/remoteResetPrincipalScope.js +1 -2
  187. package/workflows/sync/remoteResetPrincipalScope.js.map +1 -1
  188. package/workflows/sync/remoteResetScope.js +18 -18
  189. package/workflows/sync/remoteResetScope.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kCAAkC,GACnC,MAAM,SAAS,CAAC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BAA0B,GAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,wBAAwB,EACxB,4BAA4B,EAC5B,mCAAmC,EAEnC,4BAA4B,EAE5B,gCAAgC,EAEhC,6CAA6C,EAE7C,sCAAsC,EAEtC,uCAAuC,EAEvC,iCAAiC,EAEjC,iCAAiC,GAClC,MAAM,QAAQ,CAAC;AAChB,OAAO,EAEL,iCAAiC,EAEjC,oCAAoC,EAEpC,wCAAwC,EAExC,sCAAsC,EAEtC,qCAAqC,EAErC,+BAA+B,GAChC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,sBAAsB,EACtB,8BAA8B,EAC9B,+BAA+B,EAC/B,+BAA+B,EAC/B,sBAAsB,EAEtB,0BAA0B,EAE1B,kCAAkC,EAElC,mCAAmC,EAEnC,mCAAmC,EAEnC,0BAA0B,EAE1B,8BAA8B,GAC/B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,eAAe,EAEf,mBAAmB,GACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,+BAA+B,EAC/B,8BAA8B,EAC9B,+BAA+B,EAC/B,8BAA8B,GAC/B,MAAM,wBAAwB,CAAC","sourcesContent":["export {\n type AccessManifestBundleWireResponse,\n isAccessManifestBundleWireResponse,\n} from \"../util\";\nexport {\n type EffectiveAccessLevel,\n EffectiveAccessLevelSchema,\n isEffectiveAccessLevel,\n} from \"./accessLevel\";\nexport {\n type ChallengeErrorResponse,\n ChallengeErrorResponseSchema,\n type ChallengeResponse,\n ChallengeResponseSchema,\n type DestroySessionResponse,\n DestroySessionResponseSchema,\n isChallengeErrorResponse,\n isChallengeResponse,\n isDestroySessionResponse,\n isListSessionsResponse,\n isSessionRefreshRequiredFailure,\n isUserIdentityResponse,\n isUserSessionResponse,\n isVerifyResponse,\n isWebSocketTicketResponse,\n type ListSessionsResponse,\n ListSessionsResponseSchema,\n SESSION_ERROR_CODES,\n type SessionErrorCode,\n SessionErrorCodeSchema,\n type SessionFailureResponse,\n SessionFailureResponseSchema,\n type UserIdentityResponse,\n UserIdentityResponseSchema,\n type UserSessionResponse,\n UserSessionResponseSchema,\n type VerifyFailureResponse,\n VerifyFailureResponseSchema,\n type VerifyResponse,\n type VerifySuccessResponse,\n VerifySuccessResponseSchema,\n type WebSocketTicketResponse,\n WebSocketTicketResponseSchema,\n} from \"./auth\";\nexport {\n isRevenueCatWebhookResponse,\n isStripeWebhookResponse,\n type RevenueCatWebhookResponse,\n RevenueCatWebhookResponseSchema,\n type StripeWebhookResponse,\n StripeWebhookResponseSchema,\n} from \"./billingWebhooks\";\nexport {\n type BlobAttachmentBindResponse,\n BlobAttachmentBindResponseSchema,\n type BlobAttachmentDetachResponse,\n BlobAttachmentDetachResponseSchema,\n type BlobAttachmentSummary,\n BlobAttachmentSummarySchema,\n type BlobContentKeyBundleResponse,\n BlobContentKeyBundleResponseSchema,\n type BlobContentKeyTargetEnvelopeResponse,\n BlobContentKeyTargetEnvelopeResponseSchema,\n type BlobKekTargetsResponse,\n BlobKekTargetsResponseSchema,\n type InitiateMultipartBlobStageResponse,\n InitiateMultipartBlobStageResponseSchema,\n isBlobAttachmentBindResponse,\n isBlobAttachmentDetachResponse,\n isInitiateMultipartBlobStageResponse,\n isListDocumentAttachmentsResponse,\n isMultipartBlobStageStatusResponse,\n isUploadMultipartBlobPartResponse,\n type ListDocumentAttachmentsResponse,\n ListDocumentAttachmentsResponseSchema,\n type MultipartBlobStagePart,\n MultipartBlobStagePartSchema,\n type MultipartBlobStageStatusResponse,\n MultipartBlobStageStatusResponseSchema,\n type UploadMultipartBlobPartResponse,\n UploadMultipartBlobPartResponseSchema,\n} from \"./blob\";\nexport {\n BLOB_MUTATION_ERROR_CODES,\n type BlobMutationErrorCode,\n type BlobMutationFailureResponse,\n BlobMutationFailureResponseSchema,\n} from \"./blobMutationError\";\nexport {\n CONTAINER_PROJECTION_STATE_INVALID_ERROR_CODE,\n type ContainerDeleteResponse,\n ContainerDeleteResponseSchema,\n type ContainerKekKeyringWireResponse,\n type ContainerKekLogEpochResponse,\n ContainerKekLogEpochResponseSchema,\n type ContainerKekLogResponse,\n ContainerKekLogResponseSchema,\n type ContainerKekResponse,\n type ContainerKeyingPathResponse,\n ContainerKeyingPathResponseSchema,\n type ContainerMutationResponse,\n ContainerMutationResponseSchema,\n type ContainerReciteResponse,\n ContainerReciteResponseSchema,\n type ContainerRotationResponse,\n ContainerRotationResponseSchema,\n type ContainerSummary,\n ContainerSummaryResponseSchema,\n type ContainerSyncTombstone,\n ContainerSyncTombstoneResponseSchema,\n ContainerWriterProjectionErrorResponseSchema,\n type ContainerWriterProjectionResponse,\n ContainerWriterProjectionResponseSchema,\n type ContainerWriterProjectionWireResponse,\n ContainerWriterProjectionWireResponseSchema,\n isContainerDeleteResponse,\n isContainerKekLogResponse,\n isContainerMutationResponse,\n isContainerReciteResponse,\n isContainerRotationResponse,\n isContainerWriterProjectionResponse,\n isContainerWriterProjectionWireResponse,\n isListContainersResponse,\n type ListContainersResponse,\n ListContainersResponseSchema,\n} from \"./container\";\nexport {\n type ContainerCreateWithMetadataDocumentResponse,\n ContainerCreateWithMetadataDocumentResponseSchema,\n isContainerCreateWithMetadataDocumentResponse,\n} from \"./containerMetadata\";\nexport {\n CONTAINER_MUTATION_ERROR_CODES,\n ContainerMutationBehaviorErrorCodeSchema,\n type ContainerMutationErrorCode,\n ContainerMutationErrorCodeSchema,\n type ContainerMutationFailureResponse,\n ContainerMutationFailureResponseSchema,\n} from \"./containerMutationError\";\nexport {\n CONTAINER_NOT_FOUND_ERROR_CODE,\n type ContainerNotFoundErrorResponse,\n ContainerNotFoundErrorResponseSchema,\n} from \"./containerNotFoundError\";\nexport {\n isListContainerParentLanesResponse,\n type ListContainerParentLanesResponse,\n ListContainerParentLanesResponseSchema,\n} from \"./containerParentLanes\";\nexport {\n CONTAINER_UNAVAILABLE_ERROR_CODE,\n type ContainerUnavailableErrorCode,\n} from \"./containerUnavailableError\";\nexport {\n type ContainerDocumentSummary,\n ContainerDocumentSummaryResponseSchema,\n type ContainerDocumentSyncTombstone,\n ContainerDocumentSyncTombstoneResponseSchema,\n type DocumentEditAttributionRangeResponse,\n DocumentEditAttributionRangeResponseSchema,\n type DocumentEditAttributionResponse,\n DocumentEditAttributionResponseSchema,\n type DocumentEditAttributionSegmentResponse,\n DocumentEditAttributionSegmentResponseSchema,\n isDocumentEditAttributionResponse,\n isListContainerDocumentsResponse,\n isListDocumentEditAttributionRangesResponse,\n type ListContainerDocumentsResponse,\n ListContainerDocumentsResponseSchema,\n type ListDocumentEditAttributionRangesResponse,\n ListDocumentEditAttributionRangesResponseSchema,\n} from \"./document\";\nexport {\n type DocumentContentKeyBundleResponse,\n DocumentContentKeyBundleResponseSchema,\n type DocumentContentKeyTargetEnvelopeResponse,\n DocumentContentKeyTargetEnvelopeResponseSchema,\n type DocumentCreateResponse,\n DocumentCreateResponseSchema,\n type DocumentKekTargetsResponse,\n DocumentKekTargetsResponseSchema,\n type DocumentLinkSetMutationResponse,\n DocumentLinkSetMutationResponseSchema,\n type DocumentPurgeProofResponse,\n DocumentPurgeProofResponseSchema,\n type DocumentPurgeResponse,\n DocumentPurgeResponseSchema,\n type DocumentSyncPullPageResponse,\n DocumentSyncPullPageResponseSchema,\n type DocumentSyncResponse,\n DocumentSyncResponseSchema,\n type DocumentSyncUpdateResponse,\n DocumentSyncUpdateResponseSchema,\n type DocumentWriterProjectionResponse,\n DocumentWriterProjectionResponseSchema,\n type DocumentWriterProjectionWireResponse,\n DocumentWriterProjectionWireResponseSchema,\n documentKekTargetsFromContentKeyBundle,\n isDocumentContentKeyBundleResponse,\n isDocumentCreateResponse,\n isDocumentKekTargetsResponse,\n isDocumentLinkSetMutationResponse,\n isDocumentPurgeProofResponse,\n isDocumentPurgeResponse,\n isDocumentSyncResponse,\n isDocumentWriterProjectionResponse,\n isDocumentWriterProjectionWireResponse,\n} from \"./documentMutation\";\nexport {\n DOCUMENT_MUTATION_ERROR_CODES,\n DocumentMutationBehaviorErrorCodeSchema,\n type DocumentMutationErrorCode,\n DocumentMutationErrorCodeSchema,\n type DocumentMutationFailureResponse,\n DocumentMutationFailureResponseSchema,\n} from \"./documentMutationError\";\nexport {\n DOCUMENT_NOT_FOUND_ERROR_CODE,\n DOCUMENT_PROJECTION_ERROR_CODES,\n DOCUMENT_SYNC_ERROR_CODES,\n type DocumentNotFoundErrorCode,\n type DocumentNotFoundErrorResponse,\n DocumentNotFoundErrorResponseSchema,\n type DocumentProjectionErrorCode,\n DocumentProjectionErrorCodeSchema,\n type DocumentSyncErrorCode,\n DocumentSyncErrorCodeSchema,\n type DocumentSyncErrorResponse,\n DocumentSyncErrorResponseSchema,\n type DocumentSyncStateStaleErrorResponse,\n DocumentSyncStateStaleErrorResponseSchema,\n type DocumentWriterProjectionErrorResponse,\n DocumentWriterProjectionErrorResponseSchema,\n isDocumentSyncErrorCode,\n isDocumentSyncErrorResponse,\n isDocumentSyncStateStaleErrorResponse,\n} from \"./documentSyncError\";\nexport {\n type ErrorResponse,\n ErrorResponseSchema,\n isErrorResponse,\n} from \"./error\";\nexport {\n type HealthResponse,\n HealthResponseSchema,\n isHealthResponse,\n} from \"./health\";\nexport {\n MULTIPART_BLOB_STAGE_ERROR_CODES,\n type MultipartBlobStageConflictErrorResponse,\n MultipartBlobStageConflictErrorResponseSchema,\n type MultipartBlobStageErrorCode,\n type MultipartBlobStageExpiredErrorResponse,\n MultipartBlobStageExpiredErrorResponseSchema,\n type MultipartBlobStageNotFoundErrorResponse,\n MultipartBlobStageNotFoundErrorResponseSchema,\n} from \"./multipartBlobStageError\";\nexport {\n type CreateOrganizationGroupResponse,\n CreateOrganizationGroupResponseSchema,\n type DeleteOrganizationGroupResponse,\n DeleteOrganizationGroupResponseSchema,\n isCreateOrganizationGroupResponse,\n isDeleteOrganizationGroupResponse,\n isListOrganizationGroupsResponse,\n isOrganizationContainerGrantResponse,\n isOrganizationContainerGrantSubjectType,\n isOrganizationContainerGrantsResponse,\n isOrganizationDirectoryResponse,\n isOrganizationDirectoryUserResponse,\n isOrganizationGroupContainerAccessLevel,\n isOrganizationGroupContainerResponse,\n isOrganizationGroupContainersResponse,\n isOrganizationGroupCurrentStateResponse,\n isOrganizationGroupMemberResponse,\n isOrganizationGroupMembersResponse,\n isOrganizationGroupSummaryResponse,\n isOrganizationProfileResponse,\n isOrganizationUserDetailGrantsResponse,\n isOrganizationUserDetailResponse,\n type ListOrganizationGroupsResponse,\n ListOrganizationGroupsResponseSchema,\n type OrganizationContainerGrantResponse,\n OrganizationContainerGrantResponseSchema,\n type OrganizationContainerGrantSubjectType,\n type OrganizationContainerGrantsResponse,\n OrganizationContainerGrantsResponseSchema,\n type OrganizationDirectoryResponse,\n OrganizationDirectoryResponseSchema,\n type OrganizationDirectoryUserResponse,\n OrganizationDirectoryUserResponseSchema,\n type OrganizationGroupContainerAccessLevel,\n type OrganizationGroupContainerResponse,\n OrganizationGroupContainerResponseSchema,\n type OrganizationGroupContainersResponse,\n OrganizationGroupContainersResponseSchema,\n type OrganizationGroupCurrentStateResponse,\n OrganizationGroupCurrentStateResponseSchema,\n type OrganizationGroupMemberResponse,\n OrganizationGroupMemberResponseSchema,\n type OrganizationGroupMembersResponse,\n OrganizationGroupMembersResponseSchema,\n type OrganizationGroupSummaryResponse,\n OrganizationGroupSummaryResponseSchema,\n type OrganizationProfileResponse,\n OrganizationProfileResponseSchema,\n type OrganizationRole,\n type OrganizationRosterStatus,\n type OrganizationUserDetailGrantsResponse,\n OrganizationUserDetailGrantsResponseSchema,\n type OrganizationUserDetailResponse,\n OrganizationUserDetailResponseSchema,\n} from \"./organization\";\nexport {\n type BillingErrorResponse,\n BillingErrorResponseSchema,\n isOrganizationBillingProvider,\n isOrganizationBillingResponse,\n isOrganizationBillingStatus,\n isPaymentRequiredErrorResponse,\n type OrganizationBillingProvider,\n OrganizationBillingProviderSchema,\n type OrganizationBillingResponse,\n OrganizationBillingResponseSchema,\n type OrganizationBillingStatus,\n OrganizationBillingStatusSchema,\n type OrganizationBillingSubscriptionSource,\n OrganizationBillingSubscriptionSourceSchema,\n type PaymentRequiredErrorResponse,\n PaymentRequiredErrorResponseSchema,\n} from \"./organizationBilling\";\nexport {\n isOrganizationBillingHistoryResponse,\n type OrganizationBillingHistoryCategory,\n OrganizationBillingHistoryCategorySchema,\n type OrganizationBillingHistoryEntry,\n OrganizationBillingHistoryEntrySchema,\n type OrganizationBillingHistoryEnvironment,\n OrganizationBillingHistoryEnvironmentSchema,\n type OrganizationBillingHistoryOutcome,\n OrganizationBillingHistoryOutcomeSchema,\n type OrganizationBillingHistoryProvider,\n OrganizationBillingHistoryProviderSchema,\n type OrganizationBillingHistoryResponse,\n OrganizationBillingHistoryResponseSchema,\n} from \"./organizationBillingHistory\";\nexport {\n isOrganizationBillingManagementUrlResponse,\n type OrganizationBillingManagementUrlResponse,\n OrganizationBillingManagementUrlResponseSchema,\n} from \"./organizationBillingManagementUrl\";\nexport {\n isOrganizationDataUsageResponse,\n ORGANIZATION_DOCUMENT_USAGE_CATEGORIES,\n type OrganizationBlobDataUsageResponse,\n type OrganizationDataUsageResponse,\n OrganizationDataUsageResponseSchema,\n type OrganizationDocumentDataUsageResponse,\n type OrganizationDocumentUsageCategory,\n type OrganizationDocumentUsageCategoryBreakdown,\n} from \"./organizationDataUsage\";\nexport {\n isOrganizationNativePurchaseEligibilityResponse,\n type OrganizationNativePurchaseEligibilityResponse,\n OrganizationNativePurchaseEligibilityResponseSchema,\n type OrganizationNativePurchaseIneligibilityReason,\n OrganizationNativePurchaseIneligibilityReasonSchema,\n} from \"./organizationNativePurchaseEligibility\";\nexport {\n type OrganizationPolicyHistoryResponse,\n OrganizationPolicyHistoryResponseSchema,\n PRINCIPAL_DISPLAY_HISTORY_PAGE_SIZE,\n} from \"./organizationPolicyHistory\";\nexport {\n ORGANIZATION_PRESENTATION_ERROR_CODES,\n type OrganizationPresentationErrorCode,\n OrganizationPresentationErrorCodeSchema,\n type OrganizationPresentationFailureResponse,\n OrganizationPresentationFailureResponseSchema,\n} from \"./organizationPresentationError\";\nexport {\n type CreateOrganizationResponse,\n CreateOrganizationResponseSchema,\n isCreateOrganizationResponse,\n isOrganizationProvisioningResponse,\n type OrganizationProvisioningResponse,\n OrganizationProvisioningResponseSchema,\n} from \"./organizationProvisioning\";\nexport {\n isOrganizationReadModelResponse,\n type OrganizationReadModelDeltaResponse,\n type OrganizationReadModelDirectoryResponse,\n type OrganizationReadModelGrantsResponse,\n type OrganizationReadModelGroupMemberResponse,\n type OrganizationReadModelGroupMembershipResponse,\n type OrganizationReadModelGroupMembershipsResponse,\n type OrganizationReadModelOrganizationPolicyResponse,\n type OrganizationReadModelResponse,\n OrganizationReadModelResponseSchema,\n type OrganizationReadModelSnapshotResponse,\n} from \"./organizationReadModel\";\nexport {\n ORGANIZATION_READ_MODEL_ERROR_CODES,\n type OrganizationReadModelErrorCode,\n OrganizationReadModelErrorCodeSchema,\n type OrganizationReadModelFailureResponse,\n OrganizationReadModelFailureResponseSchema,\n} from \"./organizationReadModelError\";\nexport {\n CommitOrganizationGroupPolicyConflictResponseSchema,\n type CommitOrganizationGroupPolicyResponse,\n CommitOrganizationGroupPolicyResponseSchema,\n type CurrentPrincipalMemberEnvelopesResponse,\n CurrentPrincipalMemberEnvelopesResponseSchema,\n isCommitOrganizationGroupPolicyResponse,\n isCurrentPrincipalMemberEnvelopesResponse,\n isPrincipalPolicyBundleResponse,\n isPrincipalPolicyMutationResponse,\n isPrincipalPolicyStaleErrorResponse,\n isPrincipalPolicyStateChainEntryResponse,\n isPrincipalStatePayloadResponse,\n isPrincipalStateResponse,\n type PrincipalContainerGrantResponse,\n PrincipalContainerGrantResponseSchema,\n type PrincipalMemberEnvelopeResponse,\n PrincipalMemberEnvelopeResponseSchema,\n type PrincipalPolicyBundleResponse,\n PrincipalPolicyBundleResponseSchema,\n type PrincipalPolicyErrorResponse,\n PrincipalPolicyErrorResponseSchema,\n type PrincipalPolicyMutationResponse,\n PrincipalPolicyMutationResponseSchema,\n type PrincipalPolicySnapshotResponse,\n PrincipalPolicySnapshotResponseSchema,\n type PrincipalPolicyStaleErrorResponse,\n PrincipalPolicyStaleErrorResponseSchema,\n type PrincipalPolicyStateChainEntryResponse,\n PrincipalPolicyStateChainEntryResponseSchema,\n type PrincipalProjectionMemberResponse,\n PrincipalProjectionMemberResponseSchema,\n type PrincipalStateExternalAuthorityResponse,\n PrincipalStateExternalAuthorityResponseSchema,\n type PrincipalStatePayloadResponse,\n PrincipalStatePayloadResponseSchema,\n type PrincipalStateResponse,\n PrincipalStateResponseSchema,\n} from \"./principal\";\nexport {\n isPrincipalPolicyPageResponse,\n type PrincipalPolicyPageResponse,\n PrincipalPolicyPageResponseSchema,\n} from \"./principalPolicyPage\";\nexport {\n isPrincipalPolicySnapshotPageResponse,\n type PrincipalPolicyHistorySourceResponse,\n PrincipalPolicyHistorySourceResponseSchema,\n type PrincipalPolicySnapshotPageResponse,\n PrincipalPolicySnapshotPageResponseSchema,\n} from \"./principalPolicySnapshotPage\";\nexport {\n isReferencedPrincipalStateResponse,\n type ReferencedPrincipalStateResponse,\n ReferencedPrincipalStateResponseSchema,\n} from \"./principalReference\";\nexport {\n type ProjectionPolicyEvidenceResponse,\n ProjectionPolicyEvidenceResponseSchema,\n} from \"./projectionPolicyEvidence\";\nexport {\n isRegistrationResponse,\n type RegistrationResponse,\n RegistrationResponseSchema,\n} from \"./registration\";\nexport {\n isRootIdentitiesResponse,\n isRootIdentityDetailResponse,\n isRootIdentityOrganizationsResponse,\n type RootIdentitiesResponse,\n RootIdentitiesResponseSchema,\n type RootIdentityDetailResponse,\n RootIdentityDetailResponseSchema,\n type RootIdentityOrganizationBillingResponse,\n RootIdentityOrganizationBillingResponseSchema,\n type RootIdentityOrganizationResponse,\n RootIdentityOrganizationResponseSchema,\n type RootIdentityOrganizationsResponse,\n RootIdentityOrganizationsResponseSchema,\n type RootIdentitySessionResponse,\n RootIdentitySessionResponseSchema,\n type RootIdentitySummaryResponse,\n RootIdentitySummaryResponseSchema,\n} from \"./root\";\nexport {\n type RootDataUsageReportResponse,\n RootDataUsageReportResponseSchema,\n type RootOrganizationDetailResponse,\n RootOrganizationDetailResponseSchema,\n type RootOrganizationIdentitiesResponse,\n RootOrganizationIdentitiesResponseSchema,\n type RootOrganizationIdentityResponse,\n RootOrganizationIdentityResponseSchema,\n type RootOrganizationSummaryResponse,\n RootOrganizationSummaryResponseSchema,\n type RootOrganizationsResponse,\n RootOrganizationsResponseSchema,\n} from \"./rootOrganizations\";\nexport {\n isStripeCancelResponse,\n isStripeCheckoutIntentResponse,\n isStripeCheckoutOptionsResponse,\n isStripeCheckoutSessionResponse,\n isStripePortalResponse,\n type StripeCancelResponse,\n StripeCancelResponseSchema,\n type StripeCheckoutIntentResponse,\n StripeCheckoutIntentResponseSchema,\n type StripeCheckoutOptionsResponse,\n StripeCheckoutOptionsResponseSchema,\n type StripeCheckoutSessionResponse,\n StripeCheckoutSessionResponseSchema,\n type StripePortalResponse,\n StripePortalResponseSchema,\n type StripeSyncOptionResponse,\n StripeSyncOptionResponseSchema,\n} from \"./stripeCheckout\";\nexport {\n isSyncWatermark,\n type SyncWatermark,\n SyncWatermarkSchema,\n} from \"./syncWatermark\";\nexport {\n decodeContainerWriterProjection,\n decodeDocumentWriterProjection,\n encodeContainerWriterProjection,\n encodeDocumentWriterProjection,\n} from \"./writerProjectionWire\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kCAAkC,GACnC,MAAM,SAAS,CAAC;AACjB,OAAO,EAEL,0BAA0B,EAC1B,sBAAsB,GACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,4BAA4B,EAE5B,uBAAuB,EAEvB,4BAA4B,EAC5B,wBAAwB,EACxB,mBAAmB,EACnB,wBAAwB,EACxB,sBAAsB,EACtB,+BAA+B,EAC/B,sBAAsB,EACtB,qBAAqB,EACrB,gBAAgB,EAChB,yBAAyB,EAEzB,0BAA0B,EAC1B,mBAAmB,EAEnB,sBAAsB,E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BAA+B,GAChC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,sBAAsB,EACtB,8BAA8B,EAC9B,+BAA+B,EAC/B,+BAA+B,EAC/B,sBAAsB,EAEtB,0BAA0B,EAE1B,kCAAkC,EAElC,mCAAmC,EAEnC,mCAAmC,EAEnC,0BAA0B,EAE1B,8BAA8B,GAC/B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,eAAe,EAEf,mBAAmB,GACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,+BAA+B,EAC/B,8BAA8B,EAC9B,+BAA+B,EAC/B,8BAA8B,GAC/B,MAAM,wBAAwB,CAAC","sourcesContent":["export {\n type AccessManifestBundleWireResponse,\n isAccessManifestBundleWireResponse,\n} from \"../util\";\nexport {\n type EffectiveAccessLevel,\n EffectiveAccessLevelSchema,\n isEffectiveAccessLevel,\n} from \"./accessLevel\";\nexport {\n type ChallengeErrorResponse,\n ChallengeErrorResponseSchema,\n type ChallengeResponse,\n ChallengeResponseSchema,\n type DestroySessionResponse,\n DestroySessionResponseSchema,\n isChallengeErrorResponse,\n isChallengeResponse,\n isDestroySessionResponse,\n isListSessionsResponse,\n isSessionRefreshRequiredFailure,\n isUserIdentityResponse,\n isUserSessionResponse,\n isVerifyResponse,\n isWebSocketTicketResponse,\n type ListSessionsResponse,\n ListSessionsResponseSchema,\n SESSION_ERROR_CODES,\n type SessionErrorCode,\n SessionErrorCodeSchema,\n type SessionFailureResponse,\n SessionFailureResponseSchema,\n type UserIdentityResponse,\n UserIdentityResponseSchema,\n type UserSessionResponse,\n UserSessionResponseSchema,\n type VerifyFailureResponse,\n VerifyFailureResponseSchema,\n type VerifyResponse,\n type VerifySuccessResponse,\n VerifySuccessResponseSchema,\n type WebSocketTicketResponse,\n WebSocketTicketResponseSchema,\n} from \"./auth\";\nexport {\n isRevenueCatWebhookResponse,\n isStripeWebhookResponse,\n type RevenueCatWebhookResponse,\n RevenueCatWebhookResponseSchema,\n type StripeWebhookResponse,\n StripeWebhookResponseSchema,\n} from \"./billingWebhooks\";\nexport {\n type BlobAttachmentBindResponse,\n BlobAttachmentBindResponseSchema,\n type BlobAttachmentDetachResponse,\n BlobAttachmentDetachResponseSchema,\n type BlobAttachmentSummary,\n BlobAttachmentSummarySchema,\n type BlobContentKeyBundleResponse,\n BlobContentKeyBundleResponseSchema,\n type BlobContentKeyTargetEnvelopeResponse,\n BlobContentKeyTargetEnvelopeResponseSchema,\n type BlobKekTargetsResponse,\n BlobKekTargetsResponseSchema,\n type InitiateMultipartBlobStageResponse,\n InitiateMultipartBlobStageResponseSchema,\n isBlobAttachmentBindResponse,\n isBlobAttachmentDetachResponse,\n isInitiateMultipartBlobStageResponse,\n isListDocumentAttachmentsResponse,\n isMultipartBlobStageStatusResponse,\n isUploadMultipartBlobPartResponse,\n type ListDocumentAttachmentsResponse,\n ListDocumentAttachmentsResponseSchema,\n type MultipartBlobStagePart,\n MultipartBlobStagePartSchema,\n type MultipartBlobStageStatusResponse,\n MultipartBlobStageStatusResponseSchema,\n type UploadMultipartBlobPartResponse,\n UploadMultipartBlobPartResponseSchema,\n} from \"./blob\";\nexport {\n BLOB_MUTATION_ERROR_CODES,\n type BlobMutationErrorCode,\n type BlobMutationFailureResponse,\n BlobMutationFailureResponseSchema,\n} from \"./blobMutationError\";\nexport {\n CONTAINER_PROJECTION_STATE_INVALID_ERROR_CODE,\n type ContainerDeleteResponse,\n ContainerDeleteResponseSchema,\n type ContainerKekKeyringWireResponse,\n type ContainerKekLogEpochResponse,\n ContainerKekLogEpochResponseSchema,\n type ContainerKekLogResponse,\n ContainerKekLogResponseSchema,\n type ContainerKekResponse,\n type ContainerKeyingPathResponse,\n ContainerKeyingPathResponseSchema,\n type ContainerMutationResponse,\n ContainerMutationResponseSchema,\n type ContainerReciteResponse,\n ContainerReciteResponseSchema,\n type ContainerRotationResponse,\n ContainerRotationResponseSchema,\n type ContainerSummary,\n ContainerSummaryResponseSchema,\n type ContainerSyncTombstone,\n ContainerSyncTombstoneResponseSchema,\n ContainerWriterProjectionErrorResponseSchema,\n type ContainerWriterProjectionResponse,\n ContainerWriterProjectionResponseSchema,\n type ContainerWriterProjectionWireResponse,\n ContainerWriterProjectionWireResponseSchema,\n isContainerDeleteResponse,\n isContainerKekLogResponse,\n isContainerMutationResponse,\n isContainerReciteResponse,\n isContainerRotationResponse,\n isContainerWriterProjectionResponse,\n isContainerWriterProjectionWireResponse,\n isListContainersResponse,\n type ListContainersResponse,\n ListContainersResponseSchema,\n} from \"./container\";\nexport type { ListContainerDocumentLanesResponse } from \"./containerDocumentLanes\";\nexport {\n type ContainerCreateWithMetadataDocumentResponse,\n ContainerCreateWithMetadataDocumentResponseSchema,\n isContainerCreateWithMetadataDocumentResponse,\n} from \"./containerMetadata\";\nexport {\n CONTAINER_MUTATION_ERROR_CODES,\n ContainerMutationBehaviorErrorCodeSchema,\n type ContainerMutationErrorCode,\n ContainerMutationErrorCodeSchema,\n type ContainerMutationFailureResponse,\n ContainerMutationFailureResponseSchema,\n} from \"./containerMutationError\";\nexport {\n CONTAINER_NOT_FOUND_ERROR_CODE,\n type ContainerNotFoundErrorResponse,\n ContainerNotFoundErrorResponseSchema,\n} from \"./containerNotFoundError\";\nexport {\n isListContainerParentLanesResponse,\n type ListContainerParentLanesResponse,\n ListContainerParentLanesResponseSchema,\n} from \"./containerParentLanes\";\nexport {\n CONTAINER_UNAVAILABLE_ERROR_CODE,\n type ContainerUnavailableErrorCode,\n} from \"./containerUnavailableError\";\nexport {\n type ContainerDocumentSummary,\n ContainerDocumentSummaryResponseSchema,\n type ContainerDocumentSyncTombstone,\n ContainerDocumentSyncTombstoneResponseSchema,\n type DocumentEditAttributionRangeResponse,\n DocumentEditAttributionRangeResponseSchema,\n type DocumentEditAttributionResponse,\n DocumentEditAttributionResponseSchema,\n type DocumentEditAttributionSegmentResponse,\n DocumentEditAttributionSegmentResponseSchema,\n isDocumentEditAttributionResponse,\n isListDocumentEditAttributionRangesResponse,\n type ListContainerDocumentsResponse,\n ListContainerDocumentsResponseSchema,\n type ListDocumentEditAttributionRangesResponse,\n ListDocumentEditAttributionRangesResponseSchema,\n} from \"./document\";\nexport {\n type DocumentContentKeyBundleResponse,\n DocumentContentKeyBundleResponseSchema,\n type DocumentContentKeyTargetEnvelopeResponse,\n DocumentContentKeyTargetEnvelopeResponseSchema,\n type DocumentCreateResponse,\n DocumentCreateResponseSchema,\n type DocumentKekTargetsResponse,\n DocumentKekTargetsResponseSchema,\n type DocumentLinkSetMutationResponse,\n DocumentLinkSetMutationResponseSchema,\n type DocumentPurgeProofResponse,\n DocumentPurgeProofResponseSchema,\n type DocumentPurgeResponse,\n DocumentPurgeResponseSchema,\n type DocumentSyncPullPageResponse,\n DocumentSyncPullPageResponseSchema,\n type DocumentSyncResponse,\n DocumentSyncResponseSchema,\n type DocumentSyncUpdateResponse,\n DocumentSyncUpdateResponseSchema,\n type DocumentWriterProjectionResponse,\n DocumentWriterProjectionResponseSchema,\n type DocumentWriterProjectionWireResponse,\n DocumentWriterProjectionWireResponseSchema,\n documentKekTargetsFromContentKeyBundle,\n isDocumentContentKeyBundleResponse,\n isDocumentCreateResponse,\n isDocumentKekTargetsResponse,\n isDocumentLinkSetMutationResponse,\n isDocumentPurgeProofResponse,\n isDocumentPurgeResponse,\n isDocumentSyncResponse,\n isDocumentWriterProjectionResponse,\n isDocumentWriterProjectionWireResponse,\n} from \"./documentMutation\";\nexport {\n DOCUMENT_MUTATION_ERROR_CODES,\n DocumentMutationBehaviorErrorCodeSchema,\n type DocumentMutationErrorCode,\n DocumentMutationErrorCodeSchema,\n type DocumentMutationFailureResponse,\n DocumentMutationFailureResponseSchema,\n} from \"./documentMutationError\";\nexport {\n DOCUMENT_NOT_FOUND_ERROR_CODE,\n DOCUMENT_PROJECTION_ERROR_CODES,\n DOCUMENT_SYNC_ERROR_CODES,\n type DocumentNotFoundErrorCode,\n type DocumentNotFoundErrorResponse,\n DocumentNotFoundErrorResponseSchema,\n type DocumentProjectionErrorCode,\n DocumentProjectionErrorCodeSchema,\n type DocumentSyncErrorCode,\n DocumentSyncErrorCodeSchema,\n type DocumentSyncErrorResponse,\n DocumentSyncErrorResponseSchema,\n type DocumentSyncStateStaleErrorResponse,\n DocumentSyncStateStaleErrorResponseSchema,\n type DocumentWriterProjectionErrorResponse,\n DocumentWriterProjectionErrorResponseSchema,\n isDocumentSyncErrorCode,\n isDocumentSyncErrorResponse,\n isDocumentSyncStateStaleErrorResponse,\n} from \"./documentSyncError\";\nexport {\n type ErrorResponse,\n ErrorResponseSchema,\n isErrorResponse,\n} from \"./error\";\nexport {\n type HealthResponse,\n HealthResponseSchema,\n isHealthResponse,\n} from \"./health\";\nexport {\n MULTIPART_BLOB_STAGE_ERROR_CODES,\n type MultipartBlobStageConflictErrorResponse,\n MultipartBlobStageConflictErrorResponseSchema,\n type MultipartBlobStageErrorCode,\n type MultipartBlobStageExpiredErrorResponse,\n MultipartBlobStageExpiredErrorResponseSchema,\n type MultipartBlobStageNotFoundErrorResponse,\n MultipartBlobStageNotFoundErrorResponseSchema,\n} from \"./multipartBlobStageError\";\nexport {\n type CreateOrganizationGroupResponse,\n CreateOrganizationGroupResponseSchema,\n type DeleteOrganizationGroupResponse,\n DeleteOrganizationGroupResponseSchema,\n isCreateOrganizationGroupResponse,\n isDeleteOrganizationGroupResponse,\n isListOrganizationGroupsResponse,\n isOrganizationContainerGrantResponse,\n isOrganizationContainerGrantSubjectType,\n isOrganizationContainerGrantsResponse,\n isOrganizationDirectoryResponse,\n isOrganizationDirectoryUserResponse,\n isOrganizationGroupContainerAccessLevel,\n isOrganizationGroupContainerResponse,\n isOrganizationGroupContainersResponse,\n isOrganizationGroupCurrentStateResponse,\n isOrganizationGroupMemberResponse,\n isOrganizationGroupMembersResponse,\n isOrganizationGroupSummaryResponse,\n isOrganizationProfileResponse,\n isOrganizationUserDetailGrantsResponse,\n isOrganizationUserDetailResponse,\n type ListOrganizationGroupsResponse,\n ListOrganizationGroupsResponseSchema,\n type OrganizationContainerGrantResponse,\n OrganizationContainerGrantResponseSchema,\n type OrganizationContainerGrantSubjectType,\n type OrganizationContainerGrantsResponse,\n OrganizationContainerGrantsResponseSchema,\n type OrganizationDirectoryResponse,\n OrganizationDirectoryResponseSchema,\n type OrganizationDirectoryUserResponse,\n OrganizationDirectoryUserResponseSchema,\n type OrganizationGroupContainerAccessLevel,\n type OrganizationGroupContainerResponse,\n OrganizationGroupContainerResponseSchema,\n type OrganizationGroupContainersResponse,\n OrganizationGroupContainersResponseSchema,\n type OrganizationGroupCurrentStateResponse,\n OrganizationGroupCurrentStateResponseSchema,\n type OrganizationGroupMemberResponse,\n OrganizationGroupMemberResponseSchema,\n type OrganizationGroupMembersResponse,\n OrganizationGroupMembersResponseSchema,\n type OrganizationGroupSummaryResponse,\n OrganizationGroupSummaryResponseSchema,\n type OrganizationProfileResponse,\n OrganizationProfileResponseSchema,\n type OrganizationRole,\n type OrganizationRosterStatus,\n type OrganizationUserDetailGrantsResponse,\n OrganizationUserDetailGrantsResponseSchema,\n type OrganizationUserDetailResponse,\n OrganizationUserDetailResponseSchema,\n} from \"./organization\";\nexport {\n type BillingErrorResponse,\n BillingErrorResponseSchema,\n isOrganizationBillingProvider,\n isOrganizationBillingResponse,\n isOrganizationBillingStatus,\n isPaymentRequiredErrorResponse,\n type OrganizationBillingProvider,\n OrganizationBillingProviderSchema,\n type OrganizationBillingResponse,\n OrganizationBillingResponseSchema,\n type OrganizationBillingStatus,\n OrganizationBillingStatusSchema,\n type OrganizationBillingSubscriptionSource,\n OrganizationBillingSubscriptionSourceSchema,\n type PaymentRequiredErrorResponse,\n PaymentRequiredErrorResponseSchema,\n} from \"./organizationBilling\";\nexport {\n isOrganizationBillingHistoryResponse,\n type OrganizationBillingHistoryCategory,\n OrganizationBillingHistoryCategorySchema,\n type OrganizationBillingHistoryEntry,\n OrganizationBillingHistoryEntrySchema,\n type OrganizationBillingHistoryEnvironment,\n OrganizationBillingHistoryEnvironmentSchema,\n type OrganizationBillingHistoryOutcome,\n OrganizationBillingHistoryOutcomeSchema,\n type OrganizationBillingHistoryProvider,\n OrganizationBillingHistoryProviderSchema,\n type OrganizationBillingHistoryResponse,\n OrganizationBillingHistoryResponseSchema,\n} from \"./organizationBillingHistory\";\nexport {\n isOrganizationBillingManagementUrlResponse,\n type OrganizationBillingManagementUrlResponse,\n OrganizationBillingManagementUrlResponseSchema,\n} from \"./organizationBillingManagementUrl\";\nexport {\n isOrganizationDataUsageResponse,\n ORGANIZATION_DOCUMENT_USAGE_CATEGORIES,\n type OrganizationBlobDataUsageResponse,\n type OrganizationDataUsageResponse,\n OrganizationDataUsageResponseSchema,\n type OrganizationDocumentDataUsageResponse,\n type OrganizationDocumentUsageCategory,\n type OrganizationDocumentUsageCategoryBreakdown,\n} from \"./organizationDataUsage\";\nexport {\n isOrganizationNativePurchaseEligibilityResponse,\n type OrganizationNativePurchaseEligibilityResponse,\n OrganizationNativePurchaseEligibilityResponseSchema,\n type OrganizationNativePurchaseIneligibilityReason,\n OrganizationNativePurchaseIneligibilityReasonSchema,\n} from \"./organizationNativePurchaseEligibility\";\nexport {\n type OrganizationPolicyHistoryResponse,\n OrganizationPolicyHistoryResponseSchema,\n PRINCIPAL_DISPLAY_HISTORY_PAGE_SIZE,\n} from \"./organizationPolicyHistory\";\nexport {\n ORGANIZATION_PRESENTATION_ERROR_CODES,\n type OrganizationPresentationErrorCode,\n OrganizationPresentationErrorCodeSchema,\n type OrganizationPresentationFailureResponse,\n OrganizationPresentationFailureResponseSchema,\n} from \"./organizationPresentationError\";\nexport {\n type CreateOrganizationResponse,\n CreateOrganizationResponseSchema,\n isCreateOrganizationResponse,\n isOrganizationProvisioningResponse,\n type OrganizationProvisioningResponse,\n OrganizationProvisioningResponseSchema,\n} from \"./organizationProvisioning\";\nexport {\n isOrganizationReadModelResponse,\n type OrganizationReadModelDeltaResponse,\n type OrganizationReadModelDirectoryResponse,\n type OrganizationReadModelGrantsResponse,\n type OrganizationReadModelGroupMemberResponse,\n type OrganizationReadModelGroupMembershipResponse,\n type OrganizationReadModelGroupMembershipsResponse,\n type OrganizationReadModelOrganizationPolicyResponse,\n type OrganizationReadModelResponse,\n OrganizationReadModelResponseSchema,\n type OrganizationReadModelSnapshotResponse,\n} from \"./organizationReadModel\";\nexport {\n ORGANIZATION_READ_MODEL_ERROR_CODES,\n type OrganizationReadModelErrorCode,\n OrganizationReadModelErrorCodeSchema,\n type OrganizationReadModelFailureResponse,\n OrganizationReadModelFailureResponseSchema,\n} from \"./organizationReadModelError\";\nexport {\n CommitOrganizationGroupPolicyConflictResponseSchema,\n type CommitOrganizationGroupPolicyResponse,\n CommitOrganizationGroupPolicyResponseSchema,\n type CurrentPrincipalMemberEnvelopesResponse,\n CurrentPrincipalMemberEnvelopesResponseSchema,\n isCommitOrganizationGroupPolicyResponse,\n isCurrentPrincipalMemberEnvelopesResponse,\n isPrincipalPolicyBundleResponse,\n isPrincipalPolicyMutationResponse,\n isPrincipalPolicyStaleErrorResponse,\n isPrincipalPolicyStateChainEntryResponse,\n isPrincipalStatePayloadResponse,\n isPrincipalStateResponse,\n type PrincipalContainerGrantResponse,\n PrincipalContainerGrantResponseSchema,\n type PrincipalMemberEnvelopeResponse,\n PrincipalMemberEnvelopeResponseSchema,\n type PrincipalPolicyBundleResponse,\n PrincipalPolicyBundleResponseSchema,\n type PrincipalPolicyErrorResponse,\n PrincipalPolicyErrorResponseSchema,\n type PrincipalPolicyMutationResponse,\n PrincipalPolicyMutationResponseSchema,\n type PrincipalPolicySnapshotResponse,\n PrincipalPolicySnapshotResponseSchema,\n type PrincipalPolicyStaleErrorResponse,\n PrincipalPolicyStaleErrorResponseSchema,\n type PrincipalPolicyStateChainEntryResponse,\n PrincipalPolicyStateChainEntryResponseSchema,\n type PrincipalProjectionMemberResponse,\n PrincipalProjectionMemberResponseSchema,\n type PrincipalStateExternalAuthorityResponse,\n PrincipalStateExternalAuthorityResponseSchema,\n type PrincipalStatePayloadResponse,\n PrincipalStatePayloadResponseSchema,\n type PrincipalStateResponse,\n PrincipalStateResponseSchema,\n} from \"./principal\";\nexport {\n isPrincipalPolicyPageResponse,\n type PrincipalPolicyPageResponse,\n PrincipalPolicyPageResponseSchema,\n} from \"./principalPolicyPage\";\nexport {\n isPrincipalPolicySnapshotPageResponse,\n type PrincipalPolicyHistorySourceResponse,\n PrincipalPolicyHistorySourceResponseSchema,\n type PrincipalPolicySnapshotPageResponse,\n PrincipalPolicySnapshotPageResponseSchema,\n} from \"./principalPolicySnapshotPage\";\nexport {\n isReferencedPrincipalStateResponse,\n type ReferencedPrincipalStateResponse,\n ReferencedPrincipalStateResponseSchema,\n} from \"./principalReference\";\nexport {\n type ProjectionPolicyEvidenceResponse,\n ProjectionPolicyEvidenceResponseSchema,\n} from \"./projectionPolicyEvidence\";\nexport {\n isRegistrationResponse,\n type RegistrationResponse,\n RegistrationResponseSchema,\n} from \"./registration\";\nexport {\n isRootIdentitiesResponse,\n isRootIdentityDetailResponse,\n isRootIdentityOrganizationsResponse,\n type RootIdentitiesResponse,\n RootIdentitiesResponseSchema,\n type RootIdentityDetailResponse,\n RootIdentityDetailResponseSchema,\n type RootIdentityOrganizationBillingResponse,\n RootIdentityOrganizationBillingResponseSchema,\n type RootIdentityOrganizationResponse,\n RootIdentityOrganizationResponseSchema,\n type RootIdentityOrganizationsResponse,\n RootIdentityOrganizationsResponseSchema,\n type RootIdentitySessionResponse,\n RootIdentitySessionResponseSchema,\n type RootIdentitySummaryResponse,\n RootIdentitySummaryResponseSchema,\n} from \"./root\";\nexport {\n type RootDataUsageReportResponse,\n RootDataUsageReportResponseSchema,\n type RootOrganizationDetailResponse,\n RootOrganizationDetailResponseSchema,\n type RootOrganizationIdentitiesResponse,\n RootOrganizationIdentitiesResponseSchema,\n type RootOrganizationIdentityResponse,\n RootOrganizationIdentityResponseSchema,\n type RootOrganizationSummaryResponse,\n RootOrganizationSummaryResponseSchema,\n type RootOrganizationsResponse,\n RootOrganizationsResponseSchema,\n} from \"./rootOrganizations\";\nexport {\n isStripeCancelResponse,\n isStripeCheckoutIntentResponse,\n isStripeCheckoutOptionsResponse,\n isStripeCheckoutSessionResponse,\n isStripePortalResponse,\n type StripeCancelResponse,\n StripeCancelResponseSchema,\n type StripeCheckoutIntentResponse,\n StripeCheckoutIntentResponseSchema,\n type StripeCheckoutOptionsResponse,\n StripeCheckoutOptionsResponseSchema,\n type StripeCheckoutSessionResponse,\n StripeCheckoutSessionResponseSchema,\n type StripePortalResponse,\n StripePortalResponseSchema,\n type StripeSyncOptionResponse,\n StripeSyncOptionResponseSchema,\n} from \"./stripeCheckout\";\nexport {\n isSyncWatermark,\n type SyncWatermark,\n SyncWatermarkSchema,\n} from \"./syncWatermark\";\nexport {\n decodeContainerWriterProjection,\n decodeDocumentWriterProjection,\n encodeContainerWriterProjection,\n encodeDocumentWriterProjection,\n} from \"./writerProjectionWire\";\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tearleads/client-sdk",
3
- "version": "0.1.43",
3
+ "version": "0.1.45",
4
4
  "description": "React-free Tearleads client runtime: local SQLite persistence, keys, sync, encrypted blobs, and domain workflows.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -1,6 +1,7 @@
1
+ import { MAX_CONTAINER_DOCUMENT_LANES } from "../../internal/validators/request/index.js";
1
2
  import { acknowledgeContainerForce, } from "./idleBackfill.js";
2
3
  import { rearmFailedSweepContainers, } from "./laneFailure.js";
3
- import { reconcileOneContainer } from "./reconcileContainer.js";
4
+ import { reconcileContainers, } from "./reconcileContainer.js";
4
5
  const pendingRetries = new WeakMap();
5
6
  export function clearPendingDiscoveryRetries(state) {
6
7
  for (const { timer } of pendingRetries.get(state)?.values() ?? [])
@@ -33,51 +34,62 @@ export function isCurrentReconciliationLifecycle(state, generation) {
33
34
  return (state.lifecycleGeneration === generation &&
34
35
  (state.active || generation === 0));
35
36
  }
36
- // Reconcile a container whose discovered mark is already set, rolling the mark
37
- // back when the container is skipped or fails so a transient error (or a
37
+ // Reconcile containers whose discovered marks are already set, rolling a mark
38
+ // back when its container is skipped or fails so a transient error (or a
38
39
  // container that later becomes eligible) can be retried.
39
- export async function reconcileMarkedContainer(host, state, containerId, forceDocumentContentPull, fullRevalidation = false) {
40
- try {
41
- const reconciled = await reconcileOneContainer(host, containerId, {
42
- forceDocumentContentPull,
43
- documentIds: fullRevalidation
44
- ? undefined
45
- : state.forcedDocumentIds.get(containerId),
46
- onFullListing: state.initialDocumentProbe.captureListing(containerId),
47
- onPendingDiscovery: (delayMs) => schedulePendingDiscovery(state, containerId, delayMs),
48
- });
49
- if (!reconciled) {
50
- state.discoveredContainerIds.delete(containerId);
40
+ export async function reconcileMarkedContainers(host, state, containers, fullRevalidation = false) {
41
+ const results = await reconcileContainers(host, containers.map(({ containerId, forceDocumentContentPull }) => ({
42
+ containerId,
43
+ documentIds: fullRevalidation
44
+ ? undefined
45
+ : state.forcedDocumentIds.get(containerId),
46
+ forceDocumentContentPull,
47
+ onFullListing: state.initialDocumentProbe.captureListing(containerId),
48
+ onPendingDiscovery: (delayMs) => schedulePendingDiscovery(state, containerId, delayMs),
49
+ })));
50
+ for (const result of results) {
51
+ if (result.status !== "reconciled") {
52
+ state.discoveredContainerIds.delete(result.containerId);
51
53
  }
52
- return reconciled;
53
- }
54
- catch (error) {
55
- state.discoveredContainerIds.delete(containerId);
56
- throw error;
57
54
  }
55
+ return results;
58
56
  }
59
- async function sweepContainer(input) {
60
- const { containerId, host, lifecycleGeneration, state } = input;
61
- if (!isCurrentReconciliationLifecycle(state, lifecycleGeneration)) {
62
- return { status: "stale" };
57
+ /**
58
+ * Reconciles one batch of a sweep. Force generations are read before the
59
+ * batched listing starts, so a hint arriving while the batch is in flight
60
+ * keeps its newer generation and runs again.
61
+ */
62
+ async function sweepContainerBatch(input) {
63
+ const { containerIds, forceAllDocumentContentPulls, host, state } = input;
64
+ const forceGenerations = new Map(containerIds.map((containerId) => [
65
+ containerId,
66
+ state.forcedContainerGenerations.get(containerId),
67
+ ]));
68
+ const results = await reconcileMarkedContainers(host, state, containerIds.map((containerId) => ({
69
+ containerId,
70
+ forceDocumentContentPull: forceAllDocumentContentPulls ||
71
+ forceGenerations.get(containerId) !== undefined,
72
+ })), forceAllDocumentContentPulls);
73
+ if (!isCurrentReconciliationLifecycle(state, input.lifecycleGeneration)) {
74
+ return null;
63
75
  }
64
- const forceGeneration = state.forcedContainerGenerations.get(containerId);
65
- try {
66
- const reconciled = await reconcileMarkedContainer(host, state, containerId, input.forceAllDocumentContentPulls || forceGeneration !== undefined, input.forceAllDocumentContentPulls);
67
- if (!isCurrentReconciliationLifecycle(state, lifecycleGeneration)) {
68
- return { status: "stale" };
69
- }
70
- if (reconciled) {
71
- acknowledgeContainerForce(state, containerId, forceGeneration);
76
+ const failedForces = [];
77
+ let firstError;
78
+ for (const result of results) {
79
+ const forceGeneration = forceGenerations.get(result.containerId);
80
+ if (result.status === "reconciled") {
81
+ acknowledgeContainerForce(state, result.containerId, forceGeneration);
72
82
  }
73
- return { status: "succeeded" };
74
- }
75
- catch (error) {
76
- if (!isCurrentReconciliationLifecycle(state, lifecycleGeneration)) {
77
- return { status: "stale" };
83
+ else if (result.status === "failed") {
84
+ if (forceGeneration !== undefined) {
85
+ failedForces.push({ containerId: result.containerId, forceGeneration });
86
+ }
87
+ if (!host.isIgnorableError(result.error) && firstError === undefined) {
88
+ firstError = result.error;
89
+ }
78
90
  }
79
- return { error, forceGeneration, status: "failed" };
80
91
  }
92
+ return { failedForces, firstError };
81
93
  }
82
94
  export async function sweepKnownContainers(input) {
83
95
  const { forceAllDocumentContentPulls, host, knownIds, lifecycleGeneration, state, } = input;
@@ -98,28 +110,19 @@ export async function sweepKnownContainers(input) {
98
110
  // block refreshing the rest. Surface the first real error after the sweep.
99
111
  let firstError;
100
112
  const failedForces = [];
101
- for (const containerId of containerIds) {
102
- const result = await sweepContainer({
103
- containerId,
113
+ for (let offset = 0; offset < containerIds.length; offset += MAX_CONTAINER_DOCUMENT_LANES) {
114
+ const batch = await sweepContainerBatch({
115
+ containerIds: containerIds.slice(offset, offset + MAX_CONTAINER_DOCUMENT_LANES),
104
116
  forceAllDocumentContentPulls,
105
117
  host,
106
118
  lifecycleGeneration,
107
119
  state,
108
120
  });
109
- if (result.status === "stale") {
121
+ if (!batch)
110
122
  return;
111
- }
112
- if (result.status === "failed") {
113
- if (result.forceGeneration !== undefined) {
114
- failedForces.push({
115
- containerId,
116
- forceGeneration: result.forceGeneration,
117
- });
118
- }
119
- if (!host.isIgnorableError(result.error) && firstError === undefined) {
120
- firstError = result.error;
121
- }
122
- }
123
+ failedForces.push(...batch.failedForces);
124
+ if (firstError === undefined)
125
+ firstError = batch.firstError;
123
126
  }
124
127
  rearmFailedSweepContainers(state, failedForces, lifecycleGeneration);
125
128
  if (firstError !== undefined) {
@@ -1 +1 @@
1
- {"version":3,"file":"knownContainerSweep.js","sourceRoot":"","sources":["knownContainerSweep.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,GAE1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEL,0BAA0B,GAC3B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAY7D,MAAM,cAAc,GAAG,IAAI,OAAO,EAG/B,CAAC;AAEJ,MAAM,UAAU,4BAA4B,CAC1C,KAA+B;IAE/B,KAAK,MAAM,EAAE,KAAK,EAAE,IAAI,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE;QAC/D,YAAY,CAAC,KAAK,CAAC,CAAC;IACtB,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED,SAAS,wBAAwB,CAC/B,KAA+B,EAC/B,WAAmB,EACnB,OAAe;IAEf,IAAI,CAAC,KAAK,CAAC,MAAM;QAAE,OAAO;IAC1B,MAAM,OAAO,GAAG,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,GAAG,EAAE,CAAC;I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C;QACvC,KAAK,CAAC,sBAAsB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAChD,CAAC;IACD,0EAA0E;IAC1E,2EAA2E;IAC3E,IAAI,UAAmB,CAAC;IACxB,MAAM,YAAY,GAA4B,EAAE,CAAC;IACjD,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE,CAAC;QACvC,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC;YAClC,WAAW;YACX,4BAA4B;YAC5B,IAAI;YACJ,mBAAmB;YACnB,KAAK;SACN,CAAC,CAAC;QACH,IAAI,MAAM,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;YAC9B,OAAO;QACT,CAAC;QACD,IAAI,MAAM,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC/B,IAAI,MAAM,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;gBACzC,YAAY,CAAC,IAAI,CAAC;oBAChB,WAAW;oBACX,eAAe,EAAE,MAAM,CAAC,eAAe;iBACxC,CAAC,CAAC;YACL,CAAC;YACD,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;gBACrE,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC;YAC5B,CAAC;QACH,CAAC;IACH,CAAC;IACD,0BAA0B,CAAC,KAAK,EAAE,YAAY,EAAE,mBAAmB,CAAC,CAAC;IACrE,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,MAAM,UAAU,CAAC;IACnB,CAAC;AACH,CAAC","sourcesContent":["import {\n acknowledgeContainerForce,\n type IdleBackfillState,\n} from \"./idleBackfill\";\nimport {\n type FailedForcedContainer,\n rearmFailedSweepContainers,\n} from \"./laneFailure\";\nimport { reconcileOneContainer } from \"./reconcileContainer\";\nimport type { ReconciliationHost } from \"./serviceTypes\";\n\ninterface KnownContainerSweepState extends IdleBackfillState {\n active: boolean;\n lane: {\n requestSync: () => void;\n requestSyncAfter: (delayMs: number) => void;\n } | null;\n lifecycleGeneration: number;\n}\n\nconst pendingRetries = new WeakMap<\n KnownContainerSweepState,\n Map<string, { due: number; timer: ReturnType<typeof setTimeout> }>\n>();\n\nexport function clearPendingDiscoveryRetries(\n state: KnownContainerSweepState,\n): void {\n for (const { timer } of pendingRetries.get(state)?.values() ?? [])\n clearTimeout(timer);\n pendingRetries.delete(state);\n}\n\nfunction schedulePendingDiscovery(\n state: KnownContainerSweepState,\n containerId: string,\n delayMs: number,\n): void {\n if (!state.active) return;\n const retries = pendingRetries.get(state) ?? new Map();\n pendingRetries.set(state, retries);\n const due = Date.now() + delayMs;\n const existing = retries.get(containerId);\n if (existing && existing.due <= due) return;\n if (existing) clearTimeout(existing.timer);\n const generation = state.lifecycleGeneration;\n const timer = setTimeout(\n () => {\n retries.delete(containerId);\n if (!state.active || state.lifecycleGeneration !== generation) return;\n state.discoveredContainerIds.delete(containerId);\n state.queue.enqueue(\n containerId,\n state.activeContainerId === containerId ? \"active\" : \"idle\",\n );\n state.lane?.requestSync();\n },\n Math.max(1, delayMs),\n );\n retries.set(containerId, { due, timer });\n}\n\nexport function isCurrentReconciliationLifecycle(\n state: KnownContainerSweepState,\n generation: number,\n): boolean {\n return (\n state.lifecycleGeneration === generation &&\n (state.active || generation === 0)\n );\n}\n\n// Reconcile a container whose discovered mark is already set, rolling the mark\n// back when the container is skipped or fails so a transient error (or a\n// container that later becomes eligible) can be retried.\nexport async function reconcileMarkedContainer(\n host: ReconciliationHost,\n state: KnownContainerSweepState,\n containerId: string,\n forceDocumentContentPull: boolean,\n fullRevalidation = false,\n): Promise<boolean> {\n try {\n const reconciled = await reconcileOneContainer(host, containerId, {\n forceDocumentContentPull,\n documentIds: fullRevalidation\n ? undefined\n : state.forcedDocumentIds.get(containerId),\n onFullListing: state.initialDocumentProbe.captureListing(containerId),\n onPendingDiscovery: (delayMs) =>\n schedulePendingDiscovery(state, containerId, delayMs),\n });\n if (!reconciled) {\n state.discoveredContainerIds.delete(containerId);\n }\n return reconciled;\n } catch (error) {\n state.discoveredContainerIds.delete(containerId);\n throw error;\n }\n}\n\ntype SweepContainerResult =\n | { status: \"failed\"; error: unknown; forceGeneration: number | undefined }\n | { status: \"stale\" }\n | { status: \"succeeded\" };\n\nasync function sweepContainer(input: {\n containerId: string;\n forceAllDocumentContentPulls: boolean;\n host: ReconciliationHost;\n lifecycleGeneration: number;\n state: KnownContainerSweepState;\n}): Promise<SweepContainerResult> {\n const { containerId, host, lifecycleGeneration, state } = input;\n if (!isCurrentReconciliationLifecycle(state, lifecycleGeneration)) {\n return { status: \"stale\" };\n }\n const forceGeneration = state.forcedContainerGenerations.get(containerId);\n try {\n const reconciled = await reconcileMarkedContainer(\n host,\n state,\n containerId,\n input.forceAllDocumentContentPulls || forceGeneration !== undefined,\n input.forceAllDocumentContentPulls,\n );\n if (!isCurrentReconciliationLifecycle(state, lifecycleGeneration)) {\n return { status: \"stale\" };\n }\n if (reconciled) {\n acknowledgeContainerForce(state, containerId, forceGeneration);\n }\n return { status: \"succeeded\" };\n } catch (error) {\n if (!isCurrentReconciliationLifecycle(state, lifecycleGeneration)) {\n return { status: \"stale\" };\n }\n return { error, forceGeneration, status: \"failed\" };\n }\n}\n\nexport async function sweepKnownContainers(input: {\n forceAllDocumentContentPulls: boolean;\n host: ReconciliationHost;\n knownIds: ReadonlyArray<string>;\n lifecycleGeneration: number;\n state: KnownContainerSweepState;\n}): Promise<void> {\n const {\n forceAllDocumentContentPulls,\n host,\n knownIds,\n lifecycleGeneration,\n state,\n } = input;\n if (!isCurrentReconciliationLifecycle(state, lifecycleGeneration)) {\n return;\n }\n const containerIds = forceAllDocumentContentPulls\n ? knownIds\n : knownIds.filter(\n (containerId) =>\n state.forcedContainerGenerations.has(containerId) ||\n !state.discoveredContainerIds.has(containerId),\n );\n // Mark only the containers this sweep will fetch. Automatic root hints are\n // discovery signals, so already-reconciled containers stay settled unless a\n // targeted event forced them; explicit full refreshes still fetch every id.\n for (const containerId of containerIds) {\n state.discoveredContainerIds.add(containerId);\n }\n // Reconcile every container independently: one failing container must not\n // block refreshing the rest. Surface the first real error after the sweep.\n let firstError: unknown;\n const failedForces: FailedForcedContainer[] = [];\n for (const containerId of containerIds) {\n const result = await sweepContainer({\n containerId,\n forceAllDocumentContentPulls,\n host,\n lifecycleGeneration,\n state,\n });\n if (result.status === \"stale\") {\n return;\n }\n if (result.status === \"failed\") {\n if (result.forceGeneration !== undefined) {\n failedForces.push({\n containerId,\n forceGeneration: result.forceGeneration,\n });\n }\n if (!host.isIgnorableError(result.error) && firstError === undefined) {\n firstError = result.error;\n }\n }\n }\n rearmFailedSweepContainers(state, failedForces, lifecycleGeneration);\n if (firstError !== undefined) {\n throw firstError;\n }\n}\n"]}
1
+ {"version":3,"file":"knownContainerSweep.js","sourceRoot":"","sources":["knownContainerSweep.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EACL,yBAAyB,GAE1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEL,0BAA0B,GAC3B,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAY9B,MAAM,cAAc,GAAG,IAAI,OAAO,EAG/B,CAAC;AAEJ,MAAM,UAAU,4BAA4B,CAC1C,KAA+B;IAE/B,KAAK,MAAM,EAAE,KAAK,EAAE,IAAI,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE;QAC/D,YAAY,CAAC,KAAK,CAAC,CAAC;IACtB,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED,SAAS,wBAAwB,CAC/B,KAA+B,EAC/B,WAAmB,EACnB,OAAe;IAEf,IAAI,CAAC,KAAK,CAAC,MAAM;QAAE,OAAO;IAC1B,MAAM,OAAO,GAAG,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,GA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QAC7B,MAAM,UAAU,CAAC;IACnB,CAAC;AACH,CAAC","sourcesContent":["import { MAX_CONTAINER_DOCUMENT_LANES } from \"@tearleads/validators/request\";\nimport {\n acknowledgeContainerForce,\n type IdleBackfillState,\n} from \"./idleBackfill\";\nimport {\n type FailedForcedContainer,\n rearmFailedSweepContainers,\n} from \"./laneFailure\";\nimport {\n type ContainerReconcileResult,\n reconcileContainers,\n} from \"./reconcileContainer\";\nimport type { ReconciliationHost } from \"./serviceTypes\";\n\ninterface KnownContainerSweepState extends IdleBackfillState {\n active: boolean;\n lane: {\n requestSync: () => void;\n requestSyncAfter: (delayMs: number) => void;\n } | null;\n lifecycleGeneration: number;\n}\n\nconst pendingRetries = new WeakMap<\n KnownContainerSweepState,\n Map<string, { due: number; timer: ReturnType<typeof setTimeout> }>\n>();\n\nexport function clearPendingDiscoveryRetries(\n state: KnownContainerSweepState,\n): void {\n for (const { timer } of pendingRetries.get(state)?.values() ?? [])\n clearTimeout(timer);\n pendingRetries.delete(state);\n}\n\nfunction schedulePendingDiscovery(\n state: KnownContainerSweepState,\n containerId: string,\n delayMs: number,\n): void {\n if (!state.active) return;\n const retries = pendingRetries.get(state) ?? new Map();\n pendingRetries.set(state, retries);\n const due = Date.now() + delayMs;\n const existing = retries.get(containerId);\n if (existing && existing.due <= due) return;\n if (existing) clearTimeout(existing.timer);\n const generation = state.lifecycleGeneration;\n const timer = setTimeout(\n () => {\n retries.delete(containerId);\n if (!state.active || state.lifecycleGeneration !== generation) return;\n state.discoveredContainerIds.delete(containerId);\n state.queue.enqueue(\n containerId,\n state.activeContainerId === containerId ? \"active\" : \"idle\",\n );\n state.lane?.requestSync();\n },\n Math.max(1, delayMs),\n );\n retries.set(containerId, { due, timer });\n}\n\nexport function isCurrentReconciliationLifecycle(\n state: KnownContainerSweepState,\n generation: number,\n): boolean {\n return (\n state.lifecycleGeneration === generation &&\n (state.active || generation === 0)\n );\n}\n\n// Reconcile containers whose discovered marks are already set, rolling a mark\n// back when its container is skipped or fails so a transient error (or a\n// container that later becomes eligible) can be retried.\nexport async function reconcileMarkedContainers(\n host: ReconciliationHost,\n state: KnownContainerSweepState,\n containers: ReadonlyArray<{\n readonly containerId: string;\n readonly forceDocumentContentPull: boolean;\n }>,\n fullRevalidation = false,\n): Promise<ReadonlyArray<ContainerReconcileResult>> {\n const results = await reconcileContainers(\n host,\n containers.map(({ containerId, forceDocumentContentPull }) => ({\n containerId,\n documentIds: fullRevalidation\n ? undefined\n : state.forcedDocumentIds.get(containerId),\n forceDocumentContentPull,\n onFullListing: state.initialDocumentProbe.captureListing(containerId),\n onPendingDiscovery: (delayMs: number) =>\n schedulePendingDiscovery(state, containerId, delayMs),\n })),\n );\n for (const result of results) {\n if (result.status !== \"reconciled\") {\n state.discoveredContainerIds.delete(result.containerId);\n }\n }\n return results;\n}\n\n/**\n * Reconciles one batch of a sweep. Force generations are read before the\n * batched listing starts, so a hint arriving while the batch is in flight\n * keeps its newer generation and runs again.\n */\nasync function sweepContainerBatch(input: {\n containerIds: ReadonlyArray<string>;\n forceAllDocumentContentPulls: boolean;\n host: ReconciliationHost;\n lifecycleGeneration: number;\n state: KnownContainerSweepState;\n}): Promise<{\n readonly failedForces: ReadonlyArray<FailedForcedContainer>;\n readonly firstError: unknown;\n} | null> {\n const { containerIds, forceAllDocumentContentPulls, host, state } = input;\n const forceGenerations = new Map(\n containerIds.map((containerId) => [\n containerId,\n state.forcedContainerGenerations.get(containerId),\n ]),\n );\n const results = await reconcileMarkedContainers(\n host,\n state,\n containerIds.map((containerId) => ({\n containerId,\n forceDocumentContentPull:\n forceAllDocumentContentPulls ||\n forceGenerations.get(containerId) !== undefined,\n })),\n forceAllDocumentContentPulls,\n );\n if (!isCurrentReconciliationLifecycle(state, input.lifecycleGeneration)) {\n return null;\n }\n const failedForces: FailedForcedContainer[] = [];\n let firstError: unknown;\n for (const result of results) {\n const forceGeneration = forceGenerations.get(result.containerId);\n if (result.status === \"reconciled\") {\n acknowledgeContainerForce(state, result.containerId, forceGeneration);\n } else if (result.status === \"failed\") {\n if (forceGeneration !== undefined) {\n failedForces.push({ containerId: result.containerId, forceGeneration });\n }\n if (!host.isIgnorableError(result.error) && firstError === undefined) {\n firstError = result.error;\n }\n }\n }\n return { failedForces, firstError };\n}\n\nexport async function sweepKnownContainers(input: {\n forceAllDocumentContentPulls: boolean;\n host: ReconciliationHost;\n knownIds: ReadonlyArray<string>;\n lifecycleGeneration: number;\n state: KnownContainerSweepState;\n}): Promise<void> {\n const {\n forceAllDocumentContentPulls,\n host,\n knownIds,\n lifecycleGeneration,\n state,\n } = input;\n if (!isCurrentReconciliationLifecycle(state, lifecycleGeneration)) {\n return;\n }\n const containerIds = forceAllDocumentContentPulls\n ? knownIds\n : knownIds.filter(\n (containerId) =>\n state.forcedContainerGenerations.has(containerId) ||\n !state.discoveredContainerIds.has(containerId),\n );\n // Mark only the containers this sweep will fetch. Automatic root hints are\n // discovery signals, so already-reconciled containers stay settled unless a\n // targeted event forced them; explicit full refreshes still fetch every id.\n for (const containerId of containerIds) {\n state.discoveredContainerIds.add(containerId);\n }\n // Reconcile every container independently: one failing container must not\n // block refreshing the rest. Surface the first real error after the sweep.\n let firstError: unknown;\n const failedForces: FailedForcedContainer[] = [];\n for (\n let offset = 0;\n offset < containerIds.length;\n offset += MAX_CONTAINER_DOCUMENT_LANES\n ) {\n const batch = await sweepContainerBatch({\n containerIds: containerIds.slice(\n offset,\n offset + MAX_CONTAINER_DOCUMENT_LANES,\n ),\n forceAllDocumentContentPulls,\n host,\n lifecycleGeneration,\n state,\n });\n if (!batch) return;\n failedForces.push(...batch.failedForces);\n if (firstError === undefined) firstError = batch.firstError;\n }\n rearmFailedSweepContainers(state, failedForces, lifecycleGeneration);\n if (firstError !== undefined) {\n throw firstError;\n }\n}\n"]}
@@ -1,31 +1,63 @@
1
- export async function reconcileOneContainer(host, containerId, options = {}) {
2
- // A queued local root/system id can become stale before the document phase.
3
- if (!host.canDiscoverContainerDocuments(containerId)) {
4
- return false;
5
- }
1
+ async function settleDiscoveredContainer(host, entry, outcome, pending) {
2
+ const { containerId } = entry;
6
3
  try {
7
- let pending = false;
8
- const discovered = await host.discoverContainerDocuments(containerId, options.onFullListing, (delayMs) => {
9
- pending = true;
10
- options.onPendingDiscovery?.(delayMs);
11
- });
12
- if (discovered === null && !pending) {
13
- return false;
4
+ if (outcome.status === "rejected")
5
+ throw outcome.reason;
6
+ if (outcome.value === null && !pending) {
7
+ return { containerId, status: "skipped" };
14
8
  }
15
9
  const delta = await host.loadContainerDelta(containerId);
16
10
  host.applyReconciled(delta);
17
11
  // Hint forces target named documents. Full refreshes revalidate every
18
12
  // registered store; passive pulls only open system projections.
19
- host.requestDocumentContentPull(containerId, delta.documentSummaries, options.forceDocumentContentPull ?? false, options.documentIds);
13
+ host.requestDocumentContentPull(containerId, delta.documentSummaries, entry.forceDocumentContentPull, entry.documentIds);
20
14
  // A durable, scheduled retry is settled for this sweep and force request.
21
15
  // Its own timer will reopen the lane when evidence is due.
22
- return true;
16
+ return { containerId, status: "reconciled" };
23
17
  }
24
18
  catch (error) {
25
- if (host.isIgnorableError(error)) {
26
- return false;
19
+ return host.isIgnorableError(error)
20
+ ? { containerId, status: "skipped" }
21
+ : { containerId, error, status: "failed" };
22
+ }
23
+ }
24
+ /**
25
+ * Lists every entry's documents in one batched discovery, then reconciles each
26
+ * container as soon as its lane applies. Results follow entry order; one
27
+ * container's failure never hides another's result.
28
+ */
29
+ export async function reconcileContainers(host, entries) {
30
+ // A queued local root/system id can become stale before the document phase.
31
+ const eligible = new Map(entries
32
+ .filter((entry) => host.canDiscoverContainerDocuments(entry.containerId))
33
+ .map((entry) => [entry.containerId, entry]));
34
+ const pending = new Set();
35
+ const results = new Map();
36
+ const settle = async (outcome) => {
37
+ const entry = eligible.get(outcome.containerId);
38
+ if (!entry || results.has(entry.containerId))
39
+ return;
40
+ results.set(entry.containerId, await settleDiscoveredContainer(host, entry, outcome, pending.has(entry.containerId)));
41
+ };
42
+ if (eligible.size > 0) {
43
+ try {
44
+ const outcomes = await host.discoverContainerDocuments([...eligible.values()].map((entry) => ({
45
+ containerId: entry.containerId,
46
+ onFullListing: entry.onFullListing,
47
+ onPendingDiscovery: (delayMs) => {
48
+ pending.add(entry.containerId);
49
+ entry.onPendingDiscovery?.(delayMs);
50
+ },
51
+ })), settle);
52
+ for (const outcome of outcomes)
53
+ await settle(outcome);
54
+ }
55
+ catch (reason) {
56
+ for (const containerId of eligible.keys()) {
57
+ await settle({ containerId, reason, status: "rejected" });
58
+ }
27
59
  }
28
- throw error;
29
60
  }
61
+ return entries.map(({ containerId }) => results.get(containerId) ?? { containerId, status: "skipped" });
30
62
  }
31
63
  //# sourceMappingURL=reconcileContainer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"reconcileContainer.js","sourceRoot":"","sources":["reconcileContainer.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,IAAwB,EACxB,WAAmB,EACnB,UAKI,EAAE;IAEN,4EAA4E;IAC5E,IAAI,CAAC,IAAI,CAAC,6BAA6B,CAAC,WAAW,CAAC,EAAE,CAAC;QACrD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,CAAC;QACH,IAAI,OAAO,GAAG,KAAK,CAAC;QACpB,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,0BAA0B,CACtD,WAAW,EACX,OAAO,CAAC,aAAa,EACrB,CAAC,OAAO,EAAE,EAAE;YACV,OAAO,GAAG,IAAI,CAAC;YACf,OAAO,CAAC,kBAAkB,EAAE,CAAC,OAAO,CAAC,CAAC;QACxC,CAAC,CACF,CAAC;QACF,IAAI,UAAU,KAAK,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACpC,OAAO,KAAK,CAAC;QACf,CAAC;QACD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;QACzD,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QAC5B,sEAAsE;QACtE,gEAAgE;QAChE,IAAI,CAAC,0BAA0B,CAC7B,WAAW,EACX,KAAK,CAAC,iBAAiB,EACvB,OAAO,CAAC,wBAAwB,IAAI,KAAK,EACzC,OAAO,CAAC,WAAW,CACpB,CAAC;QACF,0EAA0E;QAC1E,2DAA2D;QAC3D,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;YACjC,OAAO,KAAK,CAAC;QACf,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC","sourcesContent":["import type { ReconciliationHost } from \"./serviceTypes\";\n\nexport async function reconcileOneContainer(\n host: ReconciliationHost,\n containerId: string,\n options: {\n forceDocumentContentPull?: boolean;\n documentIds?: ReadonlySet<string> | undefined;\n onFullListing?: ((documentIds: ReadonlyArray<string>) => void) | undefined;\n onPendingDiscovery?: ((delayMs: number) => void) | undefined;\n } = {},\n): Promise<boolean> {\n // A queued local root/system id can become stale before the document phase.\n if (!host.canDiscoverContainerDocuments(containerId)) {\n return false;\n }\n\n try {\n let pending = false;\n const discovered = await host.discoverContainerDocuments(\n containerId,\n options.onFullListing,\n (delayMs) => {\n pending = true;\n options.onPendingDiscovery?.(delayMs);\n },\n );\n if (discovered === null && !pending) {\n return false;\n }\n const delta = await host.loadContainerDelta(containerId);\n host.applyReconciled(delta);\n // Hint forces target named documents. Full refreshes revalidate every\n // registered store; passive pulls only open system projections.\n host.requestDocumentContentPull(\n containerId,\n delta.documentSummaries,\n options.forceDocumentContentPull ?? false,\n options.documentIds,\n );\n // A durable, scheduled retry is settled for this sweep and force request.\n // Its own timer will reopen the lane when evidence is due.\n return true;\n } catch (error) {\n if (host.isIgnorableError(error)) {\n return false;\n }\n throw error;\n }\n}\n"]}
1
+ {"version":3,"file":"reconcileContainer.js","sourceRoot":"","sources":["reconcileContainer.ts"],"names":[],"mappings":"AAuBA,KAAK,UAAU,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C;QAAC,OAAO,MAAM,EAAE,CAAC;YAChB,KAAK,MAAM,WAAW,IAAI,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC;gBAC1C,MAAM,MAAM,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;YAC5D,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC,GAAG,CAChB,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAClB,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,CACjE,CAAC;AACJ,CAAC","sourcesContent":["import type {\n ContainerDiscoveryOutcome,\n ReconciliationHost,\n} from \"./serviceTypes\";\n\nexport interface ContainerReconcileEntry {\n readonly containerId: string;\n readonly documentIds?: ReadonlySet<string> | undefined;\n readonly forceDocumentContentPull: boolean;\n readonly onFullListing?:\n | ((documentIds: ReadonlyArray<string>) => void)\n | undefined;\n readonly onPendingDiscovery?: ((delayMs: number) => void) | undefined;\n}\n\nexport type ContainerReconcileResult =\n | { readonly containerId: string; readonly status: \"reconciled\" | \"skipped\" }\n | {\n readonly containerId: string;\n readonly error: unknown;\n readonly status: \"failed\";\n };\n\nasync function settleDiscoveredContainer(\n host: ReconciliationHost,\n entry: ContainerReconcileEntry,\n outcome: ContainerDiscoveryOutcome,\n pending: boolean,\n): Promise<ContainerReconcileResult> {\n const { containerId } = entry;\n try {\n if (outcome.status === \"rejected\") throw outcome.reason;\n if (outcome.value === null && !pending) {\n return { containerId, status: \"skipped\" };\n }\n const delta = await host.loadContainerDelta(containerId);\n host.applyReconciled(delta);\n // Hint forces target named documents. Full refreshes revalidate every\n // registered store; passive pulls only open system projections.\n host.requestDocumentContentPull(\n containerId,\n delta.documentSummaries,\n entry.forceDocumentContentPull,\n entry.documentIds,\n );\n // A durable, scheduled retry is settled for this sweep and force request.\n // Its own timer will reopen the lane when evidence is due.\n return { containerId, status: \"reconciled\" };\n } catch (error) {\n return host.isIgnorableError(error)\n ? { containerId, status: \"skipped\" }\n : { containerId, error, status: \"failed\" };\n }\n}\n\n/**\n * Lists every entry's documents in one batched discovery, then reconciles each\n * container as soon as its lane applies. Results follow entry order; one\n * container's failure never hides another's result.\n */\nexport async function reconcileContainers(\n host: ReconciliationHost,\n entries: ReadonlyArray<ContainerReconcileEntry>,\n): Promise<ReadonlyArray<ContainerReconcileResult>> {\n // A queued local root/system id can become stale before the document phase.\n const eligible = new Map(\n entries\n .filter((entry) => host.canDiscoverContainerDocuments(entry.containerId))\n .map((entry) => [entry.containerId, entry]),\n );\n const pending = new Set<string>();\n const results = new Map<string, ContainerReconcileResult>();\n const settle = async (outcome: ContainerDiscoveryOutcome) => {\n const entry = eligible.get(outcome.containerId);\n if (!entry || results.has(entry.containerId)) return;\n results.set(\n entry.containerId,\n await settleDiscoveredContainer(\n host,\n entry,\n outcome,\n pending.has(entry.containerId),\n ),\n );\n };\n if (eligible.size > 0) {\n try {\n const outcomes = await host.discoverContainerDocuments(\n [...eligible.values()].map((entry) => ({\n containerId: entry.containerId,\n onFullListing: entry.onFullListing,\n onPendingDiscovery: (delayMs: number) => {\n pending.add(entry.containerId);\n entry.onPendingDiscovery?.(delayMs);\n },\n })),\n settle,\n );\n for (const outcome of outcomes) await settle(outcome);\n } catch (reason) {\n for (const containerId of eligible.keys()) {\n await settle({ containerId, reason, status: \"rejected\" });\n }\n }\n }\n return entries.map(\n ({ containerId }) =>\n results.get(containerId) ?? { containerId, status: \"skipped\" },\n );\n}\n"]}
@@ -1,20 +1,36 @@
1
1
  import { getOrCreateDomainSyncCoordinator, } from "../../data/sync/syncCoordinator.js";
2
2
  import { acknowledgeContainerForce, activateContainer, enqueueKnownContainersForIdleBackfill, markContainerForced, } from "./idleBackfill.js";
3
3
  import { createInitialDocumentProbe } from "./initialDocumentProbe.js";
4
- import { clearPendingDiscoveryRetries, isCurrentReconciliationLifecycle, reconcileMarkedContainer, sweepKnownContainers, } from "./knownContainerSweep.js";
4
+ import { clearPendingDiscoveryRetries, isCurrentReconciliationLifecycle, reconcileMarkedContainers, sweepKnownContainers, } from "./knownContainerSweep.js";
5
5
  import { rearmFailedContainer } from "./laneFailure.js";
6
6
  import { clearOriginatedDocuments } from "./originatedDocuments.js";
7
7
  import { createReconcileQueue } from "./queue.js";
8
8
  function canReconcile(status) {
9
9
  return status.dbStatus === "ready" && status.isAuthenticated && status.online;
10
10
  }
11
+ /**
12
+ * Queued containers one lane run lists together. Each still verifies and
13
+ * applies on its own; the bound keeps one run's head verification well
14
+ * inside the lane watchdog.
15
+ */
16
+ const RECONCILE_LANE_BATCH_SIZE = 4;
17
+ function dequeueContainerBatch(state) {
18
+ const containerIds = [];
19
+ while (containerIds.length < RECONCILE_LANE_BATCH_SIZE) {
20
+ const containerId = state.queue.dequeue();
21
+ if (!containerId)
22
+ break;
23
+ containerIds.push(containerId);
24
+ }
25
+ return containerIds;
26
+ }
11
27
  async function runReconcileLane(host, state) {
12
28
  if (!state.active || !canReconcile(host.getRuntimeStatus())) {
13
29
  return;
14
30
  }
15
31
  const lifecycleGeneration = state.lifecycleGeneration;
16
- const containerId = state.queue.dequeue();
17
- if (!containerId) {
32
+ const containerIds = dequeueContainerBatch(state);
33
+ if (containerIds.length === 0) {
18
34
  await state.initialDocumentProbe.run();
19
35
  scheduleProbeContinuation(host, state);
20
36
  return;
@@ -22,22 +38,34 @@ async function runReconcileLane(host, state) {
22
38
  // Double-check at run time: a container may have been discovered (by an
23
39
  // explicit refresh or an earlier lane pass) after it was queued. Mark it
24
40
  // discovered up front to collapse concurrent re-enqueues into one fetch, but
25
- // roll the mark back on failure so a transient error can be retried later.
26
- const forceGeneration = state.forcedContainerGenerations.get(containerId);
27
- const shouldForce = forceGeneration !== undefined;
28
- if (shouldForce || !state.discoveredContainerIds.has(containerId)) {
41
+ // roll the mark back on failure so a transient error can be retried. Force
42
+ // generations are read before the batched listing starts.
43
+ const batch = containerIds.flatMap((containerId) => {
44
+ const forceGeneration = state.forcedContainerGenerations.get(containerId);
45
+ if (forceGeneration === undefined &&
46
+ state.discoveredContainerIds.has(containerId)) {
47
+ return [];
48
+ }
29
49
  state.discoveredContainerIds.add(containerId);
30
- try {
31
- const reconciled = await reconcileMarkedContainer(host, state, containerId, shouldForce);
32
- if (reconciled) {
33
- acknowledgeContainerForce(state, containerId, forceGeneration);
34
- }
50
+ return [{ containerId, forceGeneration }];
51
+ });
52
+ const results = await reconcileMarkedContainers(host, state, batch.map(({ containerId, forceGeneration }) => ({
53
+ containerId,
54
+ forceDocumentContentPull: forceGeneration !== undefined,
55
+ })));
56
+ let firstError;
57
+ results.forEach((result, index) => {
58
+ const forceGeneration = batch[index]?.forceGeneration;
59
+ if (result.status === "reconciled") {
60
+ acknowledgeContainerForce(state, result.containerId, forceGeneration);
35
61
  }
36
- catch (error) {
37
- rearmFailedContainer(state, containerId, forceGeneration, lifecycleGeneration);
38
- throw error;
62
+ else if (result.status === "failed") {
63
+ rearmFailedContainer(state, result.containerId, forceGeneration, lifecycleGeneration);
64
+ firstError ??= result.error;
39
65
  }
40
- }
66
+ });
67
+ if (firstError !== undefined)
68
+ throw firstError;
41
69
  // Keep draining: schedule another pass while the queue holds work.
42
70
  if (state.queue.size > 0) {
43
71
  state.lane?.requestSync();