@hot-updater/react-native 1.0.0-rc.17 → 1.0.0-rc.21
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/checkForUpdate.js +7 -9
- package/lib/commonjs/checkForUpdate.js.map +1 -1
- package/lib/commonjs/clientPlugin.js +7 -43
- package/lib/commonjs/clientPlugin.js.map +1 -1
- package/lib/commonjs/httpClient.js +7 -9
- package/lib/commonjs/httpClient.js.map +1 -1
- package/lib/commonjs/index.js +10 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/native.js +4 -4
- package/lib/commonjs/native.js.map +1 -1
- package/lib/commonjs/pluginHost.js +26 -190
- package/lib/commonjs/pluginHost.js.map +1 -1
- package/lib/commonjs/releaseCatalogCache.js +7 -59
- package/lib/commonjs/releaseCatalogCache.js.map +1 -1
- package/lib/commonjs/sdkVersion.js +1 -1
- package/lib/module/checkForUpdate.js +1 -3
- package/lib/module/checkForUpdate.js.map +1 -1
- package/lib/module/clientPlugin.js +1 -41
- package/lib/module/clientPlugin.js.map +1 -1
- package/lib/module/httpClient.js +1 -3
- package/lib/module/httpClient.js.map +1 -1
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/native.js +1 -1
- package/lib/module/native.js.map +1 -1
- package/lib/module/pluginHost.js +22 -187
- package/lib/module/pluginHost.js.map +1 -1
- package/lib/module/releaseCatalogCache.js +3 -54
- package/lib/module/releaseCatalogCache.js.map +1 -1
- package/lib/module/sdkVersion.js +1 -1
- package/lib/typescript/commonjs/checkForUpdate.d.ts.map +1 -1
- package/lib/typescript/commonjs/clientPlugin.d.ts +1 -184
- package/lib/typescript/commonjs/clientPlugin.d.ts.map +1 -1
- package/lib/typescript/commonjs/httpClient.d.ts +1 -2
- package/lib/typescript/commonjs/httpClient.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +1 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/native.d.ts +1 -1
- package/lib/typescript/commonjs/native.d.ts.map +1 -1
- package/lib/typescript/commonjs/pluginHost.d.ts +3 -28
- package/lib/typescript/commonjs/pluginHost.d.ts.map +1 -1
- package/lib/typescript/commonjs/releaseCatalogCache.d.ts +1 -13
- package/lib/typescript/commonjs/releaseCatalogCache.d.ts.map +1 -1
- package/lib/typescript/commonjs/sdkVersion.d.ts +1 -1
- package/lib/typescript/commonjs/types.d.ts +1 -1
- package/lib/typescript/commonjs/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/wrap.types.d.ts +2 -2
- package/lib/typescript/module/checkForUpdate.d.ts.map +1 -1
- package/lib/typescript/module/clientPlugin.d.ts +1 -184
- package/lib/typescript/module/clientPlugin.d.ts.map +1 -1
- package/lib/typescript/module/httpClient.d.ts +1 -2
- package/lib/typescript/module/httpClient.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +1 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/native.d.ts +1 -1
- package/lib/typescript/module/native.d.ts.map +1 -1
- package/lib/typescript/module/pluginHost.d.ts +3 -28
- package/lib/typescript/module/pluginHost.d.ts.map +1 -1
- package/lib/typescript/module/releaseCatalogCache.d.ts +1 -13
- package/lib/typescript/module/releaseCatalogCache.d.ts.map +1 -1
- package/lib/typescript/module/sdkVersion.d.ts +1 -1
- package/lib/typescript/module/types.d.ts +1 -1
- package/lib/typescript/module/types.d.ts.map +1 -1
- package/lib/typescript/module/wrap.types.d.ts +2 -2
- package/package.json +7 -16
- package/src/checkForUpdate.ts +4 -6
- package/src/clientPlugin.ts +17 -231
- package/src/httpClient.ts +4 -4
- package/src/index.ts +7 -0
- package/src/native.ts +1 -1
- package/src/pluginHost.ts +24 -241
- package/src/releaseCatalogCache.ts +7 -136
- package/src/sdkVersion.ts +1 -1
- package/src/types.ts +1 -1
- package/src/wrap.types.ts +2 -2
- package/android/src/test/java/com/hotupdater/BsdiffPatchTest.kt +0 -46
- package/android/src/test/java/com/hotupdater/BundleFileStorageServiceTest.kt +0 -2236
- package/android/src/test/java/com/hotupdater/HotUpdaterExceptionTest.kt +0 -220
- package/android/src/test/java/com/hotupdater/HotUpdaterImplTest.kt +0 -264
- package/android/src/test/java/com/hotupdater/HotUpdaterRecoveryStateTest.kt +0 -97
- package/android/src/test/java/com/hotupdater/InstallIdentityServiceTest.kt +0 -71
- package/android/src/test/java/com/hotupdater/KeyValueStorageServiceTest.kt +0 -106
- package/android/src/test/java/com/hotupdater/NativeConfigUtilsTest.kt +0 -20
- package/android/src/test/java/com/hotupdater/NoBackupContext.kt +0 -11
- package/android/src/test/java/com/hotupdater/OkHttpDownloadServiceTest.kt +0 -397
- package/android/src/test/java/com/hotupdater/PendingCrashRecoveryTest.kt +0 -44
- package/android/src/test/java/com/hotupdater/PreviousProcessExitTest.kt +0 -57
- package/android/src/test/java/com/hotupdater/RelativePathResolverTest.kt +0 -41
- package/android/src/test/java/com/hotupdater/ReleaseCatalogCacheServiceTest.kt +0 -118
- package/android/src/test/java/com/hotupdater/TarBrArchiveExtractorTest.kt +0 -206
- package/lib/commonjs/appReady.spec.js +0 -360
- package/lib/commonjs/appReady.spec.js.map +0 -1
- package/lib/commonjs/appReady.test-utils.js +0 -25
- package/lib/commonjs/appReady.test-utils.js.map +0 -1
- package/lib/commonjs/baseURL.js +0 -16
- package/lib/commonjs/baseURL.js.map +0 -1
- package/lib/commonjs/catalogCacheNative.spec.js +0 -31
- package/lib/commonjs/catalogCacheNative.spec.js.map +0 -1
- package/lib/commonjs/checkForUpdate.releaseCatalog.spec.js +0 -936
- package/lib/commonjs/checkForUpdate.releaseCatalog.spec.js.map +0 -1
- package/lib/commonjs/entryImportGraph.spec.js +0 -50
- package/lib/commonjs/entryImportGraph.spec.js.map +0 -1
- package/lib/commonjs/httpClient.spec.js +0 -171
- package/lib/commonjs/httpClient.spec.js.map +0 -1
- package/lib/commonjs/index.spec.js +0 -395
- package/lib/commonjs/index.spec.js.map +0 -1
- package/lib/commonjs/iosInterop.spec.js +0 -18
- package/lib/commonjs/iosInterop.spec.js.map +0 -1
- package/lib/commonjs/native.spec.js +0 -910
- package/lib/commonjs/native.spec.js.map +0 -1
- package/lib/commonjs/pluginHost.spec.js +0 -292
- package/lib/commonjs/pluginHost.spec.js.map +0 -1
- package/lib/commonjs/plugins/insights/eventId.js +0 -129
- package/lib/commonjs/plugins/insights/eventId.js.map +0 -1
- package/lib/commonjs/plugins/insights/eventId.spec.js +0 -47
- package/lib/commonjs/plugins/insights/eventId.spec.js.map +0 -1
- package/lib/commonjs/plugins/insights/index.js +0 -272
- package/lib/commonjs/plugins/insights/index.js.map +0 -1
- package/lib/commonjs/plugins/insights/insights.spec.js +0 -640
- package/lib/commonjs/plugins/insights/insights.spec.js.map +0 -1
- package/lib/commonjs/plugins/insights/sender.js +0 -128
- package/lib/commonjs/plugins/insights/sender.js.map +0 -1
- package/lib/commonjs/plugins/insights/sender.spec.js +0 -265
- package/lib/commonjs/plugins/insights/sender.spec.js.map +0 -1
- package/lib/commonjs/plugins/insights/state.js +0 -145
- package/lib/commonjs/plugins/insights/state.js.map +0 -1
- package/lib/commonjs/releaseCatalogCache.spec.js +0 -213
- package/lib/commonjs/releaseCatalogCache.spec.js.map +0 -1
- package/lib/commonjs/releaseCatalogCacheNativeContract.spec.js +0 -64
- package/lib/commonjs/releaseCatalogCacheNativeContract.spec.js.map +0 -1
- package/lib/commonjs/store.notification.spec.js +0 -84
- package/lib/commonjs/store.notification.spec.js.map +0 -1
- package/lib/commonjs/store.spec.js +0 -182
- package/lib/commonjs/store.spec.js.map +0 -1
- package/lib/commonjs/updateError.spec.js +0 -149
- package/lib/commonjs/updateError.spec.js.map +0 -1
- package/lib/commonjs/wrap.progress.spec.js +0 -195
- package/lib/commonjs/wrap.progress.spec.js.map +0 -1
- package/lib/commonjs/wrap.spec.js +0 -232
- package/lib/commonjs/wrap.spec.js.map +0 -1
- package/lib/module/appReady.spec.js +0 -359
- package/lib/module/appReady.spec.js.map +0 -1
- package/lib/module/appReady.test-utils.js +0 -19
- package/lib/module/appReady.test-utils.js.map +0 -1
- package/lib/module/baseURL.js +0 -11
- package/lib/module/baseURL.js.map +0 -1
- package/lib/module/catalogCacheNative.spec.js +0 -31
- package/lib/module/catalogCacheNative.spec.js.map +0 -1
- package/lib/module/checkForUpdate.releaseCatalog.spec.js +0 -935
- package/lib/module/checkForUpdate.releaseCatalog.spec.js.map +0 -1
- package/lib/module/entryImportGraph.spec.js +0 -50
- package/lib/module/entryImportGraph.spec.js.map +0 -1
- package/lib/module/httpClient.spec.js +0 -171
- package/lib/module/httpClient.spec.js.map +0 -1
- package/lib/module/index.spec.js +0 -394
- package/lib/module/index.spec.js.map +0 -1
- package/lib/module/iosInterop.spec.js +0 -18
- package/lib/module/iosInterop.spec.js.map +0 -1
- package/lib/module/native.spec.js +0 -909
- package/lib/module/native.spec.js.map +0 -1
- package/lib/module/pluginHost.spec.js +0 -291
- package/lib/module/pluginHost.spec.js.map +0 -1
- package/lib/module/plugins/insights/eventId.js +0 -122
- package/lib/module/plugins/insights/eventId.js.map +0 -1
- package/lib/module/plugins/insights/eventId.spec.js +0 -47
- package/lib/module/plugins/insights/eventId.spec.js.map +0 -1
- package/lib/module/plugins/insights/index.js +0 -268
- package/lib/module/plugins/insights/index.js.map +0 -1
- package/lib/module/plugins/insights/insights.spec.js +0 -639
- package/lib/module/plugins/insights/insights.spec.js.map +0 -1
- package/lib/module/plugins/insights/sender.js +0 -123
- package/lib/module/plugins/insights/sender.js.map +0 -1
- package/lib/module/plugins/insights/sender.spec.js +0 -265
- package/lib/module/plugins/insights/sender.spec.js.map +0 -1
- package/lib/module/plugins/insights/state.js +0 -139
- package/lib/module/plugins/insights/state.js.map +0 -1
- package/lib/module/releaseCatalogCache.spec.js +0 -213
- package/lib/module/releaseCatalogCache.spec.js.map +0 -1
- package/lib/module/releaseCatalogCacheNativeContract.spec.js +0 -64
- package/lib/module/releaseCatalogCacheNativeContract.spec.js.map +0 -1
- package/lib/module/store.notification.spec.js +0 -85
- package/lib/module/store.notification.spec.js.map +0 -1
- package/lib/module/store.spec.js +0 -181
- package/lib/module/store.spec.js.map +0 -1
- package/lib/module/updateError.spec.js +0 -149
- package/lib/module/updateError.spec.js.map +0 -1
- package/lib/module/wrap.progress.spec.js +0 -196
- package/lib/module/wrap.progress.spec.js.map +0 -1
- package/lib/module/wrap.spec.js +0 -233
- package/lib/module/wrap.spec.js.map +0 -1
- package/lib/typescript/commonjs/appReady.test-utils.d.ts +0 -9
- package/lib/typescript/commonjs/appReady.test-utils.d.ts.map +0 -1
- package/lib/typescript/commonjs/baseURL.d.ts +0 -4
- package/lib/typescript/commonjs/baseURL.d.ts.map +0 -1
- package/lib/typescript/commonjs/plugins/insights/eventId.d.ts +0 -18
- package/lib/typescript/commonjs/plugins/insights/eventId.d.ts.map +0 -1
- package/lib/typescript/commonjs/plugins/insights/index.d.ts +0 -40
- package/lib/typescript/commonjs/plugins/insights/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/plugins/insights/sender.d.ts +0 -74
- package/lib/typescript/commonjs/plugins/insights/sender.d.ts.map +0 -1
- package/lib/typescript/commonjs/plugins/insights/state.d.ts +0 -46
- package/lib/typescript/commonjs/plugins/insights/state.d.ts.map +0 -1
- package/lib/typescript/module/appReady.test-utils.d.ts +0 -9
- package/lib/typescript/module/appReady.test-utils.d.ts.map +0 -1
- package/lib/typescript/module/baseURL.d.ts +0 -4
- package/lib/typescript/module/baseURL.d.ts.map +0 -1
- package/lib/typescript/module/plugins/insights/eventId.d.ts +0 -18
- package/lib/typescript/module/plugins/insights/eventId.d.ts.map +0 -1
- package/lib/typescript/module/plugins/insights/index.d.ts +0 -40
- package/lib/typescript/module/plugins/insights/index.d.ts.map +0 -1
- package/lib/typescript/module/plugins/insights/sender.d.ts +0 -74
- package/lib/typescript/module/plugins/insights/sender.d.ts.map +0 -1
- package/lib/typescript/module/plugins/insights/state.d.ts +0 -46
- package/lib/typescript/module/plugins/insights/state.d.ts.map +0 -1
- package/plugins/insights/package.json +0 -8
- package/src/appReady.spec.ts +0 -393
- package/src/appReady.test-utils.ts +0 -31
- package/src/baseURL.ts +0 -15
- package/src/catalogCacheNative.spec.ts +0 -63
- package/src/checkForUpdate.releaseCatalog.spec.ts +0 -966
- package/src/entryImportGraph.spec.ts +0 -65
- package/src/httpClient.spec.ts +0 -216
- package/src/index.spec.ts +0 -434
- package/src/iosInterop.spec.ts +0 -30
- package/src/native.spec.ts +0 -978
- package/src/pluginHost.spec.ts +0 -297
- package/src/plugins/insights/eventId.spec.ts +0 -60
- package/src/plugins/insights/eventId.ts +0 -171
- package/src/plugins/insights/index.ts +0 -367
- package/src/plugins/insights/insights.spec.ts +0 -732
- package/src/plugins/insights/sender.spec.ts +0 -287
- package/src/plugins/insights/sender.ts +0 -221
- package/src/plugins/insights/state.ts +0 -184
- package/src/releaseCatalogCache.spec.ts +0 -304
- package/src/releaseCatalogCacheNativeContract.spec.ts +0 -80
- package/src/store.notification.spec.ts +0 -102
- package/src/store.spec.ts +0 -215
- package/src/updateError.spec.ts +0 -144
- package/src/wrap.progress.spec.ts +0 -232
- package/src/wrap.spec.ts +0 -262
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { type HotUpdaterClientPlugin } from "../../clientPlugin";
|
|
2
|
-
export interface InsightsOptions {
|
|
3
|
-
/**
|
|
4
|
-
* Also report from debug builds (`__DEV__`). Defaults to `false`, so
|
|
5
|
-
* development sessions stay out of production Insights.
|
|
6
|
-
*/
|
|
7
|
-
readonly debug?: boolean;
|
|
8
|
-
}
|
|
9
|
-
/** The app's own id for the signed-in user, attached to later reports. */
|
|
10
|
-
export interface InsightsUser {
|
|
11
|
-
readonly userId: string | number;
|
|
12
|
-
}
|
|
13
|
-
export interface InsightsPlugin extends HotUpdaterClientPlugin {
|
|
14
|
-
readonly id: "insights";
|
|
15
|
-
/**
|
|
16
|
-
* Attaches the signed-in user's id to later reports, or clears it with
|
|
17
|
-
* `null`. It persists on the device, sends nothing by itself, and can be
|
|
18
|
-
* called before `HotUpdater.init`.
|
|
19
|
-
*/
|
|
20
|
-
setUser(user: InsightsUser | null): void;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Reports update adoption to a server that runs the `insights()` server
|
|
24
|
-
* plugin: launches (at most once a UTC day while nothing changes), downloads,
|
|
25
|
-
* applies, recoveries, and update failures. After the server answers that
|
|
26
|
-
* Insights is off, the plugin sends nothing for 24 hours, and for the rest
|
|
27
|
-
* of that runtime.
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* ```ts
|
|
31
|
-
* import { HotUpdater } from "@hot-updater/react-native";
|
|
32
|
-
* import { insights } from "@hot-updater/react-native/plugins/insights";
|
|
33
|
-
*
|
|
34
|
-
* const analytics = insights();
|
|
35
|
-
* HotUpdater.init({ baseURL, plugins: [analytics] });
|
|
36
|
-
* analytics.setUser({ userId: "user-123" });
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
export declare const insights: (options?: InsightsOptions) => InsightsPlugin;
|
|
40
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/insights/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,sBAAsB,EAG5B,MAAM,oBAAoB,CAAC;AAgB5B,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,0EAA0E;AAC1E,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;CAClC;AAED,MAAM,WAAW,cAAe,SAAQ,sBAAsB;IAC5D,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAC;IACxB;;;;OAIG;IACH,OAAO,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,GAAG,IAAI,CAAC;CAC1C;AAgCD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,QAAQ,aAAa,eAAe,KAAQ,cAgRxD,CAAC"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import type { HotUpdaterClientContext } from "../../clientPlugin";
|
|
2
|
-
export type InsightsEventType = "UNCHANGED" | "UPDATE_DOWNLOADED" | "UPDATE_APPLIED" | "RECOVERED" | "UPDATE_FAILED";
|
|
3
|
-
/** A `POST /events` body. */
|
|
4
|
-
export interface InsightsEventBody {
|
|
5
|
-
readonly eventId: string;
|
|
6
|
-
readonly type: InsightsEventType;
|
|
7
|
-
readonly installId: string;
|
|
8
|
-
readonly userId?: string;
|
|
9
|
-
readonly platform: "ios" | "android";
|
|
10
|
-
readonly appVersion: string;
|
|
11
|
-
readonly channel: string;
|
|
12
|
-
readonly cohort: string;
|
|
13
|
-
readonly fingerprintHash: string | null;
|
|
14
|
-
readonly sdkVersion: string;
|
|
15
|
-
readonly fromBundleId: string | null;
|
|
16
|
-
readonly fromReleaseId: string | null;
|
|
17
|
-
readonly toBundleId: string;
|
|
18
|
-
readonly toReleaseId: string | null;
|
|
19
|
-
readonly updateStrategy: "fingerprint" | "appVersion" | null;
|
|
20
|
-
readonly metadata?: InsightsEventMetadata;
|
|
21
|
-
}
|
|
22
|
-
/** Details beside an event's fields, by event type. */
|
|
23
|
-
export interface InsightsEventMetadata {
|
|
24
|
-
/** UPDATE_FAILED: where and why the update failed. */
|
|
25
|
-
readonly failure?: {
|
|
26
|
-
readonly stage: "check" | "download" | "install";
|
|
27
|
-
readonly reason: string;
|
|
28
|
-
readonly resource?: string;
|
|
29
|
-
readonly httpStatus?: number;
|
|
30
|
-
readonly transport?: string;
|
|
31
|
-
readonly originCode?: string;
|
|
32
|
-
readonly previousProcessExit?: string;
|
|
33
|
-
};
|
|
34
|
-
/** UPDATE_DOWNLOADED: how the bundle arrived. */
|
|
35
|
-
readonly delivery?: "patch" | "manifest" | "archive";
|
|
36
|
-
/** UPDATE_DOWNLOADED: a patch was tried, but a file or the archive came instead. */
|
|
37
|
-
readonly patchFallback?: true;
|
|
38
|
-
/** RECOVERED: why the previous main process exited, on Android 11+. */
|
|
39
|
-
readonly previousProcessExit?: string;
|
|
40
|
-
}
|
|
41
|
-
/** How the server answered one event. */
|
|
42
|
-
export type InsightsDelivery =
|
|
43
|
-
/** The server stored the event, or already had it under its id. */
|
|
44
|
-
"delivered"
|
|
45
|
-
/** The server runs without Insights: a 404, since it mounts no `/events`. */
|
|
46
|
-
| "disabled"
|
|
47
|
-
/** A 400 for an `UPDATE_FAILED` event, from a server that does not know it. */
|
|
48
|
-
| "refused"
|
|
49
|
-
/** No attempt got an answer the SDK accepts. */
|
|
50
|
-
| "failed";
|
|
51
|
-
export interface InsightsEventGate {
|
|
52
|
-
/**
|
|
53
|
-
* Whether to send the event now. It is asked before every attempt, so an
|
|
54
|
-
* event superseded while it waits out a backoff is dropped.
|
|
55
|
-
*/
|
|
56
|
-
admit(event: InsightsEventBody): boolean;
|
|
57
|
-
/** Records how an admitted event ended, once per event. */
|
|
58
|
-
settle(event: InsightsEventBody, delivery: InsightsDelivery): void;
|
|
59
|
-
}
|
|
60
|
-
export type InsightsEventSender = (event: InsightsEventBody) => Promise<void>;
|
|
61
|
-
/**
|
|
62
|
-
* Sends Insights events one at a time and retries each in the background.
|
|
63
|
-
*
|
|
64
|
-
* The server keeps an installation's latest report by arrival, so a later
|
|
65
|
-
* event waits behind an earlier one's retries; otherwise a retried
|
|
66
|
-
* UPDATE_APPLIED could land after the UPDATE_DOWNLOADED that followed it.
|
|
67
|
-
* Callers wait only for first attempts, so a report never waits out a
|
|
68
|
-
* backoff: once an event backs off, every waiting caller is released, and a
|
|
69
|
-
* failure after that only warns. The gate sees each event before each
|
|
70
|
-
* attempt, after every earlier event settled, so it decides with what the
|
|
71
|
-
* server already answered.
|
|
72
|
-
*/
|
|
73
|
-
export declare const createInsightsEventSender: (fetch: HotUpdaterClientContext["fetch"], gate: InsightsEventGate) => InsightsEventSender;
|
|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HotUpdaterClientStorage } from "../../clientPlugin";
|
|
2
|
-
/** The UTC day of a time, as `YYYY-MM-DD`. */
|
|
3
|
-
export declare const utcDay: (time: number) => string;
|
|
4
|
-
/** The start of a time's UTC day, in milliseconds. */
|
|
5
|
-
export declare const utcDayStart: (time: number) => number;
|
|
6
|
-
/** What a report says runs: the fields the server compares to skip a same-day launch. */
|
|
7
|
-
export interface RunningReport {
|
|
8
|
-
readonly day: string;
|
|
9
|
-
readonly channel: string;
|
|
10
|
-
readonly appVersion: string;
|
|
11
|
-
readonly bundleId: string;
|
|
12
|
-
readonly releaseId: string | null;
|
|
13
|
-
readonly userId: string | null;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* The Insights plugin's memory across launches, in its plugin storage. Every
|
|
17
|
-
* read tolerates a missing or unreadable value, and a storage failure only
|
|
18
|
-
* costs a report that would otherwise have been skipped.
|
|
19
|
-
*/
|
|
20
|
-
export declare const createInsightsState: (storage: HotUpdaterClientStorage) => {
|
|
21
|
-
/**
|
|
22
|
-
* Whether reporting pauses: the server answered that Insights is off
|
|
23
|
-
* during this runtime or in the 24 hours before `now`. A pause that
|
|
24
|
-
* starts after `now`, from a clock that went back, has ended.
|
|
25
|
-
*/
|
|
26
|
-
isPaused(now: number): boolean;
|
|
27
|
-
pause(now: number): void;
|
|
28
|
-
/** The server stored a report, so Insights is on. */
|
|
29
|
-
resume(): void;
|
|
30
|
-
/** Whether a launch report repeats what the installation reported that day. */
|
|
31
|
-
repeatsReport(report: RunningReport): boolean;
|
|
32
|
-
/** Records a delivered report that says what runs. */
|
|
33
|
-
recordReport(report: RunningReport): void;
|
|
34
|
-
/**
|
|
35
|
-
* Forgets the last report after a delivered download or failure, so the
|
|
36
|
-
* next launch reports again, as the server records it after one.
|
|
37
|
-
*/
|
|
38
|
-
forgetReport(): void;
|
|
39
|
-
/** Whether a failure was already reported, or refused, that day. */
|
|
40
|
-
hasFailure(day: string, key: string): boolean;
|
|
41
|
-
recordFailure(day: string, key: string): void;
|
|
42
|
-
readUserId(): string | null;
|
|
43
|
-
writeUserId(userId: string | null): void;
|
|
44
|
-
};
|
|
45
|
-
export type InsightsState = ReturnType<typeof createInsightsState>;
|
|
46
|
-
//# sourceMappingURL=state.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/insights/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAMlE,8CAA8C;AAC9C,eAAO,MAAM,MAAM,SAAU,MAAM,KAAG,MACK,CAAC;AAE5C,sDAAsD;AACtD,eAAO,MAAM,WAAW,SAAU,MAAM,KAAG,MACP,CAAC;AAErC,yFAAyF;AACzF,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAgED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,YAAa,uBAAuB;IAoBhE;;;;OAIG;IACH,QAAQ,MAAM,MAAM,GAAG,OAAO;IAU9B,KAAK,MAAM,MAAM;IAIjB,qDAAqD;IACrD,MAAM;IAIN,+EAA+E;IAC/E,aAAa,SAAS,aAAa,GAAG,OAAO;IAI7C,sDAAsD;IACtD,YAAY,SAAS,aAAa;IAGlC;;;OAGG;IACH,YAAY;IAIZ,oEAAoE;IACpE,UAAU,MAAM,MAAM,OAAO,MAAM,GAAG,OAAO;IAI7C,aAAa,MAAM,MAAM,OAAO,MAAM;IAUtC,UAAU,IAAI,MAAM,GAAG,IAAI;IAU3B,WAAW,SAAS,MAAM,GAAG,IAAI;CAIpC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { LaunchTransition, NotifyAppReadyResult } from "./native";
|
|
2
|
-
export declare const createNotifyReadResult: (result?: NotifyAppReadyResult, transition?: LaunchTransition | null, pending?: boolean, previousProcessExit?: string | null) => {
|
|
3
|
-
transition: LaunchTransition | null;
|
|
4
|
-
previousProcessExit: string | null;
|
|
5
|
-
pending: boolean;
|
|
6
|
-
result: NotifyAppReadyResult;
|
|
7
|
-
};
|
|
8
|
-
export declare const stubNotifyFrame: () => void;
|
|
9
|
-
//# sourceMappingURL=appReady.test-utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"appReady.test-utils.d.ts","sourceRoot":"","sources":["../../../src/appReady.test-utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEvE,eAAO,MAAM,sBAAsB,YACzB,oBAAoB,eAChB,gBAAgB,GAAG,IAAI,2CAEd,MAAM,GAAG,IAAI,KACjC;IACD,UAAU,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACpC,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,oBAAoB,CAAC;CAM7B,CAAC;AAEH,eAAO,MAAM,eAAe,YAS3B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"baseURL.d.ts","sourceRoot":"","sources":["../../../src/baseURL.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,gEAAgE;AAChE,eAAO,MAAM,cAAc,YAChB,iBAAiB,KACzB,OAAO,CAAC,MAAM,CAShB,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates an RFC 9562 UUIDv7: a 48-bit millisecond timestamp, then random bits.
|
|
3
|
-
*
|
|
4
|
-
* `createUUIDv7` from `@hot-updater/plugin-core` calls `crypto.getRandomValues`
|
|
5
|
-
* unconditionally, but React Native has no Web Crypto unless the app installs a
|
|
6
|
-
* polyfill. An Insights event ID only has to tell one event from another so a
|
|
7
|
-
* retried POST is counted once, so `Math.random` is enough without one.
|
|
8
|
-
*/
|
|
9
|
-
export declare const createUUIDv7: () => string;
|
|
10
|
-
/** SHA-256 of a string's UTF-8 bytes, since React Native has no Web Crypto. */
|
|
11
|
-
export declare const sha256: (value: string) => Uint8Array;
|
|
12
|
-
/**
|
|
13
|
-
* A UUIDv7 derived from a key: its time field is `timestamp` and its random
|
|
14
|
-
* bits are the key's SHA-256, so the same key and time always give the same
|
|
15
|
-
* id, and a server that stores reports by id counts it once.
|
|
16
|
-
*/
|
|
17
|
-
export declare const createKeyedUUIDv7: (key: string, timestamp: number) => string;
|
|
18
|
-
//# sourceMappingURL=eventId.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eventId.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/insights/eventId.ts"],"names":[],"mappings":"AAqBA;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,QAAO,MAW/B,CAAC;AA0CF,+EAA+E;AAC/E,eAAO,MAAM,MAAM,UAAW,MAAM,KAAG,UA+EtC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,QAAS,MAAM,aAAa,MAAM,KAAG,MAChB,CAAC"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { type HotUpdaterClientPlugin } from "../../clientPlugin";
|
|
2
|
-
export interface InsightsOptions {
|
|
3
|
-
/**
|
|
4
|
-
* Also report from debug builds (`__DEV__`). Defaults to `false`, so
|
|
5
|
-
* development sessions stay out of production Insights.
|
|
6
|
-
*/
|
|
7
|
-
readonly debug?: boolean;
|
|
8
|
-
}
|
|
9
|
-
/** The app's own id for the signed-in user, attached to later reports. */
|
|
10
|
-
export interface InsightsUser {
|
|
11
|
-
readonly userId: string | number;
|
|
12
|
-
}
|
|
13
|
-
export interface InsightsPlugin extends HotUpdaterClientPlugin {
|
|
14
|
-
readonly id: "insights";
|
|
15
|
-
/**
|
|
16
|
-
* Attaches the signed-in user's id to later reports, or clears it with
|
|
17
|
-
* `null`. It persists on the device, sends nothing by itself, and can be
|
|
18
|
-
* called before `HotUpdater.init`.
|
|
19
|
-
*/
|
|
20
|
-
setUser(user: InsightsUser | null): void;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Reports update adoption to a server that runs the `insights()` server
|
|
24
|
-
* plugin: launches (at most once a UTC day while nothing changes), downloads,
|
|
25
|
-
* applies, recoveries, and update failures. After the server answers that
|
|
26
|
-
* Insights is off, the plugin sends nothing for 24 hours, and for the rest
|
|
27
|
-
* of that runtime.
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* ```ts
|
|
31
|
-
* import { HotUpdater } from "@hot-updater/react-native";
|
|
32
|
-
* import { insights } from "@hot-updater/react-native/plugins/insights";
|
|
33
|
-
*
|
|
34
|
-
* const analytics = insights();
|
|
35
|
-
* HotUpdater.init({ baseURL, plugins: [analytics] });
|
|
36
|
-
* analytics.setUser({ userId: "user-123" });
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
export declare const insights: (options?: InsightsOptions) => InsightsPlugin;
|
|
40
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/insights/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,sBAAsB,EAG5B,MAAM,oBAAoB,CAAC;AAgB5B,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,0EAA0E;AAC1E,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;CAClC;AAED,MAAM,WAAW,cAAe,SAAQ,sBAAsB;IAC5D,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAC;IACxB;;;;OAIG;IACH,OAAO,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,GAAG,IAAI,CAAC;CAC1C;AAgCD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,QAAQ,aAAa,eAAe,KAAQ,cAgRxD,CAAC"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import type { HotUpdaterClientContext } from "../../clientPlugin";
|
|
2
|
-
export type InsightsEventType = "UNCHANGED" | "UPDATE_DOWNLOADED" | "UPDATE_APPLIED" | "RECOVERED" | "UPDATE_FAILED";
|
|
3
|
-
/** A `POST /events` body. */
|
|
4
|
-
export interface InsightsEventBody {
|
|
5
|
-
readonly eventId: string;
|
|
6
|
-
readonly type: InsightsEventType;
|
|
7
|
-
readonly installId: string;
|
|
8
|
-
readonly userId?: string;
|
|
9
|
-
readonly platform: "ios" | "android";
|
|
10
|
-
readonly appVersion: string;
|
|
11
|
-
readonly channel: string;
|
|
12
|
-
readonly cohort: string;
|
|
13
|
-
readonly fingerprintHash: string | null;
|
|
14
|
-
readonly sdkVersion: string;
|
|
15
|
-
readonly fromBundleId: string | null;
|
|
16
|
-
readonly fromReleaseId: string | null;
|
|
17
|
-
readonly toBundleId: string;
|
|
18
|
-
readonly toReleaseId: string | null;
|
|
19
|
-
readonly updateStrategy: "fingerprint" | "appVersion" | null;
|
|
20
|
-
readonly metadata?: InsightsEventMetadata;
|
|
21
|
-
}
|
|
22
|
-
/** Details beside an event's fields, by event type. */
|
|
23
|
-
export interface InsightsEventMetadata {
|
|
24
|
-
/** UPDATE_FAILED: where and why the update failed. */
|
|
25
|
-
readonly failure?: {
|
|
26
|
-
readonly stage: "check" | "download" | "install";
|
|
27
|
-
readonly reason: string;
|
|
28
|
-
readonly resource?: string;
|
|
29
|
-
readonly httpStatus?: number;
|
|
30
|
-
readonly transport?: string;
|
|
31
|
-
readonly originCode?: string;
|
|
32
|
-
readonly previousProcessExit?: string;
|
|
33
|
-
};
|
|
34
|
-
/** UPDATE_DOWNLOADED: how the bundle arrived. */
|
|
35
|
-
readonly delivery?: "patch" | "manifest" | "archive";
|
|
36
|
-
/** UPDATE_DOWNLOADED: a patch was tried, but a file or the archive came instead. */
|
|
37
|
-
readonly patchFallback?: true;
|
|
38
|
-
/** RECOVERED: why the previous main process exited, on Android 11+. */
|
|
39
|
-
readonly previousProcessExit?: string;
|
|
40
|
-
}
|
|
41
|
-
/** How the server answered one event. */
|
|
42
|
-
export type InsightsDelivery =
|
|
43
|
-
/** The server stored the event, or already had it under its id. */
|
|
44
|
-
"delivered"
|
|
45
|
-
/** The server runs without Insights: a 404, since it mounts no `/events`. */
|
|
46
|
-
| "disabled"
|
|
47
|
-
/** A 400 for an `UPDATE_FAILED` event, from a server that does not know it. */
|
|
48
|
-
| "refused"
|
|
49
|
-
/** No attempt got an answer the SDK accepts. */
|
|
50
|
-
| "failed";
|
|
51
|
-
export interface InsightsEventGate {
|
|
52
|
-
/**
|
|
53
|
-
* Whether to send the event now. It is asked before every attempt, so an
|
|
54
|
-
* event superseded while it waits out a backoff is dropped.
|
|
55
|
-
*/
|
|
56
|
-
admit(event: InsightsEventBody): boolean;
|
|
57
|
-
/** Records how an admitted event ended, once per event. */
|
|
58
|
-
settle(event: InsightsEventBody, delivery: InsightsDelivery): void;
|
|
59
|
-
}
|
|
60
|
-
export type InsightsEventSender = (event: InsightsEventBody) => Promise<void>;
|
|
61
|
-
/**
|
|
62
|
-
* Sends Insights events one at a time and retries each in the background.
|
|
63
|
-
*
|
|
64
|
-
* The server keeps an installation's latest report by arrival, so a later
|
|
65
|
-
* event waits behind an earlier one's retries; otherwise a retried
|
|
66
|
-
* UPDATE_APPLIED could land after the UPDATE_DOWNLOADED that followed it.
|
|
67
|
-
* Callers wait only for first attempts, so a report never waits out a
|
|
68
|
-
* backoff: once an event backs off, every waiting caller is released, and a
|
|
69
|
-
* failure after that only warns. The gate sees each event before each
|
|
70
|
-
* attempt, after every earlier event settled, so it decides with what the
|
|
71
|
-
* server already answered.
|
|
72
|
-
*/
|
|
73
|
-
export declare const createInsightsEventSender: (fetch: HotUpdaterClientContext["fetch"], gate: InsightsEventGate) => InsightsEventSender;
|
|
74
|
-
//# sourceMappingURL=sender.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sender.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/insights/sender.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAElE,MAAM,MAAM,iBAAiB,GACzB,WAAW,GACX,mBAAmB,GACnB,gBAAgB,GAChB,WAAW,GACX,eAAe,CAAC;AAEpB,6BAA6B;AAC7B,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,KAAK,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,QAAQ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AE,gBAAgB,GAAG,IAAI,CAAC;CACpE;AA8ED,MAAM,MAAM,mBAAmB,GAAG,CAAC,KAAK,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAE9E;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,yBAAyB,UAC7B,uBAAuB,CAAC,OAAO,CAAC,QACjC,iBAAiB,KACtB,mBAyDF,CAAC"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { HotUpdaterClientStorage } from "../../clientPlugin";
|
|
2
|
-
/** The UTC day of a time, as `YYYY-MM-DD`. */
|
|
3
|
-
export declare const utcDay: (time: number) => string;
|
|
4
|
-
/** The start of a time's UTC day, in milliseconds. */
|
|
5
|
-
export declare const utcDayStart: (time: number) => number;
|
|
6
|
-
/** What a report says runs: the fields the server compares to skip a same-day launch. */
|
|
7
|
-
export interface RunningReport {
|
|
8
|
-
readonly day: string;
|
|
9
|
-
readonly channel: string;
|
|
10
|
-
readonly appVersion: string;
|
|
11
|
-
readonly bundleId: string;
|
|
12
|
-
readonly releaseId: string | null;
|
|
13
|
-
readonly userId: string | null;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* The Insights plugin's memory across launches, in its plugin storage. Every
|
|
17
|
-
* read tolerates a missing or unreadable value, and a storage failure only
|
|
18
|
-
* costs a report that would otherwise have been skipped.
|
|
19
|
-
*/
|
|
20
|
-
export declare const createInsightsState: (storage: HotUpdaterClientStorage) => {
|
|
21
|
-
/**
|
|
22
|
-
* Whether reporting pauses: the server answered that Insights is off
|
|
23
|
-
* during this runtime or in the 24 hours before `now`. A pause that
|
|
24
|
-
* starts after `now`, from a clock that went back, has ended.
|
|
25
|
-
*/
|
|
26
|
-
isPaused(now: number): boolean;
|
|
27
|
-
pause(now: number): void;
|
|
28
|
-
/** The server stored a report, so Insights is on. */
|
|
29
|
-
resume(): void;
|
|
30
|
-
/** Whether a launch report repeats what the installation reported that day. */
|
|
31
|
-
repeatsReport(report: RunningReport): boolean;
|
|
32
|
-
/** Records a delivered report that says what runs. */
|
|
33
|
-
recordReport(report: RunningReport): void;
|
|
34
|
-
/**
|
|
35
|
-
* Forgets the last report after a delivered download or failure, so the
|
|
36
|
-
* next launch reports again, as the server records it after one.
|
|
37
|
-
*/
|
|
38
|
-
forgetReport(): void;
|
|
39
|
-
/** Whether a failure was already reported, or refused, that day. */
|
|
40
|
-
hasFailure(day: string, key: string): boolean;
|
|
41
|
-
recordFailure(day: string, key: string): void;
|
|
42
|
-
readUserId(): string | null;
|
|
43
|
-
writeUserId(userId: string | null): void;
|
|
44
|
-
};
|
|
45
|
-
export type InsightsState = ReturnType<typeof createInsightsState>;
|
|
46
|
-
//# sourceMappingURL=state.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/insights/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAMlE,8CAA8C;AAC9C,eAAO,MAAM,MAAM,SAAU,MAAM,KAAG,MACK,CAAC;AAE5C,sDAAsD;AACtD,eAAO,MAAM,WAAW,SAAU,MAAM,KAAG,MACP,CAAC;AAErC,yFAAyF;AACzF,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAgED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,YAAa,uBAAuB;IAoBhE;;;;OAIG;IACH,QAAQ,MAAM,MAAM,GAAG,OAAO;IAU9B,KAAK,MAAM,MAAM;IAIjB,qDAAqD;IACrD,MAAM;IAIN,+EAA+E;IAC/E,aAAa,SAAS,aAAa,GAAG,OAAO;IAI7C,sDAAsD;IACtD,YAAY,SAAS,aAAa;IAGlC;;;OAGG;IACH,YAAY;IAIZ,oEAAoE;IACpE,UAAU,MAAM,MAAM,OAAO,MAAM,GAAG,OAAO;IAI7C,aAAa,MAAM,MAAM,OAAO,MAAM;IAUtC,UAAU,IAAI,MAAM,GAAG,IAAI;IAU3B,WAAW,SAAS,MAAM,GAAG,IAAI;CAIpC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@hot-updater/react-native/plugins/insights",
|
|
3
|
-
"private": true,
|
|
4
|
-
"source": "../../src/plugins/insights/index.ts",
|
|
5
|
-
"main": "../../lib/commonjs/plugins/insights/index.js",
|
|
6
|
-
"module": "../../lib/module/plugins/insights/index.js",
|
|
7
|
-
"types": "../../lib/typescript/commonjs/plugins/insights/index.d.ts"
|
|
8
|
-
}
|