silosdk 0.0.5 → 0.0.6
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/README.md +2 -1
- package/dist/media.cjs +2 -2
- package/dist/media.mjs +2 -2
- package/dist/source.cjs +2 -2
- package/dist/source.mjs +2 -2
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -11,6 +11,7 @@ Silo owns:
|
|
|
11
11
|
- defaults-first source shape
|
|
12
12
|
- settings storage
|
|
13
13
|
- media file ownership and resolution
|
|
14
|
+
- ID generation through `expo-crypto`
|
|
14
15
|
|
|
15
16
|
TanStack owns:
|
|
16
17
|
|
|
@@ -21,7 +22,7 @@ TanStack owns:
|
|
|
21
22
|
## Install
|
|
22
23
|
|
|
23
24
|
```sh
|
|
24
|
-
yarn add silosdk @tanstack/react-db @tanstack/react-query expo-sqlite expo-file-system
|
|
25
|
+
yarn add silosdk @tanstack/react-db @tanstack/react-query expo-crypto expo-sqlite expo-file-system
|
|
25
26
|
```
|
|
26
27
|
|
|
27
28
|
## Sources
|
package/dist/media.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let expo_crypto = require("expo-crypto");
|
|
2
3
|
let expo_sqlite = require("expo-sqlite");
|
|
3
|
-
let nanoid = require("nanoid");
|
|
4
4
|
let __tanstack_react_query = require("@tanstack/react-query");
|
|
5
5
|
let expo_file_system = require("expo-file-system");
|
|
6
6
|
|
|
@@ -39,7 +39,7 @@ function mediaQueryKey(ref) {
|
|
|
39
39
|
}
|
|
40
40
|
async function importMedia(input) {
|
|
41
41
|
assertMediaKind(input.kind);
|
|
42
|
-
const id = (0,
|
|
42
|
+
const id = (0, expo_crypto.randomUUID)();
|
|
43
43
|
const ref = createMediaRef(input.kind, id);
|
|
44
44
|
const source = new expo_file_system.File(input.uri);
|
|
45
45
|
const name = input.name ?? source.name ?? `${id}${source.extension}`;
|
package/dist/media.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { randomUUID } from "expo-crypto";
|
|
1
2
|
import { openDatabaseSync } from "expo-sqlite";
|
|
2
|
-
import { nanoid } from "nanoid";
|
|
3
3
|
import { mutationOptions, queryOptions } from "@tanstack/react-query";
|
|
4
4
|
import { Directory, File, Paths } from "expo-file-system";
|
|
5
5
|
|
|
@@ -38,7 +38,7 @@ function mediaQueryKey(ref) {
|
|
|
38
38
|
}
|
|
39
39
|
async function importMedia(input) {
|
|
40
40
|
assertMediaKind(input.kind);
|
|
41
|
-
const id =
|
|
41
|
+
const id = randomUUID();
|
|
42
42
|
const ref = createMediaRef(input.kind, id);
|
|
43
43
|
const source = new File(input.uri);
|
|
44
44
|
const name = input.name ?? source.name ?? `${id}${source.extension}`;
|
package/dist/source.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let expo_crypto = require("expo-crypto");
|
|
2
3
|
let expo_sqlite = require("expo-sqlite");
|
|
3
|
-
let nanoid = require("nanoid");
|
|
4
4
|
|
|
5
5
|
//#region src/source/index.ts
|
|
6
6
|
const sourceNames = /* @__PURE__ */ new Set();
|
|
@@ -12,7 +12,7 @@ const reservedDocumentFields = new Set([
|
|
|
12
12
|
]);
|
|
13
13
|
const deletedDocs = /* @__PURE__ */ new WeakSet();
|
|
14
14
|
function createID() {
|
|
15
|
-
return (0,
|
|
15
|
+
return (0, expo_crypto.randomUUID)();
|
|
16
16
|
}
|
|
17
17
|
function source(name, defaults) {
|
|
18
18
|
assertSourceName(name);
|
package/dist/source.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { randomUUID } from "expo-crypto";
|
|
1
2
|
import { openDatabaseSync } from "expo-sqlite";
|
|
2
|
-
import { nanoid } from "nanoid";
|
|
3
3
|
|
|
4
4
|
//#region src/source/index.ts
|
|
5
5
|
const sourceNames = /* @__PURE__ */ new Set();
|
|
@@ -11,7 +11,7 @@ const reservedDocumentFields = new Set([
|
|
|
11
11
|
]);
|
|
12
12
|
const deletedDocs = /* @__PURE__ */ new WeakSet();
|
|
13
13
|
function createID() {
|
|
14
|
-
return
|
|
14
|
+
return randomUUID();
|
|
15
15
|
}
|
|
16
16
|
function source(name, defaults) {
|
|
17
17
|
assertSourceName(name);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "silosdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsdown",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"@tanstack/react-query": "^5.101.0",
|
|
18
18
|
"@types/node": "^25.3.0",
|
|
19
19
|
"@types/react": "^19",
|
|
20
|
+
"expo-crypto": "^56.0.4",
|
|
20
21
|
"expo-file-system": "^56.0.8",
|
|
21
22
|
"expo-sqlite": "*",
|
|
22
23
|
"prettier": "^3.7.4",
|
|
@@ -26,12 +27,12 @@
|
|
|
26
27
|
"vitest": "^4.0.18"
|
|
27
28
|
},
|
|
28
29
|
"dependencies": {
|
|
29
|
-
"@standard-schema/spec": "^1.0.0"
|
|
30
|
-
"nanoid": "5.1.6"
|
|
30
|
+
"@standard-schema/spec": "^1.0.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@tanstack/react-db": "^0.1.86",
|
|
34
34
|
"@tanstack/react-query": "^5.101.0",
|
|
35
|
+
"expo-crypto": "^56.0.4",
|
|
35
36
|
"expo-file-system": "^56.0.8",
|
|
36
37
|
"expo-sqlite": "*",
|
|
37
38
|
"react": "^19",
|