gap-nodejs-sdk 1.0.858 → 1.0.859

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.
Files changed (53) hide show
  1. package/dist/api/referral_api/1.0.0/api/index.d.ts +2 -0
  2. package/dist/api/referral_api/1.0.0/api/index.d.ts.map +1 -0
  3. package/dist/api/referral_api/1.0.0/api/index.js +1 -0
  4. package/dist/api/referral_api/1.0.0/api/referral.d.ts +16 -0
  5. package/dist/api/referral_api/1.0.0/api/referral.d.ts.map +1 -0
  6. package/dist/api/referral_api/1.0.0/api/referral.js +77 -0
  7. package/dist/api/referral_api/1.0.0/endpoints/index.d.ts +2 -0
  8. package/dist/api/referral_api/1.0.0/endpoints/index.d.ts.map +1 -0
  9. package/dist/api/referral_api/1.0.0/endpoints/index.js +1 -0
  10. package/dist/api/referral_api/1.0.0/endpoints/referral.d.ts +11 -0
  11. package/dist/api/referral_api/1.0.0/endpoints/referral.d.ts.map +1 -0
  12. package/dist/api/referral_api/1.0.0/endpoints/referral.js +9 -0
  13. package/dist/api/referral_api/1.0.0/interfaces/index.d.ts +1 -0
  14. package/dist/api/referral_api/1.0.0/interfaces/index.d.ts.map +1 -0
  15. package/dist/api/referral_api/1.0.0/interfaces/index.js +0 -0
  16. package/dist/api/referral_api/1.0.0/interfaces/referral.d.ts +12 -0
  17. package/dist/api/referral_api/1.0.0/interfaces/referral.d.ts.map +1 -0
  18. package/dist/api/referral_api/1.0.0/interfaces/referral.js +2 -0
  19. package/dist/api/referral_api/1.0.0/models/index.d.ts +2 -0
  20. package/dist/api/referral_api/1.0.0/models/index.d.ts.map +1 -0
  21. package/dist/api/referral_api/1.0.0/models/index.js +1 -0
  22. package/dist/api/referral_api/1.0.0/models/referral.d.ts +46 -0
  23. package/dist/api/referral_api/1.0.0/models/referral.d.ts.map +1 -0
  24. package/dist/api/referral_api/1.0.0/models/referral.js +80 -0
  25. package/dist/api/referral_api/1.0.0/types/request/index.d.ts +2 -0
  26. package/dist/api/referral_api/1.0.0/types/request/index.d.ts.map +1 -0
  27. package/dist/api/referral_api/1.0.0/types/request/index.js +1 -0
  28. package/dist/api/referral_api/1.0.0/types/request/referral.d.ts +34 -0
  29. package/dist/api/referral_api/1.0.0/types/request/referral.d.ts.map +1 -0
  30. package/dist/api/referral_api/1.0.0/types/request/referral.js +1 -0
  31. package/dist/api/referral_api/1.0.0/types/response/index.d.ts +2 -0
  32. package/dist/api/referral_api/1.0.0/types/response/index.d.ts.map +1 -0
  33. package/dist/api/referral_api/1.0.0/types/response/index.js +1 -0
  34. package/dist/api/referral_api/1.0.0/types/response/referral.d.ts +68 -0
  35. package/dist/api/referral_api/1.0.0/types/response/referral.d.ts.map +1 -0
  36. package/dist/api/referral_api/1.0.0/types/response/referral.js +1 -0
  37. package/dist/api/referral_api/api.d.ts +5 -0
  38. package/dist/api/referral_api/api.d.ts.map +1 -0
  39. package/dist/api/referral_api/api.js +12 -0
  40. package/dist/api/referral_api/enums/index.d.ts +11 -0
  41. package/dist/api/referral_api/enums/index.d.ts.map +1 -0
  42. package/dist/api/referral_api/enums/index.js +12 -0
  43. package/dist/api/referral_api/index.d.ts +6 -0
  44. package/dist/api/referral_api/index.d.ts.map +1 -0
  45. package/dist/api/referral_api/index.js +9 -0
  46. package/dist/gap-sdk.js +1 -1
  47. package/dist/index.d.ts +5 -0
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +5 -0
  50. package/dist/types/index.d.ts +3 -0
  51. package/dist/types/index.d.ts.map +1 -1
  52. package/dist/types/index.js +3 -0
  53. package/package.json +1 -1
