mindoodb 0.0.97 → 0.0.98
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/README.md +1 -0
- package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.d.ts +7 -0
- package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.d.ts.map +1 -1
- package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.js +17 -9
- package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.js.map +1 -1
- package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.d.ts +12 -0
- package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.d.ts.map +1 -1
- package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.js +19 -0
- package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.js.map +1 -1
- package/dist/browser/index.mjs +70 -0
- package/dist/core/BaseMindooDB.d.ts +2 -0
- package/dist/core/BaseMindooDB.d.ts.map +1 -1
- package/dist/core/BaseMindooDB.js +73 -53
- package/dist/core/BaseMindooDB.js.map +1 -1
- package/dist/core/BaseMindooTenant.d.ts +33 -1
- package/dist/core/BaseMindooTenant.d.ts.map +1 -1
- package/dist/core/BaseMindooTenant.js +141 -41
- package/dist/core/BaseMindooTenant.js.map +1 -1
- package/dist/core/BaseMindooTenantDirectory.d.ts +11 -0
- package/dist/core/BaseMindooTenantDirectory.d.ts.map +1 -1
- package/dist/core/BaseMindooTenantDirectory.js +137 -92
- package/dist/core/BaseMindooTenantDirectory.js.map +1 -1
- package/dist/core/builtinDbInvariants.d.ts +26 -1
- package/dist/core/builtinDbInvariants.d.ts.map +1 -1
- package/dist/core/builtinDbInvariants.js +52 -2
- package/dist/core/builtinDbInvariants.js.map +1 -1
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +3 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/joinrequests/crypto.d.ts +110 -0
- package/dist/core/joinrequests/crypto.d.ts.map +1 -0
- package/dist/core/joinrequests/crypto.js +340 -0
- package/dist/core/joinrequests/crypto.js.map +1 -0
- package/dist/core/joinrequests/index.d.ts +4 -0
- package/dist/core/joinrequests/index.d.ts.map +1 -0
- package/dist/core/joinrequests/index.js +29 -0
- package/dist/core/joinrequests/index.js.map +1 -0
- package/dist/core/joinrequests/invitations.d.ts +257 -0
- package/dist/core/joinrequests/invitations.d.ts.map +1 -0
- package/dist/core/joinrequests/invitations.js +703 -0
- package/dist/core/joinrequests/invitations.js.map +1 -0
- package/dist/core/joinrequests/types.d.ts +208 -0
- package/dist/core/joinrequests/types.d.ts.map +1 -0
- package/dist/core/joinrequests/types.js +43 -0
- package/dist/core/joinrequests/types.js.map +1 -0
- package/dist/core/recovery/PaperRescueDevice.d.ts +92 -0
- package/dist/core/recovery/PaperRescueDevice.d.ts.map +1 -0
- package/dist/core/recovery/PaperRescueDevice.js +182 -0
- package/dist/core/recovery/PaperRescueDevice.js.map +1 -0
- package/dist/core/recovery/RecoveryContactsDocument.d.ts +91 -0
- package/dist/core/recovery/RecoveryContactsDocument.d.ts.map +1 -0
- package/dist/core/recovery/RecoveryContactsDocument.js +92 -0
- package/dist/core/recovery/RecoveryContactsDocument.js.map +1 -0
- package/dist/core/recovery/RecoveryContactsManager.d.ts +95 -0
- package/dist/core/recovery/RecoveryContactsManager.d.ts.map +1 -0
- package/dist/core/recovery/RecoveryContactsManager.js +322 -0
- package/dist/core/recovery/RecoveryContactsManager.js.map +1 -0
- package/dist/core/recovery/index.d.ts +8 -0
- package/dist/core/recovery/index.d.ts.map +1 -0
- package/dist/core/recovery/index.js +41 -0
- package/dist/core/recovery/index.js.map +1 -0
- package/dist/core/recovery/recoverWithContacts.d.ts +36 -0
- package/dist/core/recovery/recoverWithContacts.d.ts.map +1 -0
- package/dist/core/recovery/recoverWithContacts.js +103 -0
- package/dist/core/recovery/recoverWithContacts.js.map +1 -0
- package/dist/core/recovery/recoveryPackage.d.ts +72 -0
- package/dist/core/recovery/recoveryPackage.d.ts.map +1 -0
- package/dist/core/recovery/recoveryPackage.js +181 -0
- package/dist/core/recovery/recoveryPackage.js.map +1 -0
- package/dist/core/recovery/rescueDevice.d.ts +51 -0
- package/dist/core/recovery/rescueDevice.d.ts.map +1 -0
- package/dist/core/recovery/rescueDevice.js +201 -0
- package/dist/core/recovery/rescueDevice.js.map +1 -0
- package/dist/core/recovery/shamir.d.ts +30 -0
- package/dist/core/recovery/shamir.d.ts.map +1 -0
- package/dist/core/recovery/shamir.js +133 -0
- package/dist/core/recovery/shamir.js.map +1 -0
- package/dist/core/types.d.ts +64 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/core/userkeys/UserKeyManager.d.ts +29 -0
- package/dist/core/userkeys/UserKeyManager.d.ts.map +1 -1
- package/dist/core/userkeys/UserKeyManager.js +76 -8
- package/dist/core/userkeys/UserKeyManager.js.map +1 -1
- package/dist/core/userkeys/generationSignature.d.ts +6 -0
- package/dist/core/userkeys/generationSignature.d.ts.map +1 -1
- package/dist/core/userkeys/generationSignature.js +1 -0
- package/dist/core/userkeys/generationSignature.js.map +1 -1
- package/dist/core/userkeys/resolveUserKeyDocument.d.ts.map +1 -1
- package/dist/core/userkeys/resolveUserKeyDocument.js +6 -6
- package/dist/core/userkeys/resolveUserKeyDocument.js.map +1 -1
- package/dist/core/userkeys/validateUserKeyDocument.d.ts +11 -1
- package/dist/core/userkeys/validateUserKeyDocument.d.ts.map +1 -1
- package/dist/core/userkeys/validateUserKeyDocument.js +18 -5
- package/dist/core/userkeys/validateUserKeyDocument.js.map +1 -1
- package/dist/node/server/MindooDBServer.d.ts +2 -0
- package/dist/node/server/MindooDBServer.d.ts.map +1 -1
- package/dist/node/server/MindooDBServer.js +46 -0
- package/dist/node/server/MindooDBServer.js.map +1 -1
- package/dist/node/server/StoreFactory.d.ts.map +1 -1
- package/dist/node/server/StoreFactory.js +4 -1
- package/dist/node/server/StoreFactory.js.map +1 -1
- package/dist/node/server/server.js +2 -0
- package/dist/node/server/server.js.map +1 -1
- package/dist/server/JoinRequestService.d.ts +108 -0
- package/dist/server/JoinRequestService.d.ts.map +1 -0
- package/dist/server/JoinRequestService.js +454 -0
- package/dist/server/JoinRequestService.js.map +1 -0
- package/dist/server/TenantManager.d.ts +50 -0
- package/dist/server/TenantManager.d.ts.map +1 -1
- package/dist/server/TenantManager.js +271 -33
- package/dist/server/TenantManager.js.map +1 -1
- package/dist/server/http/MindooDBServerCore.d.ts +18 -0
- package/dist/server/http/MindooDBServerCore.d.ts.map +1 -1
- package/dist/server/http/MindooDBServerCore.js +229 -137
- package/dist/server/http/MindooDBServerCore.js.map +1 -1
- package/dist/server/serverConfig.d.ts.map +1 -1
- package/dist/server/serverConfig.js +17 -0
- package/dist/server/serverConfig.js.map +1 -1
- package/dist/server/types.d.ts +15 -0
- package/dist/server/types.d.ts.map +1 -1
- package/dist/server/types.js +6 -0
- package/dist/server/types.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client API of the invitation / join-request inbox (docs/invitations.md).
|
|
3
|
+
*
|
|
4
|
+
* Admin side: create and end invitations, keep the invitation list, pull the
|
|
5
|
+
* `joinrequests` inbox with an admin key, decrypt and check requests, admit
|
|
6
|
+
* matching ones with the existing `approveJoinRequest`, decide and purge.
|
|
7
|
+
*
|
|
8
|
+
* Device side: read an invitation from the server, verify its key against the
|
|
9
|
+
* link, and post a join request.
|
|
10
|
+
*
|
|
11
|
+
* Nothing here changes who can do what: grants are still signed by an admin on
|
|
12
|
+
* an admin device; the server only relays sealed envelopes.
|
|
13
|
+
*/
|
|
14
|
+
import type { CryptoAdapter } from "../crypto/CryptoAdapter";
|
|
15
|
+
import type { PrivateUserId } from "../userid";
|
|
16
|
+
import type { EncryptedPrivateKey, JoinRequest, MindooTenant } from "../types";
|
|
17
|
+
import { type AdminRecipient } from "./crypto";
|
|
18
|
+
import { type InvitationKind, type InvitationLink, type InvitationPublicInfo, type InvitationRow, type JoinRequestStatus } from "./types";
|
|
19
|
+
/**
|
|
20
|
+
* An admin identity (root or delegated), unlocked once. The encrypted signing
|
|
21
|
+
* key and its password are what `approveJoinRequest` and directory writes take;
|
|
22
|
+
* the CryptoKeys open seals and authenticate the inbox sync.
|
|
23
|
+
*/
|
|
24
|
+
export interface UnlockedInvitationAdmin {
|
|
25
|
+
signingPublicKey: string;
|
|
26
|
+
encryptedSigningKey: EncryptedPrivateKey;
|
|
27
|
+
password: string;
|
|
28
|
+
signingKey: CryptoKey;
|
|
29
|
+
encryptionPublicKey: string;
|
|
30
|
+
encryptionKey: CryptoKey;
|
|
31
|
+
/** Display name for join responses. */
|
|
32
|
+
username?: string;
|
|
33
|
+
}
|
|
34
|
+
/** Unlock an admin identity (as Haven stores it: a `PrivateUserId` plus its password). */
|
|
35
|
+
export declare function unlockInvitationAdmin(cryptoAdapter: CryptoAdapter, identity: PrivateUserId, password: string): Promise<UnlockedInvitationAdmin>;
|
|
36
|
+
/** Every admin encryption key that must be able to open invitation seals: the root and active delegated admins. */
|
|
37
|
+
export declare function listInvitationAdminRecipients(tenant: MindooTenant): Promise<AdminRecipient[]>;
|
|
38
|
+
/** Input row when creating or editing an invitation list. */
|
|
39
|
+
export interface InvitationRowInput {
|
|
40
|
+
rowId?: string;
|
|
41
|
+
firstName?: string;
|
|
42
|
+
lastName?: string;
|
|
43
|
+
/** Canonical or abbreviated (`Anna Muster/Schule`) username; stored canonical. */
|
|
44
|
+
username?: string;
|
|
45
|
+
email?: string;
|
|
46
|
+
loginType?: InvitationRow["loginType"];
|
|
47
|
+
loginValue?: string;
|
|
48
|
+
status?: InvitationRow["status"];
|
|
49
|
+
}
|
|
50
|
+
export interface CreateInvitationOptions {
|
|
51
|
+
kind: InvitationKind;
|
|
52
|
+
/** Server that will receive the requests; must hold this tenant. */
|
|
53
|
+
serverUrl: string;
|
|
54
|
+
rows?: InvitationRowInput[];
|
|
55
|
+
label?: string;
|
|
56
|
+
/** Absolute expiry (ms); default 30 days from now. */
|
|
57
|
+
expiresAt?: number;
|
|
58
|
+
/** Open links: cap on distinct devices. */
|
|
59
|
+
maxUses?: number;
|
|
60
|
+
/**
|
|
61
|
+
* Ed25519 key of that server (`/.well-known/mindoodb-server-info`). Fetched
|
|
62
|
+
* when omitted. Named in the invitation so members trust the `jr_`
|
|
63
|
+
* documents it signs.
|
|
64
|
+
*/
|
|
65
|
+
serverSigningPublicKey?: string;
|
|
66
|
+
}
|
|
67
|
+
/** An invitation as an admin sees it. */
|
|
68
|
+
export interface InvitationView {
|
|
69
|
+
invitationId: string;
|
|
70
|
+
kind: InvitationKind;
|
|
71
|
+
publicKey: string;
|
|
72
|
+
keyFingerprint: string;
|
|
73
|
+
createdAt: number;
|
|
74
|
+
expiresAt: number;
|
|
75
|
+
ended: boolean;
|
|
76
|
+
maxUses?: number;
|
|
77
|
+
serverUrl?: string;
|
|
78
|
+
serverSigningPublicKey?: string;
|
|
79
|
+
/** Present when the admin could open the seal. */
|
|
80
|
+
label?: string;
|
|
81
|
+
rows?: InvitationRow[];
|
|
82
|
+
/** False when no wrap addresses this admin (added after the invitation; another admin must re-seal). */
|
|
83
|
+
readable: boolean;
|
|
84
|
+
}
|
|
85
|
+
/** Normalize a typed or pasted username to its canonical form (`CN=…/O=…`). */
|
|
86
|
+
export declare function canonicalInvitationUsername(value: string | undefined): string | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* Create an invitation in the local `directory` replica. Push the directory to
|
|
89
|
+
* the server afterwards; until then the server answers the link with 404.
|
|
90
|
+
*/
|
|
91
|
+
export declare function createInvitation(tenant: MindooTenant, admin: UnlockedInvitationAdmin, options: CreateInvitationOptions): Promise<InvitationView>;
|
|
92
|
+
/** All invitations of the tenant, with the sealed list where this admin can open it. Newest first. */
|
|
93
|
+
export declare function listInvitations(tenant: MindooTenant, admin?: UnlockedInvitationAdmin): Promise<InvitationView[]>;
|
|
94
|
+
/** Replace the invitation list (new rows get a nonce on personal invitations; known rows keep theirs). */
|
|
95
|
+
export declare function setInvitationRows(tenant: MindooTenant, admin: UnlockedInvitationAdmin, invitationId: string, rows: InvitationRowInput[], options?: {
|
|
96
|
+
label?: string;
|
|
97
|
+
}): Promise<InvitationView>;
|
|
98
|
+
/** Update the status of single rows (e.g. `sent` after the link went out). */
|
|
99
|
+
export declare function setInvitationRowStatus(tenant: MindooTenant, admin: UnlockedInvitationAdmin, invitationId: string, updates: Array<{
|
|
100
|
+
rowId: string;
|
|
101
|
+
status: InvitationRow["status"];
|
|
102
|
+
joinRequestDocId?: string;
|
|
103
|
+
}>): Promise<InvitationView>;
|
|
104
|
+
/** Stop accepting requests for an invitation. Requests already received stay. */
|
|
105
|
+
export declare function endInvitation(tenant: MindooTenant, admin: UnlockedInvitationAdmin, invitationId: string): Promise<InvitationView>;
|
|
106
|
+
/**
|
|
107
|
+
* Add wraps for admins that were added after an invitation was sealed. Run on
|
|
108
|
+
* an admin device that can open the seals (Haven does it when the admin opens
|
|
109
|
+
* the invitation list). Returns the ids of re-sealed invitations.
|
|
110
|
+
*/
|
|
111
|
+
export declare function resealInvitationsForAdmins(tenant: MindooTenant, admin: UnlockedInvitationAdmin): Promise<string[]>;
|
|
112
|
+
/** The link fragment for one row (personal) or for the whole invitation (open). */
|
|
113
|
+
export declare function invitationLinkFragment(tenantId: string, invitation: Pick<InvitationView, "invitationId" | "keyFingerprint" | "serverUrl">, row?: Pick<InvitationRow, "nonce">, options?: {
|
|
114
|
+
serverUrl?: string;
|
|
115
|
+
/** Tenant label for "Invitation to …"; carried in the fragment as `l=`, never sent to the server. */
|
|
116
|
+
tenantLabel?: string;
|
|
117
|
+
}): string;
|
|
118
|
+
/** Error from the server's invitation endpoints, with its machine-readable code. */
|
|
119
|
+
export declare class InvitationRequestError extends Error {
|
|
120
|
+
readonly status: number;
|
|
121
|
+
readonly code?: string | undefined;
|
|
122
|
+
constructor(message: string, status: number, code?: string | undefined);
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Read an invitation from the server and check its key against the link. A
|
|
126
|
+
* mismatch means the server (or someone in between) handed out another key,
|
|
127
|
+
* which would let it read the request: the caller must stop.
|
|
128
|
+
*/
|
|
129
|
+
export declare function fetchInvitationForLink(cryptoAdapter: CryptoAdapter, link: InvitationLink): Promise<InvitationPublicInfo>;
|
|
130
|
+
export interface SubmitJoinRequestOptions {
|
|
131
|
+
link: InvitationLink;
|
|
132
|
+
/** `mdb://join-request/...` of this device (`factory.createJoinRequest(user, { format: "uri" })`). */
|
|
133
|
+
joinRequestUri: string;
|
|
134
|
+
/** This device's Ed25519 signing key (unlocked). */
|
|
135
|
+
deviceSigningKey: CryptoKey;
|
|
136
|
+
message?: string;
|
|
137
|
+
/** Already fetched and verified invitation (saves a round trip). */
|
|
138
|
+
invitation?: InvitationPublicInfo;
|
|
139
|
+
}
|
|
140
|
+
export interface SubmittedJoinRequest {
|
|
141
|
+
id: string;
|
|
142
|
+
expiresAt: number;
|
|
143
|
+
/** Code to compare with the admin when the link carried no nonce. */
|
|
144
|
+
verificationCode: string;
|
|
145
|
+
}
|
|
146
|
+
/** Post a join request for an invitation link. */
|
|
147
|
+
export declare function submitJoinRequest(cryptoAdapter: CryptoAdapter, options: SubmitJoinRequestOptions): Promise<SubmittedJoinRequest>;
|
|
148
|
+
/**
|
|
149
|
+
* The verification code of a request, for requests sent without an
|
|
150
|
+
* invitation (code over the join request alone) or with an open link.
|
|
151
|
+
*/
|
|
152
|
+
export declare function joinRequestVerificationCode(cryptoAdapter: CryptoAdapter, joinRequestUri: string, scope?: {
|
|
153
|
+
tenantId: string;
|
|
154
|
+
invitationId: string;
|
|
155
|
+
}): Promise<string>;
|
|
156
|
+
/** Outcome of a sent request as the server reports it. */
|
|
157
|
+
export type JoinRequestOutcome = "pending" | "accepted" | "rejected" | "withdrawn" | "expired" | "replaced" | "unknown";
|
|
158
|
+
/**
|
|
159
|
+
* Ask the server what became of a request. `accepted` shows up once the
|
|
160
|
+
* server saw the admin's decision; the device learns it is in by discovery
|
|
161
|
+
* either way, so poll that too.
|
|
162
|
+
*/
|
|
163
|
+
export declare function fetchJoinRequestStatus(serverUrl: string, tenantId: string, requestId: string): Promise<{
|
|
164
|
+
status: JoinRequestOutcome;
|
|
165
|
+
expiresAt?: number;
|
|
166
|
+
}>;
|
|
167
|
+
/** Take a request back (signed by the device that sent it). The server purges it. */
|
|
168
|
+
export declare function withdrawJoinRequest(cryptoAdapter: CryptoAdapter, options: {
|
|
169
|
+
serverUrl: string;
|
|
170
|
+
tenantId: string;
|
|
171
|
+
requestId: string;
|
|
172
|
+
deviceSigningPublicKey: string;
|
|
173
|
+
deviceSigningKey: CryptoKey;
|
|
174
|
+
}): Promise<void>;
|
|
175
|
+
/**
|
|
176
|
+
* Number of pending requests in a tenant's inbox, asked with a member
|
|
177
|
+
* device's key (no admin key needed). For a "N new requests" hint.
|
|
178
|
+
*/
|
|
179
|
+
export declare function fetchJoinRequestSummary(cryptoAdapter: CryptoAdapter, options: {
|
|
180
|
+
serverUrl: string;
|
|
181
|
+
tenantId: string;
|
|
182
|
+
deviceSigningPublicKey: string;
|
|
183
|
+
deviceSigningKey: CryptoKey;
|
|
184
|
+
}): Promise<{
|
|
185
|
+
pending: number;
|
|
186
|
+
}>;
|
|
187
|
+
/** Result of checking one request against its invitation. */
|
|
188
|
+
export type JoinRequestMatch =
|
|
189
|
+
/** Personal link: HMAC proves the link, the row is known. */
|
|
190
|
+
"match"
|
|
191
|
+
/** Open link: nothing to prove; compare the verification code. */
|
|
192
|
+
| "unverified"
|
|
193
|
+
/** Something does not add up; never admit automatically. */
|
|
194
|
+
| "invalid";
|
|
195
|
+
export interface JoinRequestInboxItem {
|
|
196
|
+
docId: string;
|
|
197
|
+
status: JoinRequestStatus;
|
|
198
|
+
receivedAt: number;
|
|
199
|
+
expiresAt: number;
|
|
200
|
+
invitationId: string;
|
|
201
|
+
invitationLabel?: string;
|
|
202
|
+
kind?: InvitationKind;
|
|
203
|
+
deviceKeyFingerprint: string;
|
|
204
|
+
match: JoinRequestMatch;
|
|
205
|
+
problems: string[];
|
|
206
|
+
verificationCode?: string;
|
|
207
|
+
row?: InvitationRow;
|
|
208
|
+
joinRequestUri?: string;
|
|
209
|
+
request?: JoinRequest;
|
|
210
|
+
message?: string;
|
|
211
|
+
/** Username the request would be registered under (row first, then the request). */
|
|
212
|
+
username?: string;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Pull (and push decisions of) the `joinrequests` database with the admin key,
|
|
216
|
+
* then forget local copies of requests the server already purged.
|
|
217
|
+
*/
|
|
218
|
+
export declare function syncJoinRequestInbox(tenant: MindooTenant, serverUrl: string, admin: UnlockedInvitationAdmin): Promise<void>;
|
|
219
|
+
/** Decrypt and check every request in the local inbox replica. */
|
|
220
|
+
export declare function listJoinRequests(tenant: MindooTenant, admin: UnlockedInvitationAdmin, options?: {
|
|
221
|
+
includeDecided?: boolean;
|
|
222
|
+
}): Promise<JoinRequestInboxItem[]>;
|
|
223
|
+
/**
|
|
224
|
+
* Set a request's status (`rejected`, `withdrawn`, …). Sync the inbox
|
|
225
|
+
* afterwards: the server purges decided requests once it sees the change,
|
|
226
|
+
* and the next sync forgets the local copy.
|
|
227
|
+
*/
|
|
228
|
+
export declare function setJoinRequestStatus(tenant: MindooTenant, admin: UnlockedInvitationAdmin, docId: string, status: JoinRequestStatus): Promise<void>;
|
|
229
|
+
export interface AdmitJoinRequestsOptions {
|
|
230
|
+
/** Server URL put into the join response (the joining device discovers it there anyway). */
|
|
231
|
+
serverUrl?: string;
|
|
232
|
+
/** Document keys to share; default `$publicinfos` + `default` (see `approveJoinRequest`). */
|
|
233
|
+
sharedDocKeyIds?: string[];
|
|
234
|
+
allowDeviceSelfGrant?: boolean;
|
|
235
|
+
/** Username per request doc id, for requests without a list row or name. */
|
|
236
|
+
usernames?: Record<string, string>;
|
|
237
|
+
}
|
|
238
|
+
export interface AdmitResult {
|
|
239
|
+
docId: string;
|
|
240
|
+
ok: boolean;
|
|
241
|
+
username?: string;
|
|
242
|
+
error?: string;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Admit requests: grant each with `approveJoinRequest` under the list row's
|
|
246
|
+
* name, mark the request `accepted` and the row `admitted`. The joining
|
|
247
|
+
* device finds the grant by discovery once the directory reaches the server,
|
|
248
|
+
* so push `directory` and sync the inbox afterwards. Items with problems are
|
|
249
|
+
* refused here, whatever the caller passes.
|
|
250
|
+
*/
|
|
251
|
+
export declare function admitJoinRequests(tenant: MindooTenant, admin: UnlockedInvitationAdmin, items: JoinRequestInboxItem[], options?: AdmitJoinRequestsOptions): Promise<AdmitResult[]>;
|
|
252
|
+
/**
|
|
253
|
+
* Purge local copies of decided or expired requests (the server purges its
|
|
254
|
+
* copy on its own). Returns the purged ids.
|
|
255
|
+
*/
|
|
256
|
+
export declare function purgeDecidedJoinRequests(tenant: MindooTenant): Promise<string[]>;
|
|
257
|
+
//# sourceMappingURL=invitations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invitations.d.ts","sourceRoot":"","sources":["../../../src/core/joinrequests/invitations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAS7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAEV,mBAAmB,EACnB,WAAW,EAEX,YAAY,EACb,MAAM,UAAU,CAAC;AAGlB,OAAO,EAoBL,KAAK,cAAc,EACpB,MAAM,UAAU,CAAC;AAClB,OAAO,EASL,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAIlB,KAAK,iBAAiB,EAEvB,MAAM,SAAS,CAAC;AAMjB;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,QAAQ,EAAE,MA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