@use-stall/core 0.0.7 → 0.0.8
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/index.js +7 -8
- package/dist/index.mjs +1 -2
- package/package.json +5 -7
package/dist/index.js
CHANGED
|
@@ -134,10 +134,9 @@ var getAdapter = async (sdk, force) => {
|
|
|
134
134
|
};
|
|
135
135
|
|
|
136
136
|
// src/db/helpers.ts
|
|
137
|
-
var
|
|
138
|
-
var uuid = () => (0, import_crypto.randomUUID)();
|
|
137
|
+
var import_uuid = require("uuid");
|
|
139
138
|
var generate_offline_id = (table) => {
|
|
140
|
-
return `stall_${table}_${
|
|
139
|
+
return `stall_${table}_${(0, import_uuid.v4)()}_${Date.now()}`;
|
|
141
140
|
};
|
|
142
141
|
var save_bulk_data = async (props) => {
|
|
143
142
|
await local_db.transaction("rw", props.table, async () => {
|
|
@@ -149,7 +148,7 @@ var save_bulk_data = async (props) => {
|
|
|
149
148
|
};
|
|
150
149
|
var add_to_sync_queue = async (props) => {
|
|
151
150
|
const queue_item = {
|
|
152
|
-
id:
|
|
151
|
+
id: (0, import_uuid.v4)(),
|
|
153
152
|
action: props.action,
|
|
154
153
|
table: props.table,
|
|
155
154
|
document_id: props.document_id,
|
|
@@ -191,7 +190,7 @@ var remove_from_sync_queue = async (id) => {
|
|
|
191
190
|
};
|
|
192
191
|
var add_sync_log = async (props) => {
|
|
193
192
|
const log = {
|
|
194
|
-
id:
|
|
193
|
+
id: (0, import_uuid.v4)(),
|
|
195
194
|
sync_batch_id: props.sync_batch_id,
|
|
196
195
|
table: props.table,
|
|
197
196
|
action: props.action,
|
|
@@ -3753,7 +3752,7 @@ var fulfillments = {
|
|
|
3753
3752
|
};
|
|
3754
3753
|
|
|
3755
3754
|
// src/services/sync/sync.service.ts
|
|
3756
|
-
var
|
|
3755
|
+
var import_uuid2 = require("uuid");
|
|
3757
3756
|
|
|
3758
3757
|
// src/services/sync/sync-dependencies.ts
|
|
3759
3758
|
var SYNC_DEPENDENCY_LAYERS = {
|
|
@@ -3985,7 +3984,7 @@ var sync_queue_item = async (props) => {
|
|
|
3985
3984
|
};
|
|
3986
3985
|
var process_sync_queue = async (props) => {
|
|
3987
3986
|
const { sdk } = props;
|
|
3988
|
-
const sync_batch_id = (0,
|
|
3987
|
+
const sync_batch_id = (0, import_uuid2.v4)();
|
|
3989
3988
|
try {
|
|
3990
3989
|
const pending_items_by_table = await get_pending_sync_queue();
|
|
3991
3990
|
if (pending_items_by_table.size === 0) {
|
|
@@ -4142,7 +4141,7 @@ var trigger_sync = async (props) => {
|
|
|
4142
4141
|
} catch (error) {
|
|
4143
4142
|
console.error("Error triggering sync:", error);
|
|
4144
4143
|
return {
|
|
4145
|
-
sync_batch_id: (0,
|
|
4144
|
+
sync_batch_id: (0, import_uuid2.v4)(),
|
|
4146
4145
|
total: 0,
|
|
4147
4146
|
synced: 0,
|
|
4148
4147
|
failed: 0,
|
package/dist/index.mjs
CHANGED
|
@@ -70,8 +70,7 @@ var getAdapter = async (sdk, force) => {
|
|
|
70
70
|
};
|
|
71
71
|
|
|
72
72
|
// src/db/helpers.ts
|
|
73
|
-
import {
|
|
74
|
-
var uuid = () => randomUUID();
|
|
73
|
+
import { v4 as uuid } from "uuid";
|
|
75
74
|
var generate_offline_id = (table) => {
|
|
76
75
|
return `stall_${table}_${uuid()}_${Date.now()}`;
|
|
77
76
|
};
|
package/package.json
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@use-stall/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"author": "Stall",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
7
|
-
"type": "commonjs",
|
|
8
|
-
"types": "./dist/index.d.ts",
|
|
9
7
|
"devDependencies": {
|
|
10
8
|
"@types/node": "^24.10.2",
|
|
11
9
|
"@use-stall/types": "^0.2.9",
|
|
12
10
|
"dexie": "^4.2.1",
|
|
13
11
|
"tsup": "^8.5.1",
|
|
14
|
-
"typescript": "^5.9.3"
|
|
12
|
+
"typescript": "^5.9.3",
|
|
13
|
+
"uuid": "^13.0.0"
|
|
15
14
|
},
|
|
16
15
|
"description": "Stall core package with all the utilities needed to access the Stall API",
|
|
17
16
|
"homepage": "https://github.com/use-stall/core",
|
|
@@ -26,7 +25,6 @@
|
|
|
26
25
|
"scripts": {
|
|
27
26
|
"build": "tsup"
|
|
28
27
|
},
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
}
|
|
28
|
+
"type": "commonjs",
|
|
29
|
+
"types": "./dist/index.d.ts"
|
|
32
30
|
}
|