ggez-banking-sdk 0.0.72 → 0.0.73
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { LoginWithGoogleInterface, SignUpInterface, SignUpWithGoogleInterface, LoginRequestInterface, LoginDeviceCredentialInterface } from "../interfaces/signInterface";
|
|
2
2
|
import { IGeoCoordinates, UserInfo } from "../interfaces/interface";
|
|
3
3
|
import { LimitedTokenInterface } from "../interfaces/signInterface";
|
|
4
|
+
import { GiftData } from "../interfaces";
|
|
4
5
|
export declare const useAuth: (baseUrl: string, nodeUrl: string, userInfo: UserInfo, tokenData: LimitedTokenInterface, programId: string, geoCoordinates?: IGeoCoordinates | null, lang?: string) => {
|
|
5
6
|
GetUser: (installationId: string, token?: string, userId?: string) => Promise<{
|
|
6
7
|
response: import("axios").AxiosResponse<any, any>;
|
|
@@ -68,4 +69,16 @@ export declare const useAuth: (baseUrl: string, nodeUrl: string, userInfo: UserI
|
|
|
68
69
|
message: any;
|
|
69
70
|
status: string;
|
|
70
71
|
}>;
|
|
72
|
+
incrementPromotionParticipants: (giftData: GiftData) => Promise<{
|
|
73
|
+
response: any;
|
|
74
|
+
newUser: any;
|
|
75
|
+
message: any;
|
|
76
|
+
status: string;
|
|
77
|
+
}>;
|
|
78
|
+
getPromotionDataByCode: (promotionCode: string) => Promise<{
|
|
79
|
+
response: any;
|
|
80
|
+
newUser: any;
|
|
81
|
+
message: any;
|
|
82
|
+
status: string;
|
|
83
|
+
}>;
|
|
71
84
|
};
|
|
@@ -229,6 +229,59 @@ const useAuth = (baseUrl, nodeUrl, userInfo, tokenData, programId, geoCoordinate
|
|
|
229
229
|
};
|
|
230
230
|
}
|
|
231
231
|
};
|
|
232
|
+
const getPromotionDataByCode = async (promotionCode) => {
|
|
233
|
+
try {
|
|
234
|
+
let headersData = {
|
|
235
|
+
isUrlEncoded: false,
|
|
236
|
+
token: "",
|
|
237
|
+
header: false,
|
|
238
|
+
};
|
|
239
|
+
let headers = headerConfig(headersData);
|
|
240
|
+
const response = await restApi_1.default.restApi(nodeUrl, "get", "/api/promotion/" + promotionCode, headers);
|
|
241
|
+
return {
|
|
242
|
+
response: response,
|
|
243
|
+
newUser: null,
|
|
244
|
+
message: response?.data?.result?.friendly_message,
|
|
245
|
+
status: "success",
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
catch (error) {
|
|
249
|
+
return {
|
|
250
|
+
response: error.response,
|
|
251
|
+
newUser: null,
|
|
252
|
+
message: error.message,
|
|
253
|
+
status: "failed",
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
const incrementPromotionParticipants = async (giftData) => {
|
|
258
|
+
try {
|
|
259
|
+
const data = {
|
|
260
|
+
giftData: giftData,
|
|
261
|
+
};
|
|
262
|
+
let headersData = {
|
|
263
|
+
isUrlEncoded: false,
|
|
264
|
+
token: "",
|
|
265
|
+
header: false,
|
|
266
|
+
};
|
|
267
|
+
let headers = headerConfig(headersData);
|
|
268
|
+
const response = await restApi_1.default.restApi(nodeUrl, "put", "/api/promotion", headers, data);
|
|
269
|
+
return {
|
|
270
|
+
response: response,
|
|
271
|
+
newUser: null,
|
|
272
|
+
message: response?.data?.result?.friendly_message,
|
|
273
|
+
status: "success",
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
catch (error) {
|
|
277
|
+
return {
|
|
278
|
+
response: error.response,
|
|
279
|
+
newUser: null,
|
|
280
|
+
message: error.message,
|
|
281
|
+
status: "failed",
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
};
|
|
232
285
|
return {
|
|
233
286
|
GetUser,
|
|
234
287
|
SignUpApi,
|
|
@@ -236,6 +289,8 @@ const useAuth = (baseUrl, nodeUrl, userInfo, tokenData, programId, geoCoordinate
|
|
|
236
289
|
LoginDeviceCredential,
|
|
237
290
|
SignUpWithGoogle,
|
|
238
291
|
LoginWithGoogle,
|
|
292
|
+
incrementPromotionParticipants,
|
|
293
|
+
getPromotionDataByCode,
|
|
239
294
|
};
|
|
240
295
|
};
|
|
241
296
|
exports.useAuth = useAuth;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ggez-banking-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.73",
|
|
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",
|