@ovok/native 1.16.1-dev.2087 → 1.16.1-dev.2089
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/index.js +36 -0
- package/lib/commonjs/modules/next/index.js.map +1 -0
- package/lib/commonjs/modules/next/ovok.js +30 -0
- package/lib/commonjs/modules/next/ovok.js.map +1 -0
- package/lib/commonjs/modules/next/random-values.js +19 -0
- package/lib/commonjs/modules/next/random-values.js.map +1 -0
- package/lib/commonjs/modules/next/secure-store-storage.js +76 -0
- package/lib/commonjs/modules/next/secure-store-storage.js.map +1 -0
- package/lib/module/modules/next/index.js +6 -0
- package/lib/module/modules/next/index.js.map +1 -0
- package/lib/module/modules/next/ovok.js +27 -0
- package/lib/module/modules/next/ovok.js.map +1 -0
- package/lib/module/modules/next/random-values.js +15 -0
- package/lib/module/modules/next/random-values.js.map +1 -0
- package/lib/module/modules/next/secure-store-storage.js +72 -0
- package/lib/module/modules/next/secure-store-storage.js.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/index.d.ts +7 -0
- package/lib/typescript/commonjs/src/modules/next/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/ovok.d.ts +20 -0
- package/lib/typescript/commonjs/src/modules/next/ovok.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/random-values.d.ts +11 -0
- package/lib/typescript/commonjs/src/modules/next/random-values.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/secure-store-storage.d.ts +22 -0
- package/lib/typescript/commonjs/src/modules/next/secure-store-storage.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/index.d.ts +7 -0
- package/lib/typescript/module/src/modules/next/index.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/ovok.d.ts +20 -0
- package/lib/typescript/module/src/modules/next/ovok.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/random-values.d.ts +11 -0
- package/lib/typescript/module/src/modules/next/random-values.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/secure-store-storage.d.ts +22 -0
- package/lib/typescript/module/src/modules/next/secure-store-storage.d.ts.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
Ovok: true,
|
|
8
|
+
SecureStoreStorage: true
|
|
9
|
+
};
|
|
10
|
+
Object.defineProperty(exports, "Ovok", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _ovok.Ovok;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "SecureStoreStorage", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () {
|
|
19
|
+
return _secureStoreStorage.SecureStoreStorage;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
var _next = require("@ovok/core/next");
|
|
23
|
+
Object.keys(_next).forEach(function (key) {
|
|
24
|
+
if (key === "default" || key === "__esModule") return;
|
|
25
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
26
|
+
if (key in exports && exports[key] === _next[key]) return;
|
|
27
|
+
Object.defineProperty(exports, key, {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function () {
|
|
30
|
+
return _next[key];
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
var _ovok = require("./ovok.js");
|
|
35
|
+
var _secureStoreStorage = require("./secure-store-storage.js");
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_next","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_ovok","_secureStoreStorage"],"sourceRoot":"../../../../src","sources":["modules/next/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,KAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,KAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,KAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,KAAA,GAAAb,OAAA;AAGA,IAAAc,mBAAA,GAAAd,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Ovok = void 0;
|
|
7
|
+
var _next = require("@ovok/core/next");
|
|
8
|
+
var _randomValues = require("./random-values.js");
|
|
9
|
+
var _secureStoreStorage = require("./secure-store-storage.js");
|
|
10
|
+
/** No clientSecret: anything shipped inside an app can be extracted from it. */
|
|
11
|
+
|
|
12
|
+
/** The @ovok/core/next client with the session kept in the device's secure store. */
|
|
13
|
+
class Ovok extends _next.Ovok {
|
|
14
|
+
constructor(config) {
|
|
15
|
+
const {
|
|
16
|
+
secureStore,
|
|
17
|
+
secureStoreOptions,
|
|
18
|
+
getRandomValues,
|
|
19
|
+
...shared
|
|
20
|
+
} = config;
|
|
21
|
+
(0, _randomValues.installRandomValues)(getRandomValues);
|
|
22
|
+
super({
|
|
23
|
+
...shared,
|
|
24
|
+
clientSecret: undefined,
|
|
25
|
+
storage: new _secureStoreStorage.SecureStoreStorage(secureStore, secureStoreOptions)
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.Ovok = Ovok;
|
|
30
|
+
//# sourceMappingURL=ovok.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_next","require","_randomValues","_secureStoreStorage","Ovok","CoreOvok","constructor","config","secureStore","secureStoreOptions","getRandomValues","shared","installRandomValues","clientSecret","undefined","storage","SecureStoreStorage","exports"],"sourceRoot":"../../../../src","sources":["modules/next/ovok.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAMA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,mBAAA,GAAAF,OAAA;AAIA;;AAOA;AACA,MAAMG,IAAI,SAASC,UAAQ,CAAC;EAC1BC,WAAWA,CAACC,MAAwB,EAAE;IACpC,MAAM;MAAEC,WAAW;MAAEC,kBAAkB;MAAEC,eAAe;MAAE,GAAGC;IAAO,CAAC,GAAGJ,MAAM;IAE9E,IAAAK,iCAAmB,EAACF,eAAe,CAAC;IACpC,KAAK,CAAC;MACJ,GAAGC,MAAM;MACTE,YAAY,EAAEC,SAAS;MACvBC,OAAO,EAAE,IAAIC,sCAAkB,CAACR,WAAW,EAAEC,kBAAkB;IACjE,CAAC,CAAC;EACJ;AACF;AAACQ,OAAA,CAAAb,IAAA,GAAAA,IAAA","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.installRandomValues = void 0;
|
|
7
|
+
/** Hermes has no crypto.getRandomValues, and PKCE sign-in needs it; an existing one always wins. */
|
|
8
|
+
const installRandomValues = (source, runtime = globalThis) => {
|
|
9
|
+
const present = typeof runtime.crypto?.getRandomValues === "function";
|
|
10
|
+
if (present || source === undefined) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
runtime.crypto = {
|
|
14
|
+
...runtime.crypto,
|
|
15
|
+
getRandomValues: source
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
exports.installRandomValues = installRandomValues;
|
|
19
|
+
//# sourceMappingURL=random-values.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["installRandomValues","source","runtime","globalThis","present","crypto","getRandomValues","undefined","exports"],"sourceRoot":"../../../../src","sources":["modules/next/random-values.ts"],"mappings":";;;;;;AAIA;AACA,MAAMA,mBAAmB,GAAGA,CAC1BC,MAAsC,EACtCC,OAA4B,GAAGC,UAAiC,KACvD;EACT,MAAMC,OAAO,GAAG,OAAOF,OAAO,CAACG,MAAM,EAAEC,eAAe,KAAK,UAAU;EAErE,IAAIF,OAAO,IAAIH,MAAM,KAAKM,SAAS,EAAE;IACnC;EACF;EAEAL,OAAO,CAACG,MAAM,GAAG;IAAE,GAAGH,OAAO,CAACG,MAAM;IAAEC,eAAe,EAAEL;EAAO,CAAC;AACjE,CAAC;AAACO,OAAA,CAAAR,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SecureStoreStorage = void 0;
|
|
7
|
+
/** The part of expo-secure-store the storage needs; the host app passes the module in. */
|
|
8
|
+
|
|
9
|
+
/** Expo warns past 2048 bytes per value; 1024 UTF-16 units stays under it for any text. */
|
|
10
|
+
const CHUNK_LENGTH = 1024;
|
|
11
|
+
const KEY_UNSAFE_CHARACTERS = /[^\w.-]/g;
|
|
12
|
+
|
|
13
|
+
/** Splits each value across numbered entries and keeps the count under the key itself. */
|
|
14
|
+
class SecureStoreStorage {
|
|
15
|
+
constructor(store, options) {
|
|
16
|
+
this.store = store;
|
|
17
|
+
this.options = options;
|
|
18
|
+
}
|
|
19
|
+
async getItem(key) {
|
|
20
|
+
try {
|
|
21
|
+
return await this.read(safeKey(key));
|
|
22
|
+
} catch {
|
|
23
|
+
// A locked keychain rejects reads before first unlock; that is not a missing value to delete.
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
async setItem(key, value) {
|
|
28
|
+
const base = safeKey(key);
|
|
29
|
+
const previousCount = await this.chunkCount(base);
|
|
30
|
+
const chunks = splitIntoChunks(value);
|
|
31
|
+
await Promise.all(chunks.map((chunk, index) => this.store.setItemAsync(chunkKey(base, index), chunk, this.options)));
|
|
32
|
+
await this.store.setItemAsync(base, String(chunks.length), this.options);
|
|
33
|
+
await this.deleteChunks(base, chunks.length, previousCount);
|
|
34
|
+
}
|
|
35
|
+
async removeItem(key) {
|
|
36
|
+
const base = safeKey(key);
|
|
37
|
+
const count = await this.chunkCount(base);
|
|
38
|
+
await this.store.deleteItemAsync(base, this.options);
|
|
39
|
+
await this.deleteChunks(base, 0, count);
|
|
40
|
+
}
|
|
41
|
+
async read(base) {
|
|
42
|
+
const count = await this.chunkCount(base);
|
|
43
|
+
const chunks = await Promise.all(indexes(0, count).map(index => this.store.getItemAsync(chunkKey(base, index), this.options)));
|
|
44
|
+
const complete = count > 0 && chunks.every(chunk => chunk !== null);
|
|
45
|
+
return complete ? chunks.join("") : null;
|
|
46
|
+
}
|
|
47
|
+
async chunkCount(base) {
|
|
48
|
+
const raw = await this.store.getItemAsync(base, this.options);
|
|
49
|
+
const count = Number(raw);
|
|
50
|
+
return raw !== null && Number.isInteger(count) && count > 0 ? count : 0;
|
|
51
|
+
}
|
|
52
|
+
async deleteChunks(base, from, to) {
|
|
53
|
+
await Promise.all(indexes(from, to).map(index => this.store.deleteItemAsync(chunkKey(base, index), this.options)));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.SecureStoreStorage = SecureStoreStorage;
|
|
57
|
+
const safeKey = key => key.replace(KEY_UNSAFE_CHARACTERS, "_");
|
|
58
|
+
const chunkKey = (base, index) => `${base}.${index}`;
|
|
59
|
+
const indexes = (from, to) => Array.from({
|
|
60
|
+
length: Math.max(0, to - from)
|
|
61
|
+
}, (_, offset) => from + offset);
|
|
62
|
+
|
|
63
|
+
/** Never ends a chunk inside a surrogate pair, so each stored entry is valid text. */
|
|
64
|
+
const splitIntoChunks = value => {
|
|
65
|
+
const chunks = [];
|
|
66
|
+
for (let start = 0; start < value.length || chunks.length === 0;) {
|
|
67
|
+
const end = Math.min(start + CHUNK_LENGTH, value.length);
|
|
68
|
+
const splitsPair = end < value.length && isHighSurrogate(value.charCodeAt(end - 1));
|
|
69
|
+
const safeEnd = splitsPair ? end - 1 : end;
|
|
70
|
+
chunks.push(value.slice(start, safeEnd));
|
|
71
|
+
start = safeEnd;
|
|
72
|
+
}
|
|
73
|
+
return chunks;
|
|
74
|
+
};
|
|
75
|
+
const isHighSurrogate = code => code >= 0xd800 && code <= 0xdbff;
|
|
76
|
+
//# sourceMappingURL=secure-store-storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CHUNK_LENGTH","KEY_UNSAFE_CHARACTERS","SecureStoreStorage","constructor","store","options","getItem","key","read","safeKey","setItem","value","base","previousCount","chunkCount","chunks","splitIntoChunks","Promise","all","map","chunk","index","setItemAsync","chunkKey","String","length","deleteChunks","removeItem","count","deleteItemAsync","indexes","getItemAsync","complete","every","join","raw","Number","isInteger","from","to","exports","replace","Array","Math","max","_","offset","start","end","min","splitsPair","isHighSurrogate","charCodeAt","safeEnd","push","slice","code"],"sourceRoot":"../../../../src","sources":["modules/next/secure-store-storage.ts"],"mappings":";;;;;;AAEA;;AAOA;AACA,MAAMA,YAAY,GAAG,IAAI;AACzB,MAAMC,qBAAqB,GAAG,UAAU;;AAExC;AACA,MAAMC,kBAAkB,CAAwB;EAC9CC,WAAWA,CACQC,KAAsB,EACtBC,OAAiC,EAClD;IAAA,KAFiBD,KAAsB,GAAtBA,KAAsB;IAAA,KACtBC,OAAiC,GAAjCA,OAAiC;EACjD;EAEH,MAAMC,OAAOA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ules/next/index.ts"],"mappings":";;AAAA,cAAc,iBAAiB;AAC/B,SAASA,IAAI,QAAQ,WAAQ;AAG7B,SAASC,kBAAkB,QAAQ,2BAAwB","ignoreList":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Ovok as CoreOvok } from "@ovok/core/next";
|
|
4
|
+
import { installRandomValues } from "./random-values.js";
|
|
5
|
+
import { SecureStoreStorage } from "./secure-store-storage.js";
|
|
6
|
+
|
|
7
|
+
/** No clientSecret: anything shipped inside an app can be extracted from it. */
|
|
8
|
+
|
|
9
|
+
/** The @ovok/core/next client with the session kept in the device's secure store. */
|
|
10
|
+
class Ovok extends CoreOvok {
|
|
11
|
+
constructor(config) {
|
|
12
|
+
const {
|
|
13
|
+
secureStore,
|
|
14
|
+
secureStoreOptions,
|
|
15
|
+
getRandomValues,
|
|
16
|
+
...shared
|
|
17
|
+
} = config;
|
|
18
|
+
installRandomValues(getRandomValues);
|
|
19
|
+
super({
|
|
20
|
+
...shared,
|
|
21
|
+
clientSecret: undefined,
|
|
22
|
+
storage: new SecureStoreStorage(secureStore, secureStoreOptions)
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export { Ovok };
|
|
27
|
+
//# sourceMappingURL=ovok.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Ovok","CoreOvok","installRandomValues","SecureStoreStorage","constructor","config","secureStore","secureStoreOptions","getRandomValues","shared","clientSecret","undefined","storage"],"sourceRoot":"../../../../src","sources":["modules/next/ovok.ts"],"mappings":";;AAAA,SAASA,IAAI,IAAIC,QAAQ,QAAQ,iBAAiB;AAMlD,SAASC,mBAAmB,QAAQ,oBAAiB;AACrD,SAASC,kBAAkB,QAAQ,2BAAwB;;AAI3D;;AAOA;AACA,MAAMH,IAAI,SAASC,QAAQ,CAAC;EAC1BG,WAAWA,CAACC,MAAwB,EAAE;IACpC,MAAM;MAAEC,WAAW;MAAEC,kBAAkB;MAAEC,eAAe;MAAE,GAAGC;IAAO,CAAC,GAAGJ,MAAM;IAE9EH,mBAAmB,CAACM,eAAe,CAAC;IACpC,KAAK,CAAC;MACJ,GAAGC,MAAM;MACTC,YAAY,EAAEC,SAAS;MACvBC,OAAO,EAAE,IAAIT,kBAAkB,CAACG,WAAW,EAAEC,kBAAkB;IACjE,CAAC,CAAC;EACJ;AACF;AAEA,SAASP,IAAI","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/** Hermes has no crypto.getRandomValues, and PKCE sign-in needs it; an existing one always wins. */
|
|
4
|
+
const installRandomValues = (source, runtime = globalThis) => {
|
|
5
|
+
const present = typeof runtime.crypto?.getRandomValues === "function";
|
|
6
|
+
if (present || source === undefined) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
runtime.crypto = {
|
|
10
|
+
...runtime.crypto,
|
|
11
|
+
getRandomValues: source
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export { installRandomValues };
|
|
15
|
+
//# sourceMappingURL=random-values.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["installRandomValues","source","runtime","globalThis","present","crypto","getRandomValues","undefined"],"sourceRoot":"../../../../src","sources":["modules/next/random-values.ts"],"mappings":";;AAIA;AACA,MAAMA,mBAAmB,GAAGA,CAC1BC,MAAsC,EACtCC,OAA4B,GAAGC,UAAiC,KACvD;EACT,MAAMC,OAAO,GAAG,OAAOF,OAAO,CAACG,MAAM,EAAEC,eAAe,KAAK,UAAU;EAErE,IAAIF,OAAO,IAAIH,MAAM,KAAKM,SAAS,EAAE;IACnC;EACF;EAEAL,OAAO,CAACG,MAAM,GAAG;IAAE,GAAGH,OAAO,CAACG,MAAM;IAAEC,eAAe,EAAEL;EAAO,CAAC;AACjE,CAAC;AAED,SAASD,mBAAmB","ignoreList":[]}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/** The part of expo-secure-store the storage needs; the host app passes the module in. */
|
|
4
|
+
|
|
5
|
+
/** Expo warns past 2048 bytes per value; 1024 UTF-16 units stays under it for any text. */
|
|
6
|
+
const CHUNK_LENGTH = 1024;
|
|
7
|
+
const KEY_UNSAFE_CHARACTERS = /[^\w.-]/g;
|
|
8
|
+
|
|
9
|
+
/** Splits each value across numbered entries and keeps the count under the key itself. */
|
|
10
|
+
class SecureStoreStorage {
|
|
11
|
+
constructor(store, options) {
|
|
12
|
+
this.store = store;
|
|
13
|
+
this.options = options;
|
|
14
|
+
}
|
|
15
|
+
async getItem(key) {
|
|
16
|
+
try {
|
|
17
|
+
return await this.read(safeKey(key));
|
|
18
|
+
} catch {
|
|
19
|
+
// A locked keychain rejects reads before first unlock; that is not a missing value to delete.
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
async setItem(key, value) {
|
|
24
|
+
const base = safeKey(key);
|
|
25
|
+
const previousCount = await this.chunkCount(base);
|
|
26
|
+
const chunks = splitIntoChunks(value);
|
|
27
|
+
await Promise.all(chunks.map((chunk, index) => this.store.setItemAsync(chunkKey(base, index), chunk, this.options)));
|
|
28
|
+
await this.store.setItemAsync(base, String(chunks.length), this.options);
|
|
29
|
+
await this.deleteChunks(base, chunks.length, previousCount);
|
|
30
|
+
}
|
|
31
|
+
async removeItem(key) {
|
|
32
|
+
const base = safeKey(key);
|
|
33
|
+
const count = await this.chunkCount(base);
|
|
34
|
+
await this.store.deleteItemAsync(base, this.options);
|
|
35
|
+
await this.deleteChunks(base, 0, count);
|
|
36
|
+
}
|
|
37
|
+
async read(base) {
|
|
38
|
+
const count = await this.chunkCount(base);
|
|
39
|
+
const chunks = await Promise.all(indexes(0, count).map(index => this.store.getItemAsync(chunkKey(base, index), this.options)));
|
|
40
|
+
const complete = count > 0 && chunks.every(chunk => chunk !== null);
|
|
41
|
+
return complete ? chunks.join("") : null;
|
|
42
|
+
}
|
|
43
|
+
async chunkCount(base) {
|
|
44
|
+
const raw = await this.store.getItemAsync(base, this.options);
|
|
45
|
+
const count = Number(raw);
|
|
46
|
+
return raw !== null && Number.isInteger(count) && count > 0 ? count : 0;
|
|
47
|
+
}
|
|
48
|
+
async deleteChunks(base, from, to) {
|
|
49
|
+
await Promise.all(indexes(from, to).map(index => this.store.deleteItemAsync(chunkKey(base, index), this.options)));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const safeKey = key => key.replace(KEY_UNSAFE_CHARACTERS, "_");
|
|
53
|
+
const chunkKey = (base, index) => `${base}.${index}`;
|
|
54
|
+
const indexes = (from, to) => Array.from({
|
|
55
|
+
length: Math.max(0, to - from)
|
|
56
|
+
}, (_, offset) => from + offset);
|
|
57
|
+
|
|
58
|
+
/** Never ends a chunk inside a surrogate pair, so each stored entry is valid text. */
|
|
59
|
+
const splitIntoChunks = value => {
|
|
60
|
+
const chunks = [];
|
|
61
|
+
for (let start = 0; start < value.length || chunks.length === 0;) {
|
|
62
|
+
const end = Math.min(start + CHUNK_LENGTH, value.length);
|
|
63
|
+
const splitsPair = end < value.length && isHighSurrogate(value.charCodeAt(end - 1));
|
|
64
|
+
const safeEnd = splitsPair ? end - 1 : end;
|
|
65
|
+
chunks.push(value.slice(start, safeEnd));
|
|
66
|
+
start = safeEnd;
|
|
67
|
+
}
|
|
68
|
+
return chunks;
|
|
69
|
+
};
|
|
70
|
+
const isHighSurrogate = code => code >= 0xd800 && code <= 0xdbff;
|
|
71
|
+
export { SecureStoreStorage };
|
|
72
|
+
//# sourceMappingURL=secure-store-storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CHUNK_LENGTH","KEY_UNSAFE_CHARACTERS","SecureStoreStorage","constructor","store","options","getItem","key","read","safeKey","setItem","value","base","previousCount","chunkCount","chunks","splitIntoChunks","Promise","all","map","chunk","index","setItemAsync","chunkKey","String","length","deleteChunks","removeItem","count","deleteItemAsync","indexes","getItemAsync","complete","every","join","raw","Number","isInteger","from","to","replace","Array","Math","max","_","offset","start","end","min","splitsPair","isHighSurrogate","charCodeAt","safeEnd","push","slice","code"],"sourceRoot":"../../../../src","sources":["modules/next/secure-store-storage.ts"],"mappings":";;AAEA;;AAOA;AACA,MAAMA,YAAY,GAAG,IAAI;AACzB,MAAMC,qBAAqB,GAAG,UAAU;;AAExC;AACA,MAAMC,kBAAkB,CAAwB;EAC9CC,WAAWA,CACQC,KAAsB,EACtBC,OAAiC,EAClD;IAAA,KAFiBD,KAAsB,GAAtBA,KAAsB;IAAA,KACtBC,OAAiC,GAAjCA,OAAiC;EACjD;EAEH,MAAMC,OAAOA,CAACC,GAAW,EAA0B;IACjD,IAAI;MACF,OAAO,MAAM,IAAI,CAACC,IAAI,CAACC,OAAO,CAACF,GAAG,CAAC,CAAC;IACtC,CAAC,CAAC,MAAM;MACN;MACA,OAAO,IAAI;IACb;EACF;EAEA,MAAMG,OAAOA,CAACH,GAAW,EAAEI,KAAa,EAAiB;IACvD,MAAMC,IAAI,GAAGH,OAAO,CAACF,GAAG,CAAC;IACzB,MAAMM,aAAa,GAAG,MAAM,IAAI,CAACC,UAAU,CAACF,IAAI,CAAC;IACjD,MAAMG,MAAM,GAAGC,eAAe,CAACL,KAAK,CAAC;IAErC,MAAMM,OAAO,CAACC,GAAG,CAACH,MAAM,CAACI,GAAG,CAAC,CAACC,KAAK,EAAEC,KAAK,KAAK,IAAI,CAACjB,KAAK,CAACkB,YAAY,CAACC,QAAQ,CAACX,IAAI,EAAES,KAAK,CAAC,EAAED,KAAK,EAAE,IAAI,CAACf,OAAO,CAAC,CAAC,CAAC;IACpH,MAAM,IAAI,CAACD,KAAK,CAACkB,YAAY,CAACV,IAAI,EAAEY,MAAM,CAACT,MAAM,CAACU,MAAM,CAAC,EAAE,IAAI,CAACpB,OAAO,CAAC;IACxE,MAAM,IAAI,CAACqB,YAAY,CAACd,IAAI,EAAEG,MAAM,CAACU,MAAM,EA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,GAAGF,GAAG,GAAG,CAAC,GAAGA,GAAG;IAE1ChC,MAAM,CAACsC,IAAI,CAAC1C,KAAK,CAAC2C,KAAK,CAACR,KAAK,EAAEM,OAAO,CAAC,CAAC;IACxCN,KAAK,GAAGM,OAAO;EACjB;EAEA,OAAOrC,MAAM;AACf,CAAC;AAED,MAAMmC,eAAe,GAAIK,IAAY,IAAcA,IAAI,IAAI,MAAM,IAAIA,IAAI,IAAI,MAAM;AAEnF,SAASrD,kBAAkB","ignoreList":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "@ovok/core/next";
|
|
2
|
+
export { Ovok } from "./ovok";
|
|
3
|
+
export type { OvokNativeConfig } from "./ovok";
|
|
4
|
+
export type { RandomValuesSource } from "./random-values";
|
|
5
|
+
export { SecureStoreStorage } from "./secure-store-storage";
|
|
6
|
+
export type { OvokSecureStore } from "./secure-store-storage";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/next/index.ts"],"names":[],"mappings":"AAAA,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"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Ovok as CoreOvok } from "@ovok/core/next";
|
|
2
|
+
import type { RandomValuesSource } from "./random-values";
|
|
3
|
+
import type { OvokSecureStore } from "./secure-store-storage";
|
|
4
|
+
import type { OvokConfig } from "@ovok/core/next";
|
|
5
|
+
type UserClientConfig = Extract<OvokConfig, {
|
|
6
|
+
clientSecret?: undefined;
|
|
7
|
+
}>;
|
|
8
|
+
/** No clientSecret: anything shipped inside an app can be extracted from it. */
|
|
9
|
+
type OvokNativeConfig = Omit<UserClientConfig, "storage" | "clientSecret"> & {
|
|
10
|
+
secureStore: OvokSecureStore;
|
|
11
|
+
secureStoreOptions?: Record<string, unknown>;
|
|
12
|
+
getRandomValues?: RandomValuesSource;
|
|
13
|
+
};
|
|
14
|
+
/** The @ovok/core/next client with the session kept in the device's secure store. */
|
|
15
|
+
declare class Ovok extends CoreOvok {
|
|
16
|
+
constructor(config: OvokNativeConfig);
|
|
17
|
+
}
|
|
18
|
+
export { Ovok };
|
|
19
|
+
export type { OvokNativeConfig };
|
|
20
|
+
//# sourceMappingURL=ovok.d.ts.map
|
|
@@ -0,0 +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,MAAM,iBAAiB,CAAC;AAKlD,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,CAAC,GAAG;IAC3E,WAAW,EAAE,eAAe,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7C,eAAe,CAAC,EAAE,kBAAkB,CAAC;CACtC,CAAC;AAEF,qFAAqF;AACrF,cAAM,IAAK,SAAQ,QAAQ;gBACb,MAAM,EAAE,gBAAgB;CAUrC;AAED,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,YAAY,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type RandomValuesSource = (array: Uint8Array) => Uint8Array;
|
|
2
|
+
type RandomValuesRuntime = {
|
|
3
|
+
crypto?: {
|
|
4
|
+
getRandomValues?: unknown;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
/** Hermes has no crypto.getRandomValues, and PKCE sign-in needs it; an existing one always wins. */
|
|
8
|
+
declare const installRandomValues: (source: RandomValuesSource | undefined, runtime?: RandomValuesRuntime) => void;
|
|
9
|
+
export { installRandomValues };
|
|
10
|
+
export type { RandomValuesSource };
|
|
11
|
+
//# sourceMappingURL=random-values.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"random-values.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/next/random-values.ts"],"names":[],"mappings":"AAAA,KAAK,kBAAkB,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,UAAU,CAAC;AAE5D,KAAK,mBAAmB,GAAG;IAAE,MAAM,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;CAAE,CAAC;AAEtE,oGAAoG;AACpG,QAAA,MAAM,mBAAmB,GACvB,QAAQ,kBAAkB,GAAG,SAAS,EACtC,UAAS,mBAAuD,KAC/D,IAQF,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAC/B,YAAY,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { OvokStorage } from "@ovok/core/next";
|
|
2
|
+
/** The part of expo-secure-store the storage needs; the host app passes the module in. */
|
|
3
|
+
interface OvokSecureStore {
|
|
4
|
+
getItemAsync: (key: string, options?: Record<string, unknown>) => Promise<string | null>;
|
|
5
|
+
setItemAsync: (key: string, value: string, options?: Record<string, unknown>) => Promise<void>;
|
|
6
|
+
deleteItemAsync: (key: string, options?: Record<string, unknown>) => Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
/** Splits each value across numbered entries and keeps the count under the key itself. */
|
|
9
|
+
declare class SecureStoreStorage implements OvokStorage {
|
|
10
|
+
private readonly store;
|
|
11
|
+
private readonly options?;
|
|
12
|
+
constructor(store: OvokSecureStore, options?: Record<string, unknown> | undefined);
|
|
13
|
+
getItem(key: string): Promise<string | null>;
|
|
14
|
+
setItem(key: string, value: string): Promise<void>;
|
|
15
|
+
removeItem(key: string): Promise<void>;
|
|
16
|
+
private read;
|
|
17
|
+
private chunkCount;
|
|
18
|
+
private deleteChunks;
|
|
19
|
+
}
|
|
20
|
+
export { SecureStoreStorage };
|
|
21
|
+
export type { OvokSecureStore };
|
|
22
|
+
//# sourceMappingURL=secure-store-storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secure-store-storage.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/next/secure-store-storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,0FAA0F;AAC1F,UAAU,eAAe;IACvB,YAAY,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACzF,YAAY,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/F,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACpF;AAMD,0FAA0F;AAC1F,cAAM,kBAAmB,YAAW,WAAW;IAE3C,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;gBADR,KAAK,EAAE,eAAe,EACtB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,YAAA;IAG9C,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAS5C,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAUlD,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAQ9B,IAAI;YAYJ,UAAU;YAOV,YAAY;CAG3B;AA2BD,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAC9B,YAAY,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "@ovok/core/next";
|
|
2
|
+
export { Ovok } from "./ovok";
|
|
3
|
+
export type { OvokNativeConfig } from "./ovok";
|
|
4
|
+
export type { RandomValuesSource } from "./random-values";
|
|
5
|
+
export { SecureStoreStorage } from "./secure-store-storage";
|
|
6
|
+
export type { OvokSecureStore } from "./secure-store-storage";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/next/index.ts"],"names":[],"mappings":"AAAA,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"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Ovok as CoreOvok } from "@ovok/core/next";
|
|
2
|
+
import type { RandomValuesSource } from "./random-values";
|
|
3
|
+
import type { OvokSecureStore } from "./secure-store-storage";
|
|
4
|
+
import type { OvokConfig } from "@ovok/core/next";
|
|
5
|
+
type UserClientConfig = Extract<OvokConfig, {
|
|
6
|
+
clientSecret?: undefined;
|
|
7
|
+
}>;
|
|
8
|
+
/** No clientSecret: anything shipped inside an app can be extracted from it. */
|
|
9
|
+
type OvokNativeConfig = Omit<UserClientConfig, "storage" | "clientSecret"> & {
|
|
10
|
+
secureStore: OvokSecureStore;
|
|
11
|
+
secureStoreOptions?: Record<string, unknown>;
|
|
12
|
+
getRandomValues?: RandomValuesSource;
|
|
13
|
+
};
|
|
14
|
+
/** The @ovok/core/next client with the session kept in the device's secure store. */
|
|
15
|
+
declare class Ovok extends CoreOvok {
|
|
16
|
+
constructor(config: OvokNativeConfig);
|
|
17
|
+
}
|
|
18
|
+
export { Ovok };
|
|
19
|
+
export type { OvokNativeConfig };
|
|
20
|
+
//# sourceMappingURL=ovok.d.ts.map
|
|
@@ -0,0 +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,MAAM,iBAAiB,CAAC;AAKlD,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,CAAC,GAAG;IAC3E,WAAW,EAAE,eAAe,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7C,eAAe,CAAC,EAAE,kBAAkB,CAAC;CACtC,CAAC;AAEF,qFAAqF;AACrF,cAAM,IAAK,SAAQ,QAAQ;gBACb,MAAM,EAAE,gBAAgB;CAUrC;AAED,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,YAAY,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type RandomValuesSource = (array: Uint8Array) => Uint8Array;
|
|
2
|
+
type RandomValuesRuntime = {
|
|
3
|
+
crypto?: {
|
|
4
|
+
getRandomValues?: unknown;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
/** Hermes has no crypto.getRandomValues, and PKCE sign-in needs it; an existing one always wins. */
|
|
8
|
+
declare const installRandomValues: (source: RandomValuesSource | undefined, runtime?: RandomValuesRuntime) => void;
|
|
9
|
+
export { installRandomValues };
|
|
10
|
+
export type { RandomValuesSource };
|
|
11
|
+
//# sourceMappingURL=random-values.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"random-values.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/next/random-values.ts"],"names":[],"mappings":"AAAA,KAAK,kBAAkB,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,UAAU,CAAC;AAE5D,KAAK,mBAAmB,GAAG;IAAE,MAAM,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;CAAE,CAAC;AAEtE,oGAAoG;AACpG,QAAA,MAAM,mBAAmB,GACvB,QAAQ,kBAAkB,GAAG,SAAS,EACtC,UAAS,mBAAuD,KAC/D,IAQF,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAC/B,YAAY,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { OvokStorage } from "@ovok/core/next";
|
|
2
|
+
/** The part of expo-secure-store the storage needs; the host app passes the module in. */
|
|
3
|
+
interface OvokSecureStore {
|
|
4
|
+
getItemAsync: (key: string, options?: Record<string, unknown>) => Promise<string | null>;
|
|
5
|
+
setItemAsync: (key: string, value: string, options?: Record<string, unknown>) => Promise<void>;
|
|
6
|
+
deleteItemAsync: (key: string, options?: Record<string, unknown>) => Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
/** Splits each value across numbered entries and keeps the count under the key itself. */
|
|
9
|
+
declare class SecureStoreStorage implements OvokStorage {
|
|
10
|
+
private readonly store;
|
|
11
|
+
private readonly options?;
|
|
12
|
+
constructor(store: OvokSecureStore, options?: Record<string, unknown> | undefined);
|
|
13
|
+
getItem(key: string): Promise<string | null>;
|
|
14
|
+
setItem(key: string, value: string): Promise<void>;
|
|
15
|
+
removeItem(key: string): Promise<void>;
|
|
16
|
+
private read;
|
|
17
|
+
private chunkCount;
|
|
18
|
+
private deleteChunks;
|
|
19
|
+
}
|
|
20
|
+
export { SecureStoreStorage };
|
|
21
|
+
export type { OvokSecureStore };
|
|
22
|
+
//# sourceMappingURL=secure-store-storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secure-store-storage.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/next/secure-store-storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,0FAA0F;AAC1F,UAAU,eAAe;IACvB,YAAY,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACzF,YAAY,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/F,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACpF;AAMD,0FAA0F;AAC1F,cAAM,kBAAmB,YAAW,WAAW;IAE3C,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;gBADR,KAAK,EAAE,eAAe,EACtB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,YAAA;IAG9C,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAS5C,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAUlD,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAQ9B,IAAI;YAYJ,UAAU;YAOV,YAAY;CAG3B;AA2BD,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAC9B,YAAY,EAAE,eAAe,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ovok/native",
|
|
3
|
-
"version": "1.16.1-dev.
|
|
3
|
+
"version": "1.16.1-dev.2089+485aa0b",
|
|
4
4
|
"description": "React native component sdk for OVOK",
|
|
5
5
|
"source": "./src/index.tsx",
|
|
6
6
|
"main": "./lib/commonjs/index.js",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"@medplum/react-hooks": "3.2.23",
|
|
107
107
|
"@opentelemetry/api": "^1.9.1",
|
|
108
108
|
"@opentelemetry/api-logs": "^0.222.0",
|
|
109
|
-
"@ovok/core": "
|
|
109
|
+
"@ovok/core": "0.4.49-dev.496",
|
|
110
110
|
"@react-native-community/datetimepicker": "^9.1.0",
|
|
111
111
|
"@react-native-community/netinfo": "^12.0.1",
|
|
112
112
|
"@react-native-google-signin/google-signin": "^16.1.2",
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
"@kingstinct/react-native-healthkit": "*",
|
|
187
187
|
"@opentelemetry/api": "^1.9.1",
|
|
188
188
|
"@opentelemetry/api-logs": "^0.222.0",
|
|
189
|
-
"@ovok/core": ">=0.4.
|
|
189
|
+
"@ovok/core": ">=0.4.49-dev.496 || >=0.4.49-0",
|
|
190
190
|
"@react-native-community/datetimepicker": "*",
|
|
191
191
|
"@react-native-community/netinfo": "*",
|
|
192
192
|
"@react-native-google-signin/google-signin": "*",
|