@ansight/react-native 1.0.2-preview.7 → 1.0.2-preview.8
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
CHANGED
|
@@ -25,8 +25,8 @@ npx react-native run-android
|
|
|
25
25
|
|
|
26
26
|
This package version expects matching native SDK packages:
|
|
27
27
|
|
|
28
|
-
- CocoaPods: `Ansight`, `AnsightObjC` version `1.0.2-preview.
|
|
29
|
-
- Maven: `ai.ansight:ansight-android:1.0.2-preview.
|
|
28
|
+
- CocoaPods: `Ansight`, `AnsightObjC` version `1.0.2-preview.8`
|
|
29
|
+
- Maven: `ai.ansight:ansight-android:1.0.2-preview.8`
|
|
30
30
|
|
|
31
31
|
## Quickstart
|
|
32
32
|
|
|
@@ -112,6 +112,20 @@ The TypeScript `AnsightOptions` surface mirrors Android `AnsightOptions`, iOS
|
|
|
112
112
|
| `remoteTools` | Native visual tree, file, database, preferences, reflection, and secure-storage tool options. |
|
|
113
113
|
| `lifecycle` | JS AppState tracking toggle. Defaults to true. |
|
|
114
114
|
|
|
115
|
+
Cellular host connections are disabled by default. The restriction applies to
|
|
116
|
+
bundled configs, QR/payload flows, remembered/saved profiles, and manual
|
|
117
|
+
connections. Opt in only for a trusted development host or personal hotspot:
|
|
118
|
+
|
|
119
|
+
```ts
|
|
120
|
+
const options = Ansight.createOptionsBuilder()
|
|
121
|
+
.withCellularHostConnections()
|
|
122
|
+
.build();
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
You can also set `hostConnection.allowCellularConnections: true` directly.
|
|
126
|
+
This may consume mobile data and permits connection attempts over a broader or
|
|
127
|
+
carrier-managed network; signed pairing-config validation still applies.
|
|
128
|
+
|
|
115
129
|
Example:
|
|
116
130
|
|
|
117
131
|
```ts
|
package/android/build.gradle
CHANGED
|
@@ -749,6 +749,10 @@ class AnsightReactNativeModule(
|
|
|
749
749
|
bundledConfigJson = host.stringValue("bundledConfigJson") ?: options.hostConnection.bundledConfigJson,
|
|
750
750
|
bundledDeveloperConfigJson = host.stringValue("bundledDeveloperConfigJson") ?: options.hostConnection.bundledDeveloperConfigJson,
|
|
751
751
|
discoveryPort = host.optionalInt("discoveryPort") ?: options.hostConnection.discoveryPort,
|
|
752
|
+
allowCellularConnections = host.booleanValue(
|
|
753
|
+
"allowCellularConnections",
|
|
754
|
+
options.hostConnection.allowCellularConnections,
|
|
755
|
+
),
|
|
752
756
|
connectionProfileRetentionSeconds = host.longValue(
|
|
753
757
|
"connectionProfileRetentionSeconds",
|
|
754
758
|
options.hostConnection.connectionProfileRetentionSeconds,
|
|
@@ -1095,6 +1099,7 @@ class AnsightReactNativeModule(
|
|
|
1095
1099
|
"hasBundledConfigJson" to (options.hostConnection.bundledConfigJson != null),
|
|
1096
1100
|
"hasBundledDeveloperConfigJson" to (options.hostConnection.bundledDeveloperConfigJson != null),
|
|
1097
1101
|
"discoveryPort" to options.hostConnection.discoveryPort,
|
|
1102
|
+
"allowCellularConnections" to options.hostConnection.allowCellularConnections,
|
|
1098
1103
|
"connectionProfileRetentionSeconds" to options.hostConnection.connectionProfileRetentionSeconds,
|
|
1099
1104
|
).toWritableMap())
|
|
1100
1105
|
putMap("secureStorage", mapOf(
|
package/index.d.ts
CHANGED
|
@@ -143,6 +143,7 @@ export interface AnsightOptions {
|
|
|
143
143
|
bundledConfigJson?: string;
|
|
144
144
|
bundledDeveloperConfigJson?: string;
|
|
145
145
|
discoveryPort?: number;
|
|
146
|
+
allowCellularConnections?: boolean;
|
|
146
147
|
connectionProfileRetentionSeconds?: number;
|
|
147
148
|
};
|
|
148
149
|
secureStorage?: {
|
|
@@ -293,6 +294,7 @@ export class AnsightOptionsBuilder {
|
|
|
293
294
|
bundledConfigJson?: string;
|
|
294
295
|
}): this;
|
|
295
296
|
withHostConnectionDiscoveryPort(discoveryPort: number): this;
|
|
297
|
+
withCellularHostConnections(allow?: boolean): this;
|
|
296
298
|
withHostConnectionProfileRetentionSeconds(connectionProfileRetentionSeconds: number): this;
|
|
297
299
|
withSecureStorage(secureStorage?: NonNullable<AnsightOptions["secureStorage"]>): this;
|
|
298
300
|
withRemoteTools(remoteTools?: AnsightRemoteToolsOptions): this;
|
package/index.js
CHANGED
|
@@ -398,6 +398,13 @@ class AnsightOptionsBuilder {
|
|
|
398
398
|
}));
|
|
399
399
|
}
|
|
400
400
|
|
|
401
|
+
withCellularHostConnections(allow = true) {
|
|
402
|
+
return this.configureHostConnection((hostConnection) => ({
|
|
403
|
+
...hostConnection,
|
|
404
|
+
allowCellularConnections: allow,
|
|
405
|
+
}));
|
|
406
|
+
}
|
|
407
|
+
|
|
401
408
|
withHostConnectionProfileRetentionSeconds(connectionProfileRetentionSeconds) {
|
|
402
409
|
return this.configureHostConnection((hostConnection) => ({
|
|
403
410
|
...hostConnection,
|
|
@@ -978,6 +978,11 @@ final class AnsightReactNative: RCTEventEmitter {
|
|
|
978
978
|
savedConfigKey: stringValue(host, "savedConfigKey") ?? options.hostConnection.savedConfigKey,
|
|
979
979
|
connectionProfileRetentionSeconds: intValue(host, "connectionProfileRetentionSeconds", defaultValue: options.hostConnection.connectionProfileRetentionSeconds),
|
|
980
980
|
discoveryPort: optionalInt(host, "discoveryPort") ?? options.hostConnection.discoveryPort,
|
|
981
|
+
allowCellularConnections: boolValue(
|
|
982
|
+
host,
|
|
983
|
+
"allowCellularConnections",
|
|
984
|
+
defaultValue: options.hostConnection.allowCellularConnections
|
|
985
|
+
),
|
|
981
986
|
bundledDeveloperConfigJson: stringValue(host, "bundledDeveloperConfigJson") ?? options.hostConnection.bundledDeveloperConfigJson,
|
|
982
987
|
bundledConfigJson: stringValue(host, "bundledConfigJson") ?? options.hostConnection.bundledConfigJson
|
|
983
988
|
)
|
|
@@ -1294,6 +1299,7 @@ final class AnsightReactNative: RCTEventEmitter {
|
|
|
1294
1299
|
"savedConfigKey": options.hostConnection.savedConfigKey,
|
|
1295
1300
|
"connectionProfileRetentionSeconds": options.hostConnection.connectionProfileRetentionSeconds,
|
|
1296
1301
|
"discoveryPort": options.hostConnection.discoveryPort as Any,
|
|
1302
|
+
"allowCellularConnections": options.hostConnection.allowCellularConnections,
|
|
1297
1303
|
"hasBundledDeveloperConfigJson": options.hostConnection.bundledDeveloperConfigJson != nil,
|
|
1298
1304
|
"hasBundledConfigJson": options.hostConnection.bundledConfigJson != nil,
|
|
1299
1305
|
],
|