@tearleads/client-sdk 0.1.248 → 0.1.249
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/organizations/index.js +5 -3
- package/client/organizations/index.js.map +1 -1
- package/client/organizations/organizationGroupPresentation.d.ts +1 -1
- package/client/organizations/organizationGroupPresentation.js.map +1 -1
- package/client/organizations/organizationLeaveRequestVerifier.js +21 -0
- package/client/organizations/organizationLeaveRequestVerifier.js.map +1 -0
- package/client/organizations/{organizationReadModels.d.ts → organizationReadModelCoordinator.d.ts} +18 -16
- package/client/organizations/organizationReadModelCoordinator.js +2 -0
- package/client/organizations/organizationReadModelCoordinator.js.map +1 -0
- package/client/organizations/organizationReadModelPresentation.js +51 -0
- package/client/organizations/organizationReadModelPresentation.js.map +1 -0
- package/client/organizations/organizationReadModelScopes.js +37 -0
- package/client/organizations/organizationReadModelScopes.js.map +1 -0
- package/client/organizations/organizationReadModels.js +131 -88
- package/client/organizations/organizationReadModels.js.map +1 -1
- package/client/organizations/organizationsTypes.d.ts +13 -5
- package/client/organizations/organizationsTypes.js.map +1 -1
- package/client/organizations/principalMutations.d.ts +18 -2
- package/client/organizations/principalMutations.js +29 -15
- package/client/organizations/principalMutations.js.map +1 -1
- package/client/runtime/principalMutationApi.d.ts +2 -0
- package/client/runtime/principalMutationApi.js +2 -0
- package/client/runtime/principalMutationApi.js.map +1 -1
- package/client/runtime/principalMutationDispatch.js +47 -10
- package/client/runtime/principalMutationDispatch.js.map +1 -1
- package/client/runtime/workflowRuntime.js +5 -4
- package/client/runtime/workflowRuntime.js.map +1 -1
- package/data/containers/shared/mutationRequestOptions.d.ts +2 -0
- package/data/containers/shared/mutationRequestOptions.js.map +1 -1
- package/data/containers/shared/types.d.ts +12 -2
- package/data/containers/shared/types.js.map +1 -1
- package/data/persistence/organizations/organizationReadModelRepository.js +20 -2
- package/data/persistence/organizations/organizationReadModelRepository.js.map +1 -1
- package/internal/api-client/ApiClient.d.ts +4 -1
- package/internal/api-client/client/containerMutations.d.ts +2 -2
- package/internal/api-client/client/containerMutations.js +2 -1
- package/internal/api-client/client/containerMutations.js.map +1 -1
- package/internal/api-client/client/principalPolicies.d.ts +3 -0
- package/internal/api-client/principalPolicyRequests.d.ts +2 -0
- package/internal/api-client/principalPolicyRequests.js +6 -4
- package/internal/api-client/principalPolicyRequests.js.map +1 -1
- package/internal/api-client/routes/containers/mutations.js +3 -3
- package/internal/api-client/routes/containers/mutations.js.map +1 -1
- package/internal/api-client/routes/organizations/createGroup.js +3 -5
- package/internal/api-client/routes/organizations/createGroup.js.map +1 -1
- package/internal/api-client/routes/principals/policy.js +2 -5
- package/internal/api-client/routes/principals/policy.js.map +1 -1
- package/internal/api-client/types.d.ts +6 -0
- package/internal/api-client/types.js.map +1 -1
- package/internal/validators/operation/containerMutations.d.ts +20 -3
- package/internal/validators/operation/containerMutations.js +18 -20
- package/internal/validators/operation/containerMutations.js.map +1 -1
- package/internal/validators/operation/index.d.ts +1 -1
- package/internal/validators/operation/index.js +1 -1
- package/internal/validators/operation/index.js.map +1 -1
- package/internal/validators/operation/organizations.d.ts +17 -1
- package/internal/validators/operation/organizations.js +4 -2
- package/internal/validators/operation/organizations.js.map +1 -1
- package/internal/validators/operation/principals.d.ts +17 -1
- package/internal/validators/operation/principals.js +5 -2
- package/internal/validators/operation/principals.js.map +1 -1
- package/internal/validators/request/index.d.ts +1 -1
- package/internal/validators/request/index.js +1 -1
- package/internal/validators/request/index.js.map +1 -1
- package/internal/validators/request/organization.d.ts +15 -0
- package/internal/validators/request/organization.js +8 -0
- package/internal/validators/request/organization.js.map +1 -1
- package/internal/validators/response/areas/organizations.d.ts +3 -2
- package/internal/validators/response/areas/organizations.js +3 -2
- package/internal/validators/response/areas/organizations.js.map +1 -1
- package/internal/validators/response/areas/principals.d.ts +1 -1
- package/internal/validators/response/areas/principals.js +1 -1
- package/internal/validators/response/areas/principals.js.map +1 -1
- package/internal/validators/response/committedReadModel.d.ts +697 -0
- package/internal/validators/response/committedReadModel.js +52 -0
- package/internal/validators/response/committedReadModel.js.map +1 -0
- package/internal/validators/response/container.d.ts +52 -0
- package/internal/validators/response/container.js +3 -3
- package/internal/validators/response/container.js.map +1 -1
- package/internal/validators/response/organization.d.ts +0 -191
- package/internal/validators/response/organization.js +0 -7
- package/internal/validators/response/organization.js.map +1 -1
- package/internal/validators/response/organizationReadModel.d.ts +167 -0
- package/internal/validators/response/organizationReadModel.js +5 -0
- package/internal/validators/response/organizationReadModel.js.map +1 -1
- package/internal/validators/response/principal.d.ts +0 -403
- package/internal/validators/response/principal.js +0 -8
- package/internal/validators/response/principal.js.map +1 -1
- package/package.json +1 -1
- package/workflows/container-contents/container-state/organizationHost.d.ts +9 -0
- package/workflows/container-contents/container-state/organizationHost.js.map +1 -1
- package/workflows/container-contents/container-state/remote.js +6 -0
- package/workflows/container-contents/container-state/remote.js.map +1 -1
- package/workflows/containers/child/share/index.d.ts +4 -2
- package/workflows/containers/child/share/index.js +37 -20
- package/workflows/containers/child/share/index.js.map +1 -1
- package/workflows/organizations/containerContentsHost.js +20 -1
- package/workflows/organizations/containerContentsHost.js.map +1 -1
- package/workflows/organizations/groupPolicy/commitCurrentGroupPolicyMutation.js +5 -1
- package/workflows/organizations/groupPolicy/commitCurrentGroupPolicyMutation.js.map +1 -1
- package/workflows/organizations/groups/createCurrentOrganizationGroup.js +8 -1
- package/workflows/organizations/groups/createCurrentOrganizationGroup.js.map +1 -1
- package/workflows/organizations/index.d.ts +1 -0
- package/workflows/organizations/index.js +1 -0
- package/workflows/organizations/index.js.map +1 -1
- package/workflows/organizations/readModel/committedReadModel.d.ts +66 -0
- package/workflows/organizations/readModel/committedReadModel.js +150 -0
- package/workflows/organizations/readModel/committedReadModel.js.map +1 -0
- package/workflows/organizations/readModel/readModelProjection.d.ts +15 -2
- package/workflows/organizations/readModel/readModelProjection.js +26 -4
- package/workflows/organizations/readModel/readModelProjection.js.map +1 -1
|
@@ -802,4 +802,171 @@ export declare const OrganizationReadModelResponseSchema: z.ZodDiscriminatedUnio
|
|
|
802
802
|
}, z.core.$strict>], "mode">;
|
|
803
803
|
export type OrganizationReadModelResponse = z.infer<typeof OrganizationReadModelResponseSchema>;
|
|
804
804
|
export declare function isOrganizationReadModelResponse(value: unknown): value is OrganizationReadModelResponse;
|
|
805
|
+
/**
|
|
806
|
+
* A delta page on its own. A mutation response carries one: the page a feed
|
|
807
|
+
* read from the cursor the caller held returns once the mutation commits.
|
|
808
|
+
*/
|
|
809
|
+
export declare const OrganizationReadModelDeltaSchema: z.ZodObject<{
|
|
810
|
+
lanes: z.ZodObject<{
|
|
811
|
+
directory: z.ZodOptional<z.ZodObject<{
|
|
812
|
+
organizationId: z.ZodString;
|
|
813
|
+
profileDocumentId: z.ZodNullable<z.ZodString>;
|
|
814
|
+
users: z.ZodCustom<{
|
|
815
|
+
createdAt: string;
|
|
816
|
+
disabledAt: string | null;
|
|
817
|
+
disabledByUserId: string | null;
|
|
818
|
+
encapsulationKeyFingerprint: string;
|
|
819
|
+
isPersonalOrganizationOwner: boolean;
|
|
820
|
+
isSelf: boolean;
|
|
821
|
+
joinedAt: string;
|
|
822
|
+
leaveRequest: {
|
|
823
|
+
organizationId: string;
|
|
824
|
+
userId: string;
|
|
825
|
+
requestedAt: string;
|
|
826
|
+
membersHead: {
|
|
827
|
+
principalId: string;
|
|
828
|
+
version: number;
|
|
829
|
+
keyEpoch: number;
|
|
830
|
+
stateHash: string;
|
|
831
|
+
keyFingerprint: string;
|
|
832
|
+
};
|
|
833
|
+
signature: string;
|
|
834
|
+
} | null;
|
|
835
|
+
profileDocumentId: string | null;
|
|
836
|
+
signingKeyFingerprint: string;
|
|
837
|
+
status: "active" | "disabled";
|
|
838
|
+
updatedAt: string;
|
|
839
|
+
userId: string;
|
|
840
|
+
}[], {
|
|
841
|
+
createdAt: string;
|
|
842
|
+
disabledAt: string | null;
|
|
843
|
+
disabledByUserId: string | null;
|
|
844
|
+
encapsulationKeyFingerprint: string;
|
|
845
|
+
isPersonalOrganizationOwner: boolean;
|
|
846
|
+
isSelf: boolean;
|
|
847
|
+
joinedAt: string;
|
|
848
|
+
leaveRequest: {
|
|
849
|
+
organizationId: string;
|
|
850
|
+
userId: string;
|
|
851
|
+
requestedAt: string;
|
|
852
|
+
membersHead: {
|
|
853
|
+
principalId: string;
|
|
854
|
+
version: number;
|
|
855
|
+
keyEpoch: number;
|
|
856
|
+
stateHash: string;
|
|
857
|
+
keyFingerprint: string;
|
|
858
|
+
};
|
|
859
|
+
signature: string;
|
|
860
|
+
} | null;
|
|
861
|
+
profileDocumentId: string | null;
|
|
862
|
+
signingKeyFingerprint: string;
|
|
863
|
+
status: "active" | "disabled";
|
|
864
|
+
updatedAt: string;
|
|
865
|
+
userId: string;
|
|
866
|
+
}[]>;
|
|
867
|
+
}, z.core.$strict>>;
|
|
868
|
+
grants: z.ZodOptional<z.ZodObject<{
|
|
869
|
+
grants: z.ZodCustom<{
|
|
870
|
+
groupId: string | null;
|
|
871
|
+
signingKeyFingerprint: string | null;
|
|
872
|
+
subjectId: string;
|
|
873
|
+
subjectType: "group" | "user";
|
|
874
|
+
userId: string | null;
|
|
875
|
+
accessLevel: "write" | "admin" | "read";
|
|
876
|
+
containerId: string;
|
|
877
|
+
createdAt: string;
|
|
878
|
+
depth: number;
|
|
879
|
+
isBuiltin: boolean;
|
|
880
|
+
metadataAccessEpoch: number;
|
|
881
|
+
metadataAccessStateHash: string;
|
|
882
|
+
metadataDocumentId: string | null;
|
|
883
|
+
parentId: string | null;
|
|
884
|
+
updatedAt: string;
|
|
885
|
+
}[], {
|
|
886
|
+
groupId: string | null;
|
|
887
|
+
signingKeyFingerprint: string | null;
|
|
888
|
+
subjectId: string;
|
|
889
|
+
subjectType: "group" | "user";
|
|
890
|
+
userId: string | null;
|
|
891
|
+
accessLevel: "write" | "admin" | "read";
|
|
892
|
+
containerId: string;
|
|
893
|
+
createdAt: string;
|
|
894
|
+
depth: number;
|
|
895
|
+
isBuiltin: boolean;
|
|
896
|
+
metadataAccessEpoch: number;
|
|
897
|
+
metadataAccessStateHash: string;
|
|
898
|
+
metadataDocumentId: string | null;
|
|
899
|
+
parentId: string | null;
|
|
900
|
+
updatedAt: string;
|
|
901
|
+
}[]>;
|
|
902
|
+
organizationId: z.ZodString;
|
|
903
|
+
}, z.core.$strict>>;
|
|
904
|
+
groupMemberships: z.ZodOptional<z.ZodObject<{
|
|
905
|
+
deletedGroupIds: z.ZodCustom<string[], string[]>;
|
|
906
|
+
groups: z.ZodCustom<{
|
|
907
|
+
groupId: string;
|
|
908
|
+
members: {
|
|
909
|
+
role: "member" | "admin";
|
|
910
|
+
userId: string;
|
|
911
|
+
}[];
|
|
912
|
+
stateHash: string;
|
|
913
|
+
}[], {
|
|
914
|
+
groupId: string;
|
|
915
|
+
members: {
|
|
916
|
+
role: "member" | "admin";
|
|
917
|
+
userId: string;
|
|
918
|
+
}[];
|
|
919
|
+
stateHash: string;
|
|
920
|
+
}[]>;
|
|
921
|
+
organizationId: z.ZodString;
|
|
922
|
+
}, z.core.$strict>>;
|
|
923
|
+
groups: z.ZodOptional<z.ZodObject<{
|
|
924
|
+
groups: z.ZodCustom<{
|
|
925
|
+
currentState: {
|
|
926
|
+
keyEpoch: number;
|
|
927
|
+
keyFingerprint: string;
|
|
928
|
+
memberCount: number;
|
|
929
|
+
stateHash: string;
|
|
930
|
+
version: number;
|
|
931
|
+
} | null;
|
|
932
|
+
createdAt: string;
|
|
933
|
+
groupId: string;
|
|
934
|
+
isBuiltin: boolean;
|
|
935
|
+
organizationId: string;
|
|
936
|
+
}[], {
|
|
937
|
+
currentState: {
|
|
938
|
+
keyEpoch: number;
|
|
939
|
+
keyFingerprint: string;
|
|
940
|
+
memberCount: number;
|
|
941
|
+
stateHash: string;
|
|
942
|
+
version: number;
|
|
943
|
+
} | null;
|
|
944
|
+
createdAt: string;
|
|
945
|
+
groupId: string;
|
|
946
|
+
isBuiltin: boolean;
|
|
947
|
+
organizationId: string;
|
|
948
|
+
}[]>;
|
|
949
|
+
memberGroupId: z.ZodString;
|
|
950
|
+
organizationId: z.ZodString;
|
|
951
|
+
}, z.core.$strict>>;
|
|
952
|
+
organizationPolicy: z.ZodOptional<z.ZodObject<{
|
|
953
|
+
currentState: z.ZodObject<{
|
|
954
|
+
stateHash: z.ZodString;
|
|
955
|
+
keyEpoch: z.ZodCustom<number, number>;
|
|
956
|
+
keyFingerprint: z.ZodString;
|
|
957
|
+
memberCount: z.ZodCustom<number, number>;
|
|
958
|
+
version: z.ZodCustom<number, number>;
|
|
959
|
+
}, z.core.$strict>;
|
|
960
|
+
organizationId: z.ZodString;
|
|
961
|
+
}, z.core.$strict>>;
|
|
962
|
+
}, z.core.$strict>;
|
|
963
|
+
mode: z.ZodLiteral<"delta">;
|
|
964
|
+
currentUser: z.ZodObject<{
|
|
965
|
+
isOrgAdmin: z.ZodBoolean;
|
|
966
|
+
}, z.core.$strict>;
|
|
967
|
+
hasMore: z.ZodBoolean;
|
|
968
|
+
nextCursor: z.ZodString;
|
|
969
|
+
organizationId: z.ZodString;
|
|
970
|
+
version: z.ZodLiteral<6>;
|
|
971
|
+
}, z.core.$strict>;
|
|
805
972
|
export {};
|
|
@@ -161,4 +161,9 @@ export const OrganizationReadModelResponseSchema = registerJsonSchemaRuntimeRefi
|
|
|
161
161
|
export function isOrganizationReadModelResponse(value) {
|
|
162
162
|
return OrganizationReadModelResponseSchema.safeParse(value).success;
|
|
163
163
|
}
|
|
164
|
+
/**
|
|
165
|
+
* A delta page on its own. A mutation response carries one: the page a feed
|
|
166
|
+
* read from the cursor the caller held returns once the mutation commits.
|
|
167
|
+
*/
|
|
168
|
+
export const OrganizationReadModelDeltaSchema = registerJsonSchemaRuntimeRefinements(registerJsonSchemaView(OrganizationReadModelDeltaResponseSchema.refine(hasValidReadModelSemantics), OrganizationReadModelDeltaResponseSchema), organizationReadModelResponseRuntimeRefinements);
|
|
164
169
|
//# sourceMappingURL=organizationReadModel.js.map
|
|
@@ -1 +1 @@
|
|
|
1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,KAAK,CAAC,kBAAkB,KAAK,SAAS;YACrC,KAAK,CAAC,kBAAkB,CAAC,cAAc,KAAK,cAAc,CAAC,CAC9D,CAAC;AACJ,CAAC;AAED,SAAS,0BAA0B,CACjC,KAAwC;IAExC,IACE,CAAC,sBAAsB,CAAC,KAAK,CAAC;QAC9B,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS;YAC/B,CAAC,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC7C,CAAC,KAAK,CAAC,KAAK,CAAC,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\n/**\n * A projected member names only the user and role. The read model carries no\n * public keys: directory rows carry key fingerprints, and keying takes keys\n * from the trusted identity store.\n */\nconst OrganizationReadModelGroupMemberResponseSchema = z.strictObject(\n OrganizationGroupMemberResponseShape,\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"]}
|
|
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,EAC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,CAAC,MAAM,CAAC,CAAC;QAC7C,CAAC,KAAK,CAAC,KAAK,CAAC,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;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAC3C,oCAAoC,CAClC,sBAAsB,CACpB,wCAAwC,CAAC,MAAM,CAC7C,0BAA0B,CAC3B,EACD,wCAAwC,CACzC,EACD,+CAA+C,CAChD,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. The read model carries no\n * public keys: directory rows carry key fingerprints, and keying takes keys\n * from the trusted identity store.\n */\nconst OrganizationReadModelGroupMemberResponseSchema = z.strictObject(\n OrganizationGroupMemberResponseShape,\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\n/**\n * A delta page on its own. A mutation response carries one: the page a feed\n * read from the cursor the caller held returns once the mutation commits.\n */\nexport const OrganizationReadModelDeltaSchema =\n registerJsonSchemaRuntimeRefinements(\n registerJsonSchemaView(\n OrganizationReadModelDeltaResponseSchema.refine(\n hasValidReadModelSemantics,\n ),\n OrganizationReadModelDeltaResponseSchema,\n ),\n organizationReadModelResponseRuntimeRefinements,\n );\n"]}
|
|
@@ -772,408 +772,6 @@ export declare const PrincipalPolicyMutationResponseSchema: z.ZodType<{
|
|
|
772
772
|
};
|
|
773
773
|
}>>;
|
|
774
774
|
export type PrincipalPolicyMutationResponse = z.infer<typeof PrincipalPolicyMutationResponseSchema>;
|
|
775
|
-
export declare const CommitOrganizationGroupPolicyResponseSchema: z.ZodType<{
|
|
776
|
-
groupPolicy: {
|
|
777
|
-
containerMutations: {
|
|
778
|
-
containerKek: {
|
|
779
|
-
containerKeyEpoch: number;
|
|
780
|
-
containerKeyEpochId: string;
|
|
781
|
-
keyEpochHash: string;
|
|
782
|
-
keyringHash: string | null;
|
|
783
|
-
keyTargetHash: string;
|
|
784
|
-
parentContainerKeyEpochId: string | null;
|
|
785
|
-
};
|
|
786
|
-
bundleDigest: string;
|
|
787
|
-
containerId: string;
|
|
788
|
-
createdAt: string;
|
|
789
|
-
eventHash: string;
|
|
790
|
-
manifestHead: {
|
|
791
|
-
epoch: number;
|
|
792
|
-
manifestHash: string;
|
|
793
|
-
};
|
|
794
|
-
organizationId: string;
|
|
795
|
-
parentId: string | null;
|
|
796
|
-
updatedAt: string;
|
|
797
|
-
systemSlot?: string | null | undefined;
|
|
798
|
-
}[];
|
|
799
|
-
createdAt: string;
|
|
800
|
-
head: {
|
|
801
|
-
keyEpoch: number;
|
|
802
|
-
keyFingerprint: string;
|
|
803
|
-
principalId: string;
|
|
804
|
-
principalType: "group" | "organization";
|
|
805
|
-
stateHash: string;
|
|
806
|
-
version: number;
|
|
807
|
-
};
|
|
808
|
-
};
|
|
809
|
-
organizationPolicy: {
|
|
810
|
-
containerMutations: {
|
|
811
|
-
containerKek: {
|
|
812
|
-
containerKeyEpoch: number;
|
|
813
|
-
containerKeyEpochId: string;
|
|
814
|
-
keyEpochHash: string;
|
|
815
|
-
keyringHash: string | null;
|
|
816
|
-
keyTargetHash: string;
|
|
817
|
-
parentContainerKeyEpochId: string | null;
|
|
818
|
-
};
|
|
819
|
-
bundleDigest: string;
|
|
820
|
-
containerId: string;
|
|
821
|
-
createdAt: string;
|
|
822
|
-
eventHash: string;
|
|
823
|
-
manifestHead: {
|
|
824
|
-
epoch: number;
|
|
825
|
-
manifestHash: string;
|
|
826
|
-
};
|
|
827
|
-
organizationId: string;
|
|
828
|
-
parentId: string | null;
|
|
829
|
-
updatedAt: string;
|
|
830
|
-
systemSlot?: string | null | undefined;
|
|
831
|
-
}[];
|
|
832
|
-
createdAt: string;
|
|
833
|
-
head: {
|
|
834
|
-
keyEpoch: number;
|
|
835
|
-
keyFingerprint: string;
|
|
836
|
-
principalId: string;
|
|
837
|
-
principalType: "group" | "organization";
|
|
838
|
-
stateHash: string;
|
|
839
|
-
version: number;
|
|
840
|
-
};
|
|
841
|
-
};
|
|
842
|
-
memberPolicy?: {
|
|
843
|
-
containerMutations: {
|
|
844
|
-
containerKek: {
|
|
845
|
-
containerKeyEpoch: number;
|
|
846
|
-
containerKeyEpochId: string;
|
|
847
|
-
keyEpochHash: string;
|
|
848
|
-
keyringHash: string | null;
|
|
849
|
-
keyTargetHash: string;
|
|
850
|
-
parentContainerKeyEpochId: string | null;
|
|
851
|
-
};
|
|
852
|
-
bundleDigest: string;
|
|
853
|
-
containerId: string;
|
|
854
|
-
createdAt: string;
|
|
855
|
-
eventHash: string;
|
|
856
|
-
manifestHead: {
|
|
857
|
-
epoch: number;
|
|
858
|
-
manifestHash: string;
|
|
859
|
-
};
|
|
860
|
-
organizationId: string;
|
|
861
|
-
parentId: string | null;
|
|
862
|
-
updatedAt: string;
|
|
863
|
-
systemSlot?: string | null | undefined;
|
|
864
|
-
}[];
|
|
865
|
-
createdAt: string;
|
|
866
|
-
head: {
|
|
867
|
-
keyEpoch: number;
|
|
868
|
-
keyFingerprint: string;
|
|
869
|
-
principalId: string;
|
|
870
|
-
principalType: "group" | "organization";
|
|
871
|
-
stateHash: string;
|
|
872
|
-
version: number;
|
|
873
|
-
};
|
|
874
|
-
} | undefined;
|
|
875
|
-
}, {
|
|
876
|
-
groupPolicy: {
|
|
877
|
-
containerMutations: {
|
|
878
|
-
containerKek: {
|
|
879
|
-
containerKeyEpoch: number;
|
|
880
|
-
containerKeyEpochId: string;
|
|
881
|
-
keyEpochHash: string;
|
|
882
|
-
keyringHash: string | null;
|
|
883
|
-
keyTargetHash: string;
|
|
884
|
-
parentContainerKeyEpochId: string | null;
|
|
885
|
-
};
|
|
886
|
-
bundleDigest: string;
|
|
887
|
-
containerId: string;
|
|
888
|
-
createdAt: string;
|
|
889
|
-
eventHash: string;
|
|
890
|
-
manifestHead: {
|
|
891
|
-
epoch: number;
|
|
892
|
-
manifestHash: string;
|
|
893
|
-
};
|
|
894
|
-
organizationId: string;
|
|
895
|
-
parentId: string | null;
|
|
896
|
-
updatedAt: string;
|
|
897
|
-
systemSlot?: string | null | undefined;
|
|
898
|
-
}[];
|
|
899
|
-
createdAt: string;
|
|
900
|
-
head: {
|
|
901
|
-
keyEpoch: number;
|
|
902
|
-
keyFingerprint: string;
|
|
903
|
-
principalId: string;
|
|
904
|
-
principalType: "group" | "organization";
|
|
905
|
-
stateHash: string;
|
|
906
|
-
version: number;
|
|
907
|
-
};
|
|
908
|
-
};
|
|
909
|
-
organizationPolicy: {
|
|
910
|
-
containerMutations: {
|
|
911
|
-
containerKek: {
|
|
912
|
-
containerKeyEpoch: number;
|
|
913
|
-
containerKeyEpochId: string;
|
|
914
|
-
keyEpochHash: string;
|
|
915
|
-
keyringHash: string | null;
|
|
916
|
-
keyTargetHash: string;
|
|
917
|
-
parentContainerKeyEpochId: string | null;
|
|
918
|
-
};
|
|
919
|
-
bundleDigest: string;
|
|
920
|
-
containerId: string;
|
|
921
|
-
createdAt: string;
|
|
922
|
-
eventHash: string;
|
|
923
|
-
manifestHead: {
|
|
924
|
-
epoch: number;
|
|
925
|
-
manifestHash: string;
|
|
926
|
-
};
|
|
927
|
-
organizationId: string;
|
|
928
|
-
parentId: string | null;
|
|
929
|
-
updatedAt: string;
|
|
930
|
-
systemSlot?: string | null | undefined;
|
|
931
|
-
}[];
|
|
932
|
-
createdAt: string;
|
|
933
|
-
head: {
|
|
934
|
-
keyEpoch: number;
|
|
935
|
-
keyFingerprint: string;
|
|
936
|
-
principalId: string;
|
|
937
|
-
principalType: "group" | "organization";
|
|
938
|
-
stateHash: string;
|
|
939
|
-
version: number;
|
|
940
|
-
};
|
|
941
|
-
};
|
|
942
|
-
memberPolicy?: {
|
|
943
|
-
containerMutations: {
|
|
944
|
-
containerKek: {
|
|
945
|
-
containerKeyEpoch: number;
|
|
946
|
-
containerKeyEpochId: string;
|
|
947
|
-
keyEpochHash: string;
|
|
948
|
-
keyringHash: string | null;
|
|
949
|
-
keyTargetHash: string;
|
|
950
|
-
parentContainerKeyEpochId: string | null;
|
|
951
|
-
};
|
|
952
|
-
bundleDigest: string;
|
|
953
|
-
containerId: string;
|
|
954
|
-
createdAt: string;
|
|
955
|
-
eventHash: string;
|
|
956
|
-
manifestHead: {
|
|
957
|
-
epoch: number;
|
|
958
|
-
manifestHash: string;
|
|
959
|
-
};
|
|
960
|
-
organizationId: string;
|
|
961
|
-
parentId: string | null;
|
|
962
|
-
updatedAt: string;
|
|
963
|
-
systemSlot?: string | null | undefined;
|
|
964
|
-
}[];
|
|
965
|
-
createdAt: string;
|
|
966
|
-
head: {
|
|
967
|
-
keyEpoch: number;
|
|
968
|
-
keyFingerprint: string;
|
|
969
|
-
principalId: string;
|
|
970
|
-
principalType: "group" | "organization";
|
|
971
|
-
stateHash: string;
|
|
972
|
-
version: number;
|
|
973
|
-
};
|
|
974
|
-
} | undefined;
|
|
975
|
-
}, z.core.$ZodTypeInternals<{
|
|
976
|
-
groupPolicy: {
|
|
977
|
-
containerMutations: {
|
|
978
|
-
containerKek: {
|
|
979
|
-
containerKeyEpoch: number;
|
|
980
|
-
containerKeyEpochId: string;
|
|
981
|
-
keyEpochHash: string;
|
|
982
|
-
keyringHash: string | null;
|
|
983
|
-
keyTargetHash: string;
|
|
984
|
-
parentContainerKeyEpochId: string | null;
|
|
985
|
-
};
|
|
986
|
-
bundleDigest: string;
|
|
987
|
-
containerId: string;
|
|
988
|
-
createdAt: string;
|
|
989
|
-
eventHash: string;
|
|
990
|
-
manifestHead: {
|
|
991
|
-
epoch: number;
|
|
992
|
-
manifestHash: string;
|
|
993
|
-
};
|
|
994
|
-
organizationId: string;
|
|
995
|
-
parentId: string | null;
|
|
996
|
-
updatedAt: string;
|
|
997
|
-
systemSlot?: string | null | undefined;
|
|
998
|
-
}[];
|
|
999
|
-
createdAt: string;
|
|
1000
|
-
head: {
|
|
1001
|
-
keyEpoch: number;
|
|
1002
|
-
keyFingerprint: string;
|
|
1003
|
-
principalId: string;
|
|
1004
|
-
principalType: "group" | "organization";
|
|
1005
|
-
stateHash: string;
|
|
1006
|
-
version: number;
|
|
1007
|
-
};
|
|
1008
|
-
};
|
|
1009
|
-
organizationPolicy: {
|
|
1010
|
-
containerMutations: {
|
|
1011
|
-
containerKek: {
|
|
1012
|
-
containerKeyEpoch: number;
|
|
1013
|
-
containerKeyEpochId: string;
|
|
1014
|
-
keyEpochHash: string;
|
|
1015
|
-
keyringHash: string | null;
|
|
1016
|
-
keyTargetHash: string;
|
|
1017
|
-
parentContainerKeyEpochId: string | null;
|
|
1018
|
-
};
|
|
1019
|
-
bundleDigest: string;
|
|
1020
|
-
containerId: string;
|
|
1021
|
-
createdAt: string;
|
|
1022
|
-
eventHash: string;
|
|
1023
|
-
manifestHead: {
|
|
1024
|
-
epoch: number;
|
|
1025
|
-
manifestHash: string;
|
|
1026
|
-
};
|
|
1027
|
-
organizationId: string;
|
|
1028
|
-
parentId: string | null;
|
|
1029
|
-
updatedAt: string;
|
|
1030
|
-
systemSlot?: string | null | undefined;
|
|
1031
|
-
}[];
|
|
1032
|
-
createdAt: string;
|
|
1033
|
-
head: {
|
|
1034
|
-
keyEpoch: number;
|
|
1035
|
-
keyFingerprint: string;
|
|
1036
|
-
principalId: string;
|
|
1037
|
-
principalType: "group" | "organization";
|
|
1038
|
-
stateHash: string;
|
|
1039
|
-
version: number;
|
|
1040
|
-
};
|
|
1041
|
-
};
|
|
1042
|
-
memberPolicy?: {
|
|
1043
|
-
containerMutations: {
|
|
1044
|
-
containerKek: {
|
|
1045
|
-
containerKeyEpoch: number;
|
|
1046
|
-
containerKeyEpochId: string;
|
|
1047
|
-
keyEpochHash: string;
|
|
1048
|
-
keyringHash: string | null;
|
|
1049
|
-
keyTargetHash: string;
|
|
1050
|
-
parentContainerKeyEpochId: string | null;
|
|
1051
|
-
};
|
|
1052
|
-
bundleDigest: string;
|
|
1053
|
-
containerId: string;
|
|
1054
|
-
createdAt: string;
|
|
1055
|
-
eventHash: string;
|
|
1056
|
-
manifestHead: {
|
|
1057
|
-
epoch: number;
|
|
1058
|
-
manifestHash: string;
|
|
1059
|
-
};
|
|
1060
|
-
organizationId: string;
|
|
1061
|
-
parentId: string | null;
|
|
1062
|
-
updatedAt: string;
|
|
1063
|
-
systemSlot?: string | null | undefined;
|
|
1064
|
-
}[];
|
|
1065
|
-
createdAt: string;
|
|
1066
|
-
head: {
|
|
1067
|
-
keyEpoch: number;
|
|
1068
|
-
keyFingerprint: string;
|
|
1069
|
-
principalId: string;
|
|
1070
|
-
principalType: "group" | "organization";
|
|
1071
|
-
stateHash: string;
|
|
1072
|
-
version: number;
|
|
1073
|
-
};
|
|
1074
|
-
} | undefined;
|
|
1075
|
-
}, {
|
|
1076
|
-
groupPolicy: {
|
|
1077
|
-
containerMutations: {
|
|
1078
|
-
containerKek: {
|
|
1079
|
-
containerKeyEpoch: number;
|
|
1080
|
-
containerKeyEpochId: string;
|
|
1081
|
-
keyEpochHash: string;
|
|
1082
|
-
keyringHash: string | null;
|
|
1083
|
-
keyTargetHash: string;
|
|
1084
|
-
parentContainerKeyEpochId: string | null;
|
|
1085
|
-
};
|
|
1086
|
-
bundleDigest: string;
|
|
1087
|
-
containerId: string;
|
|
1088
|
-
createdAt: string;
|
|
1089
|
-
eventHash: string;
|
|
1090
|
-
manifestHead: {
|
|
1091
|
-
epoch: number;
|
|
1092
|
-
manifestHash: string;
|
|
1093
|
-
};
|
|
1094
|
-
organizationId: string;
|
|
1095
|
-
parentId: string | null;
|
|
1096
|
-
updatedAt: string;
|
|
1097
|
-
systemSlot?: string | null | undefined;
|
|
1098
|
-
}[];
|
|
1099
|
-
createdAt: string;
|
|
1100
|
-
head: {
|
|
1101
|
-
keyEpoch: number;
|
|
1102
|
-
keyFingerprint: string;
|
|
1103
|
-
principalId: string;
|
|
1104
|
-
principalType: "group" | "organization";
|
|
1105
|
-
stateHash: string;
|
|
1106
|
-
version: number;
|
|
1107
|
-
};
|
|
1108
|
-
};
|
|
1109
|
-
organizationPolicy: {
|
|
1110
|
-
containerMutations: {
|
|
1111
|
-
containerKek: {
|
|
1112
|
-
containerKeyEpoch: number;
|
|
1113
|
-
containerKeyEpochId: string;
|
|
1114
|
-
keyEpochHash: string;
|
|
1115
|
-
keyringHash: string | null;
|
|
1116
|
-
keyTargetHash: string;
|
|
1117
|
-
parentContainerKeyEpochId: string | null;
|
|
1118
|
-
};
|
|
1119
|
-
bundleDigest: string;
|
|
1120
|
-
containerId: string;
|
|
1121
|
-
createdAt: string;
|
|
1122
|
-
eventHash: string;
|
|
1123
|
-
manifestHead: {
|
|
1124
|
-
epoch: number;
|
|
1125
|
-
manifestHash: string;
|
|
1126
|
-
};
|
|
1127
|
-
organizationId: string;
|
|
1128
|
-
parentId: string | null;
|
|
1129
|
-
updatedAt: string;
|
|
1130
|
-
systemSlot?: string | null | undefined;
|
|
1131
|
-
}[];
|
|
1132
|
-
createdAt: string;
|
|
1133
|
-
head: {
|
|
1134
|
-
keyEpoch: number;
|
|
1135
|
-
keyFingerprint: string;
|
|
1136
|
-
principalId: string;
|
|
1137
|
-
principalType: "group" | "organization";
|
|
1138
|
-
stateHash: string;
|
|
1139
|
-
version: number;
|
|
1140
|
-
};
|
|
1141
|
-
};
|
|
1142
|
-
memberPolicy?: {
|
|
1143
|
-
containerMutations: {
|
|
1144
|
-
containerKek: {
|
|
1145
|
-
containerKeyEpoch: number;
|
|
1146
|
-
containerKeyEpochId: string;
|
|
1147
|
-
keyEpochHash: string;
|
|
1148
|
-
keyringHash: string | null;
|
|
1149
|
-
keyTargetHash: string;
|
|
1150
|
-
parentContainerKeyEpochId: string | null;
|
|
1151
|
-
};
|
|
1152
|
-
bundleDigest: string;
|
|
1153
|
-
containerId: string;
|
|
1154
|
-
createdAt: string;
|
|
1155
|
-
eventHash: string;
|
|
1156
|
-
manifestHead: {
|
|
1157
|
-
epoch: number;
|
|
1158
|
-
manifestHash: string;
|
|
1159
|
-
};
|
|
1160
|
-
organizationId: string;
|
|
1161
|
-
parentId: string | null;
|
|
1162
|
-
updatedAt: string;
|
|
1163
|
-
systemSlot?: string | null | undefined;
|
|
1164
|
-
}[];
|
|
1165
|
-
createdAt: string;
|
|
1166
|
-
head: {
|
|
1167
|
-
keyEpoch: number;
|
|
1168
|
-
keyFingerprint: string;
|
|
1169
|
-
principalId: string;
|
|
1170
|
-
principalType: "group" | "organization";
|
|
1171
|
-
stateHash: string;
|
|
1172
|
-
version: number;
|
|
1173
|
-
};
|
|
1174
|
-
} | undefined;
|
|
1175
|
-
}>>;
|
|
1176
|
-
export type CommitOrganizationGroupPolicyResponse = z.infer<typeof CommitOrganizationGroupPolicyResponseSchema>;
|
|
1177
775
|
export declare const PrincipalPolicyErrorResponseSchema: z.ZodType<{
|
|
1178
776
|
error: string;
|
|
1179
777
|
code?: "billing_checkout_no_active_members" | "billing_roster_over_capacity" | undefined;
|
|
@@ -1282,5 +880,4 @@ export declare const PrincipalPolicyStaleErrorResponseSchema: z.ZodType<{
|
|
|
1282
880
|
export type PrincipalPolicyStaleErrorResponse = z.infer<typeof PrincipalPolicyStaleErrorResponseSchema>;
|
|
1283
881
|
export declare function isPrincipalPolicyBundleResponse(value: unknown): value is PrincipalPolicyBundleResponse;
|
|
1284
882
|
export declare function isPrincipalPolicyMutationResponse(value: unknown): value is PrincipalPolicyMutationResponse;
|
|
1285
|
-
export declare function isCommitOrganizationGroupPolicyResponse(value: unknown): value is CommitOrganizationGroupPolicyResponse;
|
|
1286
883
|
export declare function isPrincipalPolicyStaleErrorResponse(value: unknown): value is PrincipalPolicyStaleErrorResponse;
|