@bytexbyte/ike-app-api 1.0.81 → 1.0.83

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,27 +1,27 @@
1
1
  import BxBApi from '@bytexbyte/bxb-api';
2
- declare type SendBody = {
2
+ type SendBody = {
3
3
  provider: 'email' | 'phone';
4
4
  identifier: string;
5
5
  };
6
- declare type SendResult = {
6
+ type SendResult = {
7
7
  error?: 'You are not logged in.';
8
8
  endTimeMilliseconds?: undefined;
9
9
  } | {
10
10
  error: 'Code already exists. Please check your email or messages.';
11
11
  endTimeMilliseconds: number;
12
12
  };
13
- declare type VerifyBody = {
13
+ type VerifyBody = {
14
14
  code: number;
15
15
  };
16
- declare type VerifyResult = {
16
+ type VerifyResult = {
17
17
  error?: 'You are not logged in.' | 'invalid code' | 'Timeout.';
18
18
  };
19
- declare type RedeemBody = {
19
+ type RedeemBody = {
20
20
  address: string;
21
21
  tokenId: string;
22
22
  digitalCustomizationId: number;
23
23
  };
24
- declare type RedeemResult = {
24
+ type RedeemResult = {
25
25
  error?: 'Invalid tag.' | 'Missing blockChainTokenId.' | 'Status error.' | 'NFT submission not found.' | 'Contract not found.' | 'Unknown error.' | 'This is not your tag.' | 'You are not logged in.' | 'Transfer failed: no transaction hash returned.';
26
26
  };
27
27
  declare class IKEAppMfaApi extends BxBApi {
package/lib/Mfa/index.js CHANGED
@@ -24,12 +24,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
24
24
  });
25
25
  };
26
26
  var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
28
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
29
  function verb(n) { return function (v) { return step([n, v]); }; }
30
30
  function step(op) {
31
31
  if (f) throw new TypeError("Generator is already executing.");
32
- while (_) try {
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
33
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
34
  if (y = 0, t) op = [op[0] & 2, t.value];
35
35
  switch (op[0]) {
@@ -24,12 +24,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
24
24
  });
25
25
  };
26
26
  var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
28
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
29
  function verb(n) { return function (v) { return step([n, v]); }; }
30
30
  function step(op) {
31
31
  if (f) throw new TypeError("Generator is already executing.");
32
- while (_) try {
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
33
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
34
  if (y = 0, t) op = [op[0] & 2, t.value];
35
35
  switch (op[0]) {
@@ -1,4 +1,5 @@
1
- export declare type Product = {
1
+ export type Product = {
2
+ batchId?: string;
2
3
  batchName: string;
3
4
  tokenId: string;
4
5
  name: string;
@@ -12,4 +13,8 @@ export declare type Product = {
12
13
  deviceStandbyTime: number;
13
14
  isScanningAllow: boolean;
14
15
  vendor: string;
16
+ /** True if this tag/device has a row in `portfolio` (owned by someone). */
17
+ portfolioClaimed: boolean;
18
+ /** Present only when the request is authenticated; true if the owner is the current user. */
19
+ portfolioOwnedByCurrentUser?: boolean;
15
20
  };
@@ -1,15 +1,15 @@
1
1
  import BxBApi from '@bytexbyte/bxb-api';
2
- declare type FreeForm = {
2
+ type FreeForm = {
3
3
  id: number;
4
4
  value: string;
5
5
  };
6
- declare type RedeemBody = {
6
+ type RedeemBody = {
7
7
  email: string;
8
8
  goldenTicketId: number;
9
9
  tokenId: string;
10
10
  freeForm: FreeForm[];
11
11
  };
12
- declare type RedeemResult = {
12
+ type RedeemResult = {
13
13
  error?: 'You are not logged in.' | 'Contact email not found.' | 'batch not found.' | 'company not found.' | 'This is not your tag.';
14
14
  };
15
15
  declare class IKEAppRedeemApi extends BxBApi {
@@ -24,12 +24,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
24
24
  });
25
25
  };
26
26
  var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
28
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
29
  function verb(n) { return function (v) { return step([n, v]); }; }
30
30
  function step(op) {
31
31
  if (f) throw new TypeError("Generator is already executing.");
32
- while (_) try {
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
33
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
34
  if (y = 0, t) op = [op[0] & 2, t.value];
35
35
  switch (op[0]) {
@@ -1,11 +1,11 @@
1
1
  import BxBApi from '@bytexbyte/bxb-api';
2
- declare type RegisterBody = {
2
+ type RegisterBody = {
3
3
  token: string;
4
4
  device: string;
5
5
  deviceOsType: 'ios' | 'android' | 'windows' | 'macos' | 'web';
6
6
  deviceId?: string;
7
7
  };
8
- declare type RegisterResult = {
8
+ type RegisterResult = {
9
9
  error?: 'You are not logged in.' | 'Invalid request';
10
10
  };
11
11
  declare class IKEAppRegisterDeviceCodeApi extends BxBApi {
@@ -24,12 +24,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
24
24
  });
25
25
  };
26
26
  var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
28
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
29
  function verb(n) { return function (v) { return step([n, v]); }; }
30
30
  function step(op) {
31
31
  if (f) throw new TypeError("Generator is already executing.");
32
- while (_) try {
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
33
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
34
  if (y = 0, t) op = [op[0] & 2, t.value];
35
35
  switch (op[0]) {
package/lib/Rsa/index.js CHANGED
@@ -24,12 +24,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
24
24
  });
25
25
  };
26
26
  var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
28
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
29
  function verb(n) { return function (v) { return step([n, v]); }; }
30
30
  function step(op) {
31
31
  if (f) throw new TypeError("Generator is already executing.");
32
- while (_) try {
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
33
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
34
  if (y = 0, t) op = [op[0] & 2, t.value];
35
35
  switch (op[0]) {
@@ -1,10 +1,10 @@
1
1
  import BxBApi from '@bytexbyte/bxb-api';
2
2
  import { Scan } from '../types';
3
- declare type ScanBody = Pick<Scan, 'isAppClip' | 'latitude' | 'longitude' | 'tagTokenId' | 'deviceId' | 'tail'> & {
3
+ type ScanBody = Pick<Scan, 'isAppClip' | 'latitude' | 'longitude' | 'tagTokenId' | 'deviceId' | 'tail'> & {
4
4
  uid: string;
5
5
  deviceOsType: 'ios' | 'android' | 'windows' | 'macos' | 'web';
6
6
  };
7
- declare type UpdateBody = {
7
+ type UpdateBody = {
8
8
  isVisitedPromo: Pick<Scan, 'isVisitedPromo'>['isVisitedPromo'];
9
9
  isVisitedShop?: undefined;
10
10
  isVisitedExplore?: undefined;
@@ -17,12 +17,12 @@ declare type UpdateBody = {
17
17
  isVisitedShop?: undefined;
18
18
  isVisitedExplore: Pick<Scan, 'isVisitedExplore'>['isVisitedExplore'];
19
19
  };
20
- declare type ScanResult = {
20
+ type ScanResult = {
21
21
  scan: Scan;
22
22
  } | {
23
23
  error: 'Token is not exist.' | 'tokenId and UID do not match.' | 'This device is deactivated.' | 'Server timeout.' | 'The device does not support' | 'This is a IKE tag, You are not authorized to call this API.';
24
24
  };
25
- declare type UpdateResult = {
25
+ type UpdateResult = {
26
26
  error?: 'scanId type error.' | 'scanId not found.' | 'This is a IKE tag, You are not authorized to call this API.' | 'Scan not found.';
27
27
  };
28
28
  declare class IKEAppScanApi extends BxBApi {
package/lib/Scan/index.js CHANGED
@@ -24,12 +24,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
24
24
  });
25
25
  };
26
26
  var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
28
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
29
  function verb(n) { return function (v) { return step([n, v]); }; }
30
30
  function step(op) {
31
31
  if (f) throw new TypeError("Generator is already executing.");
32
- while (_) try {
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
33
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
34
  if (y = 0, t) op = [op[0] & 2, t.value];
35
35
  switch (op[0]) {
@@ -1,7 +1,7 @@
1
1
  import BxBApi from '@bytexbyte/bxb-api';
2
2
  import { ikeApi } from '../config';
3
3
  import { BlockChainStatusType } from '../types';
4
- declare type GetResult = {
4
+ type GetResult = {
5
5
  tokenId: string;
6
6
  batchId: string;
7
7
  batchSerialNumber: number;
@@ -11,48 +11,48 @@ declare type GetResult = {
11
11
  }[];
12
12
  };
13
13
  } | null;
14
- declare type GetManyQuery = {
14
+ type GetManyQuery = {
15
15
  batchId: string;
16
16
  batchSerialNumberGte?: string;
17
17
  batchSerialNumberLte?: string;
18
18
  };
19
- declare type GetManyResult = {
19
+ type GetManyResult = {
20
20
  tokenId: string;
21
21
  batchSerialNumber: number;
22
22
  }[];
23
- declare type PostBody = {
23
+ type PostBody = {
24
24
  ownerId: string;
25
25
  };
26
- declare type PostResult = {
26
+ type PostResult = {
27
27
  tagTokenId: string;
28
28
  error?: undefined;
29
29
  } | {
30
30
  tagTokenId?: undefined;
31
31
  error: 'this is not your account.' | 'create error.' | 'this is not your tag.' | 'undo expired.' | 'delete error.';
32
32
  };
33
- declare type PutBody = Parameters<typeof ikeApi.tags.updateMany>[0];
34
- declare type PutResult = Awaited<ReturnType<typeof ikeApi.tags.updateMany>>;
35
- declare type TransferBody = {
33
+ type PutBody = Parameters<typeof ikeApi.tags.updateMany>[0];
34
+ type PutResult = Awaited<ReturnType<typeof ikeApi.tags.updateMany>>;
35
+ type TransferBody = {
36
36
  ownerId: string;
37
37
  transferId: string;
38
38
  };
39
- declare type UndoTransferBody = {
39
+ type UndoTransferBody = {
40
40
  ownerId: string;
41
41
  };
42
- declare type PutInfoVisible = {
42
+ type PutInfoVisible = {
43
43
  ownerId: string;
44
44
  isInfoVisible: boolean;
45
45
  };
46
- declare type PutInfoVisibleResult = {
46
+ type PutInfoVisibleResult = {
47
47
  error?: 'this is not your account.' | 'this is not your tag.' | 'update error.';
48
48
  };
49
- declare type PutUpdateDisplayName = {
49
+ type PutUpdateDisplayName = {
50
50
  displayName: string;
51
51
  };
52
- declare type PutUpdateDisplayNameResult = {
52
+ type PutUpdateDisplayNameResult = {
53
53
  error?: 'update error.';
54
54
  };
55
- declare type TagCheckListStatus = 'pass' | 'fail' | 'none';
55
+ type TagCheckListStatus = 'pass' | 'fail' | 'none';
56
56
  declare class IKEAppTagsApi extends BxBApi {
57
57
  constructor({ host, credentials, onSuccess, onError, }: {
58
58
  host: string;
package/lib/Tags/index.js CHANGED
@@ -24,12 +24,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
24
24
  });
25
25
  };
26
26
  var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
28
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
29
  function verb(n) { return function (v) { return step([n, v]); }; }
30
30
  function step(op) {
31
31
  if (f) throw new TypeError("Generator is already executing.");
32
- while (_) try {
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
33
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
34
  if (y = 0, t) op = [op[0] & 2, t.value];
35
35
  switch (op[0]) {
@@ -24,12 +24,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
24
24
  });
25
25
  };
26
26
  var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
28
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
29
  function verb(n) { return function (v) { return step([n, v]); }; }
30
30
  function step(op) {
31
31
  if (f) throw new TypeError("Generator is already executing.");
32
- while (_) try {
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
33
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
34
  if (y = 0, t) op = [op[0] & 2, t.value];
35
35
  switch (op[0]) {
@@ -1,6 +1,6 @@
1
1
  import BxBApi from '@bytexbyte/bxb-api';
2
2
  import { User, UserLog, UserLogAction, Wallet } from '../types';
3
- declare type GetResult = {
3
+ type GetResult = {
4
4
  user: {
5
5
  email: string | null;
6
6
  phone: string | null;
@@ -12,21 +12,21 @@ declare type GetResult = {
12
12
  user?: undefined;
13
13
  error: 'Authentication type error.' | 'Incorrect userID.' | 'User not found.' | 'You are not authorized to call this API.';
14
14
  };
15
- declare type UpdateBody = Pick<User, 'image' | 'firstName' | 'lastName'>;
16
- declare type UpdateResult = Pick<User, 'id' | 'email' | 'phone' | 'image' | 'firstName' | 'lastName'> | {
15
+ type UpdateBody = Pick<User, 'image' | 'firstName' | 'lastName'>;
16
+ type UpdateResult = Pick<User, 'id' | 'email' | 'phone' | 'image' | 'firstName' | 'lastName'> | {
17
17
  error?: 'Authentication type error.' | 'Incorrect userID.' | 'You cannot make changes to this user.' | 'You are not authorized to call this API.';
18
18
  };
19
- declare type DeleteResult = User | {
19
+ type DeleteResult = User | {
20
20
  error?: 'Authentication type error.' | 'Incorrect userID.' | 'You cannot make changes to this user.' | 'User not found.' | 'You are not authorized to call this API.';
21
21
  };
22
- declare type GetWalletResult = {
22
+ type GetWalletResult = {
23
23
  address: Pick<Wallet, 'address'>['address'];
24
24
  error?: undefined;
25
25
  } | {
26
26
  address?: undefined;
27
27
  error: 'Incorrect userID.' | 'You are not logged in.' | 'You cannot make changes to this user.' | 'Missing userId.' | 'Invalid id.';
28
28
  };
29
- declare type GetUserIdByEmailResult = {
29
+ type GetUserIdByEmailResult = {
30
30
  user: {
31
31
  id: string;
32
32
  };
@@ -35,18 +35,18 @@ declare type GetUserIdByEmailResult = {
35
35
  user?: undefined;
36
36
  error: 'Invalid email.' | 'You are not logged in.' | 'Incorrect userID.' | 'You cannot make changes to this user.' | 'Missing userId.';
37
37
  };
38
- declare type PostWalletBody = {
38
+ type PostWalletBody = {
39
39
  address: string;
40
40
  };
41
- declare type PostWalletResult = {
41
+ type PostWalletResult = {
42
42
  userId: string;
43
43
  address: string;
44
44
  };
45
- declare type LogoutResult = {
45
+ type LogoutResult = {
46
46
  success?: boolean;
47
47
  error?: 'You are not logged in.' | 'Incorrect userID.' | 'You cannot make changes to this user.' | 'Missing userId.';
48
48
  };
49
- declare type GetScanHistoryResult = {
49
+ type GetScanHistoryResult = {
50
50
  scanList: {
51
51
  id: number;
52
52
  tagTokenId: string;
@@ -75,25 +75,29 @@ declare type GetScanHistoryResult = {
75
75
  } | {
76
76
  error: 'You are not logged in.' | 'Incorrect userID.' | 'You cannot get data of this user.' | 'Missing userId.';
77
77
  };
78
- declare type RemoveScanHistoryResult = {
78
+ type RemoveScanHistoryResult = {
79
79
  error?: 'You are not logged in.' | 'Incorrect userID.' | 'Incorrect tagUid.' | 'You cannot make changes to this user.' | 'Missing userId.' | 'Missing scanHistoryId.' | 'Missing tagUid.';
80
80
  };
81
- declare type RemoveAllScanHistoryResult = {
81
+ type RemoveAllScanHistoryResult = {
82
82
  error?: 'You are not logged in.' | 'Incorrect userID.' | 'You cannot make changes to this user.' | 'Missing userId.';
83
83
  };
84
- declare type SaveProductResult = {
84
+ type SaveProductResult = {
85
85
  error?: 'You are not logged in.' | 'Incorrect userID.' | 'Incorrect batchId.' | 'You cannot make changes to this user.' | 'Missing userId.' | 'Missing batchId.';
86
86
  };
87
- declare type RemoveProductResult = {
87
+ /** POST/DELETE `/api/user/:userId/portfolio/:tagTokenId` one tag per owner (see `portfolio` table). */
88
+ type PortfolioDeviceResult = {
89
+ error?: string;
90
+ };
91
+ type RemoveProductResult = {
88
92
  error?: 'You are not logged in.' | 'Incorrect userID.' | 'Incorrect digitalCustomizationId.' | 'You cannot make changes to this user.' | 'Missing userId.' | 'Missing digitalCustomizationId.';
89
93
  };
90
- declare type CreateNotificationResult = {
94
+ type CreateNotificationResult = {
91
95
  error?: 'You are not logged in.' | 'Incorrect userID.' | 'Incorrect digitalCustomizationId.' | 'You cannot make changes to this user.' | 'Missing userId.' | 'Missing digitalCustomizationId.' | 'Missing digitalCustomization.';
92
96
  };
93
- declare type RemoveNotificationResult = {
97
+ type RemoveNotificationResult = {
94
98
  error?: 'You are not logged in.' | 'Incorrect userID.' | 'Incorrect digitalCustomizationId.' | 'You cannot make changes to this user.' | 'Missing userId.' | 'Missing digitalCustomizationId.';
95
99
  };
96
- declare type UpdateNotificationResult = {
100
+ type UpdateNotificationResult = {
97
101
  error?: 'You are not logged in.' | 'Incorrect userID.' | 'Incorrect digitalCustomizationId.' | 'You cannot make changes to this user.' | 'Missing userId.' | 'Missing digitalCustomizationId.';
98
102
  };
99
103
  declare enum RuleType {
@@ -102,7 +106,7 @@ declare enum RuleType {
102
106
  redeemNFT = "redeemNFT",
103
107
  redeemGoldenTicket = "redeemGoldenTicket"
104
108
  }
105
- declare type GetConnectDeviceAtResult = {
109
+ type GetConnectDeviceAtResult = {
106
110
  connectDeviceAt: Date;
107
111
  error?: undefined;
108
112
  } | {
@@ -127,6 +131,8 @@ declare class IKEAppUserApi extends BxBApi {
127
131
  removeAllScanHistory(userId: string): Promise<RemoveAllScanHistoryResult>;
128
132
  saveProduct(userId: string, batchId: string): Promise<SaveProductResult>;
129
133
  removeProduct(userId: string, batchId: string): Promise<RemoveProductResult>;
134
+ claimPortfolio(userId: string, tagTokenId: string): Promise<PortfolioDeviceResult>;
135
+ releasePortfolio(userId: string, tagTokenId: string): Promise<PortfolioDeviceResult>;
130
136
  logout(userId: string, form: {
131
137
  deviceToken: string;
132
138
  }): Promise<LogoutResult>;
package/lib/User/index.js CHANGED
@@ -24,12 +24,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
24
24
  });
25
25
  };
26
26
  var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
28
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
29
  function verb(n) { return function (v) { return step([n, v]); }; }
30
30
  function step(op) {
31
31
  if (f) throw new TypeError("Generator is already executing.");
32
- while (_) try {
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
33
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
34
  if (y = 0, t) op = [op[0] & 2, t.value];
35
35
  switch (op[0]) {
@@ -277,6 +277,56 @@ var IKEAppUserApi = /** @class */ (function (_super) {
277
277
  });
278
278
  });
279
279
  };
280
+ IKEAppUserApi.prototype.claimPortfolio = function (userId, tagTokenId) {
281
+ return __awaiter(this, void 0, void 0, function () {
282
+ var encoded, response;
283
+ return __generator(this, function (_a) {
284
+ switch (_a.label) {
285
+ case 0:
286
+ encoded = encodeURIComponent(tagTokenId);
287
+ return [4 /*yield*/, this.bxbFetch({
288
+ method: 'POST',
289
+ headers: userId
290
+ ? {
291
+ 'Content-Type': 'application/json',
292
+ 'IKE-App-User-Id': userId,
293
+ }
294
+ : {
295
+ 'Content-Type': 'application/json',
296
+ },
297
+ }, "".concat(userId, "/portfolio/").concat(encoded))];
298
+ case 1:
299
+ response = _a.sent();
300
+ return [2 /*return*/, response.json()];
301
+ }
302
+ });
303
+ });
304
+ };
305
+ IKEAppUserApi.prototype.releasePortfolio = function (userId, tagTokenId) {
306
+ return __awaiter(this, void 0, void 0, function () {
307
+ var encoded, response;
308
+ return __generator(this, function (_a) {
309
+ switch (_a.label) {
310
+ case 0:
311
+ encoded = encodeURIComponent(tagTokenId);
312
+ return [4 /*yield*/, this.bxbFetch({
313
+ method: 'DELETE',
314
+ headers: userId
315
+ ? {
316
+ 'Content-Type': 'application/json',
317
+ 'IKE-App-User-Id': userId,
318
+ }
319
+ : {
320
+ 'Content-Type': 'application/json',
321
+ },
322
+ }, "".concat(userId, "/portfolio/").concat(encoded))];
323
+ case 1:
324
+ response = _a.sent();
325
+ return [2 /*return*/, response.json()];
326
+ }
327
+ });
328
+ });
329
+ };
280
330
  IKEAppUserApi.prototype.logout = function (userId, form) {
281
331
  return __awaiter(this, void 0, void 0, function () {
282
332
  var response;
package/lib/index.js CHANGED
@@ -20,12 +20,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
20
20
  });
21
21
  };
22
22
  var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
24
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
29
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {