@bytexbyte/ike-app-api 1.0.51 → 1.0.53

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/lib/App.d.ts CHANGED
@@ -8,6 +8,9 @@ declare type GetMaintenanceVersionResult = {
8
8
  declare type GetCheckNetwork = {
9
9
  message: string;
10
10
  };
11
+ declare type GetConfig = {
12
+ isRewardEnabled: boolean;
13
+ };
11
14
  declare class IKEAppApi extends BxBApi {
12
15
  constructor({ host, onSuccess, onError }: {
13
16
  host: string;
@@ -19,5 +22,8 @@ declare class IKEAppApi extends BxBApi {
19
22
  getCheckNetwork(init?: {
20
23
  signal?: AbortSignal;
21
24
  }): Promise<GetCheckNetwork>;
25
+ getConfig(init?: {
26
+ signal?: AbortSignal;
27
+ }): Promise<GetConfig>;
22
28
  }
23
29
  export default IKEAppApi;
package/lib/App.js CHANGED
@@ -122,6 +122,19 @@ var IKEAppApi = /** @class */ (function (_super) {
122
122
  });
123
123
  });
124
124
  };
125
+ IKEAppApi.prototype.getConfig = function (init) {
126
+ return __awaiter(this, void 0, void 0, function () {
127
+ var response;
128
+ return __generator(this, function (_a) {
129
+ switch (_a.label) {
130
+ case 0: return [4 /*yield*/, this.bxbFetch(__assign({ method: 'GET', headers: { 'Content-Type': 'application/json' } }, init), 'get-config')];
131
+ case 1:
132
+ response = _a.sent();
133
+ return [2 /*return*/, response.json()];
134
+ }
135
+ });
136
+ });
137
+ };
125
138
  return IKEAppApi;
126
139
  }(bxb_api_1.default));
127
140
  exports.default = IKEAppApi;
@@ -1,30 +1,6 @@
1
1
  import BxBApi from '@bytexbyte/bxb-api';
