@raisindb/functions-types 0.1.37 → 0.1.55

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/raisin.d.ts +50 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raisindb/functions-types",
3
- "version": "0.1.37",
3
+ "version": "0.1.55",
4
4
  "description": "TypeScript type definitions for the RaisinDB server-side function runtime (QuickJS)",
5
5
  "license": "MIT",
6
6
  "types": "raisin.d.ts",
package/raisin.d.ts CHANGED
@@ -162,14 +162,14 @@ interface RaisinNode {
162
162
  /**
163
163
  * True if this node carries the given mixin (type-declared, transitively).
164
164
  * Backed by the server-materialized effective-mixin set.
165
- * @param mixinName - e.g., "studio:SEO"
165
+ * @param mixinName - e.g., "app:SEO"
166
166
  */
167
167
  hasMixin(mixinName: string): boolean;
168
168
 
169
169
  /**
170
170
  * True if this node "is a" given type — its node_type, any `extends` ancestor,
171
171
  * or any effective mixin.
172
- * @param typeName - e.g., "studio:Folder"
172
+ * @param typeName - e.g., "app:Folder"
173
173
  */
174
174
  isNodeType(typeName: string): boolean;
175
175
  }
@@ -180,6 +180,22 @@ interface ResourceUploadData {
180
180
  name?: string;
181
181
  }
182
182
 
183
+ /**
184
+ * A single entry in a node's revision history (newest first), returned by
185
+ * raisin.nodes.history(). Use `revision` with an at-revision read to fetch the
186
+ * full snapshot of that historical version.
187
+ */
188
+ interface RaisinRevisionEntry {
189
+ /** HLC revision string ("timestamp-counter"). */
190
+ revision: string;
191
+ /** When this revision was written (ISO 8601 string). */
192
+ updated_at?: string;
193
+ /** User ID who authored this revision. */
194
+ updated_by?: string;
195
+ /** True when the node was deleted at this revision (tombstone). */
196
+ deleted: boolean;
197
+ }
198
+
183
199
  interface NodeCreateData {
184
200
  name?: string;
185
201
  path?: string;
@@ -263,6 +279,7 @@ declare namespace raisin {
263
279
 
264
280
  namespace crypto {
265
281
  function uuid(): Promise<string>;
282
+ function verifyJwt(token: string, opts?: any | null): Promise<any>;
266
283
  }
267
284
 
268
285
  namespace date {
@@ -303,9 +320,31 @@ declare namespace raisin {
303
320
  function delete(url: string, options?: HttpOptions): Promise<HttpResponse>;
304
321
  }
305
322
 
323
+ namespace imap {
324
+ function fetchSince(conn: any, sinceUid: number, opts?: any | null): Promise<any>;
325
+ function listMailboxes(conn: any): Promise<any>;
326
+ function fetchMessage(conn: any, uid: number, opts?: any | null): Promise<any>;
327
+ }
328
+
329
+ namespace integrations {
330
+ function syncNow(mountId: string, mode?: string | null): Promise<any>;
331
+ }
332
+
333
+ namespace inventory {
334
+ function claim(pool: string, n: number, capacity: number): Promise<any>;
335
+ function release(pool: string, n: number): Promise<number>;
336
+ }
337
+
338
+ namespace locks {
339
+ function acquire(key: string, ttlMs: number, owner?: string | null): Promise<any>;
340
+ function release(key: string, token: number): Promise<boolean>;
341
+ function renew(key: string, token: number, ttlMs: number): Promise<boolean>;
342
+ }
343
+
306
344
  namespace nodes {
307
345
  function get(workspace: string, path: string): Promise<RaisinNode | null>;
308
346
  function getById(workspace: string, id: string): Promise<RaisinNode | null>;
347
+ function history(workspace: string, id: string, limit?: number | null): Promise<RaisinRevisionEntry[]>;
309
348
  function create(workspace: string, parentPath: string, data: any): Promise<RaisinNode>;
310
349
  function update(workspace: string, path: string, data: any): Promise<RaisinNode>;
311
350
  function delete(workspace: string, path: string): Promise<void>;
@@ -313,7 +352,16 @@ declare namespace raisin {
313
352
  function move(workspace: string, nodePath: string, newParentPath: string): Promise<RaisinNode>;
314
353
  function query(workspace: string, query: any): Promise<RaisinNode[]>;
315
354
  function getChildren(workspace: string, parentPath: string, limit?: number | null): Promise<RaisinNode[]>;
355
+ function applyChildOrder(workspace: string, parentPath: string, sourceBranch: string, targetBranch: string): Promise<void>;
316
356
  function addResource(workspace: string, nodePath: string, propertyPath: string, uploadData: any): Promise<any>;
357
+ /**
358
+ * Create a node under parentPath, auto-creating any missing ancestor folders.
359
+ */
360
+ function createDeep(workspace: string, parentPath: string, data: any, parentNodeType?: string): Promise<RaisinNode>;
361
+ /**
362
+ * Upsert a node by path (create-or-update), auto-creating any missing ancestor folders.
363
+ */
364
+ function upsertDeep(workspace: string, data: any, parentNodeType?: string): Promise<void>;
317
365
  /**
318
366
  * Start a transaction for atomic multi-node operations.
319
367
  * @example