@smartico/public-api 0.0.419 → 0.0.421
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/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 +3 -1
- package/dist/ActivityLog/GetActivityLogResponse.d.ts +1 -2
- package/dist/ActivityLog/PointChangeSourceType.d.ts +1 -0
- 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 +3 -5
- package/dist/WSAPI/WSAPIBase.d.ts +0 -1
- package/dist/WSAPI/WSAPIJackpots.d.ts +2 -0
- package/dist/WSAPI/WSAPITypes.d.ts +17 -17
- package/dist/WSAPI/WSAPIUser.d.ts +24 -35
- package/dist/index.js +61 -131
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +58 -102
- 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 +3 -3
- package/src/ActivityLog/GetActivityLogResponse.ts +23 -49
- package/src/ActivityLog/PointChangeSourceType.ts +1 -0
- 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/SmarticoAPI.ts +6 -40
- package/src/WSAPI/WSAPIBase.ts +0 -1
- package/src/WSAPI/WSAPIJackpots.ts +2 -0
- package/src/WSAPI/WSAPITypes.ts +18 -18
- package/src/WSAPI/WSAPIUser.ts +38 -55
- 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/dist/index.js
CHANGED
|
@@ -2234,7 +2234,6 @@ var onUpdateContextKey;
|
|
|
2234
2234
|
onUpdateContextKey["CurrentLevel"] = "currentLevel";
|
|
2235
2235
|
onUpdateContextKey["InboxUnreadCount"] = "inboxUnreadCount";
|
|
2236
2236
|
onUpdateContextKey["ActivityLog"] = "activityLog";
|
|
2237
|
-
onUpdateContextKey["ActivityLogV2"] = "activityLogV2";
|
|
2238
2237
|
onUpdateContextKey["AvatarsList"] = "avatarsList";
|
|
2239
2238
|
onUpdateContextKey["AvatarsCustomized"] = "avatarsCustomized";
|
|
2240
2239
|
onUpdateContextKey["AvatarPrompts"] = "avatarPrompts";
|
|
@@ -3034,15 +3033,16 @@ var WSAPIUser = /*#__PURE__*/function (_WSAPIBase) {
|
|
|
3034
3033
|
}
|
|
3035
3034
|
}
|
|
3036
3035
|
/**
|
|
3037
|
-
* Returns the user's
|
|
3038
|
-
*
|
|
3039
|
-
*
|
|
3040
|
-
*
|
|
3036
|
+
* Returns the user's activity history within the requested time window,
|
|
3037
|
+
* ordered newest-first. Today that is primarily wallet changes (points /
|
|
3038
|
+
* gems / diamonds); when the server starts returning richer activity rows
|
|
3039
|
+
* (missions, badges, levels, …), the same method surfaces them via optional
|
|
3040
|
+
* fields on {@link TActivityLog} — no separate call, same wire CID.
|
|
3041
3041
|
*
|
|
3042
|
-
*
|
|
3043
|
-
*
|
|
3044
|
-
*
|
|
3045
|
-
*
|
|
3042
|
+
* Existing wallet fields (`type`, `amount`, `balance`, `source_type_id`, …)
|
|
3043
|
+
* stay stable. Clients that only read those keep working; clients that want
|
|
3044
|
+
* the fuller feed can also read `activity_type_id`, `meta`,
|
|
3045
|
+
* `source_entity_*`, and `is_wallet_entry` when present.
|
|
3046
3046
|
*
|
|
3047
3047
|
* @remarks
|
|
3048
3048
|
* **Preconditions**
|
|
@@ -3055,13 +3055,18 @@ var WSAPIUser = /*#__PURE__*/function (_WSAPIBase) {
|
|
|
3055
3055
|
* `from` by 50 between calls. Both `startTimeSeconds` and `endTimeSeconds`
|
|
3056
3056
|
* are epoch seconds bounding the window the server scans.
|
|
3057
3057
|
*
|
|
3058
|
+
* **Filtering** — optional server-side filters:
|
|
3059
|
+
* - `types` — {@link ActivityLogActivities} / `type_id` values (e.g. Points=3, Gems=1)
|
|
3060
|
+
* - `src_types` — {@link PointChangeSourceType} / `source_type_id` values
|
|
3061
|
+
* Omit both for an unfiltered window.
|
|
3062
|
+
*
|
|
3058
3063
|
* **Subscription model (`onUpdate`)**
|
|
3059
3064
|
* The callback fires when the user's `ach_points_balance`,
|
|
3060
3065
|
* `ach_gems_balance`, or `ach_diamonds_balance` changes (i.e. whenever a
|
|
3061
3066
|
* wallet event lands). The pushed payload is a FIXED re-fetch of the
|
|
3062
3067
|
* **last 10 minutes / first 50 entries** — it does NOT honor the original
|
|
3063
|
-
* call's `startTimeSeconds` / `endTimeSeconds` / `from` / `to
|
|
3064
|
-
* maintaining a long historical view must re-call `getActivityLog` with
|
|
3068
|
+
* call's `startTimeSeconds` / `endTimeSeconds` / `from` / `to` / filters.
|
|
3069
|
+
* Consumers maintaining a long historical view must re-call `getActivityLog` with
|
|
3065
3070
|
* their own params after receiving an `onUpdate` notification.
|
|
3066
3071
|
*
|
|
3067
3072
|
* **Refresh**
|
|
@@ -3085,6 +3090,8 @@ var WSAPIUser = /*#__PURE__*/function (_WSAPIBase) {
|
|
|
3085
3090
|
* endTimeSeconds: now,
|
|
3086
3091
|
* from: 0,
|
|
3087
3092
|
* to: 50,
|
|
3093
|
+
* types: [1], // Gems only (ActivityLogActivities.Gems)
|
|
3094
|
+
* src_types: [11], // Tournament wins only (PointChangeSourceType.Tournament)
|
|
3088
3095
|
* onUpdate: (refreshed) => {
|
|
3089
3096
|
* console.log('[smartico] wallet changed — refreshed payload is last 10 min / 50 entries:', refreshed.length, 'rows');
|
|
3090
3097
|
* // If the consumer is showing a full 30-day view, re-call getActivityLog with the original params here.
|
|
@@ -3103,10 +3110,13 @@ var WSAPIUser = /*#__PURE__*/function (_WSAPIBase) {
|
|
|
3103
3110
|
endTimeSeconds = _ref.endTimeSeconds,
|
|
3104
3111
|
from = _ref.from,
|
|
3105
3112
|
to = _ref.to,
|
|
3113
|
+
types = _ref.types,
|
|
3114
|
+
src_types = _ref.src_types,
|
|
3106
3115
|
onUpdate = _ref.onUpdate;
|
|
3107
3116
|
try {
|
|
3117
|
+
var _types$join, _src_types$join;
|
|
3108
3118
|
var _this7 = this;
|
|
3109
|
-
var cacheKey = onUpdateContextKey.ActivityLog + ":" + startTimeSeconds + ":" + endTimeSeconds + ":" + from + ":" + to;
|
|
3119
|
+
var cacheKey = onUpdateContextKey.ActivityLog + ":" + startTimeSeconds + ":" + endTimeSeconds + ":" + from + ":" + to + ":" + ((_types$join = types == null ? void 0 : types.join(',')) != null ? _types$join : '') + ":" + ((_src_types$join = src_types == null ? void 0 : src_types.join(',')) != null ? _src_types$join : '');
|
|
3110
3120
|
if (typeof onUpdate === 'function') {
|
|
3111
3121
|
_this7.onUpdateCallback.set(onUpdateContextKey.ActivityLog, onUpdate);
|
|
3112
3122
|
// Remember the requested window so a push refresh re-fetches THIS window
|
|
@@ -3115,11 +3125,13 @@ var WSAPIUser = /*#__PURE__*/function (_WSAPIBase) {
|
|
|
3115
3125
|
startTimeSeconds: startTimeSeconds,
|
|
3116
3126
|
endTimeSeconds: endTimeSeconds,
|
|
3117
3127
|
from: from,
|
|
3118
|
-
to: to
|
|
3128
|
+
to: to,
|
|
3129
|
+
types: types,
|
|
3130
|
+
src_types: src_types
|
|
3119
3131
|
};
|
|
3120
3132
|
}
|
|
3121
3133
|
return Promise.resolve(OCache.use(cacheKey, exports.ECacheContext.WSAPI, function () {
|
|
3122
|
-
return _this7.api.getActivityLogT(_this7.userExtId, startTimeSeconds, endTimeSeconds, from, to);
|
|
3134
|
+
return _this7.api.getActivityLogT(_this7.userExtId, startTimeSeconds, endTimeSeconds, from, to, types, src_types);
|
|
3123
3135
|
}, CACHE_DATA_SEC));
|
|
3124
3136
|
} catch (e) {
|
|
3125
3137
|
return Promise.reject(e);
|
|
@@ -3133,8 +3145,9 @@ var WSAPIUser = /*#__PURE__*/function (_WSAPIBase) {
|
|
|
3133
3145
|
if (!params) {
|
|
3134
3146
|
return Promise.resolve();
|
|
3135
3147
|
}
|
|
3136
|
-
return Promise.resolve(_this8.api.getActivityLogT(_this8.userExtId, params.startTimeSeconds, params.endTimeSeconds, params.from, params.to)).then(function (payload) {
|
|
3137
|
-
var
|
|
3148
|
+
return Promise.resolve(_this8.api.getActivityLogT(_this8.userExtId, params.startTimeSeconds, params.endTimeSeconds, params.from, params.to, params.types, params.src_types)).then(function (payload) {
|
|
3149
|
+
var _params$types$join, _params$types, _params$src_types$joi, _params$src_types;
|
|
3150
|
+
var cacheKey = onUpdateContextKey.ActivityLog + ":" + params.startTimeSeconds + ":" + params.endTimeSeconds + ":" + params.from + ":" + params.to + ":" + ((_params$types$join = (_params$types = params.types) == null ? void 0 : _params$types.join(',')) != null ? _params$types$join : '') + ":" + ((_params$src_types$joi = (_params$src_types = params.src_types) == null ? void 0 : _params$src_types.join(',')) != null ? _params$src_types$joi : '');
|
|
3138
3151
|
OCache.set(cacheKey, payload, exports.ECacheContext.WSAPI);
|
|
3139
3152
|
var onUpdate = _this8.onUpdateCallback.get(onUpdateContextKey.ActivityLog);
|
|
3140
3153
|
if (typeof onUpdate === 'function') {
|
|
@@ -3144,40 +3157,6 @@ var WSAPIUser = /*#__PURE__*/function (_WSAPIBase) {
|
|
|
3144
3157
|
} catch (e) {
|
|
3145
3158
|
return Promise.reject(e);
|
|
3146
3159
|
}
|
|
3147
|
-
}
|
|
3148
|
-
/**
|
|
3149
|
-
* Returns the full activity log (v2) — wallet changes **and** non-wallet
|
|
3150
|
-
* activities (missions, badges, levels, tournaments, avatars, …).
|
|
3151
|
-
*
|
|
3152
|
-
* **Backwards compatibility**: existing integrations should keep using
|
|
3153
|
-
* {@link getActivityLog}, which returns wallet-only {@link TActivityLog}
|
|
3154
|
-
* rows with the original field contract unchanged.
|
|
3155
|
-
*
|
|
3156
|
-
* **Pagination** — same `from` / `to` offset model as {@link getActivityLog}
|
|
3157
|
-
* (server caps a single response at 50 entries).
|
|
3158
|
-
*
|
|
3159
|
-
* **Filtering** — pass `types` with {@link ActivityLogActivities} values to
|
|
3160
|
-
* request a server-side subset (e.g. missions only). Omit for all activity types.
|
|
3161
|
-
*
|
|
3162
|
-
* @returns Array of {@link TActivityLogEntry} ordered newest-first.
|
|
3163
|
-
*/
|
|
3164
|
-
;
|
|
3165
|
-
_proto.getActivityLogV2 = function getActivityLogV2(_ref2) {
|
|
3166
|
-
var startTimeSeconds = _ref2.startTimeSeconds,
|
|
3167
|
-
endTimeSeconds = _ref2.endTimeSeconds,
|
|
3168
|
-
from = _ref2.from,
|
|
3169
|
-
to = _ref2.to,
|
|
3170
|
-
types = _ref2.types;
|
|
3171
|
-
try {
|
|
3172
|
-
var _types$join;
|
|
3173
|
-
var _this9 = this;
|
|
3174
|
-
var cacheKey = onUpdateContextKey.ActivityLogV2 + ":" + startTimeSeconds + ":" + endTimeSeconds + ":" + from + ":" + to + ":" + ((_types$join = types == null ? void 0 : types.join(',')) != null ? _types$join : '');
|
|
3175
|
-
return Promise.resolve(OCache.use(cacheKey, exports.ECacheContext.WSAPI, function () {
|
|
3176
|
-
return _this9.api.getActivityLogV2T(_this9.userExtId, startTimeSeconds, endTimeSeconds, from, to, types);
|
|
3177
|
-
}, CACHE_DATA_SEC));
|
|
3178
|
-
} catch (e) {
|
|
3179
|
-
return Promise.reject(e);
|
|
3180
|
-
}
|
|
3181
3160
|
};
|
|
3182
3161
|
return WSAPIUser;
|
|
3183
3162
|
}(WSAPIBase);
|
|
@@ -6218,6 +6197,8 @@ var WSAPIJackpots = /*#__PURE__*/function (_WSAPIClans) {
|
|
|
6218
6197
|
* - The jackpot must currently be active and the user must be in its
|
|
6219
6198
|
* eligibility segment. Ineligible jackpots are filtered out of
|
|
6220
6199
|
* {@link jackpotGet} entirely, so a card the user sees is opt-in-able.
|
|
6200
|
+
* - Skip the opt-in CTA when the template reports `is_auto_opt_in: true` —
|
|
6201
|
+
* eligible users are enrolled automatically and there is nothing to join.
|
|
6221
6202
|
*
|
|
6222
6203
|
* **Error handling**
|
|
6223
6204
|
* The server returns a non-zero `errCode` with a human-readable `errMsg`
|
|
@@ -10340,7 +10321,7 @@ exports.BonusStatus = void 0;
|
|
|
10340
10321
|
BonusStatus[BonusStatus["EXPIRED"] = 6] = "EXPIRED";
|
|
10341
10322
|
})(exports.BonusStatus || (exports.BonusStatus = {}));
|
|
10342
10323
|
|
|
10343
|
-
/** Activity-log entry type as returned on the
|
|
10324
|
+
/** Activity-log entry type as returned on the wire (`type_id`). */
|
|
10344
10325
|
exports.ActivityLogActivities = void 0;
|
|
10345
10326
|
(function (ActivityLogActivities) {
|
|
10346
10327
|
ActivityLogActivities[ActivityLogActivities["Gems"] = 1] = "Gems";
|
|
@@ -10373,59 +10354,38 @@ exports.UserBalanceType = void 0;
|
|
|
10373
10354
|
})(exports.UserBalanceType || (exports.UserBalanceType = {}));
|
|
10374
10355
|
|
|
10375
10356
|
var ActivityLogTransform = function ActivityLogTransform(items) {
|
|
10376
|
-
if (!items) {
|
|
10377
|
-
return [];
|
|
10378
|
-
}
|
|
10379
|
-
return items.map(function (item) {
|
|
10380
|
-
var _item$create_date$sec, _item$create_date, _item$type;
|
|
10381
|
-
var itemTransformed = {
|
|
10382
|
-
create_date: (_item$create_date$sec = (_item$create_date = item.create_date) == null ? void 0 : _item$create_date.seconds) != null ? _item$create_date$sec : item.create_date,
|
|
10383
|
-
user_ext_id: item.user_ext_id,
|
|
10384
|
-
crm_brand_id: item.crm_brand_id,
|
|
10385
|
-
source_type_id: item.source_type_id
|
|
10386
|
-
};
|
|
10387
|
-
item.type = (_item$type = item.type) != null ? _item$type : exports.UserBalanceType.Points;
|
|
10388
|
-
if (item.type === exports.UserBalanceType.Diamonds || item.type === exports.UserBalanceType.Gems) {
|
|
10389
|
-
itemTransformed.type = item.type;
|
|
10390
|
-
itemTransformed.amount = item.amount;
|
|
10391
|
-
itemTransformed.balance = item.balance;
|
|
10392
|
-
}
|
|
10393
|
-
if (item.type === exports.UserBalanceType.Points) {
|
|
10394
|
-
itemTransformed.type = exports.UserBalanceType.Points;
|
|
10395
|
-
itemTransformed.amount = item.points_collected;
|
|
10396
|
-
itemTransformed.balance = item.user_points_balance;
|
|
10397
|
-
itemTransformed.total_ever = item.user_points_ever;
|
|
10398
|
-
}
|
|
10399
|
-
return itemTransformed;
|
|
10400
|
-
});
|
|
10401
|
-
};
|
|
10402
|
-
var ActivityLogV2Transform = function ActivityLogV2Transform(items) {
|
|
10403
10357
|
if (!items) {
|
|
10404
10358
|
return [];
|
|
10405
10359
|
}
|
|
10406
10360
|
return items.map(function (r) {
|
|
10407
|
-
var _r$create_date$second, _r$create_date, _r$
|
|
10408
|
-
|
|
10409
|
-
|
|
10410
|
-
var
|
|
10361
|
+
var _r$type_id, _r$ctx_meta, _r$create_date$second, _r$create_date, _r$amount, _r$user_points_balanc, _r$ctx_, _r$source_entity_name, _r$source_ref_id;
|
|
10362
|
+
// The wire sends the activity kind as `type` (an ActivityLogActivities value).
|
|
10363
|
+
// `type_id` is accepted as an alias so an older/newer server spelling still maps.
|
|
10364
|
+
var activityTypeId = (_r$type_id = r.type_id) != null ? _r$type_id : r.type;
|
|
10365
|
+
var isGems = activityTypeId === exports.ActivityLogActivities.Gems;
|
|
10366
|
+
var isDiamonds = activityTypeId === exports.ActivityLogActivities.Diamonds;
|
|
10367
|
+
var meta = (_r$ctx_meta = r.ctx_meta) != null ? _r$ctx_meta : r.context_value_meta;
|
|
10368
|
+
return {
|
|
10411
10369
|
create_date: (_r$create_date$second = (_r$create_date = r.create_date) == null ? void 0 : _r$create_date.seconds) != null ? _r$create_date$second : r.create_date,
|
|
10412
10370
|
user_ext_id: r.user_ext_id,
|
|
10413
|
-
|
|
10371
|
+
// Sent as a string on the wire.
|
|
10372
|
+
crm_brand_id: Number(r.crm_brand_id),
|
|
10414
10373
|
type: isGems ? exports.UserBalanceType.Gems : isDiamonds ? exports.UserBalanceType.Diamonds : exports.UserBalanceType.Points,
|
|
10415
|
-
amount
|
|
10374
|
+
// `amount` carries the real delta; `points_collected` is a `-1` placeholder on points rows.
|
|
10375
|
+
amount: (_r$amount = r.amount) != null ? _r$amount : r.points_collected,
|
|
10416
10376
|
balance: (_r$user_points_balanc = r.user_points_balance) != null ? _r$user_points_balanc : r.balance,
|
|
10417
10377
|
total_ever: r.user_points_ever,
|
|
10418
10378
|
source_type_id: r.source_type_id,
|
|
10419
|
-
activity_type_id:
|
|
10420
|
-
context_value_1: r.context_value_1,
|
|
10421
|
-
meta:
|
|
10422
|
-
|
|
10379
|
+
activity_type_id: activityTypeId,
|
|
10380
|
+
context_value_1: (_r$ctx_ = r.ctx_1) != null ? _r$ctx_ : r.context_value_1,
|
|
10381
|
+
meta: meta,
|
|
10382
|
+
// Entity name travels inside the context meta, not as a top-level field.
|
|
10383
|
+
source_entity_name: (_r$source_entity_name = r.source_entity_name) != null ? _r$source_entity_name : meta == null ? void 0 : meta.name,
|
|
10423
10384
|
source_entity_id: r.source_entity_id,
|
|
10424
|
-
source_reference_id: r.source_reference_id,
|
|
10385
|
+
source_reference_id: (_r$source_ref_id = r.source_ref_id) != null ? _r$source_ref_id : r.source_reference_id,
|
|
10425
10386
|
source_root_id: r.source_root_id,
|
|
10426
|
-
is_wallet_entry:
|
|
10387
|
+
is_wallet_entry: activityTypeId == null || activityTypeId === exports.ActivityLogActivities.Gems || activityTypeId === exports.ActivityLogActivities.Diamonds || activityTypeId === exports.ActivityLogActivities.Points
|
|
10427
10388
|
};
|
|
10428
|
-
return x;
|
|
10429
10389
|
});
|
|
10430
10390
|
};
|
|
10431
10391
|
|
|
@@ -10447,6 +10407,7 @@ exports.PointChangeSourceType = void 0;
|
|
|
10447
10407
|
PointChangeSourceType[PointChangeSourceType["WinMiniGame"] = 17] = "WinMiniGame";
|
|
10448
10408
|
PointChangeSourceType[PointChangeSourceType["API"] = 18] = "API";
|
|
10449
10409
|
PointChangeSourceType[PointChangeSourceType["DynamicFormula"] = 19] = "DynamicFormula";
|
|
10410
|
+
PointChangeSourceType[PointChangeSourceType["Jackpot"] = 20] = "Jackpot";
|
|
10450
10411
|
PointChangeSourceType[PointChangeSourceType["Raffle"] = 21] = "Raffle";
|
|
10451
10412
|
PointChangeSourceType[PointChangeSourceType["Avatars"] = 22] = "Avatars";
|
|
10452
10413
|
PointChangeSourceType[PointChangeSourceType["Clan"] = 23] = "Clan";
|
|
@@ -12330,55 +12291,25 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
12330
12291
|
return Promise.reject(e);
|
|
12331
12292
|
}
|
|
12332
12293
|
};
|
|
12333
|
-
_proto.getActivityLog = function getActivityLog(user_ext_id, startTimeSeconds, endTimeSeconds, limit, offset) {
|
|
12294
|
+
_proto.getActivityLog = function getActivityLog(user_ext_id, startTimeSeconds, endTimeSeconds, limit, offset, types, src_types) {
|
|
12334
12295
|
try {
|
|
12335
12296
|
var _this102 = this;
|
|
12336
|
-
var message = _this102.buildMessage(user_ext_id, exports.ClassId.GET_POINT_HISTORY_REQUEST, {
|
|
12337
|
-
startTimeSeconds: Math.floor(startTimeSeconds),
|
|
12338
|
-
endTimeSeconds: Math.floor(endTimeSeconds),
|
|
12339
|
-
limit: limit,
|
|
12340
|
-
offset: offset
|
|
12341
|
-
});
|
|
12342
|
-
return Promise.resolve(_this102.send(message, exports.ClassId.GET_POINT_HISTORY_RESPONSE));
|
|
12343
|
-
} catch (e) {
|
|
12344
|
-
return Promise.reject(e);
|
|
12345
|
-
}
|
|
12346
|
-
};
|
|
12347
|
-
_proto.getActivityLogV2 = function getActivityLogV2(user_ext_id, startTimeSeconds, endTimeSeconds, limit, offset, types) {
|
|
12348
|
-
try {
|
|
12349
|
-
var _this103 = this;
|
|
12350
|
-
var message = _this103.buildMessage(user_ext_id, exports.ClassId.GET_POINT_HISTORY_REQUEST, _extends({
|
|
12297
|
+
var message = _this102.buildMessage(user_ext_id, exports.ClassId.GET_POINT_HISTORY_REQUEST, _extends({
|
|
12351
12298
|
startTimeSeconds: Math.floor(startTimeSeconds),
|
|
12352
12299
|
endTimeSeconds: Math.floor(endTimeSeconds),
|
|
12353
12300
|
limit: limit,
|
|
12354
12301
|
offset: offset
|
|
12355
12302
|
}, types ? {
|
|
12356
12303
|
types: types
|
|
12304
|
+
} : {}, src_types ? {
|
|
12305
|
+
src_types: src_types
|
|
12357
12306
|
} : {}));
|
|
12358
|
-
return Promise.resolve(
|
|
12359
|
-
} catch (e) {
|
|
12360
|
-
return Promise.reject(e);
|
|
12361
|
-
}
|
|
12362
|
-
};
|
|
12363
|
-
_proto.getActivityLogT = function getActivityLogT(user_ext_id, startTimeSeconds, endTimeSeconds, from, to) {
|
|
12364
|
-
if (from === void 0) {
|
|
12365
|
-
from = 0;
|
|
12366
|
-
}
|
|
12367
|
-
if (to === void 0) {
|
|
12368
|
-
to = 50;
|
|
12369
|
-
}
|
|
12370
|
-
try {
|
|
12371
|
-
var _this104 = this;
|
|
12372
|
-
var limit = to - from > 50 ? 50 : to - from;
|
|
12373
|
-
var offset = from;
|
|
12374
|
-
return Promise.resolve(_this104.getActivityLog(user_ext_id, startTimeSeconds, endTimeSeconds, limit, offset)).then(function (_this104$getActivityL) {
|
|
12375
|
-
return ActivityLogTransform(_this104$getActivityL.logHistory);
|
|
12376
|
-
});
|
|
12307
|
+
return Promise.resolve(_this102.send(message, exports.ClassId.GET_POINT_HISTORY_RESPONSE));
|
|
12377
12308
|
} catch (e) {
|
|
12378
12309
|
return Promise.reject(e);
|
|
12379
12310
|
}
|
|
12380
12311
|
};
|
|
12381
|
-
_proto.
|
|
12312
|
+
_proto.getActivityLogT = function getActivityLogT(user_ext_id, startTimeSeconds, endTimeSeconds, from, to, types, src_types) {
|
|
12382
12313
|
if (from === void 0) {
|
|
12383
12314
|
from = 0;
|
|
12384
12315
|
}
|
|
@@ -12386,11 +12317,11 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
12386
12317
|
to = 50;
|
|
12387
12318
|
}
|
|
12388
12319
|
try {
|
|
12389
|
-
var
|
|
12320
|
+
var _this103 = this;
|
|
12390
12321
|
var limit = to - from > 50 ? 50 : to - from;
|
|
12391
12322
|
var offset = from;
|
|
12392
|
-
return Promise.resolve(
|
|
12393
|
-
return
|
|
12323
|
+
return Promise.resolve(_this103.getActivityLog(user_ext_id, startTimeSeconds, endTimeSeconds, limit, offset, types, src_types)).then(function (_this103$getActivityL) {
|
|
12324
|
+
return ActivityLogTransform(_this103$getActivityL.logHistory);
|
|
12394
12325
|
});
|
|
12395
12326
|
} catch (e) {
|
|
12396
12327
|
return Promise.reject(e);
|
|
@@ -13042,7 +12973,6 @@ exports.JoinClanErrorCode = void 0;
|
|
|
13042
12973
|
|
|
13043
12974
|
exports.AchCategoryTransform = AchCategoryTransform;
|
|
13044
12975
|
exports.ActivityLogTransform = ActivityLogTransform;
|
|
13045
|
-
exports.ActivityLogV2Transform = ActivityLogV2Transform;
|
|
13046
12976
|
exports.AllRoundsGameBoardID = AllRoundsGameBoardID;
|
|
13047
12977
|
exports.BonusItemsTransform = BonusItemsTransform;
|
|
13048
12978
|
exports.CookieStore = CookieStore;
|