@teardown/react-native 2.0.14 → 2.0.17
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/package.json +1 -1
- package/src/teardown.core.ts +18 -16
package/package.json
CHANGED
package/src/teardown.core.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { ApiClient } from "./clients/api";
|
|
|
2
2
|
import { DeviceClient, type DeviceClientOptions } from "./clients/device/device.client";
|
|
3
3
|
import { ForceUpdateClient, type ForceUpdateClientOptions } from "./clients/force-update";
|
|
4
4
|
import { IdentityClient } from "./clients/identity";
|
|
5
|
-
import { LoggingClient, type LogLevel
|
|
6
|
-
import {
|
|
5
|
+
import { type Logger, LoggingClient, type LogLevel } from "./clients/logging";
|
|
6
|
+
import { type StorageAdapter, StorageClient } from "./clients/storage";
|
|
7
7
|
import { UtilsClient } from "./clients/utils/utils.client";
|
|
8
8
|
|
|
9
9
|
export type TeardownCoreOptions = {
|
|
@@ -51,30 +51,32 @@ export class TeardownCore {
|
|
|
51
51
|
this.device = new DeviceClient(this.logging, this.utils, this.storage, {
|
|
52
52
|
adapter: this.options.deviceAdapter,
|
|
53
53
|
});
|
|
54
|
-
this.identity = new IdentityClient(
|
|
55
|
-
|
|
56
|
-
this.utils,
|
|
57
|
-
this.storage,
|
|
58
|
-
this.api,
|
|
59
|
-
this.device
|
|
60
|
-
);
|
|
61
|
-
this.forceUpdate = new ForceUpdateClient(this.logging, this.storage, this.identity, this.options.forceUpdate)
|
|
62
|
-
|
|
63
|
-
void this.initialize().catch((error) => {
|
|
64
|
-
this.logger.error("Error initializing TeardownCore", { error });
|
|
65
|
-
}).then(() => {
|
|
66
|
-
this.logger.debug("TeardownCore initialized");
|
|
67
|
-
});
|
|
54
|
+
this.identity = new IdentityClient(this.logging, this.utils, this.storage, this.api, this.device);
|
|
55
|
+
this.forceUpdate = new ForceUpdateClient(this.logging, this.storage, this.identity, this.options.forceUpdate);
|
|
68
56
|
|
|
57
|
+
void this.initialize()
|
|
58
|
+
.catch((error) => {
|
|
59
|
+
this.logger.error("Error initializing TeardownCore", { error });
|
|
60
|
+
})
|
|
61
|
+
.then(() => {
|
|
62
|
+
this.logger.debug("TeardownCore initialized");
|
|
63
|
+
});
|
|
69
64
|
}
|
|
70
65
|
|
|
71
66
|
async initialize(): Promise<void> {
|
|
72
67
|
// Wait for all storage hydration to complete
|
|
68
|
+
this.logger.debug("Waiting for storage to be ready");
|
|
73
69
|
await this.storage.whenReady();
|
|
74
70
|
// Initialize identity (loads from storage, then identifies if needed)
|
|
71
|
+
this.logger.debug("Initializing identity");
|
|
75
72
|
await this.identity.initialize();
|
|
73
|
+
this.logger.debug("Identity initialized");
|
|
76
74
|
// Then initialize force update (subscribes to identity events)
|
|
75
|
+
this.logger.debug("Initializing force update");
|
|
77
76
|
this.forceUpdate.initialize();
|
|
77
|
+
this.logger.debug("Force update initialized");
|
|
78
|
+
|
|
79
|
+
this.logger.debug("TeardownCore initialized");
|
|
78
80
|
}
|
|
79
81
|
|
|
80
82
|
setLogLevel(level: LogLevel): void {
|