2
- import { InAppNotificationType } from './type';
3
- declare type CreateInAppNotificationResult = {
4
- success: 'ok';
5
- } | {
6
- error: 'You are not authorized to call this API.' | 'Type is required.' | 'UserId is required.' | 'PushNotificationId is required.';
7
- };
8
- declare type PutInAppNotificationsResult = {
9
- success: 'ok';
10
- error?: undefined;
11
- } | {
12
- success?: undefined;
13
- error: 'You are not authorized to call this API.';
14
- };
15
- declare type DeleteInAppNotificationsResult = PutInAppNotificationsResult;
16
- declare type PutInAppNotificationResult = PutInAppNotificationsResult | {
17
- error: 'Id is required.';
18
- };
19
- declare type DeleteInAppNotificationResult = PutInAppNotificationResult;
20
- declare type CheckReadedInAppNotificationsResult = {
21
- isAllRead: boolean;
22
- error?: undefined;
23
- } | {
24
- isAllRead?: undefined;
25
- error: 'You are not authorized to call this API.';
26
- };
27
- declare class IKEApInAppNotificationApi extends BxBApi {
2
+ import { CheckReadedInAppNotificationsResult, CreateInAppNotificationResult, DeleteInAppNotificationResult, DeleteInAppNotificationsResult, InAppNotificationType, PutInAppNotificationResult, PutInAppNotificationsResult } from './type';
3
+ declare class IKEAppInAppNotificationApi extends BxBApi {
28
4
  constructor({ host, secretKey, secret, onSuccess, onError, }: {
29
5
  host: string;
30
6
  secretKey?: string;
@@ -45,4 +21,4 @@ declare class IKEApInAppNotificationApi extends BxBApi {
45
21
  deleteInAppNotifications(): Promise<DeleteInAppNotificationsResult>;
46
22
  checkReadedInAppNotifications(): Promise<CheckReadedInAppNotificationsResult>;
47
23
  }
48
- export default IKEApInAppNotificationApi;
24
+ export default IKEAppInAppNotificationApi;
@@ -52,20 +52,21 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
52
52
  };
53
53
  Object.defineProperty(exports, "__esModule", { value: true });
54
54
  var bxb_api_1 = require("@bytexbyte/bxb-api");
55
- var IKEApInAppNotificationApi = /** @class */ (function (_super) {
56
- __extends(IKEApInAppNotificationApi, _super);
57
- function IKEApInAppNotificationApi(_a) {
55
+ var config_1 = require("../config");
56
+ var IKEAppInAppNotificationApi = /** @class */ (function (_super) {
57
+ __extends(IKEAppInAppNotificationApi, _super);
58
+ function IKEAppInAppNotificationApi(_a) {
58
59
  var host = _a.host, secretKey = _a.secretKey, secret = _a.secret, onSuccess = _a.onSuccess, onError = _a.onError;
59
60
  return _super.call(this, {
60
61
  host: host,
61
- secretKey: secretKey !== null && secretKey !== void 0 ? secretKey : '',
62
- secret: secret !== null && secret !== void 0 ? secret : '',
62
+ secretKey: config_1.localSecretKey,
63
+ secret: '',
63
64
  moduleName: 'in-app-notification',
64
65
  onSuccess: onSuccess,
65
66
  onError: onError,
66
67
  }) || this;
67
68
  }
68
- IKEApInAppNotificationApi.prototype.createInAppNotification = function (body) {
69
+ IKEAppInAppNotificationApi.prototype.createInAppNotification = function (body) {
69
70
  return __awaiter(this, void 0, void 0, function () {
70
71
  var response;
71
72
  return __generator(this, function (_a) {
@@ -84,7 +85,7 @@ var IKEApInAppNotificationApi = /** @class */ (function (_super) {
84
85
  });
85
86
  });
86
87
  };
87
- IKEApInAppNotificationApi.prototype.putInAppNotification = function (notificationId) {
88
+ IKEAppInAppNotificationApi.prototype.putInAppNotification = function (notificationId) {
88
89
  return __awaiter(this, void 0, void 0, function () {
89
90
  var response;
90
91
  return __generator(this, function (_a) {
@@ -102,7 +103,7 @@ var IKEApInAppNotificationApi = /** @class */ (function (_super) {
102
103
  });
103
104
  });
104
105
  };
105
- IKEApInAppNotificationApi.prototype.deleteInAppNotification = function (notificationId) {
106
+ IKEAppInAppNotificationApi.prototype.deleteInAppNotification = function (notificationId) {
106
107
  return __awaiter(this, void 0, void 0, function () {
107
108
  var response;
108
109
  return __generator(this, function (_a) {
@@ -120,7 +121,7 @@ var IKEApInAppNotificationApi = /** @class */ (function (_super) {
120
121
  });
121
122
  });
122
123
  };
123
- IKEApInAppNotificationApi.prototype.putInAppNotifications = function () {
124
+ IKEAppInAppNotificationApi.prototype.putInAppNotifications = function () {
124
125
  return __awaiter(this, void 0, void 0, function () {
125
126
  var response;
126
127
  return __generator(this, function (_a) {
@@ -138,7 +139,7 @@ var IKEApInAppNotificationApi = /** @class */ (function (_super) {
138
139
  });
139
140
  });
140
141
  };
141
- IKEApInAppNotificationApi.prototype.deleteInAppNotifications = function () {
142
+ IKEAppInAppNotificationApi.prototype.deleteInAppNotifications = function () {
142
143
  return __awaiter(this, void 0, void 0, function () {
143
144
  var response;
144
145
  return __generator(this, function (_a) {
@@ -156,7 +157,7 @@ var IKEApInAppNotificationApi = /** @class */ (function (_super) {
156
157
  });
157
158
  });
158
159
  };
159
- IKEApInAppNotificationApi.prototype.checkReadedInAppNotifications = function () {
160
+ IKEAppInAppNotificationApi.prototype.checkReadedInAppNotifications = function () {
160
161
  return __awaiter(this, void 0, void 0, function () {
161
162
  var response;
162
163
  return __generator(this, function (_a) {
@@ -174,6 +175,6 @@ var IKEApInAppNotificationApi = /** @class */ (function (_super) {
174
175
  });
175
176
  });
176
177
  };
177
- return IKEApInAppNotificationApi;
178
+ return IKEAppInAppNotificationApi;
178
179
  }(bxb_api_1.default));
179
- exports.default = IKEApInAppNotificationApi;
180
+ exports.default = IKEAppInAppNotificationApi;
@@ -1 +1,25 @@
1
+ export declare type CreateInAppNotificationResult = {
2
+ success: 'ok';
3
+ } | {
4
+ error: 'You are not authorized to call this API.' | 'Type is required.' | 'UserId is required.' | 'PushNotificationId is required.';
5
+ };
6
+ export declare type PutInAppNotificationsResult = {
7
+ success: 'ok';
8
+ error?: undefined;
9
+ } | {
10
+ success?: undefined;
11
+ error: 'You are not authorized to call this API.';
12
+ };
13
+ export declare type DeleteInAppNotificationsResult = PutInAppNotificationsResult;
14
+ export declare type PutInAppNotificationResult = PutInAppNotificationsResult | {
15
+ error: 'Id is required.';
16
+ };
17
+ export declare type DeleteInAppNotificationResult = PutInAppNotificationResult;
18
+ export declare type CheckReadedInAppNotificationsResult = {
19
+ isAllRead: boolean;
20
+ error?: undefined;
21
+ } | {
22
+ isAllRead?: undefined;
23
+ error: 'You are not authorized to call this API.';
24
+ };
1
25
  export declare type InAppNotificationType = 'pushNotification';
package/lib/index.d.ts CHANGED
@@ -5,7 +5,7 @@ import IKEAppBleConnectionErrorLogApi from './BleConnectionErrorLog';
5
5
  import IKEAppContractApi from './Contract';
6
6
  import IKEAppDigitalCustomizationApi from './DigitalCustomization';
7
7
  import IKEAppFileApi from './File';
8
- import IKEApInAppNotificationApi from './InAppNotification';
8
+ import IKEAppInAppNotificationApi from './InAppNotification';
9
9
  import IKEAppIncodeApi from './Incode';
10
10
  import IKEAppMfaApi from './Mfa';
11
11
  import IKEAppProductApi from './Product';
@@ -30,7 +30,7 @@ declare class IKEAppApi {
30
30
  tags: IKEAppTagsApi;
31
31
  digitalCustomization: IKEAppDigitalCustomizationApi;
32
32
  contract: IKEAppContractApi;
33
- inAppNotification: IKEApInAppNotificationApi;
33
+ inAppNotification: IKEAppInAppNotificationApi;
34
34
  incode: IKEAppIncodeApi;
35
35
  rsa: IKEAppRsaApi;
36
36
  bleConnectionErrorLog: IKEAppBleConnectionErrorLogApi;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytexbyte/ike-app-api",
3
- "version": "1.0.51",
3
+ "version": "1.0.53",
4
4
  "description": "app api",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -76,4 +76,4 @@
76
76
  "tsutils": "^2.29.0",
77
77
  "wrappy": "^1.0.2"
78
78
  }
79
- }
79
+ }