@abraca/dabra 2.5.0 → 2.7.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 +67 -3
- package/dist/abracadabra-provider.cjs.map +1 -1
- package/dist/abracadabra-provider.esm.js +67 -3
- package/dist/abracadabra-provider.esm.js.map +1 -1
- package/dist/index.d.ts +63 -2
- package/package.json +2 -2
- package/src/AbracadabraBaseProvider.ts +15 -0
- package/src/AbracadabraClient.ts +78 -0
- package/src/ContentManager.ts +8 -6
|
@@ -2328,6 +2328,21 @@ var QueryClient = class extends EventEmitter {
|
|
|
2328
2328
|
}
|
|
2329
2329
|
};
|
|
2330
2330
|
|
|
2331
|
+
//#endregion
|
|
2332
|
+
//#region packages/provider/src/OutgoingMessages/QueryAwarenessMessage.ts
|
|
2333
|
+
var QueryAwarenessMessage = class extends OutgoingMessage {
|
|
2334
|
+
constructor(..._args) {
|
|
2335
|
+
super(..._args);
|
|
2336
|
+
this.type = MessageType.QueryAwareness;
|
|
2337
|
+
this.description = "Queries awareness states";
|
|
2338
|
+
}
|
|
2339
|
+
get(args) {
|
|
2340
|
+
writeVarString(this.encoder, args.documentName);
|
|
2341
|
+
writeVarUint(this.encoder, this.type);
|
|
2342
|
+
return this.encoder;
|
|
2343
|
+
}
|
|
2344
|
+
};
|
|
2345
|
+
|
|
2331
2346
|
//#endregion
|
|
2332
2347
|
//#region packages/provider/src/OutgoingMessages/SyncStepOneMessage.ts
|
|
2333
2348
|
var SyncStepOneMessage = class extends OutgoingMessage {
|
|
@@ -2610,6 +2625,7 @@ var AbracadabraBaseProvider = class extends EventEmitter {
|
|
|
2610
2625
|
clients: [this.document.clientID],
|
|
2611
2626
|
documentName: this.configuration.name
|
|
2612
2627
|
});
|
|
2628
|
+
if (this.awareness) this.send(QueryAwarenessMessage, { documentName: this.configuration.name });
|
|
2613
2629
|
}
|
|
2614
2630
|
send(message, args) {
|
|
2615
2631
|
if (!this._isAttached) return;
|
|
@@ -11092,6 +11108,49 @@ var AbracadabraClient = class {
|
|
|
11092
11108
|
return this.request("GET", `/admin/users/${encodeURIComponent(userId)}/docs${qs}`);
|
|
11093
11109
|
}
|
|
11094
11110
|
/**
|
|
11111
|
+
* List `service`-role users (runners, demo seeders, automation
|
|
11112
|
+
* identities). Requires Service role. Admins can see service users via
|
|
11113
|
+
* `/admin/users` too but cannot mint or rotate them.
|
|
11114
|
+
*/
|
|
11115
|
+
async adminListServiceAccounts() {
|
|
11116
|
+
return this.request("GET", "/admin/service-accounts");
|
|
11117
|
+
}
|
|
11118
|
+
/**
|
|
11119
|
+
* Create a new `service`-role user. When `public_key` is omitted the
|
|
11120
|
+
* server generates a keypair and returns the private half in the
|
|
11121
|
+
* response — show it to the operator **once** and discard; the server
|
|
11122
|
+
* never persists it. Requires Service role.
|
|
11123
|
+
*/
|
|
11124
|
+
async adminCreateServiceAccount(body) {
|
|
11125
|
+
return this.request("POST", "/admin/service-accounts", { body });
|
|
11126
|
+
}
|
|
11127
|
+
/**
|
|
11128
|
+
* Rotate the active keypair on a service account. Old JWTs are
|
|
11129
|
+
* invalidated; old device keys are marked revoked; the canonical
|
|
11130
|
+
* `users.public_key` swaps to the new value. `users.id` stays put so
|
|
11131
|
+
* existing permission rows keep matching. Returns the new pubkey (and
|
|
11132
|
+
* private half when the server generated it). Requires Service role.
|
|
11133
|
+
*/
|
|
11134
|
+
async adminRotateServiceAccountKey(userId, body = {}) {
|
|
11135
|
+
return this.request("POST", `/admin/service-accounts/${encodeURIComponent(userId)}/rotate-key`, { body });
|
|
11136
|
+
}
|
|
11137
|
+
/**
|
|
11138
|
+
* Lock a service account and revoke all of its device keys. Idempotent.
|
|
11139
|
+
* Refuses targets whose `users.role` isn't `"service"`. Requires
|
|
11140
|
+
* Service role.
|
|
11141
|
+
*/
|
|
11142
|
+
async adminRevokeServiceAccount(userId) {
|
|
11143
|
+
await this.request("DELETE", `/admin/service-accounts/${encodeURIComponent(userId)}`);
|
|
11144
|
+
}
|
|
11145
|
+
/**
|
|
11146
|
+
* Revoke a single device key on a user (any role). Bumps
|
|
11147
|
+
* `tokens_invalid_before` so open WS sessions tied to the key must
|
|
11148
|
+
* re-auth. Requires elevated role (Service or Admin@root).
|
|
11149
|
+
*/
|
|
11150
|
+
async adminRevokeDeviceKey(userId, keyId) {
|
|
11151
|
+
await this.request("POST", `/admin/users/${encodeURIComponent(userId)}/device-keys/${encodeURIComponent(keyId)}/revoke`);
|
|
11152
|
+
}
|
|
11153
|
+
/**
|
|
11095
11154
|
* Page through the audit log. Filters AND-combine; `limit` defaults to
|
|
11096
11155
|
* 100 server-side. Requires elevated role.
|
|
11097
11156
|
*/
|
|
@@ -20277,8 +20336,13 @@ var ContentManager = class {
|
|
|
20277
20336
|
}
|
|
20278
20337
|
/**
|
|
20279
20338
|
* Read document content as markdown.
|
|
20280
|
-
*
|
|
20281
|
-
* body, tree
|
|
20339
|
+
*
|
|
20340
|
+
* Returns the markdown body, tree-derived label/type/meta, and immediate
|
|
20341
|
+
* children. `title` mirrors `label` (the tree entry's display name) — it
|
|
20342
|
+
* is *not* derived from a TipTap `documentHeader`, and the markdown body
|
|
20343
|
+
* does NOT include YAML frontmatter. Callers that want frontmatter-style
|
|
20344
|
+
* round-tripping should serialise `meta`/`type` themselves on top of the
|
|
20345
|
+
* returned markdown.
|
|
20282
20346
|
*/
|
|
20283
20347
|
async read(docId) {
|
|
20284
20348
|
const fragment = (await this.dm.getChildProvider(docId)).document.getXmlFragment("default");
|
|
@@ -20313,7 +20377,7 @@ var ContentManager = class {
|
|
|
20313
20377
|
type,
|
|
20314
20378
|
meta
|
|
20315
20379
|
}));
|
|
20316
|
-
const markdown = yjsToMarkdown(fragment
|
|
20380
|
+
const { markdown } = yjsToMarkdown(fragment);
|
|
20317
20381
|
return {
|
|
20318
20382
|
label,
|
|
20319
20383
|
type,
|