@smartico/public-api 0.0.5 → 0.0.7

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 (87) hide show
  1. package/dist/Base/ClassId.d.ts +53 -4
  2. package/dist/Inbox/GetInboxMessagesRequest.d.ts +5 -0
  3. package/dist/Inbox/GetInboxMessagesResponse.d.ts +5 -0
  4. package/dist/Inbox/InboxMessage.d.ts +14 -0
  5. package/dist/Inbox/InboxMessageType.d.ts +11 -0
  6. package/dist/Inbox/index.d.ts +5 -0
  7. package/dist/Leaderboard/GetLeaderBoardsRequest.d.ts +7 -0
  8. package/dist/Leaderboard/GetLeaderBoardsResponse.d.ts +7 -0
  9. package/dist/Leaderboard/LeaderBoardDetails.d.ts +13 -0
  10. package/dist/Leaderboard/LeaderBoardPeriodType.d.ts +5 -0
  11. package/dist/Leaderboard/LeaderBoardPosition.d.ts +10 -0
  12. package/dist/Leaderboard/LeaderBoardPublicMeta.d.ts +5 -0
  13. package/dist/Leaderboard/index.d.ts +7 -0
  14. package/dist/Missions/AchievementOptinRequest.d.ts +4 -0
  15. package/dist/Missions/AchievementOptinResponse.d.ts +3 -0
  16. package/dist/Missions/AchievementPublicMeta.d.ts +15 -0
  17. package/dist/Missions/AchievementStatus.d.ts +8 -0
  18. package/dist/Missions/AchievementTaskPublicMeta.d.ts +3 -0
  19. package/dist/Missions/AchievementTaskType.d.ts +4 -0
  20. package/dist/Missions/AchievementType.d.ts +4 -0
  21. package/dist/Missions/GetAchievementMapRequest.d.ts +3 -0
  22. package/dist/Missions/GetAchievementMapResponse.d.ts +5 -0
  23. package/dist/Missions/ReloadAchievementsEvent.d.ts +3 -0
  24. package/dist/Missions/UserAchievement.d.ts +21 -0
  25. package/dist/Missions/UserAchievementTask.d.ts +14 -0
  26. package/dist/Missions/index.d.ts +13 -0
  27. package/dist/NodeCache.d.ts +9 -0
  28. package/dist/SmarticoAPI.d.ts +2 -0
  29. package/dist/Store/BuyShopItemErrorCode.d.ts +10 -0
  30. package/dist/Store/BuyShopItemRequest.d.ts +4 -0
  31. package/dist/Store/BuyShopItemResponse.d.ts +4 -0
  32. package/dist/Store/GetCategoriesShopResponse.d.ts +5 -0
  33. package/dist/Store/GetShopItemsResponse.d.ts +5 -0
  34. package/dist/Store/ShopCategory.d.ts +5 -0
  35. package/dist/Store/ShopCategoryPublicMeta.d.ts +4 -0
  36. package/dist/Store/ShopItem.d.ts +9 -0
  37. package/dist/Store/ShopItemPublicMeta.d.ts +10 -0
  38. package/dist/Store/ShopItemType.d.ts +4 -0
  39. package/dist/Store/index.d.ts +11 -0
  40. package/dist/index.d.ts +5 -1
  41. package/dist/index.js +178 -16
  42. package/dist/index.js.map +1 -1
  43. package/dist/index.modern.mjs +164 -14
  44. package/dist/index.modern.mjs.map +1 -1
  45. package/package.json +6 -4
  46. package/src/Base/ClassId.ts +64 -6
  47. package/src/Base/ProtocolMessage.ts +6 -1
  48. package/src/Inbox/GetInboxMessagesRequest.ts +7 -0
  49. package/src/Inbox/GetInboxMessagesResponse.ts +7 -0
  50. package/src/Inbox/InboxMessage.ts +16 -0
  51. package/src/Inbox/InboxMessageType.ts +13 -0
  52. package/src/Inbox/index.ts +11 -0
  53. package/src/Leaderboard/GetLeaderBoardsRequest.ts +11 -0
  54. package/src/Leaderboard/GetLeaderBoardsResponse.ts +8 -0
  55. package/src/Leaderboard/LeaderBoardDetails.ts +15 -0
  56. package/src/Leaderboard/LeaderBoardPeriodType.ts +5 -0
  57. package/src/Leaderboard/LeaderBoardPosition.ts +12 -0
  58. package/src/Leaderboard/LeaderBoardPublicMeta.ts +6 -0
  59. package/src/Leaderboard/index.ts +17 -0
  60. package/src/Missions/AchievementOptinRequest.ts +7 -0
  61. package/src/Missions/AchievementOptinResponse.ts +5 -0
  62. package/src/Missions/AchievementPublicMeta.ts +17 -0
  63. package/src/Missions/AchievementStatus.ts +9 -0
  64. package/src/Missions/AchievementTaskPublicMeta.ts +4 -0
  65. package/src/Missions/AchievementTaskType.ts +4 -0
  66. package/src/Missions/AchievementType.ts +5 -0
  67. package/src/Missions/GetAchievementMapRequest.ts +5 -0
  68. package/src/Missions/GetAchievementMapResponse.ts +8 -0
  69. package/src/Missions/ReloadAchievementsEvent.ts +5 -0
  70. package/src/Missions/UserAchievement.ts +25 -0
  71. package/src/Missions/UserAchievementTask.ts +17 -0
  72. package/src/Missions/index.ts +28 -0
  73. package/src/NodeCache.ts +45 -0
  74. package/src/OCache.ts +3 -2
  75. package/src/SmarticoAPI.ts +18 -4
  76. package/src/Store/BuyShopItemErrorCode.ts +10 -0
  77. package/src/Store/BuyShopItemRequest.ts +5 -0
  78. package/src/Store/BuyShopItemResponse.ts +6 -0
  79. package/src/Store/GetCategoriesShopResponse.ts +11 -0
  80. package/src/Store/GetShopItemsResponse.ts +7 -0
  81. package/src/Store/ShopCategory.ts +7 -0
  82. package/src/Store/ShopCategoryPublicMeta.ts +5 -0
  83. package/src/Store/ShopItem.ts +10 -0
  84. package/src/Store/ShopItemPublicMeta.ts +10 -0
  85. package/src/Store/ShopItemType.ts +5 -0
  86. package/src/Store/index.ts +25 -0
  87. package/src/index.ts +6 -1
