@smartico/public-api 0.0.6 → 0.0.8
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/README.md +2 -3
- package/dist/Base/ClassId.d.ts +1 -0
- package/dist/Inbox/InboxMessage.d.ts +2 -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/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 +4 -1
- package/dist/index.js +48 -0
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +49 -1
- package/dist/index.modern.mjs.map +1 -1
- package/package.json +1 -1
- package/src/Base/ClassId.ts +4 -1
- package/src/Inbox/InboxMessage.ts +2 -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/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 +5 -1
package/README.md
CHANGED
|
@@ -46,9 +46,8 @@ npm unlink
|
|
|
46
46
|
|
|
47
47
|
Consumer project console:
|
|
48
48
|
```bash
|
|
49
|
-
npm link @smartico/public-api
|
|
49
|
+
npm link @smartico/public-api --legacy-peer-deps
|
|
50
50
|
|
|
51
51
|
# when you are done
|
|
52
|
-
npm unlink npm
|
|
53
|
-
npm install npm link @smartico/public-api
|
|
52
|
+
npm unlink @smartico/public-api --legacy-peer-deps && npm install @smartico/public-api --legacy-peer-deps
|
|
54
53
|
```
|
package/dist/Base/ClassId.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export declare enum ClassId {
|
|
|
18
18
|
CLIENT_EXECUTE_JS_EVENT = 107,
|
|
19
19
|
CLIENT_PUBLIC_PROPERTIES_CHANGED_EVENT = 108,
|
|
20
20
|
CLIENT_ENGAGEMENT_EVENT_NEW = 110,
|
|
21
|
+
CLIENT_TRACK_ACTIVITY_REQUEST = 155,
|
|
21
22
|
CLIENT_SET_AVATAR_REQUEST = 157,
|
|
22
23
|
CLIENT_SET_AVATAR_RESPONSE = 158,
|
|
23
24
|
CLIENT_SET_CUSTOM_USERNAME_REQUEST = 159,
|
|
@@ -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, };
|
|
@@ -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
|
@@ -2,6 +2,9 @@ import { ClassId } from './Base/ClassId';
|
|
|
2
2
|
import { ILogger } from './ILogger';
|
|
3
3
|
import { SmarticoAPI } from './SmarticoAPI';
|
|
4
4
|
export * from './Core';
|
|
5
|
-
export * from './MiniGames';
|
|
6
5
|
export * from './Inbox';
|
|
6
|
+
export * from './Leaderboard';
|
|
7
|
+
export * from './MiniGames';
|
|
8
|
+
export * from './Missions';
|
|
9
|
+
export * from './Store';
|
|
7
10
|
export { SmarticoAPI, ClassId, ILogger };
|
package/dist/index.js
CHANGED
|
@@ -41,6 +41,7 @@ exports.ClassId = void 0;
|
|
|
41
41
|
ClassId[ClassId["CLIENT_EXECUTE_JS_EVENT"] = 107] = "CLIENT_EXECUTE_JS_EVENT";
|
|
42
42
|
ClassId[ClassId["CLIENT_PUBLIC_PROPERTIES_CHANGED_EVENT"] = 108] = "CLIENT_PUBLIC_PROPERTIES_CHANGED_EVENT";
|
|
43
43
|
ClassId[ClassId["CLIENT_ENGAGEMENT_EVENT_NEW"] = 110] = "CLIENT_ENGAGEMENT_EVENT_NEW";
|
|
44
|
+
ClassId[ClassId["CLIENT_TRACK_ACTIVITY_REQUEST"] = 155] = "CLIENT_TRACK_ACTIVITY_REQUEST";
|
|
44
45
|
ClassId[ClassId["CLIENT_SET_AVATAR_REQUEST"] = 157] = "CLIENT_SET_AVATAR_REQUEST";
|
|
45
46
|
ClassId[ClassId["CLIENT_SET_AVATAR_RESPONSE"] = 158] = "CLIENT_SET_AVATAR_RESPONSE";
|
|
46
47
|
ClassId[ClassId["CLIENT_SET_CUSTOM_USERNAME_REQUEST"] = 159] = "CLIENT_SET_CUSTOM_USERNAME_REQUEST";
|
|
@@ -733,6 +734,53 @@ exports.InboxMessageType = void 0;
|
|
|
733
734
|
})(exports.InboxMessageType || (exports.InboxMessageType = {}));
|
|
734
735
|
// keep in sync with BO enum
|
|
735
736
|
|
|
737
|
+
exports.LeaderBoardPeriodType = void 0;
|
|
738
|
+
(function (LeaderBoardPeriodType) {
|
|
739
|
+
LeaderBoardPeriodType[LeaderBoardPeriodType["DAILY"] = 1] = "DAILY";
|
|
740
|
+
LeaderBoardPeriodType[LeaderBoardPeriodType["WEEKLY"] = 2] = "WEEKLY";
|
|
741
|
+
LeaderBoardPeriodType[LeaderBoardPeriodType["MONTHLY"] = 3] = "MONTHLY";
|
|
742
|
+
})(exports.LeaderBoardPeriodType || (exports.LeaderBoardPeriodType = {}));
|
|
743
|
+
|
|
744
|
+
exports.AchievementStatus = void 0;
|
|
745
|
+
(function (AchievementStatus) {
|
|
746
|
+
AchievementStatus[AchievementStatus["Draft"] = 1] = "Draft";
|
|
747
|
+
AchievementStatus[AchievementStatus["AvailableUnlocked"] = 2] = "AvailableUnlocked";
|
|
748
|
+
AchievementStatus[AchievementStatus["AvailableLocked"] = 3] = "AvailableLocked";
|
|
749
|
+
AchievementStatus[AchievementStatus["Archived"] = 4] = "Archived";
|
|
750
|
+
AchievementStatus[AchievementStatus["FeaturedManually"] = 5] = "FeaturedManually";
|
|
751
|
+
AchievementStatus[AchievementStatus["FeaturedAI"] = 6] = "FeaturedAI";
|
|
752
|
+
})(exports.AchievementStatus || (exports.AchievementStatus = {}));
|
|
753
|
+
|
|
754
|
+
exports.AchievementTaskType = void 0;
|
|
755
|
+
(function (AchievementTaskType) {
|
|
756
|
+
AchievementTaskType[AchievementTaskType["CompleteAchievement"] = 1] = "CompleteAchievement";
|
|
757
|
+
AchievementTaskType[AchievementTaskType["UnlockAchievement"] = 2] = "UnlockAchievement";
|
|
758
|
+
})(exports.AchievementTaskType || (exports.AchievementTaskType = {}));
|
|
759
|
+
|
|
760
|
+
exports.AchievementType = void 0;
|
|
761
|
+
(function (AchievementType) {
|
|
762
|
+
AchievementType[AchievementType["Mission"] = 1] = "Mission";
|
|
763
|
+
AchievementType[AchievementType["Badge"] = 2] = "Badge";
|
|
764
|
+
})(exports.AchievementType || (exports.AchievementType = {}));
|
|
765
|
+
|
|
766
|
+
exports.BuyShopItemErrorCode = void 0;
|
|
767
|
+
(function (BuyShopItemErrorCode) {
|
|
768
|
+
BuyShopItemErrorCode[BuyShopItemErrorCode["FAILED_TO_BUY_SHOP_ITEM"] = 121] = "FAILED_TO_BUY_SHOP_ITEM";
|
|
769
|
+
BuyShopItemErrorCode[BuyShopItemErrorCode["SHOP_NO_BALANCE"] = 11000] = "SHOP_NO_BALANCE";
|
|
770
|
+
BuyShopItemErrorCode[BuyShopItemErrorCode["SHOP_WRONG_LABEL"] = 11001] = "SHOP_WRONG_LABEL";
|
|
771
|
+
BuyShopItemErrorCode[BuyShopItemErrorCode["SHOP_FAILED_TO_BUY_BONUS"] = 11002] = "SHOP_FAILED_TO_BUY_BONUS";
|
|
772
|
+
BuyShopItemErrorCode[BuyShopItemErrorCode["SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION"] = 11003] = "SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION";
|
|
773
|
+
BuyShopItemErrorCode[BuyShopItemErrorCode["SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION_PURSHASE"] = 11004] = "SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION_PURSHASE";
|
|
774
|
+
BuyShopItemErrorCode[BuyShopItemErrorCode["SHOP_FAILED_TO_BUY_MATCHING_BONUS"] = 11005] = "SHOP_FAILED_TO_BUY_MATCHING_BONUS";
|
|
775
|
+
BuyShopItemErrorCode[BuyShopItemErrorCode["SHOP_FAILED_MAX_BOUGHT_ITEMS_REACHED"] = 11006] = "SHOP_FAILED_MAX_BOUGHT_ITEMS_REACHED";
|
|
776
|
+
})(exports.BuyShopItemErrorCode || (exports.BuyShopItemErrorCode = {}));
|
|
777
|
+
|
|
778
|
+
exports.ShopItemType = void 0;
|
|
779
|
+
(function (ShopItemType) {
|
|
780
|
+
ShopItemType[ShopItemType["Bonus"] = 1] = "Bonus";
|
|
781
|
+
ShopItemType[ShopItemType["Manual"] = 2] = "Manual";
|
|
782
|
+
})(exports.ShopItemType || (exports.ShopItemType = {}));
|
|
783
|
+
|
|
736
784
|
exports.SAWBuyInTypeName = SAWBuyInTypeName;
|
|
737
785
|
exports.SAWGameTypeName = SAWGameTypeName;
|
|
738
786
|
exports.SAWUtils = SAWUtils;
|