@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.
- package/client/Tearleads.d.ts +3 -0
- package/client/Tearleads.js +20 -12
- package/client/Tearleads.js.map +1 -1
- package/client/organizations/organizationGroupPresentation.d.ts +1 -12
- package/client/session/index.js +2 -2
- package/client/session/index.js.map +1 -1
- package/client/session/sessionOrganizationCreation.js +1 -0
- package/client/session/sessionOrganizationCreation.js.map +1 -1
- package/client/session/sessionTypes.d.ts +3 -0
- package/client/session/sessionTypes.js.map +1 -1
- package/client/workflowRuntime.d.ts +2 -0
- package/client/workflowRuntime.js +34 -16
- package/client/workflowRuntime.js.map +1 -1
- package/data/persistence/documents/documentDiscoveryEvidencePersistence.d.ts +16 -0
- package/data/persistence/documents/documentDiscoveryEvidencePersistence.js +23 -0
- package/data/persistence/documents/documentDiscoveryEvidencePersistence.js.map +1 -1
- package/data/persistence/organizations/organizationReadModelGrantPersistence.js +2 -1
- package/data/persistence/organizations/organizationReadModelGrantPersistence.js.map +1 -1
- package/data/persistence/organizations/organizationReadModelMemberLoad.d.ts +9 -0
- package/data/persistence/organizations/organizationReadModelMemberLoad.js +29 -21
- package/data/persistence/organizations/organizationReadModelMemberLoad.js.map +1 -1
- package/data/persistence/organizations/organizationReadModelMembershipPersistence.js +91 -46
- package/data/persistence/organizations/organizationReadModelMembershipPersistence.js.map +1 -1
- package/data/persistence/organizations/organizationReadModelPersistence.js +95 -73
- package/data/persistence/organizations/organizationReadModelPersistence.js.map +1 -1
- package/data/persistence/organizations/organizationReadModelProjection.js +78 -89
- package/data/persistence/organizations/organizationReadModelProjection.js.map +1 -1
- package/data/persistence/organizations/organizationReadModelPurge.js +14 -15
- package/data/persistence/organizations/organizationReadModelPurge.js.map +1 -1
- package/data/sqlite/organizationReadModelSchema.js +23 -28
- package/data/sqlite/organizationReadModelSchema.js.map +1 -1
- package/data/sqlite/organizationReadModelTableRegistry.d.ts +116 -263
- package/data/sqlite/organizationReadModelTableRegistry.js +10 -7
- package/data/sqlite/organizationReadModelTableRegistry.js.map +1 -1
- package/data/sqlite/schema.d.ts +116 -263
- package/data/sqlite/sqliteBindBudget.js +30 -0
- package/data/sqlite/sqliteBindBudget.js.map +1 -0
- package/data/trustedUserIdentity/index.d.ts +1 -1
- package/data/trustedUserIdentity/index.js +1 -1
- package/data/trustedUserIdentity/index.js.map +1 -1
- package/data/trustedUserIdentity/service.d.ts +12 -1
- package/data/trustedUserIdentity/service.js +27 -3
- package/data/trustedUserIdentity/service.js.map +1 -1
- package/internal/validators/operation/organizations.d.ts +0 -16
- package/internal/validators/response/index.d.ts +1 -1
- package/internal/validators/response/index.js.map +1 -1
- package/internal/validators/response/organizationReadModel.d.ts +10 -48
- package/internal/validators/response/organizationReadModel.js +9 -1
- package/internal/validators/response/organizationReadModel.js.map +1 -1
- package/package.json +1 -1
- package/workflows/organizations/createOrganization.d.ts +3 -0
- package/workflows/organizations/createOrganization.js +1 -0
- package/workflows/organizations/createOrganization.js.map +1 -1
- package/workflows/organizations/readModel.d.ts +8 -3
- package/workflows/organizations/readModel.js.map +1 -1
- package/workflows/organizations/readModelProjection.d.ts +2 -12
- package/workflows/organizations/readModelProjection.js +1 -1
- package/workflows/organizations/readModelProjection.js.map +1 -1
- package/workflows/registration/organizationProvisioningPersistence.d.ts +3 -0
- package/workflows/registration/organizationProvisioningPersistence.js +27 -1
- package/workflows/registration/organizationProvisioningPersistence.js.map +1 -1
- package/workflows/registration/persistRegistrationBootstrap.d.ts +3 -0
- package/workflows/registration/persistRegistrationBootstrap.js +7 -1
- package/workflows/registration/persistRegistrationBootstrap.js.map +1 -1
- package/workflows/registration/provisionedPrincipalHistory.d.ts +45 -0
- package/workflows/registration/provisionedPrincipalHistory.js +104 -0
- package/workflows/registration/provisionedPrincipalHistory.js.map +1 -0
- package/workflows/registration/provisioningAcknowledgement.js +18 -0
- package/workflows/registration/provisioningAcknowledgement.js.map +1 -1
- package/workflows/registration/registerIdentity.d.ts +3 -0
- package/workflows/registration/registerIdentity.js +1 -0
- package/workflows/registration/registerIdentity.js.map +1 -1
- package/workflows/sync/remoteReset.js +1 -3
- package/workflows/sync/remoteReset.js.map +1 -1
- package/data/persistence/organizations/organizationReadModelPolicyHeadPersistence.js +0 -64
- package/data/persistence/organizations/organizationReadModelPolicyHeadPersistence.js.map +0 -1
|
@@ -26,7 +26,7 @@ export { isOrganizationNativePurchaseEligibilityResponse, type OrganizationNativ
|
|
|
26
26
|
export { type OrganizationPolicyHistoryResponse, OrganizationPolicyHistoryResponseSchema, PRINCIPAL_DISPLAY_HISTORY_PAGE_SIZE, } from "./organizationPolicyHistory.js";
|
|
27
27
|
export { ORGANIZATION_PRESENTATION_ERROR_CODES, type OrganizationPresentationErrorCode, OrganizationPresentationErrorCodeSchema, type OrganizationPresentationFailureResponse, OrganizationPresentationFailureResponseSchema, } from "./organizationPresentationError.js";
|
|
28
28
|
export { type CreateOrganizationResponse, CreateOrganizationResponseSchema, isCreateOrganizationResponse, isOrganizationProvisioningResponse, type OrganizationProvisioningResponse, OrganizationProvisioningResponseSchema, } from "./organizationProvisioning.js";
|
|
29
|
-
export { isOrganizationReadModelResponse, type OrganizationReadModelDeltaResponse, type OrganizationReadModelDirectoryResponse, type OrganizationReadModelGrantsResponse, type OrganizationReadModelGroupMembershipResponse, type OrganizationReadModelGroupMembershipsResponse, type OrganizationReadModelOrganizationPolicyResponse, type OrganizationReadModelResponse, OrganizationReadModelResponseSchema, type OrganizationReadModelSnapshotResponse, } from "./organizationReadModel.js";
|
|
29
|
+
export { isOrganizationReadModelResponse, type OrganizationReadModelDeltaResponse, type OrganizationReadModelDirectoryResponse, type OrganizationReadModelGrantsResponse, type OrganizationReadModelGroupMemberResponse, type OrganizationReadModelGroupMembershipResponse, type OrganizationReadModelGroupMembershipsResponse, type OrganizationReadModelOrganizationPolicyResponse, type OrganizationReadModelResponse, OrganizationReadModelResponseSchema, type OrganizationReadModelSnapshotResponse, } from "./organizationReadModel.js";
|
|
30
30
|
export { ORGANIZATION_READ_MODEL_ERROR_CODES, type OrganizationReadModelErrorCode, OrganizationReadModelErrorCodeSchema, type OrganizationReadModelFailureResponse, OrganizationReadModelFailureResponseSchema, } from "./organizationReadModelError.js";
|
|
31
31
|
export { CommitOrganizationGroupPolicyConflictResponseSchema, type CommitOrganizationGroupPolicyResponse, CommitOrganizationGroupPolicyResponseSchema, type CurrentPrincipalMemberEnvelopesResponse, CurrentPrincipalMemberEnvelopesResponseSchema, isCommitOrganizationGroupPolicyResponse, isCurrentPrincipalMemberEnvelopesResponse, isPrincipalPolicyBundleResponse, isPrincipalPolicyMutationResponse, isPrincipalPolicyStaleErrorResponse, isPrincipalPolicyStateChainEntryResponse, isPrincipalStatePayloadResponse, isPrincipalStateResponse, type PrincipalContainerGrantResponse, PrincipalContainerGrantResponseSchema, type PrincipalMemberEnvelopeResponse, PrincipalMemberEnvelopeResponseSchema, type PrincipalPolicyBundleResponse, PrincipalPolicyBundleResponseSchema, type PrincipalPolicyErrorResponse, PrincipalPolicyErrorResponseSchema, type PrincipalPolicyMutationResponse, PrincipalPolicyMutationResponseSchema, type PrincipalPolicySnapshotResponse, PrincipalPolicySnapshotResponseSchema, type PrincipalPolicyStaleErrorResponse, PrincipalPolicyStaleErrorResponseSchema, type PrincipalPolicyStateChainEntryResponse, PrincipalPolicyStateChainEntryResponseSchema, type PrincipalProjectionMemberResponse, PrincipalProjectionMemberResponseSchema, type PrincipalStateExternalAuthorityResponse, PrincipalStateExternalAuthorityResponseSchema, type PrincipalStatePayloadResponse, PrincipalStatePayloadResponseSchema, type PrincipalStateResponse, PrincipalStateResponseSchema, } from "./principal.js";
|
|
32
32
|
export { isPrincipalPolicyPageResponse, type PrincipalPolicyPageResponse, PrincipalPolicyPageResponseSchema, } from "./principalPolicyPage.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AA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AAsB,EAEtB,0BAA0B,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","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 CompleteMultipartBlobStageResponse,\n CompleteMultipartBlobStageResponseSchema,\n type InitiateMultipartBlobStageResponse,\n InitiateMultipartBlobStageResponseSchema,\n isBlobAttachmentBindResponse,\n isBlobAttachmentDetachResponse,\n isCompleteMultipartBlobStageResponse,\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 isContainerDeleteResponse,\n isContainerKekLogResponse,\n isContainerMutationResponse,\n isContainerReciteResponse,\n isContainerRotationResponse,\n isContainerWriterProjectionResponse,\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 documentKekTargetsFromContentKeyBundle,\n isDocumentContentKeyBundleResponse,\n isDocumentCreateResponse,\n isDocumentKekTargetsResponse,\n isDocumentLinkSetMutationResponse,\n isDocumentPurgeProofResponse,\n isDocumentPurgeResponse,\n isDocumentSyncResponse,\n isDocumentWriterProjectionResponse,\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 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\";\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,EAEtB,4BAA4B,EAE5B,0BAA0B,EAE1B,yBAAyB,EAEzB,2BAA2B,EAG3B,2BAA2B,EAE3B,6BAA6B,GAC9B,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,2BAA2B,EAC3B,uBAAuB,EAEvB,+BAA+B,EAE/B,2BAA2B,GAC5B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,gCAAgC,EAEhC,kCAAkC,EAElC,2BAA2B,EA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B,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 CompleteMultipartBlobStageResponse,\n CompleteMultipartBlobStageResponseSchema,\n type InitiateMultipartBlobStageResponse,\n InitiateMultipartBlobStageResponseSchema,\n isBlobAttachmentBindResponse,\n isBlobAttachmentDetachResponse,\n isCompleteMultipartBlobStageResponse,\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 isContainerDeleteResponse,\n isContainerKekLogResponse,\n isContainerMutationResponse,\n isContainerReciteResponse,\n isContainerRotationResponse,\n isContainerWriterProjectionResponse,\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 documentKekTargetsFromContentKeyBundle,\n isDocumentContentKeyBundleResponse,\n isDocumentCreateResponse,\n isDocumentKekTargetsResponse,\n isDocumentLinkSetMutationResponse,\n isDocumentPurgeProofResponse,\n isDocumentPurgeResponse,\n isDocumentSyncResponse,\n isDocumentWriterProjectionResponse,\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\";\n"]}
|
|
@@ -72,21 +72,23 @@ declare const OrganizationReadModelGrantsResponseSchema: z.ZodObject<{
|
|
|
72
72
|
organizationId: z.ZodString;
|
|
73
73
|
}, z.core.$strict>;
|
|
74
74
|
export type OrganizationReadModelGrantsResponse = z.infer<typeof OrganizationReadModelGrantsResponseSchema>;
|
|
75
|
+
/**
|
|
76
|
+
* A projected member names only the user and role. Public keys live once per
|
|
77
|
+
* user in the directory lane; keying never reads either copy from the read
|
|
78
|
+
* model.
|
|
79
|
+
*/
|
|
80
|
+
declare const OrganizationReadModelGroupMemberResponseSchema: z.ZodObject<{
|
|
81
|
+
role: z.ZodLiteral<"member" | "admin">;
|
|
82
|
+
userId: z.ZodString;
|
|
83
|
+
}, z.core.$strict>;
|
|
84
|
+
export type OrganizationReadModelGroupMemberResponse = z.infer<typeof OrganizationReadModelGroupMemberResponseSchema>;
|
|
75
85
|
declare const OrganizationReadModelGroupMembershipResponseSchema: z.ZodObject<{
|
|
76
86
|
groupId: z.ZodString;
|
|
77
87
|
members: z.ZodCustom<{
|
|
78
|
-
encapsulationKeyFingerprint: string | null;
|
|
79
|
-
encapsulationPublicKey: string | null;
|
|
80
88
|
role: "member" | "admin";
|
|
81
|
-
signingKeyFingerprint: string | null;
|
|
82
|
-
signingPublicKey: string | null;
|
|
83
89
|
userId: string;
|
|
84
90
|
}[], {
|
|
85
|
-
encapsulationKeyFingerprint: string | null;
|
|
86
|
-
encapsulationPublicKey: string | null;
|
|
87
91
|
role: "member" | "admin";
|
|
88
|
-
signingKeyFingerprint: string | null;
|
|
89
|
-
signingPublicKey: string | null;
|
|
90
92
|
userId: string;
|
|
91
93
|
}[]>;
|
|
92
94
|
stateHash: z.ZodString;
|
|
@@ -97,22 +99,14 @@ declare const OrganizationReadModelGroupMembershipsResponseSchema: z.ZodObject<{
|
|
|
97
99
|
groups: z.ZodCustom<{
|
|
98
100
|
groupId: string;
|
|
99
101
|
members: {
|
|
100
|
-
encapsulationKeyFingerprint: string | null;
|
|
101
|
-
encapsulationPublicKey: string | null;
|
|
102
102
|
role: "member" | "admin";
|
|
103
|
-
signingKeyFingerprint: string | null;
|
|
104
|
-
signingPublicKey: string | null;
|
|
105
103
|
userId: string;
|
|
106
104
|
}[];
|
|
107
105
|
stateHash: string;
|
|
108
106
|
}[], {
|
|
109
107
|
groupId: string;
|
|
110
108
|
members: {
|
|
111
|
-
encapsulationKeyFingerprint: string | null;
|
|
112
|
-
encapsulationPublicKey: string | null;
|
|
113
109
|
role: "member" | "admin";
|
|
114
|
-
signingKeyFingerprint: string | null;
|
|
115
|
-
signingPublicKey: string | null;
|
|
116
110
|
userId: string;
|
|
117
111
|
}[];
|
|
118
112
|
stateHash: string;
|
|
@@ -210,22 +204,14 @@ declare const OrganizationReadModelSnapshotResponseSchema: z.ZodObject<{
|
|
|
210
204
|
groups: z.ZodCustom<{
|
|
211
205
|
groupId: string;
|
|
212
206
|
members: {
|
|
213
|
-
encapsulationKeyFingerprint: string | null;
|
|
214
|
-
encapsulationPublicKey: string | null;
|
|
215
207
|
role: "member" | "admin";
|
|
216
|
-
signingKeyFingerprint: string | null;
|
|
217
|
-
signingPublicKey: string | null;
|
|
218
208
|
userId: string;
|
|
219
209
|
}[];
|
|
220
210
|
stateHash: string;
|
|
221
211
|
}[], {
|
|
222
212
|
groupId: string;
|
|
223
213
|
members: {
|
|
224
|
-
encapsulationKeyFingerprint: string | null;
|
|
225
|
-
encapsulationPublicKey: string | null;
|
|
226
214
|
role: "member" | "admin";
|
|
227
|
-
signingKeyFingerprint: string | null;
|
|
228
|
-
signingPublicKey: string | null;
|
|
229
215
|
userId: string;
|
|
230
216
|
}[];
|
|
231
217
|
stateHash: string;
|
|
@@ -359,22 +345,14 @@ declare const OrganizationReadModelDeltaResponseSchema: z.ZodObject<{
|
|
|
359
345
|
groups: z.ZodCustom<{
|
|
360
346
|
groupId: string;
|
|
361
347
|
members: {
|
|
362
|
-
encapsulationKeyFingerprint: string | null;
|
|
363
|
-
encapsulationPublicKey: string | null;
|
|
364
348
|
role: "member" | "admin";
|
|
365
|
-
signingKeyFingerprint: string | null;
|
|
366
|
-
signingPublicKey: string | null;
|
|
367
349
|
userId: string;
|
|
368
350
|
}[];
|
|
369
351
|
stateHash: string;
|
|
370
352
|
}[], {
|
|
371
353
|
groupId: string;
|
|
372
354
|
members: {
|
|
373
|
-
encapsulationKeyFingerprint: string | null;
|
|
374
|
-
encapsulationPublicKey: string | null;
|
|
375
355
|
role: "member" | "admin";
|
|
376
|
-
signingKeyFingerprint: string | null;
|
|
377
|
-
signingPublicKey: string | null;
|
|
378
356
|
userId: string;
|
|
379
357
|
}[];
|
|
380
358
|
stateHash: string;
|
|
@@ -509,22 +487,14 @@ export declare const OrganizationReadModelResponseSchema: z.ZodDiscriminatedUnio
|
|
|
509
487
|
groups: z.ZodCustom<{
|
|
510
488
|
groupId: string;
|
|
511
489
|
members: {
|
|
512
|
-
encapsulationKeyFingerprint: string | null;
|
|
513
|
-
encapsulationPublicKey: string | null;
|
|
514
490
|
role: "member" | "admin";
|
|
515
|
-
signingKeyFingerprint: string | null;
|
|
516
|
-
signingPublicKey: string | null;
|
|
517
491
|
userId: string;
|
|
518
492
|
}[];
|
|
519
493
|
stateHash: string;
|
|
520
494
|
}[], {
|
|
521
495
|
groupId: string;
|
|
522
496
|
members: {
|
|
523
|
-
encapsulationKeyFingerprint: string | null;
|
|
524
|
-
encapsulationPublicKey: string | null;
|
|
525
497
|
role: "member" | "admin";
|
|
526
|
-
signingKeyFingerprint: string | null;
|
|
527
|
-
signingPublicKey: string | null;
|
|
528
498
|
userId: string;
|
|
529
499
|
}[];
|
|
530
500
|
stateHash: string;
|
|
@@ -658,22 +628,14 @@ export declare const OrganizationReadModelResponseSchema: z.ZodDiscriminatedUnio
|
|
|
658
628
|
groups: z.ZodCustom<{
|
|
659
629
|
groupId: string;
|
|
660
630
|
members: {
|
|
661
|
-
encapsulationKeyFingerprint: string | null;
|
|
662
|
-
encapsulationPublicKey: string | null;
|
|
663
631
|
role: "member" | "admin";
|
|
664
|
-
signingKeyFingerprint: string | null;
|
|
665
|
-
signingPublicKey: string | null;
|
|
666
632
|
userId: string;
|
|
667
633
|
}[];
|
|
668
634
|
stateHash: string;
|
|
669
635
|
}[], {
|
|
670
636
|
groupId: string;
|
|
671
637
|
members: {
|
|
672
|
-
encapsulationKeyFingerprint: string | null;
|
|
673
|
-
encapsulationPublicKey: string | null;
|
|
674
638
|
role: "member" | "admin";
|
|
675
|
-
signingKeyFingerprint: string | null;
|
|
676
|
-
signingPublicKey: string | null;
|
|
677
639
|
userId: string;
|
|
678
640
|
}[];
|
|
679
641
|
stateHash: string;
|
|
@@ -14,7 +14,15 @@ const OrganizationReadModelGrantsResponseSchema = z.strictObject({
|
|
|
14
14
|
grants: arraySchema(OrganizationReadModelGrantResponseSchema),
|
|
15
15
|
organizationId: z.string(),
|
|
16
16
|
});
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* A projected member names only the user and role. Public keys live once per
|
|
19
|
+
* user in the directory lane; keying never reads either copy from the read
|
|
20
|
+
* model.
|
|
21
|
+
*/
|
|
22
|
+
const OrganizationReadModelGroupMemberResponseSchema = z.strictObject({
|
|
23
|
+
role: OrganizationGroupMemberResponseShape.role,
|
|
24
|
+
userId: OrganizationGroupMemberResponseShape.userId,
|
|
25
|
+
});
|
|
18
26
|
const OrganizationReadModelGroupMembershipResponseSchema = z.strictObject({
|
|
19
27
|
groupId: z.string(),
|
|
20
28
|
members: arraySchema(OrganizationReadModelGroupMemberResponseSchema),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organizationReadModel.js","sourceRoot":"","sources":["organizationReadModel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,oCAAoC,EACpC,sBAAsB,GACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,+CAA+C,EAAE,MAAM,qCAAqC,CAAC;AACtG,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EACL,uCAAuC,EACvC,6CAA6C,EAC7C,sCAAsC,EACt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AC,gBAAgB,KAAK,SAAS;YACzC,CAAC,wBAAwB,CAAC,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,EAC1D,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,CACL,KAAK,CAAC,IAAI,KAAK,OAAO;QACtB,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,eAAe,CAAC,MAAM,KAAK,CAAC,CAC1D,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,mCAAmC,GAC9C,oCAAoC,CAClC,sBAAsB,CACpB,uCAAuC,CAAC,MAAM,CAC5C,0BAA0B,CAC3B,EACD,uCAAuC,CACxC,EACD,+CAA+C,CAChD,CAAC;AAMJ,MAAM,UAAU,+BAA+B,CAC7C,KAAc;IAEd,OAAO,mCAAmC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AACtE,CAAC","sourcesContent":["import { z } from \"zod\";\nimport {\n registerJsonSchemaRuntimeRefinements,\n registerJsonSchemaView,\n} from \"../jsonSchema\";\nimport { organizationReadModelResponseRuntimeRefinements } from \"../organizationReadModelRefinements\";\nimport { arraySchema } from \"../schema\";\nimport {\n OrganizationContainerGrantResponseShape,\n OrganizationDirectoryCurrentUserResponseShape,\n OrganizationDirectoryUserResponseShape,\n OrganizationGroupCurrentStateResponseShape,\n OrganizationGroupMemberResponseShape,\n OrganizationGroupSummaryResponseShape,\n} from \"./organization\";\n\nconst OrganizationReadModelDirectoryUserResponseSchema = z.strictObject(\n OrganizationDirectoryUserResponseShape,\n);\n\nconst OrganizationReadModelDirectoryResponseSchema = z.strictObject({\n organizationId: z.string(),\n profileDocumentId: z.string().nullable(),\n users: arraySchema(OrganizationReadModelDirectoryUserResponseSchema),\n});\n\nexport type OrganizationReadModelDirectoryResponse = z.infer<\n typeof OrganizationReadModelDirectoryResponseSchema\n>;\n\nconst OrganizationReadModelGrantResponseSchema = z.strictObject(\n OrganizationContainerGrantResponseShape,\n);\n\nconst OrganizationReadModelGrantsResponseSchema = z.strictObject({\n grants: arraySchema(OrganizationReadModelGrantResponseSchema),\n organizationId: z.string(),\n});\n\nexport type OrganizationReadModelGrantsResponse = z.infer<\n typeof OrganizationReadModelGrantsResponseSchema\n>;\n\nconst OrganizationReadModelGroupMemberResponseSchema = z.strictObject(\n OrganizationGroupMemberResponseShape,\n);\n\nconst OrganizationReadModelGroupMembershipResponseSchema = z.strictObject({\n groupId: z.string(),\n members: arraySchema(OrganizationReadModelGroupMemberResponseSchema),\n stateHash: z.string().min(1),\n});\n\nexport type OrganizationReadModelGroupMembershipResponse = z.infer<\n typeof OrganizationReadModelGroupMembershipResponseSchema\n>;\n\nconst OrganizationReadModelGroupMembershipsResponseSchema = z.strictObject({\n deletedGroupIds: arraySchema(z.string().min(1)),\n groups: arraySchema(OrganizationReadModelGroupMembershipResponseSchema),\n organizationId: z.string(),\n});\n\nexport type OrganizationReadModelGroupMembershipsResponse = z.infer<\n typeof OrganizationReadModelGroupMembershipsResponseSchema\n>;\n\nconst OrganizationReadModelGroupCurrentStateResponseSchema = z.strictObject(\n OrganizationGroupCurrentStateResponseShape,\n);\n\nconst OrganizationReadModelGroupSummaryResponseSchema = z.strictObject({\n ...OrganizationGroupSummaryResponseShape,\n currentState: OrganizationReadModelGroupCurrentStateResponseSchema.nullable(),\n});\n\nconst OrganizationReadModelGroupsResponseSchema = z.strictObject({\n groups: arraySchema(OrganizationReadModelGroupSummaryResponseSchema),\n memberGroupId: z.string(),\n organizationId: z.string(),\n});\n\nconst OrganizationReadModelOrganizationPolicyResponseSchema = z.strictObject({\n currentState: z.strictObject({\n ...OrganizationGroupCurrentStateResponseShape,\n stateHash: z.string().min(1),\n }),\n organizationId: z.string(),\n});\n\nexport type OrganizationReadModelOrganizationPolicyResponse = z.infer<\n typeof OrganizationReadModelOrganizationPolicyResponseSchema\n>;\n\nconst OrganizationReadModelCurrentUserResponseSchema = z.strictObject(\n OrganizationDirectoryCurrentUserResponseShape,\n);\n\nconst OrganizationReadModelResponseBaseShape = {\n currentUser: OrganizationReadModelCurrentUserResponseSchema,\n hasMore: z.boolean(),\n nextCursor: z.string().min(1),\n organizationId: z.string(),\n version: z.literal(6),\n};\n\nconst OrganizationReadModelSnapshotResponseSchema = z.strictObject({\n ...OrganizationReadModelResponseBaseShape,\n hasMore: z.literal(false),\n lanes: z.strictObject({\n directory: OrganizationReadModelDirectoryResponseSchema,\n grants: OrganizationReadModelGrantsResponseSchema,\n groupMemberships: OrganizationReadModelGroupMembershipsResponseSchema,\n groups: OrganizationReadModelGroupsResponseSchema,\n organizationPolicy: OrganizationReadModelOrganizationPolicyResponseSchema,\n }),\n mode: z.literal(\"snapshot\"),\n});\n\nexport type OrganizationReadModelSnapshotResponse = z.infer<\n typeof OrganizationReadModelSnapshotResponseSchema\n>;\n\nconst OrganizationReadModelDeltaResponseSchema = z.strictObject({\n ...OrganizationReadModelResponseBaseShape,\n lanes: z.strictObject({\n directory: OrganizationReadModelDirectoryResponseSchema.optional(),\n grants: OrganizationReadModelGrantsResponseSchema.optional(),\n groupMemberships:\n OrganizationReadModelGroupMembershipsResponseSchema.optional(),\n groups: OrganizationReadModelGroupsResponseSchema.optional(),\n organizationPolicy:\n OrganizationReadModelOrganizationPolicyResponseSchema.optional(),\n }),\n mode: z.literal(\"delta\"),\n});\n\nexport type OrganizationReadModelDeltaResponse = z.infer<\n typeof OrganizationReadModelDeltaResponseSchema\n>;\n\nconst OrganizationReadModelResponseSchemaView = z.discriminatedUnion(\"mode\", [\n OrganizationReadModelDeltaResponseSchema,\n OrganizationReadModelSnapshotResponseSchema,\n]);\n\ntype OrganizationReadModelResponseView = z.infer<\n typeof OrganizationReadModelResponseSchemaView\n>;\n\nfunction hasValidGrantSubjectFields(\n grant: z.infer<typeof OrganizationReadModelGrantResponseSchema>,\n): boolean {\n if (grant.subjectType === \"user\") {\n return grant.userId === grant.subjectId && grant.groupId === null;\n }\n if (grant.subjectType === \"group\") {\n return (\n grant.userId === null &&\n grant.signingKeyFingerprint === null &&\n grant.groupId === grant.subjectId\n );\n }\n return false;\n}\n\nfunction hasValidGrants(\n grants: OrganizationReadModelGrantsResponse[\"grants\"],\n): boolean {\n const keys = new Set<string>();\n return grants.every((grant) => {\n const key = `${grant.subjectType}:${grant.subjectId}:${grant.containerId}`;\n if (!hasValidGrantSubjectFields(grant) || keys.has(key)) {\n return false;\n }\n keys.add(key);\n return true;\n });\n}\n\nfunction hasValidGroupMemberships(\n lane: OrganizationReadModelGroupMembershipsResponse,\n): boolean {\n const groupIds = new Set<string>();\n const validGroups = lane.groups.every((group) => {\n if (groupIds.has(group.groupId)) {\n return false;\n }\n groupIds.add(group.groupId);\n const memberIds = new Set<string>();\n return group.members.every((member) => {\n if (memberIds.has(member.userId)) {\n return false;\n }\n memberIds.add(member.userId);\n return true;\n });\n });\n if (!validGroups) {\n return false;\n }\n\n const deletedGroupIds = new Set<string>();\n return lane.deletedGroupIds.every((groupId) => {\n if (groupIds.has(groupId) || deletedGroupIds.has(groupId)) {\n return false;\n }\n deletedGroupIds.add(groupId);\n return true;\n });\n}\n\nfunction laneOrganizationsMatch(\n value: OrganizationReadModelResponseView,\n): boolean {\n const { lanes, organizationId } = value;\n return (\n (lanes.directory === undefined ||\n lanes.directory.organizationId === organizationId) &&\n (lanes.grants === undefined ||\n lanes.grants.organizationId === organizationId) &&\n (lanes.groupMemberships === undefined ||\n lanes.groupMemberships.organizationId === organizationId) &&\n (lanes.groups === undefined ||\n (lanes.groups.organizationId === organizationId &&\n lanes.groups.groups.every(\n (group) => group.organizationId === organizationId,\n ))) &&\n (lanes.organizationPolicy === undefined ||\n lanes.organizationPolicy.organizationId === organizationId)\n );\n}\n\nfunction hasValidReadModelSemantics(\n value: OrganizationReadModelResponseView,\n): boolean {\n if (\n !laneOrganizationsMatch(value) ||\n (value.lanes.grants !== undefined &&\n !hasValidGrants(value.lanes.grants.grants)) ||\n (value.lanes.groupMemberships !== undefined &&\n !hasValidGroupMemberships(value.lanes.groupMemberships))\n ) {\n return false;\n }\n\n return (\n value.mode === \"delta\" ||\n value.lanes.groupMemberships.deletedGroupIds.length === 0\n );\n}\n\nexport const OrganizationReadModelResponseSchema =\n registerJsonSchemaRuntimeRefinements(\n registerJsonSchemaView(\n OrganizationReadModelResponseSchemaView.refine(\n hasValidReadModelSemantics,\n ),\n OrganizationReadModelResponseSchemaView,\n ),\n organizationReadModelResponseRuntimeRefinements,\n );\n\nexport type OrganizationReadModelResponse = z.infer<\n typeof OrganizationReadModelResponseSchema\n>;\n\nexport function isOrganizationReadModelResponse(\n value: unknown,\n): value is OrganizationReadModelResponse {\n return OrganizationReadModelResponseSchema.safeParse(value).success;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"organizationReadModel.js","sourceRoot":"","sources":["organizationReadModel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,oCAAoC,EACpC,sBAAsB,GACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,+CAA+C,EAAE,MAAM,qCAAqC,CAAC;AACtG,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EACL,uCAAuC,EACvC,6CAA6C,EAC7C,sCAAsC,EACtC,0CAA0C,EAC1C,oCAAoC,EACpC,qCAAqC,GACtC,MAAM,gBAAgB,CAAC;AAExB,MAAM,gDAAgD,GAAG,CAAC,CAAC,YAAY,CACrE,sCAAsC,CACvC,CAAC;AAEF,MAAM,4CAA4C,GAAG,CAAC,CAAC,YAAY,CAAC;IAClE,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACxC,KAAK,EAAE,WAAW,CAAC,gDAAgD,CAAC;CACrE,CAAC,CAAC;AAMH,MAAM,wCAAwC,GAAG,CAAC,CAAC,YAAY,CAC7D,uCAAuC,CACxC,CAAC;AAEF,MAAM,yCAAyC,GAAG,CAAC,CAAC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C5C,0BAA0B,CAC3B,EACD,uCAAuC,CACxC,EACD,+CAA+C,CAChD,CAAC;AAMJ,MAAM,UAAU,+BAA+B,CAC7C,KAAc;IAEd,OAAO,mCAAmC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AACtE,CAAC","sourcesContent":["import { z } from \"zod\";\nimport {\n registerJsonSchemaRuntimeRefinements,\n registerJsonSchemaView,\n} from \"../jsonSchema\";\nimport { organizationReadModelResponseRuntimeRefinements } from \"../organizationReadModelRefinements\";\nimport { arraySchema } from \"../schema\";\nimport {\n OrganizationContainerGrantResponseShape,\n OrganizationDirectoryCurrentUserResponseShape,\n OrganizationDirectoryUserResponseShape,\n OrganizationGroupCurrentStateResponseShape,\n OrganizationGroupMemberResponseShape,\n OrganizationGroupSummaryResponseShape,\n} from \"./organization\";\n\nconst OrganizationReadModelDirectoryUserResponseSchema = z.strictObject(\n OrganizationDirectoryUserResponseShape,\n);\n\nconst OrganizationReadModelDirectoryResponseSchema = z.strictObject({\n organizationId: z.string(),\n profileDocumentId: z.string().nullable(),\n users: arraySchema(OrganizationReadModelDirectoryUserResponseSchema),\n});\n\nexport type OrganizationReadModelDirectoryResponse = z.infer<\n typeof OrganizationReadModelDirectoryResponseSchema\n>;\n\nconst OrganizationReadModelGrantResponseSchema = z.strictObject(\n OrganizationContainerGrantResponseShape,\n);\n\nconst OrganizationReadModelGrantsResponseSchema = z.strictObject({\n grants: arraySchema(OrganizationReadModelGrantResponseSchema),\n organizationId: z.string(),\n});\n\nexport type OrganizationReadModelGrantsResponse = z.infer<\n typeof OrganizationReadModelGrantsResponseSchema\n>;\n\n/**\n * A projected member names only the user and role. Public keys live once per\n * user in the directory lane; keying never reads either copy from the read\n * model.\n */\nconst OrganizationReadModelGroupMemberResponseSchema = z.strictObject({\n role: OrganizationGroupMemberResponseShape.role,\n userId: OrganizationGroupMemberResponseShape.userId,\n});\n\nexport type OrganizationReadModelGroupMemberResponse = z.infer<\n typeof OrganizationReadModelGroupMemberResponseSchema\n>;\n\nconst OrganizationReadModelGroupMembershipResponseSchema = z.strictObject({\n groupId: z.string(),\n members: arraySchema(OrganizationReadModelGroupMemberResponseSchema),\n stateHash: z.string().min(1),\n});\n\nexport type OrganizationReadModelGroupMembershipResponse = z.infer<\n typeof OrganizationReadModelGroupMembershipResponseSchema\n>;\n\nconst OrganizationReadModelGroupMembershipsResponseSchema = z.strictObject({\n deletedGroupIds: arraySchema(z.string().min(1)),\n groups: arraySchema(OrganizationReadModelGroupMembershipResponseSchema),\n organizationId: z.string(),\n});\n\nexport type OrganizationReadModelGroupMembershipsResponse = z.infer<\n typeof OrganizationReadModelGroupMembershipsResponseSchema\n>;\n\nconst OrganizationReadModelGroupCurrentStateResponseSchema = z.strictObject(\n OrganizationGroupCurrentStateResponseShape,\n);\n\nconst OrganizationReadModelGroupSummaryResponseSchema = z.strictObject({\n ...OrganizationGroupSummaryResponseShape,\n currentState: OrganizationReadModelGroupCurrentStateResponseSchema.nullable(),\n});\n\nconst OrganizationReadModelGroupsResponseSchema = z.strictObject({\n groups: arraySchema(OrganizationReadModelGroupSummaryResponseSchema),\n memberGroupId: z.string(),\n organizationId: z.string(),\n});\n\nconst OrganizationReadModelOrganizationPolicyResponseSchema = z.strictObject({\n currentState: z.strictObject({\n ...OrganizationGroupCurrentStateResponseShape,\n stateHash: z.string().min(1),\n }),\n organizationId: z.string(),\n});\n\nexport type OrganizationReadModelOrganizationPolicyResponse = z.infer<\n typeof OrganizationReadModelOrganizationPolicyResponseSchema\n>;\n\nconst OrganizationReadModelCurrentUserResponseSchema = z.strictObject(\n OrganizationDirectoryCurrentUserResponseShape,\n);\n\nconst OrganizationReadModelResponseBaseShape = {\n currentUser: OrganizationReadModelCurrentUserResponseSchema,\n hasMore: z.boolean(),\n nextCursor: z.string().min(1),\n organizationId: z.string(),\n version: z.literal(6),\n};\n\nconst OrganizationReadModelSnapshotResponseSchema = z.strictObject({\n ...OrganizationReadModelResponseBaseShape,\n hasMore: z.literal(false),\n lanes: z.strictObject({\n directory: OrganizationReadModelDirectoryResponseSchema,\n grants: OrganizationReadModelGrantsResponseSchema,\n groupMemberships: OrganizationReadModelGroupMembershipsResponseSchema,\n groups: OrganizationReadModelGroupsResponseSchema,\n organizationPolicy: OrganizationReadModelOrganizationPolicyResponseSchema,\n }),\n mode: z.literal(\"snapshot\"),\n});\n\nexport type OrganizationReadModelSnapshotResponse = z.infer<\n typeof OrganizationReadModelSnapshotResponseSchema\n>;\n\nconst OrganizationReadModelDeltaResponseSchema = z.strictObject({\n ...OrganizationReadModelResponseBaseShape,\n lanes: z.strictObject({\n directory: OrganizationReadModelDirectoryResponseSchema.optional(),\n grants: OrganizationReadModelGrantsResponseSchema.optional(),\n groupMemberships:\n OrganizationReadModelGroupMembershipsResponseSchema.optional(),\n groups: OrganizationReadModelGroupsResponseSchema.optional(),\n organizationPolicy:\n OrganizationReadModelOrganizationPolicyResponseSchema.optional(),\n }),\n mode: z.literal(\"delta\"),\n});\n\nexport type OrganizationReadModelDeltaResponse = z.infer<\n typeof OrganizationReadModelDeltaResponseSchema\n>;\n\nconst OrganizationReadModelResponseSchemaView = z.discriminatedUnion(\"mode\", [\n OrganizationReadModelDeltaResponseSchema,\n OrganizationReadModelSnapshotResponseSchema,\n]);\n\ntype OrganizationReadModelResponseView = z.infer<\n typeof OrganizationReadModelResponseSchemaView\n>;\n\nfunction hasValidGrantSubjectFields(\n grant: z.infer<typeof OrganizationReadModelGrantResponseSchema>,\n): boolean {\n if (grant.subjectType === \"user\") {\n return grant.userId === grant.subjectId && grant.groupId === null;\n }\n if (grant.subjectType === \"group\") {\n return (\n grant.userId === null &&\n grant.signingKeyFingerprint === null &&\n grant.groupId === grant.subjectId\n );\n }\n return false;\n}\n\nfunction hasValidGrants(\n grants: OrganizationReadModelGrantsResponse[\"grants\"],\n): boolean {\n const keys = new Set<string>();\n return grants.every((grant) => {\n const key = `${grant.subjectType}:${grant.subjectId}:${grant.containerId}`;\n if (!hasValidGrantSubjectFields(grant) || keys.has(key)) {\n return false;\n }\n keys.add(key);\n return true;\n });\n}\n\nfunction hasValidGroupMemberships(\n lane: OrganizationReadModelGroupMembershipsResponse,\n): boolean {\n const groupIds = new Set<string>();\n const validGroups = lane.groups.every((group) => {\n if (groupIds.has(group.groupId)) {\n return false;\n }\n groupIds.add(group.groupId);\n const memberIds = new Set<string>();\n return group.members.every((member) => {\n if (memberIds.has(member.userId)) {\n return false;\n }\n memberIds.add(member.userId);\n return true;\n });\n });\n if (!validGroups) {\n return false;\n }\n\n const deletedGroupIds = new Set<string>();\n return lane.deletedGroupIds.every((groupId) => {\n if (groupIds.has(groupId) || deletedGroupIds.has(groupId)) {\n return false;\n }\n deletedGroupIds.add(groupId);\n return true;\n });\n}\n\nfunction laneOrganizationsMatch(\n value: OrganizationReadModelResponseView,\n): boolean {\n const { lanes, organizationId } = value;\n return (\n (lanes.directory === undefined ||\n lanes.directory.organizationId === organizationId) &&\n (lanes.grants === undefined ||\n lanes.grants.organizationId === organizationId) &&\n (lanes.groupMemberships === undefined ||\n lanes.groupMemberships.organizationId === organizationId) &&\n (lanes.groups === undefined ||\n (lanes.groups.organizationId === organizationId &&\n lanes.groups.groups.every(\n (group) => group.organizationId === organizationId,\n ))) &&\n (lanes.organizationPolicy === undefined ||\n lanes.organizationPolicy.organizationId === organizationId)\n );\n}\n\nfunction hasValidReadModelSemantics(\n value: OrganizationReadModelResponseView,\n): boolean {\n if (\n !laneOrganizationsMatch(value) ||\n (value.lanes.grants !== undefined &&\n !hasValidGrants(value.lanes.grants.grants)) ||\n (value.lanes.groupMemberships !== undefined &&\n !hasValidGroupMemberships(value.lanes.groupMemberships))\n ) {\n return false;\n }\n\n return (\n value.mode === \"delta\" ||\n value.lanes.groupMemberships.deletedGroupIds.length === 0\n );\n}\n\nexport const OrganizationReadModelResponseSchema =\n registerJsonSchemaRuntimeRefinements(\n registerJsonSchemaView(\n OrganizationReadModelResponseSchemaView.refine(\n hasValidReadModelSemantics,\n ),\n OrganizationReadModelResponseSchemaView,\n ),\n organizationReadModelResponseRuntimeRefinements,\n );\n\nexport type OrganizationReadModelResponse = z.infer<\n typeof OrganizationReadModelResponseSchema\n>;\n\nexport function isOrganizationReadModelResponse(\n value: unknown,\n): value is OrganizationReadModelResponse {\n return OrganizationReadModelResponseSchema.safeParse(value).success;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -3,6 +3,7 @@ import type { CreateOrganizationRequest } from "../../internal/validators/reques
|
|
|
3
3
|
import type { CreateOrganizationResponse } from "../../internal/validators/response/index.js";
|
|
4
4
|
import type { DocumentProjectorRegistryInput } from "../../data/documents/documentKinds.js";
|
|
5
5
|
import type { ExecSqlClientLike } from "../../data/sqlite/sqlSchema.js";
|
|
6
|
+
import type { ProvisionedPrincipalHistoryPrimer } from "../registration/provisionedPrincipalHistory.js";
|
|
6
7
|
import { type ProvisionedSystemContainerSpec } from "../registration/registerIdentity.js";
|
|
7
8
|
import { removeNativeSubscriptionRestoreProvisioningAttempt } from "./organizationProvisioningAttempt.js";
|
|
8
9
|
export { removeNativeSubscriptionRestoreProvisioningAttempt };
|
|
@@ -29,6 +30,8 @@ export interface CreateOrganizationInput {
|
|
|
29
30
|
logError?: ((message: string | Error, cause?: unknown) => void) | undefined;
|
|
30
31
|
/** Overrides the seeded organization profile name; see registration. */
|
|
31
32
|
organizationProfileName?: string | undefined;
|
|
33
|
+
/** Seeds verified recovery progress for the founding policy heads. */
|
|
34
|
+
primePrincipalHistory?: ProvisionedPrincipalHistoryPrimer | undefined;
|
|
32
35
|
/**
|
|
33
36
|
* App-owned system containers to provision atomically with the new
|
|
34
37
|
* organization (e.g. a trash bin). See registration.
|
|
@@ -115,6 +115,7 @@ export async function createOrganization(input) {
|
|
|
115
115
|
log: input.log,
|
|
116
116
|
logError: input.logError,
|
|
117
117
|
organizationMetadataBootstrap: artifacts.organizationMetadataBootstrap,
|
|
118
|
+
primePrincipalHistory: input.primePrincipalHistory,
|
|
118
119
|
response,
|
|
119
120
|
rootContainer: artifacts.rootContainer,
|
|
120
121
|
rootMetadataDocument: artifacts.rootMetadataDocument,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createOrganization.js","sourceRoot":"","sources":["createOrganization.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,wCAAwC,GACzC,MAAM,mBAAmB,CAAC;AAK3B,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EACL,sCAAsC,EAItC,oCAAoC,GACrC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,0CAA0C,EAC1C,kDAAkD,GACnD,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,kCAAkC,EAAE,MAAM,uCAAuC,CAAC;AAE3F,OAAO,EAAE,kDAAkD,EAAE,CAAC;AAkD9D,SAAS,4BAA4B,CAAC,KAIrC;IACC,IACE,KAAK,CAAC,QAAQ,CAAC,cAAc,KAAK,KAAK,CAAC,OAAO,CAAC,cAAc;QAC9D,KAAK,CAAC,QAAQ,CAAC,eAAe,KAAK,KAAK,CAAC,OAAO,CAAC,eAAe,EAChE,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IACE,CAAC,KAAK,CAAC,QAAQ,CAAC,sBAAsB;QACtC,KAAK,CAAC,QAAQ,CAAC,MAAM,KAAK,KAAK,CAAC,QAAQ,CAAC,MAAM,EAC/C,CAAC;QACD,MAAM,IAAI,KAAK,CACb,+DAA+D,CAChE,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,CAClB,qCAAqC,KAAK,CAAC,QAAQ,CAAC,cAAc,GAAG,CACtE,CAAC;IACF,OAAO,IAAI,CAAC;AACd,CAAC;AAED,KAAK,UAAU,0BAA0B,CACvC,KAA8B,EAC9B,eAAuB;IAEvB,MAAM,cAAc,GAA2C;QAC7D,oBAAoB,EAAE,KAAK,CAAC,oBAAoB;QAChD,uBAAuB,EAAE,KAAK,CAAC,uBAAuB;QACtD,2BAA2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,EAAE,CAAC,EAAE,CAAC;QACzE,yEAAyE;QACzE,4DAA4D;QAC5D,yEAAyE;QACzE,0EAA0E;QAC1E,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,GAAG,EAAE,CAAC,yBAAyB,QAAQ,CAAC,cAAc,GAAG,CAAC,CAAC;IACjE,MAAM,oCAAoC,CAAC;QACzC,SAAS,EAAE,SAAS,CAAC,SAAS;QAC9B,uBAAuB,EAAE,KAAK,CAAC,iBAAiB;QAChD,eAAe,EAAE,KAAK,CAAC,eAAe;QACtC,WAAW,EAAE,sBAAsB;QACnC,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,kBAAkB,EAAE,KAAK,CAAC,kBAAkB;QAC5C,iBAAiB,EAAE,SAAS,CAAC,iBAAiB;QAC9C,kBAAkB,EAAE,SAAS,CAAC,kBAAkB;QAChD,yBAAyB,EAAE,SAAS,CAAC,yBAAyB;QAC9D,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,6BAA6B,EAAE,SAAS,CAAC,6BAA6B;QACtE,QAAQ;QACR,aAAa,EAAE,SAAS,CAAC,aAAa;QACtC,oBAAoB,EAAE,SAAS,CAAC,oBAAoB;QACpD,2BAA2B,EAAE,SAAS,CAAC,2BAA2B;QAClE,sBAAsB,EAAE,SAAS,CAAC,sBAAsB;QACxD,yBAAyB,EAAE,SAAS,CAAC,yBAAyB;KAC/D,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import {\n type EncapsulationKeyPair,\n type SigningKeyPair,\n signOrganizationReplacementAuthorization,\n} from \"@tearleads/crypto\";\nimport type { CreateOrganizationRequest } from \"@tearleads/validators/request\";\nimport type { CreateOrganizationResponse } from \"@tearleads/validators/response\";\nimport type { DocumentProjectorRegistryInput } from \"../../data/documents/documentKinds\";\nimport type { ExecSqlClientLike } from \"../../data/sqlite/sqlSchema\";\nimport { createExecSql } from \"../../data/sqlite/sqlSchema\";\nimport {\n buildOrganizationProvisioningArtifacts,\n type OrganizationProvisioningArtifacts,\n type OrganizationProvisioningArtifactsInput,\n type ProvisionedSystemContainerSpec,\n persistOrganizationProvisioningState,\n} from \"../registration/registerIdentity\";\nimport {\n makeOrganizationProvisioningAttemptDurable,\n removeNativeSubscriptionRestoreProvisioningAttempt,\n} from \"./organizationProvisioningAttempt\";\nimport { pinOrganizationReplacementResponse } from \"./organizationReplacementVerification\";\n\nexport { removeNativeSubscriptionRestoreProvisioningAttempt };\n\nexport interface CreateOrganizationApi {\n createOrganization(\n request: CreateOrganizationRequest,\n ): Promise<CreateOrganizationResponse | null>;\n}\n\nexport interface CreateOrganizationInput {\n apiClient: CreateOrganizationApi;\n dbClient: ExecSqlClientLike;\n documentProjectors?: DocumentProjectorRegistryInput | undefined;\n encapsulationKeyPair: EncapsulationKeyPair;\n /**\n * Returns false once the identity that supplied the key pairs is no longer\n * active. Checked before the remote create (so a stale request is never\n * submitted) and again before local persistence: an identity switch closes\n * or renews the captured database client, so persisting would write another\n * identity's bootstrap — or throw — after the org already exists remotely.\n * The caller discards the result.\n */\n isIdentityCurrent?: (() => boolean) | undefined;\n /** @internal Forwarded to the bootstrap persist; test-only seam. */\n onPersistQueued?: (() => void) | undefined;\n log?: ((message: string) => void) | undefined;\n logError?: ((message: string | Error, cause?: unknown) => void) | undefined;\n /** Overrides the seeded organization profile name; see registration. */\n organizationProfileName?: string | undefined;\n /**\n * App-owned system containers to provision atomically with the new\n * organization (e.g. a trash bin). See registration.\n */\n provisionedSystemContainers?:\n | ReadonlyArray<ProvisionedSystemContainerSpec>\n | undefined;\n /** Purged organization whose personal-org generation this replaces. */\n replacesOrganizationId?: string | undefined;\n /** Marks and durably replays a fresh native-subscription restore target. */\n nativeSubscriptionRestore?: boolean | undefined;\n /** Overrides the seeded self roster-profile nickname; see registration. */\n rosterProfileNickname?: string | undefined;\n signingKeyPair: SigningKeyPair;\n /**\n * The already-registered user creating the organization; they become its\n * founding admin. The server independently requires this to match the\n * authenticated session.\n */\n userId: string;\n}\n\nfunction isAdoptedReplacementResponse(input: {\n creation: CreateOrganizationInput;\n request: CreateOrganizationRequest;\n response: CreateOrganizationResponse;\n}): boolean {\n if (\n input.response.organizationId === input.request.organizationId &&\n input.response.rootContainerId === input.request.rootContainerId\n ) {\n return false;\n }\n if (\n !input.creation.replacesOrganizationId ||\n input.response.userId !== input.creation.userId\n ) {\n throw new Error(\n \"Organization provisioning returned an unexpected organization\",\n );\n }\n input.creation.log?.(\n `Organization replacement adopted (${input.response.organizationId})`,\n );\n return true;\n}\n\nasync function buildOrganizationCandidate(\n input: CreateOrganizationInput,\n rootContainerId: string,\n): Promise<OrganizationProvisioningArtifacts | null> {\n const artifactsInput: OrganizationProvisioningArtifactsInput = {\n encapsulationKeyPair: input.encapsulationKeyPair,\n organizationProfileName: input.organizationProfileName,\n provisionedSystemContainers: input.provisionedSystemContainers,\n rootContainerId,\n rosterProfileNickname: input.rosterProfileNickname,\n signingKeyPair: input.signingKeyPair,\n userId: input.userId,\n };\n const artifacts: OrganizationProvisioningArtifacts =\n await buildOrganizationProvisioningArtifacts(artifactsInput);\n\n if (input.replacesOrganizationId) {\n artifacts.replacementAuthorization =\n await signOrganizationReplacementAuthorization(\n {\n ...artifacts,\n replacesOrganizationId: input.replacesOrganizationId,\n rootContainerId,\n userId: input.userId,\n },\n input.signingKeyPair,\n );\n }\n\n if (\n input.replacesOrganizationId &&\n input.isIdentityCurrent &&\n !input.isIdentityCurrent()\n ) {\n input.log?.(\n \"Organization creation aborted: identity changed while building artifacts\",\n );\n return null;\n }\n\n return artifacts;\n}\n\n/**\n * Provisions an additional organization for an already-registered user, reusing\n * the exact artifact-build and local-persistence path as registration\n * ({@link buildOrganizationProvisioningArtifacts} /\n * {@link persistOrganizationProvisioningState}). Unlike registration it mints a\n * fresh root container id, signs with the caller's existing identity, and needs\n * no auth challenge — the user is already authenticated.\n */\nexport async function createOrganization(\n input: CreateOrganizationInput,\n): Promise<CreateOrganizationResponse | null> {\n input.log?.(\"Creating organization...\");\n\n const rootContainerId = crypto.randomUUID();\n const candidateArtifacts = await buildOrganizationCandidate(\n input,\n rootContainerId,\n );\n\n if (!candidateArtifacts) return null;\n\n const durableAttempt = await makeOrganizationProvisioningAttemptDurable({\n artifacts: candidateArtifacts,\n canStartDurableMutation: input.isIdentityCurrent,\n dbClient: input.dbClient,\n nativeSubscriptionRestore: input.nativeSubscriptionRestore,\n replacesOrganizationId: input.replacesOrganizationId,\n rootContainerId,\n userId: input.userId,\n });\n if (!durableAttempt) {\n input.log?.(\n \"Organization creation aborted: identity changed before saving artifacts\",\n );\n return null;\n }\n const {\n artifacts,\n request,\n rootContainerId: durableRootContainerId,\n } = durableAttempt;\n\n if (input.isIdentityCurrent && !input.isIdentityCurrent()) {\n input.log?.(\n \"Organization creation aborted: identity changed before provisioning\",\n );\n return null;\n }\n\n const response = await input.apiClient.createOrganization(request);\n if (!response) {\n return null;\n }\n\n if (input.isIdentityCurrent && !input.isIdentityCurrent()) {\n input.log?.(\n \"Organization creation discarded: identity changed while provisioning\",\n );\n return null;\n }\n\n if (\n input.replacesOrganizationId &&\n !(await pinOrganizationReplacementResponse({\n replacesOrganizationId: input.replacesOrganizationId,\n response,\n signingPublicKey: input.signingKeyPair.signingPublicKey,\n userId: input.userId,\n execSql: createExecSql(input.dbClient),\n stillCurrent: input.isIdentityCurrent,\n }))\n )\n return null;\n\n if (isAdoptedReplacementResponse({ creation: input, request, response })) {\n // Another device authorized this winning genesis with the same identity.\n // Its encrypted bootstrap will hydrate normally; persisting\n // this device's losing candidate would instead create an unrelated local\n // root. The session reset rebinds retained local data to the winning ids.\n return response;\n }\n\n input.log?.(`Organization created (${response.organizationId})`);\n await persistOrganizationProvisioningState({\n bootstrap: artifacts.bootstrap,\n canStartDurableMutation: input.isIdentityCurrent,\n onPersistQueued: input.onPersistQueued,\n containerId: durableRootContainerId,\n dbClient: input.dbClient,\n documentProjectors: input.documentProjectors,\n initialAdminGroup: artifacts.initialAdminGroup,\n initialMemberGroup: artifacts.initialMemberGroup,\n initialOrganizationPolicy: artifacts.initialOrganizationPolicy,\n log: input.log,\n logError: input.logError,\n organizationMetadataBootstrap: artifacts.organizationMetadataBootstrap,\n response,\n rootContainer: artifacts.rootContainer,\n rootMetadataDocument: artifacts.rootMetadataDocument,\n rootMetadataDocumentRequest: artifacts.rootMetadataDocumentRequest,\n rosterProfileBootstrap: artifacts.rosterProfileBootstrap,\n systemContainerBootstraps: artifacts.systemContainerBootstraps,\n });\n\n return response;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"createOrganization.js","sourceRoot":"","sources":["createOrganization.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,wCAAwC,GACzC,MAAM,mBAAmB,CAAC;AAK3B,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,OAAO,EACL,sCAAsC,EAItC,oCAAoC,GACrC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,0CAA0C,EAC1C,kDAAkD,GACnD,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,kCAAkC,EAAE,MAAM,uCAAuC,CAAC;AAE3F,OAAO,EAAE,kDAAkD,EAAE,CAAC;AAoD9D,SAAS,4BAA4B,CAAC,KAIrC;IACC,IACE,KAAK,CAAC,QAAQ,CAAC,cAAc,KAAK,KAAK,CAAC,OAAO,CAAC,cAAc;QAC9D,KAAK,CAAC,QAAQ,CAAC,eAAe,KAAK,KAAK,CAAC,OAAO,CAAC,eAAe,EAChE,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IACE,CAAC,KAAK,CAAC,QAAQ,CAAC,sBAAsB;QACtC,KAAK,CAAC,QAAQ,CAAC,MAAM,KAAK,KAAK,CAAC,QAAQ,CAAC,MAAM,EAC/C,CAAC;QACD,MAAM,IAAI,KAAK,CACb,+DAA+D,CAChE,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,QAAQ,CAAC,GAAG,EAA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AAC;IAEH,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import {\n type EncapsulationKeyPair,\n type SigningKeyPair,\n signOrganizationReplacementAuthorization,\n} from \"@tearleads/crypto\";\nimport type { CreateOrganizationRequest } from \"@tearleads/validators/request\";\nimport type { CreateOrganizationResponse } from \"@tearleads/validators/response\";\nimport type { DocumentProjectorRegistryInput } from \"../../data/documents/documentKinds\";\nimport type { ExecSqlClientLike } from \"../../data/sqlite/sqlSchema\";\nimport { createExecSql } from \"../../data/sqlite/sqlSchema\";\nimport type { ProvisionedPrincipalHistoryPrimer } from \"../registration/provisionedPrincipalHistory\";\nimport {\n buildOrganizationProvisioningArtifacts,\n type OrganizationProvisioningArtifacts,\n type OrganizationProvisioningArtifactsInput,\n type ProvisionedSystemContainerSpec,\n persistOrganizationProvisioningState,\n} from \"../registration/registerIdentity\";\nimport {\n makeOrganizationProvisioningAttemptDurable,\n removeNativeSubscriptionRestoreProvisioningAttempt,\n} from \"./organizationProvisioningAttempt\";\nimport { pinOrganizationReplacementResponse } from \"./organizationReplacementVerification\";\n\nexport { removeNativeSubscriptionRestoreProvisioningAttempt };\n\nexport interface CreateOrganizationApi {\n createOrganization(\n request: CreateOrganizationRequest,\n ): Promise<CreateOrganizationResponse | null>;\n}\n\nexport interface CreateOrganizationInput {\n apiClient: CreateOrganizationApi;\n dbClient: ExecSqlClientLike;\n documentProjectors?: DocumentProjectorRegistryInput | undefined;\n encapsulationKeyPair: EncapsulationKeyPair;\n /**\n * Returns false once the identity that supplied the key pairs is no longer\n * active. Checked before the remote create (so a stale request is never\n * submitted) and again before local persistence: an identity switch closes\n * or renews the captured database client, so persisting would write another\n * identity's bootstrap — or throw — after the org already exists remotely.\n * The caller discards the result.\n */\n isIdentityCurrent?: (() => boolean) | undefined;\n /** @internal Forwarded to the bootstrap persist; test-only seam. */\n onPersistQueued?: (() => void) | undefined;\n log?: ((message: string) => void) | undefined;\n logError?: ((message: string | Error, cause?: unknown) => void) | undefined;\n /** Overrides the seeded organization profile name; see registration. */\n organizationProfileName?: string | undefined;\n /** Seeds verified recovery progress for the founding policy heads. */\n primePrincipalHistory?: ProvisionedPrincipalHistoryPrimer | undefined;\n /**\n * App-owned system containers to provision atomically with the new\n * organization (e.g. a trash bin). See registration.\n */\n provisionedSystemContainers?:\n | ReadonlyArray<ProvisionedSystemContainerSpec>\n | undefined;\n /** Purged organization whose personal-org generation this replaces. */\n replacesOrganizationId?: string | undefined;\n /** Marks and durably replays a fresh native-subscription restore target. */\n nativeSubscriptionRestore?: boolean | undefined;\n /** Overrides the seeded self roster-profile nickname; see registration. */\n rosterProfileNickname?: string | undefined;\n signingKeyPair: SigningKeyPair;\n /**\n * The already-registered user creating the organization; they become its\n * founding admin. The server independently requires this to match the\n * authenticated session.\n */\n userId: string;\n}\n\nfunction isAdoptedReplacementResponse(input: {\n creation: CreateOrganizationInput;\n request: CreateOrganizationRequest;\n response: CreateOrganizationResponse;\n}): boolean {\n if (\n input.response.organizationId === input.request.organizationId &&\n input.response.rootContainerId === input.request.rootContainerId\n ) {\n return false;\n }\n if (\n !input.creation.replacesOrganizationId ||\n input.response.userId !== input.creation.userId\n ) {\n throw new Error(\n \"Organization provisioning returned an unexpected organization\",\n );\n }\n input.creation.log?.(\n `Organization replacement adopted (${input.response.organizationId})`,\n );\n return true;\n}\n\nasync function buildOrganizationCandidate(\n input: CreateOrganizationInput,\n rootContainerId: string,\n): Promise<OrganizationProvisioningArtifacts | null> {\n const artifactsInput: OrganizationProvisioningArtifactsInput = {\n encapsulationKeyPair: input.encapsulationKeyPair,\n organizationProfileName: input.organizationProfileName,\n provisionedSystemContainers: input.provisionedSystemContainers,\n rootContainerId,\n rosterProfileNickname: input.rosterProfileNickname,\n signingKeyPair: input.signingKeyPair,\n userId: input.userId,\n };\n const artifacts: OrganizationProvisioningArtifacts =\n await buildOrganizationProvisioningArtifacts(artifactsInput);\n\n if (input.replacesOrganizationId) {\n artifacts.replacementAuthorization =\n await signOrganizationReplacementAuthorization(\n {\n ...artifacts,\n replacesOrganizationId: input.replacesOrganizationId,\n rootContainerId,\n userId: input.userId,\n },\n input.signingKeyPair,\n );\n }\n\n if (\n input.replacesOrganizationId &&\n input.isIdentityCurrent &&\n !input.isIdentityCurrent()\n ) {\n input.log?.(\n \"Organization creation aborted: identity changed while building artifacts\",\n );\n return null;\n }\n\n return artifacts;\n}\n\n/**\n * Provisions an additional organization for an already-registered user, reusing\n * the exact artifact-build and local-persistence path as registration\n * ({@link buildOrganizationProvisioningArtifacts} /\n * {@link persistOrganizationProvisioningState}). Unlike registration it mints a\n * fresh root container id, signs with the caller's existing identity, and needs\n * no auth challenge — the user is already authenticated.\n */\nexport async function createOrganization(\n input: CreateOrganizationInput,\n): Promise<CreateOrganizationResponse | null> {\n input.log?.(\"Creating organization...\");\n\n const rootContainerId = crypto.randomUUID();\n const candidateArtifacts = await buildOrganizationCandidate(\n input,\n rootContainerId,\n );\n\n if (!candidateArtifacts) return null;\n\n const durableAttempt = await makeOrganizationProvisioningAttemptDurable({\n artifacts: candidateArtifacts,\n canStartDurableMutation: input.isIdentityCurrent,\n dbClient: input.dbClient,\n nativeSubscriptionRestore: input.nativeSubscriptionRestore,\n replacesOrganizationId: input.replacesOrganizationId,\n rootContainerId,\n userId: input.userId,\n });\n if (!durableAttempt) {\n input.log?.(\n \"Organization creation aborted: identity changed before saving artifacts\",\n );\n return null;\n }\n const {\n artifacts,\n request,\n rootContainerId: durableRootContainerId,\n } = durableAttempt;\n\n if (input.isIdentityCurrent && !input.isIdentityCurrent()) {\n input.log?.(\n \"Organization creation aborted: identity changed before provisioning\",\n );\n return null;\n }\n\n const response = await input.apiClient.createOrganization(request);\n if (!response) {\n return null;\n }\n\n if (input.isIdentityCurrent && !input.isIdentityCurrent()) {\n input.log?.(\n \"Organization creation discarded: identity changed while provisioning\",\n );\n return null;\n }\n\n if (\n input.replacesOrganizationId &&\n !(await pinOrganizationReplacementResponse({\n replacesOrganizationId: input.replacesOrganizationId,\n response,\n signingPublicKey: input.signingKeyPair.signingPublicKey,\n userId: input.userId,\n execSql: createExecSql(input.dbClient),\n stillCurrent: input.isIdentityCurrent,\n }))\n )\n return null;\n\n if (isAdoptedReplacementResponse({ creation: input, request, response })) {\n // Another device authorized this winning genesis with the same identity.\n // Its encrypted bootstrap will hydrate normally; persisting\n // this device's losing candidate would instead create an unrelated local\n // root. The session reset rebinds retained local data to the winning ids.\n return response;\n }\n\n input.log?.(`Organization created (${response.organizationId})`);\n await persistOrganizationProvisioningState({\n bootstrap: artifacts.bootstrap,\n canStartDurableMutation: input.isIdentityCurrent,\n onPersistQueued: input.onPersistQueued,\n containerId: durableRootContainerId,\n dbClient: input.dbClient,\n documentProjectors: input.documentProjectors,\n initialAdminGroup: artifacts.initialAdminGroup,\n initialMemberGroup: artifacts.initialMemberGroup,\n initialOrganizationPolicy: artifacts.initialOrganizationPolicy,\n log: input.log,\n logError: input.logError,\n organizationMetadataBootstrap: artifacts.organizationMetadataBootstrap,\n primePrincipalHistory: input.primePrincipalHistory,\n response,\n rootContainer: artifacts.rootContainer,\n rootMetadataDocument: artifacts.rootMetadataDocument,\n rootMetadataDocumentRequest: artifacts.rootMetadataDocumentRequest,\n rosterProfileBootstrap: artifacts.rosterProfileBootstrap,\n systemContainerBootstraps: artifacts.systemContainerBootstraps,\n });\n\n return response;\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UpdateOrganizationProfileRequest, UpdateOrganizationRosterEntryRequest } from "../../internal/validators/request/index.js";
|
|
2
|
-
import type { OrganizationContainerGrantResponse, OrganizationContainerGrantsResponse, OrganizationDirectoryResponse, OrganizationDirectoryUserResponse, OrganizationGroupContainerResponse, OrganizationGroupContainersResponse,
|
|
2
|
+
import type { OrganizationContainerGrantResponse, OrganizationContainerGrantsResponse, OrganizationDirectoryResponse, OrganizationDirectoryUserResponse, OrganizationGroupContainerResponse, OrganizationGroupContainersResponse, OrganizationGroupSummaryResponse, OrganizationProfileResponse, OrganizationReadModelGroupMemberResponse, OrganizationUserDetailResponse } from "../../internal/validators/response/index.js";
|
|
3
3
|
import type { OrganizationGroupPolicyHistory } from "./policyHistoryReadModel.js";
|
|
4
4
|
export type { OrganizationGroupPolicyHistory, OrganizationGroupPolicyHistoryEntry, OrganizationPolicyGrantChange, OrganizationPolicyGroupChange, OrganizationPolicyHistory, OrganizationPolicyHistoryEntry, OrganizationPrincipalMemberChange, OrganizationPrincipalMemberChangeType, OrganizationPrincipalPolicyHistory, OrganizationPrincipalPolicyHistoryEntry, } from "./policyHistoryReadModel.js";
|
|
5
5
|
export { buildOrganizationGroupPolicyHistory, buildOrganizationPolicyHistory, } from "./policyHistoryReadModel.js";
|
|
@@ -26,8 +26,13 @@ export interface OrganizationUserDetail extends Omit<OrganizationUserDetailRespo
|
|
|
26
26
|
readonly groupGrants: OrganizationContainerGrant[];
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
|
|
30
|
-
export type
|
|
29
|
+
/** A projected group member: public keys live in the directory lane only. */
|
|
30
|
+
export type OrganizationGroupMember = OrganizationReadModelGroupMemberResponse;
|
|
31
|
+
export interface OrganizationGroupMembers {
|
|
32
|
+
readonly groupId: string;
|
|
33
|
+
readonly members: OrganizationGroupMember[];
|
|
34
|
+
readonly organizationId: string;
|
|
35
|
+
}
|
|
31
36
|
export type OrganizationGroupSummary = OrganizationGroupSummaryResponse & {
|
|
32
37
|
readonly name: string;
|
|
33
38
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readModel.js","sourceRoot":"","sources":["readModel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"readModel.js","sourceRoot":"","sources":["readModel.ts"],"names":[],"mappings":"AA8BA,OAAO,EACL,mCAAmC,EACnC,8BAA8B,GAC/B,MAAM,0BAA0B,CAAC;AAqElC,MAAM,CAAC,KAAK,UAAU,6BAA6B,CAAC,KAQnD;IACC,OAAO,KAAK,CAAC,SAAS,CAAC,6BAA6B,CAClD,KAAK,CAAC,cAAc,EACpB,KAAK,CAAC,MAAM,EACZ,EAAE,iBAAiB,EAAE,KAAK,CAAC,iBAAiB,EAAE,CAC/C,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAAC,KAI/C;IACC,OAAO,KAAK,CAAC,SAAS,CAAC,yBAAyB,CAAC,KAAK,CAAC,cAAc,EAAE;QACrE,iBAAiB,EAAE,KAAK,CAAC,iBAAiB;KAC3C,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type {\n UpdateOrganizationProfileRequest,\n UpdateOrganizationRosterEntryRequest,\n} from \"@tearleads/validators/request\";\nimport type {\n OrganizationContainerGrantResponse,\n OrganizationContainerGrantsResponse,\n OrganizationDirectoryResponse,\n OrganizationDirectoryUserResponse,\n OrganizationGroupContainerResponse,\n OrganizationGroupContainersResponse,\n OrganizationGroupSummaryResponse,\n OrganizationProfileResponse,\n OrganizationReadModelGroupMemberResponse,\n OrganizationUserDetailResponse,\n} from \"@tearleads/validators/response\";\nimport type { OrganizationGroupPolicyHistory } from \"./policyHistoryReadModel\";\n\nexport type {\n OrganizationGroupPolicyHistory,\n OrganizationGroupPolicyHistoryEntry,\n OrganizationPolicyGrantChange,\n OrganizationPolicyGroupChange,\n OrganizationPolicyHistory,\n OrganizationPolicyHistoryEntry,\n OrganizationPrincipalMemberChange,\n OrganizationPrincipalMemberChangeType,\n OrganizationPrincipalPolicyHistory,\n OrganizationPrincipalPolicyHistoryEntry,\n} from \"./policyHistoryReadModel\";\nexport {\n buildOrganizationGroupPolicyHistory,\n buildOrganizationPolicyHistory,\n} from \"./policyHistoryReadModel\";\n\nexport type OrganizationDirectory = OrganizationDirectoryResponse;\nexport type OrganizationDirectoryUser = OrganizationDirectoryUserResponse;\nexport type OrganizationProfile = OrganizationProfileResponse;\nexport type OrganizationGroupContainer = OrganizationGroupContainerResponse & {\n readonly containerDisplayName: string | null;\n};\nexport type OrganizationContainerGrant = OrganizationContainerGrantResponse & {\n readonly groupName: string | null;\n readonly containerDisplayName: string | null;\n};\nexport interface OrganizationGroupContainers\n extends Omit<OrganizationGroupContainersResponse, \"containers\"> {\n readonly containers: OrganizationGroupContainer[];\n}\nexport interface OrganizationContainerGrants\n extends Omit<OrganizationContainerGrantsResponse, \"grants\"> {\n readonly grants: OrganizationContainerGrant[];\n}\nexport interface OrganizationUserDetail\n extends Omit<OrganizationUserDetailResponse, \"grants\" | \"groups\"> {\n readonly groups: OrganizationGroupSummary[];\n readonly grants: {\n readonly directGrants: OrganizationContainerGrant[];\n readonly groupGrants: OrganizationContainerGrant[];\n };\n}\n/** A projected group member: public keys live in the directory lane only. */\nexport type OrganizationGroupMember = OrganizationReadModelGroupMemberResponse;\nexport interface OrganizationGroupMembers {\n readonly groupId: string;\n readonly members: OrganizationGroupMember[];\n readonly organizationId: string;\n}\nexport type OrganizationGroupSummary = OrganizationGroupSummaryResponse & {\n readonly name: string;\n /**\n * The group's signed name does not open under the metadata key this member\n * holds; only a dishonest admin signs such a name. `name` is then empty, and\n * the group must not be offered for selection by name.\n */\n readonly nameUnreadable: boolean;\n};\nexport interface OrganizationDirectoryAndGroups {\n readonly directory: OrganizationDirectory;\n readonly groups: ReadonlyArray<OrganizationGroupSummary>;\n readonly memberGroupId: string;\n readonly readModelCursor: string;\n}\n\nexport interface OrganizationGroupDetails {\n readonly members: OrganizationGroupMembers | null;\n readonly containers: OrganizationGroupContainers | null;\n readonly policyHistory: OrganizationGroupPolicyHistory | null;\n}\n\ninterface OrganizationReadApi {\n readonly updateOrganizationRosterEntry: (\n organizationId: string,\n userId: string,\n input: UpdateOrganizationRosterEntryRequest,\n ) => Promise<OrganizationDirectoryUserResponse | null>;\n readonly updateOrganizationProfile: (\n organizationId: string,\n input: UpdateOrganizationProfileRequest,\n ) => Promise<OrganizationProfileResponse | null>;\n}\n\nexport async function updateOrganizationRosterEntry(input: {\n readonly apiClient: Pick<\n OrganizationReadApi,\n \"updateOrganizationRosterEntry\"\n >;\n readonly organizationId: string;\n readonly profileDocumentId: string | null;\n readonly userId: string;\n}): Promise<OrganizationDirectoryUser | null> {\n return input.apiClient.updateOrganizationRosterEntry(\n input.organizationId,\n input.userId,\n { profileDocumentId: input.profileDocumentId },\n );\n}\n\nexport async function updateOrganizationProfile(input: {\n readonly apiClient: Pick<OrganizationReadApi, \"updateOrganizationProfile\">;\n readonly organizationId: string;\n readonly profileDocumentId: string | null;\n}): Promise<OrganizationProfileResponse | null> {\n return input.apiClient.updateOrganizationProfile(input.organizationId, {\n profileDocumentId: input.profileDocumentId,\n });\n}\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { RequestResult, RequestResultOptions } from "../../internal/api-client/index.js";
|
|
2
2
|
import { type OrganizationReadModelResponse } from "../../internal/validators/response/index.js";
|
|
3
|
+
import { type OrganizationReadModelGroupMembers } from "../../data/persistence/organizations/organizationReadModelMemberLoad.js";
|
|
3
4
|
import type { ExecSql } from "../../data/sqlite/sqlSchema.js";
|
|
4
5
|
import type { OrganizationDirectoryAndGroups } from "./readModel.js";
|
|
5
6
|
interface OrganizationReadModelApi {
|
|
@@ -17,18 +18,7 @@ export interface ReconcileOrganizationDirectoryAndGroupsInput extends Organizati
|
|
|
17
18
|
export declare function loadLocalOrganizationDirectoryAndGroups(input: OrganizationReadModelProjectionInput): Promise<OrganizationDirectoryAndGroups | null>;
|
|
18
19
|
export declare function loadLocalOrganizationGroupMembers(input: OrganizationReadModelProjectionInput & {
|
|
19
20
|
readonly groupId: string;
|
|
20
|
-
}): Promise<
|
|
21
|
-
groupId: string;
|
|
22
|
-
members: {
|
|
23
|
-
encapsulationKeyFingerprint: string | null;
|
|
24
|
-
encapsulationPublicKey: string | null;
|
|
25
|
-
role: "member" | "admin";
|
|
26
|
-
signingKeyFingerprint: string | null;
|
|
27
|
-
signingPublicKey: string | null;
|
|
28
|
-
userId: string;
|
|
29
|
-
}[];
|
|
30
|
-
organizationId: string;
|
|
31
|
-
} | null>;
|
|
21
|
+
}): Promise<OrganizationReadModelGroupMembers | null>;
|
|
32
22
|
/**
|
|
33
23
|
* Resolves the reconciled projection, `null` when the pass completed
|
|
34
24
|
* authoritatively with nothing presentable (including a denial that purged
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ORGANIZATION_READ_MODEL_ERROR_CODES, } from "../../internal/validators/response/index.js";
|
|
2
2
|
import { purgeOrganizationAccessProjection } from "../../data/persistence/organizations/organizationAccessRevocationPersistence.js";
|
|
3
3
|
import { recordOrganizationPresentationDenials } from "../../data/persistence/organizations/organizationPresentationDenialPersistence.js";
|
|
4
|
-
import { loadOrganizationReadModelGroupMembers } from "../../data/persistence/organizations/organizationReadModelMemberLoad.js";
|
|
4
|
+
import { loadOrganizationReadModelGroupMembers, } from "../../data/persistence/organizations/organizationReadModelMemberLoad.js";
|
|
5
5
|
import { OrganizationReadModelBindingError } from "../../data/persistence/organizations/organizationReadModelMembershipPersistence.js";
|
|
6
6
|
import { applyOrganizationReadModelResponse, loadOrganizationReadModelProjection, purgeOrganizationReadModelProjection, } from "../../data/persistence/organizations/organizationReadModelPersistence.js";
|
|
7
7
|
import { captureOrganizationPresentationAccessAttempt, denyOrganizationPresentationAccess, isOrganizationPresentationAccessAttemptCurrent, isOrganizationPresentationAccessReadable, restoreOrganizationPresentationAccess, runOrganizationPresentationMutation, runOrganizationPresentationRead, } from "./organizationPresentationAccessState.js";
|