@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
|
@@ -3325,6 +3325,35 @@ var AbracadabraClient = class {
|
|
|
3325
3325
|
async redeemInvite(code) {
|
|
3326
3326
|
await this.request("POST", "/invites/redeem", { body: { code } });
|
|
3327
3327
|
}
|
|
3328
|
+
/** List spaces visible to the caller. No auth required for public spaces. */
|
|
3329
|
+
async listSpaces() {
|
|
3330
|
+
return (await this.request("GET", "/spaces", { auth: false })).spaces;
|
|
3331
|
+
}
|
|
3332
|
+
/** Get a single space by ID. */
|
|
3333
|
+
async getSpace(spaceId) {
|
|
3334
|
+
return this.request("GET", `/spaces/${encodeURIComponent(spaceId)}`, { auth: false });
|
|
3335
|
+
}
|
|
3336
|
+
/** Get the hub space, or null if none is configured. */
|
|
3337
|
+
async getHubSpace() {
|
|
3338
|
+
try {
|
|
3339
|
+
return await this.request("GET", "/spaces/hub", { auth: false });
|
|
3340
|
+
} catch (e) {
|
|
3341
|
+
if (typeof e === "object" && e !== null && "status" in e && e.status === 404) return null;
|
|
3342
|
+
throw e;
|
|
3343
|
+
}
|
|
3344
|
+
}
|
|
3345
|
+
/** Create a new space (auth required). */
|
|
3346
|
+
async createSpace(opts) {
|
|
3347
|
+
return this.request("POST", "/spaces", { body: opts });
|
|
3348
|
+
}
|
|
3349
|
+
/** Update an existing space (Owner or admin required). */
|
|
3350
|
+
async updateSpace(spaceId, opts) {
|
|
3351
|
+
return this.request("PATCH", `/spaces/${encodeURIComponent(spaceId)}`, { body: opts });
|
|
3352
|
+
}
|
|
3353
|
+
/** Delete a space and its root document (Owner or admin required). */
|
|
3354
|
+
async deleteSpace(spaceId) {
|
|
3355
|
+
await this.request("DELETE", `/spaces/${encodeURIComponent(spaceId)}`);
|
|
3356
|
+
}
|
|
3328
3357
|
/** Health check — no auth required. */
|
|
3329
3358
|
async health() {
|
|
3330
3359
|
return this.request("GET", "/health", { auth: false });
|