@webority-technologies/mobile-core 0.0.6 → 0.0.7
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/android/build.gradle +65 -0
- package/android/src/newarch/java/com/webority/mobilecore/smsretriever/AppSignatureHelper.kt +57 -0
- package/android/src/newarch/java/com/webority/mobilecore/smsretriever/SmsRetrieverModule.kt +20 -0
- package/android/src/newarch/java/com/webority/mobilecore/smsretriever/SmsRetrieverModuleImpl.kt +146 -0
- package/android/src/newarch/java/com/webority/mobilecore/smsretriever/SmsRetrieverPackage.kt +33 -0
- package/lib/commonjs/formatters/dateMath.js +4 -4
- package/lib/commonjs/formatters/windowsToIanaTable.js +164 -0
- package/lib/commonjs/geolocation/index.js +1 -1
- package/lib/commonjs/permissions/index.js +128 -129
- package/lib/commonjs/smsRetriever/index.js +91 -0
- package/lib/commonjs/specs/NativeSmsRetriever.js +15 -0
- package/lib/commonjs/sqlite/index.js +12 -30
- package/lib/module/formatters/dateMath.js +4 -4
- package/lib/module/formatters/windowsToIanaTable.js +160 -0
- package/lib/module/geolocation/index.js +1 -1
- package/lib/module/index.js +3 -2
- package/lib/module/permissions/index.js +129 -130
- package/lib/module/smsRetriever/index.js +86 -0
- package/lib/module/specs/NativeSmsRetriever.js +13 -0
- package/lib/module/sqlite/index.js +12 -30
- package/lib/typescript/commonjs/formatters/windowsToIanaTable.d.ts +18 -0
- package/lib/typescript/commonjs/index.d.ts +3 -2
- package/lib/typescript/commonjs/permissions/index.d.ts +14 -36
- package/lib/typescript/commonjs/smsRetriever/index.d.ts +30 -0
- package/lib/typescript/commonjs/specs/NativeSmsRetriever.d.ts +15 -0
- package/lib/typescript/commonjs/sqlite/index.d.ts +10 -18
- package/lib/typescript/module/formatters/windowsToIanaTable.d.ts +18 -0
- package/lib/typescript/module/index.d.ts +3 -2
- package/lib/typescript/module/permissions/index.d.ts +14 -36
- package/lib/typescript/module/smsRetriever/index.d.ts +30 -0
- package/lib/typescript/module/specs/NativeSmsRetriever.d.ts +15 -0
- package/lib/typescript/module/sqlite/index.d.ts +10 -18
- package/package.json +31 -49
- package/lib/commonjs/sqlite/adapters/op.js +0 -43
- package/lib/commonjs/sqlite/adapters/rows.js +0 -33
- package/lib/commonjs/sqlite/adapters/storage.js +0 -50
- package/lib/commonjs/sqlite/adapters/sync.js +0 -45
- package/lib/commonjs/sqlite/nitro.js +0 -17
- package/lib/commonjs/sqlite/op.js +0 -18
- package/lib/commonjs/sqlite/quick.js +0 -14
- package/lib/commonjs/sqlite/storage.js +0 -14
- package/lib/module/sqlite/adapters/op.js +0 -38
- package/lib/module/sqlite/adapters/rows.js +0 -28
- package/lib/module/sqlite/adapters/storage.js +0 -46
- package/lib/module/sqlite/adapters/sync.js +0 -41
- package/lib/module/sqlite/nitro.js +0 -12
- package/lib/module/sqlite/op.js +0 -13
- package/lib/module/sqlite/quick.js +0 -9
- package/lib/module/sqlite/storage.js +0 -9
- package/lib/typescript/commonjs/sqlite/adapters/op.d.ts +0 -27
- package/lib/typescript/commonjs/sqlite/adapters/rows.d.ts +0 -7
- package/lib/typescript/commonjs/sqlite/adapters/storage.d.ts +0 -30
- package/lib/typescript/commonjs/sqlite/adapters/sync.d.ts +0 -31
- package/lib/typescript/commonjs/sqlite/nitro.d.ts +0 -7
- package/lib/typescript/commonjs/sqlite/op.d.ts +0 -8
- package/lib/typescript/commonjs/sqlite/quick.d.ts +0 -4
- package/lib/typescript/commonjs/sqlite/storage.d.ts +0 -4
- package/lib/typescript/module/sqlite/adapters/op.d.ts +0 -27
- package/lib/typescript/module/sqlite/adapters/rows.d.ts +0 -7
- package/lib/typescript/module/sqlite/adapters/storage.d.ts +0 -30
- package/lib/typescript/module/sqlite/adapters/sync.d.ts +0 -31
- package/lib/typescript/module/sqlite/nitro.d.ts +0 -7
- package/lib/typescript/module/sqlite/op.d.ts +0 -8
- package/lib/typescript/module/sqlite/quick.d.ts +0 -4
- package/lib/typescript/module/sqlite/storage.d.ts +0 -4
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.rowsToArray = void 0;
|
|
7
|
-
/**
|
|
8
|
-
* Row shapes differ per driver: a plain array, `{ _array, length, item() }`, or
|
|
9
|
-
* `{ length, item() }` alone. Every adapter normalises to a plain array here so
|
|
10
|
-
* nothing driver-specific escapes into the Db layer.
|
|
11
|
-
*/
|
|
12
|
-
const rowsToArray = rows => {
|
|
13
|
-
if (Array.isArray(rows)) {
|
|
14
|
-
return rows;
|
|
15
|
-
}
|
|
16
|
-
const shaped = rows;
|
|
17
|
-
if (!shaped) {
|
|
18
|
-
return [];
|
|
19
|
-
}
|
|
20
|
-
if (Array.isArray(shaped._array)) {
|
|
21
|
-
return shaped._array;
|
|
22
|
-
}
|
|
23
|
-
if (typeof shaped.item === 'function' && typeof shaped.length === 'number') {
|
|
24
|
-
const out = [];
|
|
25
|
-
for (let i = 0; i < shaped.length; i += 1) {
|
|
26
|
-
out.push(shaped.item(i));
|
|
27
|
-
}
|
|
28
|
-
return out;
|
|
29
|
-
}
|
|
30
|
-
return [];
|
|
31
|
-
};
|
|
32
|
-
exports.rowsToArray = rowsToArray;
|
|
33
|
-
//# sourceMappingURL=rows.js.map
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.adaptSqliteStorage = void 0;
|
|
7
|
-
var _rows = require("./rows.js");
|
|
8
|
-
/** react-native-sqlite-storage: callback-based by default, promise-based once
|
|
9
|
-
* `enablePromise(true)` is called; `executeSql` resolves an array whose first
|
|
10
|
-
* element is the result set. */
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Adapt an already-required `react-native-sqlite-storage` module. Exported for
|
|
14
|
-
* the same reason as the filesystem adapters: the library cannot name a package
|
|
15
|
-
* the app did not install without breaking the app's bundle.
|
|
16
|
-
*/
|
|
17
|
-
const adaptSqliteStorage = mod => ({
|
|
18
|
-
open: async (name, options) => {
|
|
19
|
-
// This is a GLOBAL side effect, not a per-connection setting: the vendor
|
|
20
|
-
// implements it by rewriting SQLitePlugin and SQLiteFactory prototype
|
|
21
|
-
// methods. An app that also uses react-native-sqlite-storage directly in
|
|
22
|
-
// callback mode will find its own callbacks converted to promises from the
|
|
23
|
-
// moment this adapter opens a database. Unavoidable, since the adapter
|
|
24
|
-
// cannot work otherwise, and worth knowing before mixing the two.
|
|
25
|
-
mod.enablePromise(true);
|
|
26
|
-
const db = await mod.openDatabase({
|
|
27
|
-
name,
|
|
28
|
-
location: options?.location ?? 'default'
|
|
29
|
-
});
|
|
30
|
-
return {
|
|
31
|
-
execute: async (sql, params) => {
|
|
32
|
-
const [result] = await db.executeSql(sql, params ? [...params] : undefined);
|
|
33
|
-
return {
|
|
34
|
-
rows: (0, _rows.rowsToArray)(result.rows),
|
|
35
|
-
rowsAffected: result.rowsAffected ?? 0,
|
|
36
|
-
insertId: result.insertId
|
|
37
|
-
};
|
|
38
|
-
},
|
|
39
|
-
// Not `() => db.close()`: in promise mode this driver resolves the
|
|
40
|
-
// success-callback ARGUMENTS array rather than void, so returning it
|
|
41
|
-
// directly would make SqliteDatabase.close() resolve an array while
|
|
42
|
-
// typed as void. Awaiting and discarding makes the type honest.
|
|
43
|
-
close: async () => {
|
|
44
|
-
await db.close();
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
exports.adaptSqliteStorage = adaptSqliteStorage;
|
|
50
|
-
//# sourceMappingURL=storage.js.map
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.adaptSyncSqlite = void 0;
|
|
7
|
-
var _rows = require("./rows.js");
|
|
8
|
-
/**
|
|
9
|
-
* nitro-sqlite and quick-sqlite share one synchronous shape, so one adapter
|
|
10
|
-
* serves both. The REQUIRE lives in the driver entry points beside this file,
|
|
11
|
-
* never here and never in the core: Metro resolves requires statically, so a
|
|
12
|
-
* package named anywhere reachable becomes mandatory for every consumer.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/** Shape shared by react-native-nitro-sqlite and react-native-quick-sqlite: a
|
|
16
|
-
* synchronous `open({ name, location })` whose `db.execute()` and `db.close()`
|
|
17
|
-
* are also synchronous. Both are wrapped in Promise.resolve to fit SqliteDriver. */
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Adapt an already-required nitro-sqlite or quick-sqlite module. Both expose the
|
|
21
|
-
* same synchronous shape. Exported so an app on quick-sqlite can inject it.
|
|
22
|
-
*/
|
|
23
|
-
const adaptSyncSqlite = mod => ({
|
|
24
|
-
open: async (name, options) => {
|
|
25
|
-
const db = mod.open({
|
|
26
|
-
name,
|
|
27
|
-
location: options?.location
|
|
28
|
-
});
|
|
29
|
-
return {
|
|
30
|
-
execute: async (sql, params) => {
|
|
31
|
-
const result = db.execute(sql, params ? [...params] : undefined);
|
|
32
|
-
return {
|
|
33
|
-
rows: (0, _rows.rowsToArray)(result.rows),
|
|
34
|
-
rowsAffected: result.rowsAffected ?? 0,
|
|
35
|
-
insertId: result.insertId
|
|
36
|
-
};
|
|
37
|
-
},
|
|
38
|
-
close: async () => {
|
|
39
|
-
db.close();
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
exports.adaptSyncSqlite = adaptSyncSqlite;
|
|
45
|
-
//# sourceMappingURL=sync.js.map
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.nitroSqliteDriver = void 0;
|
|
7
|
-
var _sync = require("./adapters/sync.js");
|
|
8
|
-
/**
|
|
9
|
-
* The one place `react-native-nitro-sqlite` is named. Import this module only if
|
|
10
|
-
* you installed it; nothing else in the library reaches it.
|
|
11
|
-
*/
|
|
12
|
-
const nitroSqliteDriver = () => {
|
|
13
|
-
const mod = require('react-native-nitro-sqlite');
|
|
14
|
-
return (0, _sync.adaptSyncSqlite)(mod.default ?? mod);
|
|
15
|
-
};
|
|
16
|
-
exports.nitroSqliteDriver = nitroSqliteDriver;
|
|
17
|
-
//# sourceMappingURL=nitro.js.map
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.opSqliteDriver = void 0;
|
|
7
|
-
var _op = require("./adapters/op.js");
|
|
8
|
-
/**
|
|
9
|
-
* The one place `@op-engineering/op-sqlite` is named. It is the driver we
|
|
10
|
-
* recommend: the most actively maintained of the four, and the only one already
|
|
11
|
-
* proven in one of our apps. Import this module only if you installed it.
|
|
12
|
-
*/
|
|
13
|
-
const opSqliteDriver = () => {
|
|
14
|
-
const mod = require('@op-engineering/op-sqlite');
|
|
15
|
-
return (0, _op.adaptOpSqlite)(mod.default ?? mod);
|
|
16
|
-
};
|
|
17
|
-
exports.opSqliteDriver = opSqliteDriver;
|
|
18
|
-
//# sourceMappingURL=op.js.map
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.quickSqliteDriver = void 0;
|
|
7
|
-
var _sync = require("./adapters/sync.js");
|
|
8
|
-
/** The one place `react-native-quick-sqlite` is named. */
|
|
9
|
-
const quickSqliteDriver = () => {
|
|
10
|
-
const mod = require('react-native-quick-sqlite');
|
|
11
|
-
return (0, _sync.adaptSyncSqlite)(mod.default ?? mod);
|
|
12
|
-
};
|
|
13
|
-
exports.quickSqliteDriver = quickSqliteDriver;
|
|
14
|
-
//# sourceMappingURL=quick.js.map
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.sqliteStorageDriver = void 0;
|
|
7
|
-
var _storage = require("./adapters/storage.js");
|
|
8
|
-
/** The one place `react-native-sqlite-storage` is named. */
|
|
9
|
-
const sqliteStorageDriver = () => {
|
|
10
|
-
const mod = require('react-native-sqlite-storage');
|
|
11
|
-
return (0, _storage.adaptSqliteStorage)(mod.default ?? mod);
|
|
12
|
-
};
|
|
13
|
-
exports.sqliteStorageDriver = sqliteStorageDriver;
|
|
14
|
-
//# sourceMappingURL=storage.js.map
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @op-engineering/op-sqlite. Shape verified against 18.1.4 rather than assumed:
|
|
5
|
-
* `open({ name, location })` is synchronous and returns a DB whose `execute` is
|
|
6
|
-
* ASYNC, and whose `rows` is already a plain array of objects rather than the
|
|
7
|
-
* `{ _array, item() }` shape the older drivers use. Both differences are why it
|
|
8
|
-
* cannot share the sync adapter.
|
|
9
|
-
*
|
|
10
|
-
* The REQUIRE lives in the driver entry point beside this file, never here.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
export const adaptOpSqlite = mod => ({
|
|
14
|
-
open: async (name, options) => {
|
|
15
|
-
const db = mod.open({
|
|
16
|
-
name,
|
|
17
|
-
location: options?.location
|
|
18
|
-
});
|
|
19
|
-
return {
|
|
20
|
-
execute: async (sql, params) => {
|
|
21
|
-
const result = await db.execute(sql, params ? [...params] : undefined);
|
|
22
|
-
return {
|
|
23
|
-
rows: result.rows ?? [],
|
|
24
|
-
rowsAffected: result.rowsAffected ?? 0,
|
|
25
|
-
insertId: result.insertId
|
|
26
|
-
};
|
|
27
|
-
},
|
|
28
|
-
close: async () => {
|
|
29
|
-
if (db.closeAsync) {
|
|
30
|
-
await db.closeAsync();
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
db.close();
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
//# sourceMappingURL=op.js.map
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Row shapes differ per driver: a plain array, `{ _array, length, item() }`, or
|
|
5
|
-
* `{ length, item() }` alone. Every adapter normalises to a plain array here so
|
|
6
|
-
* nothing driver-specific escapes into the Db layer.
|
|
7
|
-
*/
|
|
8
|
-
export const rowsToArray = rows => {
|
|
9
|
-
if (Array.isArray(rows)) {
|
|
10
|
-
return rows;
|
|
11
|
-
}
|
|
12
|
-
const shaped = rows;
|
|
13
|
-
if (!shaped) {
|
|
14
|
-
return [];
|
|
15
|
-
}
|
|
16
|
-
if (Array.isArray(shaped._array)) {
|
|
17
|
-
return shaped._array;
|
|
18
|
-
}
|
|
19
|
-
if (typeof shaped.item === 'function' && typeof shaped.length === 'number') {
|
|
20
|
-
const out = [];
|
|
21
|
-
for (let i = 0; i < shaped.length; i += 1) {
|
|
22
|
-
out.push(shaped.item(i));
|
|
23
|
-
}
|
|
24
|
-
return out;
|
|
25
|
-
}
|
|
26
|
-
return [];
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=rows.js.map
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { rowsToArray } from "./rows.js";
|
|
4
|
-
|
|
5
|
-
/** react-native-sqlite-storage: callback-based by default, promise-based once
|
|
6
|
-
* `enablePromise(true)` is called; `executeSql` resolves an array whose first
|
|
7
|
-
* element is the result set. */
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Adapt an already-required `react-native-sqlite-storage` module. Exported for
|
|
11
|
-
* the same reason as the filesystem adapters: the library cannot name a package
|
|
12
|
-
* the app did not install without breaking the app's bundle.
|
|
13
|
-
*/
|
|
14
|
-
export const adaptSqliteStorage = mod => ({
|
|
15
|
-
open: async (name, options) => {
|
|
16
|
-
// This is a GLOBAL side effect, not a per-connection setting: the vendor
|
|
17
|
-
// implements it by rewriting SQLitePlugin and SQLiteFactory prototype
|
|
18
|
-
// methods. An app that also uses react-native-sqlite-storage directly in
|
|
19
|
-
// callback mode will find its own callbacks converted to promises from the
|
|
20
|
-
// moment this adapter opens a database. Unavoidable, since the adapter
|
|
21
|
-
// cannot work otherwise, and worth knowing before mixing the two.
|
|
22
|
-
mod.enablePromise(true);
|
|
23
|
-
const db = await mod.openDatabase({
|
|
24
|
-
name,
|
|
25
|
-
location: options?.location ?? 'default'
|
|
26
|
-
});
|
|
27
|
-
return {
|
|
28
|
-
execute: async (sql, params) => {
|
|
29
|
-
const [result] = await db.executeSql(sql, params ? [...params] : undefined);
|
|
30
|
-
return {
|
|
31
|
-
rows: rowsToArray(result.rows),
|
|
32
|
-
rowsAffected: result.rowsAffected ?? 0,
|
|
33
|
-
insertId: result.insertId
|
|
34
|
-
};
|
|
35
|
-
},
|
|
36
|
-
// Not `() => db.close()`: in promise mode this driver resolves the
|
|
37
|
-
// success-callback ARGUMENTS array rather than void, so returning it
|
|
38
|
-
// directly would make SqliteDatabase.close() resolve an array while
|
|
39
|
-
// typed as void. Awaiting and discarding makes the type honest.
|
|
40
|
-
close: async () => {
|
|
41
|
-
await db.close();
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
//# sourceMappingURL=storage.js.map
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { rowsToArray } from "./rows.js";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* nitro-sqlite and quick-sqlite share one synchronous shape, so one adapter
|
|
7
|
-
* serves both. The REQUIRE lives in the driver entry points beside this file,
|
|
8
|
-
* never here and never in the core: Metro resolves requires statically, so a
|
|
9
|
-
* package named anywhere reachable becomes mandatory for every consumer.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
/** Shape shared by react-native-nitro-sqlite and react-native-quick-sqlite: a
|
|
13
|
-
* synchronous `open({ name, location })` whose `db.execute()` and `db.close()`
|
|
14
|
-
* are also synchronous. Both are wrapped in Promise.resolve to fit SqliteDriver. */
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Adapt an already-required nitro-sqlite or quick-sqlite module. Both expose the
|
|
18
|
-
* same synchronous shape. Exported so an app on quick-sqlite can inject it.
|
|
19
|
-
*/
|
|
20
|
-
export const adaptSyncSqlite = mod => ({
|
|
21
|
-
open: async (name, options) => {
|
|
22
|
-
const db = mod.open({
|
|
23
|
-
name,
|
|
24
|
-
location: options?.location
|
|
25
|
-
});
|
|
26
|
-
return {
|
|
27
|
-
execute: async (sql, params) => {
|
|
28
|
-
const result = db.execute(sql, params ? [...params] : undefined);
|
|
29
|
-
return {
|
|
30
|
-
rows: rowsToArray(result.rows),
|
|
31
|
-
rowsAffected: result.rowsAffected ?? 0,
|
|
32
|
-
insertId: result.insertId
|
|
33
|
-
};
|
|
34
|
-
},
|
|
35
|
-
close: async () => {
|
|
36
|
-
db.close();
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
//# sourceMappingURL=sync.js.map
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { adaptSyncSqlite } from "./adapters/sync.js";
|
|
4
|
-
/**
|
|
5
|
-
* The one place `react-native-nitro-sqlite` is named. Import this module only if
|
|
6
|
-
* you installed it; nothing else in the library reaches it.
|
|
7
|
-
*/
|
|
8
|
-
export const nitroSqliteDriver = () => {
|
|
9
|
-
const mod = require('react-native-nitro-sqlite');
|
|
10
|
-
return adaptSyncSqlite(mod.default ?? mod);
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=nitro.js.map
|
package/lib/module/sqlite/op.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { adaptOpSqlite } from "./adapters/op.js";
|
|
4
|
-
/**
|
|
5
|
-
* The one place `@op-engineering/op-sqlite` is named. It is the driver we
|
|
6
|
-
* recommend: the most actively maintained of the four, and the only one already
|
|
7
|
-
* proven in one of our apps. Import this module only if you installed it.
|
|
8
|
-
*/
|
|
9
|
-
export const opSqliteDriver = () => {
|
|
10
|
-
const mod = require('@op-engineering/op-sqlite');
|
|
11
|
-
return adaptOpSqlite(mod.default ?? mod);
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=op.js.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { adaptSyncSqlite } from "./adapters/sync.js";
|
|
4
|
-
/** The one place `react-native-quick-sqlite` is named. */
|
|
5
|
-
export const quickSqliteDriver = () => {
|
|
6
|
-
const mod = require('react-native-quick-sqlite');
|
|
7
|
-
return adaptSyncSqlite(mod.default ?? mod);
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=quick.js.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { adaptSqliteStorage } from "./adapters/storage.js";
|
|
4
|
-
/** The one place `react-native-sqlite-storage` is named. */
|
|
5
|
-
export const sqliteStorageDriver = () => {
|
|
6
|
-
const mod = require('react-native-sqlite-storage');
|
|
7
|
-
return adaptSqliteStorage(mod.default ?? mod);
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=storage.js.map
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { SqliteDriver } from '../index';
|
|
2
|
-
/**
|
|
3
|
-
* @op-engineering/op-sqlite. Shape verified against 18.1.4 rather than assumed:
|
|
4
|
-
* `open({ name, location })` is synchronous and returns a DB whose `execute` is
|
|
5
|
-
* ASYNC, and whose `rows` is already a plain array of objects rather than the
|
|
6
|
-
* `{ _array, item() }` shape the older drivers use. Both differences are why it
|
|
7
|
-
* cannot share the sync adapter.
|
|
8
|
-
*
|
|
9
|
-
* The REQUIRE lives in the driver entry point beside this file, never here.
|
|
10
|
-
*/
|
|
11
|
-
export interface OpSqliteQueryResult {
|
|
12
|
-
rows?: Record<string, unknown>[];
|
|
13
|
-
rowsAffected?: number;
|
|
14
|
-
insertId?: number;
|
|
15
|
-
}
|
|
16
|
-
export interface OpSqliteModuleLike {
|
|
17
|
-
open: (options: {
|
|
18
|
-
name: string;
|
|
19
|
-
location?: string;
|
|
20
|
-
}) => {
|
|
21
|
-
execute: (sql: string, params?: unknown[]) => Promise<OpSqliteQueryResult>;
|
|
22
|
-
close: () => void;
|
|
23
|
-
closeAsync?: () => Promise<void>;
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
export declare const adaptOpSqlite: (mod: OpSqliteModuleLike) => SqliteDriver;
|
|
27
|
-
//# sourceMappingURL=op.d.ts.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Row shapes differ per driver: a plain array, `{ _array, length, item() }`, or
|
|
3
|
-
* `{ length, item() }` alone. Every adapter normalises to a plain array here so
|
|
4
|
-
* nothing driver-specific escapes into the Db layer.
|
|
5
|
-
*/
|
|
6
|
-
export declare const rowsToArray: (rows: unknown) => Record<string, unknown>[];
|
|
7
|
-
//# sourceMappingURL=rows.d.ts.map
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { SqliteDriver } from '../index';
|
|
2
|
-
interface SqliteStorageResultSet {
|
|
3
|
-
rows: {
|
|
4
|
-
length: number;
|
|
5
|
-
item: (i: number) => Record<string, unknown>;
|
|
6
|
-
};
|
|
7
|
-
rowsAffected: number;
|
|
8
|
-
insertId?: number;
|
|
9
|
-
}
|
|
10
|
-
/** react-native-sqlite-storage: callback-based by default, promise-based once
|
|
11
|
-
* `enablePromise(true)` is called; `executeSql` resolves an array whose first
|
|
12
|
-
* element is the result set. */
|
|
13
|
-
interface SqliteStorageModuleLike {
|
|
14
|
-
enablePromise: (enabled: boolean) => void;
|
|
15
|
-
openDatabase: (options: {
|
|
16
|
-
name: string;
|
|
17
|
-
location?: string;
|
|
18
|
-
}) => Promise<{
|
|
19
|
-
executeSql: (sql: string, params?: unknown[]) => Promise<[SqliteStorageResultSet]>;
|
|
20
|
-
close: () => Promise<void>;
|
|
21
|
-
}>;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Adapt an already-required `react-native-sqlite-storage` module. Exported for
|
|
25
|
-
* the same reason as the filesystem adapters: the library cannot name a package
|
|
26
|
-
* the app did not install without breaking the app's bundle.
|
|
27
|
-
*/
|
|
28
|
-
export declare const adaptSqliteStorage: (mod: SqliteStorageModuleLike) => SqliteDriver;
|
|
29
|
-
export {};
|
|
30
|
-
//# sourceMappingURL=storage.d.ts.map
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { SqliteDriver } from '../index';
|
|
2
|
-
/**
|
|
3
|
-
* nitro-sqlite and quick-sqlite share one synchronous shape, so one adapter
|
|
4
|
-
* serves both. The REQUIRE lives in the driver entry points beside this file,
|
|
5
|
-
* never here and never in the core: Metro resolves requires statically, so a
|
|
6
|
-
* package named anywhere reachable becomes mandatory for every consumer.
|
|
7
|
-
*/
|
|
8
|
-
interface SyncQueryResult {
|
|
9
|
-
rows?: unknown;
|
|
10
|
-
rowsAffected?: number;
|
|
11
|
-
insertId?: number;
|
|
12
|
-
}
|
|
13
|
-
/** Shape shared by react-native-nitro-sqlite and react-native-quick-sqlite: a
|
|
14
|
-
* synchronous `open({ name, location })` whose `db.execute()` and `db.close()`
|
|
15
|
-
* are also synchronous. Both are wrapped in Promise.resolve to fit SqliteDriver. */
|
|
16
|
-
interface SyncSqliteModuleLike {
|
|
17
|
-
open: (options: {
|
|
18
|
-
name: string;
|
|
19
|
-
location?: string;
|
|
20
|
-
}) => {
|
|
21
|
-
execute: (sql: string, params?: unknown[]) => SyncQueryResult;
|
|
22
|
-
close: () => void;
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Adapt an already-required nitro-sqlite or quick-sqlite module. Both expose the
|
|
27
|
-
* same synchronous shape. Exported so an app on quick-sqlite can inject it.
|
|
28
|
-
*/
|
|
29
|
-
export declare const adaptSyncSqlite: (mod: SyncSqliteModuleLike) => SqliteDriver;
|
|
30
|
-
export {};
|
|
31
|
-
//# sourceMappingURL=sync.d.ts.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SqliteDriver } from './index';
|
|
2
|
-
/**
|
|
3
|
-
* The one place `react-native-nitro-sqlite` is named. Import this module only if
|
|
4
|
-
* you installed it; nothing else in the library reaches it.
|
|
5
|
-
*/
|
|
6
|
-
export declare const nitroSqliteDriver: () => SqliteDriver;
|
|
7
|
-
//# sourceMappingURL=nitro.d.ts.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { SqliteDriver } from './index';
|
|
2
|
-
/**
|
|
3
|
-
* The one place `@op-engineering/op-sqlite` is named. It is the driver we
|
|
4
|
-
* recommend: the most actively maintained of the four, and the only one already
|
|
5
|
-
* proven in one of our apps. Import this module only if you installed it.
|
|
6
|
-
*/
|
|
7
|
-
export declare const opSqliteDriver: () => SqliteDriver;
|
|
8
|
-
//# sourceMappingURL=op.d.ts.map
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { SqliteDriver } from '../index.js';
|
|
2
|
-
/**
|
|
3
|
-
* @op-engineering/op-sqlite. Shape verified against 18.1.4 rather than assumed:
|
|
4
|
-
* `open({ name, location })` is synchronous and returns a DB whose `execute` is
|
|
5
|
-
* ASYNC, and whose `rows` is already a plain array of objects rather than the
|
|
6
|
-
* `{ _array, item() }` shape the older drivers use. Both differences are why it
|
|
7
|
-
* cannot share the sync adapter.
|
|
8
|
-
*
|
|
9
|
-
* The REQUIRE lives in the driver entry point beside this file, never here.
|
|
10
|
-
*/
|
|
11
|
-
export interface OpSqliteQueryResult {
|
|
12
|
-
rows?: Record<string, unknown>[];
|
|
13
|
-
rowsAffected?: number;
|
|
14
|
-
insertId?: number;
|
|
15
|
-
}
|
|
16
|
-
export interface OpSqliteModuleLike {
|
|
17
|
-
open: (options: {
|
|
18
|
-
name: string;
|
|
19
|
-
location?: string;
|
|
20
|
-
}) => {
|
|
21
|
-
execute: (sql: string, params?: unknown[]) => Promise<OpSqliteQueryResult>;
|
|
22
|
-
close: () => void;
|
|
23
|
-
closeAsync?: () => Promise<void>;
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
export declare const adaptOpSqlite: (mod: OpSqliteModuleLike) => SqliteDriver;
|
|
27
|
-
//# sourceMappingURL=op.d.ts.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Row shapes differ per driver: a plain array, `{ _array, length, item() }`, or
|
|
3
|
-
* `{ length, item() }` alone. Every adapter normalises to a plain array here so
|
|
4
|
-
* nothing driver-specific escapes into the Db layer.
|
|
5
|
-
*/
|
|
6
|
-
export declare const rowsToArray: (rows: unknown) => Record<string, unknown>[];
|
|
7
|
-
//# sourceMappingURL=rows.d.ts.map
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { SqliteDriver } from '../index.js';
|
|
2
|
-
interface SqliteStorageResultSet {
|
|
3
|
-
rows: {
|
|
4
|
-
length: number;
|
|
5
|
-
item: (i: number) => Record<string, unknown>;
|
|
6
|
-
};
|
|
7
|
-
rowsAffected: number;
|
|
8
|
-
insertId?: number;
|
|
9
|
-
}
|
|
10
|
-
/** react-native-sqlite-storage: callback-based by default, promise-based once
|
|
11
|
-
* `enablePromise(true)` is called; `executeSql` resolves an array whose first
|
|
12
|
-
* element is the result set. */
|
|
13
|
-
interface SqliteStorageModuleLike {
|
|
14
|
-
enablePromise: (enabled: boolean) => void;
|
|
15
|
-
openDatabase: (options: {
|
|
16
|
-
name: string;
|
|
17
|
-
location?: string;
|
|
18
|
-
}) => Promise<{
|
|
19
|
-
executeSql: (sql: string, params?: unknown[]) => Promise<[SqliteStorageResultSet]>;
|
|
20
|
-
close: () => Promise<void>;
|
|
21
|
-
}>;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Adapt an already-required `react-native-sqlite-storage` module. Exported for
|
|
25
|
-
* the same reason as the filesystem adapters: the library cannot name a package
|
|
26
|
-
* the app did not install without breaking the app's bundle.
|
|
27
|
-
*/
|
|
28
|
-
export declare const adaptSqliteStorage: (mod: SqliteStorageModuleLike) => SqliteDriver;
|
|
29
|
-
export {};
|
|
30
|
-
//# sourceMappingURL=storage.d.ts.map
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { SqliteDriver } from '../index.js';
|
|
2
|
-
/**
|
|
3
|
-
* nitro-sqlite and quick-sqlite share one synchronous shape, so one adapter
|
|
4
|
-
* serves both. The REQUIRE lives in the driver entry points beside this file,
|
|
5
|
-
* never here and never in the core: Metro resolves requires statically, so a
|
|
6
|
-
* package named anywhere reachable becomes mandatory for every consumer.
|
|
7
|
-
*/
|
|
8
|
-
interface SyncQueryResult {
|
|
9
|
-
rows?: unknown;
|
|
10
|
-
rowsAffected?: number;
|
|
11
|
-
insertId?: number;
|
|
12
|
-
}
|
|
13
|
-
/** Shape shared by react-native-nitro-sqlite and react-native-quick-sqlite: a
|
|
14
|
-
* synchronous `open({ name, location })` whose `db.execute()` and `db.close()`
|
|
15
|
-
* are also synchronous. Both are wrapped in Promise.resolve to fit SqliteDriver. */
|
|
16
|
-
interface SyncSqliteModuleLike {
|
|
17
|
-
open: (options: {
|
|
18
|
-
name: string;
|
|
19
|
-
location?: string;
|
|
20
|
-
}) => {
|
|
21
|
-
execute: (sql: string, params?: unknown[]) => SyncQueryResult;
|
|
22
|
-
close: () => void;
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Adapt an already-required nitro-sqlite or quick-sqlite module. Both expose the
|
|
27
|
-
* same synchronous shape. Exported so an app on quick-sqlite can inject it.
|
|
28
|
-
*/
|
|
29
|
-
export declare const adaptSyncSqlite: (mod: SyncSqliteModuleLike) => SqliteDriver;
|
|
30
|
-
export {};
|
|
31
|
-
//# sourceMappingURL=sync.d.ts.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SqliteDriver } from './index.js';
|
|
2
|
-
/**
|
|
3
|
-
* The one place `react-native-nitro-sqlite` is named. Import this module only if
|
|
4
|
-
* you installed it; nothing else in the library reaches it.
|
|
5
|
-
*/
|
|
6
|
-
export declare const nitroSqliteDriver: () => SqliteDriver;
|
|
7
|
-
//# sourceMappingURL=nitro.d.ts.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { SqliteDriver } from './index.js';
|
|
2
|
-
/**
|
|
3
|
-
* The one place `@op-engineering/op-sqlite` is named. It is the driver we
|
|
4
|
-
* recommend: the most actively maintained of the four, and the only one already
|
|
5
|
-
* proven in one of our apps. Import this module only if you installed it.
|
|
6
|
-
*/
|
|
7
|
-
export declare const opSqliteDriver: () => SqliteDriver;
|
|
8
|
-
//# sourceMappingURL=op.d.ts.map
|