@@ -0,0 +1,7 @@
1
+ import { ProtocolResponse } from "../Base/ProtocolResponse";
2
+ import { InboxMessage } from "./InboxMessage";
3
+
4
+ export interface GetInboxMessagesResponse extends ProtocolResponse {
5
+
6
+ log: InboxMessage[];
7
+ }
@@ -0,0 +1,16 @@
1
+ import { InboxMessageType } from "./InboxMessageType";
2
+
3
+ export interface InboxMessage {
4
+
5
+ createDate: string;
6
+ body: {
7
+ action: string;
8
+ body: string;
9
+ type: InboxMessageType;
10
+ image: string;
11
+ title: string;
12
+ html_body: string;
13
+ };
14
+ engagement_uuid: string;
15
+ ff: string;
16
+ }
@@ -0,0 +1,13 @@
1
+ export enum InboxMessageType {
2
+ Custom = 0,
3
+ MissionCompleted = 1,
4
+ MissionUnlocked = 2,
5
+ LeaderboardWon = 3,
6
+ LevelChanged = 4,
7
+ BonusGiven = 5,
8
+ PointsAdded = 6,
9
+ PointsUsed = 7,
10
+ PersonalMessage = 8
11
+ }
12
+
13
+ // keep in sync with BO enum
@@ -0,0 +1,11 @@
1
+ import { GetInboxMessagesRequest } from "./GetInboxMessagesRequest";
2
+ import { GetInboxMessagesResponse } from "./GetInboxMessagesResponse";
3
+ import { InboxMessage } from "./InboxMessage";
4
+ import { InboxMessageType } from "./InboxMessageType";
5
+
6
+ export {
7
+ InboxMessage,
8
+ InboxMessageType,
9
+ GetInboxMessagesRequest,
10
+ GetInboxMessagesResponse,
11
+ }
@@ -0,0 +1,11 @@
1
+ import { ProtocolMessage } from "../Base/ProtocolMessage";
2
+ import { LeaderBoardPeriodType } from "./LeaderBoardPeriodType";
3
+
4
+
5
+ export interface GetLeaderBoardsRequest extends ProtocolMessage {
6
+ // if not set will return all boards
7
+ period_type_id?: LeaderBoardPeriodType;
8
+ // can be >=1, if set will return snapshot for the previous period (1), or period before previous (2) etc
9
+ snapshot_offset?: number;
10
+ include_users?: boolean;
11
+ }
@@ -0,0 +1,8 @@
1
+ import { ProtocolResponse } from "../Base/ProtocolResponse";
2
+ import { LeaderBoardDetails } from "./LeaderBoardDetails";
3
+
4
+ export interface GetLeaderBoardsResponse extends ProtocolResponse {
5
+
6
+ map: { [key: string]: LeaderBoardDetails };
7
+ }
8
+
@@ -0,0 +1,15 @@
1
+ import { LeaderBoardPeriodType } from "./LeaderBoardPeriodType";
2
+ import { LeaderBoardPosition } from "./LeaderBoardPosition";
3
+ import { LeaderBoardPublicMeta } from "./LeaderBoardPublicMeta";
4
+
5
+ export interface LeaderBoardDetails {
6
+
7
+ board_id: number;
8
+ period_type_id: LeaderBoardPeriodType;
9
+ create_date?: number; // 0 for the current
10
+ versiod_id: number; // 0 for the current
11
+ reward_points: number[];
12
+ board_public_meta: LeaderBoardPublicMeta;
13
+ positions: LeaderBoardPosition[];
14
+ userPosition: LeaderBoardPosition;
15
+ }
@@ -0,0 +1,5 @@
1
+ export enum LeaderBoardPeriodType {
2
+ DAILY = 1,
3
+ WEEKLY = 2,
4
+ MONTHLY = 3
5
+ }
@@ -0,0 +1,12 @@
1
+ export interface LeaderBoardPosition {
2
+
3
+ public_username?: string;
4
+ user_alt_name: string; // TODO Need remove it in future
5
+ position_in_board: number;
6
+ points_accumulated: number;
7
+ is_me: boolean;
8
+ level_id: number;
9
+ avatar_id: string;
10
+
11
+ avatar_url?: string;
12
+ }
@@ -0,0 +1,6 @@
1
+ export interface LeaderBoardPublicMeta {
2
+
3
+ name: string;
4
+ description: string;
5
+ rules: string;
6
+ }
@@ -0,0 +1,17 @@
1
+ import { GetLeaderBoardsRequest } from "./GetLeaderBoardsRequest";
2
+ import { GetLeaderBoardsResponse } from "./GetLeaderBoardsResponse";
3
+ import { LeaderBoardDetails } from "./LeaderBoardDetails";
4
+ import { LeaderBoardPeriodType } from "./LeaderBoardPeriodType";
5
+ import { LeaderBoardPosition } from "./LeaderBoardPosition";
6
+ import { LeaderBoardPublicMeta } from "./LeaderBoardPublicMeta";
7
+
8
+
9
+ export {
10
+ GetLeaderBoardsRequest,
11
+ GetLeaderBoardsResponse,
12
+ LeaderBoardDetails,
13
+ LeaderBoardPeriodType,
14
+ LeaderBoardPosition,
15
+ LeaderBoardPublicMeta,
16
+
17
+ }
@@ -0,0 +1,7 @@
1
+ import { ProtocolMessage } from "../Base/ProtocolMessage";
2
+
3
+
4
+ export interface AchievementOptinRequest extends ProtocolMessage {
5
+
6
+ achievementId: number;
7
+ }
@@ -0,0 +1,5 @@
1
+ import { ProtocolResponse } from "../Base/ProtocolResponse";
2
+
3
+ export interface AchievementOptinResponse extends ProtocolResponse {
4
+
5
+ }
@@ -0,0 +1,17 @@
1
+ export interface AchievementPublicMeta {
2
+
3
+ description?: string;
4
+ unlock_mission_description?: string;
5
+ cta_text?: string;
6
+ cta_action?: string;
7
+ label_tag?: string;
8
+ reward?: string;
9
+ image_url?: string;
10
+ name?: string;
11
+ position?: number;
12
+ hide_tasks?: boolean;
13
+ hide_locked_mission?: boolean;
14
+ custom_section_id?: number;
15
+ only_in_custom_section?: boolean;
16
+
17
+ }
@@ -0,0 +1,9 @@
1
+ export enum AchievementStatus {
2
+
3
+ Draft = 1,
4
+ AvailableUnlocked = 2,
5
+ AvailableLocked = 3,
6
+ Archived = 4,
7
+ FeaturedManually = 5,
8
+ FeaturedAI = 6
9
+ }
@@ -0,0 +1,4 @@
1
+ export interface AchievementTaskPublicMeta {
2
+
3
+ name?: string;
4
+ }
@@ -0,0 +1,4 @@
1
+ export enum AchievementTaskType {
2
+ CompleteAchievement = 1,
3
+ UnlockAchievement = 2
4
+ }
@@ -0,0 +1,5 @@
1
+ export enum AchievementType {
2
+
3
+ Mission = 1,
4
+ Badge = 2
5
+ }
@@ -0,0 +1,5 @@
1
+ import { ProtocolMessage } from "../Base/ProtocolMessage";
2
+
3
+ export interface GetAchievementMapRequest extends ProtocolMessage {
4
+
5
+ }
@@ -0,0 +1,8 @@
1
+ import { ProtocolResponse } from "../Base/ProtocolResponse";
2
+ import { UserAchievement } from "./UserAchievement";
3
+
4
+
5
+ export interface GetAchievementMapResponse extends ProtocolResponse {
6
+
7
+ achievements?: UserAchievement[];
8
+ }
@@ -0,0 +1,5 @@
1
+ import { ProtocolResponse } from "../Base/ProtocolResponse";
2
+
3
+ export interface ReloadAchievementsEvent extends ProtocolResponse {
4
+
5
+ }
@@ -0,0 +1,25 @@
1
+
2
+ import { AchievementPublicMeta } from "./AchievementPublicMeta";
3
+ import { AchievementStatus } from "./AchievementStatus";
4
+ import { AchievementType } from "./AchievementType";
5
+ import { UserAchievementTask } from "./UserAchievementTask";
6
+
7
+ export interface UserAchievement {
8
+
9
+ ach_id?: number;
10
+ ach_type_id?: AchievementType;
11
+ ach_public_meta?: AchievementPublicMeta;
12
+ isCompleted?: boolean;
13
+ isLocked?: boolean;
14
+ requiresOptin?: boolean;
15
+ isOptedIn?: boolean;
16
+ start_date?: string; // time when mission unlocked or opted-in. Needed to calculated "remaining time" in case time_limit_ms is set
17
+ time_limit_ms?: number;
18
+ progress?: number;
19
+ complete_date?: string;
20
+ unlock_date?: string;
21
+ completed_tasks?: number;
22
+ achievementTasks?: UserAchievementTask[];
23
+ ach_status_id?: AchievementStatus;
24
+ }
25
+
@@ -0,0 +1,17 @@
1
+ import { AchievementTaskPublicMeta } from "./AchievementTaskPublicMeta";
2
+ import { AchievementTaskType } from "./AchievementTaskType";
3
+
4
+ export interface UserAchievementTask {
5
+
6
+ task_id?: number;
7
+ task_public_meta?: AchievementTaskPublicMeta;
8
+ points_reward?: number;
9
+ task_type_id: AchievementTaskType;
10
+ isCompleted?: boolean;
11
+ userExecutedCount?: number;
12
+ userProgress?: number;
13
+ lastExecutionDate: string;
14
+ unlocked_by_mission_id?: number;
15
+ unlocked_by_level_id?: number;
16
+ }
17
+
@@ -0,0 +1,28 @@
1
+ import { AchievementOptinRequest } from "./AchievementOptinRequest";
2
+ import { AchievementOptinResponse } from "./AchievementOptinResponse";
3
+ import { AchievementPublicMeta } from "./AchievementPublicMeta";
4
+ import { AchievementStatus } from "./AchievementStatus";
5
+ import { AchievementTaskPublicMeta } from "./AchievementTaskPublicMeta";
6
+ import { AchievementTaskType } from "./AchievementTaskType";
7
+ import { AchievementType } from "./AchievementType";
8
+ import { GetAchievementMapRequest } from "./GetAchievementMapRequest";
9
+ import { GetAchievementMapResponse } from "./GetAchievementMapResponse";
10
+ import { ReloadAchievementsEvent } from "./ReloadAchievementsEvent";
11
+ import { UserAchievement } from "./UserAchievement";
12
+ import { UserAchievementTask } from "./UserAchievementTask";
13
+
14
+
15
+ export {
16
+ AchievementOptinRequest,
17
+ AchievementOptinResponse,
18
+ AchievementPublicMeta,
19
+ AchievementStatus,
20
+ AchievementTaskPublicMeta,
21
+ AchievementTaskType,
22
+ AchievementType,
23
+ GetAchievementMapRequest,
24
+ GetAchievementMapResponse,
25
+ ReloadAchievementsEvent,
26
+ UserAchievement,
27
+ UserAchievementTask,
28
+ }
@@ -0,0 +1,45 @@
1
+
2
+ class NodeCache {
3
+
4
+ private static ttlChecker: NodeJS.Timeout;
5
+
6
+ private static cache: { [key: string] : any } = {};
7
+
8
+ constructor() {
9
+ if (NodeCache.ttlChecker === undefined) {
10
+ NodeCache.ttlChecker = setInterval(() => {
11
+ const now = new Date().getTime();
12
+ for (const key in NodeCache.cache) {
13
+ if (NodeCache.cache.hasOwnProperty(key)) {
14
+ const o = NodeCache.cache[key];
15
+ if (o.ttl < now) {
16
+ delete NodeCache.cache[key];
17
+ }
18
+ }
19
+ }
20
+ }, 1000);
21
+ }
22
+ }
23
+
24
+ public get(key: string): any {
25
+ const o = NodeCache.cache[key];
26
+ if (o !== undefined && o.ttl > new Date().getTime()) {
27
+ return o.value;
28
+ }
29
+ }
30
+
31
+ public set(key: string, value: any, ttlSeconds: number = 60) {
32
+ NodeCache.cache[key] = {
33
+ value,
34
+ ttl: new Date().getTime() + ttlSeconds * 1000
35
+ }
36
+ }
37
+
38
+ public flushAll() {
39
+ NodeCache.cache = {};
40
+ }
41
+
42
+ }
43
+
44
+
45
+ export { NodeCache }
package/src/OCache.ts CHANGED
@@ -1,4 +1,5 @@
1
- import NodeCache from 'node-cache';
1
+ import { NodeCache } from "./NodeCache";
2
+
2
3
 