@@ -0,0 +1,2 @@
1
+ export { default as Referral } from "./referral";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/referral_api/1.0.0/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,IAAI,QAAQ,EAAC,MAAM,YAAY,CAAC"}
@@ -0,0 +1 @@
1
+ export { default as Referral } from "./referral";
@@ -0,0 +1,16 @@
1
+ import ReferralAbstractClass from "../interfaces/referral";
2
+ import Base from "../../../../base/Base";
3
+ import { GapApiVersion } from "../../../../base_type";
4
+ import * as Request from "../types/request";
5
+ import * as Response from "../types/response";
6
+ export default class Referral extends Base implements ReferralAbstractClass {
7
+ static API_VERSION: GapApiVersion;
8
+ static approve(data: Request.ApproveReferralRequest): Promise<Response.ApproveReferralResponse>;
9
+ static reject(data: Request.RejectReferralRequest): Promise<Response.RejectReferralResponse>;
10
+ static getLog(data?: Request.GetReferralLogRequest): Promise<Response.GetReferralLogResponse>;
11
+ static getReport(data: Request.GetReferralReportRequest): Promise<Response.GetReferralReportResponse>;
12
+ static getConfig(): Promise<Response.GetReferralConfigResponse>;
13
+ static updateConfig(data: Request.UpdateReferralConfigRequest): Promise<Response.UpdateReferralConfigResponse>;
14
+ static createForm(data: Request.CreateReferralFormRequest): Promise<Response.CreateReferralFormResponse>;
15
+ }
16
+ //# sourceMappingURL=referral.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"referral.d.ts","sourceRoot":"","sources":["../../../../../src/api/referral_api/1.0.0/api/referral.ts"],"names":[],"mappings":"AACA,OAAO,qBAAqB,MAAM,wBAAwB,CAAC;AAC3D,OAAO,IAAI,MAAM,uBAAuB,CAAC;AACzC,OAAO,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAG9C,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,IAAK,YAAW,qBAAqB;IACvE,OAAc,WAAW,gBAAoB;WAEzB,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,sBAAsB,GAAG,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAC;WAUxF,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,qBAAqB,GAAG,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAC;WAUrF,MAAM,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,qBAAqB,GAAG,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAC;WAUtF,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,wBAAwB,GAAG,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAC;WAU9F,SAAS,IAAI,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAC;WASxD,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,2BAA2B,GAAG,OAAO,CAAC,QAAQ,CAAC,4BAA4B,CAAC;WAUvG,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,yBAAyB,GAAG,OAAO,CAAC,QAAQ,CAAC,0BAA0B,CAAC;CASxH"}
@@ -0,0 +1,77 @@
1
+ import { __awaiter } from "tslib";
2
+ import { referral } from "../endpoints";
3
+ import Base from "../../../../base/Base";
4
+ import { GapApiVersion } from "../../../../base_type";
5
+ import * as Model from "../models";
6
+ export default class Referral extends Base {
7
+ static approve(data) {
8
+ var _a;
9
+ return __awaiter(this, void 0, void 0, function* () {
10
+ const response = yield this.client.post({
11
+ path: referral.APPROVE,
12
+ data: data
13
+ });
14
+ return Model.ReferralModel((_a = response === null || response === void 0 ? void 0 : response.result) === null || _a === void 0 ? void 0 : _a.data);
15
+ });
16
+ }
17
+ static reject(data) {
18
+ var _a;
19
+ return __awaiter(this, void 0, void 0, function* () {
20
+ const response = yield this.client.post({
21
+ path: referral.REJECT,
22
+ data: data
23
+ });
24
+ return Model.ReferralModel((_a = response === null || response === void 0 ? void 0 : response.result) === null || _a === void 0 ? void 0 : _a.data);
25
+ });
26
+ }
27
+ static getLog(data) {
28
+ var _a;
29
+ return __awaiter(this, void 0, void 0, function* () {
30
+ const response = yield this.client.get({
31
+ path: referral.LOG,
32
+ query: data
33
+ });
34
+ return Model.ReferralLogModel((_a = response === null || response === void 0 ? void 0 : response.result) === null || _a === void 0 ? void 0 : _a.data);
35
+ });
36
+ }
37
+ static getReport(data) {
38
+ var _a;
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ const response = yield this.client.get({
41
+ path: referral.REPORT,
42
+ query: data
43
+ });
44
+ return Model.ReferralReportModel((_a = response === null || response === void 0 ? void 0 : response.result) === null || _a === void 0 ? void 0 : _a.data);
45
+ });
46
+ }
47
+ static getConfig() {
48
+ var _a;
49
+ return __awaiter(this, void 0, void 0, function* () {
50
+ const response = yield this.client.get({
51
+ path: referral.GET_CONFIG,
52
+ });
53
+ return Model.ReferralConfigModel((_a = response === null || response === void 0 ? void 0 : response.result) === null || _a === void 0 ? void 0 : _a.data);
54
+ });
55
+ }
56
+ static updateConfig(data) {
57
+ var _a;
58
+ return __awaiter(this, void 0, void 0, function* () {
59
+ const response = yield this.client.post({
60
+ path: referral.UPDATE_CONFIG,
61
+ data: data
62
+ });
63
+ return Model.ReferralConfigModel((_a = response === null || response === void 0 ? void 0 : response.result) === null || _a === void 0 ? void 0 : _a.data);
64
+ });
65
+ }
66
+ static createForm(data) {
67
+ var _a;
68
+ return __awaiter(this, void 0, void 0, function* () {
69
+ const response = yield this.client.post({
70
+ path: referral.CREATE_FORM,
71
+ data: data
72
+ });
73
+ return Model.ReferralModel((_a = response === null || response === void 0 ? void 0 : response.result) === null || _a === void 0 ? void 0 : _a.data);
74
+ });
75
+ }
76
+ }
77
+ Referral.API_VERSION = GapApiVersion.V1;
@@ -0,0 +1,2 @@
1
+ export { default as referral } from "./referral";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/referral_api/1.0.0/endpoints/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,IAAI,QAAQ,EAAC,MAAM,YAAY,CAAC"}
@@ -0,0 +1 @@
1
+ export { default as referral } from "./referral";
@@ -0,0 +1,11 @@
1
+ declare const _default: {
2
+ APPROVE: string;
3
+ REJECT: string;
4
+ LOG: string;
5
+ REPORT: string;
6
+ GET_CONFIG: string;
7
+ UPDATE_CONFIG: string;
8
+ CREATE_FORM: string;
9
+ };
10
+ export default _default;
11
+ //# sourceMappingURL=referral.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"referral.d.ts","sourceRoot":"","sources":["../../../../../src/api/referral_api/1.0.0/endpoints/referral.ts"],"names":[],"mappings":";;;;;;;;;AAAA,wBAQC"}
@@ -0,0 +1,9 @@
1
+ export default {
2
+ APPROVE: "/v1/referral/site/approve",
3
+ REJECT: "/v1/referral/site/reject",
4
+ LOG: "/v1/referral/site/log",
5
+ REPORT: "/v1/referral/site/report",
6
+ GET_CONFIG: "/v1/referral/config/get",
7
+ UPDATE_CONFIG: "/v1/referral/config/update",
8
+ CREATE_FORM: "/v1/referral/form/create",
9
+ };
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/referral_api/1.0.0/interfaces/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ import * as Request from "../types/request";
2
+ import * as Response from "../types/response";
3
+ export default abstract class Referral {
4
+ static approve: (data: Request.ApproveReferralRequest) => Promise<Response.ApproveReferralResponse>;
5
+ static reject: (data: Request.RejectReferralRequest) => Promise<Response.RejectReferralResponse>;
6
+ static getLog: (data?: Request.GetReferralLogRequest) => Promise<Response.GetReferralLogResponse>;
7
+ static getReport: (data: Request.GetReferralReportRequest) => Promise<Response.GetReferralReportResponse>;
8
+ static getConfig: () => Promise<Response.GetReferralConfigResponse>;
9
+ static updateConfig: (data: Request.UpdateReferralConfigRequest) => Promise<Response.UpdateReferralConfigResponse>;
10
+ static createForm: (data: Request.CreateReferralFormRequest) => Promise<Response.CreateReferralFormResponse>;
11
+ }
12
+ //# sourceMappingURL=referral.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"referral.d.ts","sourceRoot":"","sources":["../../../../../src/api/referral_api/1.0.0/interfaces/referral.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAE9C,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,QAAQ;IAClC,OAAc,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,sBAAsB,KAAK,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAAC;IAC3G,OAAc,MAAM,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,qBAAqB,KAAK,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAC,CAAC;IACxG,OAAc,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,qBAAqB,KAAK,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAC,CAAC;IACzG,OAAc,SAAS,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,wBAAwB,KAAK,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAC,CAAC;IACjH,OAAc,SAAS,EAAE,MAAM,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAC,CAAC;IAC3E,OAAc,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,2BAA2B,KAAK,OAAO,CAAC,QAAQ,CAAC,4BAA4B,CAAC,CAAC;IAC1H,OAAc,UAAU,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,yBAAyB,KAAK,OAAO,CAAC,QAAQ,CAAC,0BAA0B,CAAC,CAAC;CACvH"}
@@ -0,0 +1,2 @@
1
+ export default class Referral {
2
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./referral";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/referral_api/1.0.0/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA"}
@@ -0,0 +1 @@
1
+ export * from "./referral";
@@ -0,0 +1,46 @@
1
+ export declare function ReferralModel(data: any): {
2
+ id: any;
3
+ referrer_customer_id: any;
4
+ referrer_phone: any;
5
+ referee_customer_id: any;
6
+ referee_phone: any;
7
+ checkin_id: any;
8
+ kiosk_id: any;
9
+ status: any;
10
+ referrer_points: any;
11
+ referee_points: any;
12
+ referee_credited_at: any;
13
+ credit_due_at: any;
14
+ flag_reason: any;
15
+ sms_status: any;
16
+ created_at: any;
17
+ };
18
+ export declare function ReferralLogModel(data: any): {
19
+ items: any;
20
+ _meta: {
21
+ totalCount: any;
22
+ pageCount: any;
23
+ currentPage: any;
24
+ perPage: any;
25
+ };
26
+ };
27
+ export declare function ReferralConfigModel(data: any): {
28
+ enabled: any;
29
+ referrer_points: any;
30
+ referee_points_enabled: any;
31
+ referee_points: any;
32
+ credit_delay_hours: any;
33
+ monthly_limit: any;
34
+ daily_limit: any;
35
+ kiosk_hourly_limit: any;
36
+ sms_template: any;
37
+ };
38
+ export declare function ReferralReportModel(data: any): {
39
+ from: any;
40
+ to: any;
41
+ totalReferrals: any;
42
+ validReferrals: any;
43
+ totalPointsAwarded: any;
44
+ topReferrers: any;
45
+ };
46
+ //# sourceMappingURL=referral.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"referral.d.ts","sourceRoot":"","sources":["../../../../../src/api/referral_api/1.0.0/models/referral.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,IAAI,EAAE,GAAG;;;;;;;;;;;;;;;;EAkBtC;AAsBD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,GAAG;;;;;;;;EAKzC;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,GAAG;;;;;;;;;;EAY5C;AAWD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,GAAG;;;;;;;EAS5C"}
@@ -0,0 +1,80 @@
1
+ export function ReferralModel(data) {
2
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
3
+ return {
4
+ id: (_a = data === null || data === void 0 ? void 0 : data.id) !== null && _a !== void 0 ? _a : null,
5
+ referrer_customer_id: (_b = data === null || data === void 0 ? void 0 : data.referrer_customer_id) !== null && _b !== void 0 ? _b : null,
6
+ referrer_phone: (_c = data === null || data === void 0 ? void 0 : data.referrer_phone) !== null && _c !== void 0 ? _c : null,
7
+ referee_customer_id: (_d = data === null || data === void 0 ? void 0 : data.referee_customer_id) !== null && _d !== void 0 ? _d : null,
8
+ referee_phone: (_e = data === null || data === void 0 ? void 0 : data.referee_phone) !== null && _e !== void 0 ? _e : null,
9
+ checkin_id: (_f = data === null || data === void 0 ? void 0 : data.checkin_id) !== null && _f !== void 0 ? _f : null,
10
+ kiosk_id: (_g = data === null || data === void 0 ? void 0 : data.kiosk_id) !== null && _g !== void 0 ? _g : null,
11
+ status: (_h = data === null || data === void 0 ? void 0 : data.status) !== null && _h !== void 0 ? _h : null,
12
+ referrer_points: (_j = data === null || data === void 0 ? void 0 : data.referrer_points) !== null && _j !== void 0 ? _j : null,
13
+ referee_points: (_k = data === null || data === void 0 ? void 0 : data.referee_points) !== null && _k !== void 0 ? _k : null,
14
+ referee_credited_at: (_l = data === null || data === void 0 ? void 0 : data.referee_credited_at) !== null && _l !== void 0 ? _l : null,
15
+ credit_due_at: (_m = data === null || data === void 0 ? void 0 : data.credit_due_at) !== null && _m !== void 0 ? _m : null,
16
+ flag_reason: (_o = data === null || data === void 0 ? void 0 : data.flag_reason) !== null && _o !== void 0 ? _o : null,
17
+ sms_status: (_p = data === null || data === void 0 ? void 0 : data.sms_status) !== null && _p !== void 0 ? _p : null,
18
+ created_at: (_q = data === null || data === void 0 ? void 0 : data.created_at) !== null && _q !== void 0 ? _q : null,
19
+ };
20
+ }
21
+ function ReferralLogItemModel(data) {
22
+ var _a, _b, _c, _d, _e, _f;
23
+ return {
24
+ id: (_a = data === null || data === void 0 ? void 0 : data.id) !== null && _a !== void 0 ? _a : null,
25
+ referrer_phone: (_b = data === null || data === void 0 ? void 0 : data.referrer_phone) !== null && _b !== void 0 ? _b : null,
26
+ referee_phone: (_c = data === null || data === void 0 ? void 0 : data.referee_phone) !== null && _c !== void 0 ? _c : null,
27
+ status: (_d = data === null || data === void 0 ? void 0 : data.status) !== null && _d !== void 0 ? _d : null,
28
+ flag_reason: (_e = data === null || data === void 0 ? void 0 : data.flag_reason) !== null && _e !== void 0 ? _e : null,
29
+ created_at: (_f = data === null || data === void 0 ? void 0 : data.created_at) !== null && _f !== void 0 ? _f : null,
30
+ };
31
+ }
32
+ function PaginationMetaModel(data) {
33
+ var _a, _b, _c, _d;
34
+ return {
35
+ totalCount: (_a = data === null || data === void 0 ? void 0 : data.totalCount) !== null && _a !== void 0 ? _a : null,
36
+ pageCount: (_b = data === null || data === void 0 ? void 0 : data.pageCount) !== null && _b !== void 0 ? _b : null,
37
+ currentPage: (_c = data === null || data === void 0 ? void 0 : data.currentPage) !== null && _c !== void 0 ? _c : null,
38
+ perPage: (_d = data === null || data === void 0 ? void 0 : data.perPage) !== null && _d !== void 0 ? _d : null,
39
+ };
40
+ }
41
+ export function ReferralLogModel(data) {
42
+ return {
43
+ items: Array.isArray(data === null || data === void 0 ? void 0 : data.items) ? data.items.map(ReferralLogItemModel) : [],
44
+ _meta: PaginationMetaModel(data === null || data === void 0 ? void 0 : data._meta),
45
+ };
46
+ }
47
+ export function ReferralConfigModel(data) {
48
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
49
+ return {
50
+ enabled: (_a = data === null || data === void 0 ? void 0 : data.enabled) !== null && _a !== void 0 ? _a : null,
51
+ referrer_points: (_b = data === null || data === void 0 ? void 0 : data.referrer_points) !== null && _b !== void 0 ? _b : null,
52
+ referee_points_enabled: (_c = data === null || data === void 0 ? void 0 : data.referee_points_enabled) !== null && _c !== void 0 ? _c : null,
53
+ referee_points: (_d = data === null || data === void 0 ? void 0 : data.referee_points) !== null && _d !== void 0 ? _d : null,
54
+ credit_delay_hours: (_e = data === null || data === void 0 ? void 0 : data.credit_delay_hours) !== null && _e !== void 0 ? _e : null,
55
+ monthly_limit: (_f = data === null || data === void 0 ? void 0 : data.monthly_limit) !== null && _f !== void 0 ? _f : null,
56
+ daily_limit: (_g = data === null || data === void 0 ? void 0 : data.daily_limit) !== null && _g !== void 0 ? _g : null,
57
+ kiosk_hourly_limit: (_h = data === null || data === void 0 ? void 0 : data.kiosk_hourly_limit) !== null && _h !== void 0 ? _h : null,
58
+ sms_template: (_j = data === null || data === void 0 ? void 0 : data.sms_template) !== null && _j !== void 0 ? _j : null,
59
+ };
60
+ }
61
+ function TopReferrerModel(data) {
62
+ var _a, _b, _c, _d;
63
+ return {
64
+ referrer_customer_id: (_a = data === null || data === void 0 ? void 0 : data.referrer_customer_id) !== null && _a !== void 0 ? _a : null,
65
+ referrer_phone: (_b = data === null || data === void 0 ? void 0 : data.referrer_phone) !== null && _b !== void 0 ? _b : null,
66
+ referral_count: (_c = data === null || data === void 0 ? void 0 : data.referral_count) !== null && _c !== void 0 ? _c : null,
67
+ points_awarded: (_d = data === null || data === void 0 ? void 0 : data.points_awarded) !== null && _d !== void 0 ? _d : null,
68
+ };
69
+ }
70
+ export function ReferralReportModel(data) {
71
+ var _a, _b, _c, _d, _e;
72
+ return {
73
+ from: (_a = data === null || data === void 0 ? void 0 : data.from) !== null && _a !== void 0 ? _a : null,
74
+ to: (_b = data === null || data === void 0 ? void 0 : data.to) !== null && _b !== void 0 ? _b : null,
75
+ totalReferrals: (_c = data === null || data === void 0 ? void 0 : data.totalReferrals) !== null && _c !== void 0 ? _c : null,
76
+ validReferrals: (_d = data === null || data === void 0 ? void 0 : data.validReferrals) !== null && _d !== void 0 ? _d : null,
77
+ totalPointsAwarded: (_e = data === null || data === void 0 ? void 0 : data.totalPointsAwarded) !== null && _e !== void 0 ? _e : null,
78
+ topReferrers: Array.isArray(data === null || data === void 0 ? void 0 : data.topReferrers) ? data.topReferrers.map(TopReferrerModel) : [],
79
+ };
80
+ }
@@ -0,0 +1,2 @@
1
+ export * from './referral';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/api/referral_api/1.0.0/types/request/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './referral';
@@ -0,0 +1,34 @@
1
+ import { ReferralStatus } from "../../../enums";
2
+ export type ApproveReferralRequest = {
3
+ id: number;
4
+ };
5
+ export type RejectReferralRequest = {
6
+ id: number;
7
+ };
8
+ export type GetReferralLogRequest = {
9
+ status?: ReferralStatus;
10
+ from?: string;
11
+ to?: string;
12
+ pageSize?: number;
13
+ };
14
+ export type GetReferralReportRequest = {
15
+ from: string;
16
+ to: string;
17
+ };
18
+ export type UpdateReferralConfigRequest = {
19
+ enabled: number;
20
+ referrer_points: number;
21
+ referee_points_enabled: number;
22
+ referee_points: number;
23
+ credit_delay_hours: number;
24
+ monthly_limit: number;
25
+ daily_limit: number;
26
+ kiosk_hourly_limit: number;
27
+ sms_template: string;
28
+ };
29
+ export type CreateReferralFormRequest = {
30
+ referee_phone: string;
31
+ referrer_phone: string;
32
+ checkin_id: number;
33
+ };
34
+ //# sourceMappingURL=referral.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"referral.d.ts","sourceRoot":"","sources":["../../../../../../src/api/referral_api/1.0.0/types/request/referral.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAE9C,MAAM,MAAM,sBAAsB,GAAG;IACjC,EAAE,EAAE,MAAM,CAAC;CACd,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAChC,EAAE,EAAE,MAAM,CAAC;CACd,CAAA;AAGD,MAAM,MAAM,qBAAqB,GAAG;IAChC,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACd,CAAA;AAED,MAAM,MAAM,2BAA2B,GAAG;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;CACxB,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACpC,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;CACtB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './referral';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/api/referral_api/1.0.0/types/response/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './referral';
@@ -0,0 +1,68 @@
1
+ import { Nullable } from "../../../../../base_type";
2
+ import { ReferralStatus, ReferralSmsStatus } from "../../../enums";
3
+ export type Referral = Nullable<{
4
+ id: number;
5
+ referrer_customer_id: number;
6
+ referrer_phone: string;
7
+ referee_customer_id: number;
8
+ referee_phone: string;
9
+ checkin_id: number;
10
+ kiosk_id: number;
11
+ status: ReferralStatus;
12
+ referrer_points: number;
13
+ referee_points: number;
14
+ referee_credited_at: string;
15
+ credit_due_at: string;
16
+ flag_reason: string;
17
+ sms_status: ReferralSmsStatus;
18
+ created_at: string;
19
+ }>;
20
+ export type ApproveReferralResponse = Referral;
21
+ export type RejectReferralResponse = Referral;
22
+ export type CreateReferralFormResponse = Referral;
23
+ export type ReferralLogItem = Nullable<{
24
+ id: number;
25
+ referrer_phone: string;
26
+ referee_phone: string;
27
+ status: ReferralStatus;
28
+ flag_reason: string;
29
+ created_at: string;
30
+ }>;
31
+ export type PaginationMeta = Nullable<{
32
+ totalCount: number;
33
+ pageCount: number;
34
+ currentPage: number;
35
+ perPage: number;
36
+ }>;
37
+ export type GetReferralLogResponse = Nullable<{
38
+ items: ReferralLogItem[];
39
+ _meta: PaginationMeta;
40
+ }>;
41
+ export type ReferralConfig = Nullable<{
42
+ enabled: number;
43
+ referrer_points: number;
44
+ referee_points_enabled: number;
45
+ referee_points: number;
46
+ credit_delay_hours: number;
47
+ monthly_limit: number;
48
+ daily_limit: number;
49
+ kiosk_hourly_limit: number;
50
+ sms_template: string;
51
+ }>;
52
+ export type GetReferralConfigResponse = ReferralConfig;
53
+ export type UpdateReferralConfigResponse = ReferralConfig;
54
+ export type TopReferrer = Nullable<{
55
+ referrer_customer_id: string;
56
+ referrer_phone: string;
57
+ referral_count: string;
58
+ points_awarded: string;
59
+ }>;
60
+ export type GetReferralReportResponse = Nullable<{
61
+ from: string;
62
+ to: string;
63
+ totalReferrals: number;
64
+ validReferrals: number;
65
+ totalPointsAwarded: number;
66
+ topReferrers: TopReferrer[];
67
+ }>;
68
+ //# sourceMappingURL=referral.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"referral.d.ts","sourceRoot":"","sources":["../../../../../../src/api/referral_api/1.0.0/types/response/referral.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAC,cAAc,EAAE,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AAEjE,MAAM,MAAM,QAAQ,GAAG,QAAQ,CAAC;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,oBAAoB,EAAE,MAAM,CAAA;IAC5B,cAAc,EAAE,MAAM,CAAA;IACtB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,cAAc,CAAA;IACtB,eAAe,EAAE,MAAM,CAAA;IACvB,cAAc,EAAE,MAAM,CAAA;IACtB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,iBAAiB,CAAA;IAC7B,UAAU,EAAE,MAAM,CAAA;CACrB,CAAC,CAAA;AAEF,MAAM,MAAM,uBAAuB,GAAG,QAAQ,CAAC;AAE/C,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC;AAE9C,MAAM,MAAM,0BAA0B,GAAG,QAAQ,CAAC;AAElD,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;IACnC,EAAE,EAAE,MAAM,CAAA;IACV,cAAc,EAAE,MAAM,CAAA;IACtB,aAAa,EAAE,MAAM,CAAA;IACrB,MAAM,EAAE,cAAc,CAAA;IACtB,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;CACrB,CAAC,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;IAClC,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;CAClB,CAAC,CAAA;AAEF,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC;IAC1C,KAAK,EAAE,eAAe,EAAE,CAAA;IACxB,KAAK,EAAE,cAAc,CAAA;CACxB,CAAC,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;IAClC,OAAO,EAAE,MAAM,CAAA;IACf,eAAe,EAAE,MAAM,CAAA;IACvB,sBAAsB,EAAE,MAAM,CAAA;IAC9B,cAAc,EAAE,MAAM,CAAA;IACtB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,MAAM,CAAA;IACnB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,YAAY,EAAE,MAAM,CAAA;CACvB,CAAC,CAAA;AAEF,MAAM,MAAM,yBAAyB,GAAG,cAAc,CAAC;AAEvD,MAAM,MAAM,4BAA4B,GAAG,cAAc,CAAC;AAE1D,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC;IAC/B,oBAAoB,EAAE,MAAM,CAAA;IAC5B,cAAc,EAAE,MAAM,CAAA;IACtB,cAAc,EAAE,MAAM,CAAA;IACtB,cAAc,EAAE,MAAM,CAAA;CACzB,CAAC,CAAA;AAEF,MAAM,MAAM,yBAAyB,GAAG,QAAQ,CAAC;IAC7C,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,cAAc,EAAE,MAAM,CAAA;IACtB,cAAc,EAAE,MAAM,CAAA;IACtB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,YAAY,EAAE,WAAW,EAAE,CAAA;CAC9B,CAAC,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { GapApiVersion } from "../../base_type";
2
+ import * as V1 from "./1.0.0/api";
3
+ declare const getApi: (version: GapApiVersion) => typeof V1;
4
+ export default getApi;
5
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/api/referral_api/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAMlC,QAAA,MAAM,MAAM,YAAa,aAAa,cAKrC,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { GapApiVersion } from "../../base_type";
2
+ import * as V1 from "./1.0.0/api";
3
+ const apiList = {
4
+ [GapApiVersion.V1]: V1,
5
+ };
6
+ const getApi = (version) => {
7
+ if (!apiList[version]) {
8
+ throw new Error(`Can't not find API of this version!`);
9
+ }
10
+ return apiList[version];
11
+ };
12
+ export default getApi;
@@ -0,0 +1,11 @@
1
+ export declare enum ReferralStatus {
2
+ PENDING = 1,
3
+ CONFIRMED = 2,
4
+ FLAGGED = 3,
5
+ CANCELLED = 4
6
+ }
7
+ export declare enum ReferralSmsStatus {
8
+ NOT_SENT = 0,
9
+ SENT = 1
10
+ }
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/referral_api/enums/index.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc;IACtB,OAAO,IAAI;IACX,SAAS,IAAI;IACb,OAAO,IAAI;IACX,SAAS,IAAI;CAChB;AAED,oBAAY,iBAAiB;IACzB,QAAQ,IAAI;IACZ,IAAI,IAAI;CACX"}
@@ -0,0 +1,12 @@
1
+ export var ReferralStatus;
2
+ (function (ReferralStatus) {
3
+ ReferralStatus[ReferralStatus["PENDING"] = 1] = "PENDING";
4
+ ReferralStatus[ReferralStatus["CONFIRMED"] = 2] = "CONFIRMED";
5
+ ReferralStatus[ReferralStatus["FLAGGED"] = 3] = "FLAGGED";
6
+ ReferralStatus[ReferralStatus["CANCELLED"] = 4] = "CANCELLED";
7
+ })(ReferralStatus || (ReferralStatus = {}));
8
+ export var ReferralSmsStatus;
9
+ (function (ReferralSmsStatus) {
10
+ ReferralSmsStatus[ReferralSmsStatus["NOT_SENT"] = 0] = "NOT_SENT";
11
+ ReferralSmsStatus[ReferralSmsStatus["SENT"] = 1] = "SENT";
12
+ })(ReferralSmsStatus || (ReferralSmsStatus = {}));
@@ -0,0 +1,6 @@
1
+ import { GapApiVersion } from "../../base_type";
2
+ export default class ReferralApi {
3
+ referral: any;
4
+ constructor(domain: string, gClientId: string, token: string, version: GapApiVersion);
5
+ }
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/referral_api/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAG9C,MAAM,CAAC,OAAO,OAAO,WAAW;IAC5B,QAAQ,MAAC;gBAEG,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa;CAKvF"}
@@ -0,0 +1,9 @@
1
+ import Base from "../../base/Base";
2
+ import getApi from "./api";
3
+ export default class ReferralApi {
4
+ constructor(domain, gClientId, token, version) {
5
+ Base.setClient(domain, gClientId, token, version);
6
+ const API = getApi(version);
7
+ this.referral = API.Referral;
8
+ }
9
+ }