@aguacerowx/react-native 0.0.49 → 0.0.51
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/android/src/main/java/com/aguacerowx/reactnative/WeatherFrameProcessorModule.java +36 -0
- package/ios/WeatherFrameProcessorModule.swift +33 -2
- package/lib/commonjs/WeatherLayerManager.js +54 -6
- package/lib/commonjs/WeatherLayerManager.js.map +1 -1
- package/lib/commonjs/aguaceroCoreDebugHooks.js +144 -0
- package/lib/commonjs/aguaceroCoreDebugHooks.js.map +1 -0
- package/lib/commonjs/aguaceroRnDebug.js +351 -0
- package/lib/commonjs/aguaceroRnDebug.js.map +1 -0
- package/lib/commonjs/index.js +37 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/nexrad/nexradAndroidController.js +13 -0
- package/lib/commonjs/nexrad/nexradAndroidController.js.map +1 -1
- package/lib/commonjs/nexrad/nexradDiag.js +7 -1
- package/lib/commonjs/nexrad/nexradDiag.js.map +1 -1
- package/lib/commonjs/nexrad/radarArchiveCore.bundled.js +15 -14
- package/lib/commonjs/nexrad/radarArchiveCore.bundled.js.map +1 -1
- package/lib/commonjs/satellite/satelliteAndroidController.js +9 -0
- package/lib/commonjs/satellite/satelliteAndroidController.js.map +1 -1
- package/lib/module/WeatherLayerManager.js +54 -6
- package/lib/module/WeatherLayerManager.js.map +1 -1
- package/lib/module/aguaceroCoreDebugHooks.js +136 -0
- package/lib/module/aguaceroCoreDebugHooks.js.map +1 -0
- package/lib/module/aguaceroRnDebug.js +334 -0
- package/lib/module/aguaceroRnDebug.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/nexrad/nexradAndroidController.js +13 -0
- package/lib/module/nexrad/nexradAndroidController.js.map +1 -1
- package/lib/module/nexrad/nexradDiag.js +7 -1
- package/lib/module/nexrad/nexradDiag.js.map +1 -1
- package/lib/module/nexrad/radarArchiveCore.bundled.js +15 -14
- package/lib/module/nexrad/radarArchiveCore.bundled.js.map +1 -1
- package/lib/module/satellite/satelliteAndroidController.js +9 -0
- package/lib/module/satellite/satelliteAndroidController.js.map +1 -1
- package/lib/typescript/WeatherLayerManager.d.ts.map +1 -1
- package/lib/typescript/aguaceroCoreDebugHooks.d.ts +10 -0
- package/lib/typescript/aguaceroCoreDebugHooks.d.ts.map +1 -0
- package/lib/typescript/aguaceroRnDebug.d.ts +97 -0
- package/lib/typescript/aguaceroRnDebug.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +1 -0
- package/lib/typescript/nexrad/nexradAndroidController.d.ts.map +1 -1
- package/lib/typescript/nexrad/nexradDiag.d.ts.map +1 -1
- package/lib/typescript/nexrad/radarArchiveCore.bundled.d.ts.map +1 -1
- package/lib/typescript/satellite/satelliteAndroidController.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/WeatherLayerManager.js +78 -21
- package/src/aguaceroCoreDebugHooks.js +142 -0
- package/src/aguaceroRnDebug.js +328 -0
- package/src/index.js +8 -0
- package/src/nexrad/nexradAndroidController.js +11 -1
- package/src/nexrad/nexradDiag.js +7 -1
- package/src/nexrad/radarArchiveCore.bundled.js +7085 -7084
- package/src/satellite/satelliteAndroidController.js +9 -0
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { resolveSatelliteS3FileName } from '@aguacerowx/javascript-sdk';
|
|
6
6
|
import { satBridgeWarn } from '../satelliteBridgeDiag';
|
|
7
|
+
import { aguaceroDebug, getAguaceroAuthDiagnosticSnapshot, isAguaceroRnDebugEnabled, redactApiKeyFromUrl } from '../aguaceroRnDebug';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Target frame first, then remaining frames by increasing temporal distance to {@code targetUnix}.
|
|
@@ -163,6 +164,14 @@ export class SatelliteAndroidController {
|
|
|
163
164
|
const runKeyChanged = satRunKey !== this._cachedRunKey;
|
|
164
165
|
const timelineChanged = timelineSig !== this._cachedTimelineSig;
|
|
165
166
|
if (runKeyChanged || timelineChanged) {
|
|
167
|
+
if (isAguaceroRnDebugEnabled()) {
|
|
168
|
+
aguaceroDebug('satellite.sync.payload', {
|
|
169
|
+
auth: getAguaceroAuthDiagnosticSnapshot(this.core),
|
|
170
|
+
frameCount: frames.length,
|
|
171
|
+
sampleFrameUrl: frames[0] ? redactApiKeyFromUrl(frames[0].url) : null,
|
|
172
|
+
gridRequestSiteOrigin: mergedState.gridRequestSiteOrigin ?? this.core.gridRequestSiteOrigin ?? null
|
|
173
|
+
});
|
|
174
|
+
}
|
|
166
175
|
const sortedFrames = sortFramesByTargetProximity(frames, targetUnix);
|
|
167
176
|
const payload = {
|
|
168
177
|
runKey: satRunKey,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["resolveSatelliteS3FileName","satBridgeWarn","sortFramesByTargetProximity","frames","targetUnix","length","Number","isFinite","withDistance","map","f","_d","Math","abs","unix","sort","a","b","rest","buildSatelliteFetchParts","state","satelliteTimestamp","fileName","satelliteChannel","satelliteTimeToFileMap","channelName","variable","channelNameUpper","String","toUpperCase","s3FileName","replace","endsWith","shaderFileName","startsWith","token","toLowerCase","apiKey","url","encodeURIComponent","frameKey","SatelliteAndroidController","constructor","core","satelliteLayerRef","_destroyed","_cachedRunKey","undefined","_cachedTimelineSig","_lastTargetUnix","_lastStyleJson","destroy","native","current","clearSatellite","sync","destroyed","isSatellite","Boolean","instrumentId","satelliteInstrumentId","sector","satelliteSectorLabel","channel","tlMapSize","Object","keys","syncSatellite","refExists","satRunKey","timelineSig","join","mergedState","k","ts","parts","push","console","warn","timelineKeyCount","hasApiKey","mapKeys","nk","filter","n","max","stylePayload","visible","opacity","fillSmoothing","styleJson","JSON","stringify","runKeyChanged","timelineChanged","sortedFrames","payload","runKey","userId","
|
|
1
|
+
{"version":3,"names":["resolveSatelliteS3FileName","satBridgeWarn","aguaceroDebug","getAguaceroAuthDiagnosticSnapshot","isAguaceroRnDebugEnabled","redactApiKeyFromUrl","sortFramesByTargetProximity","frames","targetUnix","length","Number","isFinite","withDistance","map","f","_d","Math","abs","unix","sort","a","b","rest","buildSatelliteFetchParts","state","satelliteTimestamp","fileName","satelliteChannel","satelliteTimeToFileMap","channelName","variable","channelNameUpper","String","toUpperCase","s3FileName","replace","endsWith","shaderFileName","startsWith","token","toLowerCase","apiKey","url","encodeURIComponent","frameKey","SatelliteAndroidController","constructor","core","satelliteLayerRef","_destroyed","_cachedRunKey","undefined","_cachedTimelineSig","_lastTargetUnix","_lastStyleJson","destroy","native","current","clearSatellite","sync","destroyed","isSatellite","Boolean","instrumentId","satelliteInstrumentId","sector","satelliteSectorLabel","channel","tlMapSize","Object","keys","syncSatellite","refExists","satRunKey","timelineSig","join","mergedState","k","ts","parts","push","console","warn","timelineKeyCount","hasApiKey","mapKeys","nk","filter","n","max","stylePayload","visible","opacity","fillSmoothing","styleJson","JSON","stringify","runKeyChanged","timelineChanged","auth","frameCount","sampleFrameUrl","gridRequestSiteOrigin","sortedFrames","payload","runKey","userId","bundleId","payloadJson","jsonChars","finiteTarget","activateSatelliteCachedUnix","updateSatelliteStyle"],"sourceRoot":"..\\..\\..\\src","sources":["satellite/satelliteAndroidController.js"],"mappings":"AAAA;AACA;AACA;AACA;AACA,SAASA,0BAA0B,QAAQ,4BAA4B;AACvE,SAASC,aAAa,QAAQ,wBAAwB;AACtD,SAASC,aAAa,EAAEC,iCAAiC,EAAEC,wBAAwB,EAAEC,mBAAmB,QAAQ,oBAAoB;;AAEpI;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,2BAA2BA,CAACC,MAAM,EAAEC,UAAU,EAAE;EAC5D,IAAI,CAACD,MAAM,CAACE,MAAM,EAAE,OAAOF,MAAM;EACjC,IAAIC,UAAU,IAAI,IAAI,IAAI,CAACE,MAAM,CAACC,QAAQ,CAACH,UAAU,CAAC,EAAE;IACpD,OAAOD,MAAM;EACjB;EACA,MAAMK,YAAY,GAAGL,MAAM,CAACM,GAAG,CAAEC,CAAC,KAAM;IACpC,GAAGA,C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aAAa,GAAGuB,SAAS;MAC9B,IAAI,CAACrB,kBAAkB,GAAGsB,WAAW;MACrC,IAAI,CAACrB,eAAe,GAAG7C,UAAU,IAAI,IAAI,IAAIE,MAAM,CAACC,QAAQ,CAACH,UAAU,CAAC,GAAGA,UAAU,GAAG,IAAI;MAC5F,IAAI,CAAC8C,cAAc,GAAGwC,SAAS;MAC/B;IACJ;;IAEA;IACA,MAAMgB,YAAY,GACdtG,UAAU,IAAI,IAAI,IAAIE,MAAM,CAACC,QAAQ,CAACH,UAAU,CAAC,GAAGA,UAAU,GAAG,IAAI;IACzE,IAAIsG,YAAY,KAAK,IAAI,CAACzD,eAAe,EAAE;MACvC,IAAIyD,YAAY,IAAI,IAAI,IAAItD,MAAM,CAACuD,2BAA2B,EAAE;QAC5DvD,MAAM,CAACuD,2BAA2B,CAACD,YAAY,CAAC;QAChD7G,aAAa,CAAC,wDAAwD,EAAE;UAAEiB,IAAI,EAAE4F;QAAa,CAAC,CAAC;MACnG;MACA,IAAI,CAACzD,eAAe,GAAGyD,YAAY;IACvC;IAEA,IAAIhB,SAAS,KAAK,IAAI,CAACxC,cAAc,IAAIE,MAAM,CAACwD,oBAAoB,EAAE;MAClExD,MAAM,CAACwD,oBAAoB,CAAClB,SAAS,CAAC;MACtC7F,aAAa,CAAC,iDAAiD,EAAE;QAAE4G,SAAS,EAAEf,SAAS,CAACrF;MAAO,CAAC,CAAC;MACjG,IAAI,CAAC6C,cAAc,GAAGwC,SAAS;IACnC;EACJ;AACJ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WeatherLayerManager.d.ts","sourceRoot":"","sources":["../../src/WeatherLayerManager.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WeatherLayerManager.d.ts","sourceRoot":"","sources":["../../src/WeatherLayerManager.js"],"names":[],"mappings":"AA2QA,sCAisDG"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {import('@aguacerowx/javascript-sdk').AguaceroCore} core
|
|
3
|
+
* @param {Record<string, unknown>} [extra]
|
|
4
|
+
*/
|
|
5
|
+
export function installAguaceroCoreDebugHooks(core: any, extra?: Record<string, unknown>): void;
|
|
6
|
+
/**
|
|
7
|
+
* @param {import('@aguacerowx/javascript-sdk').AguaceroCore} core
|
|
8
|
+
*/
|
|
9
|
+
export function logProcessFrameAuthMismatch(core: any, options: any, context?: {}): void;
|
|
10
|
+
//# sourceMappingURL=aguaceroCoreDebugHooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aguaceroCoreDebugHooks.d.ts","sourceRoot":"","sources":["../../src/aguaceroCoreDebugHooks.js"],"names":[],"mappings":"AAaA;;;GAGG;AACH,iEAFW,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,QAoGjC;AAED;;GAEG;AACH,yFAqBC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {boolean} enabled
|
|
3
|
+
*/
|
|
4
|
+
export function setAguaceroRnDebugEnabled(enabled: boolean): void;
|
|
5
|
+
/**
|
|
6
|
+
* @param {{ enabled?: boolean }} opts
|
|
7
|
+
*/
|
|
8
|
+
export function configureAguaceroRnDebug(opts?: {
|
|
9
|
+
enabled?: boolean;
|
|
10
|
+
}): void;
|
|
11
|
+
/**
|
|
12
|
+
* True when `debug={true}`, {@link configureAguaceroRnDebug}, or `globalThis.__AGUACERO_DEBUG__ === true`.
|
|
13
|
+
* @returns {boolean}
|
|
14
|
+
*/
|
|
15
|
+
export function isAguaceroRnDebugEnabled(): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* @param {string | null | undefined} secret
|
|
18
|
+
* @returns {Record<string, unknown>}
|
|
19
|
+
*/
|
|
20
|
+
export function describeSecret(secret: string | null | undefined): Record<string, unknown>;
|
|
21
|
+
/**
|
|
22
|
+
* @param {string} s
|
|
23
|
+
* @returns {string}
|
|
24
|
+
*/
|
|
25
|
+
export function fingerprintSecret(s: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* @param {string} u
|
|
28
|
+
* @returns {string}
|
|
29
|
+
*/
|
|
30
|
+
export function redactApiKeyFromUrl(u: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* @param {string} url
|
|
33
|
+
* @returns {boolean}
|
|
34
|
+
*/
|
|
35
|
+
export function shouldLogAguaceroUrl(url: string): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* @param {string} tag
|
|
38
|
+
* @param {Record<string, unknown> | undefined} detail
|
|
39
|
+
*/
|
|
40
|
+
export function aguaceroDebug(tag: string, detail: Record<string, unknown> | undefined): void;
|
|
41
|
+
/**
|
|
42
|
+
* Auth / HTTP failures: logged when debug is on (same prefix).
|
|
43
|
+
* @param {string} tag
|
|
44
|
+
* @param {Record<string, unknown> | undefined} detail
|
|
45
|
+
*/
|
|
46
|
+
export function aguaceroDebugWarn(tag: string, detail: Record<string, unknown> | undefined): void;
|
|
47
|
+
/**
|
|
48
|
+
* @param {import('@aguacerowx/javascript-sdk').AguaceroCore | { apiKey?: string; bundleId?: string | null; gridRequestSiteOrigin?: string | null; baseGridUrl?: string; isReactNative?: boolean }} core
|
|
49
|
+
* @param {Record<string, unknown>} [extra]
|
|
50
|
+
*/
|
|
51
|
+
export function getAguaceroAuthDiagnosticSnapshot(core: any | {
|
|
52
|
+
apiKey?: string;
|
|
53
|
+
bundleId?: string | null;
|
|
54
|
+
gridRequestSiteOrigin?: string | null;
|
|
55
|
+
baseGridUrl?: string;
|
|
56
|
+
isReactNative?: boolean;
|
|
57
|
+
}, extra?: Record<string, unknown>): {
|
|
58
|
+
platform: "ios" | "android" | "windows" | "macos" | "web";
|
|
59
|
+
isReactNative: boolean;
|
|
60
|
+
baseGridUrl: any;
|
|
61
|
+
apiKey: Record<string, unknown>;
|
|
62
|
+
bundleId: {
|
|
63
|
+
present: boolean;
|
|
64
|
+
value: string;
|
|
65
|
+
length: number;
|
|
66
|
+
hint?: undefined;
|
|
67
|
+
} | {
|
|
68
|
+
present: boolean;
|
|
69
|
+
hint: string;
|
|
70
|
+
value?: undefined;
|
|
71
|
+
length?: undefined;
|
|
72
|
+
};
|
|
73
|
+
gridRequestSiteOrigin: {
|
|
74
|
+
present: boolean;
|
|
75
|
+
value: string;
|
|
76
|
+
length: number;
|
|
77
|
+
hint?: undefined;
|
|
78
|
+
} | {
|
|
79
|
+
present: boolean;
|
|
80
|
+
hint: string;
|
|
81
|
+
value?: undefined;
|
|
82
|
+
length?: undefined;
|
|
83
|
+
};
|
|
84
|
+
willSendAppIdentifier: boolean;
|
|
85
|
+
willSendOriginHeaders: boolean;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* @param {Record<string, unknown>} options - {@link buildGridFrameProcessOptions} output
|
|
89
|
+
* @param {import('@aguacerowx/javascript-sdk').AguaceroCore} [core]
|
|
90
|
+
* @returns {Record<string, unknown>}
|
|
91
|
+
*/
|
|
92
|
+
export function augmentProcessFrameOptionsForDebug(options: Record<string, unknown>, core?: any): Record<string, unknown>;
|
|
93
|
+
/**
|
|
94
|
+
* Patches `global.fetch` once to log Aguacero CDN / API traffic when debug is enabled.
|
|
95
|
+
*/
|
|
96
|
+
export function installGlobalFetchLogger(): void;
|
|
97
|
+
//# sourceMappingURL=aguaceroRnDebug.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aguaceroRnDebug.d.ts","sourceRoot":"","sources":["../../src/aguaceroRnDebug.js"],"names":[],"mappings":"AAsCA;;GAEG;AACH,mDAFW,OAAO,QAIjB;AAED;;GAEG;AACH,gDAFW;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,QAwB/B;AAED;;;GAGG;AACH,4CAFa,OAAO,CAqBnB;AAUD;;;GAGG;AACH,uCAHW,MAAM,GAAG,IAAI,GAAG,SAAS,GACvB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAkBnC;AAED;;;GAGG;AACH,qCAHW,MAAM,GACJ,MAAM,CAMlB;AAED;;;GAGG;AACH,uCAHW,MAAM,GACJ,MAAM,CAKlB;AAED;;;GAGG;AACH,0CAHW,MAAM,GACJ,OAAO,CAMnB;AAED;;;GAGG;AACH,mCAHW,MAAM,UACN,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,QAS7C;AAED;;;;GAIG;AACH,uCAHW,MAAM,UACN,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,QAS7C;AAED;;;GAGG;AACH,wDAHW,GAAiD,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,OAAO,CAAA;CAAE,UACvL,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwBjC;AAED;;;;GAIG;AACH,4DAJW,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,eAErB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAiBnC;AA4BD;;GAEG;AACH,iDAiEC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { MapManager } from "./MapManager";
|
|
2
2
|
export { WeatherLayerManager } from "./WeatherLayerManager";
|
|
3
3
|
export { default as GridRenderLayer } from "./GridRenderLayerNativeComponent";
|
|
4
|
+
export { configureAguaceroRnDebug, setAguaceroRnDebugEnabled, isAguaceroRnDebugEnabled, getAguaceroAuthDiagnosticSnapshot, aguaceroDebug, aguaceroDebugWarn } from "./aguaceroRnDebug";
|
|
4
5
|
export { AGUACERO_NEXRAD_MAP_LAYER_ID, AGUACERO_SATELLITE_MAP_LAYER_ID } from "./nws/nwsAndroidConstants";
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nexradAndroidController.d.ts","sourceRoot":"","sources":["../../../src/nexrad/nexradAndroidController.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"nexradAndroidController.d.ts","sourceRoot":"","sources":["../../../src/nexrad/nexradAndroidController.js"],"names":[],"mappings":"AAoNA;IACA;;;;WAIO;IACH,kBAJO,GAAC,YACD,KAAK,CAAC,gBAAgB,CAAC;QAAE,iBAAiB,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;QAAC,qBAAqB,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;QAAC,yBAAyB,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC,YAC9L,MAAM,EAgDhB;IA7CG,UAAgB;IAChB;4BALgD,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;gCAA0B,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;sBAAgB,MAAM,IAAI;oCAA8B,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;cAKlK;IACzB,kBAAwB;IACxB,+BAAkB;IAClB,8BAAuE;IACvE,wBAA0D;IAC1D,2BAA4B;IAC5B,kHAAkH;IAClH,uCAAoC;IACpC,sCAAyB;IACzB,yBAA+B;IAC/B,8BAAiC;IACjC,iEAAiE;IACjE,iBADW;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAClC;IAC3B,qFAAqF;IACrF,sBADW,GAAG,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAC5C;IACrC,oHAAoH;IACpH,qBADW,GAAG,CAAC,MAAM,CAAC,CACc;IACpC,uEAAuE;IACvE,sBADW,GAAG,CAAC,MAAM,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAC9B;IACrC,4CAA4C;IAC5C,mBADW;QAAE,MAAM,EAAE,MAAM,IAAI,CAAA;KAAE,GAAG,IAAI,CACX;IA0BjC,wCAMC;IAED,qFAOC;IAED,uCAOC;IAED,gBAqBC;IAED,2DAgBC;IAED,eAEC;IAED;;;;;MAuBC;IAED;;;;OAIG;IACH,mCAHW,MAAM,GACJ;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAQ5E;IAED,uGAAuG;IACvG,iCADY,MAAM,SAAkB;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,QAS5F;IAED;;;OAGG;IACH,sDAEC;IAED;;;;OAIG;IACH,oGAqBC;IAED;;;;;OAKG;IACH,4BALW,GAAC,SACD,GAAC,KACD;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,QACpB,MAAM,QAgIhB;IAED,sCAwCC;IAED;;;;;MAUC;IAED;;;;;;;;aAkBC;IAED;;;qBAgCC;IAED,8CAYC;IAED,qDAMC;IAED,sCAgKC;IAED,gCA0HC;IAED;;;;;;;;;;;;;;;aAwGC;CACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nexradDiag.d.ts","sourceRoot":"","sources":["../../../src/nexrad/nexradDiag.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,
|
|
1
|
+
{"version":3,"file":"nexradDiag.d.ts","sourceRoot":"","sources":["../../../src/nexrad/nexradDiag.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,6CAQC;AAED;;;;GAIG;AACH,qCAHW,MAAM,WACN,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,QAiBjC;AAED,0DAOC;AAED;;;GAGG;AACH,sCAHW,MAAM,GACJ;IAAE,SAAS,EAAE,MAAM,MAAM,CAAC;IAAC,GAAG,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAA;CAAE,CAuB1F;AAED;;GAEG;AACH,+CAFW,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,QAWjC;AAED;;;;;;;;GAQG;AACH,uDARW,UAAU,UACV,MAAM,SACN,MAAM,cACN,MAAM,eACN,MAAM,UACN,MAAM,UACN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmDhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radarArchiveCore.bundled.d.ts","sourceRoot":"","sources":["../../../src/nexrad/radarArchiveCore.bundled.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"radarArchiveCore.bundled.d.ts","sourceRoot":"","sources":["../../../src/nexrad/radarArchiveCore.bundled.js"],"names":[],"mappings":"AA8rNA,+IAwNC;AAlyCD,0EAKC;AA1ID,qDAEC;AACD,8DAEC;AACD,8DAGC;AA94BD,0EAKC;AAVD,sDAEC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"satelliteAndroidController.d.ts","sourceRoot":"","sources":["../../../src/satellite/satelliteAndroidController.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"satelliteAndroidController.d.ts","sourceRoot":"","sources":["../../../src/satellite/satelliteAndroidController.js"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,oDAHW;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,EAAE,cACvD,MAAM,GAAG,IAAI;UADL,MAAM;SAAO,MAAM;oBAAkB,MAAM;IAiB7D;AAED;;;GAGG;AACH,yEAFW,MAAM;;;;;SA4BhB;AAED;IACI;;;OAGG;IACH,0CAFW,KAAK,CAAC,SAAS,CAAC;QAAE,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;QAAC,2BAA2B,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;QAAC,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,CAAC,EAcvM;IAXG,UAAgB;IAChB;wBAJyC,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI;yBAAmB,MAAM,IAAI;sCAAgC,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI;+BAAyB,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI;OAIvJ;IAC1C,oBAAuB;IACvB,iCAAiC;IACjC,eADW,MAAM,GAAG,SAAS,CACC;IAC9B,iCAAiC;IACjC,oBADW,MAAM,GAAG,SAAS,CACM;IACnC,wCAAwC;IACxC,iBADW,MAAM,GAAG,IAAI,GAAG,SAAS,CACJ;IAChC,iCAAiC;IACjC,gBADW,MAAM,GAAG,SAAS,CACE;IAGnC,gBAQC;IAED;;OAEG;IACH,uBAsJC;CACJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aguacerowx/react-native",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.51",
|
|
4
4
|
"description": "Native weather rendering for React Native",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "Michael Barletta",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"react-native-device-info": ">=10.0.0"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@aguacerowx/javascript-sdk": "^0.0.
|
|
49
|
+
"@aguacerowx/javascript-sdk": "^0.0.29",
|
|
50
50
|
"base64-js": "^1.5.1"
|
|
51
51
|
},
|
|
52
52
|
"react-native-builder-bob": {
|
|
@@ -20,6 +20,14 @@ import { SatelliteAndroidController } from './satellite/satelliteAndroidControll
|
|
|
20
20
|
import NwsAlertsOverlay from './nws/NwsAlertsOverlay';
|
|
21
21
|
import { mapRegistry } from './MapRegistry';
|
|
22
22
|
import { satBridgeWarn } from './satelliteBridgeDiag';
|
|
23
|
+
import {
|
|
24
|
+
augmentProcessFrameOptionsForDebug,
|
|
25
|
+
aguaceroDebugWarn,
|
|
26
|
+
configureAguaceroRnDebug,
|
|
27
|
+
getAguaceroAuthDiagnosticSnapshot,
|
|
28
|
+
isAguaceroRnDebugEnabled,
|
|
29
|
+
} from './aguaceroRnDebug';
|
|
30
|
+
import { installAguaceroCoreDebugHooks, logProcessFrameAuthMismatch } from './aguaceroCoreDebugHooks';
|
|
23
31
|
|
|
24
32
|
const NEXRAD_NATIVE = Platform.OS === 'android' || Platform.OS === 'ios';
|
|
25
33
|
const SATELLITE_NATIVE = Platform.OS === 'android' || Platform.OS === 'ios';
|
|
@@ -154,8 +162,9 @@ function satelliteObsTimelineSig(state) {
|
|
|
154
162
|
return `${keys.length}:${keys[0]}:${keys[keys.length - 1]}`;
|
|
155
163
|
}
|
|
156
164
|
|
|
157
|
-
/** True
|
|
165
|
+
/** True when {@link WeatherLayerManager} `debug` / {@link configureAguaceroRnDebug}, or legacy `__AGUACERO_WX_GRID_DEBUG__`. */
|
|
158
166
|
function wxGridDebugEnabled() {
|
|
167
|
+
if (isAguaceroRnDebugEnabled()) return true;
|
|
159
168
|
try {
|
|
160
169
|
if (typeof __DEV__ !== 'undefined' && __DEV__) return true;
|
|
161
170
|
return Boolean(typeof globalThis !== 'undefined' && globalThis.__AGUACERO_WX_GRID_DEBUG__);
|
|
@@ -274,8 +283,14 @@ export const WeatherLayerManager = forwardRef((props, ref) => {
|
|
|
274
283
|
onNwsAlertClick,
|
|
275
284
|
/** Same semantics as mapsgl / AguaceroCore: Origin + Referer for grid CDN (required by many CloudFront rules). */
|
|
276
285
|
gridRequestSiteOrigin,
|
|
286
|
+
/** When true, logs auth/HTTP diagnostics under `[AguaceroRN][debug]` (Metro / Logcat / Xcode). */
|
|
287
|
+
debug = false,
|
|
277
288
|
...restProps
|
|
278
289
|
} = props;
|
|
290
|
+
|
|
291
|
+
useEffect(() => {
|
|
292
|
+
configureAguaceroRnDebug({ enabled: Boolean(debug) });
|
|
293
|
+
}, [debug]);
|
|
279
294
|
const context = useContext(AguaceroContext);
|
|
280
295
|
|
|
281
296
|
// Create the core here instead of getting it from context
|
|
@@ -295,6 +310,25 @@ export const WeatherLayerManager = forwardRef((props, ref) => {
|
|
|
295
310
|
[apiKey, gridRequestSiteOrigin],
|
|
296
311
|
);
|
|
297
312
|
|
|
313
|
+
useEffect(() => {
|
|
314
|
+
if (!core) return;
|
|
315
|
+
installAguaceroCoreDebugHooks(core, {
|
|
316
|
+
gridRequestSiteOriginProp: gridRequestSiteOrigin ?? null,
|
|
317
|
+
debugProp: Boolean(debug),
|
|
318
|
+
});
|
|
319
|
+
if (isAguaceroRnDebugEnabled() && !apiKey) {
|
|
320
|
+
aguaceroDebugWarn('WeatherLayerManager.missingApiKey', {
|
|
321
|
+
hint: 'apiKey prop is empty — all CDN requests will fail or return 403',
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
if (isAguaceroRnDebugEnabled() && apiKey && !gridRequestSiteOrigin) {
|
|
325
|
+
aguaceroDebugWarn('WeatherLayerManager.missingGridOrigin', {
|
|
326
|
+
hint: 'gridRequestSiteOrigin is not set — CloudFront often returns 403 without Origin/Referer on React Native',
|
|
327
|
+
snapshot: getAguaceroAuthDiagnosticSnapshot(core),
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
}, [core, debug, gridRequestSiteOrigin, apiKey]);
|
|
331
|
+
|
|
298
332
|
const [watchesWarningsOptions, setWatchesWarningsOptions] = useState(() => ({
|
|
299
333
|
alertInteractionEnabled: true,
|
|
300
334
|
...(watchesWarningsProp ?? {}),
|
|
@@ -637,13 +671,17 @@ export const WeatherLayerManager = forwardRef((props, ref) => {
|
|
|
637
671
|
resourcePath = `/grids/${model}/${date}/${run}/${currentFrame}/${variable}/0`;
|
|
638
672
|
}
|
|
639
673
|
|
|
640
|
-
const options =
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
674
|
+
const options = augmentProcessFrameOptionsForDebug(
|
|
675
|
+
buildGridFrameProcessOptions(
|
|
676
|
+
core.baseGridUrl,
|
|
677
|
+
resourcePath,
|
|
678
|
+
core.apiKey,
|
|
679
|
+
core.bundleId,
|
|
680
|
+
gridRequestSiteOrigin,
|
|
681
|
+
),
|
|
682
|
+
core,
|
|
646
683
|
);
|
|
684
|
+
logProcessFrameAuthMismatch(core, options, { phase: 'preloadCurrent', currentCacheKey });
|
|
647
685
|
|
|
648
686
|
try {
|
|
649
687
|
wxGridVerbose('processFrameRequest', { currentCacheKey, resourcePath, frame: currentFrame });
|
|
@@ -763,12 +801,23 @@ export const WeatherLayerManager = forwardRef((props, ref) => {
|
|
|
763
801
|
(typeof e?.message === 'string' && e.message.includes('superseded')));
|
|
764
802
|
if (!cancelled) {
|
|
765
803
|
hasPreloadedRef.current = false;
|
|
766
|
-
|
|
804
|
+
const errDetail = {
|
|
767
805
|
currentCacheKey,
|
|
768
806
|
code: e?.code,
|
|
769
807
|
message: e?.message,
|
|
770
808
|
userInfo: e?.userInfo,
|
|
771
|
-
}
|
|
809
|
+
};
|
|
810
|
+
wxGridWarn('preloadProcessFrameError', errDetail);
|
|
811
|
+
if (isAguaceroRnDebugEnabled()) {
|
|
812
|
+
aguaceroDebugWarn('preloadProcessFrameError', {
|
|
813
|
+
...errDetail,
|
|
814
|
+
auth: getAguaceroAuthDiagnosticSnapshot(core),
|
|
815
|
+
is403:
|
|
816
|
+
e?.code === 'HTTP_ERROR' &&
|
|
817
|
+
typeof e?.message === 'string' &&
|
|
818
|
+
e.message.includes('403'),
|
|
819
|
+
});
|
|
820
|
+
}
|
|
772
821
|
} else {
|
|
773
822
|
wxGridVerbose('preloadProcessFrameCancelled', { currentCacheKey });
|
|
774
823
|
}
|
|
@@ -793,13 +842,17 @@ export const WeatherLayerManager = forwardRef((props, ref) => {
|
|
|
793
842
|
resourcePath = `/grids/${model}/${date}/${run}/${frame}/${variable}/0`;
|
|
794
843
|
}
|
|
795
844
|
|
|
796
|
-
const options =
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
845
|
+
const options = augmentProcessFrameOptionsForDebug(
|
|
846
|
+
buildGridFrameProcessOptions(
|
|
847
|
+
core.baseGridUrl,
|
|
848
|
+
resourcePath,
|
|
849
|
+
core.apiKey,
|
|
850
|
+
core.bundleId,
|
|
851
|
+
gridRequestSiteOrigin,
|
|
852
|
+
),
|
|
853
|
+
core,
|
|
802
854
|
);
|
|
855
|
+
logProcessFrameAuthMismatch(core, options, { phase: 'preloadBackground', cacheKey });
|
|
803
856
|
|
|
804
857
|
WeatherFrameProcessorModule.processFrame(options)
|
|
805
858
|
.then(result => {
|
|
@@ -1194,13 +1247,17 @@ export const WeatherLayerManager = forwardRef((props, ref) => {
|
|
|
1194
1247
|
const frameDate = new Date(frame * 1000);
|
|
1195
1248
|
const y = frameDate.getUTCFullYear(), m = (frameDate.getUTCMonth() + 1).toString().padStart(2, '0'), d = frameDate.getUTCDate().toString().padStart(2, '0');
|
|
1196
1249
|
const resourcePath = `/grids/mrms/${y}${m}${d}/${frame}/0/${currentVariable}/0`;
|
|
1197
|
-
const options =
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1250
|
+
const options = augmentProcessFrameOptionsForDebug(
|
|
1251
|
+
buildGridFrameProcessOptions(
|
|
1252
|
+
core.baseGridUrl,
|
|
1253
|
+
resourcePath,
|
|
1254
|
+
core.apiKey,
|
|
1255
|
+
core.bundleId,
|
|
1256
|
+
gridRequestSiteOrigin,
|
|
1257
|
+
),
|
|
1258
|
+
core,
|
|
1203
1259
|
);
|
|
1260
|
+
logProcessFrameAuthMismatch(core, options, { phase: 'mrmsRefresh', cacheKey });
|
|
1204
1261
|
|
|
1205
1262
|
WeatherFrameProcessorModule.processFrame(options)
|
|
1206
1263
|
.then(result => {
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-core hooks for {@link AguaceroCore} when RN debug is enabled.
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
aguaceroDebug,
|
|
6
|
+
aguaceroDebugWarn,
|
|
7
|
+
getAguaceroAuthDiagnosticSnapshot,
|
|
8
|
+
isAguaceroRnDebugEnabled,
|
|
9
|
+
redactApiKeyFromUrl,
|
|
10
|
+
} from './aguaceroRnDebug';
|
|
11
|
+
|
|
12
|
+
const HOOK_FLAG = '__aguaceroRnDebugHooksInstalled';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @param {import('@aguacerowx/javascript-sdk').AguaceroCore} core
|
|
16
|
+
* @param {Record<string, unknown>} [extra]
|
|
17
|
+
*/
|
|
18
|
+
export function installAguaceroCoreDebugHooks(core, extra = {}) {
|
|
19
|
+
if (!core || !isAguaceroRnDebugEnabled() || core[HOOK_FLAG]) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
core[HOOK_FLAG] = true;
|
|
23
|
+
|
|
24
|
+
aguaceroDebug('core.created', getAguaceroAuthDiagnosticSnapshot(core, extra));
|
|
25
|
+
|
|
26
|
+
if (typeof core.initialize === 'function' && !core.__aguaceroOrigInitialize) {
|
|
27
|
+
core.__aguaceroOrigInitialize = core.initialize.bind(core);
|
|
28
|
+
core.initialize = async function aguaceroDebugInitialize(options) {
|
|
29
|
+
aguaceroDebug('core.initialize.start', {
|
|
30
|
+
stateMode: {
|
|
31
|
+
isMRMS: core.state?.isMRMS,
|
|
32
|
+
isSatellite: core.state?.isSatellite,
|
|
33
|
+
isNexrad: core.state?.isNexrad,
|
|
34
|
+
model: core.state?.model,
|
|
35
|
+
variable: core.state?.variable,
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
try {
|
|
39
|
+
await core.__aguaceroOrigInitialize(options);
|
|
40
|
+
aguaceroDebug('core.initialize.done', {
|
|
41
|
+
hasModelStatus: Boolean(core.modelStatus),
|
|
42
|
+
hasMrmsStatus: Boolean(core.mrmsStatus),
|
|
43
|
+
hasSatelliteListing: Boolean(core.satelliteListing),
|
|
44
|
+
mrmsVariableCount: core.mrmsStatus ? Object.keys(core.mrmsStatus).length : 0,
|
|
45
|
+
});
|
|
46
|
+
} catch (err) {
|
|
47
|
+
aguaceroDebugWarn('core.initialize.error', { message: err?.message || String(err) });
|
|
48
|
+
throw err;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (typeof core._loadGridData === 'function' && !core.__aguaceroOrigLoadGridData) {
|
|
54
|
+
core.__aguaceroOrigLoadGridData = core._loadGridData.bind(core);
|
|
55
|
+
core._loadGridData = async function aguaceroDebugLoadGridData(state) {
|
|
56
|
+
const tag = 'core._loadGridData';
|
|
57
|
+
aguaceroDebug(`${tag}.start`, {
|
|
58
|
+
isMRMS: state?.isMRMS,
|
|
59
|
+
model: state?.model,
|
|
60
|
+
variable: state?.variable,
|
|
61
|
+
mrmsTimestamp: state?.mrmsTimestamp,
|
|
62
|
+
forecastHour: state?.forecastHour,
|
|
63
|
+
auth: getAguaceroAuthDiagnosticSnapshot(core),
|
|
64
|
+
});
|
|
65
|
+
const result = await core.__aguaceroOrigLoadGridData(state);
|
|
66
|
+
if (result == null) {
|
|
67
|
+
aguaceroDebugWarn(`${tag}.null`, {
|
|
68
|
+
hint: 'Grid load returned null — often failed fetch (check fetch.httpError above) or missing apiKey',
|
|
69
|
+
});
|
|
70
|
+
} else {
|
|
71
|
+
aguaceroDebug(`${tag}.ok`, {
|
|
72
|
+
hasData: Boolean(result?.data),
|
|
73
|
+
encodingKeys: result?.encoding ? Object.keys(result.encoding) : [],
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
return result;
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (typeof core.refreshNexradTimes === 'function' && !core.__aguaceroOrigRefreshNexradTimes) {
|
|
81
|
+
core.__aguaceroOrigRefreshNexradTimes = core.refreshNexradTimes.bind(core);
|
|
82
|
+
core.refreshNexradTimes = async function aguaceroDebugRefreshNexradTimes() {
|
|
83
|
+
aguaceroDebug('core.refreshNexradTimes.start', {
|
|
84
|
+
site: core.state?.nexradSite,
|
|
85
|
+
product: core.state?.nexradProduct,
|
|
86
|
+
dataSource: core.state?.nexradDataSource,
|
|
87
|
+
});
|
|
88
|
+
try {
|
|
89
|
+
const out = await core.__aguaceroOrigRefreshNexradTimes();
|
|
90
|
+
aguaceroDebug('core.refreshNexradTimes.done', {
|
|
91
|
+
timesCount: out?.unixTimes?.length ?? 0,
|
|
92
|
+
});
|
|
93
|
+
return out;
|
|
94
|
+
} catch (err) {
|
|
95
|
+
aguaceroDebugWarn('core.refreshNexradTimes.error', { message: err?.message || String(err) });
|
|
96
|
+
throw err;
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (typeof core.setState === 'function' && !core.__aguaceroOrigSetState) {
|
|
102
|
+
core.__aguaceroOrigSetState = core.setState.bind(core);
|
|
103
|
+
core.setState = async function aguaceroDebugSetState(patch) {
|
|
104
|
+
const modeChange =
|
|
105
|
+
patch &&
|
|
106
|
+
('isMRMS' in patch || 'isSatellite' in patch || 'isNexrad' in patch || 'variable' in patch);
|
|
107
|
+
if (modeChange) {
|
|
108
|
+
aguaceroDebug('core.setState.modePatch', {
|
|
109
|
+
keys: Object.keys(patch || {}),
|
|
110
|
+
patch: { ...patch, apiKey: undefined },
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
return core.__aguaceroOrigSetState(patch);
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* @param {import('@aguacerowx/javascript-sdk').AguaceroCore} core
|
|
120
|
+
*/
|
|
121
|
+
export function logProcessFrameAuthMismatch(core, options, context = {}) {
|
|
122
|
+
if (!isAguaceroRnDebugEnabled() || !core || !options) return;
|
|
123
|
+
const mismatches = [];
|
|
124
|
+
if (options.apiKey && core.apiKey && options.apiKey !== core.apiKey) {
|
|
125
|
+
mismatches.push('processFrame.apiKey !== core.apiKey');
|
|
126
|
+
}
|
|
127
|
+
if (options.bundleId !== undefined && options.bundleId !== core.bundleId) {
|
|
128
|
+
mismatches.push('processFrame.bundleId !== core.bundleId');
|
|
129
|
+
}
|
|
130
|
+
const optOrigin = options.gridRequestSiteOrigin || '';
|
|
131
|
+
const coreOrigin = core.gridRequestSiteOrigin || '';
|
|
132
|
+
if (String(optOrigin) !== String(coreOrigin)) {
|
|
133
|
+
mismatches.push('processFrame.gridRequestSiteOrigin !== core.gridRequestSiteOrigin');
|
|
134
|
+
}
|
|
135
|
+
if (mismatches.length > 0) {
|
|
136
|
+
aguaceroDebugWarn('auth.mismatch', {
|
|
137
|
+
mismatches,
|
|
138
|
+
processFrameUrl: redactApiKeyFromUrl(options.url),
|
|
139
|
+
...context,
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
}
|