@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
|
@@ -2532,7 +2532,8 @@ var AbracadabraClient = class {
|
|
|
2532
2532
|
identityPublicKey: opts.publicKey,
|
|
2533
2533
|
deviceName: opts.deviceName,
|
|
2534
2534
|
displayName: opts.displayName,
|
|
2535
|
-
email: opts.email
|
|
2535
|
+
email: opts.email,
|
|
2536
|
+
inviteCode: opts.inviteCode
|
|
2536
2537
|
},
|
|
2537
2538
|
auth: false
|
|
2538
2539
|
});
|
|
@@ -2698,6 +2699,22 @@ var AbracadabraClient = class {
|
|
|
2698
2699
|
await this.request("DELETE", `/docs/${encodeURIComponent(docId)}/uploads/${encodeURIComponent(uploadId)}`);
|
|
2699
2700
|
if (this.cache) await this.cache.invalidateUploads(docId).catch(() => null);
|
|
2700
2701
|
}
|
|
2702
|
+
/** Create an invite code (requires permission per server config). */
|
|
2703
|
+
async createInvite(opts) {
|
|
2704
|
+
return this.request("POST", "/invites", { body: opts ?? {} });
|
|
2705
|
+
}
|
|
2706
|
+
/** List invite codes visible to the current user. */
|
|
2707
|
+
async listInvites() {
|
|
2708
|
+
return (await this.request("GET", "/invites")).invites;
|
|
2709
|
+
}
|
|
2710
|
+
/** Revoke an invite by its code. */
|
|
2711
|
+
async revokeInvite(code) {
|
|
2712
|
+
await this.request("DELETE", `/invites/${encodeURIComponent(code)}`);
|
|
2713
|
+
}
|
|
2714
|
+
/** Redeem an invite code for the currently authenticated user. */
|
|
2715
|
+
async redeemInvite(code) {
|
|
2716
|
+
await this.request("POST", "/invites/redeem", { body: { code } });
|
|
2717
|
+
}
|
|
2701
2718
|
/** Health check — no auth required. */
|
|
2702
2719
|
async health() {
|
|
2703
2720
|
return this.request("GET", "/health", { auth: false });
|