ggez-banking-sdk 0.0.97 → 0.0.99
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.
|
@@ -68,15 +68,15 @@ const Data = () => {
|
|
|
68
68
|
};
|
|
69
69
|
const dataSignUpApi = (values) => {
|
|
70
70
|
const client = new clientjs_1.ClientJS();
|
|
71
|
-
let customField = {
|
|
71
|
+
let customField = { promotion_data: {} };
|
|
72
72
|
if (values.referralCode && values.referralCodeType) {
|
|
73
|
-
customField.
|
|
73
|
+
customField.promotion_data["referral_data"] = {
|
|
74
74
|
code: values.referralCode,
|
|
75
75
|
type: +values.referralCodeType,
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
78
|
if (values.giftData) {
|
|
79
|
-
customField.
|
|
79
|
+
customField.promotion_data["gift_data"] = [values.giftData];
|
|
80
80
|
}
|
|
81
81
|
let data = {
|
|
82
82
|
...data_1.userData,
|
|
@@ -171,15 +171,21 @@ const Data = () => {
|
|
|
171
171
|
};
|
|
172
172
|
const dataSignUpWithGoogle = (values) => {
|
|
173
173
|
const client = new clientjs_1.ClientJS();
|
|
174
|
-
let customField =
|
|
174
|
+
let customField = null;
|
|
175
175
|
if (values.referralCode && values.referralCodeType) {
|
|
176
|
-
customField
|
|
176
|
+
if (!customField) {
|
|
177
|
+
customField = { promotion_data: {} };
|
|
178
|
+
}
|
|
179
|
+
customField.promotion_data.referral_data = {
|
|
177
180
|
code: values.referralCode,
|
|
178
181
|
type: +values.referralCodeType,
|
|
179
182
|
};
|
|
180
183
|
}
|
|
181
184
|
if (values.giftData) {
|
|
182
|
-
customField
|
|
185
|
+
if (!customField) {
|
|
186
|
+
customField = { promotion_data: {} };
|
|
187
|
+
}
|
|
188
|
+
customField.promotion_data.gift_data = [values.giftData];
|
|
183
189
|
}
|
|
184
190
|
let data = {
|
|
185
191
|
...data_1.userData,
|
|
@@ -267,7 +267,7 @@ const Helper = (userInfo) => {
|
|
|
267
267
|
};
|
|
268
268
|
// header config
|
|
269
269
|
const headerConfig = (headersData) => {
|
|
270
|
-
const { header, isUrlEncoded, token, lang, installationId } = headersData;
|
|
270
|
+
const { header, isUrlEncoded, token, lang, installationId, disableCache } = headersData;
|
|
271
271
|
let headers;
|
|
272
272
|
if (!header)
|
|
273
273
|
return undefined;
|
|
@@ -291,6 +291,14 @@ const Helper = (userInfo) => {
|
|
|
291
291
|
generate_jwt: true,
|
|
292
292
|
};
|
|
293
293
|
}
|
|
294
|
+
if (disableCache) {
|
|
295
|
+
headers = {
|
|
296
|
+
...headers,
|
|
297
|
+
"Cache-Control": "no-cache",
|
|
298
|
+
Pragma: "no-cache",
|
|
299
|
+
Expires: "0",
|
|
300
|
+
};
|
|
301
|
+
}
|
|
294
302
|
return headers;
|
|
295
303
|
};
|
|
296
304
|
// check response
|
|
@@ -95,9 +95,9 @@ export interface LimitedTokenInterface {
|
|
|
95
95
|
geoCoordinates?: IGeoCoordinates | null;
|
|
96
96
|
}
|
|
97
97
|
export interface CustomField {
|
|
98
|
-
|
|
98
|
+
promotion_data: PromotionData;
|
|
99
99
|
}
|
|
100
|
-
export interface
|
|
100
|
+
export interface PromotionData {
|
|
101
101
|
referral_data?: ReferralData;
|
|
102
102
|
gift_data?: Gift[];
|
|
103
103
|
}
|
|
@@ -235,6 +235,7 @@ const useAuth = (baseUrl, nodeUrl, userInfo, tokenData, programId, geoCoordinate
|
|
|
235
235
|
isUrlEncoded: false,
|
|
236
236
|
token: "",
|
|
237
237
|
header: false,
|
|
238
|
+
disableCache: true,
|
|
238
239
|
};
|
|
239
240
|
let headers = headerConfig(headersData);
|
|
240
241
|
const response = await restApi_1.default.restApi(nodeUrl, "get", "api/promotion/" + promotionCode, headers);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ggez-banking-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.99",
|
|
4
4
|
"description": "A Node.js package to handle GGEZ Banking API endpoints, Simplify the process of managing CRUD operations with this efficient and easy-to-use package.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|