@roc-db/in-memory 0.2.0-pre.1 → 0.2.0-pre.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.
@@ -0,0 +1,11 @@
1
+ import { Snowflake, type Adapter, type Operation } from "roc-db";
2
+ import type { z } from "zod";
3
+ type Entity = z.ZodObject<{
4
+ entity: z.ZodLiteral<string>;
5
+ }>;
6
+ export declare const createInMemoryAdapter: <const Name extends string, const Operations extends readonly Operation[], const Entities extends readonly Entity[]>({ operations, entities, snowflake, }: {
7
+ operations: Operations;
8
+ entities: Entities;
9
+ snowflake?: Snowflake;
10
+ }) => Adapter;
11
+ export {};
@@ -0,0 +1 @@
1
+ export declare const begin: (request: any, engineOpts: any) => any;
@@ -0,0 +1,24 @@
1
+ import { type Ref } from "roc-db";
2
+ import type { InMemoryWriteTransaction } from "../types/InMemoryWriteTransaction";
3
+ export declare const createEntity: (txn: InMemoryWriteTransaction, ref: Ref, { data, indexedData, children, parents, ancestors, }: {
4
+ data?: {} | undefined;
5
+ indexedData?: {} | undefined;
6
+ children?: {} | undefined;
7
+ parents?: {} | undefined;
8
+ ancestors?: {} | undefined;
9
+ }) => {
10
+ ref: `${string}/${string}`;
11
+ entity: string;
12
+ created: {
13
+ timestamp: any;
14
+ mutationRef: any;
15
+ };
16
+ updated: {
17
+ timestamp: any;
18
+ mutationRef: any;
19
+ };
20
+ data: {};
21
+ children: {};
22
+ parents: {};
23
+ ancestors: {};
24
+ };
@@ -0,0 +1 @@
1
+ export declare const deleteEntity: (txn: any, ref: any) => boolean;
@@ -0,0 +1,3 @@
1
+ import type { WriteOperation } from "roc-db";
2
+ import type { InMemoryEngine } from "../types/InMemoryEngine";
3
+ export declare const findDebounceMutation: (request: WriteOperation, engine: InMemoryEngine, now: any) => import("roc-db").Mutation | undefined;
@@ -0,0 +1 @@
1
+ export declare const getChangeSetMutations: (txn: any, changeSetRef: any) => any[];
@@ -0,0 +1,11 @@
1
+ export { begin } from "./begin";
2
+ export { createEntity } from "./createEntity";
3
+ export { deleteEntity } from "./deleteEntity";
4
+ export { getChangeSetMutations } from "./getChangeSetMutations";
5
+ export { findDebounceMutation } from "./findDebounceMutation";
6
+ export { pageMutations } from "./pageMutations";
7
+ export { patchEntity } from "./patchEntity";
8
+ export { readEntity } from "./readEntity";
9
+ export { readMutation } from "./readMutation";
10
+ export { saveMutation } from "./saveMutation";
11
+ export { updateEntity } from "./updateEntity";
@@ -0,0 +1,6 @@
1
+ import type { ReadTransaction } from "roc-db";
2
+ import type { InMemoryEngine } from "../types/InMemoryEngine";
3
+ export declare const pageMutations: (txn: ReadTransaction<any, InMemoryEngine, any, any>, { size, skip }?: {
4
+ size?: number;
5
+ skip?: number;
6
+ }) => import("roc-db").Mutation[];
@@ -0,0 +1,6 @@
1
+ export declare const patchEntity: (txn: any, ref: any, { data, children, parents, ancestors }: {
2
+ data?: {} | undefined;
3
+ children?: {} | undefined;
4
+ parents?: {} | undefined;
5
+ ancestors?: {} | undefined;
6
+ }) => any;
@@ -0,0 +1 @@
1
+ export declare const readEntity: (txn: any, ref: any) => any;
@@ -0,0 +1 @@
1
+ export declare const readMutation: (engineOpts: any, ref: any) => any;
@@ -0,0 +1,2 @@
1
+ import type { InMemoryWriteTransaction } from "../types/InMemoryWriteTransaction";
2
+ export declare const saveMutation: (txn: InMemoryWriteTransaction, finalizedMutation: any) => any;
@@ -0,0 +1,6 @@
1
+ export declare const updateEntity: (txn: any, ref: any, { data, children, parents, ancestors }: {
2
+ data?: {} | undefined;
3
+ children?: {} | undefined;
4
+ parents?: {} | undefined;
5
+ ancestors?: {} | undefined;
6
+ }) => any;
@@ -0,0 +1 @@
1
+ export { createInMemoryAdapter } from "./createInMemoryAdapter";
@@ -0,0 +1,5 @@
1
+ import type { Entity, Ref, Mutation } from "roc-db";
2
+ export type InMemoryEngine = {
3
+ entities: Map<Ref, Entity>;
4
+ mutations: Map<Ref, Mutation>;
5
+ };
@@ -0,0 +1,3 @@
1
+ import type { WriteTransaction } from "roc-db";
2
+ import type { InMemoryEngine } from "./InMemoryEngine";
3
+ export type InMemoryWriteTransaction = WriteTransaction<any, InMemoryEngine, any, any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roc-db/in-memory",
3
- "version": "0.2.0-pre.1",
3
+ "version": "0.2.0-pre.2",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/index.ts"
@@ -15,12 +15,12 @@
15
15
  "test": "bun test"
16
16
  },
17
17
  "devDependencies": {
18
- "@roc-db/test-utils": "0.2.0-pre.1",
19
- "roc-db": "0.2.0-pre.1",
18
+ "@roc-db/test-utils": "0.2.0-pre.2",
19
+ "roc-db": "0.2.0-pre.2",
20
20
  "zod": "3.24.2"
21
21
  },
22
22
  "peerDependencies": {
23
- "roc-db": "0.2.0-pre.1",
23
+ "roc-db": "0.2.0-pre.2",
24
24
  "zod": "3.24.2"
25
25
  },
26
26
  "keywords": [],