@smartico/public-api 0.0.379 → 0.0.380
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/.nvmrc +1 -1
- package/README.md +31 -2
- package/dist/Store/BuyStoreItemErrorCode.d.ts +9 -1
- package/dist/Tournaments/TournamentRegistrationError.d.ts +3 -1
- package/dist/WSAPI/WSAPI.d.ts +13 -1235
- package/dist/WSAPI/WSAPIAvatars.d.ts +78 -0
- package/dist/WSAPI/WSAPIBase.d.ts +71 -0
- package/dist/WSAPI/WSAPIBonuses.d.ts +26 -0
- package/dist/WSAPI/WSAPIClans.d.ts +388 -0
- package/dist/WSAPI/WSAPIGamePick.d.ts +308 -0
- package/dist/WSAPI/WSAPIGeneral.d.ts +30 -0
- package/dist/WSAPI/WSAPIInbox.d.ts +126 -0
- package/dist/WSAPI/WSAPIJackpots.d.ts +109 -0
- package/dist/WSAPI/WSAPILeaderBoard.d.ts +25 -0
- package/dist/WSAPI/WSAPIMiniGames.d.ts +94 -0
- package/dist/WSAPI/WSAPIMissions.d.ts +517 -0
- package/dist/WSAPI/WSAPIRaffles.d.ts +119 -0
- package/dist/WSAPI/WSAPIStore.d.ts +656 -0
- package/dist/WSAPI/WSAPITournaments.d.ts +501 -0
- package/dist/WSAPI/WSAPITypes.d.ts +145 -85
- package/dist/WSAPI/WSAPIUser.d.ts +383 -0
- package/dist/index.js +3818 -1528
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +3180 -981
- package/dist/index.modern.mjs.map +1 -1
- package/docs/api/README.md +56 -2
- package/docs/api/classes/WSAPIAvatars.md +116 -0
- package/docs/api/classes/WSAPIBonuses.md +50 -0
- package/docs/api/classes/WSAPIClans.md +66 -0
- package/docs/api/classes/WSAPIGamePick.md +181 -0
- package/docs/api/classes/WSAPIGeneral.md +63 -0
- package/docs/api/classes/WSAPIInbox.md +277 -0
- package/docs/api/classes/WSAPIJackpots.md +185 -0
- package/docs/api/classes/WSAPILeaderBoard.md +39 -0
- package/docs/api/classes/WSAPIMiniGames.md +175 -0
- package/docs/api/classes/WSAPIMissions.md +611 -0
- package/docs/api/classes/WSAPIRaffles.md +195 -0
- package/docs/api/classes/WSAPIStore.md +744 -0
- package/docs/api/classes/WSAPITournaments.md +104 -0
- package/docs/api/classes/WSAPIUser.md +200 -0
- package/docs/api/enumerations/AchievementClaimPeriodTypeId.md +13 -0
- package/docs/api/enumerations/BuyStoreItemErrorCode.md +32 -0
- package/docs/api/interfaces/ClanPrizePublicMeta.md +41 -0
- package/docs/api/interfaces/ClanPrizeStructureEntry.md +7 -1
- package/docs/api/interfaces/ClanPublicMeta.md +4 -0
- package/docs/api/interfaces/SAWTemplateUI.md +10 -0
- package/docs/api/interfaces/TAchCategory.md +19 -4
- package/docs/api/interfaces/TBuyStoreItemResult.md +26 -8
- package/docs/api/interfaces/TMissionClaimRewardResult.md +14 -3
- package/docs/api/interfaces/TMissionOptInResult.md +10 -3
- package/docs/api/interfaces/TMissionOrBadge.md +6 -2
- package/docs/api/interfaces/TStoreItem.md +21 -1
- package/docs/api/interfaces/TTournamentDetailed.md +8 -0
- package/docs/api/interfaces/UserAchievement.md +1 -1
- package/docs/ui/clans/UIGuide_getClanInfo.md +153 -0
- package/docs/ui/clans/UIGuide_getClans.md +172 -0
- package/docs/ui/clans/UIGuide_joinClan.md +196 -0
- package/docs/ui/missions/UIGuide_getAchCategories.md +17 -0
- package/docs/ui/missions/UIGuide_getBadges.md +237 -0
- package/docs/ui/missions/UIGuide_getMissions.md +268 -0
- package/docs/ui/missions/UIGuide_requestMissionClaimReward.md +21 -0
- package/docs/ui/missions/UIGuide_requestMissionOptIn.md +16 -0
- package/docs/ui/store/UIGuide_buyStoreItem.md +133 -0
- package/docs/ui/store/UIGuide_getStoreCategories.md +19 -0
- package/docs/ui/store/UIGuide_getStoreItems.md +264 -0
- package/docs/ui/store/UIGuide_getStorePurchasedItems.md +122 -0
- package/docs/ui/tournaments/UIGuide_getClanTournamentPlayers.md +140 -0
- package/docs/ui/tournaments/UIGuide_getTournamentInstanceInfo.md +265 -0
- package/docs/ui/tournaments/UIGuide_getTournamentsList.md +236 -0
- package/docs/ui/tournaments/UIGuide_registerInTournament.md +156 -0
- package/docs/ui/user/UIGuide_getLevels.md +162 -0
- package/docs/ui/user/UIGuide_getUserProfile.md +213 -0
- package/package.json +3 -3
- package/scripts/postdoc-cleanup.js +195 -0
- package/src/Missions/MissionsUtils.ts +5 -2
- package/src/Store/BuyStoreItemErrorCode.ts +8 -0
- package/src/Store/StoreItem.ts +1 -0
- package/src/Store/StoreItemPurchased.ts +1 -0
- package/src/Store/StoreItemType.ts +1 -1
- package/src/Tournaments/TournamentRegistrationError.ts +4 -0
- package/src/WSAPI/WSAPI.ts +27 -2007
- package/src/WSAPI/WSAPIAvatars.ts +127 -0
- package/src/WSAPI/WSAPIBase.ts +93 -0
- package/src/WSAPI/WSAPIBonuses.ts +54 -0
- package/src/WSAPI/WSAPIClans.ts +417 -0
- package/src/WSAPI/WSAPIGamePick.ts +382 -0
- package/src/WSAPI/WSAPIGeneral.ts +57 -0
- package/src/WSAPI/WSAPIInbox.ts +222 -0
- package/src/WSAPI/WSAPIJackpots.ts +212 -0
- package/src/WSAPI/WSAPILeaderBoard.ts +40 -0
- package/src/WSAPI/WSAPIMiniGames.ts +181 -0
- package/src/WSAPI/WSAPIMissions.ts +572 -0
- package/src/WSAPI/WSAPIRaffles.ts +175 -0
- package/src/WSAPI/WSAPIStore.ts +732 -0
- package/src/WSAPI/WSAPITournaments.ts +541 -0
- package/src/WSAPI/WSAPITypes.ts +145 -87
- package/src/WSAPI/WSAPIUser.ts +456 -0
- package/tsconfig.json +17 -1
- package/docs/api/classes/WSAPI.md +0 -1927
package/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
v22.22.0
|
package/README.md
CHANGED
|
@@ -38,7 +38,36 @@ _smartico.api.getMiniGames( { onUpdate: miniGamesUpdates} ).then( games => {
|
|
|
38
38
|
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
## API reference
|
|
42
|
+
|
|
43
|
+
The SDK surface is split across one class per feature area, joined by an internal inheritance chain. Consumers always call `_smartico.api.<methodName>(...)` — the chain is an implementation detail; never import the domain classes directly.
|
|
44
|
+
|
|
45
|
+
| Domain | Reference | Methods | UI Guides |
|
|
46
|
+
|---|---|---|---|
|
|
47
|
+
| **User / Profile / Levels** | [`WSAPIUser`](docs/api/classes/WSAPIUser.md) | `getUserProfile`, `checkSegmentMatch`, `checkSegmentListMatch`, `getLevels`, `getCurrentLevel`, `getUserLevelExtraCounters`, `getActivityLog` | [`getUserProfile`](docs/ui/user/UIGuide_getUserProfile.md) · [`getLevels`](docs/ui/user/UIGuide_getLevels.md) |
|
|
48
|
+
| **General / Utility** | [`WSAPIGeneral`](docs/api/classes/WSAPIGeneral.md) | `getCustomSections`, `getTranslations`, `getRelatedItemsForGame` | — |
|
|
49
|
+
| **Missions & Badges** | [`WSAPIMissions`](docs/api/classes/WSAPIMissions.md) | `getMissions`, `getBadges`, `getAchCategories`, `requestMissionOptIn`, `requestMissionClaimReward` | [`getMissions`](docs/ui/missions/UIGuide_getMissions.md) · [`getBadges`](docs/ui/missions/UIGuide_getBadges.md) · [`getAchCategories`](docs/ui/missions/UIGuide_getAchCategories.md) · [`requestMissionOptIn`](docs/ui/missions/UIGuide_requestMissionOptIn.md) · [`requestMissionClaimReward`](docs/ui/missions/UIGuide_requestMissionClaimReward.md) |
|
|
50
|
+
| **Bonuses** | [`WSAPIBonuses`](docs/api/classes/WSAPIBonuses.md) | `getBonuses`, `claimBonus` | — |
|
|
51
|
+
| **Store / Shop** | [`WSAPIStore`](docs/api/classes/WSAPIStore.md) | `getStoreItems`, `buyStoreItem`, `getStoreCategories`, `getStorePurchasedItems` | [`getStoreItems`](docs/ui/store/UIGuide_getStoreItems.md) · [`buyStoreItem`](docs/ui/store/UIGuide_buyStoreItem.md) · [`getStoreCategories`](docs/ui/store/UIGuide_getStoreCategories.md) · [`getStorePurchasedItems`](docs/ui/store/UIGuide_getStorePurchasedItems.md) |
|
|
52
|
+
| **Tournaments** | [`WSAPITournaments`](docs/api/classes/WSAPITournaments.md) | `getTournamentsList`, `getTournamentInstanceInfo`, `registerInTournament`, `getClanTournamentPlayers` | [`getTournamentsList`](docs/ui/tournaments/UIGuide_getTournamentsList.md) · [`getTournamentInstanceInfo`](docs/ui/tournaments/UIGuide_getTournamentInstanceInfo.md) · [`registerInTournament`](docs/ui/tournaments/UIGuide_registerInTournament.md) · [`getClanTournamentPlayers`](docs/ui/tournaments/UIGuide_getClanTournamentPlayers.md) |
|
|
53
|
+
| **Clans** | [`WSAPIClans`](docs/api/classes/WSAPIClans.md) | `getClans`, `getClanInfo`, `joinClan` | [`getClans`](docs/ui/clans/UIGuide_getClans.md) · [`getClanInfo`](docs/ui/clans/UIGuide_getClanInfo.md) · [`joinClan`](docs/ui/clans/UIGuide_joinClan.md) |
|
|
54
|
+
| **Jackpots** | [`WSAPIJackpots`](docs/api/classes/WSAPIJackpots.md) | `jackpotGet`, `jackpotOptIn`, `jackpotOptOut`, `getJackpotWinners`, `getJackpotEligibleGames` | — |
|
|
55
|
+
| **Raffles / Draws** | [`WSAPIRaffles`](docs/api/classes/WSAPIRaffles.md) | `getRaffles`, `getRaffleDrawRun`, `getRaffleDrawRunsHistory`, `claimRafflePrize`, `requestRaffleOptin` | — |
|
|
56
|
+
| **MiniGames / SAW** | [`WSAPIMiniGames`](docs/api/classes/WSAPIMiniGames.md) | `getMiniGames`, `getMiniGamesHistory`, `playMiniGame`, `miniGameWinAcknowledgeRequest`, `playMiniGameBatch` | — |
|
|
57
|
+
| **Avatars** | [`WSAPIAvatars`](docs/api/classes/WSAPIAvatars.md) | `getAvatarsList`, `getAvatarsCustomized`, `getAvatarPrompts`, `setAvatar` | — |
|
|
58
|
+
| **Game Pick (sports / quiz)** | [`WSAPIGamePick`](docs/api/classes/WSAPIGamePick.md) | `gamePickGet*`, `gamePickSubmit*` (9 methods) | — |
|
|
59
|
+
| **Leaderboard** | [`WSAPILeaderBoard`](docs/api/classes/WSAPILeaderBoard.md) | `getLeaderBoard` | — |
|
|
60
|
+
| **Inbox / Messages / Engagement** | [`WSAPIInbox`](docs/api/classes/WSAPIInbox.md) | `getInboxMessages`, `getInboxUnreadCount`, `getInboxMessageBody`, `markInboxMessageAsRead`, `markAllInboxMessagesAsRead`, `markUnmarkInboxMessageAsFavorite`, `deleteInboxMessage`, `deleteAllInboxMessages`, `reportImpressionEvent`, `reportClickEvent` | — |
|
|
61
|
+
|
|
62
|
+
The shared return / param types live in [`WSAPITypes`](docs/api/classes/WSAPITypes.md). For the full type / enum / interface listing, see [`docs/api/globals.md`](docs/api/globals.md).
|
|
63
|
+
|
|
64
|
+
### Where to look for working examples
|
|
65
|
+
|
|
66
|
+
The class reference pages above describe **API behavior** — preconditions, error codes, refresh semantics, cache, idempotency, side effects, visitor mode. They do not include long-form UI prescriptions.
|
|
67
|
+
|
|
68
|
+
For runnable, copy-pasteable widget code, the canonical reference is [**expo.smartico.ai**](https://expo.smartico.ai/widgets/intro). Each widget there is a complete React component built against this SDK — read it, fork it, adapt it. The expo site is where to start when you're building a new widget from scratch.
|
|
69
|
+
|
|
70
|
+
The "UI Guides" column in the table above links to per-method prescriptive guidance for the most heavily-used flows (Missions, Store) — list bucketing, card and detail layouts, action-button decision matrices, image specs, status-specific visual treatments, animations. Use these alongside the expo examples when you need finer guidance on edge cases (locked / missed / recurring missions, multi-currency store items, claim-window expiration, etc.). More UI guides will be added per domain over time.
|
|
42
71
|
|
|
43
72
|
See [expo.smartico.ai](https://expo.smartico.ai/widgets/intro) for the open-source examples of using the API as React-based components. Available examples:
|
|
44
73
|
|
|
@@ -151,7 +180,7 @@ const optInResult = await api.requestMissionOptIn(missions[0].id);
|
|
|
151
180
|
console.log('Opt-in:', optInResult.err_code);
|
|
152
181
|
```
|
|
153
182
|
|
|
154
|
-
For the full list of available methods, see the [
|
|
183
|
+
For the full list of available methods, see the [API reference](#api-reference) section above.
|
|
155
184
|
|
|
156
185
|
You can also use `SmarticoAPI` directly for low-level protocol access:
|
|
157
186
|
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export declare enum BuyStoreItemErrorCode {
|
|
2
|
+
/** Generic server error / control-group rejection */
|
|
3
|
+
SHOP_FAILED_GENERIC = 1,
|
|
4
|
+
/** Label mismatch detected before purchase transaction */
|
|
5
|
+
SHOP_WRONG_LABEL_PRECHECK = 106,
|
|
2
6
|
/** User don't have enough points on balance */
|
|
3
7
|
SHOP_NO_BALANCE = 11000,
|
|
4
8
|
/** Wrong shop item id */
|
|
@@ -13,6 +17,8 @@ export declare enum BuyStoreItemErrorCode {
|
|
|
13
17
|
SHOP_FAILED_TO_BUY_MATCHING_BONUS = 11005,
|
|
14
18
|
/** Failed to buy item because of limit of max items is reached */
|
|
15
19
|
SHOP_FAILED_MAX_BOUGHT_ITEMS_REACHED = 11006,
|
|
20
|
+
/** Bonus was issued but a follow-up redemption step failed */
|
|
21
|
+
SHOP_FAILED_BONUS_REDEMPTION = 11007,
|
|
16
22
|
/** Failed to buy item because no more items are available */
|
|
17
23
|
SHOP_FAILED_POOL_EMPTY = 11009,
|
|
18
24
|
/** User doesn't have enough gems on balance */
|
|
@@ -20,5 +26,7 @@ export declare enum BuyStoreItemErrorCode {
|
|
|
20
26
|
/** User doesn't have enough diamonds on balance */
|
|
21
27
|
SHOP_NO_BALANCE_DIAMONDS = 11012,
|
|
22
28
|
/** Failed to buy item because of purchase limitation */
|
|
23
|
-
SHOP_FAILED_PURCHASE_LIMITATION = 11014
|
|
29
|
+
SHOP_FAILED_PURCHASE_LIMITATION = 11014,
|
|
30
|
+
/** Uncaught server exception */
|
|
31
|
+
SHOP_UNEXPECTED_EXCEPTION = 9999
|
|
24
32
|
}
|
|
@@ -8,5 +8,7 @@ export declare enum TournamentRegistrationError {
|
|
|
8
8
|
TOURNAMENT_USER_DONT_MATCH_CONDITIONS = 30005,
|
|
9
9
|
TOURNAMENT_USER_NOT_REGISTERED = 30006,
|
|
10
10
|
TOURNAMENT_CANT_CHANGE_REGISTRATION_STATUS = 30007,
|
|
11
|
-
TOURNAMENT_MAX_REGISTRATIONS_REACHED = 30008
|
|
11
|
+
TOURNAMENT_MAX_REGISTRATIONS_REACHED = 30008,
|
|
12
|
+
TOURNAMENT_REGISTRATION_NOT_ENOUGH_GEMS = 30010,
|
|
13
|
+
TOURNAMENT_REGISTRATION_NOT_ENOUGH_DIAMONDS = 30011
|
|
12
14
|
}
|