@abraca/dabra 1.0.1 → 1.0.2
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 +29 -0
- package/dist/abracadabra-provider.cjs.map +1 -1
- package/dist/abracadabra-provider.esm.js +29 -0
- package/dist/abracadabra-provider.esm.js.map +1 -1
- package/dist/index.d.ts +29 -1
- package/package.json +1 -1
- package/src/AbracadabraClient.ts +49 -0
- package/src/types.ts +14 -0
|
@@ -3295,6 +3295,35 @@ var AbracadabraClient = class {
|
|
|
3295
3295
|
async redeemInvite(code) {
|
|
3296
3296
|
await this.request("POST", "/invites/redeem", { body: { code } });
|
|
3297
3297
|
}
|
|
3298
|
+
/** List spaces visible to the caller. No auth required for public spaces. */
|
|
3299
|
+
async listSpaces() {
|
|
3300
|
+
return (await this.request("GET", "/spaces", { auth: false })).spaces;
|
|
3301
|
+
}
|
|
3302
|
+
/** Get a single space by ID. */
|
|
3303
|
+
async getSpace(spaceId) {
|
|
3304
|
+
return this.request("GET", `/spaces/${encodeURIComponent(spaceId)}`, { auth: false });
|
|
3305
|
+
}
|
|
3306
|
+
/** Get the hub space, or null if none is configured. */
|
|
3307
|
+
async getHubSpace() {
|
|
3308
|
+
try {
|
|
3309
|
+
return await this.request("GET", "/spaces/hub", { auth: false });
|
|
3310
|
+
} catch (e) {
|
|
3311
|
+
if (typeof e === "object" && e !== null && "status" in e && e.status === 404) return null;
|
|
3312
|
+
throw e;
|
|
3313
|
+
}
|
|
3314
|
+
}
|
|
3315
|
+
/** Create a new space (auth required). */
|
|
3316
|
+
async createSpace(opts) {
|
|
3317
|
+
return this.request("POST", "/spaces", { body: opts });
|
|
3318
|
+
}
|
|
3319
|
+
/** Update an existing space (Owner or admin required). */
|
|
3320
|
+
async updateSpace(spaceId, opts) {
|
|
3321
|
+
return this.request("PATCH", `/spaces/${encodeURIComponent(spaceId)}`, { body: opts });
|
|
3322
|
+
}
|
|
3323
|
+
/** Delete a space and its root document (Owner or admin required). */
|
|
3324
|
+
async deleteSpace(spaceId) {
|
|
3325
|
+
await this.request("DELETE", `/spaces/${encodeURIComponent(spaceId)}`);
|
|
3326
|
+
}
|
|
3298
3327
|
/** Health check — no auth required. */
|
|
3299
3328
|
async health() {
|
|
3300
3329
|
return this.request("GET", "/health", { auth: false });
|