@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.
- package/dist/Base/ClassId.d.ts +53 -4
- package/dist/Inbox/GetInboxMessagesRequest.d.ts +5 -0
- package/dist/Inbox/GetInboxMessagesResponse.d.ts +5 -0
- package/dist/Inbox/InboxMessage.d.ts +14 -0
- package/dist/Inbox/InboxMessageType.d.ts +11 -0
- package/dist/Inbox/index.d.ts +5 -0
- package/dist/Leaderboard/GetLeaderBoardsRequest.d.ts +7 -0
- package/dist/Leaderboard/GetLeaderBoardsResponse.d.ts +7 -0
- package/dist/Leaderboard/LeaderBoardDetails.d.ts +13 -0
- package/dist/Leaderboard/LeaderBoardPeriodType.d.ts +5 -0
- package/dist/Leaderboard/LeaderBoardPosition.d.ts +10 -0
- package/dist/Leaderboard/LeaderBoardPublicMeta.d.ts +5 -0
- package/dist/Leaderboard/index.d.ts +7 -0
- package/dist/Missions/AchievementOptinRequest.d.ts +4 -0
- package/dist/Missions/AchievementOptinResponse.d.ts +3 -0
- package/dist/Missions/AchievementPublicMeta.d.ts +15 -0
- package/dist/Missions/AchievementStatus.d.ts +8 -0
- package/dist/Missions/AchievementTaskPublicMeta.d.ts +3 -0
- package/dist/Missions/AchievementTaskType.d.ts +4 -0
- package/dist/Missions/AchievementType.d.ts +4 -0
- package/dist/Missions/GetAchievementMapRequest.d.ts +3 -0
- package/dist/Missions/GetAchievementMapResponse.d.ts +5 -0
- package/dist/Missions/ReloadAchievementsEvent.d.ts +3 -0
- package/dist/Missions/UserAchievement.d.ts +21 -0
- package/dist/Missions/UserAchievementTask.d.ts +14 -0
- package/dist/Missions/index.d.ts +13 -0
- package/dist/NodeCache.d.ts +9 -0
- package/dist/SmarticoAPI.d.ts +2 -0
- package/dist/Store/BuyShopItemErrorCode.d.ts +10 -0
- package/dist/Store/BuyShopItemRequest.d.ts +4 -0
- package/dist/Store/BuyShopItemResponse.d.ts +4 -0
- package/dist/Store/GetCategoriesShopResponse.d.ts +5 -0
- package/dist/Store/GetShopItemsResponse.d.ts +5 -0
- package/dist/Store/ShopCategory.d.ts +5 -0
- package/dist/Store/ShopCategoryPublicMeta.d.ts +4 -0
- package/dist/Store/ShopItem.d.ts +9 -0
- package/dist/Store/ShopItemPublicMeta.d.ts +10 -0
- package/dist/Store/ShopItemType.d.ts +4 -0
- package/dist/Store/index.d.ts +11 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +178 -16
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +164 -14
- package/dist/index.modern.mjs.map +1 -1
- package/package.json +6 -4
- package/src/Base/ClassId.ts +64 -6
- package/src/Base/ProtocolMessage.ts +6 -1
- package/src/Inbox/GetInboxMessagesRequest.ts +7 -0
- package/src/Inbox/GetInboxMessagesResponse.ts +7 -0
- package/src/Inbox/InboxMessage.ts +16 -0
- package/src/Inbox/InboxMessageType.ts +13 -0
- package/src/Inbox/index.ts +11 -0
- package/src/Leaderboard/GetLeaderBoardsRequest.ts +11 -0
- package/src/Leaderboard/GetLeaderBoardsResponse.ts +8 -0
- package/src/Leaderboard/LeaderBoardDetails.ts +15 -0
- package/src/Leaderboard/LeaderBoardPeriodType.ts +5 -0
- package/src/Leaderboard/LeaderBoardPosition.ts +12 -0
- package/src/Leaderboard/LeaderBoardPublicMeta.ts +6 -0
- package/src/Leaderboard/index.ts +17 -0
- package/src/Missions/AchievementOptinRequest.ts +7 -0
- package/src/Missions/AchievementOptinResponse.ts +5 -0
- package/src/Missions/AchievementPublicMeta.ts +17 -0
- package/src/Missions/AchievementStatus.ts +9 -0
- package/src/Missions/AchievementTaskPublicMeta.ts +4 -0
- package/src/Missions/AchievementTaskType.ts +4 -0
- package/src/Missions/AchievementType.ts +5 -0
- package/src/Missions/GetAchievementMapRequest.ts +5 -0
- package/src/Missions/GetAchievementMapResponse.ts +8 -0
- package/src/Missions/ReloadAchievementsEvent.ts +5 -0
- package/src/Missions/UserAchievement.ts +25 -0
- package/src/Missions/UserAchievementTask.ts +17 -0
- package/src/Missions/index.ts +28 -0
- package/src/NodeCache.ts +45 -0
- package/src/OCache.ts +3 -2
- package/src/SmarticoAPI.ts +18 -4
- package/src/Store/BuyShopItemErrorCode.ts +10 -0
- package/src/Store/BuyShopItemRequest.ts +5 -0
- package/src/Store/BuyShopItemResponse.ts +6 -0
- package/src/Store/GetCategoriesShopResponse.ts +11 -0
- package/src/Store/GetShopItemsResponse.ts +7 -0
- package/src/Store/ShopCategory.ts +7 -0
- package/src/Store/ShopCategoryPublicMeta.ts +5 -0
- package/src/Store/ShopItem.ts +10 -0
- package/src/Store/ShopItemPublicMeta.ts +10 -0
- package/src/Store/ShopItemType.ts +5 -0
- package/src/Store/index.ts +25 -0
- package/src/index.ts +6 -1
package/dist/Base/ClassId.d.ts
CHANGED
|
@@ -1,14 +1,60 @@
|
|
|
1
1
|
export declare enum ClassId {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
INIT = 3,
|
|
3
|
+
INIT_RESPONSE = 4,
|
|
4
4
|
IDENTIFY = 5,
|
|
5
5
|
IDENTIFY_RESPONSE = 6,
|
|
6
|
+
LOGIN = 7,
|
|
7
|
+
LOGOUT = 8,
|
|
6
8
|
EVENT = 9,
|
|
7
9
|
EVENT_RESPONSE = 10,
|
|
10
|
+
LOGIN_RESPONSE = 11,
|
|
11
|
+
LOGOUT_RESPONSE = 12,
|
|
8
12
|
GET_TRANSLATIONS_REQUEST = 13,
|
|
9
13
|
GET_TRANSLATIONS_RESPONSE = 14,
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
CLIENT_ENGAGEMENT_IMPRESSION_REQUEST = 103,
|
|
15
|
+
CLIENT_ENGAGEMENT_ACTION_REQUEST = 104,
|
|
16
|
+
CLIENT_EXECUTE_DEEPLINK_EVENT = 105,
|
|
17
|
+
CLIENT_ENGAGEMENT_FAILED_REQUEST = 106,
|
|
18
|
+
CLIENT_EXECUTE_JS_EVENT = 107,
|
|
19
|
+
CLIENT_PUBLIC_PROPERTIES_CHANGED_EVENT = 108,
|
|
20
|
+
CLIENT_ENGAGEMENT_EVENT_NEW = 110,
|
|
21
|
+
CLIENT_SET_AVATAR_REQUEST = 157,
|
|
22
|
+
CLIENT_SET_AVATAR_RESPONSE = 158,
|
|
23
|
+
CLIENT_SET_CUSTOM_USERNAME_REQUEST = 159,
|
|
24
|
+
CLIENT_SET_CUSTOM_USERNAME_RESPONSE = 160,
|
|
25
|
+
GET_LEVEL_MAP_REQUEST = 500,
|
|
26
|
+
GET_LEVEL_MAP_RESPONSE = 501,
|
|
27
|
+
GET_ACHIEVEMENT_MAP_REQUEST = 502,
|
|
28
|
+
GET_ACHIEVEMENT_MAP_RESPONSE = 503,
|
|
29
|
+
RELOAD_ACHIEVEMENTS_EVENT = 504,
|
|
30
|
+
GET_LEADERS_BOARD_REQUEST = 505,
|
|
31
|
+
GET_LEADERS_BOARD_RESPONSE = 506,
|
|
32
|
+
GET_ACTIVITY_LOG_REQUEST = 507,
|
|
33
|
+
GET_ACTIVITY_LOG_RESPONSE = 508,
|
|
34
|
+
GET_SHOP_ITEMS_REQUEST = 509,
|
|
35
|
+
GET_SHOP_ITEMS_RESPONSE = 510,
|
|
36
|
+
BUY_SHOP_ITEM_REQUEST = 511,
|
|
37
|
+
BUY_SHOP_ITEM_RESPONSE = 512,
|
|
38
|
+
GET_INBOX_MESSAGES_REQUEST = 513,
|
|
39
|
+
GET_INBOX_MESSAGES_RESPONSE = 514,
|
|
40
|
+
GET_SHOP_CATEGORIES_REQUEST = 515,
|
|
41
|
+
GET_SHOP_CATEGORIES_RESPONSE = 516,
|
|
42
|
+
GET_TOURNAMENT_LOBBY_REQUEST = 517,
|
|
43
|
+
GET_TOURNAMENT_LOBBY_RESPONSE = 518,
|
|
44
|
+
GET_TOURNAMENT_INFO_REQUEST = 519,
|
|
45
|
+
GET_TOURNAMENT_INFO_RESPONSE = 520,
|
|
46
|
+
TOURNAMENT_REGISTER_REQUEST = 521,
|
|
47
|
+
TOURNAMENT_REGISTER_RESPONSE = 522,
|
|
48
|
+
GET_CUSTOM_SECTIONS_REQUEST = 523,
|
|
49
|
+
GET_CUSTOM_SECTIONS_RESPONSE = 524,
|
|
50
|
+
MISSION_OPTIN_REQUEST = 525,
|
|
51
|
+
MISSION_OPTIN_RESPONSE = 526,
|
|
52
|
+
GET_ACHIEVEMENT_USER_REQUEST = 527,
|
|
53
|
+
GET_ACHIEVEMENT_USER_RESPONSE = 528,
|
|
54
|
+
GET_BONUSES_REQUEST = 600,
|
|
55
|
+
GET_BONUSES_RESPONSE = 601,
|
|
56
|
+
CLAIM_BONUS_REQUEST = 602,
|
|
57
|
+
CLAIM_BONUS_RESPONSE = 603,
|
|
12
58
|
SAW_GET_SPINS_REQUEST = 700,
|
|
13
59
|
SAW_GET_SPINS_RESPONSE = 701,
|
|
14
60
|
SAW_DO_SPIN_REQUEST = 702,
|
|
@@ -17,5 +63,8 @@ export declare enum ClassId {
|
|
|
17
63
|
SAW_AKNOWLEDGE_RESPONSE = 705,
|
|
18
64
|
SAW_SPINS_COUNT_PUSH = 706,
|
|
19
65
|
SAW_SHOW_SPIN_PUSH = 707,
|
|
66
|
+
REGISTER_PUSH_NOTIFICATIONS_TOKEN_REQ = 1003,
|
|
67
|
+
REGISTER_PUSH_NOTIFICATIONS_TOKEN_RESP = 2003,
|
|
68
|
+
CLIENT_DEBUG_REQUEST = 77777,
|
|
20
69
|
UNSUPPORTED_COMMAND = 99999
|
|
21
70
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { InboxMessageType } from "./InboxMessageType";
|
|
2
|
+
export interface InboxMessage {
|
|
3
|
+
createDate: string;
|
|
4
|
+
body: {
|
|
5
|
+
action: string;
|
|
6
|
+
body: string;
|
|
7
|
+
type: InboxMessageType;
|
|
8
|
+
image: string;
|
|
9
|
+
title: string;
|
|
10
|
+
html_body: string;
|
|
11
|
+
};
|
|
12
|
+
engagement_uuid: string;
|
|
13
|
+
ff: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { GetInboxMessagesRequest } from "./GetInboxMessagesRequest";
|
|
2
|
+
import { GetInboxMessagesResponse } from "./GetInboxMessagesResponse";
|
|
3
|
+
import { InboxMessage } from "./InboxMessage";
|
|
4
|
+
import { InboxMessageType } from "./InboxMessageType";
|
|
5
|
+
export { InboxMessage, InboxMessageType, GetInboxMessagesRequest, GetInboxMessagesResponse, };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ProtocolMessage } from "../Base/ProtocolMessage";
|
|
2
|
+
import { LeaderBoardPeriodType } from "./LeaderBoardPeriodType";
|
|
3
|
+
export interface GetLeaderBoardsRequest extends ProtocolMessage {
|
|
4
|
+
period_type_id?: LeaderBoardPeriodType;
|
|
5
|
+
snapshot_offset?: number;
|
|
6
|
+
include_users?: boolean;
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LeaderBoardPeriodType } from "./LeaderBoardPeriodType";
|
|
2
|
+
import { LeaderBoardPosition } from "./LeaderBoardPosition";
|
|
3
|
+
import { LeaderBoardPublicMeta } from "./LeaderBoardPublicMeta";
|
|
4
|
+
export interface LeaderBoardDetails {
|
|
5
|
+
board_id: number;
|
|
6
|
+
period_type_id: LeaderBoardPeriodType;
|
|
7
|
+
create_date?: number;
|
|
8
|
+
versiod_id: number;
|
|
9
|
+
reward_points: number[];
|
|
10
|
+
board_public_meta: LeaderBoardPublicMeta;
|
|
11
|
+
positions: LeaderBoardPosition[];
|
|
12
|
+
userPosition: LeaderBoardPosition;
|
|
13
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
export { GetLeaderBoardsRequest, GetLeaderBoardsResponse, LeaderBoardDetails, LeaderBoardPeriodType, LeaderBoardPosition, LeaderBoardPublicMeta, };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface AchievementPublicMeta {
|
|
2
|
+
description?: string;
|
|
3
|
+
unlock_mission_description?: string;
|
|
4
|
+
cta_text?: string;
|
|
5
|
+
cta_action?: string;
|
|
6
|
+
label_tag?: string;
|
|
7
|
+
reward?: string;
|
|
8
|
+
image_url?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
position?: number;
|
|
11
|
+
hide_tasks?: boolean;
|
|
12
|
+
hide_locked_mission?: boolean;
|
|
13
|
+
custom_section_id?: number;
|
|
14
|
+
only_in_custom_section?: boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AchievementPublicMeta } from "./AchievementPublicMeta";
|
|
2
|
+
import { AchievementStatus } from "./AchievementStatus";
|
|
3
|
+
import { AchievementType } from "./AchievementType";
|
|
4
|
+
import { UserAchievementTask } from "./UserAchievementTask";
|
|
5
|
+
export interface UserAchievement {
|
|
6
|
+
ach_id?: number;
|
|
7
|
+
ach_type_id?: AchievementType;
|
|
8
|
+
ach_public_meta?: AchievementPublicMeta;
|
|
9
|
+
isCompleted?: boolean;
|
|
10
|
+
isLocked?: boolean;
|
|
11
|
+
requiresOptin?: boolean;
|
|
12
|
+
isOptedIn?: boolean;
|
|
13
|
+
start_date?: string;
|
|
14
|
+
time_limit_ms?: number;
|
|
15
|
+
progress?: number;
|
|
16
|
+
complete_date?: string;
|
|
17
|
+
unlock_date?: string;
|
|
18
|
+
completed_tasks?: number;
|
|
19
|
+
achievementTasks?: UserAchievementTask[];
|
|
20
|
+
ach_status_id?: AchievementStatus;
|
|
21
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AchievementTaskPublicMeta } from "./AchievementTaskPublicMeta";
|
|
2
|
+
import { AchievementTaskType } from "./AchievementTaskType";
|
|
3
|
+
export interface UserAchievementTask {
|
|
4
|
+
task_id?: number;
|
|
5
|
+
task_public_meta?: AchievementTaskPublicMeta;
|
|
6
|
+
points_reward?: number;
|
|
7
|
+
task_type_id: AchievementTaskType;
|
|
8
|
+
isCompleted?: boolean;
|
|
9
|
+
userExecutedCount?: number;
|
|
10
|
+
userProgress?: number;
|
|
11
|
+
lastExecutionDate: string;
|
|
12
|
+
unlocked_by_mission_id?: number;
|
|
13
|
+
unlocked_by_level_id?: number;
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
export { AchievementOptinRequest, AchievementOptinResponse, AchievementPublicMeta, AchievementStatus, AchievementTaskPublicMeta, AchievementTaskType, AchievementType, GetAchievementMapRequest, GetAchievementMapResponse, ReloadAchievementsEvent, UserAchievement, UserAchievementTask, };
|
package/dist/SmarticoAPI.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { ILogger } from './ILogger';
|
|
|
5
5
|
import { SAWDoSpinResponse } from './MiniGames';
|
|
6
6
|
import { GetTranslationsResponse, ResponseIdentify, TranslationArea } from './Core';
|
|
7
7
|
import { GetLabelInfoResponse } from './Core/GetLabelInfoResponse';
|
|
8
|
+
import { GetInboxMessagesResponse } from './Inbox';
|
|
8
9
|
interface IOptions {
|
|
9
10
|
logger?: ILogger;
|
|
10
11
|
logCIDs?: ClassId[];
|
|
@@ -31,5 +32,6 @@ declare class SmarticoAPI {
|
|
|
31
32
|
sawGetTemplates(user_ext_id: string): Promise<SAWGetTemplatesResponse>;
|
|
32
33
|
sawFormatTemplatesForWidget(templates: SAWTemplate[], pointsBalance: number): Promise<any[]>;
|
|
33
34
|
sawSpinRequest(user_ext_id: string, saw_template_id: number, round_id: number): Promise<SAWDoSpinResponse>;
|
|
35
|
+
inboxGetMessages(user_ext_id: string, limit?: number, offset?: number): Promise<GetInboxMessagesResponse>;
|
|
34
36
|
}
|
|
35
37
|
export { SmarticoAPI };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare 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,
|
|
6
|
+
SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION = 11003,
|
|
7
|
+
SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION_PURSHASE = 11004,
|
|
8
|
+
SHOP_FAILED_TO_BUY_MATCHING_BONUS = 11005,
|
|
9
|
+
SHOP_FAILED_MAX_BOUGHT_ITEMS_REACHED = 11006
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ShopItemPublicMeta } from "./ShopItemPublicMeta";
|
|
2
|
+
import { ShopItemType } from "./ShopItemType";
|
|
3
|
+
export interface ShopItem {
|
|
4
|
+
id: number;
|
|
5
|
+
itemTypeId: ShopItemType;
|
|
6
|
+
itemPublicMeta: ShopItemPublicMeta;
|
|
7
|
+
categoryIds?: number[];
|
|
8
|
+
canBuy?: boolean;
|
|
9
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
export { BuyShopItemErrorCode, BuyShopItemRequest, BuyShopItemResponse, GetCategoriesShopResponse, GetShopItemsResponse, ShopCategory, ShopCategoryPublicMeta, ShopItem, ShopItemPublicMeta, ShopItemType, };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { ClassId } from './Base/ClassId';
|
|
2
2
|
import { ILogger } from './ILogger';
|
|
3
3
|
import { SmarticoAPI } from './SmarticoAPI';
|
|
4
|
-
export * from './MiniGames';
|
|
5
4
|
export * from './Core';
|
|
5
|
+
export * from './Inbox';
|
|
6
|
+
export * from './Leaderboard';
|
|
7
|
+
export * from './MiniGames';
|
|
8
|
+
export * from './Missions';
|
|
9
|
+
export * from './Store';
|
|
6
10
|
export { SmarticoAPI, ClassId, ILogger };
|