@tearleads/client-sdk 0.1.104 → 0.1.106
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 -2
- package/client/organizations/index.js.map +1 -1
- package/client/organizations/organizationMemberships.js +26 -18
- package/client/organizations/organizationMemberships.js.map +1 -1
- package/client/organizations/organizationReadModels.d.ts +9 -4
- package/client/organizations/organizationReadModels.js +20 -9
- package/client/organizations/organizationReadModels.js.map +1 -1
- package/data/keyingProjectionVerification/checkpoints/checkpointContext.js +4 -1
- package/data/keyingProjectionVerification/checkpoints/checkpointContext.js.map +1 -1
- package/data/keyingProjectionVerification/checkpoints/verifiedBundleBytes.js +27 -0
- package/data/keyingProjectionVerification/checkpoints/verifiedBundleBytes.js.map +1 -0
- package/data/keyingProjectionVerification/container/containerManifestVerification.js +2 -0
- package/data/keyingProjectionVerification/container/containerManifestVerification.js.map +1 -1
- package/data/keyingProjectionVerification/document/documentManifestVerification.js +2 -0
- package/data/keyingProjectionVerification/document/documentManifestVerification.js.map +1 -1
- package/data/persistence/container-contents/containerContentsPersistence.js +3 -1
- package/data/persistence/container-contents/containerContentsPersistence.js.map +1 -1
- package/data/persistence/container-contents/containerMetadataRows.js +9 -0
- package/data/persistence/container-contents/containerMetadataRows.js.map +1 -1
- package/data/principals/principalPolicyAdminSigners.js +50 -0
- package/data/principals/principalPolicyAdminSigners.js.map +1 -1
- package/internal/api-client/ApiClient.d.ts +7 -0
- package/internal/crypto/organizationLeaveRequest.d.ts +1 -1
- package/internal/crypto/organizationLeaveRequest.js +9 -2
- package/internal/crypto/organizationLeaveRequest.js.map +1 -1
- package/internal/validators/operation/organizationMemberships.d.ts +7 -0
- package/internal/validators/operation/organizations.d.ts +56 -0
- package/internal/validators/response/organization.d.ts +91 -0
- package/internal/validators/response/organizationReadModel.d.ts +70 -0
- package/internal/validators/util/index.d.ts +1 -1
- package/internal/validators/util/index.js.map +1 -1
- package/internal/validators/util/organizationLeaveRequest.d.ts +25 -2
- package/internal/validators/util/organizationLeaveRequest.js +19 -3
- package/internal/validators/util/organizationLeaveRequest.js.map +1 -1
- package/package.json +1 -1
- package/workflows/organizations/memberships/leaveRequest.d.ts +6 -2
- package/workflows/organizations/memberships/leaveRequest.js +20 -5
- package/workflows/organizations/memberships/leaveRequest.js.map +1 -1
- package/workflows/organizations/memberships/leaveRequestMembersEvidence.js +80 -0
- package/workflows/organizations/memberships/leaveRequestMembersEvidence.js.map +1 -0
- package/workflows/organizations/memberships/leaveRequestMembership.d.ts +24 -0
- package/workflows/organizations/memberships/leaveRequestMembership.js +65 -0
- package/workflows/organizations/memberships/leaveRequestMembership.js.map +1 -0
- package/workflows/organizations/memberships/leaveRequestVerification.d.ts +15 -7
- package/workflows/organizations/memberships/leaveRequestVerification.js +18 -11
- package/workflows/organizations/memberships/leaveRequestVerification.js.map +1 -1
- package/workflows/principals/policyCache/principalPolicyCacheValidation.js +20 -2
- package/workflows/principals/policyCache/principalPolicyCacheValidation.js.map +1 -1
|
@@ -7458,6 +7458,13 @@ export declare const getOrganizationReadModelOperation: Omit<{
|
|
|
7458
7458
|
organizationId: string;
|
|
7459
7459
|
userId: string;
|
|
7460
7460
|
requestedAt: string;
|
|
7461
|
+
membersHead: {
|
|
7462
|
+
principalId: string;
|
|
7463
|
+
version: number;
|
|
7464
|
+
keyEpoch: number;
|
|
7465
|
+
stateHash: string;
|
|
7466
|
+
keyFingerprint: string;
|
|
7467
|
+
};
|
|
7461
7468
|
signature: string;
|
|
7462
7469
|
} | null;
|
|
7463
7470
|
profileDocumentId: string | null;
|
|
@@ -7479,6 +7486,13 @@ export declare const getOrganizationReadModelOperation: Omit<{
|
|
|
7479
7486
|
organizationId: string;
|
|
7480
7487
|
userId: string;
|
|
7481
7488
|
requestedAt: string;
|
|
7489
|
+
membersHead: {
|
|
7490
|
+
principalId: string;
|
|
7491
|
+
version: number;
|
|
7492
|
+
keyEpoch: number;
|
|
7493
|
+
stateHash: string;
|
|
7494
|
+
keyFingerprint: string;
|
|
7495
|
+
};
|
|
7482
7496
|
signature: string;
|
|
7483
7497
|
} | null;
|
|
7484
7498
|
profileDocumentId: string | null;
|
|
@@ -7611,6 +7625,13 @@ export declare const getOrganizationReadModelOperation: Omit<{
|
|
|
7611
7625
|
organizationId: string;
|
|
7612
7626
|
userId: string;
|
|
7613
7627
|
requestedAt: string;
|
|
7628
|
+
membersHead: {
|
|
7629
|
+
principalId: string;
|
|
7630
|
+
version: number;
|
|
7631
|
+
keyEpoch: number;
|
|
7632
|
+
stateHash: string;
|
|
7633
|
+
keyFingerprint: string;
|
|
7634
|
+
};
|
|
7614
7635
|
signature: string;
|
|
7615
7636
|
} | null;
|
|
7616
7637
|
profileDocumentId: string | null;
|
|
@@ -7632,6 +7653,13 @@ export declare const getOrganizationReadModelOperation: Omit<{
|
|
|
7632
7653
|
organizationId: string;
|
|
7633
7654
|
userId: string;
|
|
7634
7655
|
requestedAt: string;
|
|
7656
|
+
membersHead: {
|
|
7657
|
+
principalId: string;
|
|
7658
|
+
version: number;
|
|
7659
|
+
keyEpoch: number;
|
|
7660
|
+
stateHash: string;
|
|
7661
|
+
keyFingerprint: string;
|
|
7662
|
+
};
|
|
7635
7663
|
signature: string;
|
|
7636
7664
|
} | null;
|
|
7637
7665
|
profileDocumentId: string | null;
|
|
@@ -10777,6 +10805,13 @@ export declare const updateOrganizationRosterEntryOperation: Omit<{
|
|
|
10777
10805
|
organizationId: string;
|
|
10778
10806
|
userId: string;
|
|
10779
10807
|
requestedAt: string;
|
|
10808
|
+
membersHead: {
|
|
10809
|
+
principalId: string;
|
|
10810
|
+
version: number;
|
|
10811
|
+
keyEpoch: number;
|
|
10812
|
+
stateHash: string;
|
|
10813
|
+
keyFingerprint: string;
|
|
10814
|
+
};
|
|
10780
10815
|
signature: string;
|
|
10781
10816
|
} | null;
|
|
10782
10817
|
profileDocumentId: string | null;
|
|
@@ -10798,6 +10833,13 @@ export declare const updateOrganizationRosterEntryOperation: Omit<{
|
|
|
10798
10833
|
organizationId: string;
|
|
10799
10834
|
userId: string;
|
|
10800
10835
|
requestedAt: string;
|
|
10836
|
+
membersHead: {
|
|
10837
|
+
principalId: string;
|
|
10838
|
+
version: number;
|
|
10839
|
+
keyEpoch: number;
|
|
10840
|
+
stateHash: string;
|
|
10841
|
+
keyFingerprint: string;
|
|
10842
|
+
};
|
|
10801
10843
|
signature: string;
|
|
10802
10844
|
} | null;
|
|
10803
10845
|
profileDocumentId: string | null;
|
|
@@ -10819,6 +10861,13 @@ export declare const updateOrganizationRosterEntryOperation: Omit<{
|
|
|
10819
10861
|
organizationId: string;
|
|
10820
10862
|
userId: string;
|
|
10821
10863
|
requestedAt: string;
|
|
10864
|
+
membersHead: {
|
|
10865
|
+
principalId: string;
|
|
10866
|
+
version: number;
|
|
10867
|
+
keyEpoch: number;
|
|
10868
|
+
stateHash: string;
|
|
10869
|
+
keyFingerprint: string;
|
|
10870
|
+
};
|
|
10822
10871
|
signature: string;
|
|
10823
10872
|
} | null;
|
|
10824
10873
|
profileDocumentId: string | null;
|
|
@@ -10840,6 +10889,13 @@ export declare const updateOrganizationRosterEntryOperation: Omit<{
|
|
|
10840
10889
|
organizationId: string;
|
|
10841
10890
|
userId: string;
|
|
10842
10891
|
requestedAt: string;
|
|
10892
|
+
membersHead: {
|
|
10893
|
+
principalId: string;
|
|
10894
|
+
version: number;
|
|
10895
|
+
keyEpoch: number;
|
|
10896
|
+
stateHash: string;
|
|
10897
|
+
keyFingerprint: string;
|
|
10898
|
+
};
|
|
10843
10899
|
signature: string;
|
|
10844
10900
|
} | null;
|
|
10845
10901
|
profileDocumentId: string | null;
|
|
@@ -24,6 +24,13 @@ export declare const OrganizationDirectoryUserResponseShape: {
|
|
|
24
24
|
organizationId: z.ZodCustom<string, string>;
|
|
25
25
|
userId: z.ZodCustom<string, string>;
|
|
26
26
|
requestedAt: z.ZodString;
|
|
27
|
+
membersHead: z.ZodObject<{
|
|
28
|
+
principalId: z.ZodCustom<string, string>;
|
|
29
|
+
version: z.ZodCustom<number, number>;
|
|
30
|
+
keyEpoch: z.ZodCustom<number, number>;
|
|
31
|
+
stateHash: z.ZodString;
|
|
32
|
+
keyFingerprint: z.ZodString;
|
|
33
|
+
}, z.core.$strict>;
|
|
27
34
|
signature: z.ZodString;
|
|
28
35
|
}, z.core.$strict>>;
|
|
29
36
|
profileDocumentId: z.ZodNullable<z.ZodString>;
|
|
@@ -46,6 +53,13 @@ export declare const OrganizationDirectoryUserResponseSchema: z.ZodType<{
|
|
|
46
53
|
organizationId: string;
|
|
47
54
|
userId: string;
|
|
48
55
|
requestedAt: string;
|
|
56
|
+
membersHead: {
|
|
57
|
+
principalId: string;
|
|
58
|
+
version: number;
|
|
59
|
+
keyEpoch: number;
|
|
60
|
+
stateHash: string;
|
|
61
|
+
keyFingerprint: string;
|
|
62
|
+
};
|
|
49
63
|
signature: string;
|
|
50
64
|
} | null;
|
|
51
65
|
profileDocumentId: string | null;
|
|
@@ -67,6 +81,13 @@ export declare const OrganizationDirectoryUserResponseSchema: z.ZodType<{
|
|
|
67
81
|
organizationId: string;
|
|
68
82
|
userId: string;
|
|
69
83
|
requestedAt: string;
|
|
84
|
+
membersHead: {
|
|
85
|
+
principalId: string;
|
|
86
|
+
version: number;
|
|
87
|
+
keyEpoch: number;
|
|
88
|
+
stateHash: string;
|
|
89
|
+
keyFingerprint: string;
|
|
90
|
+
};
|
|
70
91
|
signature: string;
|
|
71
92
|
} | null;
|
|
72
93
|
profileDocumentId: string | null;
|
|
@@ -88,6 +109,13 @@ export declare const OrganizationDirectoryUserResponseSchema: z.ZodType<{
|
|
|
88
109
|
organizationId: string;
|
|
89
110
|
userId: string;
|
|
90
111
|
requestedAt: string;
|
|
112
|
+
membersHead: {
|
|
113
|
+
principalId: string;
|
|
114
|
+
version: number;
|
|
115
|
+
keyEpoch: number;
|
|
116
|
+
stateHash: string;
|
|
117
|
+
keyFingerprint: string;
|
|
118
|
+
};
|
|
91
119
|
signature: string;
|
|
92
120
|
} | null;
|
|
93
121
|
profileDocumentId: string | null;
|
|
@@ -109,6 +137,13 @@ export declare const OrganizationDirectoryUserResponseSchema: z.ZodType<{
|
|
|
109
137
|
organizationId: string;
|
|
110
138
|
userId: string;
|
|
111
139
|
requestedAt: string;
|
|
140
|
+
membersHead: {
|
|
141
|
+
principalId: string;
|
|
142
|
+
version: number;
|
|
143
|
+
keyEpoch: number;
|
|
144
|
+
stateHash: string;
|
|
145
|
+
keyFingerprint: string;
|
|
146
|
+
};
|
|
112
147
|
signature: string;
|
|
113
148
|
} | null;
|
|
114
149
|
profileDocumentId: string | null;
|
|
@@ -141,6 +176,13 @@ export declare const OrganizationDirectoryResponseSchema: z.ZodType<{
|
|
|
141
176
|
organizationId: string;
|
|
142
177
|
userId: string;
|
|
143
178
|
requestedAt: string;
|
|
179
|
+
membersHead: {
|
|
180
|
+
principalId: string;
|
|
181
|
+
version: number;
|
|
182
|
+
keyEpoch: number;
|
|
183
|
+
stateHash: string;
|
|
184
|
+
keyFingerprint: string;
|
|
185
|
+
};
|
|
144
186
|
signature: string;
|
|
145
187
|
} | null;
|
|
146
188
|
profileDocumentId: string | null;
|
|
@@ -169,6 +211,13 @@ export declare const OrganizationDirectoryResponseSchema: z.ZodType<{
|
|
|
169
211
|
organizationId: string;
|
|
170
212
|
userId: string;
|
|
171
213
|
requestedAt: string;
|
|
214
|
+
membersHead: {
|
|
215
|
+
principalId: string;
|
|
216
|
+
version: number;
|
|
217
|
+
keyEpoch: number;
|
|
218
|
+
stateHash: string;
|
|
219
|
+
keyFingerprint: string;
|
|
220
|
+
};
|
|
172
221
|
signature: string;
|
|
173
222
|
} | null;
|
|
174
223
|
profileDocumentId: string | null;
|
|
@@ -197,6 +246,13 @@ export declare const OrganizationDirectoryResponseSchema: z.ZodType<{
|
|
|
197
246
|
organizationId: string;
|
|
198
247
|
userId: string;
|
|
199
248
|
requestedAt: string;
|
|
249
|
+
membersHead: {
|
|
250
|
+
principalId: string;
|
|
251
|
+
version: number;
|
|
252
|
+
keyEpoch: number;
|
|
253
|
+
stateHash: string;
|
|
254
|
+
keyFingerprint: string;
|
|
255
|
+
};
|
|
200
256
|
signature: string;
|
|
201
257
|
} | null;
|
|
202
258
|
profileDocumentId: string | null;
|
|
@@ -225,6 +281,13 @@ export declare const OrganizationDirectoryResponseSchema: z.ZodType<{
|
|
|
225
281
|
organizationId: string;
|
|
226
282
|
userId: string;
|
|
227
283
|
requestedAt: string;
|
|
284
|
+
membersHead: {
|
|
285
|
+
principalId: string;
|
|
286
|
+
version: number;
|
|
287
|
+
keyEpoch: number;
|
|
288
|
+
stateHash: string;
|
|
289
|
+
keyFingerprint: string;
|
|
290
|
+
};
|
|
228
291
|
signature: string;
|
|
229
292
|
} | null;
|
|
230
293
|
profileDocumentId: string | null;
|
|
@@ -2041,6 +2104,13 @@ export declare const OrganizationUserDetailResponseSchema: z.ZodType<{
|
|
|
2041
2104
|
organizationId: string;
|
|
2042
2105
|
userId: string;
|
|
2043
2106
|
requestedAt: string;
|
|
2107
|
+
membersHead: {
|
|
2108
|
+
principalId: string;
|
|
2109
|
+
version: number;
|
|
2110
|
+
keyEpoch: number;
|
|
2111
|
+
stateHash: string;
|
|
2112
|
+
keyFingerprint: string;
|
|
2113
|
+
};
|
|
2044
2114
|
signature: string;
|
|
2045
2115
|
} | null;
|
|
2046
2116
|
profileDocumentId: string | null;
|
|
@@ -2114,6 +2184,13 @@ export declare const OrganizationUserDetailResponseSchema: z.ZodType<{
|
|
|
2114
2184
|
organizationId: string;
|
|
2115
2185
|
userId: string;
|
|
2116
2186
|
requestedAt: string;
|
|
2187
|
+
membersHead: {
|
|
2188
|
+
principalId: string;
|
|
2189
|
+
version: number;
|
|
2190
|
+
keyEpoch: number;
|
|
2191
|
+
stateHash: string;
|
|
2192
|
+
keyFingerprint: string;
|
|
2193
|
+
};
|
|
2117
2194
|
signature: string;
|
|
2118
2195
|
} | null;
|
|
2119
2196
|
profileDocumentId: string | null;
|
|
@@ -2187,6 +2264,13 @@ export declare const OrganizationUserDetailResponseSchema: z.ZodType<{
|
|
|
2187
2264
|
organizationId: string;
|
|
2188
2265
|
userId: string;
|
|
2189
2266
|
requestedAt: string;
|
|
2267
|
+
membersHead: {
|
|
2268
|
+
principalId: string;
|
|
2269
|
+
version: number;
|
|
2270
|
+
keyEpoch: number;
|
|
2271
|
+
stateHash: string;
|
|
2272
|
+
keyFingerprint: string;
|
|
2273
|
+
};
|
|
2190
2274
|
signature: string;
|
|
2191
2275
|
} | null;
|
|
2192
2276
|
profileDocumentId: string | null;
|
|
@@ -2260,6 +2344,13 @@ export declare const OrganizationUserDetailResponseSchema: z.ZodType<{
|
|
|
2260
2344
|
organizationId: string;
|
|
2261
2345
|
userId: string;
|
|
2262
2346
|
requestedAt: string;
|
|
2347
|
+
membersHead: {
|
|
2348
|
+
principalId: string;
|
|
2349
|
+
version: number;
|
|
2350
|
+
keyEpoch: number;
|
|
2351
|
+
stateHash: string;
|
|
2352
|
+
keyFingerprint: string;
|
|
2353
|
+
};
|
|
2263
2354
|
signature: string;
|
|
2264
2355
|
} | null;
|
|
2265
2356
|
profileDocumentId: string | null;
|
|
@@ -15,6 +15,13 @@ declare const OrganizationReadModelDirectoryResponseSchema: z.ZodObject<{
|
|
|
15
15
|
organizationId: string;
|
|
16
16
|
userId: string;
|
|
17
17
|
requestedAt: string;
|
|
18
|
+
membersHead: {
|
|
19
|
+
principalId: string;
|
|
20
|
+
version: number;
|
|
21
|
+
keyEpoch: number;
|
|
22
|
+
stateHash: string;
|
|
23
|
+
keyFingerprint: string;
|
|
24
|
+
};
|
|
18
25
|
signature: string;
|
|
19
26
|
} | null;
|
|
20
27
|
profileDocumentId: string | null;
|
|
@@ -36,6 +43,13 @@ declare const OrganizationReadModelDirectoryResponseSchema: z.ZodObject<{
|
|
|
36
43
|
organizationId: string;
|
|
37
44
|
userId: string;
|
|
38
45
|
requestedAt: string;
|
|
46
|
+
membersHead: {
|
|
47
|
+
principalId: string;
|
|
48
|
+
version: number;
|
|
49
|
+
keyEpoch: number;
|
|
50
|
+
stateHash: string;
|
|
51
|
+
keyFingerprint: string;
|
|
52
|
+
};
|
|
39
53
|
signature: string;
|
|
40
54
|
} | null;
|
|
41
55
|
profileDocumentId: string | null;
|
|
@@ -156,6 +170,13 @@ declare const OrganizationReadModelSnapshotResponseSchema: z.ZodObject<{
|
|
|
156
170
|
organizationId: string;
|
|
157
171
|
userId: string;
|
|
158
172
|
requestedAt: string;
|
|
173
|
+
membersHead: {
|
|
174
|
+
principalId: string;
|
|
175
|
+
version: number;
|
|
176
|
+
keyEpoch: number;
|
|
177
|
+
stateHash: string;
|
|
178
|
+
keyFingerprint: string;
|
|
179
|
+
};
|
|
159
180
|
signature: string;
|
|
160
181
|
} | null;
|
|
161
182
|
profileDocumentId: string | null;
|
|
@@ -177,6 +198,13 @@ declare const OrganizationReadModelSnapshotResponseSchema: z.ZodObject<{
|
|
|
177
198
|
organizationId: string;
|
|
178
199
|
userId: string;
|
|
179
200
|
requestedAt: string;
|
|
201
|
+
membersHead: {
|
|
202
|
+
principalId: string;
|
|
203
|
+
version: number;
|
|
204
|
+
keyEpoch: number;
|
|
205
|
+
stateHash: string;
|
|
206
|
+
keyFingerprint: string;
|
|
207
|
+
};
|
|
180
208
|
signature: string;
|
|
181
209
|
} | null;
|
|
182
210
|
profileDocumentId: string | null;
|
|
@@ -309,6 +337,13 @@ declare const OrganizationReadModelDeltaResponseSchema: z.ZodObject<{
|
|
|
309
337
|
organizationId: string;
|
|
310
338
|
userId: string;
|
|
311
339
|
requestedAt: string;
|
|
340
|
+
membersHead: {
|
|
341
|
+
principalId: string;
|
|
342
|
+
version: number;
|
|
343
|
+
keyEpoch: number;
|
|
344
|
+
stateHash: string;
|
|
345
|
+
keyFingerprint: string;
|
|
346
|
+
};
|
|
312
347
|
signature: string;
|
|
313
348
|
} | null;
|
|
314
349
|
profileDocumentId: string | null;
|
|
@@ -330,6 +365,13 @@ declare const OrganizationReadModelDeltaResponseSchema: z.ZodObject<{
|
|
|
330
365
|
organizationId: string;
|
|
331
366
|
userId: string;
|
|
332
367
|
requestedAt: string;
|
|
368
|
+
membersHead: {
|
|
369
|
+
principalId: string;
|
|
370
|
+
version: number;
|
|
371
|
+
keyEpoch: number;
|
|
372
|
+
stateHash: string;
|
|
373
|
+
keyFingerprint: string;
|
|
374
|
+
};
|
|
333
375
|
signature: string;
|
|
334
376
|
} | null;
|
|
335
377
|
profileDocumentId: string | null;
|
|
@@ -463,6 +505,13 @@ export declare const OrganizationReadModelResponseSchema: z.ZodDiscriminatedUnio
|
|
|
463
505
|
organizationId: string;
|
|
464
506
|
userId: string;
|
|
465
507
|
requestedAt: string;
|
|
508
|
+
membersHead: {
|
|
509
|
+
principalId: string;
|
|
510
|
+
version: number;
|
|
511
|
+
keyEpoch: number;
|
|
512
|
+
stateHash: string;
|
|
513
|
+
keyFingerprint: string;
|
|
514
|
+
};
|
|
466
515
|
signature: string;
|
|
467
516
|
} | null;
|
|
468
517
|
profileDocumentId: string | null;
|
|
@@ -484,6 +533,13 @@ export declare const OrganizationReadModelResponseSchema: z.ZodDiscriminatedUnio
|
|
|
484
533
|
organizationId: string;
|
|
485
534
|
userId: string;
|
|
486
535
|
requestedAt: string;
|
|
536
|
+
membersHead: {
|
|
537
|
+
principalId: string;
|
|
538
|
+
version: number;
|
|
539
|
+
keyEpoch: number;
|
|
540
|
+
stateHash: string;
|
|
541
|
+
keyFingerprint: string;
|
|
542
|
+
};
|
|
487
543
|
signature: string;
|
|
488
544
|
} | null;
|
|
489
545
|
profileDocumentId: string | null;
|
|
@@ -616,6 +672,13 @@ export declare const OrganizationReadModelResponseSchema: z.ZodDiscriminatedUnio
|
|
|
616
672
|
organizationId: string;
|
|
617
673
|
userId: string;
|
|
618
674
|
requestedAt: string;
|
|
675
|
+
membersHead: {
|
|
676
|
+
principalId: string;
|
|
677
|
+
version: number;
|
|
678
|
+
keyEpoch: number;
|
|
679
|
+
stateHash: string;
|
|
680
|
+
keyFingerprint: string;
|
|
681
|
+
};
|
|
619
682
|
signature: string;
|
|
620
683
|
} | null;
|
|
621
684
|
profileDocumentId: string | null;
|
|
@@ -637,6 +700,13 @@ export declare const OrganizationReadModelResponseSchema: z.ZodDiscriminatedUnio
|
|
|
637
700
|
organizationId: string;
|
|
638
701
|
userId: string;
|
|
639
702
|
requestedAt: string;
|
|
703
|
+
membersHead: {
|
|
704
|
+
principalId: string;
|
|
705
|
+
version: number;
|
|
706
|
+
keyEpoch: number;
|
|
707
|
+
stateHash: string;
|
|
708
|
+
keyFingerprint: string;
|
|
709
|
+
};
|
|
640
710
|
signature: string;
|
|
641
711
|
} | null;
|
|
642
712
|
profileDocumentId: string | null;
|
|
@@ -6,7 +6,7 @@ export { MAX_CONTAINER_PATH_LENGTH } from "./containerLimits.js";
|
|
|
6
6
|
export { MAX_DOCUMENT_SYNC_AUTHORIZATION_PATH_REFS, MAX_DOCUMENT_SYNC_AUTHORIZATION_PATHS, MAX_DOCUMENT_SYNC_CONTENT_KEY_TARGETS, MAX_DOCUMENT_SYNC_OUTGOING_UPDATES, MAX_DOCUMENT_SYNC_PULL_CURSOR_LENGTH, MAX_DOCUMENT_SYNC_REQUEST_BYTES, MAX_DOCUMENT_SYNC_RESPONSE_ENVELOPE_BYTES, MAX_DOCUMENT_SYNC_RESPONSE_PAGE_BYTES, MAX_DOCUMENT_SYNC_RESPONSE_PAGE_UPDATES, MAX_DOCUMENT_SYNC_RESPONSE_UPDATE_PAGE_BYTES, } from "./documentSyncLimits.js";
|
|
7
7
|
export { isSerializedKeyEnvelope, isSerializedKeyEnvelopeArray, type SerializedKeyEnvelope, } from "./keyEnvelope.js";
|
|
8
8
|
export { KNOWN_MANIFEST_HINT_LIMIT, KnownManifestsHeadersSchema, parseKnownManifestHints, } from "./knownManifestWire.js";
|
|
9
|
-
export { isOrganizationLeaveRequest, type OrganizationLeaveRequest, OrganizationLeaveRequestSchema, } from "./organizationLeaveRequest.js";
|
|
9
|
+
export { isOrganizationLeaveRequest, type OrganizationLeaveRequest, type OrganizationLeaveRequestMembersHead, OrganizationLeaveRequestSchema, } from "./organizationLeaveRequest.js";
|
|
10
10
|
export { isOrganizationReplacementAuthorization, type OrganizationReplacementAuthorization, OrganizationReplacementAuthorizationSchema, } from "./organizationReplacement.js";
|
|
11
11
|
export { PRINCIPAL_POLICY_HISTORY_PAGE_LIMIT, PRINCIPAL_POLICY_REPAIR_HEAD_LIMIT, } from "./principalHistoryWire.js";
|
|
12
12
|
export { hasArrayProperty, hasBooleanProperty, hasNonEmptyStringProperty, hasNullableNumberProperty, hasNullableStringProperty, hasNumberProperty, hasObjectProperty, hasOptionalStringProperty, hasPositiveIntegerProperty, hasPropertyValue, hasStringProperty, isNonEmptyStringArray, isOptionalRecordArray, isOptionalRecordArrayArray, isRecordArray, isRecordArrayArray, isStringArray, } from "./properties.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,mCAAmC,EAGnC,sCAAsC,EACtC,8BAA8B,EAC9B,+BAA+B,EAC/B,0BAA0B,EAC1B,+BAA+B,EAC/B,kCAAkC,EAClC,uCAAuC,GACxC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,yBAAyB,EACzB,6BAA6B,GAC9B,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,wBAAwB,EACxB,8BAA8B,EAE9B,iCAAiC,EAEjC,6BAA6B,EAE7B,mCAAmC,EACnC,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,4BAA4B,EAC5B,uCAAuC,EACvC,mCAAmC,EACnC,mCAAmC,EACnC,+BAA+B,EAC/B,uBAAuB,EACvB,2BAA2B,EAC3B,6BAA6B,EAC7B,8CAA8C,EAC9C,gDAAgD,EAChD,wCAAwC,EACxC,yCAAyC,EACzC,8BAA8B,GAC/B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EACL,yCAAyC,EACzC,qCAAqC,EACrC,qCAAqC,EACrC,kCAAkC,EAClC,oCAAoC,EACpC,+BAA+B,EAC/B,yCAAyC,EACzC,qCAAqC,EACrC,uCAAuC,EACvC,4CAA4C,GAC7C,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,uBAAuB,EACvB,4BAA4B,GAE7B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,yBAAyB,EACzB,2BAA2B,EAC3B,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,0BAA0B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,mCAAmC,EAGnC,sCAAsC,EACtC,8BAA8B,EAC9B,+BAA+B,EAC/B,0BAA0B,EAC1B,+BAA+B,EAC/B,kCAAkC,EAClC,uCAAuC,GACxC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,yBAAyB,EACzB,6BAA6B,GAC9B,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,wBAAwB,EACxB,8BAA8B,EAE9B,iCAAiC,EAEjC,6BAA6B,EAE7B,mCAAmC,EACnC,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,4BAA4B,EAC5B,uCAAuC,EACvC,mCAAmC,EACnC,mCAAmC,EACnC,+BAA+B,EAC/B,uBAAuB,EACvB,2BAA2B,EAC3B,6BAA6B,EAC7B,8CAA8C,EAC9C,gDAAgD,EAChD,wCAAwC,EACxC,yCAAyC,EACzC,8BAA8B,GAC/B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EACL,yCAAyC,EACzC,qCAAqC,EACrC,qCAAqC,EACrC,kCAAkC,EAClC,oCAAoC,EACpC,+BAA+B,EAC/B,yCAAyC,EACzC,qCAAqC,EACrC,uCAAuC,EACvC,4CAA4C,GAC7C,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,uBAAuB,EACvB,4BAA4B,GAE7B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,yBAAyB,EACzB,2BAA2B,EAC3B,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,0BAA0B,EAG1B,8BAA8B,GAC/B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,sCAAsC,EAEtC,0CAA0C,GAC3C,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,mCAAmC,EACnC,kCAAkC,GACnC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,EACzB,iBAAiB,EACjB,iBAAiB,EACjB,yBAAyB,EACzB,0BAA0B,EAC1B,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,0BAA0B,EAC1B,aAAa,EACb,kBAAkB,EAClB,aAAa,GACd,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,WAAW,EACX,mBAAmB,EACnB,iBAAiB,EACjB,yBAAyB,EACzB,wBAAwB,EACxB,2BAA2B,EAC3B,iBAAiB,GAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC","sourcesContent":["export {\n type AccessEventBundleWireResponse,\n AccessEventBundleWireResponseSchema,\n type AccessManifestBundleWire,\n type AccessManifestBundleWireResponse,\n AccessManifestBundleWireResponseSchema,\n AccessManifestBundleWireSchema,\n isAccessEventBundleWireResponse,\n isAccessManifestBundleWire,\n isAccessManifestBundleWireArray,\n isAccessManifestBundleWireResponse,\n isOptionalAccessManifestBundleWireArray,\n} from \"./accessManifestBundle\";\nexport {\n MAX_INITIATE_PART_UPLOADS,\n MAX_MULTIPART_BLOB_PART_BYTES,\n} from \"./blob\";\nexport {\n blobPartContentMd5Schema,\n MAX_MULTIPART_BLOB_PART_NUMBER,\n type MultipartBlobPartDescriptor,\n MultipartBlobPartDescriptorSchema,\n type MultipartBlobPartUpload,\n MultipartBlobPartUploadSchema,\n type MultipartBlobPartUploadSource,\n MultipartBlobPartUploadSourceSchema,\n signedBlobUrlExpirySchema,\n signedBlobUrlSchema,\n} from \"./blobTransferSchemas\";\nexport {\n CONTAINER_KEK_LOG_PAGE_LIMIT,\n CONTAINER_KEK_LOG_PRINCIPAL_SCOPE_LIMIT,\n CONTAINER_KEK_WRAPS_PER_EPOCH_LIMIT,\n ContainerKekKeyringWireRecordSchema,\n isContainerKekKeyringWireRecord,\n MAX_CONTAINER_KEY_EPOCH,\n MAX_INLINE_CONTAINER_REKEYS,\n MAX_ROTATION_CONTAINER_REKEYS,\n MAX_SEALED_CONTAINER_KEK_KEYRING_BASE64_LENGTH,\n SEALED_CONTAINER_KEK_KEYRING_AEAD_OVERHEAD_BYTES,\n SEALED_CONTAINER_KEK_KEYRING_ENTRY_BYTES,\n SEALED_CONTAINER_KEK_KEYRING_HEADER_BYTES,\n sealedContainerKekKeyringBytes,\n} from \"./containerKekKeyringWire\";\nexport { MAX_CONTAINER_PATH_LENGTH } from \"./containerLimits\";\nexport {\n MAX_DOCUMENT_SYNC_AUTHORIZATION_PATH_REFS,\n MAX_DOCUMENT_SYNC_AUTHORIZATION_PATHS,\n MAX_DOCUMENT_SYNC_CONTENT_KEY_TARGETS,\n MAX_DOCUMENT_SYNC_OUTGOING_UPDATES,\n MAX_DOCUMENT_SYNC_PULL_CURSOR_LENGTH,\n MAX_DOCUMENT_SYNC_REQUEST_BYTES,\n MAX_DOCUMENT_SYNC_RESPONSE_ENVELOPE_BYTES,\n MAX_DOCUMENT_SYNC_RESPONSE_PAGE_BYTES,\n MAX_DOCUMENT_SYNC_RESPONSE_PAGE_UPDATES,\n MAX_DOCUMENT_SYNC_RESPONSE_UPDATE_PAGE_BYTES,\n} from \"./documentSyncLimits\";\nexport {\n isSerializedKeyEnvelope,\n isSerializedKeyEnvelopeArray,\n type SerializedKeyEnvelope,\n} from \"./keyEnvelope\";\nexport {\n KNOWN_MANIFEST_HINT_LIMIT,\n KnownManifestsHeadersSchema,\n parseKnownManifestHints,\n} from \"./knownManifestWire\";\nexport {\n isOrganizationLeaveRequest,\n type OrganizationLeaveRequest,\n type OrganizationLeaveRequestMembersHead,\n OrganizationLeaveRequestSchema,\n} from \"./organizationLeaveRequest\";\nexport {\n isOrganizationReplacementAuthorization,\n type OrganizationReplacementAuthorization,\n OrganizationReplacementAuthorizationSchema,\n} from \"./organizationReplacement\";\nexport {\n PRINCIPAL_POLICY_HISTORY_PAGE_LIMIT,\n PRINCIPAL_POLICY_REPAIR_HEAD_LIMIT,\n} from \"./principalHistoryWire\";\nexport {\n hasArrayProperty,\n hasBooleanProperty,\n hasNonEmptyStringProperty,\n hasNullableNumberProperty,\n hasNullableStringProperty,\n hasNumberProperty,\n hasObjectProperty,\n hasOptionalStringProperty,\n hasPositiveIntegerProperty,\n hasPropertyValue,\n hasStringProperty,\n isNonEmptyStringArray,\n isOptionalRecordArray,\n isOptionalRecordArrayArray,\n isRecordArray,\n isRecordArrayArray,\n isStringArray,\n} from \"./properties\";\nexport {\n AUTH_CHALLENGE_HEX_LENGTH,\n isAuthChallengeHexString,\n isByteArray,\n isByteArrayOfLength,\n isSha256HexString,\n ML_DSA87_PUBLIC_KEY_BYTES,\n ML_DSA87_SIGNATURE_BYTES,\n ML_KEM1024_PUBLIC_KEY_BYTES,\n SHA256_HEX_LENGTH,\n} from \"./protocol\";\nexport {\n CANONICAL_SIGNED_AT_PATTERN,\n isCanonicalSignedAt,\n MAX_SIGNED_AT_YEAR,\n MIN_SIGNED_AT_YEAR,\n SIGNED_AT_CONTRACT,\n} from \"./signedAt\";\nexport { isUuidV4String } from \"./uuid\";\nexport { isWalLsnString, parseWalLsn } from \"./walLsn\";\n"]}
|
|
@@ -1,14 +1,37 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* The exact signed head of the organization's reserved Members group that the
|
|
4
|
+
* member saw when asking. Removing anyone from Members rotates its key epoch,
|
|
5
|
+
* so a request stays current only while the member has stayed in Members
|
|
6
|
+
* since this head: a request from an earlier membership never is.
|
|
7
|
+
*/
|
|
8
|
+
export declare const OrganizationLeaveRequestMembersHeadSchema: z.ZodObject<{
|
|
9
|
+
principalId: z.ZodCustom<string, string>;
|
|
10
|
+
version: z.ZodCustom<number, number>;
|
|
11
|
+
keyEpoch: z.ZodCustom<number, number>;
|
|
12
|
+
stateHash: z.ZodString;
|
|
13
|
+
keyFingerprint: z.ZodString;
|
|
14
|
+
}, z.core.$strict>;
|
|
15
|
+
export type OrganizationLeaveRequestMembersHead = z.infer<typeof OrganizationLeaveRequestMembersHeadSchema>;
|
|
2
16
|
/**
|
|
3
17
|
* A member's signed request to leave an organization. Signed with the member's
|
|
4
18
|
* identity key so an administrator can tell the request came from the member,
|
|
5
|
-
* not from the server
|
|
6
|
-
*
|
|
19
|
+
* not from the server, and bound to the Members head the member saw so it
|
|
20
|
+
* cannot outlive their membership. It authorizes nothing by itself: leaving
|
|
21
|
+
* still needs an administrator to sign the member's removal from the
|
|
22
|
+
* organization's groups.
|
|
7
23
|
*/
|
|
8
24
|
export declare const OrganizationLeaveRequestSchema: z.ZodObject<{
|
|
9
25
|
organizationId: z.ZodCustom<string, string>;
|
|
10
26
|
userId: z.ZodCustom<string, string>;
|
|
11
27
|
requestedAt: z.ZodString;
|
|
28
|
+
membersHead: z.ZodObject<{
|
|
29
|
+
principalId: z.ZodCustom<string, string>;
|
|
30
|
+
version: z.ZodCustom<number, number>;
|
|
31
|
+
keyEpoch: z.ZodCustom<number, number>;
|
|
32
|
+
stateHash: z.ZodString;
|
|
33
|
+
keyFingerprint: z.ZodString;
|
|
34
|
+
}, z.core.$strict>;
|
|
12
35
|
signature: z.ZodString;
|
|
13
36
|
}, z.core.$strict>;
|
|
14
37
|
export type OrganizationLeaveRequest = z.infer<typeof OrganizationLeaveRequestSchema>;
|
|
@@ -1,12 +1,27 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { registerJsonSchemaFragment } from "../jsonSchema.js";
|
|
3
|
-
import { nonEmptyStringSchema, uuidV4StringSchema } from "../schema.js";
|
|
3
|
+
import { boundedPositiveIntegerSchema, nonEmptyStringSchema, uuidV4StringSchema, } from "../schema.js";
|
|
4
4
|
import { CANONICAL_SIGNED_AT_PATTERN, isCanonicalSignedAt, SIGNED_AT_CONTRACT, } from "./signedAt.js";
|
|
5
|
+
/**
|
|
6
|
+
* The exact signed head of the organization's reserved Members group that the
|
|
7
|
+
* member saw when asking. Removing anyone from Members rotates its key epoch,
|
|
8
|
+
* so a request stays current only while the member has stayed in Members
|
|
9
|
+
* since this head: a request from an earlier membership never is.
|
|
10
|
+
*/
|
|
11
|
+
export const OrganizationLeaveRequestMembersHeadSchema = z.strictObject({
|
|
12
|
+
principalId: uuidV4StringSchema,
|
|
13
|
+
version: boundedPositiveIntegerSchema(Number.MAX_SAFE_INTEGER),
|
|
14
|
+
keyEpoch: boundedPositiveIntegerSchema(Number.MAX_SAFE_INTEGER),
|
|
15
|
+
stateHash: nonEmptyStringSchema,
|
|
16
|
+
keyFingerprint: nonEmptyStringSchema,
|
|
17
|
+
});
|
|
5
18
|
/**
|
|
6
19
|
* A member's signed request to leave an organization. Signed with the member's
|
|
7
20
|
* identity key so an administrator can tell the request came from the member,
|
|
8
|
-
* not from the server
|
|
9
|
-
*
|
|
21
|
+
* not from the server, and bound to the Members head the member saw so it
|
|
22
|
+
* cannot outlive their membership. It authorizes nothing by itself: leaving
|
|
23
|
+
* still needs an administrator to sign the member's removal from the
|
|
24
|
+
* organization's groups.
|
|
10
25
|
*/
|
|
11
26
|
export const OrganizationLeaveRequestSchema = z.strictObject({
|
|
12
27
|
organizationId: uuidV4StringSchema,
|
|
@@ -14,6 +29,7 @@ export const OrganizationLeaveRequestSchema = z.strictObject({
|
|
|
14
29
|
requestedAt: registerJsonSchemaFragment(z.string().refine(isCanonicalSignedAt, {
|
|
15
30
|
message: `requestedAt must be ${SIGNED_AT_CONTRACT}`,
|
|
16
31
|
}), { pattern: CANONICAL_SIGNED_AT_PATTERN.source, type: "string" }),
|
|
32
|
+
membersHead: OrganizationLeaveRequestMembersHeadSchema,
|
|
17
33
|
signature: nonEmptyStringSchema,
|
|
18
34
|
});
|
|
19
35
|
export function isOrganizationLeaveRequest(value) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organizationLeaveRequest.js","sourceRoot":"","sources":["organizationLeaveRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,
|
|
1
|
+
{"version":3,"file":"organizationLeaveRequest.js","sourceRoot":"","sources":["organizationLeaveRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,YAAY,CAAC;AAEpB;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yCAAyC,GAAG,CAAC,CAAC,YAAY,CAAC;IACtE,WAAW,EAAE,kBAAkB;IAC/B,OAAO,EAAE,4BAA4B,CAAC,MAAM,CAAC,gBAAgB,CAAC;IAC9D,QAAQ,EAAE,4BAA4B,CAAC,MAAM,CAAC,gBAAgB,CAAC;IAC/D,SAAS,EAAE,oBAAoB;IAC/B,cAAc,EAAE,oBAAoB;CACrC,CAAC,CAAC;AAMH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,YAAY,CAAC;IAC3D,cAAc,EAAE,kBAAkB;IAClC,MAAM,EAAE,kBAAkB;IAC1B,WAAW,EAAE,0BAA0B,CACrC,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,mBAAmB,EAAE;QACrC,OAAO,EAAE,uBAAuB,kBAAkB,EAAE;KACrD,CAAC,EACF,EAAE,OAAO,EAAE,2BAA2B,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,CAChE;IACD,WAAW,EAAE,yCAAyC;IACtD,SAAS,EAAE,oBAAoB;CAChC,CAAC,CAAC;AAMH,MAAM,UAAU,0BAA0B,CACxC,KAAc;IAEd,OAAO,8BAA8B,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AACjE,CAAC","sourcesContent":["import { z } from \"zod\";\nimport { registerJsonSchemaFragment } from \"../jsonSchema\";\nimport {\n boundedPositiveIntegerSchema,\n nonEmptyStringSchema,\n uuidV4StringSchema,\n} from \"../schema\";\nimport {\n CANONICAL_SIGNED_AT_PATTERN,\n isCanonicalSignedAt,\n SIGNED_AT_CONTRACT,\n} from \"./signedAt\";\n\n/**\n * The exact signed head of the organization's reserved Members group that the\n * member saw when asking. Removing anyone from Members rotates its key epoch,\n * so a request stays current only while the member has stayed in Members\n * since this head: a request from an earlier membership never is.\n */\nexport const OrganizationLeaveRequestMembersHeadSchema = z.strictObject({\n principalId: uuidV4StringSchema,\n version: boundedPositiveIntegerSchema(Number.MAX_SAFE_INTEGER),\n keyEpoch: boundedPositiveIntegerSchema(Number.MAX_SAFE_INTEGER),\n stateHash: nonEmptyStringSchema,\n keyFingerprint: nonEmptyStringSchema,\n});\n\nexport type OrganizationLeaveRequestMembersHead = z.infer<\n typeof OrganizationLeaveRequestMembersHeadSchema\n>;\n\n/**\n * A member's signed request to leave an organization. Signed with the member's\n * identity key so an administrator can tell the request came from the member,\n * not from the server, and bound to the Members head the member saw so it\n * cannot outlive their membership. It authorizes nothing by itself: leaving\n * still needs an administrator to sign the member's removal from the\n * organization's groups.\n */\nexport const OrganizationLeaveRequestSchema = z.strictObject({\n organizationId: uuidV4StringSchema,\n userId: uuidV4StringSchema,\n requestedAt: registerJsonSchemaFragment(\n z.string().refine(isCanonicalSignedAt, {\n message: `requestedAt must be ${SIGNED_AT_CONTRACT}`,\n }),\n { pattern: CANONICAL_SIGNED_AT_PATTERN.source, type: \"string\" },\n ),\n membersHead: OrganizationLeaveRequestMembersHeadSchema,\n signature: nonEmptyStringSchema,\n});\n\nexport type OrganizationLeaveRequest = z.infer<\n typeof OrganizationLeaveRequestSchema\n>;\n\nexport function isOrganizationLeaveRequest(\n value: unknown,\n): value is OrganizationLeaveRequest {\n return OrganizationLeaveRequestSchema.safeParse(value).success;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RequestResult } from "../../../internal/api-client/index.js";
|
|
2
2
|
import { type SigningKeyPair } from "../../../internal/crypto/index.js";
|
|
3
3
|
import type { OrganizationMembershipResponse } from "../../../internal/validators/response/index.js";
|
|
4
|
-
import type { OrganizationLeaveRequest } from "../../../internal/validators/util/index.js";
|
|
4
|
+
import type { OrganizationLeaveRequest, OrganizationLeaveRequestMembersHead } from "../../../internal/validators/util/index.js";
|
|
5
5
|
import type { OrganizationMembership } from "./organizationMemberships.js";
|
|
6
6
|
export interface OrganizationLeaveRequestApi {
|
|
7
7
|
setOrganizationLeaveRequest(organizationId: string, request: OrganizationLeaveRequest | null): Promise<RequestResult<OrganizationMembershipResponse>>;
|
|
@@ -17,10 +17,14 @@ export type OrganizationLeaveRequestResult = {
|
|
|
17
17
|
/**
|
|
18
18
|
* Files or withdraws the user's request to leave one organization. Filing
|
|
19
19
|
* signs the request with the user's identity key, so administrators can tell
|
|
20
|
-
* the member made it
|
|
20
|
+
* the member made it, and binds it to the organization's Members head as this
|
|
21
|
+
* device verified it, so it cannot outlive this membership. It removes nothing
|
|
22
|
+
* until an administrator approves it.
|
|
21
23
|
*/
|
|
22
24
|
export declare function setOrganizationLeaveRequested(input: {
|
|
23
25
|
readonly apiClient: OrganizationLeaveRequestApi;
|
|
26
|
+
/** The organization's current Members head, freshly verified. */
|
|
27
|
+
readonly loadMembersHead: () => Promise<OrganizationLeaveRequestMembersHead>;
|
|
24
28
|
readonly organizationId: string;
|
|
25
29
|
readonly requested: boolean;
|
|
26
30
|
readonly signer: {
|
|
@@ -2,16 +2,31 @@ import { signOrganizationLeaveRequest, } from "../../../internal/crypto/index.js
|
|
|
2
2
|
/**
|
|
3
3
|
* Files or withdraws the user's request to leave one organization. Filing
|
|
4
4
|
* signs the request with the user's identity key, so administrators can tell
|
|
5
|
-
* the member made it
|
|
5
|
+
* the member made it, and binds it to the organization's Members head as this
|
|
6
|
+
* device verified it, so it cannot outlive this membership. It removes nothing
|
|
7
|
+
* until an administrator approves it.
|
|
6
8
|
*/
|
|
7
9
|
export async function setOrganizationLeaveRequested(input) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
let request = null;
|
|
11
|
+
if (input.requested) {
|
|
12
|
+
let membersHead;
|
|
13
|
+
try {
|
|
14
|
+
membersHead = await input.loadMembersHead();
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return {
|
|
18
|
+
httpStatus: null,
|
|
19
|
+
message: "Could not confirm your current membership. Try again.",
|
|
20
|
+
status: "failed",
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
request = signOrganizationLeaveRequest({
|
|
24
|
+
membersHead,
|
|
10
25
|
organizationId: input.organizationId,
|
|
11
26
|
requestedAt: (input.now?.() ?? new Date()).toISOString(),
|
|
12
27
|
userId: input.signer.userId,
|
|
13
|
-
}, input.signer.signingKeyPair)
|
|
14
|
-
|
|
28
|
+
}, input.signer.signingKeyPair);
|
|
29
|
+
}
|
|
15
30
|
const result = await input.apiClient.setOrganizationLeaveRequest(input.organizationId, request);
|
|
16
31
|
return result.ok
|
|
17
32
|
? { membership: result.data, status: "updated" }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leaveRequest.js","sourceRoot":"","sources":["leaveRequest.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,4BAA4B,GAC7B,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"leaveRequest.js","sourceRoot":"","sources":["leaveRequest.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,4BAA4B,GAC7B,MAAM,mBAAmB,CAAC;AAuB3B;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,6BAA6B,CAAC,KAWnD;IACC,IAAI,OAAO,GAAoC,IAAI,CAAC;IACpD,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;QACpB,IAAI,WAAgD,CAAC;QACrD,IAAI,CAAC;YACH,WAAW,GAAG,MAAM,KAAK,CAAC,eAAe,EAAE,CAAC;QAC9C,CAAC;QAAC,MAAM,CAAC;YACP,OAAO;gBACL,UAAU,EAAE,IAAI;gBAChB,OAAO,EAAE,uDAAuD;gBAChE,MAAM,EAAE,QAAQ;aACjB,CAAC;QACJ,CAAC;QACD,OAAO,GAAG,4BAA4B,CACpC;YACE,WAAW;YACX,cAAc,EAAE,KAAK,CAAC,cAAc;YACpC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE;YACxD,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM;SAC5B,EACD,KAAK,CAAC,MAAM,CAAC,cAAc,CAC5B,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,SAAS,CAAC,2BAA2B,CAC9D,KAAK,CAAC,cAAc,EACpB,OAAO,CACR,CAAC;IACF,OAAO,MAAM,CAAC,EAAE;QACd,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE;QAChD,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AAC/E,CAAC","sourcesContent":["import type { RequestResult } from \"@tearleads/api-client\";\nimport {\n type SigningKeyPair,\n signOrganizationLeaveRequest,\n} from \"@tearleads/crypto\";\nimport type { OrganizationMembershipResponse } from \"@tearleads/validators/response\";\nimport type {\n OrganizationLeaveRequest,\n OrganizationLeaveRequestMembersHead,\n} from \"@tearleads/validators/util\";\nimport type { OrganizationMembership } from \"./organizationMemberships\";\n\nexport interface OrganizationLeaveRequestApi {\n setOrganizationLeaveRequest(\n organizationId: string,\n request: OrganizationLeaveRequest | null,\n ): Promise<RequestResult<OrganizationMembershipResponse>>;\n}\n\nexport type OrganizationLeaveRequestResult =\n | { readonly status: \"updated\"; readonly membership: OrganizationMembership }\n | {\n readonly status: \"failed\";\n readonly httpStatus: number | null;\n readonly message: string;\n };\n\n/**\n * Files or withdraws the user's request to leave one organization. Filing\n * signs the request with the user's identity key, so administrators can tell\n * the member made it, and binds it to the organization's Members head as this\n * device verified it, so it cannot outlive this membership. It removes nothing\n * until an administrator approves it.\n */\nexport async function setOrganizationLeaveRequested(input: {\n readonly apiClient: OrganizationLeaveRequestApi;\n /** The organization's current Members head, freshly verified. */\n readonly loadMembersHead: () => Promise<OrganizationLeaveRequestMembersHead>;\n readonly organizationId: string;\n readonly requested: boolean;\n readonly signer: {\n readonly signingKeyPair: Pick<SigningKeyPair, \"signingPrivateKey\">;\n readonly userId: string;\n };\n readonly now?: () => Date;\n}): Promise<OrganizationLeaveRequestResult> {\n let request: OrganizationLeaveRequest | null = null;\n if (input.requested) {\n let membersHead: OrganizationLeaveRequestMembersHead;\n try {\n membersHead = await input.loadMembersHead();\n } catch {\n return {\n httpStatus: null,\n message: \"Could not confirm your current membership. Try again.\",\n status: \"failed\",\n };\n }\n request = signOrganizationLeaveRequest(\n {\n membersHead,\n organizationId: input.organizationId,\n requestedAt: (input.now?.() ?? new Date()).toISOString(),\n userId: input.signer.userId,\n },\n input.signer.signingKeyPair,\n );\n }\n const result = await input.apiClient.setOrganizationLeaveRequest(\n input.organizationId,\n request,\n );\n return result.ok\n ? { membership: result.data, status: \"updated\" }\n : { httpStatus: result.status, message: result.message, status: \"failed\" };\n}\n"]}
|