@luciq/react-native 18.0.0-5556-SNAPSHOT β 18.0.0-9508-SNAPSHOT
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 +2 -0
- package/bin/index.js +7 -2
- package/cli/upload/migrate.ts +8 -2
- package/dangerfile.ts +1 -1
- package/dist/modules/NetworkLogger.js +16 -0
- package/dist/utils/XhrNetworkInterceptor.js +4 -9
- package/package.json +1 -1
- package/src/modules/NetworkLogger.ts +16 -0
- package/src/utils/XhrNetworkInterceptor.ts +5 -9
- package/upload/index.js +7 -2
package/README.md
CHANGED
|
@@ -63,6 +63,8 @@ Luciq.init({
|
|
|
63
63
|
|
|
64
64
|
_You can find your app token by selecting the SDK tab from your [**Luciq dashboard**](https://dashboard.luciq.ai)._
|
|
65
65
|
|
|
66
|
+
> :warning: If you're updating the SDK from versions prior to v11, please check our [migration guide](https://docs.luciq.ai/docs/react-native-migration-guide).
|
|
67
|
+
|
|
66
68
|
## Microphone and Photo Library Usage Description (iOS Only)
|
|
67
69
|
|
|
68
70
|
Luciq needs access to the microphone and photo library to be able to let users add audio and video attachments. Starting from iOS 10, apps that donβt provide a usage description for those 2 permissions would be rejected when submitted to the App Store.
|
package/bin/index.js
CHANGED
|
@@ -18975,6 +18975,8 @@ const migrate = async (opts) => {
|
|
|
18975
18975
|
// Sort methods by priority (lower number = higher priority)
|
|
18976
18976
|
const sortedMethods = enabledMethods.sort((a, b) => (a.priority || 999) - (b.priority || 999));
|
|
18977
18977
|
if (!opts.silent) {
|
|
18978
|
+
console.log('π Starting migration with all enabled methods');
|
|
18979
|
+
console.log(`π Found ${sortedMethods.length} enabled method(s):`);
|
|
18978
18980
|
sortedMethods.forEach((method) => {
|
|
18979
18981
|
console.log(` - ${method.name}: ${method.description}`);
|
|
18980
18982
|
});
|
|
@@ -19074,13 +19076,13 @@ function processFile(filePath, method, dryRun, silent) {
|
|
|
19074
19076
|
if (newContent !== content) {
|
|
19075
19077
|
if (dryRun) {
|
|
19076
19078
|
if (!silent) {
|
|
19077
|
-
console.log(`π
|
|
19079
|
+
console.log(`π [${method.name}] Would update content: ${filePath}`);
|
|
19078
19080
|
}
|
|
19079
19081
|
return;
|
|
19080
19082
|
}
|
|
19081
19083
|
fs$2.writeFileSync(filePath, newContent, 'utf8');
|
|
19082
19084
|
if (!silent) {
|
|
19083
|
-
console.log(`π
|
|
19085
|
+
console.log(`π [${method.name}] Updated content: ${filePath}`);
|
|
19084
19086
|
}
|
|
19085
19087
|
}
|
|
19086
19088
|
}
|
|
@@ -19119,6 +19121,9 @@ async function executeAllMethods(methods, dryRun, silent) {
|
|
|
19119
19121
|
}
|
|
19120
19122
|
async function executeMethod(method, dryRun, silent) {
|
|
19121
19123
|
const startDir = process.cwd();
|
|
19124
|
+
if (!silent) {
|
|
19125
|
+
console.log(`π Executing method: ${method.name}`);
|
|
19126
|
+
}
|
|
19122
19127
|
walkDirectory(startDir, method, dryRun, silent);
|
|
19123
19128
|
}
|
|
19124
19129
|
|
package/cli/upload/migrate.ts
CHANGED
|
@@ -80,6 +80,8 @@ export const migrate = async (opts: MigrateOptions): Promise<boolean> => {
|
|
|
80
80
|
const sortedMethods = enabledMethods.sort((a, b) => (a.priority || 999) - (b.priority || 999));
|
|
81
81
|
|
|
82
82
|
if (!opts.silent) {
|
|
83
|
+
console.log('π Starting migration with all enabled methods');
|
|
84
|
+
console.log(`π Found ${sortedMethods.length} enabled method(s):`);
|
|
83
85
|
sortedMethods.forEach((method) => {
|
|
84
86
|
console.log(` - ${method.name}: ${method.description}`);
|
|
85
87
|
});
|
|
@@ -199,14 +201,14 @@ function processFile(
|
|
|
199
201
|
if (newContent !== content) {
|
|
200
202
|
if (dryRun) {
|
|
201
203
|
if (!silent) {
|
|
202
|
-
console.log(`π
|
|
204
|
+
console.log(`π [${method.name}] Would update content: ${filePath}`);
|
|
203
205
|
}
|
|
204
206
|
return;
|
|
205
207
|
}
|
|
206
208
|
|
|
207
209
|
fs.writeFileSync(filePath, newContent, 'utf8');
|
|
208
210
|
if (!silent) {
|
|
209
|
-
console.log(`π
|
|
211
|
+
console.log(`π [${method.name}] Updated content: ${filePath}`);
|
|
210
212
|
}
|
|
211
213
|
}
|
|
212
214
|
} catch (error) {
|
|
@@ -261,5 +263,9 @@ async function executeMethod(
|
|
|
261
263
|
): Promise<void> {
|
|
262
264
|
const startDir = process.cwd();
|
|
263
265
|
|
|
266
|
+
if (!silent) {
|
|
267
|
+
console.log(`π Executing method: ${method.name}`);
|
|
268
|
+
}
|
|
269
|
+
|
|
264
270
|
walkDirectory(startDir, method, dryRun, silent);
|
|
265
271
|
}
|
package/dangerfile.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import collectCoverage, { ReportType } from '@
|
|
1
|
+
import collectCoverage, { ReportType } from '@luciq/danger-plugin-coverage';
|
|
2
2
|
import { danger, fail, schedule, warn } from 'danger';
|
|
3
3
|
|
|
4
4
|
const hasSourceChanges = danger.git.modified_files.some((file) => file.startsWith('src/'));
|
|
@@ -47,10 +47,26 @@ export const setEnabled = (isEnabled) => {
|
|
|
47
47
|
Logger.warn('LCQ-RN:', `${LuciqConstants.MAX_RESPONSE_BODY_SIZE_EXCEEDED_MESSAGE}${MAX_NETWORK_BODY_SIZE_IN_BYTES / 1024} Kb`);
|
|
48
48
|
}
|
|
49
49
|
if (network.requestBody && isContentTypeNotAllowed(network.requestContentType)) {
|
|
50
|
+
Logger.log('LCQ-RN: Request body omitted - unsupported content type', {
|
|
51
|
+
url: network.url,
|
|
52
|
+
method: network.method,
|
|
53
|
+
responseCode: network.responseCode,
|
|
54
|
+
requestContentType: network.requestContentType,
|
|
55
|
+
requestHeaderKeys: Object.keys(network.requestHeaders ?? {}),
|
|
56
|
+
requestBodyPreview: network.requestBody?.substring(0, 200) ?? '',
|
|
57
|
+
});
|
|
50
58
|
network.requestBody = `Body is omitted because content type ${network.requestContentType} isn't supported`;
|
|
51
59
|
Logger.warn(`LCQ-RN: The request body for the network request with URL ${network.url} has been omitted because the content type ${network.requestContentType} isn't supported.`);
|
|
52
60
|
}
|
|
53
61
|
if (network.responseBody && isContentTypeNotAllowed(network.contentType)) {
|
|
62
|
+
Logger.log('LCQ-RN: Response body omitted - unsupported content type', {
|
|
63
|
+
url: network.url,
|
|
64
|
+
method: network.method,
|
|
65
|
+
responseCode: network.responseCode,
|
|
66
|
+
contentType: network.contentType,
|
|
67
|
+
responseHeaderKeys: Object.keys(network.responseHeaders ?? {}),
|
|
68
|
+
responseBodyPreview: network.responseBody?.substring(0, 200) ?? '',
|
|
69
|
+
});
|
|
54
70
|
network.responseBody = `Body is omitted because content type ${network.contentType} isn't supported`;
|
|
55
71
|
Logger.warn(`LCQ-RN: The response body for the network request with URL ${network.url} has been omitted because the content type ${network.contentType} isn't supported.`);
|
|
56
72
|
}
|
|
@@ -199,16 +199,11 @@ export default {
|
|
|
199
199
|
cloneNetwork.gqlQueryName = '';
|
|
200
200
|
}
|
|
201
201
|
if (cloneNetwork.responseBody) {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
cloneNetwork.serverErrorMessage = 'GraphQLError';
|
|
206
|
-
}
|
|
207
|
-
else {
|
|
208
|
-
cloneNetwork.serverErrorMessage = '';
|
|
209
|
-
}
|
|
202
|
+
const responseObj = JSON.parse(cloneNetwork.responseBody);
|
|
203
|
+
if (responseObj.errors) {
|
|
204
|
+
cloneNetwork.serverErrorMessage = 'GraphQLError';
|
|
210
205
|
}
|
|
211
|
-
|
|
206
|
+
else {
|
|
212
207
|
cloneNetwork.serverErrorMessage = '';
|
|
213
208
|
}
|
|
214
209
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luciq/react-native",
|
|
3
3
|
"description": "Luciq is the Agentic Observability Platform built for Mobile.",
|
|
4
|
-
"version": "18.0.0-
|
|
4
|
+
"version": "18.0.0-9508-SNAPSHOT",
|
|
5
5
|
"author": "Luciq (https://luciq.ai)",
|
|
6
6
|
"repository": "github:luciqai/luciq-reactnative-sdk",
|
|
7
7
|
"homepage": "https://www.luciq.ai/platforms/react-native",
|
|
@@ -84,6 +84,14 @@ export const setEnabled = (isEnabled: boolean) => {
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
if (network.requestBody && isContentTypeNotAllowed(network.requestContentType)) {
|
|
87
|
+
Logger.log('LCQ-RN: Request body omitted - unsupported content type', {
|
|
88
|
+
url: network.url,
|
|
89
|
+
method: network.method,
|
|
90
|
+
responseCode: network.responseCode,
|
|
91
|
+
requestContentType: network.requestContentType,
|
|
92
|
+
requestHeaderKeys: Object.keys(network.requestHeaders ?? {}),
|
|
93
|
+
requestBodyPreview: network.requestBody?.substring(0, 200) ?? '',
|
|
94
|
+
});
|
|
87
95
|
network.requestBody = `Body is omitted because content type ${network.requestContentType} isn't supported`;
|
|
88
96
|
Logger.warn(
|
|
89
97
|
`LCQ-RN: The request body for the network request with URL ${network.url} has been omitted because the content type ${network.requestContentType} isn't supported.`,
|
|
@@ -91,6 +99,14 @@ export const setEnabled = (isEnabled: boolean) => {
|
|
|
91
99
|
}
|
|
92
100
|
|
|
93
101
|
if (network.responseBody && isContentTypeNotAllowed(network.contentType)) {
|
|
102
|
+
Logger.log('LCQ-RN: Response body omitted - unsupported content type', {
|
|
103
|
+
url: network.url,
|
|
104
|
+
method: network.method,
|
|
105
|
+
responseCode: network.responseCode,
|
|
106
|
+
contentType: network.contentType,
|
|
107
|
+
responseHeaderKeys: Object.keys(network.responseHeaders ?? {}),
|
|
108
|
+
responseBodyPreview: network.responseBody?.substring(0, 200) ?? '',
|
|
109
|
+
});
|
|
94
110
|
network.responseBody = `Body is omitted because content type ${network.contentType} isn't supported`;
|
|
95
111
|
Logger.warn(
|
|
96
112
|
`LCQ-RN: The response body for the network request with URL ${network.url} has been omitted because the content type ${network.contentType} isn't supported.`,
|
|
@@ -275,15 +275,11 @@ export default {
|
|
|
275
275
|
cloneNetwork.gqlQueryName = '';
|
|
276
276
|
}
|
|
277
277
|
if (cloneNetwork.responseBody) {
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
} else {
|
|
284
|
-
cloneNetwork.serverErrorMessage = '';
|
|
285
|
-
}
|
|
286
|
-
} catch (_error) {
|
|
278
|
+
const responseObj = JSON.parse(cloneNetwork.responseBody);
|
|
279
|
+
|
|
280
|
+
if (responseObj.errors) {
|
|
281
|
+
cloneNetwork.serverErrorMessage = 'GraphQLError';
|
|
282
|
+
} else {
|
|
287
283
|
cloneNetwork.serverErrorMessage = '';
|
|
288
284
|
}
|
|
289
285
|
}
|
package/upload/index.js
CHANGED
|
@@ -17155,6 +17155,8 @@ const migrate = async (opts) => {
|
|
|
17155
17155
|
// Sort methods by priority (lower number = higher priority)
|
|
17156
17156
|
const sortedMethods = enabledMethods.sort((a, b) => (a.priority || 999) - (b.priority || 999));
|
|
17157
17157
|
if (!opts.silent) {
|
|
17158
|
+
console.log('π Starting migration with all enabled methods');
|
|
17159
|
+
console.log(`π Found ${sortedMethods.length} enabled method(s):`);
|
|
17158
17160
|
sortedMethods.forEach((method) => {
|
|
17159
17161
|
console.log(` - ${method.name}: ${method.description}`);
|
|
17160
17162
|
});
|
|
@@ -17254,13 +17256,13 @@ function processFile(filePath, method, dryRun, silent) {
|
|
|
17254
17256
|
if (newContent !== content) {
|
|
17255
17257
|
if (dryRun) {
|
|
17256
17258
|
if (!silent) {
|
|
17257
|
-
console.log(`π
|
|
17259
|
+
console.log(`π [${method.name}] Would update content: ${filePath}`);
|
|
17258
17260
|
}
|
|
17259
17261
|
return;
|
|
17260
17262
|
}
|
|
17261
17263
|
fs$1.writeFileSync(filePath, newContent, 'utf8');
|
|
17262
17264
|
if (!silent) {
|
|
17263
|
-
console.log(`π
|
|
17265
|
+
console.log(`π [${method.name}] Updated content: ${filePath}`);
|
|
17264
17266
|
}
|
|
17265
17267
|
}
|
|
17266
17268
|
}
|
|
@@ -17299,6 +17301,9 @@ async function executeAllMethods(methods, dryRun, silent) {
|
|
|
17299
17301
|
}
|
|
17300
17302
|
async function executeMethod(method, dryRun, silent) {
|
|
17301
17303
|
const startDir = process.cwd();
|
|
17304
|
+
if (!silent) {
|
|
17305
|
+
console.log(`π Executing method: ${method.name}`);
|
|
17306
|
+
}
|
|
17302
17307
|
walkDirectory(startDir, method, dryRun, silent);
|
|
17303
17308
|
}
|
|
17304
17309
|
|