@ownables/platform-browser 0.1.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -0
- package/dist/core/src/index.d.ts +21 -0
- package/dist/core/src/index.d.ts.map +1 -0
- package/dist/core/src/index.js +20 -0
- package/dist/core/src/index.js.map +1 -0
- package/dist/core/src/interfaces/core.d.ts +53 -0
- package/dist/core/src/interfaces/core.d.ts.map +1 -0
- package/dist/core/src/interfaces/core.js +2 -0
- package/dist/core/src/interfaces/core.js.map +1 -0
- package/dist/core/src/logger.d.ts +3 -0
- package/dist/core/src/logger.d.ts.map +1 -0
- package/dist/core/src/logger.js +2 -0
- package/dist/core/src/logger.js.map +1 -0
- package/dist/core/src/ownableErrorMessage.d.ts +2 -0
- package/dist/core/src/ownableErrorMessage.d.ts.map +1 -0
- package/dist/core/src/ownableErrorMessage.js +20 -0
- package/dist/core/src/ownableErrorMessage.js.map +1 -0
- package/dist/core/src/progress.d.ts +3 -0
- package/dist/core/src/progress.d.ts.map +1 -0
- package/dist/core/src/progress.js +8 -0
- package/dist/core/src/progress.js.map +1 -0
- package/dist/core/src/services/EventChain.service.d.ts +47 -0
- package/dist/core/src/services/EventChain.service.d.ts.map +1 -0
- package/dist/core/src/services/EventChain.service.js +113 -0
- package/dist/core/src/services/EventChain.service.js.map +1 -0
- package/dist/core/src/services/Ownable.service.d.ts +60 -0
- package/dist/core/src/services/Ownable.service.d.ts.map +1 -0
- package/dist/core/src/services/Ownable.service.js +421 -0
- package/dist/core/src/services/Ownable.service.js.map +1 -0
- package/dist/core/src/services/Polling.service.d.ts +31 -0
- package/dist/core/src/services/Polling.service.d.ts.map +1 -0
- package/dist/core/src/services/Polling.service.js +109 -0
- package/dist/core/src/services/Polling.service.js.map +1 -0
- package/dist/core/src/services/SIWE.service.d.ts +16 -0
- package/dist/core/src/services/SIWE.service.d.ts.map +1 -0
- package/dist/core/src/services/SIWE.service.js +123 -0
- package/dist/core/src/services/SIWE.service.js.map +1 -0
- package/dist/core/src/services/StateStoreRecordStore.service.d.ts +13 -0
- package/dist/core/src/services/StateStoreRecordStore.service.d.ts.map +1 -0
- package/dist/core/src/services/StateStoreRecordStore.service.js +76 -0
- package/dist/core/src/services/StateStoreRecordStore.service.js.map +1 -0
- package/dist/core/src/services/WorkerRPC.service.d.ts +37 -0
- package/dist/core/src/services/WorkerRPC.service.d.ts.map +1 -0
- package/dist/core/src/services/WorkerRPC.service.js +219 -0
- package/dist/core/src/services/WorkerRPC.service.js.map +1 -0
- package/dist/core/src/services/workerSource.d.ts +2 -0
- package/dist/core/src/services/workerSource.d.ts.map +1 -0
- package/dist/core/src/services/workerSource.js +72 -0
- package/dist/core/src/services/workerSource.js.map +1 -0
- package/dist/core/src/types/Authority.d.ts +40 -0
- package/dist/core/src/types/Authority.d.ts.map +1 -0
- package/dist/core/src/types/Authority.js +2 -0
- package/dist/core/src/types/Authority.js.map +1 -0
- package/dist/core/src/types/EventChainStore.d.ts +12 -0
- package/dist/core/src/types/EventChainStore.d.ts.map +1 -0
- package/dist/core/src/types/EventChainStore.js +2 -0
- package/dist/core/src/types/EventChainStore.js.map +1 -0
- package/dist/core/src/types/MessageInfo.d.ts +19 -0
- package/dist/core/src/types/MessageInfo.d.ts.map +1 -0
- package/dist/core/src/types/MessageInfo.js +2 -0
- package/dist/core/src/types/MessageInfo.js.map +1 -0
- package/dist/core/src/types/OwnableRuntime.d.ts +40 -0
- package/dist/core/src/types/OwnableRuntime.d.ts.map +1 -0
- package/dist/core/src/types/OwnableRuntime.js +2 -0
- package/dist/core/src/types/OwnableRuntime.js.map +1 -0
- package/dist/core/src/types/Polling.d.ts +14 -0
- package/dist/core/src/types/Polling.d.ts.map +1 -0
- package/dist/core/src/types/Polling.js +2 -0
- package/dist/core/src/types/Polling.js.map +1 -0
- package/dist/core/src/types/SIWE.d.ts +30 -0
- package/dist/core/src/types/SIWE.d.ts.map +1 -0
- package/dist/core/src/types/SIWE.js +2 -0
- package/dist/core/src/types/SIWE.js.map +1 -0
- package/dist/core/src/types/TypedCosmWasmMsg.d.ts +12 -0
- package/dist/core/src/types/TypedCosmWasmMsg.d.ts.map +1 -0
- package/dist/core/src/types/TypedCosmWasmMsg.js +2 -0
- package/dist/core/src/types/TypedCosmWasmMsg.js.map +1 -0
- package/dist/core/src/types/TypedDict.d.ts +4 -0
- package/dist/core/src/types/TypedDict.d.ts.map +1 -0
- package/dist/core/src/types/TypedDict.js +2 -0
- package/dist/core/src/types/TypedDict.js.map +1 -0
- package/dist/core/src/types/TypedOwnableInfo.d.ts +34 -0
- package/dist/core/src/types/TypedOwnableInfo.d.ts.map +1 -0
- package/dist/core/src/types/TypedOwnableInfo.js +2 -0
- package/dist/core/src/types/TypedOwnableInfo.js.map +1 -0
- package/dist/core/src/types/TypedPackage.d.ts +35 -0
- package/dist/core/src/types/TypedPackage.d.ts.map +1 -0
- package/dist/core/src/types/TypedPackage.js +2 -0
- package/dist/core/src/types/TypedPackage.js.map +1 -0
- package/dist/platform-browser/src/index.d.ts +11 -0
- package/dist/platform-browser/src/index.d.ts.map +1 -0
- package/dist/platform-browser/src/index.js +11 -0
- package/dist/platform-browser/src/index.js.map +1 -0
- package/dist/platform-browser/src/services/IDB.service.d.ts +29 -0
- package/dist/platform-browser/src/services/IDB.service.d.ts.map +1 -0
- package/dist/platform-browser/src/services/IDB.service.js +192 -0
- package/dist/platform-browser/src/services/IDB.service.js.map +1 -0
- package/dist/platform-browser/src/services/LocalStorage.service.d.ts +14 -0
- package/dist/platform-browser/src/services/LocalStorage.service.d.ts.map +1 -0
- package/dist/platform-browser/src/services/LocalStorage.service.js +57 -0
- package/dist/platform-browser/src/services/LocalStorage.service.js.map +1 -0
- package/dist/platform-browser/src/services/Package.service.d.ts +49 -0
- package/dist/platform-browser/src/services/Package.service.d.ts.map +1 -0
- package/dist/platform-browser/src/services/Package.service.js +466 -0
- package/dist/platform-browser/src/services/Package.service.js.map +1 -0
- package/dist/platform-browser/src/services/Relay.service.d.ts +59 -0
- package/dist/platform-browser/src/services/Relay.service.d.ts.map +1 -0
- package/dist/platform-browser/src/services/Relay.service.js +299 -0
- package/dist/platform-browser/src/services/Relay.service.js.map +1 -0
- package/dist/platform-browser/src/services/SessionStorage.service.d.ts +7 -0
- package/dist/platform-browser/src/services/SessionStorage.service.d.ts.map +1 -0
- package/dist/platform-browser/src/services/SessionStorage.service.js +16 -0
- package/dist/platform-browser/src/services/SessionStorage.service.js.map +1 -0
- package/dist/platform-browser/src/utils/calculateCid.d.ts +2 -0
- package/dist/platform-browser/src/utils/calculateCid.d.ts.map +1 -0
- package/dist/platform-browser/src/utils/calculateCid.js +18 -0
- package/dist/platform-browser/src/utils/calculateCid.js.map +1 -0
- package/package.json +7 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Authority.js","sourceRoot":"","sources":["../../../../../core/src/types/Authority.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IEventChainJSON } from 'eqty-core';
|
|
2
|
+
export interface StoredChainInfo {
|
|
3
|
+
chain: IEventChainJSON;
|
|
4
|
+
state: string;
|
|
5
|
+
package: string;
|
|
6
|
+
isConsumed?: boolean;
|
|
7
|
+
uniqueMessageHash: string;
|
|
8
|
+
created: Date;
|
|
9
|
+
latestHash: string;
|
|
10
|
+
keywords: string[];
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=EventChainStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventChainStore.d.ts","sourceRoot":"","sources":["../../../../../core/src/types/EventChainStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,IAAI,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventChainStore.js","sourceRoot":"","sources":["../../../../../core/src/types/EventChainStore.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Binary } from "eqty-core";
|
|
2
|
+
export interface MessageInfo {
|
|
3
|
+
hash: string;
|
|
4
|
+
recipient: string;
|
|
5
|
+
sender: string | Object;
|
|
6
|
+
size: number;
|
|
7
|
+
timestamp: Date;
|
|
8
|
+
type: string;
|
|
9
|
+
}
|
|
10
|
+
export interface MessageExt extends MessageInfo {
|
|
11
|
+
data: any;
|
|
12
|
+
sender: Object;
|
|
13
|
+
signature: Binary;
|
|
14
|
+
_hash: Binary;
|
|
15
|
+
parsedData: string;
|
|
16
|
+
messageHash?: string | any;
|
|
17
|
+
message?: MessageExt | any;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=MessageInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageInfo.d.ts","sourceRoot":"","sources":["../../../../../core/src/types/MessageInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,IAAI,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,UAAW,SAAQ,WAAW;IAC7C,IAAI,EAAE,GAAG,CAAC;IACV,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IAC3B,OAAO,CAAC,EAAE,UAAU,GAAG,GAAG,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageInfo.js","sourceRoot":"","sources":["../../../../../core/src/types/MessageInfo.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type TypedDict from './TypedDict';
|
|
2
|
+
export type StateDump = Array<[ArrayLike<number>, ArrayLike<number>]>;
|
|
3
|
+
export interface CosmWasmMessageInfo {
|
|
4
|
+
sender: string;
|
|
5
|
+
funds: object[];
|
|
6
|
+
}
|
|
7
|
+
export interface CosmWasmEvent {
|
|
8
|
+
type: string;
|
|
9
|
+
attributes: TypedDict<string>;
|
|
10
|
+
}
|
|
11
|
+
export interface OwnableRPC {
|
|
12
|
+
initialize: (js: string, wasm: Uint8Array) => Promise<void>;
|
|
13
|
+
instantiate: (msg: TypedDict, info: CosmWasmMessageInfo) => Promise<{
|
|
14
|
+
attributes: TypedDict<string>;
|
|
15
|
+
state: StateDump;
|
|
16
|
+
}>;
|
|
17
|
+
execute: (msg: TypedDict, info: CosmWasmMessageInfo, state: StateDump) => Promise<{
|
|
18
|
+
attributes: TypedDict<string>;
|
|
19
|
+
events: Array<CosmWasmEvent>;
|
|
20
|
+
data: string;
|
|
21
|
+
state: StateDump;
|
|
22
|
+
}>;
|
|
23
|
+
externalEvent: (msg: TypedDict, info: TypedDict, state: StateDump) => Promise<{
|
|
24
|
+
attributes: TypedDict<string>;
|
|
25
|
+
events: Array<CosmWasmEvent>;
|
|
26
|
+
data: string;
|
|
27
|
+
state: StateDump;
|
|
28
|
+
}>;
|
|
29
|
+
query: (msg: TypedDict, state: StateDump) => Promise<any>;
|
|
30
|
+
refresh: (state: StateDump) => Promise<void>;
|
|
31
|
+
terminate: () => void;
|
|
32
|
+
setWidgetWindow: (win: unknown | null) => void;
|
|
33
|
+
}
|
|
34
|
+
export interface StateSnapshot {
|
|
35
|
+
eventIndex: number;
|
|
36
|
+
blockHash: string;
|
|
37
|
+
stateDump: StateDump;
|
|
38
|
+
timestamp: Date;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=OwnableRuntime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OwnableRuntime.d.ts","sourceRoot":"","sources":["../../../../../core/src/types/OwnableRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AAEzC,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAEtE,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5D,WAAW,EAAE,CACX,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,mBAAmB,KACtB,OAAO,CAAC;QAAE,UAAU,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;QAAC,KAAK,EAAE,SAAS,CAAA;KAAE,CAAC,CAAC;IAClE,OAAO,EAAE,CACP,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,mBAAmB,EACzB,KAAK,EAAE,SAAS,KACb,OAAO,CAAC;QACX,UAAU,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;QAC9B,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;QAC7B,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,SAAS,CAAC;KAClB,CAAC,CAAC;IACH,aAAa,EAAE,CACb,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,SAAS,KACb,OAAO,CAAC;QACX,UAAU,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;QAC9B,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;QAC7B,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,SAAS,CAAC;KAClB,CAAC,CAAC;IACH,KAAK,EAAE,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IAC1D,OAAO,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,eAAe,EAAE,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAC;CAChD;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,SAAS,CAAC;IACrB,SAAS,EAAE,IAAI,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OwnableRuntime.js","sourceRoot":"","sources":["../../../../../core/src/types/OwnableRuntime.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Relay polling is legacy and will be removed in a future major version.
|
|
3
|
+
* Prefer hub-backed notification flows.
|
|
4
|
+
*/
|
|
5
|
+
export interface RelayPollingClient {
|
|
6
|
+
url?: string;
|
|
7
|
+
relay: {
|
|
8
|
+
get(path: string, headers?: Record<string, string>): Promise<any>;
|
|
9
|
+
};
|
|
10
|
+
isAvailable(): Promise<boolean>;
|
|
11
|
+
ensureAuthenticated(): Promise<boolean>;
|
|
12
|
+
getAuthHeaders(): Record<string, string>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=Polling.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Polling.d.ts","sourceRoot":"","sources":["../../../../../core/src/types/Polling.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,EAAE;QAAE,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAA;KAAE,CAAC;IAC7E,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAChC,mBAAmB,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACxC,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC1C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Polling.js","sourceRoot":"","sources":["../../../../../core/src/types/Polling.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface SIWEMessage {
|
|
2
|
+
domain: string;
|
|
3
|
+
address: string;
|
|
4
|
+
statement?: string;
|
|
5
|
+
uri: string;
|
|
6
|
+
version: string;
|
|
7
|
+
chainId: number;
|
|
8
|
+
nonce: string;
|
|
9
|
+
issuedAt: string;
|
|
10
|
+
expirationTime?: string;
|
|
11
|
+
notBefore?: string;
|
|
12
|
+
requestId?: string;
|
|
13
|
+
resources?: string[];
|
|
14
|
+
}
|
|
15
|
+
export interface SIWEAuthResult {
|
|
16
|
+
success: boolean;
|
|
17
|
+
address?: string;
|
|
18
|
+
token?: string;
|
|
19
|
+
expiresIn?: string;
|
|
20
|
+
error?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface SIWEClientDeps {
|
|
23
|
+
fetchFn?: (input: string, init?: RequestInit) => Promise<{
|
|
24
|
+
ok: boolean;
|
|
25
|
+
json(): Promise<any>;
|
|
26
|
+
}>;
|
|
27
|
+
now?: () => Date;
|
|
28
|
+
nonceGenerator?: () => string;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=SIWE.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SIWE.d.ts","sourceRoot":"","sources":["../../../../../core/src/types/SIWE.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,CAAA;KAAE,CAAC,CAAC;IAChG,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,MAAM,CAAC;CAC/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SIWE.js","sourceRoot":"","sources":["../../../../../core/src/types/SIWE.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface TypedCosmWasmMethod {
|
|
2
|
+
required: string[];
|
|
3
|
+
properties: {
|
|
4
|
+
[methodName: string]: object;
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
export interface TypedCosmWasmMsg {
|
|
8
|
+
title: string;
|
|
9
|
+
oneOf: Array<TypedCosmWasmMethod>;
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=TypedCosmWasmMsg.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypedCosmWasmMsg.d.ts","sourceRoot":"","sources":["../../../../../core/src/types/TypedCosmWasmMsg.ts"],"names":[],"mappings":"AAAA,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,EAAE;QACV,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC;KAC9B,CAAC;CACH;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC;CACnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypedCosmWasmMsg.js","sourceRoot":"","sources":["../../../../../core/src/types/TypedCosmWasmMsg.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypedDict.d.ts","sourceRoot":"","sources":["../../../../../core/src/types/TypedDict.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC,CAAC,GAAG,GAAG;IACxC,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypedDict.js","sourceRoot":"","sources":["../../../../../core/src/types/TypedDict.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface TypedOwnableInfo {
|
|
2
|
+
owner: string;
|
|
3
|
+
issuer: string;
|
|
4
|
+
ownable_type?: string;
|
|
5
|
+
nft?: NftObject;
|
|
6
|
+
}
|
|
7
|
+
export interface NftObject {
|
|
8
|
+
address: string;
|
|
9
|
+
id: string;
|
|
10
|
+
lock_service?: any;
|
|
11
|
+
network: string;
|
|
12
|
+
}
|
|
13
|
+
export interface TypedMetadata {
|
|
14
|
+
name: string;
|
|
15
|
+
image?: string;
|
|
16
|
+
image_data?: string;
|
|
17
|
+
external_url?: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
background_color?: string;
|
|
20
|
+
animation_url?: string;
|
|
21
|
+
youtube_url?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface TypedOwnable {
|
|
24
|
+
owner: string;
|
|
25
|
+
email?: string;
|
|
26
|
+
name: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
keywords?: string[];
|
|
29
|
+
evmAddress: string;
|
|
30
|
+
network: string;
|
|
31
|
+
image: unknown | null;
|
|
32
|
+
templateId?: string;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=TypedOwnableInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypedOwnableInfo.d.ts","sourceRoot":"","sources":["../../../../../core/src/types/TypedOwnableInfo.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypedOwnableInfo.js","sourceRoot":"","sources":["../../../../../core/src/types/TypedOwnableInfo.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface TypedPackageCapabilities {
|
|
2
|
+
isDynamic: boolean;
|
|
3
|
+
hasMetadata: boolean;
|
|
4
|
+
hasWidgetState: boolean;
|
|
5
|
+
isConsumable: boolean;
|
|
6
|
+
isConsumer: boolean;
|
|
7
|
+
isTransferable: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface TypedPackage extends TypedPackageCapabilities {
|
|
10
|
+
title: string;
|
|
11
|
+
detail?: unknown;
|
|
12
|
+
name: string;
|
|
13
|
+
version?: string;
|
|
14
|
+
ownablesAbi?: string;
|
|
15
|
+
wireFormat?: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
cid: string;
|
|
18
|
+
chain?: unknown;
|
|
19
|
+
isNotLocal?: boolean;
|
|
20
|
+
uniqueMessageHash?: string;
|
|
21
|
+
versions: Array<{
|
|
22
|
+
date: Date;
|
|
23
|
+
cid: string;
|
|
24
|
+
uniqueMessageHash?: string;
|
|
25
|
+
}>;
|
|
26
|
+
keywords?: string[];
|
|
27
|
+
}
|
|
28
|
+
export interface TypedPackageStub {
|
|
29
|
+
title: string;
|
|
30
|
+
name: string;
|
|
31
|
+
description?: string;
|
|
32
|
+
stub: true;
|
|
33
|
+
isNotLocal?: boolean;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=TypedPackage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypedPackage.d.ts","sourceRoot":"","sources":["../../../../../core/src/types/TypedPackage.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,OAAO,CAAC;IACxB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,YAAa,SAAQ,wBAAwB;IAC5D,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,IAAI,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACzE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,IAAI,CAAC;IACX,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypedPackage.js","sourceRoot":"","sources":["../../../../../core/src/types/TypedPackage.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { default as IDBService } from './services/IDB.service';
|
|
2
|
+
export { default as LocalStorageService } from './services/LocalStorage.service';
|
|
3
|
+
export { default as PackageService } from './services/Package.service';
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Relay transport is legacy and will be removed in a future major version.
|
|
6
|
+
* Prefer hub upload/download with WalletConnect Notify packages.
|
|
7
|
+
*/
|
|
8
|
+
export { RelayService } from './services/Relay.service';
|
|
9
|
+
export { default as SessionStorageService } from './services/SessionStorage.service';
|
|
10
|
+
export { default as calculateCid } from './utils/calculateCid';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACvE;;;GAGG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AACrF,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { default as IDBService } from './services/IDB.service';
|
|
2
|
+
export { default as LocalStorageService } from './services/LocalStorage.service';
|
|
3
|
+
export { default as PackageService } from './services/Package.service';
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Relay transport is legacy and will be removed in a future major version.
|
|
6
|
+
* Prefer hub upload/download with WalletConnect Notify packages.
|
|
7
|
+
*/
|
|
8
|
+
export { RelayService } from './services/Relay.service';
|
|
9
|
+
export { default as SessionStorageService } from './services/SessionStorage.service';
|
|
10
|
+
export { default as calculateCid } from './utils/calculateCid';
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACvE;;;GAGG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AACrF,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import TypedDict from "@ownables/core/types/TypedDict";
|
|
2
|
+
export default class IDBService {
|
|
3
|
+
private db;
|
|
4
|
+
private readonly dbName;
|
|
5
|
+
private readonly indexedDBApi;
|
|
6
|
+
private static mainInstance;
|
|
7
|
+
constructor(db: IDBDatabase, dbName: string, indexedDBApi?: IDBFactory);
|
|
8
|
+
static main(indexedDBApi?: IDBFactory): Promise<IDBService>;
|
|
9
|
+
static open(suffix: string, indexedDBApi?: IDBFactory): Promise<IDBService>;
|
|
10
|
+
close(): Promise<void>;
|
|
11
|
+
private error;
|
|
12
|
+
get(store: string, key: string): Promise<any>;
|
|
13
|
+
getAll(store: string): Promise<Array<any>>;
|
|
14
|
+
getMap(store: string): Promise<Map<any, any>>;
|
|
15
|
+
keys(store: string): Promise<string[]>;
|
|
16
|
+
set(store: string, key: string, value: any): Promise<void>;
|
|
17
|
+
setAll(store: string, map: TypedDict | Map<any, any>): Promise<void>;
|
|
18
|
+
setAll(data: TypedDict<TypedDict | Map<any, any>>): Promise<void>;
|
|
19
|
+
clear(store: string): Promise<void>;
|
|
20
|
+
private upgrade;
|
|
21
|
+
listStores(): Promise<string[]>;
|
|
22
|
+
hasStore(store: string): Promise<boolean>;
|
|
23
|
+
createStore(...stores: string[]): Promise<void>;
|
|
24
|
+
deleteStore(store: string | RegExp): Promise<void>;
|
|
25
|
+
deleteDatabase(): Promise<void>;
|
|
26
|
+
deleteAllDatabases(): Promise<void>;
|
|
27
|
+
delete(store: string, key: string): Promise<void>;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=IDB.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IDB.service.d.ts","sourceRoot":"","sources":["../../../../src/services/IDB.service.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,gCAAgC,CAAC;AAKvD,MAAM,CAAC,OAAO,OAAO,UAAU;IAI3B,OAAO,CAAC,EAAE;IACV,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAL/B,OAAO,CAAC,MAAM,CAAC,YAAY,CAAa;gBAG9B,EAAE,EAAE,WAAW,EACN,MAAM,EAAE,MAAM,EACd,YAAY,GAAE,UAA6B;WAGjD,IAA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AC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAelD,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAU/B,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC;IAwBnC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CASxD"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
// Default base DB name; per-address DBs will suffix this with the address
|
|
2
|
+
const DEFAULT_DB_NAME = "ownables";
|
|
3
|
+
export default class IDBService {
|
|
4
|
+
db;
|
|
5
|
+
dbName;
|
|
6
|
+
indexedDBApi;
|
|
7
|
+
static mainInstance;
|
|
8
|
+
constructor(db, dbName, indexedDBApi = window.indexedDB) {
|
|
9
|
+
this.db = db;
|
|
10
|
+
this.dbName = dbName;
|
|
11
|
+
this.indexedDBApi = indexedDBApi;
|
|
12
|
+
}
|
|
13
|
+
static async main(indexedDBApi = window.indexedDB) {
|
|
14
|
+
if (this.mainInstance)
|
|
15
|
+
return this.mainInstance;
|
|
16
|
+
this.mainInstance = await this.open('', indexedDBApi);
|
|
17
|
+
return this.mainInstance;
|
|
18
|
+
}
|
|
19
|
+
static async open(suffix, indexedDBApi = window.indexedDB) {
|
|
20
|
+
const suffixClean = (suffix || "").trim().toLowerCase();
|
|
21
|
+
const dbName = suffixClean ? `${DEFAULT_DB_NAME}:${suffixClean}` : DEFAULT_DB_NAME;
|
|
22
|
+
const db = await new Promise((resolve, reject) => {
|
|
23
|
+
const request = indexedDBApi.open(dbName);
|
|
24
|
+
request.onsuccess = () => resolve(request.result);
|
|
25
|
+
request.onerror = (e) => reject(e.target.error);
|
|
26
|
+
});
|
|
27
|
+
return new IDBService(db, dbName, indexedDBApi);
|
|
28
|
+
}
|
|
29
|
+
// Close the DB connection for this instance
|
|
30
|
+
async close() {
|
|
31
|
+
this.db.close();
|
|
32
|
+
}
|
|
33
|
+
error(event) {
|
|
34
|
+
return event.target?.error || new Error("Unknown error");
|
|
35
|
+
}
|
|
36
|
+
async get(store, key) {
|
|
37
|
+
return new Promise(async (resolve, reject) => {
|
|
38
|
+
const tx = this.db.transaction(store, "readonly");
|
|
39
|
+
const request = tx.objectStore(store).get(key);
|
|
40
|
+
request.onsuccess = () => resolve(request.result);
|
|
41
|
+
request.onerror = (event) => reject(this.error(event));
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
async getAll(store) {
|
|
45
|
+
return new Promise(async (resolve, reject) => {
|
|
46
|
+
const tx = this.db.transaction(store, "readonly");
|
|
47
|
+
const request = tx.objectStore(store).getAll();
|
|
48
|
+
request.onsuccess = () => resolve(request.result);
|
|
49
|
+
request.onerror = (event) => reject(this.error(event));
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
async getMap(store) {
|
|
53
|
+
return new Promise(async (resolve, reject) => {
|
|
54
|
+
const tx = this.db.transaction(store, "readonly");
|
|
55
|
+
const request = tx.objectStore(store).openCursor();
|
|
56
|
+
const map = new Map();
|
|
57
|
+
request.onsuccess = () => {
|
|
58
|
+
const cursor = request.result;
|
|
59
|
+
if (cursor) {
|
|
60
|
+
map.set(cursor.primaryKey, cursor.value);
|
|
61
|
+
cursor.continue();
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
resolve(map);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
request.onerror = (event) => reject(this.error(event));
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
async keys(store) {
|
|
71
|
+
return new Promise(async (resolve, reject) => {
|
|
72
|
+
const tx = this.db
|
|
73
|
+
.transaction(store, "readonly")
|
|
74
|
+
.objectStore(store)
|
|
75
|
+
.getAllKeys();
|
|
76
|
+
tx.onsuccess = () => resolve(tx.result);
|
|
77
|
+
tx.onerror = (event) => reject(this.error(event));
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
async set(store, key, value) {
|
|
81
|
+
return new Promise(async (resolve, reject) => {
|
|
82
|
+
const tx = this.db.transaction(store, "readwrite");
|
|
83
|
+
const request = tx.objectStore(store).put(value, key);
|
|
84
|
+
request.onsuccess = () => resolve();
|
|
85
|
+
request.onerror = (event) => reject(this.error(event));
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
async setAll(a, b) {
|
|
89
|
+
const storeNames = b ? [a] : Object.keys(a);
|
|
90
|
+
const data = b ? { [a]: b } : a;
|
|
91
|
+
return new Promise(async (resolve, reject) => {
|
|
92
|
+
const tx = this.db.transaction(storeNames, "readwrite");
|
|
93
|
+
tx.oncomplete = () => resolve();
|
|
94
|
+
tx.onerror = (event) => reject(this.error(event));
|
|
95
|
+
tx.onabort = () => reject(new Error("Transaction aborted"));
|
|
96
|
+
try {
|
|
97
|
+
for (const [store, map] of Object.entries(data)) {
|
|
98
|
+
const objectStore = tx.objectStore(store);
|
|
99
|
+
const entries = map instanceof Map ? map.entries() : Object.entries(map);
|
|
100
|
+
for (const [key, value] of entries) {
|
|
101
|
+
objectStore.put(value, key);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
tx.abort();
|
|
107
|
+
reject(error);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
async clear(store) {
|
|
112
|
+
return new Promise(async (resolve, reject) => {
|
|
113
|
+
const tx = this.db.transaction(store, "readwrite");
|
|
114
|
+
const request = tx.objectStore(store).clear();
|
|
115
|
+
request.onsuccess = () => resolve();
|
|
116
|
+
request.onerror = (event) => reject(this.error(event));
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
async upgrade(action) {
|
|
120
|
+
const version = this.db.version; // Get version before closing DB
|
|
121
|
+
this.db.close();
|
|
122
|
+
this.db = await new Promise(async (resolve, reject) => {
|
|
123
|
+
const request = this.indexedDBApi.open(this.dbName, version + 1);
|
|
124
|
+
request.onupgradeneeded = () => action(request.result);
|
|
125
|
+
request.onsuccess = () => resolve(request.result);
|
|
126
|
+
request.onerror = (e) => reject(e);
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
async listStores() {
|
|
130
|
+
return Array.from(this.db.objectStoreNames);
|
|
131
|
+
}
|
|
132
|
+
async hasStore(store) {
|
|
133
|
+
return this.db.objectStoreNames.contains(store);
|
|
134
|
+
}
|
|
135
|
+
async createStore(...stores) {
|
|
136
|
+
await this.upgrade((db) => {
|
|
137
|
+
for (const store of stores) {
|
|
138
|
+
if (!db.objectStoreNames.contains(store)) {
|
|
139
|
+
db.createObjectStore(store);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
// Verify
|
|
144
|
+
for (const store of stores) {
|
|
145
|
+
if (!this.db.objectStoreNames.contains(store)) {
|
|
146
|
+
throw new Error(`Failed to create store ${store}.`);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
async deleteStore(store) {
|
|
151
|
+
const stores = store instanceof RegExp
|
|
152
|
+
? Array.from(this.db.objectStoreNames).filter((name) => name.match(store))
|
|
153
|
+
: this.db.objectStoreNames.contains(store) ? [store] : [];
|
|
154
|
+
if (stores.length === 0)
|
|
155
|
+
return;
|
|
156
|
+
await this.upgrade((db2) => {
|
|
157
|
+
for (const s of stores) {
|
|
158
|
+
db2.deleteObjectStore(s);
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
async deleteDatabase() {
|
|
163
|
+
await this.close();
|
|
164
|
+
await new Promise((resolve, reject) => {
|
|
165
|
+
const request = this.indexedDBApi.deleteDatabase(this.dbName);
|
|
166
|
+
request.onsuccess = () => resolve();
|
|
167
|
+
request.onerror = (event) => reject(this.error(event));
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
async deleteAllDatabases() {
|
|
171
|
+
await this.close();
|
|
172
|
+
const dbs = await this.indexedDBApi.databases();
|
|
173
|
+
await Promise.all(dbs
|
|
174
|
+
.map((d) => d.name)
|
|
175
|
+
.filter((name) => name && (name === DEFAULT_DB_NAME || name.startsWith(`${DEFAULT_DB_NAME}:`)))
|
|
176
|
+
.map((name) => new Promise((resolve, reject) => {
|
|
177
|
+
const req = this.indexedDBApi.deleteDatabase(name);
|
|
178
|
+
req.onsuccess = () => resolve();
|
|
179
|
+
req.onerror = (ev) => reject(ev);
|
|
180
|
+
req.onblocked = () => resolve(); // tolerate blocked
|
|
181
|
+
})));
|
|
182
|
+
}
|
|
183
|
+
async delete(store, key) {
|
|
184
|
+
return new Promise(async (resolve, reject) => {
|
|
185
|
+
const tx = this.db.transaction(store, "readwrite");
|
|
186
|
+
const request = tx.objectStore(store).delete(key);
|
|
187
|
+
request.onsuccess = () => resolve();
|
|
188
|
+
request.onerror = (event) => reject(this.error(event));
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
//# sourceMappingURL=IDB.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IDB.service.js","sourceRoot":"","sources":["../../../../src/services/IDB.service.ts"],"names":[],"mappings":"AAEA,0EAA0E;AAC1E,MAAM,eAAe,GAAG,UAAU,CAAC;AAEnC,MAAM,CAAC,OAAO,OAAO,UAAU;IAInB;IACS;IACA;IALX,MAAM,CAAC,YAAY,CAAa;IAExC,YACU,EAAe,EACN,MAAc,EACd,eAA2B,MAAM,CAAC,SAAS;QAFpD,OAAE,GAAF,EAAE,CAAa;QACN,WAAM,GAAN,MAAM,CAAQ;QACd,iBAAY,GAAZ,YAAY,CAA+B;IAC3D,CAAC;IAEJ,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,eAA2B,MAAM,CAAC,SAAS;QAC3D,IAAI,IAAI,CAAC,YAAY;YAAE,OAAO,IAAI,CAAC,YAAY,CAAC;QAEhD,IAAI,CAAC,YAAY,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC;QACtD,OAAO,IAAI,CAAC,YAAY,CAAC;I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AC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export default class LocalStorageService {
|
|
2
|
+
private readonly prefix;
|
|
3
|
+
private readonly storage;
|
|
4
|
+
constructor(group?: string, storage?: Storage);
|
|
5
|
+
get(key: string): any;
|
|
6
|
+
set(key: string, value: any): void;
|
|
7
|
+
append(key: string, value: any): void;
|
|
8
|
+
remove(key: string): void;
|
|
9
|
+
clear(): void;
|
|
10
|
+
static clearAll(storage?: Storage): void;
|
|
11
|
+
removeItem(key: string, value: any): void;
|
|
12
|
+
removeByField(key: string, field: string, value: any): void;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=LocalStorage.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LocalStorage.service.d.ts","sourceRoot":"","sources":["../../../../src/services/LocalStorage.service.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,mBAAmB;IACtC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;gBAEtB,KAAK,GAAE,MAAW,EAAE,OAAO,GAAE,OAAsB;IAK/D,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG;IAKrB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;IAIlC,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;IAWrC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAIzB,KAAK,IAAI,IAAI;IAeb,MAAM,CAAC,QAAQ,CAAC,OAAO,GAAE,OAAsB,GAAG,IAAI;IAItD,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;IAazC,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;CAO5D"}
|