react-native-my-survey-sdk 2.2.27 → 2.2.29
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
CHANGED
|
@@ -5,10 +5,8 @@ import {
|
|
|
5
5
|
XeboChoice,
|
|
6
6
|
XeboConditionalFollowUp,
|
|
7
7
|
XeboAnswer,
|
|
8
|
-
XeboEnvironment,
|
|
9
8
|
XeboUserData,
|
|
10
9
|
XeboQualityFlags,
|
|
11
|
-
XeboDeviceInfo,
|
|
12
10
|
XeboGeolocation,
|
|
13
11
|
} from '../models/XeboModels';
|
|
14
12
|
import {
|
|
@@ -20,29 +18,20 @@ import {
|
|
|
20
18
|
|
|
21
19
|
// ─── URL helpers ──────────────────────────────────────────────────────────────
|
|
22
20
|
|
|
23
|
-
export function
|
|
24
|
-
|
|
25
|
-
return { resolvedZone: zone.slice(4), environment: 'uat' };
|
|
26
|
-
}
|
|
27
|
-
return { resolvedZone: zone, environment: explicitEnv ?? 'production' };
|
|
21
|
+
export function resolveZone(zone: string): string {
|
|
22
|
+
return zone;
|
|
28
23
|
}
|
|
29
24
|
|
|
30
|
-
export function buildBaseURL(resolvedZone: string
|
|
31
|
-
return
|
|
32
|
-
? `https://uat-${resolvedZone}-api.xebo.ai`
|
|
33
|
-
: `https://${resolvedZone}-api.xebo.ai`;
|
|
25
|
+
export function buildBaseURL(resolvedZone: string): string {
|
|
26
|
+
return `https://${resolvedZone}-api.xebo.ai`;
|
|
34
27
|
}
|
|
35
28
|
|
|
36
|
-
export function buildFeedbackBaseURL(resolvedZone: string
|
|
37
|
-
return
|
|
38
|
-
? `https://uat-${resolvedZone}-feedback-api.xebo.ai`
|
|
39
|
-
: `https://${resolvedZone}-feedback-api.xebo.ai`;
|
|
29
|
+
export function buildFeedbackBaseURL(resolvedZone: string): string {
|
|
30
|
+
return `https://${resolvedZone}-feedback-api.xebo.ai`;
|
|
40
31
|
}
|
|
41
32
|
|
|
42
|
-
export function buildVerifyURL(
|
|
43
|
-
return
|
|
44
|
-
? 'https://uat-api.xebo.ai/api/v1/api-key/verify'
|
|
45
|
-
: 'https://api.xebo.ai/api/v1/api-key/verify';
|
|
33
|
+
export function buildVerifyURL(): string {
|
|
34
|
+
return 'https://api.xebo.ai/api/v1/api-key/verify';
|
|
46
35
|
}
|
|
47
36
|
|
|
48
37
|
// ─── Step 0: API key verification → bearer token ─────────────────────────────
|
|
@@ -389,7 +378,6 @@ export interface SubmitMeta {
|
|
|
389
378
|
startTime?: string;
|
|
390
379
|
endTime?: string;
|
|
391
380
|
qualityFlags?: XeboQualityFlags;
|
|
392
|
-
deviceInfo?: XeboDeviceInfo;
|
|
393
381
|
geolocation?: XeboGeolocation;
|
|
394
382
|
}
|
|
395
383
|
|
|
@@ -425,7 +413,6 @@ export async function submitResponse(
|
|
|
425
413
|
const payload: Record<string, unknown> = {
|
|
426
414
|
collector_id: collectorUUID,
|
|
427
415
|
...(meta?.qualityFlags && { qualityFlags: meta.qualityFlags }),
|
|
428
|
-
...(meta?.deviceInfo && { deviceInfo: meta.deviceInfo }),
|
|
429
416
|
...(meta?.geolocation && { geoLocation: meta.geolocation }),
|
|
430
417
|
responses: [
|
|
431
418
|
{
|
|
@@ -36,15 +36,12 @@ import {
|
|
|
36
36
|
XeboAnswer,
|
|
37
37
|
XeboConfig,
|
|
38
38
|
XeboThemeConfig,
|
|
39
|
-
XeboEnvironment,
|
|
40
39
|
XeboQueuedResponse,
|
|
41
40
|
XeboUserData,
|
|
42
41
|
XeboQualityFlags,
|
|
43
|
-
XeboDeviceInfo,
|
|
44
42
|
XeboGeolocation,
|
|
45
43
|
} from '../models/XeboModels';
|
|
46
44
|
import {
|
|
47
|
-
resolveZoneAndEnv,
|
|
48
45
|
buildBaseURL,
|
|
49
46
|
buildFeedbackBaseURL,
|
|
50
47
|
buildVerifyURL,
|
|
@@ -72,7 +69,6 @@ class XeboSurveyManagerClass extends SimpleEventEmitter {
|
|
|
72
69
|
private apiKey = '';
|
|
73
70
|
private collectorId = '';
|
|
74
71
|
private resolvedZone = '';
|
|
75
|
-
private environment: XeboEnvironment = 'production';
|
|
76
72
|
private baseURL = '';
|
|
77
73
|
private feedbackBaseURL = '';
|
|
78
74
|
private verifyURL = '';
|
|
@@ -107,12 +103,10 @@ class XeboSurveyManagerClass extends SimpleEventEmitter {
|
|
|
107
103
|
this.apiKey = config.apiKey;
|
|
108
104
|
this.collectorId = config.collectorId;
|
|
109
105
|
|
|
110
|
-
|
|
111
|
-
this.
|
|
112
|
-
this.
|
|
113
|
-
this.
|
|
114
|
-
this.feedbackBaseURL = buildFeedbackBaseURL(this.resolvedZone, this.environment);
|
|
115
|
-
this.verifyURL = buildVerifyURL(this.environment);
|
|
106
|
+
this.resolvedZone = config.zone;
|
|
107
|
+
this.baseURL = buildBaseURL(this.resolvedZone);
|
|
108
|
+
this.feedbackBaseURL = buildFeedbackBaseURL(this.resolvedZone);
|
|
109
|
+
this.verifyURL = buildVerifyURL();
|
|
116
110
|
|
|
117
111
|
// Capture device info once at configure time
|
|
118
112
|
this.deviceModel = `${DeviceInfo.getModel()} (${DeviceInfo.getSystemName()})`;
|
|
@@ -286,14 +280,6 @@ class XeboSurveyManagerClass extends SimpleEventEmitter {
|
|
|
286
280
|
};
|
|
287
281
|
}
|
|
288
282
|
|
|
289
|
-
private _buildDeviceInfo(): XeboDeviceInfo {
|
|
290
|
-
return {
|
|
291
|
-
type: 'mobile',
|
|
292
|
-
os: Platform.OS,
|
|
293
|
-
browser: 'app',
|
|
294
|
-
};
|
|
295
|
-
}
|
|
296
|
-
|
|
297
283
|
private _buildGeolocation(): XeboGeolocation {
|
|
298
284
|
return {
|
|
299
285
|
type: 'point',
|
|
@@ -324,7 +310,6 @@ class XeboSurveyManagerClass extends SimpleEventEmitter {
|
|
|
324
310
|
startTime: this.surveyStartTime,
|
|
325
311
|
endTime,
|
|
326
312
|
qualityFlags: this._buildQualityFlags(),
|
|
327
|
-
deviceInfo: this._buildDeviceInfo(),
|
|
328
313
|
geolocation: this._buildGeolocation(),
|
|
329
314
|
},
|
|
330
315
|
);
|
|
@@ -361,7 +346,6 @@ class XeboSurveyManagerClass extends SimpleEventEmitter {
|
|
|
361
346
|
platform: Platform.OS,
|
|
362
347
|
osVersion: this.osVersion,
|
|
363
348
|
qualityFlags: this._buildQualityFlags(),
|
|
364
|
-
deviceInfo: this._buildDeviceInfo(),
|
|
365
349
|
geolocation: this._buildGeolocation(),
|
|
366
350
|
};
|
|
367
351
|
|
|
@@ -395,7 +379,6 @@ class XeboSurveyManagerClass extends SimpleEventEmitter {
|
|
|
395
379
|
startTime: queued.startTime,
|
|
396
380
|
endTime: queued.endTime,
|
|
397
381
|
qualityFlags: queued.qualityFlags,
|
|
398
|
-
deviceInfo: queued.deviceInfo,
|
|
399
382
|
geolocation: queued.geolocation,
|
|
400
383
|
},
|
|
401
384
|
);
|
package/src/index.ts
CHANGED
package/src/models/XeboModels.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
// ─── Enums ───────────────────────────────────────────────────────────────────
|
|
2
2
|
|
|
3
|
-
export type XeboEnvironment = 'production' | 'uat';
|
|
4
|
-
|
|
5
3
|
export enum XeboQuestionType {
|
|
6
4
|
singleChoice = 'singleChoice',
|
|
7
5
|
multipleChoice = 'multipleChoice',
|
|
@@ -149,7 +147,6 @@ export interface XeboQueuedResponse {
|
|
|
149
147
|
platform?: string;
|
|
150
148
|
osVersion?: string;
|
|
151
149
|
qualityFlags?: XeboQualityFlags;
|
|
152
|
-
deviceInfo?: XeboDeviceInfo;
|
|
153
150
|
geolocation?: XeboGeolocation;
|
|
154
151
|
}
|
|
155
152
|
|
|
@@ -159,7 +156,6 @@ export interface XeboConfig {
|
|
|
159
156
|
apiKey: string;
|
|
160
157
|
collectorId: string;
|
|
161
158
|
zone: string;
|
|
162
|
-
environment?: XeboEnvironment;
|
|
163
159
|
}
|
|
164
160
|
|
|
165
161
|
export interface XeboThemeConfig {
|