3
4
  export enum ECacheContext {
4
5
  Translations,
@@ -18,7 +19,7 @@ export class OCache {
18
19
  const key = cacheContext.toString() + '_' + JSON.stringify(oKey);
19
20
 
20
21
  if (this.cache[cacheContext] === undefined) {
21
- this.cache[cacheContext] = new NodeCache( { useClones: !WITH_REF_CACHE.includes(cacheContext) } );
22
+ this.cache[cacheContext] = new NodeCache( );
22
23
  }
23
24
 
24
25
  return this.cache[cacheContext].get(key);
@@ -12,6 +12,7 @@ import { ECacheContext, OCache } from './OCache';
12
12
  import { GetTranslationsRequest, GetTranslationsResponse, ResponseIdentify, TranslationArea } from './Core';
13
13
  import { GetLabelInfoResponse } from './Core/GetLabelInfoResponse';
14
14
  import { GetLabelInfoRequest } from './Core/GetLabelInfoRequest';
15
+ import { GetInboxMessagesRequest, GetInboxMessagesResponse } from './Inbox';
15
16
 
16
17
  const PUBLIC_API_URL = 'https://papi{ENV_ID}.smartico.ai/services/public';
17
18
  const AVATAR_DOMAIN = 'https://img{ENV_ID}.smr.vc';
@@ -182,9 +183,9 @@ class SmarticoAPI {
182
183
 
183
184
  return OCache.use<GetLabelInfoResponse>(`${this.label_api_key} - ${this.brand_api_key}`, ECacheContext.LabelInfo, async () => {
184
185
 
185
- const message = this.buildMessage<GetLabelInfoResponse, GetLabelInfoRequest>(user_ext_id, ClassId.GET_LABEL_INFO);
186
+ const message = this.buildMessage<GetLabelInfoResponse, GetLabelInfoRequest>(user_ext_id, ClassId.INIT);
186
187
 
187
- return this.send<GetLabelInfoResponse>(message, ClassId.GET_LABEL_INFO_RESPONSE)
188
+ return this.send<GetLabelInfoResponse>(message, ClassId.INIT_RESPONSE)
188
189
 
189
190
  }, cacheSec);
190
191
 
@@ -207,11 +208,11 @@ class SmarticoAPI {
207
208
 
208
209
  public async coreChangeUsername(user_ext_id: string, public_username_custom: string): Promise<{ public_username_custom: string }> {
209
210
 
210
- const message = this.buildMessage<any, any>(user_ext_id, ClassId.CHANGE_USERNAME, {
211
+ const message = this.buildMessage<any, any>(user_ext_id, ClassId.CLIENT_SET_CUSTOM_USERNAME_REQUEST, {
211
212
  public_username_custom
212
213
  });
213
214
 
214
- return this.send(message, ClassId.CHANGE_USERNAME_RESPONSE);
215
+ return this.send(message, ClassId.CLIENT_SET_CUSTOM_USERNAME_RESPONSE);
215
216
  }
216
217
 
217
218
 
@@ -291,6 +292,19 @@ class SmarticoAPI {
291
292
  return spinAttemptResponse;
292
293
  }
293
294
 
295
+ public async inboxGetMessages(user_ext_id: string, limit: number = 10, offset: number = 0): Promise<GetInboxMessagesResponse> {
296
+
297
+ const message = this.buildMessage<GetInboxMessagesRequest, GetInboxMessagesResponse>(user_ext_id, ClassId.GET_ACTIVITY_LOG_REQUEST, {
298
+ limit,
299
+ offset
300
+ });
301
+
302
+ const response = await this.send<GetInboxMessagesResponse>(message);
303
+
304
+ return response;
305
+
306
+ }
307
+
294
308
  }
295
309
 
296
310
  export { SmarticoAPI }
@@ -0,0 +1,10 @@
1
+ export enum BuyShopItemErrorCode {
2
+ FAILED_TO_BUY_SHOP_ITEM = 121,
3
+ SHOP_NO_BALANCE = 11000,
4
+ SHOP_WRONG_LABEL = 11001,
5
+ SHOP_FAILED_TO_BUY_BONUS = 11002, // remote product restriction
6
+ SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION = 11003, // when not visible but trying to buy. Shoudnt happen
7
+ SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION_PURSHASE = 11004, // when visible but not matching to purchase segment
8
+ SHOP_FAILED_TO_BUY_MATCHING_BONUS = 11005,
9
+ SHOP_FAILED_MAX_BOUGHT_ITEMS_REACHED = 11006
10
+ }
@@ -0,0 +1,5 @@
1
+ import { ProtocolMessage } from "../Base/ProtocolMessage";
2
+
3
+ export interface BuyShopItemRequest extends ProtocolMessage {
4
+ itemId: number;
5
+ }
@@ -0,0 +1,6 @@
1
+ import { ProtocolResponse } from "../Base/ProtocolResponse";
2
+
3
+ export interface BuyShopItemResponse extends ProtocolResponse {
4
+ success?: boolean;
5
+ }
6
+
@@ -0,0 +1,11 @@
1
+ import { ProtocolResponse } from "../Base/ProtocolResponse";
2
+ import { ShopCategory } from "./ShopCategory";
3
+
4
+
5
+ export interface GetCategoriesShopResponse extends ProtocolResponse {
6
+
7
+ categories: ShopCategory[];
8
+ }
9
+
10
+
11
+
@@ -0,0 +1,7 @@
1
+
2
+ import { ProtocolResponse } from "../Base/ProtocolResponse";
3
+ import { ShopItem } from "./ShopItem";
4
+
5
+ export interface GetShopItemsResponse extends ProtocolResponse {
6
+ items: ShopItem[];
7
+ }
@@ -0,0 +1,7 @@
1
+ import { ShopCategoryPublicMeta } from "./ShopCategoryPublicMeta";
2
+
3
+ export interface ShopCategory {
4
+
5
+ id?: number;
6
+ publicMeta?: ShopCategoryPublicMeta;
7
+ }
@@ -0,0 +1,5 @@
1
+ export interface ShopCategoryPublicMeta {
2
+
3
+ name?: string;
4
+ order?: number;
5
+ }
@@ -0,0 +1,10 @@
1
+ import { ShopItemPublicMeta } from "./ShopItemPublicMeta";
2
+ import { ShopItemType } from "./ShopItemType";
3
+
4
+ export interface ShopItem {
5
+ id: number;
6
+ itemTypeId: ShopItemType;
7
+ itemPublicMeta: ShopItemPublicMeta;
8
+ categoryIds?: number[];
9
+ canBuy?: boolean;
10
+ }
@@ -0,0 +1,10 @@
1
+ export interface ShopItemPublicMeta {
2
+ price: string;
3
+ image_url: string;
4
+ name: string;
5
+ description: string;
6
+ label_tag: string;
7
+ limit_message: string;
8
+ priority: number;
9
+ related_items: number[];
10
+ }
@@ -0,0 +1,5 @@
1
+ export enum ShopItemType {
2
+ Bonus = 1,
3
+ Manual = 2
4
+ }
5
+
@@ -0,0 +1,25 @@
1
+ import { BuyShopItemErrorCode } from "./BuyShopItemErrorCode";
2
+ import { BuyShopItemRequest } from "./BuyShopItemRequest";
3
+ import { BuyShopItemResponse } from "./BuyShopItemResponse";
4
+ import { GetCategoriesShopResponse } from "./GetCategoriesShopResponse";
5
+ import { GetShopItemsResponse } from "./GetShopItemsResponse";
6
+ import { ShopCategory } from "./ShopCategory";
7
+ import { ShopCategoryPublicMeta } from "./ShopCategoryPublicMeta";
8
+ import { ShopItem } from "./ShopItem";
9
+ import { ShopItemPublicMeta } from "./ShopItemPublicMeta";
10
+ import { ShopItemType } from "./ShopItemType";
11
+
12
+
13
+ export {
14
+ BuyShopItemErrorCode,
15
+ BuyShopItemRequest,
16
+ BuyShopItemResponse,
17
+ GetCategoriesShopResponse,
18
+ GetShopItemsResponse,
19
+ ShopCategory,
20
+ ShopCategoryPublicMeta,
21
+ ShopItem,
22
+ ShopItemPublicMeta,
23
+ ShopItemType,
24
+
25
+ }
package/src/index.ts CHANGED
@@ -2,8 +2,13 @@ import { ClassId } from './Base/ClassId'
2
2
  import { ILogger } from './ILogger';
3
3
  import { SmarticoAPI } from './SmarticoAPI'
4
4
 
5
- export * from './MiniGames';
6
5
  export * from './Core';
6
+ export * from './Inbox';
7
+ export * from './Leaderboard';
8
+ export * from './MiniGames';
9
+ export * from './Missions';
10
+ export * from './Store';
11
+
7
12
 
8
13
  export {
9
14
  SmarticoAPI,