react-native-my-survey-sdk 2.2.28 → 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,7 +5,6 @@ import {
|
|
|
5
5
|
XeboChoice,
|
|
6
6
|
XeboConditionalFollowUp,
|
|
7
7
|
XeboAnswer,
|
|
8
|
-
XeboEnvironment,
|
|
9
8
|
XeboUserData,
|
|
10
9
|
XeboQualityFlags,
|
|
11
10
|
XeboGeolocation,
|
|
@@ -19,36 +18,19 @@ import {
|
|
|
19
18
|
|
|
20
19
|
// ─── URL helpers ──────────────────────────────────────────────────────────────
|
|
21
20
|
|
|
22
|
-
export function
|
|
23
|
-
|
|
24
|
-
return { resolvedZone: zone.slice(4), environment: 'uat' };
|
|
25
|
-
}
|
|
26
|
-
if (zone === 'preprod' || zone.startsWith('preprod-')) {
|
|
27
|
-
const resolvedZone = zone.startsWith('preprod-') ? zone.slice(8) : 'preprod';
|
|
28
|
-
return { resolvedZone, environment: 'preprod' };
|
|
29
|
-
}
|
|
30
|
-
return { resolvedZone: zone, environment: explicitEnv ?? 'production' };
|
|
21
|
+
export function resolveZone(zone: string): string {
|
|
22
|
+
return zone;
|
|
31
23
|
}
|
|
32
24
|
|
|
33
|
-
export function buildBaseURL(resolvedZone: string
|
|
34
|
-
if (environment === 'uat') return `https://uat-${resolvedZone}-api.xebo.ai`;
|
|
35
|
-
if (environment === 'preprod') return resolvedZone === 'preprod'
|
|
36
|
-
? 'https://preprod-api.xebo.ai'
|
|
37
|
-
: `https://preprod-${resolvedZone}-api.xebo.ai`;
|
|
25
|
+
export function buildBaseURL(resolvedZone: string): string {
|
|
38
26
|
return `https://${resolvedZone}-api.xebo.ai`;
|
|
39
27
|
}
|
|
40
28
|
|
|
41
|
-
export function buildFeedbackBaseURL(resolvedZone: string
|
|
42
|
-
if (environment === 'uat') return `https://uat-${resolvedZone}-feedback-api.xebo.ai`;
|
|
43
|
-
if (environment === 'preprod') return resolvedZone === 'preprod'
|
|
44
|
-
? 'https://preprod-feedback-api.xebo.ai'
|
|
45
|
-
: `https://preprod-${resolvedZone}-feedback-api.xebo.ai`;
|
|
29
|
+
export function buildFeedbackBaseURL(resolvedZone: string): string {
|
|
46
30
|
return `https://${resolvedZone}-feedback-api.xebo.ai`;
|
|
47
31
|
}
|
|
48
32
|
|
|
49
|
-
export function buildVerifyURL(
|
|
50
|
-
if (environment === 'uat') return 'https://uat-api.xebo.ai/api/v1/api-key/verify';
|
|
51
|
-
if (environment === 'preprod') return 'https://preprod-api.xebo.ai/api/v1/api-key/verify';
|
|
33
|
+
export function buildVerifyURL(): string {
|
|
52
34
|
return 'https://api.xebo.ai/api/v1/api-key/verify';
|
|
53
35
|
}
|
|
54
36
|
|
|
@@ -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
|
-
|
|
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()})`;
|
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' | 'preprod';
|
|
4
|
-
|
|
5
3
|
export enum XeboQuestionType {
|
|
6
4
|
singleChoice = 'singleChoice',
|
|
7
5
|
multipleChoice = 'multipleChoice',
|
|
@@ -158,7 +156,6 @@ export interface XeboConfig {
|
|
|
158
156
|
apiKey: string;
|
|
159
157
|
collectorId: string;
|
|
160
158
|
zone: string;
|
|
161
|
-
environment?: XeboEnvironment;
|
|
162
159
|
}
|
|
163
160
|
|
|
164
161
|
export interface XeboThemeConfig {
|