@livestore/common 0.0.48-dev.3 → 0.0.48-dev.5
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/.tsbuildinfo +1 -1
- package/dist/derived-mutations.d.ts +8 -8
- package/dist/sync/sync.d.ts +1 -1
- package/dist/sync/sync.d.ts.map +1 -1
- package/dist/sync/sync.js.map +1 -1
- package/package.json +3 -3
- package/src/sync/sync.ts +2 -1
|
@@ -15,19 +15,19 @@ export declare const makeDerivedMutationDefsForTable: <TTableDef extends DbSchem
|
|
|
15
15
|
readonly [x: string]: any;
|
|
16
16
|
}>;
|
|
17
17
|
update: import("./schema/mutations.js").MutationDef<`_Derived_Update_${string}`, {
|
|
18
|
-
readonly values: {
|
|
19
|
-
[x: string]: any;
|
|
20
|
-
};
|
|
21
18
|
readonly where: {
|
|
22
19
|
[x: string]: any;
|
|
23
20
|
};
|
|
24
|
-
}, {
|
|
25
21
|
readonly values: {
|
|
26
22
|
[x: string]: any;
|
|
27
23
|
};
|
|
24
|
+
}, {
|
|
28
25
|
readonly where: {
|
|
29
26
|
[x: string]: any;
|
|
30
27
|
};
|
|
28
|
+
readonly values: {
|
|
29
|
+
[x: string]: any;
|
|
30
|
+
};
|
|
31
31
|
}>;
|
|
32
32
|
delete: import("./schema/mutations.js").MutationDef<`_Derived_Delete_${string}`, {
|
|
33
33
|
readonly where: {
|
|
@@ -53,19 +53,19 @@ export declare const deriveUpdateMutationDef: <TTableDef extends DbSchema.TableD
|
|
|
53
53
|
enabled: true;
|
|
54
54
|
};
|
|
55
55
|
}, Schema.Schema<any, any, never>>>(table: TTableDef) => import("./schema/mutations.js").MutationDef<`_Derived_Update_${string}`, {
|
|
56
|
-
readonly values: {
|
|
57
|
-
[x: string]: any;
|
|
58
|
-
};
|
|
59
56
|
readonly where: {
|
|
60
57
|
[x: string]: any;
|
|
61
58
|
};
|
|
62
|
-
}, {
|
|
63
59
|
readonly values: {
|
|
64
60
|
[x: string]: any;
|
|
65
61
|
};
|
|
62
|
+
}, {
|
|
66
63
|
readonly where: {
|
|
67
64
|
[x: string]: any;
|
|
68
65
|
};
|
|
66
|
+
readonly values: {
|
|
67
|
+
[x: string]: any;
|
|
68
|
+
};
|
|
69
69
|
}>;
|
|
70
70
|
export declare const deriveDeleteMutationDef: <TTableDef extends DbSchema.TableDef<DbSchema.DefaultSqliteTableDefConstrained, boolean, TableOptions & {
|
|
71
71
|
deriveMutations: {
|
package/dist/sync/sync.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { type Effect, Schema, type Stream, type SubscriptionRef } from '@livesto
|
|
|
2
2
|
import type { MutationEvent } from '../schema/mutations.js';
|
|
3
3
|
export type SyncImpl = {
|
|
4
4
|
pull: (cursor: string | undefined) => Stream.Stream<MutationEvent.AnyEncoded, IsOfflineError | InvalidPullError>;
|
|
5
|
-
push: (mutationEvent: MutationEvent.AnyEncoded) => Effect.Effect<void, IsOfflineError | InvalidPushError>;
|
|
6
5
|
pushes: Stream.Stream<MutationEvent.AnyEncoded>;
|
|
6
|
+
push: (mutationEvent: MutationEvent.AnyEncoded) => Effect.Effect<void, IsOfflineError | InvalidPushError>;
|
|
7
7
|
isConnected: SubscriptionRef.SubscriptionRef<boolean>;
|
|
8
8
|
};
|
|
9
9
|
declare const IsOfflineError_base: Schema.TaggedErrorClass<IsOfflineError, "IsOfflineError", {
|
package/dist/sync/sync.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/sync/sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAEhG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAE3D,MAAM,MAAM,QAAQ,GAAG;
|
|
1
|
+
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/sync/sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAEhG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAE3D,MAAM,MAAM,QAAQ,GAAG;IAErB,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,KAAK,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,UAAU,EAAE,cAAc,GAAG,gBAAgB,CAAC,CAAA;IAChH,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,CAAA;IAC/C,IAAI,EAAE,CAAC,aAAa,EAAE,aAAa,CAAC,UAAU,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,cAAc,GAAG,gBAAgB,CAAC,CAAA;IACzG,WAAW,EAAE,eAAe,CAAC,eAAe,CAAC,OAAO,CAAC,CAAA;CACtD,CAAA;;;;AAED,qBAAa,cAAe,SAAQ,mBAA0D;CAAG;;;;;;AACjG,qBAAa,gBAAiB,SAAQ,qBAEpC;CAAG;;;;;;AACL,qBAAa,gBAAiB,SAAQ,qBAEpC;CAAG"}
|
package/dist/sync/sync.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.js","sourceRoot":"","sources":["../../src/sync/sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,EAAqC,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"sync.js","sourceRoot":"","sources":["../../src/sync/sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,EAAqC,MAAM,yBAAyB,CAAA;AAYhG,MAAM,OAAO,cAAe,SAAQ,MAAM,CAAC,WAAW,EAAkB,CAAC,gBAAgB,EAAE,EAAE,CAAC;CAAG;AACjG,MAAM,OAAO,gBAAiB,SAAQ,MAAM,CAAC,WAAW,EAAoB,CAAC,kBAAkB,EAAE;IAC/F,OAAO,EAAE,MAAM,CAAC,MAAM;CACvB,CAAC;CAAG;AACL,MAAM,OAAO,gBAAiB,SAAQ,MAAM,CAAC,WAAW,EAAoB,CAAC,kBAAkB,EAAE;IAC/F,OAAO,EAAE,MAAM,CAAC,MAAM;CACvB,CAAC;CAAG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livestore/common",
|
|
3
|
-
"version": "0.0.48-dev.
|
|
3
|
+
"version": "0.0.48-dev.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@opentelemetry/api": "^1.9.0",
|
|
32
|
-
"
|
|
33
|
-
"
|
|
32
|
+
"effect-db-schema": "0.0.48-dev.5",
|
|
33
|
+
"@livestore/utils": "0.0.48-dev.5"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"vitest": "^1.6.0"
|
package/src/sync/sync.ts
CHANGED
|
@@ -3,9 +3,10 @@ import { type Effect, Schema, type Stream, type SubscriptionRef } from '@livesto
|
|
|
3
3
|
import type { MutationEvent } from '../schema/mutations.js'
|
|
4
4
|
|
|
5
5
|
export type SyncImpl = {
|
|
6
|
+
// TODO consider unifying `pull` and `pushed` into a single stream with a "marker event" after the initial loading is completed
|
|
6
7
|
pull: (cursor: string | undefined) => Stream.Stream<MutationEvent.AnyEncoded, IsOfflineError | InvalidPullError>
|
|
7
|
-
push: (mutationEvent: MutationEvent.AnyEncoded) => Effect.Effect<void, IsOfflineError | InvalidPushError>
|
|
8
8
|
pushes: Stream.Stream<MutationEvent.AnyEncoded>
|
|
9
|
+
push: (mutationEvent: MutationEvent.AnyEncoded) => Effect.Effect<void, IsOfflineError | InvalidPushError>
|
|
9
10
|
isConnected: SubscriptionRef.SubscriptionRef<boolean>
|
|
10
11
|
}
|
|
11
12
|
|