@abraca/dabra 0.7.0 → 0.8.0
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/dist/abracadabra-provider.cjs +18 -1
- package/dist/abracadabra-provider.cjs.map +1 -1
- package/dist/abracadabra-provider.esm.js +18 -1
- package/dist/abracadabra-provider.esm.js.map +1 -1
- package/dist/index.d.ts +25 -1
- package/package.json +1 -1
- package/src/AbracadabraClient.ts +27 -0
- package/src/types.ts +13 -0
|
@@ -2562,7 +2562,8 @@ var AbracadabraClient = class {
|
|
|
2562
2562
|
identityPublicKey: opts.publicKey,
|
|
2563
2563
|
deviceName: opts.deviceName,
|
|
2564
2564
|
displayName: opts.displayName,
|
|
2565
|
-
email: opts.email
|
|
2565
|
+
email: opts.email,
|
|
2566
|
+
inviteCode: opts.inviteCode
|
|
2566
2567
|
},
|
|
2567
2568
|
auth: false
|
|
2568
2569
|
});
|
|
@@ -2728,6 +2729,22 @@ var AbracadabraClient = class {
|
|
|
2728
2729
|
await this.request("DELETE", `/docs/${encodeURIComponent(docId)}/uploads/${encodeURIComponent(uploadId)}`);
|
|
2729
2730
|
if (this.cache) await this.cache.invalidateUploads(docId).catch(() => null);
|
|
2730
2731
|
}
|
|
2732
|
+
/** Create an invite code (requires permission per server config). */
|
|
2733
|
+
async createInvite(opts) {
|
|
2734
|
+
return this.request("POST", "/invites", { body: opts ?? {} });
|
|
2735
|
+
}
|
|
2736
|
+
/** List invite codes visible to the current user. */
|
|
2737
|
+
async listInvites() {
|
|
2738
|
+
return (await this.request("GET", "/invites")).invites;
|
|
2739
|
+
}
|
|
2740
|
+
/** Revoke an invite by its code. */
|
|
2741
|
+
async revokeInvite(code) {
|
|
2742
|
+
await this.request("DELETE", `/invites/${encodeURIComponent(code)}`);
|
|
2743
|
+
}
|
|
2744
|
+
/** Redeem an invite code for the currently authenticated user. */
|
|
2745
|
+
async redeemInvite(code) {
|
|
2746
|
+
await this.request("POST", "/invites/redeem", { body: { code } });
|
|
2747
|
+
}
|
|
2731
2748
|
/** Health check — no auth required. */
|
|
2732
2749
|
async health() {
|
|
2733
2750
|
return this.request("GET", "/health", { auth: false });
|