@smartico/public-api 0.0.420 → 0.0.422
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 +14 -0
- package/dist/ActivityLog/ActivityLogActivities.d.ts +1 -1
- package/dist/ActivityLog/ActivityLogEntry.d.ts +35 -17
- package/dist/ActivityLog/ActivityLogMeta.d.ts +31 -0
- package/dist/ActivityLog/GetActivityLogRequest.d.ts +2 -0
- package/dist/ActivityLog/GetActivityLogResponse.d.ts +1 -2
- package/dist/Jackpots/JackPotWinPushWinner.d.ts +34 -0
- package/dist/Jackpots/JackPotWinner.d.ts +3 -1
- package/dist/Jackpots/JackpotContributionRule.d.ts +23 -0
- package/dist/Jackpots/JackpotDetails.d.ts +8 -0
- package/dist/Jackpots/JackpotPot.d.ts +4 -2
- package/dist/Jackpots/JackpotPublicMeta.d.ts +6 -2
- package/dist/Jackpots/JackpotWinPush.d.ts +14 -2
- package/dist/Jackpots/index.d.ts +2 -0
- package/dist/SmarticoAPI.d.ts +1 -3
- package/dist/WSAPI/WSAPIBase.d.ts +0 -1
- package/dist/WSAPI/WSAPIJackpots.d.ts +2 -0
- package/dist/WSAPI/WSAPITypes.d.ts +19 -17
- package/dist/WSAPI/WSAPIUser.d.ts +11 -36
- package/dist/index.js +36 -128
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +34 -100
- package/dist/index.modern.mjs.map +1 -1
- package/docs/Callbacks.md +1 -1
- package/docs/api/README.md +4 -4
- package/docs/api/classes/WSAPIJackpots.md +2 -0
- package/docs/api/classes/WSAPIUser.md +30 -59
- package/docs/api/documents/Callbacks.md +1 -1
- package/docs/api/enumerations/ActivityLogActivities.md +1 -1
- package/docs/api/enumerations/PointChangeSourceType.md +6 -0
- package/docs/api/interfaces/ActivityLogEntry.md +124 -0
- package/docs/api/interfaces/ActivityLogMeta.md +100 -0
- package/docs/api/interfaces/JackPotWinPushWinner.md +103 -0
- package/docs/api/interfaces/JackPotWinner.md +9 -1
- package/docs/api/interfaces/JackpotContributionRule.md +49 -0
- package/docs/api/interfaces/JackpotDetails.md +24 -0
- package/docs/api/interfaces/JackpotPot.md +9 -1
- package/docs/api/interfaces/JackpotPublicMeta.md +12 -2
- package/docs/api/interfaces/JackpotWinPush.md +14 -1
- package/docs/api/interfaces/TActivityLog.md +70 -2
- package/docs/api/type-aliases/TActivityLogEntry.md +7 -0
- package/docs/capabilities/_responses/gamePickGetActiveRound.json +37 -37
- package/docs/capabilities/_responses/gamePickGetActiveRounds.json +37 -131
- package/docs/capabilities/_responses/gamePickGetBoard.json +25 -14
- package/docs/capabilities/_responses/gamePickGetGameInfo.json +93 -79
- package/docs/capabilities/_responses/gamePickGetHistory.json +37 -131
- package/docs/capabilities/_responses/gamePickGetUserInfo.json +5 -5
- package/docs/capabilities/_responses/getActivityLog.json +106 -1
- package/docs/capabilities/_responses/getAvatarsCustomized.json +4 -4
- package/docs/capabilities/_responses/getAvatarsList.json +2 -2
- package/docs/capabilities/_responses/getBadges.json +27 -29
- package/docs/capabilities/_responses/getBonuses.json +1 -18
- package/docs/capabilities/_responses/getClanInfo.json +13 -13
- package/docs/capabilities/_responses/getClans.json +6 -6
- package/docs/capabilities/_responses/getCurrentLevel.json +12 -12
- package/docs/capabilities/_responses/getInboxMessageBody.json +2 -2
- package/docs/capabilities/_responses/getInboxMessages.json +6 -6
- package/docs/capabilities/_responses/getInboxUnreadCount.json +1 -1
- package/docs/capabilities/_responses/getJackpotWinners.json +14 -14
- package/docs/capabilities/_responses/getLeaderBoard.json +8 -8
- package/docs/capabilities/_responses/getMiniGames.json +92 -90
- package/docs/capabilities/_responses/getMiniGamesHistory.json +874 -1
- package/docs/capabilities/_responses/getMissions.json +2 -2
- package/docs/capabilities/_responses/getRaffleDrawRun.json +7 -7
- package/docs/capabilities/_responses/getRaffleDrawRunsHistory.json +6 -6
- package/docs/capabilities/_responses/getRaffles.json +14 -14
- package/docs/capabilities/_responses/getStorePurchasedItems.json +5 -5
- package/docs/capabilities/_responses/getTournamentInstanceInfo.json +100 -53
- package/docs/capabilities/_responses/getTournamentsList.json +12 -12
- package/docs/capabilities/_responses/getTranslations.json +1 -1
- package/docs/capabilities/_responses/getUserProfile.json +10 -10
- package/docs/capabilities/_responses/jackpotGet.json +33 -34
- package/docs/capabilities/gamePickGetActiveRound.md +22 -23
- package/docs/capabilities/gamePickGetActiveRounds.md +22 -23
- package/docs/capabilities/gamePickGetBoard.md +14 -14
- package/docs/capabilities/gamePickGetGameInfo.md +24 -44
- package/docs/capabilities/gamePickGetHistory.md +22 -23
- package/docs/capabilities/gamePickGetUserInfo.md +5 -5
- package/docs/capabilities/getActivityLog.md +69 -9
- package/docs/capabilities/getAvatarsCustomized.md +3 -3
- package/docs/capabilities/getBadges.md +13 -14
- package/docs/capabilities/getBonuses.md +2 -17
- package/docs/capabilities/getClanInfo.md +8 -8
- package/docs/capabilities/getClans.md +4 -4
- package/docs/capabilities/getCurrentLevel.md +12 -12
- package/docs/capabilities/getInboxMessageBody.md +2 -2
- package/docs/capabilities/getInboxMessages.md +3 -3
- package/docs/capabilities/getInboxUnreadCount.md +6 -0
- package/docs/capabilities/getJackpotWinners.md +9 -8
- package/docs/capabilities/getLeaderBoard.md +5 -5
- package/docs/capabilities/getMiniGames.md +35 -37
- package/docs/capabilities/getMiniGamesHistory.md +83 -2
- package/docs/capabilities/getMissions.md +1 -1
- package/docs/capabilities/getRaffleDrawRun.md +7 -7
- package/docs/capabilities/getRaffleDrawRunsHistory.md +3 -3
- package/docs/capabilities/getRaffles.md +8 -8
- package/docs/capabilities/getStorePurchasedItems.md +2 -2
- package/docs/capabilities/getTournamentInstanceInfo.md +45 -37
- package/docs/capabilities/getTournamentsList.md +6 -6
- package/docs/capabilities/getTranslations.md +1 -1
- package/docs/capabilities/getUserProfile.md +10 -10
- package/docs/capabilities/jackpotGet.md +56 -28
- package/docs/capabilities/jackpotOptIn.md +2 -0
- package/docs/capabilities/smarticoCallbacks.md +1 -1
- package/docs/native/PROTOCOL.md +141 -18
- package/docs/ui/jackpots/UIGuide_jackpotGet.md +1 -1
- package/docs/ui/user/UIGuide_getActivityLog.md +4 -2
- package/package.json +4 -3
- package/scripts/capture-responses-browser.mjs +8 -1
- package/src/ActivityLog/ActivityLogActivities.ts +1 -1
- package/src/ActivityLog/ActivityLogEntry.ts +33 -21
- package/src/ActivityLog/ActivityLogMeta.ts +31 -0
- package/src/ActivityLog/GetActivityLogRequest.ts +2 -0
- package/src/ActivityLog/GetActivityLogResponse.ts +23 -49
- package/src/Jackpots/JackPotWinPushWinner.ts +35 -0
- package/src/Jackpots/JackPotWinner.ts +3 -1
- package/src/Jackpots/JackpotContributionRule.ts +25 -0
- package/src/Jackpots/JackpotDetails.ts +8 -0
- package/src/Jackpots/JackpotPot.ts +4 -2
- package/src/Jackpots/JackpotPublicMeta.ts +6 -2
- package/src/Jackpots/JackpotWinPush.ts +14 -2
- package/src/Jackpots/index.ts +2 -0
- package/src/MiniGames/SAWGetTemplatesResponse.ts +1 -0
- package/src/SmarticoAPI.ts +1 -44
- package/src/WSAPI/WSAPIBase.ts +0 -1
- package/src/WSAPI/WSAPIJackpots.ts +2 -0
- package/src/WSAPI/WSAPITypes.ts +20 -18
- package/src/WSAPI/WSAPIUser.ts +10 -53
- package/docs/api/interfaces/GemsDiamondsLog.md +0 -45
- package/docs/api/interfaces/PointsLog.md +0 -45
- package/docs/api/interfaces/TActivityLogEntry.md +0 -100
- package/docs/api/type-aliases/ActivityLogEntry.md +0 -3
- package/docs/capabilities/getActivityLogV2.md +0 -62
package/README.md
CHANGED
|
@@ -180,6 +180,17 @@ import { SmarticoAPI, WSAPI } from '@smartico/public-api';
|
|
|
180
180
|
|
|
181
181
|
// publicApiUrl is resolved automatically by SmarticoAPI from your label key
|
|
182
182
|
const messageSender = async (message: any, publicApiUrl?: string): Promise<any> => {
|
|
183
|
+
|
|
184
|
+
// if label has user hash protection enabled, calculate hash and add in the message, e.g.
|
|
185
|
+
const hashValidityTimestampMs = ~~(+new Date() / 1000) * 1000 + 24 * 3600 * 1000;
|
|
186
|
+
const userExtId = message.user_ext_id;
|
|
187
|
+
const saltKey = 'your_secret_salt_key_setup_on_smartico_side';
|
|
188
|
+
const hashValue = md5((userExtId + ':' + saltKey + ':' + hashValidityTimestampMs).toLowerCase()) +
|
|
189
|
+
':' +
|
|
190
|
+
hashValidityTimestampMs;
|
|
191
|
+
|
|
192
|
+
message.hash = hashValue;
|
|
193
|
+
|
|
183
194
|
const res = await fetch(publicApiUrl, {
|
|
184
195
|
method: 'POST',
|
|
185
196
|
headers: { 'Content-Type': 'application/json' },
|
|
@@ -229,6 +240,9 @@ You can make HTTP calls to the Smartico public endpoint to interact with user da
|
|
|
229
240
|
|
|
230
241
|
This example checks whether a user belongs to specific segments. It corresponds to `checkSegmentListMatch` (cid: 161 / response cid: 162) described in [Native Protocol](docs/native/PROTOCOL.md).
|
|
231
242
|
|
|
243
|
+
Note: in case your label has user hash protection enabled, you need to calculate it using secret salt key and pass it in the data under "hash" value.
|
|
244
|
+
Check for more details here - https://help.smartico.ai/welcome/technical-guides/front-end-integration/extended-integration#protecting-user-identification-on-the-public-front-end
|
|
245
|
+
|
|
232
246
|
**Request:**
|
|
233
247
|
|
|
234
248
|
```bash
|
|
@@ -1,23 +1,41 @@
|
|
|
1
|
+
import { ActivityLogActivities } from './ActivityLogActivities';
|
|
2
|
+
import { ActivityLogMeta } from './ActivityLogMeta';
|
|
1
3
|
import { PointChangeSourceType } from './PointChangeSourceType';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* One raw activity-log row as it arrives on the wire.
|
|
6
|
+
*
|
|
7
|
+
* JS consumers receive the friendlier {@link TActivityLog} instead — this is the
|
|
8
|
+
* pre-transform shape, documented for native clients that read the protocol directly.
|
|
9
|
+
*/
|
|
10
|
+
export interface ActivityLogEntry {
|
|
11
|
+
/** Creation time; `seconds` is the epoch value in SECONDS (not ms). */
|
|
12
|
+
create_date: {
|
|
13
|
+
seconds: number;
|
|
14
|
+
nanos?: number;
|
|
15
|
+
};
|
|
6
16
|
user_ext_id: string;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
17
|
+
/** Sent as a string on the wire. */
|
|
18
|
+
crm_brand_id: string;
|
|
19
|
+
/** Kind of activity this row records. */
|
|
20
|
+
type: ActivityLogActivities;
|
|
21
|
+
/** Sub-action within `type` (e.g. unlock vs complete, add vs deduct). */
|
|
22
|
+
ctx_1: number;
|
|
23
|
+
/** Extra display payload for the row; contents vary by `type`. */
|
|
24
|
+
ctx_meta?: ActivityLogMeta;
|
|
25
|
+
/** What triggered the change. */
|
|
11
26
|
source_type_id: PointChangeSourceType;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
crm_brand_id: number;
|
|
18
|
-
type: UserBalanceType;
|
|
27
|
+
/** More specific id within the source (e.g. level id, draw id, win id). */
|
|
28
|
+
source_ref_id: number;
|
|
29
|
+
/** Root / parent entity id when the source is nested. */
|
|
30
|
+
source_root_id: number;
|
|
31
|
+
/** Delta applied by this row, in the balance named by `type`. */
|
|
19
32
|
amount: number;
|
|
33
|
+
/** Balance after this row, in the balance named by `type`. */
|
|
20
34
|
balance: number;
|
|
21
|
-
|
|
35
|
+
/** Points balance after this row; points rows only. */
|
|
36
|
+
user_points_balance?: number;
|
|
37
|
+
/** Total points ever collected after this row; points rows only. */
|
|
38
|
+
user_points_ever?: number;
|
|
39
|
+
/** Placeholder on points rows (`-1`) — read `amount` for the real delta. */
|
|
40
|
+
points_collected?: number;
|
|
22
41
|
}
|
|
23
|
-
export type ActivityLogEntry = PointsLog | GemsDiamondsLog;
|
|
@@ -1,8 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extra display payload attached to an activity-log row (`ctx_meta` on the wire).
|
|
3
|
+
* Which keys are present depends on the row's activity type — treat every field
|
|
4
|
+
* as optional and render only what is there.
|
|
5
|
+
*/
|
|
1
6
|
export interface ActivityLogMeta {
|
|
7
|
+
/** Display name of the source entity (mission, tournament, raffle, …). */
|
|
2
8
|
name?: string;
|
|
3
9
|
image_url?: string;
|
|
4
10
|
position?: number;
|
|
11
|
+
/** Points balance before this row; points rows. */
|
|
5
12
|
user_points_balance_before?: number;
|
|
13
|
+
/** Points the awarding rule asked for; points rows. */
|
|
6
14
|
points_requested?: number;
|
|
15
|
+
/** Total points ever collected after this row; points rows. */
|
|
7
16
|
user_points_ever?: number;
|
|
17
|
+
/** Gems / diamonds the awarding rule asked for; gems / diamonds rows. */
|
|
18
|
+
amount_requested?: number;
|
|
19
|
+
/** Gems / diamonds balance before this row. */
|
|
20
|
+
balance_before?: number;
|
|
21
|
+
/** Whether this row counts toward level progress. */
|
|
22
|
+
affects_level?: boolean;
|
|
23
|
+
/** Whether this row counts toward leaderboards. */
|
|
24
|
+
affects_leaderboard?: boolean;
|
|
25
|
+
/** Whether this row moved the spendable balance. */
|
|
26
|
+
affects_current_balance?: boolean;
|
|
27
|
+
/** Set on the row that seeds a brand-new user's wallet. */
|
|
28
|
+
user_initialization?: boolean;
|
|
29
|
+
/** Set on mission rows for repeatable missions. */
|
|
30
|
+
is_recurring?: boolean;
|
|
31
|
+
/** Level moved from; level-change rows. */
|
|
32
|
+
from_level_id?: number;
|
|
33
|
+
/** Level moved to; level-change rows. */
|
|
34
|
+
to_level_id?: number;
|
|
35
|
+
/** Public meta of the level moved from; level-change rows. */
|
|
36
|
+
from_level_public_meta?: any;
|
|
37
|
+
/** Public meta of the level moved to; level-change rows. */
|
|
38
|
+
to_level_public_meta?: any;
|
|
8
39
|
}
|
|
@@ -5,6 +5,8 @@ export interface GetActivityLogRequest extends ProtocolMessage {
|
|
|
5
5
|
endTimeSeconds: number;
|
|
6
6
|
limit: number;
|
|
7
7
|
offset: number;
|
|
8
|
+
/** Optional filter — {@link ActivityLogActivities} values to include. */
|
|
8
9
|
types?: number[];
|
|
10
|
+
/** Optional filter — {@link PointChangeSourceType} values to include. */
|
|
9
11
|
src_types?: number[];
|
|
10
12
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { ProtocolResponse } from '../Base/ProtocolResponse';
|
|
2
2
|
import { ActivityLogEntry } from './ActivityLogEntry';
|
|
3
|
-
import { TActivityLog
|
|
3
|
+
import { TActivityLog } from '../WSAPI/WSAPITypes';
|
|
4
4
|
export interface GetActivityLogResponse extends ProtocolResponse {
|
|
5
5
|
logHistory: ActivityLogEntry[];
|
|
6
6
|
}
|
|
7
7
|
export declare const ActivityLogTransform: (items: ActivityLogEntry[]) => TActivityLog[];
|
|
8
|
-
export declare const ActivityLogV2Transform: (items: any[]) => TActivityLogEntry[];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One winner entry inside a {@link JackpotWinPush}.
|
|
3
|
+
*
|
|
4
|
+
* Distinct from {@link JackPotWinner}, which is the winner shape returned by the
|
|
5
|
+
* `getJackpotWinners()` history — the live win push carries bet / trigger context
|
|
6
|
+
* and no avatar.
|
|
7
|
+
*/
|
|
8
|
+
interface JackPotWinPushWinner {
|
|
9
|
+
/** Smartico user ID of the winner */
|
|
10
|
+
user_id: number;
|
|
11
|
+
/** Operator's external user ID of the winner */
|
|
12
|
+
ext_user_id: string;
|
|
13
|
+
/** Flag indicating that this copy of the push was delivered to the winner themselves */
|
|
14
|
+
is_me: boolean;
|
|
15
|
+
/** Name of the winner, masked for everyone except `is_me` unless masking is disabled by request to Smartico AM team */
|
|
16
|
+
public_username: string;
|
|
17
|
+
/** Custom display name; falls back to `public_username` when not set */
|
|
18
|
+
public_username_custom: string;
|
|
19
|
+
/** Won amount in the Jackpot currency; real and bonus parts are combined */
|
|
20
|
+
winning_amount_jp_currency: number;
|
|
21
|
+
/** Won amount in the user Wallet currency; real and bonus parts are combined */
|
|
22
|
+
winning_amount_wallet_currency: number;
|
|
23
|
+
/** Position of the winner. Relevant for jackpots where there could be multiple winners */
|
|
24
|
+
winning_position: number;
|
|
25
|
+
/** External game ID of the game whose bet triggered the win; `null` when the triggering bet context is unavailable */
|
|
26
|
+
winning_game_id: string | null;
|
|
27
|
+
/** External provider ID of the triggering game's provider; `null` when the triggering bet context is unavailable */
|
|
28
|
+
winning_provider_id: string | null;
|
|
29
|
+
/** Placement time of the triggering bet as reported by the operator (epoch milliseconds) — not the time Smartico processed it; `null` when unavailable */
|
|
30
|
+
bet_original_date: number | null;
|
|
31
|
+
/** Present only on the `is_me` copy; `true` while the win awaits manual approval before payout */
|
|
32
|
+
pending_approve?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export { JackPotWinPushWinner };
|
|
@@ -9,7 +9,9 @@ interface JackPotWinner {
|
|
|
9
9
|
winning_amount_wallet_currency: number;
|
|
10
10
|
/** Position of the winner. Relevant for jackpots where there could be multiple winners */
|
|
11
11
|
winning_position: number;
|
|
12
|
-
/** Avatar of the winner */
|
|
12
|
+
/** Avatar image URL of the winner */
|
|
13
13
|
avatar_id: string;
|
|
14
|
+
/** Numeric ID of the winner's avatar; `null` when the winner has not picked one */
|
|
15
|
+
avatar_real_id: number | null;
|
|
14
16
|
}
|
|
15
17
|
export { JackPotWinner };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { JackpotContributionType } from './JackpotContributionType';
|
|
2
|
+
/**
|
|
3
|
+
* One per-game / per-provider override of a jackpot's default contribution.
|
|
4
|
+
*
|
|
5
|
+
* When a qualifying bet matches a rule's `extEntityIds`, that rule's
|
|
6
|
+
* `contributionValue` and `type` are used instead of the template-level
|
|
7
|
+
* `contribution_value` / `contribution_type`. Rules are informational for
|
|
8
|
+
* consumers — the server applies them. Note the camelCase field names; the rest
|
|
9
|
+
* of the jackpot payload is snake_case.
|
|
10
|
+
*/
|
|
11
|
+
interface JackpotContributionRule {
|
|
12
|
+
/** Stable ID of the rule within its template */
|
|
13
|
+
ruleId: number;
|
|
14
|
+
/** Template this rule belongs to */
|
|
15
|
+
jpTemplateId: number;
|
|
16
|
+
/** Whether `contributionValue` is a fixed amount or a percentage; see {@link JackpotContributionType} */
|
|
17
|
+
type: JackpotContributionType;
|
|
18
|
+
/** Operator-side game or provider IDs this rule applies to */
|
|
19
|
+
extEntityIds: string[];
|
|
20
|
+
/** Contribution to apply for matching bets — fixed amount or percentage depending on `type` */
|
|
21
|
+
contributionValue: number;
|
|
22
|
+
}
|
|
23
|
+
export { JackpotContributionRule };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { AchRelatedGame } from '../Base/AchRelatedGame';
|
|
2
|
+
import { JackpotContributionRule } from './JackpotContributionRule';
|
|
1
3
|
import { JackpotContributionType } from './JackpotContributionType';
|
|
2
4
|
import { JackpotPot } from './JackpotPot';
|
|
3
5
|
import { JackpotPublicMeta } from './JackpotPublicMeta';
|
|
@@ -21,10 +23,16 @@ interface JackpotDetails {
|
|
|
21
23
|
contribution_type: JackpotContributionType;
|
|
22
24
|
/** Amount of contribution per qualifying bet — fixed value or percentage depending on `contribution_type`. */
|
|
23
25
|
contribution_value: number;
|
|
26
|
+
/** Per-game / per-provider overrides of `contribution_type` + `contribution_value`; see {@link JackpotContributionRule}. Empty when the template contributes at a flat rate. */
|
|
27
|
+
contribution_rules: JackpotContributionRule[];
|
|
28
|
+
/** Reserved — the server currently always sends an empty array. Use `getJackpotEligibleGames()` for the eligible-games list. */
|
|
29
|
+
related_games: AchRelatedGame[];
|
|
24
30
|
/** Live pot snapshot (amount, temperature, last explosion timestamp). */
|
|
25
31
|
pot: JackpotPot;
|
|
26
32
|
/** `true` when the current user is currently opted in. */
|
|
27
33
|
is_opted_in: boolean;
|
|
34
|
+
/** `true` when eligible users are opted in automatically, so no opt-in CTA is needed; `false` means `jackpotOptIn()` must be called explicitly. */
|
|
35
|
+
is_auto_opt_in: boolean;
|
|
28
36
|
/** `true` when every game in the operator catalog contributes; if `true`, skip `getJackpotEligibleGames`. */
|
|
29
37
|
ach_related_game_allow_all: boolean;
|
|
30
38
|
/** Number of users currently opted in; always `1` for `JackpotType.Personal`. */
|
|
@@ -21,8 +21,10 @@ interface JackpotPot {
|
|
|
21
21
|
current_pot_amount: number;
|
|
22
22
|
/** Current pot amount converted to the user's wallet currency (`user_currency`). */
|
|
23
23
|
current_pot_amount_user_currency: number;
|
|
24
|
-
/** Unix ms timestamp of when this pot last exploded; `
|
|
25
|
-
explode_date_ts: number;
|
|
24
|
+
/** Unix ms timestamp of when this pot last exploded; `null` while the pot is still running. */
|
|
25
|
+
explode_date_ts: number | null;
|
|
26
|
+
/** Owning user for `JackpotType.Personal` pots; `null` for shared `MultiUser` pots. */
|
|
27
|
+
user_id: number | null;
|
|
26
28
|
/** Heat band of the pot relative to its explosion range; see {@link JackPotTemparature}. */
|
|
27
29
|
current_pot_temperature: JackPotTemparature;
|
|
28
30
|
}
|
|
@@ -14,11 +14,15 @@ interface JackpotPublicMeta {
|
|
|
14
14
|
placeholder1: string;
|
|
15
15
|
/** custom value of placeholder2 defined by operator and can be used in the HTML templates */
|
|
16
16
|
placeholder2: string;
|
|
17
|
+
/** operator-defined display order, ascending; sent as a string */
|
|
18
|
+
priority: string;
|
|
17
19
|
/**
|
|
18
|
-
* Custom data
|
|
20
|
+
* Custom data that can be used in API to build custom UI.
|
|
21
|
+
* `jackpotGet()` returns this already parsed — an object when the operator stored JSON,
|
|
22
|
+
* otherwise the raw string. Elsewhere (e.g. the jackpot-win push) it arrives unparsed.
|
|
19
23
|
* You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice
|
|
20
24
|
* Read more here - <https://help.smartico.ai/welcome/products/tools-and-guides/custom-fields-attributes>
|
|
21
25
|
*/
|
|
22
|
-
custom_data:
|
|
26
|
+
custom_data: any;
|
|
23
27
|
}
|
|
24
28
|
export { JackpotPublicMeta };
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
import { ProtocolMessage } from '../Base/ProtocolMessage';
|
|
2
|
-
import {
|
|
2
|
+
import { JackPotWinPushWinner } from './JackPotWinPushWinner';
|
|
3
3
|
import { JackpotDetails } from './JackpotDetails';
|
|
4
|
+
/**
|
|
5
|
+
* Live jackpot-win notification. Delivered both to the winner and to other players
|
|
6
|
+
* taking part in the same jackpot — use `winners[].is_me` to tell the two apart;
|
|
7
|
+
* the copy sent to other players has its `public_username` masked.
|
|
8
|
+
*
|
|
9
|
+
* Surfaced to consumers through the `jackpot_win` callback
|
|
10
|
+
* (`_smartico.on('jackpot_win', …)`).
|
|
11
|
+
*
|
|
12
|
+
* The explosion time is `jackpot.pot.explode_date_ts` (epoch milliseconds).
|
|
13
|
+
*/
|
|
4
14
|
export interface JackpotWinPush extends ProtocolMessage {
|
|
15
|
+
/** The jackpot that exploded, including its live `pot` snapshot */
|
|
5
16
|
jackpot: JackpotDetails;
|
|
6
|
-
|
|
17
|
+
/** Winner entries; currently always a single entry */
|
|
18
|
+
winners: JackPotWinPushWinner[];
|
|
7
19
|
}
|
package/dist/Jackpots/index.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export * from './GetJackpotsPotsResponse';
|
|
|
3
3
|
export * from './GetJackpotsRequest';
|
|
4
4
|
export * from './GetJackpotsResponse';
|
|
5
5
|
export * from './JackPotWinner';
|
|
6
|
+
export * from './JackPotWinPushWinner';
|
|
7
|
+
export * from './JackpotContributionRule';
|
|
6
8
|
export * from './JackpotContributionType';
|
|
7
9
|
export * from './JackpotDetails';
|
|
8
10
|
export * from './JackpotPot';
|
package/dist/SmarticoAPI.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { GetTournamentInfoResponse, GetTournamentsResponse, TournamentRegisterRe
|
|
|
11
11
|
import { LeaderBoardDetails, LeaderBoardPeriodType } from './Leaderboard';
|
|
12
12
|
import { GetLevelMapResponse } from './Level';
|
|
13
13
|
import { WSAPI } from './WSAPI/WSAPI';
|
|
14
|
-
import { TInboxMessage, TInboxMessageBody, TLevel, TMiniGameTemplate, TMissionOrBadge, TStoreCategory, TAchCategory, TStoreItem, TTournament, TTournamentDetailed, LeaderBoardDetailsT, UserLevelExtraCountersT, TSegmentCheckResult, TUICustomSection, TBonus, TRaffle, TLevelCurrent, TActivityLog,
|
|
14
|
+
import { TInboxMessage, TInboxMessageBody, TLevel, TMiniGameTemplate, TMissionOrBadge, TStoreCategory, TAchCategory, TStoreItem, TTournament, TTournamentDetailed, LeaderBoardDetailsT, UserLevelExtraCountersT, TSegmentCheckResult, TUICustomSection, TBonus, TRaffle, TLevelCurrent, TActivityLog, TRaffleDraw, TAvatarDefinition, TAvatarCustomized, TAvatarPrompt, TClans, TClanInfo, TClanJoinResult, TClanTournamentPlayers } from './WSAPI/WSAPITypes';
|
|
15
15
|
import { GetAchievementsUserInfoResponse } from './Core/GetAchievementsUserInfoResponse';
|
|
16
16
|
import { GetJackpotsPotsResponse, GetJackpotsResponse, JackpotsOptinResponse, JackpotsOptoutResponse } from './Jackpots';
|
|
17
17
|
import { GetCustomSectionsResponse } from './CustomSections';
|
|
@@ -232,8 +232,6 @@ declare class SmarticoAPI {
|
|
|
232
232
|
limit: number;
|
|
233
233
|
}): Promise<GetRaffleWonPrizesResponse>;
|
|
234
234
|
getActivityLog(user_ext_id: string, startTimeSeconds: number, endTimeSeconds: number, limit: number, offset: number, types?: number[], src_types?: number[]): Promise<GetActivityLogResponse>;
|
|
235
|
-
getActivityLogV2(user_ext_id: string, startTimeSeconds: number, endTimeSeconds: number, limit: number, offset: number, types?: number[], src_types?: number[]): Promise<GetActivityLogResponse>;
|
|
236
235
|
getActivityLogT(user_ext_id: string, startTimeSeconds: number, endTimeSeconds: number, from?: number, to?: number, types?: number[], src_types?: number[]): Promise<TActivityLog[]>;
|
|
237
|
-
getActivityLogV2T(user_ext_id: string, startTimeSeconds: number, endTimeSeconds: number, from?: number, to?: number, types?: number[], src_types?: number[]): Promise<TActivityLogEntry[]>;
|
|
238
236
|
}
|
|
239
237
|
export { SmarticoAPI, MessageSender };
|
|
@@ -36,7 +36,6 @@ export declare enum onUpdateContextKey {
|
|
|
36
36
|
CurrentLevel = "currentLevel",
|
|
37
37
|
InboxUnreadCount = "inboxUnreadCount",
|
|
38
38
|
ActivityLog = "activityLog",
|
|
39
|
-
ActivityLogV2 = "activityLogV2",
|
|
40
39
|
AvatarsList = "avatarsList",
|
|
41
40
|
AvatarsCustomized = "avatarsCustomized",
|
|
42
41
|
AvatarPrompts = "avatarPrompts"
|
|
@@ -103,6 +103,8 @@ export declare class WSAPIJackpots extends WSAPIClans {
|
|
|
103
103
|
* - The jackpot must currently be active and the user must be in its
|
|
104
104
|
* eligibility segment. Ineligible jackpots are filtered out of
|
|
105
105
|
* {@link jackpotGet} entirely, so a card the user sees is opt-in-able.
|
|
106
|
+
* - Skip the opt-in CTA when the template reports `is_auto_opt_in: true` —
|
|
107
|
+
* eligible users are enrolled automatically and there is nothing to join.
|
|
106
108
|
*
|
|
107
109
|
* **Error handling**
|
|
108
110
|
* The server returns a non-zero `errCode` with a human-readable `errMsg`
|
|
@@ -205,6 +205,8 @@ export interface TMiniGameTemplate {
|
|
|
205
205
|
activeTillDate?: number;
|
|
206
206
|
/** Number of steps to complete the game and collect the prize (step games — Voyager / Treasure Hunt) */
|
|
207
207
|
steps_to_finish_game?: number;
|
|
208
|
+
/** Minimum number of path steps / collectible prizes a session must include before the game can finish (step games — Voyager / Treasure Hunt). `>= 1` and `<= steps_to_finish_game`; when omitted, no minimum is enforced */
|
|
209
|
+
min_steps_to_finish_game?: number;
|
|
208
210
|
/** ID of the operator-defined custom section (widget menu grouping) the mini-game is assigned to */
|
|
209
211
|
custom_section_id?: number;
|
|
210
212
|
/** Full raw UI definition of the mini-game (skin, colors, per-game visual settings) — see {@link SAWTemplateUI}. The commonly needed values are already lifted onto this template object */
|
|
@@ -1679,8 +1681,12 @@ export interface TransformedRaffleClaimPrizeResponse {
|
|
|
1679
1681
|
errorMessage?: string;
|
|
1680
1682
|
}
|
|
1681
1683
|
/**
|
|
1682
|
-
*
|
|
1683
|
-
*
|
|
1684
|
+
* One activity-log row from {@link WSAPIUser.getActivityLog}.
|
|
1685
|
+
*
|
|
1686
|
+
* Always includes the wallet fields (`type` / `amount` / `balance` / …). When the
|
|
1687
|
+
* server returns richer activity rows (missions, badges, levels, …), the optional
|
|
1688
|
+
* fields below are populated — same method, same CID; clients that ignore unknown
|
|
1689
|
+
* fields keep working.
|
|
1684
1690
|
*/
|
|
1685
1691
|
export interface TActivityLog {
|
|
1686
1692
|
/** Date when the change was created (epoch timestamp in seconds) */
|
|
@@ -1699,29 +1705,25 @@ export interface TActivityLog {
|
|
|
1699
1705
|
total_ever?: number;
|
|
1700
1706
|
/** Source type ID indicating what triggered this change */
|
|
1701
1707
|
source_type_id: PointChangeSourceType;
|
|
1702
|
-
}
|
|
1703
|
-
/**
|
|
1704
|
-
* Full activity-log row returned by {@link WSAPIUser.getActivityLogV2}.
|
|
1705
|
-
* Includes wallet changes and non-wallet activities (missions, badges, levels, …).
|
|
1706
|
-
*/
|
|
1707
|
-
export interface TActivityLogEntry {
|
|
1708
|
-
create_date: number;
|
|
1709
|
-
user_ext_id: string;
|
|
1710
|
-
crm_brand_id: number;
|
|
1711
|
-
type: UserBalanceType;
|
|
1712
|
-
amount: number;
|
|
1713
|
-
balance: number;
|
|
1714
|
-
total_ever?: number;
|
|
1715
|
-
source_type_id: PointChangeSourceType;
|
|
1708
|
+
/** Activity kind — see {@link ActivityLogActivities} (`type` on the wire). */
|
|
1716
1709
|
activity_type_id?: ActivityLogActivities;
|
|
1710
|
+
/** Sub-action for `activity_type_id` (e.g. unlock vs complete, add vs deduct, raffle win vs register). */
|
|
1717
1711
|
context_value_1?: number;
|
|
1712
|
+
/** Extra display payload for the row (name, image, position, …) — see {@link ActivityLogMeta}. */
|
|
1718
1713
|
meta?: ActivityLogMeta;
|
|
1714
|
+
/** Human-readable name of the source entity (mission, tournament, raffle, …). */
|
|
1719
1715
|
source_entity_name?: string;
|
|
1716
|
+
/** Primary id of the source entity (mission / badge / tournament / …). */
|
|
1720
1717
|
source_entity_id?: number;
|
|
1718
|
+
/** More specific id within the source (e.g. level id, draw id, win id). */
|
|
1721
1719
|
source_reference_id?: number;
|
|
1720
|
+
/** Root / parent entity id when the source is nested (e.g. raffle id owning a draw). */
|
|
1722
1721
|
source_root_id?: number;
|
|
1723
|
-
|
|
1722
|
+
/** True when the row is a points/gems/diamonds wallet change. */
|
|
1723
|
+
is_wallet_entry?: boolean;
|
|
1724
1724
|
}
|
|
1725
|
+
/** @deprecated Use {@link TActivityLog} — same shape; kept as an alias for early adopters. */
|
|
1726
|
+
export type TActivityLogEntry = TActivityLog;
|
|
1725
1727
|
/**
|
|
1726
1728
|
* Result of `_smartico.api.requestRaffleOptin({raffle_id, draw_id, raffle_run_id})`.
|
|
1727
1729
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TActivityLog,
|
|
1
|
+
import { TActivityLog, TLevel, TLevelCurrent, TSegmentCheckResult, TUserProfile, UserLevelExtraCountersT } from './WSAPITypes';
|
|
2
2
|
import { WSAPIBase } from './WSAPIBase';
|
|
3
3
|
/** @group User */
|
|
4
4
|
export declare class WSAPIUser extends WSAPIBase {
|
|
@@ -465,15 +465,16 @@ export declare class WSAPIUser extends WSAPIBase {
|
|
|
465
465
|
*/
|
|
466
466
|
getUserLevelExtraCounters(): Promise<UserLevelExtraCountersT>;
|
|
467
467
|
/**
|
|
468
|
-
* Returns the user's
|
|
469
|
-
*
|
|
470
|
-
*
|
|
471
|
-
*
|
|
468
|
+
* Returns the user's activity history within the requested time window,
|
|
469
|
+
* ordered newest-first. Today that is primarily wallet changes (points /
|
|
470
|
+
* gems / diamonds); when the server starts returning richer activity rows
|
|
471
|
+
* (missions, badges, levels, …), the same method surfaces them via optional
|
|
472
|
+
* fields on {@link TActivityLog} — no separate call, same wire CID.
|
|
472
473
|
*
|
|
473
|
-
*
|
|
474
|
-
*
|
|
475
|
-
*
|
|
476
|
-
*
|
|
474
|
+
* Existing wallet fields (`type`, `amount`, `balance`, `source_type_id`, …)
|
|
475
|
+
* stay stable. Clients that only read those keep working; clients that want
|
|
476
|
+
* the fuller feed can also read `activity_type_id`, `meta`,
|
|
477
|
+
* `source_entity_*`, and `is_wallet_entry` when present.
|
|
477
478
|
*
|
|
478
479
|
* @remarks
|
|
479
480
|
* **Preconditions**
|
|
@@ -486,7 +487,7 @@ export declare class WSAPIUser extends WSAPIBase {
|
|
|
486
487
|
* `from` by 50 between calls. Both `startTimeSeconds` and `endTimeSeconds`
|
|
487
488
|
* are epoch seconds bounding the window the server scans.
|
|
488
489
|
*
|
|
489
|
-
* **Filtering** — optional server-side filters
|
|
490
|
+
* **Filtering** — optional server-side filters:
|
|
490
491
|
* - `types` — {@link ActivityLogActivities} / `type_id` values (e.g. Points=3, Gems=1)
|
|
491
492
|
* - `src_types` — {@link PointChangeSourceType} / `source_type_id` values
|
|
492
493
|
* Omit both for an unfiltered window.
|
|
@@ -555,30 +556,4 @@ export declare class WSAPIUser extends WSAPIBase {
|
|
|
555
556
|
* refresh re-fetches the same window and updates its matching composite cache key. */
|
|
556
557
|
private activityLogOnUpdateParams;
|
|
557
558
|
protected notifyActivityLogUpdate(): Promise<void>;
|
|
558
|
-
/**
|
|
559
|
-
* Returns the full activity log (v2) — wallet changes **and** non-wallet
|
|
560
|
-
* activities (missions, badges, levels, tournaments, avatars, …).
|
|
561
|
-
*
|
|
562
|
-
* **Backwards compatibility**: existing integrations should keep using
|
|
563
|
-
* {@link getActivityLog}, which returns wallet-only {@link TActivityLog}
|
|
564
|
-
* rows with the original field contract unchanged.
|
|
565
|
-
*
|
|
566
|
-
* **Pagination** — same `from` / `to` offset model as {@link getActivityLog}
|
|
567
|
-
* (server caps a single response at 50 entries).
|
|
568
|
-
*
|
|
569
|
-
* **Filtering** — optional server-side filters:
|
|
570
|
-
* - `types` — {@link ActivityLogActivities} values (`type_id`)
|
|
571
|
-
* - `src_types` — {@link PointChangeSourceType} values (`source_type_id`)
|
|
572
|
-
* Omit both for all activity types / sources.
|
|
573
|
-
*
|
|
574
|
-
* @returns Array of {@link TActivityLogEntry} ordered newest-first.
|
|
575
|
-
*/
|
|
576
|
-
getActivityLogV2({ startTimeSeconds, endTimeSeconds, from, to, types, src_types, }: {
|
|
577
|
-
startTimeSeconds: number;
|
|
578
|
-
endTimeSeconds: number;
|
|
579
|
-
from: number;
|
|
580
|
-
to: number;
|
|
581
|
-
types?: number[];
|
|
582
|
-
src_types?: number[];
|
|
583
|
-
}): Promise<TActivityLogEntry[]>;
|
|
584
559
|
}
|