@ovok/native 1.17.0-dev.2258 → 1.17.0-dev.2262
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/lib/commonjs/modules/next/bluetooth/adapters/chosen-patient.js +12 -5
- package/lib/commonjs/modules/next/bluetooth/adapters/chosen-patient.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/adapters/ovok-reading-sink.js +27 -119
- package/lib/commonjs/modules/next/bluetooth/adapters/ovok-reading-sink.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/adapters/reading-measurements.js +118 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/reading-measurements.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/series-saving.js +14 -8
- package/lib/commonjs/modules/next/bluetooth/adapters/series-saving.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-database-outbox-store.js +80 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-database-outbox-store.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-database.js +0 -22
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-database.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-schema.js +1 -1
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-schema.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-store.js +16 -67
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-store.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/index.js +9 -1
- package/lib/commonjs/modules/next/bluetooth/index.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/sqlite/index.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/web/index.js +9 -1
- package/lib/commonjs/modules/next/bluetooth/web/index.js.map +1 -1
- package/lib/commonjs/modules/next/index.js.map +1 -1
- package/lib/commonjs/modules/next/ovok.js +25 -2
- package/lib/commonjs/modules/next/ovok.js.map +1 -1
- package/lib/commonjs/modules/next/react-native-outbox-triggers.js +40 -0
- package/lib/commonjs/modules/next/react-native-outbox-triggers.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/chosen-patient.js +11 -5
- package/lib/module/modules/next/bluetooth/adapters/chosen-patient.js.map +1 -1
- package/lib/module/modules/next/bluetooth/adapters/ovok-reading-sink.js +28 -120
- package/lib/module/modules/next/bluetooth/adapters/ovok-reading-sink.js.map +1 -1
- package/lib/module/modules/next/bluetooth/adapters/reading-measurements.js +115 -0
- package/lib/module/modules/next/bluetooth/adapters/reading-measurements.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/series-saving.js +13 -8
- package/lib/module/modules/next/bluetooth/adapters/series-saving.js.map +1 -1
- package/lib/module/modules/next/bluetooth/adapters/sqlite-database-outbox-store.js +77 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-database-outbox-store.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-database.js +0 -18
- package/lib/module/modules/next/bluetooth/adapters/sqlite-database.js.map +1 -1
- package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-schema.js +1 -1
- package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-schema.js.map +1 -1
- package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-store.js +16 -67
- package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-store.js.map +1 -1
- package/lib/module/modules/next/bluetooth/index.js +1 -0
- package/lib/module/modules/next/bluetooth/index.js.map +1 -1
- package/lib/module/modules/next/bluetooth/sqlite/index.js +3 -2
- package/lib/module/modules/next/bluetooth/sqlite/index.js.map +1 -1
- package/lib/module/modules/next/bluetooth/web/index.js +1 -0
- package/lib/module/modules/next/bluetooth/web/index.js.map +1 -1
- package/lib/module/modules/next/index.js +1 -1
- package/lib/module/modules/next/index.js.map +1 -1
- package/lib/module/modules/next/ovok.js +25 -2
- package/lib/module/modules/next/ovok.js.map +1 -1
- package/lib/module/modules/next/react-native-outbox-triggers.js +37 -0
- package/lib/module/modules/next/react-native-outbox-triggers.js.map +1 -0
- package/lib/typescript/commonjs/src/modules/data-sync/services/managers/sync-progress-manager.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/chosen-patient.d.ts +13 -5
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/chosen-patient.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ovok-reading-sink.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ovok-reading-sink.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/reading-measurements.d.ts +7 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/reading-measurements.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/series-saving.d.ts +3 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/series-saving.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-database-outbox-store.d.ts +38 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-database-outbox-store.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-database.d.ts +9 -7
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-database.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-store.d.ts +5 -33
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-store.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device-snapshot.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/sqlite/index.d.ts +5 -3
- package/lib/typescript/commonjs/src/modules/next/bluetooth/sqlite/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/web/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/web/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/index.d.ts +2 -1
- package/lib/typescript/commonjs/src/modules/next/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/ovok.d.ts +11 -3
- package/lib/typescript/commonjs/src/modules/next/ovok.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/react-native-outbox-triggers.d.ts +7 -0
- package/lib/typescript/commonjs/src/modules/next/react-native-outbox-triggers.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/theme/hooks/use-app-theme.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/theme/utils/generate-theme.d.ts +1 -1
- package/lib/typescript/module/src/modules/data-sync/services/managers/sync-progress-manager.d.ts +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/chosen-patient.d.ts +13 -5
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/chosen-patient.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/ovok-reading-sink.d.ts +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/ovok-reading-sink.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/reading-measurements.d.ts +7 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/reading-measurements.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/series-saving.d.ts +3 -1
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/series-saving.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-database-outbox-store.d.ts +38 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-database-outbox-store.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-database.d.ts +9 -7
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-database.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-store.d.ts +5 -33
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-store.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/device-snapshot.d.ts +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/index.d.ts +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/sqlite/index.d.ts +5 -3
- package/lib/typescript/module/src/modules/next/bluetooth/sqlite/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/web/index.d.ts +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/web/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/index.d.ts +2 -1
- package/lib/typescript/module/src/modules/next/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/ovok.d.ts +11 -3
- package/lib/typescript/module/src/modules/next/ovok.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/react-native-outbox-triggers.d.ts +7 -0
- package/lib/typescript/module/src/modules/next/react-native-outbox-triggers.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/theme/hooks/use-app-theme.d.ts +1 -1
- package/lib/typescript/module/src/modules/theme/utils/generate-theme.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,10 +1,18 @@
|
|
|
1
|
+
import { DeviceSnapshot } from "../core/device-snapshot";
|
|
2
|
+
import { Reading } from "../core/reading";
|
|
3
|
+
/**
|
|
4
|
+
* What `savesFor` returns to keep a reading on the device, unsent, until `ovok.outbox.assign` names who was measured:
|
|
5
|
+
* for a shared monitor set to ask each time.
|
|
6
|
+
*/
|
|
7
|
+
declare const HOLD: unique symbol;
|
|
1
8
|
/**
|
|
2
9
|
* Names the patient a reading is saved for, when the person measuring isn't the patient (a clinician): read at every
|
|
3
|
-
* save, so it follows whoever is chosen now. `
|
|
10
|
+
* save, so it follows whoever is chosen now. `HOLD` keeps the reading until a patient is assigned, and `undefined`
|
|
11
|
+
* means nobody is chosen, so the reading is not saved.
|
|
4
12
|
*/
|
|
5
|
-
type SavesFor = () => string | undefined;
|
|
6
|
-
/** The patient `savesFor` names, or `undefined` for the signed-in patient or guest; throws when nobody is chosen. */
|
|
7
|
-
declare const chosenPatientOf: (savesFor: SavesFor | undefined) => string | undefined;
|
|
8
|
-
export { chosenPatientOf };
|
|
13
|
+
type SavesFor = (reading: Reading, device: DeviceSnapshot) => string | typeof HOLD | undefined;
|
|
14
|
+
/** The patient `savesFor` names, `HOLD`, or `undefined` for the signed-in patient or guest; throws when nobody is chosen. */
|
|
15
|
+
declare const chosenPatientOf: (savesFor: SavesFor | undefined, reading: Reading, device: DeviceSnapshot) => string | typeof HOLD | undefined;
|
|
16
|
+
export { chosenPatientOf, HOLD };
|
|
9
17
|
export type { SavesFor };
|
|
10
18
|
//# sourceMappingURL=chosen-patient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chosen-patient.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/chosen-patient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chosen-patient.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/chosen-patient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C;;;GAGG;AACH,QAAA,MAAM,IAAI,eAAsB,CAAC;AAEjC;;;;GAIG;AACH,KAAK,QAAQ,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,KAAK,MAAM,GAAG,OAAO,IAAI,GAAG,SAAS,CAAC;AAE/F,6HAA6H;AAC7H,QAAA,MAAM,eAAe,GAAI,UAAU,QAAQ,GAAG,SAAS,EAAE,SAAS,OAAO,EAAE,QAAQ,cAAc,KAAG,MAAM,GAAG,OAAO,IAAI,GAAG,SAY1H,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC;AACjC,YAAY,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { SupersessionClient } from "./live-supersession";
|
|
|
5
5
|
type OvokSinkClient = SupersessionClient;
|
|
6
6
|
/**
|
|
7
7
|
* Saves readings through the Ovok measurements API, queueing them offline: for the signed-in account, or for the
|
|
8
|
-
* patient `savesFor` names
|
|
8
|
+
* patient `savesFor` names, or holds them when it returns `HOLD`. A reading with a series also saves it; a stored record then removes the live recordings it
|
|
9
9
|
* replaces, once it is saved.
|
|
10
10
|
*/
|
|
11
11
|
declare const ovokReadingSink: (client: OvokSinkClient, savesFor?: SavesFor) => ReadingSink;
|
package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ovok-reading-sink.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ovok-reading-sink.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/ovok-reading-sink.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ovok-reading-sink.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/ovok-reading-sink.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,EAAyB,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAyB,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAiBhF,uHAAuH;AACvH,KAAK,cAAc,GAAG,kBAAkB,CAAC;AA+DzC;;;;GAIG;AACH,QAAA,MAAM,eAAe,GAAI,QAAQ,cAAc,EAAE,WAAW,QAAQ,KAAG,WA2BrE,CAAC;AAEH,OAAO,EAAE,eAAe,EAAE,CAAC;AAC3B,YAAY,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Measurement } from "@ovok/core/next";
|
|
2
|
+
import { MeasurementType } from "../core/measurement-type";
|
|
3
|
+
import { Reading } from "../core/reading";
|
|
4
|
+
/** How each reading type becomes Ovok measurements, one for most and one per channel for an ECG; a type missing here cannot be saved yet. */
|
|
5
|
+
declare const MEASUREMENTS: Partial<Record<MeasurementType, (reading: Reading) => readonly Measurement[]>>;
|
|
6
|
+
export { MEASUREMENTS };
|
|
7
|
+
//# sourceMappingURL=reading-measurements.d.ts.map
|
package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/reading-measurements.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reading-measurements.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/reading-measurements.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,WAAW,EAKZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,eAAe,EAAc,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AA8G1C,6IAA6I;AAC7I,QAAA,MAAM,YAAY,EAAE,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,SAAS,WAAW,EAAE,CAAC,CAahG,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -26,6 +26,8 @@ declare const seriesObservationsOf: (field: SeriesField, { start, intervalMs, va
|
|
|
26
26
|
* saved for `patientId` when given, otherwise for the signed-in patient or the guest.
|
|
27
27
|
*/
|
|
28
28
|
declare const saveSeries: (client: SeriesClient, reading: SeriesReading, device: MeasurementDevice, patientId?: string) => Promise<SaveObservationsResult>;
|
|
29
|
-
|
|
29
|
+
/** Keeps a series on the device, naming the guest, until `ovok.outbox.assign` names the patient. */
|
|
30
|
+
declare const holdSeries: (client: SeriesClient, reading: SeriesReading, device: MeasurementDevice) => Promise<SaveObservationsResult>;
|
|
31
|
+
export { holdSeries, isSeriesReading, ownPatientId, saveSeries, seriesFieldOf, seriesObservationsOf };
|
|
30
32
|
export type { MeasurementDevice, SeriesClient };
|
|
31
33
|
//# sourceMappingURL=series-saving.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"series-saving.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/series-saving.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EAEvB,kBAAkB,EAClB,IAAI,EACJ,sBAAsB,EAEtB,uBAAuB,EACxB,MAAM,iBAAiB,CAAC;AAIzB,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAKlD,KAAK,iBAAiB,GAAG,WAAW,CAAC,uBAAuB,CAAC,QAAQ,CAAC,CAAC,CAAC;AAExE,2EAA2E;AAC3E,KAAK,YAAY,GAAG,IAAI,CAAC,IAAI,EAAE,cAAc,GAAG,SAAS,CAAC,CAAC;AAE3D,qCAAqC;AACrC,KAAK,aAAa,GAAG,OAAO,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAElD,yFAAyF;AACzF,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,kBAAkB,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAYlE,QAAA,MAAM,eAAe,GAAI,SAAS,OAAO,KAAG,OAAO,IAAI,aAA6C,CAAC;AAErG,6FAA6F;AAC7F,QAAA,MAAM,aAAa,GAAI,QAAQ,MAAM,KAAG,WAAW,GAAG,SAAgD,CAAC;AAEvG,oGAAoG;AACpG,QAAA,MAAM,YAAY,GAAU,aAAa,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,KAAG,OAAO,CAAC,MAAM,CAI9E,CAAC;AAEF,+FAA+F;AAC/F,QAAA,MAAM,oBAAoB,GACxB,OAAO,WAAW,EAClB,+BAA+B,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,YAAY,GAAG,QAAQ,CAAC,EAC9E,MAAM,IAAI,CAAC,uBAAuB,EAAE,WAAW,GAAG,UAAU,GAAG,iBAAiB,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,iBAAiB,CAAA;CAAE,+CAKhH,CAAC;
|
|
1
|
+
{"version":3,"file":"series-saving.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/series-saving.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EAEvB,kBAAkB,EAClB,IAAI,EACJ,sBAAsB,EAEtB,uBAAuB,EACxB,MAAM,iBAAiB,CAAC;AAIzB,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAKlD,KAAK,iBAAiB,GAAG,WAAW,CAAC,uBAAuB,CAAC,QAAQ,CAAC,CAAC,CAAC;AAExE,2EAA2E;AAC3E,KAAK,YAAY,GAAG,IAAI,CAAC,IAAI,EAAE,cAAc,GAAG,SAAS,CAAC,CAAC;AAE3D,qCAAqC;AACrC,KAAK,aAAa,GAAG,OAAO,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAElD,yFAAyF;AACzF,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,kBAAkB,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAYlE,QAAA,MAAM,eAAe,GAAI,SAAS,OAAO,KAAG,OAAO,IAAI,aAA6C,CAAC;AAErG,6FAA6F;AAC7F,QAAA,MAAM,aAAa,GAAI,QAAQ,MAAM,KAAG,WAAW,GAAG,SAAgD,CAAC;AAEvG,oGAAoG;AACpG,QAAA,MAAM,YAAY,GAAU,aAAa,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,KAAG,OAAO,CAAC,MAAM,CAI9E,CAAC;AAEF,+FAA+F;AAC/F,QAAA,MAAM,oBAAoB,GACxB,OAAO,WAAW,EAClB,+BAA+B,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,YAAY,GAAG,QAAQ,CAAC,EAC9E,MAAM,IAAI,CAAC,uBAAuB,EAAE,WAAW,GAAG,UAAU,GAAG,iBAAiB,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,iBAAiB,CAAA;CAAE,+CAKhH,CAAC;AAmBL;;;GAGG;AACH,QAAA,MAAM,UAAU,GACd,QAAQ,YAAY,EACpB,SAAS,aAAa,EACtB,QAAQ,iBAAiB,EACzB,YAAY,MAAM,KACjB,OAAO,CAAC,sBAAsB,CACsE,CAAC;AAExG,oGAAoG;AACpG,QAAA,MAAM,UAAU,GAAU,QAAQ,YAAY,EAAE,SAAS,aAAa,EAAE,QAAQ,iBAAiB,KAAG,OAAO,CAAC,sBAAsB,CACpB,CAAC;AAE/G,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,oBAAoB,EAAE,CAAC;AACtG,YAAY,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { OutboxItem, OutboxItemSummary, OutboxState, OutboxStore } from "@ovok/core/next";
|
|
2
|
+
import { Logger } from "../core/ports";
|
|
3
|
+
import { SqliteDatabase } from "./sqlite-database";
|
|
4
|
+
/** How `SqliteDatabaseOutboxStore` opens its database. */
|
|
5
|
+
type SqliteDatabaseOutboxOptions = {
|
|
6
|
+
/** The database file name; `ovok-outbox.db` by default. */
|
|
7
|
+
name?: string;
|
|
8
|
+
/** Opens the named database, such as `expo-sqlite`'s `openDatabaseAsync`. */
|
|
9
|
+
open: (name: string) => Promise<SqliteDatabase>;
|
|
10
|
+
/** Where structured events go; silent by default. */
|
|
11
|
+
logger?: Logger;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* An `OutboxStore` on a SQLite database it is given a way to open: one row per item in `outbox_items`, the entries as
|
|
15
|
+
* one JSON text column, so listing and counting never read them. The database opens on first use.
|
|
16
|
+
*/
|
|
17
|
+
declare class SqliteDatabaseOutboxStore implements OutboxStore {
|
|
18
|
+
private readonly options;
|
|
19
|
+
private database;
|
|
20
|
+
constructor(options: SqliteDatabaseOutboxOptions);
|
|
21
|
+
/** Stores an item, replacing the one with the same id. */
|
|
22
|
+
put(item: OutboxItem): Promise<void>;
|
|
23
|
+
/** Returns an item, or `null` when there is none. */
|
|
24
|
+
get(id: string): Promise<OutboxItem | null>;
|
|
25
|
+
/** Deletes an item; an unknown id is not an error. */
|
|
26
|
+
remove(id: string): Promise<void>;
|
|
27
|
+
/** The owner's pending items that are due, newest recorded first, then by position in the recording. */
|
|
28
|
+
due(ownerKey: string, now: number, limit: number): Promise<OutboxItem[]>;
|
|
29
|
+
/** Every item of the owner in any state, newest recorded first, without its entries. */
|
|
30
|
+
summaries(ownerKey: string): Promise<OutboxItemSummary[]>;
|
|
31
|
+
/** How many of the owner's items are in `state`. */
|
|
32
|
+
count(ownerKey: string, state: OutboxState): Promise<number>;
|
|
33
|
+
private open;
|
|
34
|
+
private connect;
|
|
35
|
+
}
|
|
36
|
+
export { SqliteDatabaseOutboxStore };
|
|
37
|
+
export type { SqliteDatabaseOutboxOptions };
|
|
38
|
+
//# sourceMappingURL=sqlite-database-outbox-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqlite-database-outbox-store.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/sqlite-database-outbox-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE/F,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAanD,0DAA0D;AAC1D,KAAK,2BAA2B,GAAG;IAEjC,2DAA2D;IAC3D,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,6EAA6E;IAC7E,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;IAEhD,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAiBF;;;GAGG;AACH,cAAM,yBAA0B,YAAW,WAAW;IAGjC,OAAO,CAAC,QAAQ,CAAC,OAAO;IAF3C,OAAO,CAAC,QAAQ,CAAwC;gBAEpB,OAAO,EAAE,2BAA2B;IAExE,0DAA0D;IAC7C,GAAG,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjD,qDAAqD;IACxC,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAMxD,sDAAsD;IACzC,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9C,wGAAwG;IAC3F,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAMrF,wFAAwF;IAC3E,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAMtE,oDAAoD;IACvC,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC;IAMzE,OAAO,CAAC,IAAI;YASE,OAAO;CAOtB;AAED,OAAO,EAAE,yBAAyB,EAAE,CAAC;AACrC,YAAY,EAAE,2BAA2B,EAAE,CAAC"}
|
|
@@ -5,19 +5,21 @@ interface SqliteTransaction {
|
|
|
5
5
|
/** Runs statements that take no parameters. */
|
|
6
6
|
execAsync(source: string): Promise<void>;
|
|
7
7
|
/** Runs one statement that writes. */
|
|
8
|
-
runAsync(source: string, params
|
|
8
|
+
runAsync(source: string, params: SqliteBindValue[]): Promise<unknown>;
|
|
9
9
|
/** Returns the first row a query finds, or `null`. */
|
|
10
|
-
getFirstAsync<Row>(source: string, params
|
|
10
|
+
getFirstAsync<Row>(source: string, params: SqliteBindValue[]): Promise<Row | null>;
|
|
11
11
|
}
|
|
12
12
|
/** The part of an `expo-sqlite` database the outbox store uses. */
|
|
13
13
|
interface SqliteDatabase extends SqliteTransaction {
|
|
14
14
|
/** Returns every row a query finds. */
|
|
15
|
-
getAllAsync<Row>(source: string, params
|
|
15
|
+
getAllAsync<Row>(source: string, params: SqliteBindValue[]): Promise<Row[]>;
|
|
16
16
|
/** Runs `task` in one exclusive transaction: it commits when `task` resolves and rolls back when it throws. */
|
|
17
17
|
withExclusiveTransactionAsync(task: (transaction: SqliteTransaction) => Promise<void>): Promise<void>;
|
|
18
18
|
}
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
/** The `expo-sqlite` module, or anything that opens a database the same way. */
|
|
20
|
+
interface OvokSqlite {
|
|
21
|
+
/** Opens the named database, creating it when it does not exist. */
|
|
22
|
+
openDatabaseAsync(name: string): Promise<SqliteDatabase>;
|
|
23
|
+
}
|
|
24
|
+
export type { OvokSqlite, SqliteBindValue, SqliteDatabase, SqliteTransaction };
|
|
23
25
|
//# sourceMappingURL=sqlite-database.d.ts.map
|
package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-database.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sqlite-database.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/sqlite-database.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,KAAK,eAAe,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;AAE9C,sEAAsE;AACtE,UAAU,iBAAiB;IAEzB,+CAA+C;IAC/C,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzC,sCAAsC;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"sqlite-database.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/sqlite-database.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,KAAK,eAAe,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;AAE9C,sEAAsE;AACtE,UAAU,iBAAiB;IAEzB,+CAA+C;IAC/C,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzC,sCAAsC;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEtE,sDAAsD;IACtD,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;CACpF;AAED,mEAAmE;AACnE,UAAU,cAAe,SAAQ,iBAAiB;IAEhD,uCAAuC;IACvC,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAE5E,+GAA+G;IAC/G,6BAA6B,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvG;AAED,gFAAgF;AAChF,UAAU,UAAU;IAElB,oEAAoE;IACpE,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CAC1D;AAED,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,CAAC"}
|
package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-store.d.ts
CHANGED
|
@@ -1,37 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
|
|
6
|
-
/** The database file name; `ovok-outbox.db` by default. */
|
|
7
|
-
name?: string;
|
|
8
|
-
/** Opens the named database; `expo-sqlite`'s `openDatabaseAsync` by default, swapped in tests. */
|
|
9
|
-
open?: (name: string) => Promise<SqliteDatabase>;
|
|
10
|
-
/** Where structured events go; silent by default. */
|
|
11
|
-
logger?: Logger;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* An `OutboxStore` on `expo-sqlite`, for phones: one row per item in `outbox_items`, the entries as one JSON text
|
|
15
|
-
* column, so listing and counting never read them. `expo-sqlite` is an optional peer dependency, loaded on first use.
|
|
16
|
-
*/
|
|
17
|
-
declare class SqliteOutboxStore implements OutboxStore {
|
|
18
|
-
private readonly options;
|
|
19
|
-
private database;
|
|
1
|
+
import { SqliteDatabaseOutboxOptions, SqliteDatabaseOutboxStore } from "./sqlite-database-outbox-store";
|
|
2
|
+
/** Every field has a default for a phone app; `open` defaults to `expo-sqlite`'s `openDatabaseAsync`. */
|
|
3
|
+
type SqliteOutboxOptions = Partial<SqliteDatabaseOutboxOptions>;
|
|
4
|
+
/** The outbox store on `expo-sqlite`, for phones; `expo-sqlite` is an optional peer dependency, loaded on first use. */
|
|
5
|
+
declare class SqliteOutboxStore extends SqliteDatabaseOutboxStore {
|
|
20
6
|
constructor(options?: SqliteOutboxOptions);
|
|
21
|
-
/** Stores an item, replacing the one with the same id. */
|
|
22
|
-
put(item: OutboxItem): Promise<void>;
|
|
23
|
-
/** Returns an item, or `null` when there is none. */
|
|
24
|
-
get(id: string): Promise<OutboxItem | null>;
|
|
25
|
-
/** Deletes an item; an unknown id is not an error. */
|
|
26
|
-
remove(id: string): Promise<void>;
|
|
27
|
-
/** The owner's pending items that are due, newest recorded first, then by position in the recording. */
|
|
28
|
-
due(ownerKey: string, now: number, limit: number): Promise<OutboxItem[]>;
|
|
29
|
-
/** Every item of the owner in any state, newest recorded first, without its entries. */
|
|
30
|
-
summaries(ownerKey: string): Promise<OutboxItemSummary[]>;
|
|
31
|
-
/** How many of the owner's items are in `state`. */
|
|
32
|
-
count(ownerKey: string, state: OutboxState): Promise<number>;
|
|
33
|
-
private open;
|
|
34
|
-
private connect;
|
|
35
7
|
}
|
|
36
8
|
export { SqliteOutboxStore };
|
|
37
9
|
export type { SqliteOutboxOptions };
|
package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-store.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sqlite-outbox-store.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/sqlite-outbox-store.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sqlite-outbox-store.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/sqlite-outbox-store.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,2BAA2B,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAGxG,yGAAyG;AACzG,KAAK,mBAAmB,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;AAahE,wHAAwH;AACxH,cAAM,iBAAkB,SAAQ,yBAAyB;gBACpC,OAAO,GAAE,mBAAwB;CAGrD;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAC7B,YAAY,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -120,7 +120,7 @@ declare const storedFields: (record: PairedDevice, model: DeviceModel) => {
|
|
|
120
120
|
name: string;
|
|
121
121
|
lastConnectedAt: Date | null;
|
|
122
122
|
lastSyncedAt: Date | null;
|
|
123
|
-
lastSyncOutcome: "
|
|
123
|
+
lastSyncOutcome: "success" | "failed" | null;
|
|
124
124
|
lastReadingAt: Date | null;
|
|
125
125
|
battery: Battery | null;
|
|
126
126
|
identity: DeviceIdentity | null;
|
|
@@ -11,6 +11,7 @@ export { blePlxCentral } from "./adapters/ble-plx-central";
|
|
|
11
11
|
export { osBluetoothPermissions } from "./adapters/os-permissions";
|
|
12
12
|
export { reactNativeLifecycle } from "./adapters/react-native-lifecycle";
|
|
13
13
|
export { createBluetooth } from "./create-bluetooth";
|
|
14
|
+
export { HOLD } from "./adapters/chosen-patient";
|
|
14
15
|
export type { SavesFor } from "./adapters/chosen-patient";
|
|
15
16
|
export type { CreateBluetoothOptions } from "./create-bluetooth";
|
|
16
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,YAAY,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC7G,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,YAAY,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,YAAY,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,YAAY,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC7G,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,YAAY,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,YAAY,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The outbox store on `expo-sqlite
|
|
3
|
-
* It has its own subpath so apps without `expo-sqlite`, and browser
|
|
2
|
+
* The outbox store on `expo-sqlite`, for an app that builds its own instead of passing `sqlite` to the `Ovok` client.
|
|
3
|
+
* Import from `@ovok/native/next/bluetooth/sqlite`. It has its own subpath so apps without `expo-sqlite`, and browser
|
|
4
|
+
* bundles, never load it.
|
|
4
5
|
*
|
|
5
6
|
* @module next/bluetooth/sqlite
|
|
6
7
|
*/
|
|
7
8
|
export { SqliteOutboxStore } from "../adapters/sqlite-outbox-store";
|
|
8
|
-
export type { SqliteBindValue, SqliteDatabase, SqliteTransaction } from "../adapters/sqlite-database";
|
|
9
|
+
export type { OvokSqlite, SqliteBindValue, SqliteDatabase, SqliteTransaction } from "../adapters/sqlite-database";
|
|
10
|
+
export type { SqliteDatabaseOutboxOptions } from "../adapters/sqlite-database-outbox-store";
|
|
9
11
|
export type { SqliteOutboxOptions } from "../adapters/sqlite-outbox-store";
|
|
10
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/sqlite/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/sqlite/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAClH,YAAY,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AAC5F,YAAY,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC"}
|
|
@@ -8,6 +8,7 @@ export * from "../shared";
|
|
|
8
8
|
export { webBluetoothCentral } from "../adapters/web-bluetooth-central";
|
|
9
9
|
export type { WebBluetooth } from "../adapters/web-bluetooth-central";
|
|
10
10
|
export { createWebBluetooth } from "./create-web-bluetooth";
|
|
11
|
+
export { HOLD } from "../adapters/chosen-patient";
|
|
11
12
|
export type { SavesFor } from "../adapters/chosen-patient";
|
|
12
13
|
export type { CreateWebBluetoothOptions } from "./create-web-bluetooth";
|
|
13
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/web/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,YAAY,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,YAAY,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC3D,YAAY,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/web/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,YAAY,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,YAAY,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC3D,YAAY,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The native `Ovok` client built on `@ovok/core/next`, with secure-store token storage.
|
|
2
|
+
* The native `Ovok` client built on `@ovok/core/next`, with secure-store token storage and a SQLite outbox.
|
|
3
3
|
*
|
|
4
4
|
* Import from `@ovok/native/next`.
|
|
5
5
|
*
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export * from "@ovok/core/next";
|
|
9
9
|
export { Ovok } from "./ovok";
|
|
10
|
+
export type { OvokSqlite } from "./bluetooth/adapters/sqlite-database";
|
|
10
11
|
export type { OvokNativeConfig } from "./ovok";
|
|
11
12
|
export type { RandomValuesSource } from "./random-values";
|
|
12
13
|
export { SecureStoreStorage } from "./secure-store-storage";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/next/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC/C,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,YAAY,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/next/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AACvE,YAAY,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC/C,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,YAAY,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
import { Ovok as CoreOvok } from "@ovok/core/next";
|
|
2
|
+
import type { OvokSqlite } from "./bluetooth/adapters/sqlite-database";
|
|
2
3
|
import type { RandomValuesSource } from "./random-values";
|
|
3
4
|
import type { OvokSecureStore } from "./secure-store-storage";
|
|
4
|
-
import type { OvokConfig, OvokStorage } from "@ovok/core/next";
|
|
5
|
+
import type { OutboxStore, OvokConfig, OvokStorage } from "@ovok/core/next";
|
|
5
6
|
type UserClientConfig = Extract<OvokConfig, {
|
|
6
7
|
clientSecret?: undefined;
|
|
7
8
|
}>;
|
|
8
9
|
/** No clientSecret: anything shipped inside an app can be extracted from it. */
|
|
9
|
-
type OvokNativeConfig = Omit<UserClientConfig, "storage" | "clientSecret"> & {
|
|
10
|
+
type OvokNativeConfig = Omit<UserClientConfig, "storage" | "clientSecret" | "outboxStore"> & {
|
|
10
11
|
/** The expo-secure-store module (or a compatible store) that holds the session. */
|
|
11
12
|
secureStore: OvokSecureStore;
|
|
12
13
|
/** Options passed to every secure store call, such as keychain accessibility. */
|
|
13
14
|
secureStoreOptions?: Record<string, unknown>;
|
|
15
|
+
/** The expo-sqlite module (or a compatible one) for unsent measurements; required without `outboxStore`. */
|
|
16
|
+
sqlite?: OvokSqlite;
|
|
17
|
+
/** Where unsent measurements wait, instead of the SQLite database `sqlite` opens. */
|
|
18
|
+
outboxStore?: OutboxStore;
|
|
14
19
|
/** Fills a byte array with random values; used when the runtime has no `crypto.getRandomValues`. */
|
|
15
20
|
getRandomValues?: RandomValuesSource;
|
|
16
21
|
};
|
|
17
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* The @ovok/core/next client with the session kept in the device's secure store and unsent measurements in SQLite,
|
|
24
|
+
* sent when the network returns and when the app comes to the foreground.
|
|
25
|
+
*/
|
|
18
26
|
declare class Ovok extends CoreOvok {
|
|
19
27
|
/** Base URL of the Ovok API, with a trailing slash. */
|
|
20
28
|
readonly baseUrl: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ovok.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/next/ovok.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"ovok.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/next/ovok.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAO5E,KAAK,gBAAgB,GAAG,OAAO,CAAC,UAAU,EAAE;IAAE,YAAY,CAAC,EAAE,SAAS,CAAA;CAAE,CAAC,CAAC;AAE1E,gFAAgF;AAChF,KAAK,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,cAAc,GAAG,aAAa,CAAC,GAAG;IAE3F,mFAAmF;IACnF,WAAW,EAAE,eAAe,CAAC;IAE7B,iFAAiF;IACjF,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAE7C,4GAA4G;IAC5G,MAAM,CAAC,EAAE,UAAU,CAAC;IAEpB,qFAAqF;IACrF,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B,oGAAoG;IACpG,eAAe,CAAC,EAAE,kBAAkB,CAAC;CACtC,CAAC;AAcF;;;GAGG;AACH,cAAM,IAAK,SAAQ,QAAQ;IACzB,uDAAuD;IACvD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,kDAAkD;IAClD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAE5B,2CAA2C;IAC3C,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;gBAElB,MAAM,EAAE,gBAAgB;CAiBrC;AAED,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,YAAY,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { OutboxConnectivity, OutboxLifecycle } from "@ovok/core/next";
|
|
2
|
+
/** The device's connection through NetInfo: the outbox hears each time it comes back after going offline. */
|
|
3
|
+
declare const netInfoConnectivity: OutboxConnectivity;
|
|
4
|
+
/** The app's foreground through React Native's `AppState`. */
|
|
5
|
+
declare const appStateLifecycle: OutboxLifecycle;
|
|
6
|
+
export { appStateLifecycle, netInfoConnectivity };
|
|
7
|
+
//# sourceMappingURL=react-native-outbox-triggers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-native-outbox-triggers.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/next/react-native-outbox-triggers.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAO3E,6GAA6G;AAC7G,QAAA,MAAM,mBAAmB,EAAE,kBAa1B,CAAC;AAEF,8DAA8D;AAC9D,QAAA,MAAM,iBAAiB,EAAE,eAUxB,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -182,7 +182,7 @@ export declare const useAppTheme: () => {
|
|
|
182
182
|
spacingScale: Record<string, number> | undefined;
|
|
183
183
|
borderRadiusScale: Record<string, number> | undefined;
|
|
184
184
|
dark: boolean;
|
|
185
|
-
mode?: "
|
|
185
|
+
mode?: "exact" | "adaptive";
|
|
186
186
|
animation: {
|
|
187
187
|
scale: number;
|
|
188
188
|
defaultAnimationDuration?: number;
|
|
@@ -187,7 +187,7 @@ export declare const generateTheme: (theme: ThemeProviderProps["theme"]) => {
|
|
|
187
187
|
borderRadiusScale: Record<string, number> | undefined;
|
|
188
188
|
/** Whether the dark variant is used. */
|
|
189
189
|
dark: boolean;
|
|
190
|
-
mode?: "
|
|
190
|
+
mode?: "exact" | "adaptive";
|
|
191
191
|
animation: {
|
|
192
192
|
scale: number;
|
|
193
193
|
defaultAnimationDuration?: number;
|
package/lib/typescript/module/src/modules/data-sync/services/managers/sync-progress-manager.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export declare class SyncProgressManager<TDataToSync extends AndroidHealthSyncPr
|
|
|
16
16
|
setTotalObservations(measurementTypeKey: HealthSyncKey, total: number): void;
|
|
17
17
|
incrementSyncedObservations(measurementTypeKey: HealthSyncKey, count: number, createdCount?: number): void;
|
|
18
18
|
setStatus(measurementTypeKey: HealthSyncKey, status: SyncProgress["status"], reason?: SyncPauseReason): void;
|
|
19
|
-
getStatus(measurementTypeKey: HealthSyncKey): "
|
|
19
|
+
getStatus(measurementTypeKey: HealthSyncKey): "failed" | "started" | "completed" | "idle" | "syncing" | "paused";
|
|
20
20
|
resetAll(): void;
|
|
21
21
|
private notifyProgress;
|
|
22
22
|
}
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
+
import { DeviceSnapshot } from "../core/device-snapshot";
|
|
2
|
+
import { Reading } from "../core/reading";
|
|
3
|
+
/**
|
|
4
|
+
* What `savesFor` returns to keep a reading on the device, unsent, until `ovok.outbox.assign` names who was measured:
|
|
5
|
+
* for a shared monitor set to ask each time.
|
|
6
|
+
*/
|
|
7
|
+
declare const HOLD: unique symbol;
|
|
1
8
|
/**
|
|
2
9
|
* Names the patient a reading is saved for, when the person measuring isn't the patient (a clinician): read at every
|
|
3
|
-
* save, so it follows whoever is chosen now. `
|
|
10
|
+
* save, so it follows whoever is chosen now. `HOLD` keeps the reading until a patient is assigned, and `undefined`
|
|
11
|
+
* means nobody is chosen, so the reading is not saved.
|
|
4
12
|
*/
|
|
5
|
-
type SavesFor = () => string | undefined;
|
|
6
|
-
/** The patient `savesFor` names, or `undefined` for the signed-in patient or guest; throws when nobody is chosen. */
|
|
7
|
-
declare const chosenPatientOf: (savesFor: SavesFor | undefined) => string | undefined;
|
|
8
|
-
export { chosenPatientOf };
|
|
13
|
+
type SavesFor = (reading: Reading, device: DeviceSnapshot) => string | typeof HOLD | undefined;
|
|
14
|
+
/** The patient `savesFor` names, `HOLD`, or `undefined` for the signed-in patient or guest; throws when nobody is chosen. */
|
|
15
|
+
declare const chosenPatientOf: (savesFor: SavesFor | undefined, reading: Reading, device: DeviceSnapshot) => string | typeof HOLD | undefined;
|
|
16
|
+
export { chosenPatientOf, HOLD };
|
|
9
17
|
export type { SavesFor };
|
|
10
18
|
//# sourceMappingURL=chosen-patient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chosen-patient.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/chosen-patient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chosen-patient.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/chosen-patient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C;;;GAGG;AACH,QAAA,MAAM,IAAI,eAAsB,CAAC;AAEjC;;;;GAIG;AACH,KAAK,QAAQ,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,KAAK,MAAM,GAAG,OAAO,IAAI,GAAG,SAAS,CAAC;AAE/F,6HAA6H;AAC7H,QAAA,MAAM,eAAe,GAAI,UAAU,QAAQ,GAAG,SAAS,EAAE,SAAS,OAAO,EAAE,QAAQ,cAAc,KAAG,MAAM,GAAG,OAAO,IAAI,GAAG,SAY1H,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC;AACjC,YAAY,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { SupersessionClient } from "./live-supersession";
|
|
|
5
5
|
type OvokSinkClient = SupersessionClient;
|
|
6
6
|
/**
|
|
7
7
|
* Saves readings through the Ovok measurements API, queueing them offline: for the signed-in account, or for the
|
|
8
|
-
* patient `savesFor` names
|
|
8
|
+
* patient `savesFor` names, or holds them when it returns `HOLD`. A reading with a series also saves it; a stored record then removes the live recordings it
|
|
9
9
|
* replaces, once it is saved.
|
|
10
10
|
*/
|
|
11
11
|
declare const ovokReadingSink: (client: OvokSinkClient, savesFor?: SavesFor) => ReadingSink;
|
package/lib/typescript/module/src/modules/next/bluetooth/adapters/ovok-reading-sink.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ovok-reading-sink.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/ovok-reading-sink.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ovok-reading-sink.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/ovok-reading-sink.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,EAAyB,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAyB,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAiBhF,uHAAuH;AACvH,KAAK,cAAc,GAAG,kBAAkB,CAAC;AA+DzC;;;;GAIG;AACH,QAAA,MAAM,eAAe,GAAI,QAAQ,cAAc,EAAE,WAAW,QAAQ,KAAG,WA2BrE,CAAC;AAEH,OAAO,EAAE,eAAe,EAAE,CAAC;AAC3B,YAAY,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Measurement } from "@ovok/core/next";
|
|
2
|
+
import { MeasurementType } from "../core/measurement-type";
|
|
3
|
+
import { Reading } from "../core/reading";
|
|
4
|
+
/** How each reading type becomes Ovok measurements, one for most and one per channel for an ECG; a type missing here cannot be saved yet. */
|
|
5
|
+
declare const MEASUREMENTS: Partial<Record<MeasurementType, (reading: Reading) => readonly Measurement[]>>;
|
|
6
|
+
export { MEASUREMENTS };
|
|
7
|
+
//# sourceMappingURL=reading-measurements.d.ts.map
|
package/lib/typescript/module/src/modules/next/bluetooth/adapters/reading-measurements.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reading-measurements.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/reading-measurements.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,WAAW,EAKZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,eAAe,EAAc,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AA8G1C,6IAA6I;AAC7I,QAAA,MAAM,YAAY,EAAE,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,SAAS,WAAW,EAAE,CAAC,CAahG,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -26,6 +26,8 @@ declare const seriesObservationsOf: (field: SeriesField, { start, intervalMs, va
|
|
|
26
26
|
* saved for `patientId` when given, otherwise for the signed-in patient or the guest.
|
|
27
27
|
*/
|
|
28
28
|
declare const saveSeries: (client: SeriesClient, reading: SeriesReading, device: MeasurementDevice, patientId?: string) => Promise<SaveObservationsResult>;
|
|
29
|
-
|
|
29
|
+
/** Keeps a series on the device, naming the guest, until `ovok.outbox.assign` names the patient. */
|
|
30
|
+
declare const holdSeries: (client: SeriesClient, reading: SeriesReading, device: MeasurementDevice) => Promise<SaveObservationsResult>;
|
|
31
|
+
export { holdSeries, isSeriesReading, ownPatientId, saveSeries, seriesFieldOf, seriesObservationsOf };
|
|
30
32
|
export type { MeasurementDevice, SeriesClient };
|
|
31
33
|
//# sourceMappingURL=series-saving.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"series-saving.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/series-saving.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EAEvB,kBAAkB,EAClB,IAAI,EACJ,sBAAsB,EAEtB,uBAAuB,EACxB,MAAM,iBAAiB,CAAC;AAIzB,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAKlD,KAAK,iBAAiB,GAAG,WAAW,CAAC,uBAAuB,CAAC,QAAQ,CAAC,CAAC,CAAC;AAExE,2EAA2E;AAC3E,KAAK,YAAY,GAAG,IAAI,CAAC,IAAI,EAAE,cAAc,GAAG,SAAS,CAAC,CAAC;AAE3D,qCAAqC;AACrC,KAAK,aAAa,GAAG,OAAO,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAElD,yFAAyF;AACzF,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,kBAAkB,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAYlE,QAAA,MAAM,eAAe,GAAI,SAAS,OAAO,KAAG,OAAO,IAAI,aAA6C,CAAC;AAErG,6FAA6F;AAC7F,QAAA,MAAM,aAAa,GAAI,QAAQ,MAAM,KAAG,WAAW,GAAG,SAAgD,CAAC;AAEvG,oGAAoG;AACpG,QAAA,MAAM,YAAY,GAAU,aAAa,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,KAAG,OAAO,CAAC,MAAM,CAI9E,CAAC;AAEF,+FAA+F;AAC/F,QAAA,MAAM,oBAAoB,GACxB,OAAO,WAAW,EAClB,+BAA+B,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,YAAY,GAAG,QAAQ,CAAC,EAC9E,MAAM,IAAI,CAAC,uBAAuB,EAAE,WAAW,GAAG,UAAU,GAAG,iBAAiB,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,iBAAiB,CAAA;CAAE,+CAKhH,CAAC;
|
|
1
|
+
{"version":3,"file":"series-saving.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/series-saving.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EAEvB,kBAAkB,EAClB,IAAI,EACJ,sBAAsB,EAEtB,uBAAuB,EACxB,MAAM,iBAAiB,CAAC;AAIzB,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAKlD,KAAK,iBAAiB,GAAG,WAAW,CAAC,uBAAuB,CAAC,QAAQ,CAAC,CAAC,CAAC;AAExE,2EAA2E;AAC3E,KAAK,YAAY,GAAG,IAAI,CAAC,IAAI,EAAE,cAAc,GAAG,SAAS,CAAC,CAAC;AAE3D,qCAAqC;AACrC,KAAK,aAAa,GAAG,OAAO,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAElD,yFAAyF;AACzF,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,kBAAkB,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAYlE,QAAA,MAAM,eAAe,GAAI,SAAS,OAAO,KAAG,OAAO,IAAI,aAA6C,CAAC;AAErG,6FAA6F;AAC7F,QAAA,MAAM,aAAa,GAAI,QAAQ,MAAM,KAAG,WAAW,GAAG,SAAgD,CAAC;AAEvG,oGAAoG;AACpG,QAAA,MAAM,YAAY,GAAU,aAAa,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,KAAG,OAAO,CAAC,MAAM,CAI9E,CAAC;AAEF,+FAA+F;AAC/F,QAAA,MAAM,oBAAoB,GACxB,OAAO,WAAW,EAClB,+BAA+B,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,YAAY,GAAG,QAAQ,CAAC,EAC9E,MAAM,IAAI,CAAC,uBAAuB,EAAE,WAAW,GAAG,UAAU,GAAG,iBAAiB,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,iBAAiB,CAAA;CAAE,+CAKhH,CAAC;AAmBL;;;GAGG;AACH,QAAA,MAAM,UAAU,GACd,QAAQ,YAAY,EACpB,SAAS,aAAa,EACtB,QAAQ,iBAAiB,EACzB,YAAY,MAAM,KACjB,OAAO,CAAC,sBAAsB,CACsE,CAAC;AAExG,oGAAoG;AACpG,QAAA,MAAM,UAAU,GAAU,QAAQ,YAAY,EAAE,SAAS,aAAa,EAAE,QAAQ,iBAAiB,KAAG,OAAO,CAAC,sBAAsB,CACpB,CAAC;AAE/G,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,oBAAoB,EAAE,CAAC;AACtG,YAAY,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAC"}
|
package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-database-outbox-store.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { OutboxItem, OutboxItemSummary, OutboxState, OutboxStore } from "@ovok/core/next";
|
|
2
|
+
import { Logger } from "../core/ports";
|
|
3
|
+
import { SqliteDatabase } from "./sqlite-database";
|
|
4
|
+
/** How `SqliteDatabaseOutboxStore` opens its database. */
|
|
5
|
+
type SqliteDatabaseOutboxOptions = {
|
|
6
|
+
/** The database file name; `ovok-outbox.db` by default. */
|
|
7
|
+
name?: string;
|
|
8
|
+
/** Opens the named database, such as `expo-sqlite`'s `openDatabaseAsync`. */
|
|
9
|
+
open: (name: string) => Promise<SqliteDatabase>;
|
|
10
|
+
/** Where structured events go; silent by default. */
|
|
11
|
+
logger?: Logger;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* An `OutboxStore` on a SQLite database it is given a way to open: one row per item in `outbox_items`, the entries as
|
|
15
|
+
* one JSON text column, so listing and counting never read them. The database opens on first use.
|
|
16
|
+
*/
|
|
17
|
+
declare class SqliteDatabaseOutboxStore implements OutboxStore {
|
|
18
|
+
private readonly options;
|
|
19
|
+
private database;
|
|
20
|
+
constructor(options: SqliteDatabaseOutboxOptions);
|
|
21
|
+
/** Stores an item, replacing the one with the same id. */
|
|
22
|
+
put(item: OutboxItem): Promise<void>;
|
|
23
|
+
/** Returns an item, or `null` when there is none. */
|
|
24
|
+
get(id: string): Promise<OutboxItem | null>;
|
|
25
|
+
/** Deletes an item; an unknown id is not an error. */
|
|
26
|
+
remove(id: string): Promise<void>;
|
|
27
|
+
/** The owner's pending items that are due, newest recorded first, then by position in the recording. */
|
|
28
|
+
due(ownerKey: string, now: number, limit: number): Promise<OutboxItem[]>;
|
|
29
|
+
/** Every item of the owner in any state, newest recorded first, without its entries. */
|
|
30
|
+
summaries(ownerKey: string): Promise<OutboxItemSummary[]>;
|
|
31
|
+
/** How many of the owner's items are in `state`. */
|
|
32
|
+
count(ownerKey: string, state: OutboxState): Promise<number>;
|
|
33
|
+
private open;
|
|
34
|
+
private connect;
|
|
35
|
+
}
|
|
36
|
+
export { SqliteDatabaseOutboxStore };
|
|
37
|
+
export type { SqliteDatabaseOutboxOptions };
|
|
38
|
+
//# sourceMappingURL=sqlite-database-outbox-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqlite-database-outbox-store.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/sqlite-database-outbox-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE/F,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAanD,0DAA0D;AAC1D,KAAK,2BAA2B,GAAG;IAEjC,2DAA2D;IAC3D,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,6EAA6E;IAC7E,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;IAEhD,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAiBF;;;GAGG;AACH,cAAM,yBAA0B,YAAW,WAAW;IAGjC,OAAO,CAAC,QAAQ,CAAC,OAAO;IAF3C,OAAO,CAAC,QAAQ,CAAwC;gBAEpB,OAAO,EAAE,2BAA2B;IAExE,0DAA0D;IAC7C,GAAG,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjD,qDAAqD;IACxC,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAMxD,sDAAsD;IACzC,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9C,wGAAwG;IAC3F,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAMrF,wFAAwF;IAC3E,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAMtE,oDAAoD;IACvC,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC;IAMzE,OAAO,CAAC,IAAI;YASE,OAAO;CAOtB;AAED,OAAO,EAAE,yBAAyB,EAAE,CAAC;AACrC,YAAY,EAAE,2BAA2B,EAAE,CAAC"}
|
|
@@ -5,19 +5,21 @@ interface SqliteTransaction {
|
|
|
5
5
|
/** Runs statements that take no parameters. */
|
|
6
6
|
execAsync(source: string): Promise<void>;
|
|
7
7
|
/** Runs one statement that writes. */
|
|
8
|
-
runAsync(source: string, params
|
|
8
|
+
runAsync(source: string, params: SqliteBindValue[]): Promise<unknown>;
|
|
9
9
|
/** Returns the first row a query finds, or `null`. */
|
|
10
|
-
getFirstAsync<Row>(source: string, params
|
|
10
|
+
getFirstAsync<Row>(source: string, params: SqliteBindValue[]): Promise<Row | null>;
|
|
11
11
|
}
|
|
12
12
|
/** The part of an `expo-sqlite` database the outbox store uses. */
|
|
13
13
|
interface SqliteDatabase extends SqliteTransaction {
|
|
14
14
|
/** Returns every row a query finds. */
|
|
15
|
-
getAllAsync<Row>(source: string, params
|
|
15
|
+
getAllAsync<Row>(source: string, params: SqliteBindValue[]): Promise<Row[]>;
|
|
16
16
|
/** Runs `task` in one exclusive transaction: it commits when `task` resolves and rolls back when it throws. */
|
|
17
17
|
withExclusiveTransactionAsync(task: (transaction: SqliteTransaction) => Promise<void>): Promise<void>;
|
|
18
18
|
}
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
/** The `expo-sqlite` module, or anything that opens a database the same way. */
|
|
20
|
+
interface OvokSqlite {
|
|
21
|
+
/** Opens the named database, creating it when it does not exist. */
|
|
22
|
+
openDatabaseAsync(name: string): Promise<SqliteDatabase>;
|
|
23
|
+
}
|
|
24
|
+
export type { OvokSqlite, SqliteBindValue, SqliteDatabase, SqliteTransaction };
|
|
23
25
|
//# sourceMappingURL=sqlite-database.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sqlite-database.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/sqlite-database.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,KAAK,eAAe,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;AAE9C,sEAAsE;AACtE,UAAU,iBAAiB;IAEzB,+CAA+C;IAC/C,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzC,sCAAsC;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"sqlite-database.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/sqlite-database.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,KAAK,eAAe,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;AAE9C,sEAAsE;AACtE,UAAU,iBAAiB;IAEzB,+CAA+C;IAC/C,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzC,sCAAsC;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEtE,sDAAsD;IACtD,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;CACpF;AAED,mEAAmE;AACnE,UAAU,cAAe,SAAQ,iBAAiB;IAEhD,uCAAuC;IACvC,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAE5E,+GAA+G;IAC/G,6BAA6B,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvG;AAED,gFAAgF;AAChF,UAAU,UAAU;IAElB,oEAAoE;IACpE,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CAC1D;AAED,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,CAAC"}
|