@bytexbyte/ike-app-api 1.0.40 → 1.0.42

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.
@@ -8,8 +8,8 @@ declare class IKEAppProductApi extends BxBApi {
8
8
  });
9
9
  getProductByMacAddress(form: {
10
10
  macAddress: string;
11
- longitude: number;
12
- latitude: number;
11
+ longitude: number | null;
12
+ latitude: number | null;
13
13
  }): Promise<Product | {
14
14
  error: 'Token is not exist.' | 'Digital customization is not exist.';
15
15
  }>;
@@ -1,5 +1,5 @@
1
1
  import BxBApi from '@bytexbyte/bxb-api';
2
- import { User, Wallet } from '../types';
2
+ import { User, UserLog, UserLogType, Wallet } from '../types';
3
3
  declare type GetResult = {
4
4
  user: {
5
5
  email: string | null;
@@ -177,5 +177,12 @@ declare class IKEAppUserApi extends BxBApi {
177
177
  } | {
178
178
  error: 'You are not logged in.' | 'Incorrect userId.' | 'Incorrect tokenId.' | 'You cannot check to this user.' | 'Field(s) cannot be empty.' | 'User not found.' | 'User has not been verified.';
179
179
  }>;
180
+ createLog(userId: string, body: {
181
+ tagTokenId: string;
182
+ type: UserLogType;
183
+ message: string;
184
+ }): Promise<UserLog | {
185
+ error: 'You are not logged in.' | 'Incorrect userId.' | 'Incorrect tagTokenId.' | 'Incorrect type.' | 'Incorrect message.' | 'You cannot create log to this user.' | 'Field(s) cannot be empty.' | 'User not found.' | 'User has not been verified.';
186
+ }>;
180
187
  }
181
188
  export default IKEAppUserApi;
package/lib/User/index.js CHANGED
@@ -572,6 +572,25 @@ var IKEAppUserApi = /** @class */ (function (_super) {
572
572
  });
573
573
  });
574
574
  };
575
+ IKEAppUserApi.prototype.createLog = function (userId, body) {
576
+ return __awaiter(this, void 0, void 0, function () {
577
+ var response;
578
+ return __generator(this, function (_a) {
579
+ switch (_a.label) {
580
+ case 0: return [4 /*yield*/, this.bxbFetch({
581
+ method: 'POST',
582
+ headers: {
583
+ 'Content-Type': 'application/json',
584
+ },
585
+ body: JSON.stringify(body),
586
+ }, "".concat(userId, "/log"))];
587
+ case 1:
588
+ response = _a.sent();
589
+ return [2 /*return*/, response.json()];
590
+ }
591
+ });
592
+ });
593
+ };
575
594
  return IKEAppUserApi;
576
595
  }(bxb_api_1.default));
577
596
  exports.default = IKEAppUserApi;
package/lib/types.d.ts CHANGED
@@ -596,3 +596,19 @@ export declare const LogType: {
596
596
  pendingPointLog: string;
597
597
  };
598
598
  export declare type LogType = typeof LogType[keyof typeof LogType];
599
+ export declare type UserLog = {
600
+ id: number;
601
+ userId: string;
602
+ tagTokenId: string;
603
+ type: UserLogType;
604
+ message: string;
605
+ createdAt: Date;
606
+ };
607
+ export declare const UserLogType: {
608
+ signature: string;
609
+ decryptToken: string;
610
+ origin: string;
611
+ connection: string;
612
+ unknow: string;
613
+ };
614
+ export declare type UserLogType = typeof UserLogType[keyof typeof UserLogType];
package/lib/types.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LogType = exports.ContractStatusType = exports.ContractType = exports.MinimumPurchaseRequirementsType = exports.RewardType = exports.RuleType = exports.osType = exports.FromType = exports.NftStatusType = exports.AgeVerificationType = exports.BlockChainStatusType = void 0;
3
+ exports.UserLogType = exports.LogType = exports.ContractStatusType = exports.ContractType = exports.MinimumPurchaseRequirementsType = exports.RewardType = exports.RuleType = exports.osType = exports.FromType = exports.NftStatusType = exports.AgeVerificationType = exports.BlockChainStatusType = void 0;
4
4
  /**
5
5
  * Enums
6
6
  */
@@ -62,3 +62,10 @@ exports.LogType = {
62
62
  rewardLog: 'rewardLog',
63
63
  pendingPointLog: 'pendingPointLog',
64
64
  };
65
+ exports.UserLogType = {
66
+ signature: 'signature',
67
+ decryptToken: 'decryptToken',
68
+ origin: 'origin',
69
+ connection: 'connection',
70
+ unknow: 'unknow',
71
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytexbyte/ike-app-api",
3
- "version": "1.0.40",
3
+ "version": "1.0.42",
4
4
  "description": "app api",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",