@smartico/public-api 0.0.316 → 0.0.317
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/Inbox/GetInboxMessagesRequest.d.ts +2 -0
- package/dist/Inbox/InboxReadStatus.d.ts +4 -0
- package/dist/Inbox/index.d.ts +1 -0
- package/dist/SmarticoAPI.d.ts +3 -3
- package/dist/WSAPI/WSAPI.d.ts +6 -2
- package/dist/index.js +16 -6
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +17 -7
- package/dist/index.modern.mjs.map +1 -1
- package/docs/classes/WSAPI.md +4 -1
- package/package.json +1 -1
- package/src/Inbox/GetInboxMessagesRequest.ts +2 -0
- package/src/Inbox/InboxReadStatus.ts +4 -0
- package/src/Inbox/index.ts +1 -0
- package/src/SmarticoAPI.ts +5 -1
- package/src/WSAPI/WSAPI.ts +7 -2
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { InboxCategories } from './InboxCategories';
|
|
2
2
|
import { ProtocolMessage } from '../Base/ProtocolMessage';
|
|
3
|
+
import { InboxReadStatus } from './InboxReadStatus';
|
|
3
4
|
export interface GetInboxMessagesRequest extends ProtocolMessage {
|
|
4
5
|
limit?: number;
|
|
5
6
|
offset?: number;
|
|
6
7
|
starred_only?: boolean;
|
|
7
8
|
category_id?: InboxCategories;
|
|
9
|
+
read_status?: InboxReadStatus;
|
|
8
10
|
}
|
package/dist/Inbox/index.d.ts
CHANGED
package/dist/SmarticoAPI.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { ILogger } from './ILogger';
|
|
|
4
4
|
import { SAWDoAknowledgeResponse, SAWDoSpinResponse, SAWPrizesHistory, SAWWinningHistoryResponse } from './MiniGames';
|
|
5
5
|
import { GetTranslationsResponse, PublicLabelSettings, ResponseIdentify, TranslationArea } from './Core';
|
|
6
6
|
import { GetLabelInfoResponse } from './Core/GetLabelInfoResponse';
|
|
7
|
-
import { GetInboxMessagesResponse, InboxMessageBody, MarkInboxMessageDeletedResponse, MarkInboxMessageReadResponse, MarkInboxMessageStarredResponse } from './Inbox';
|
|
7
|
+
import { GetInboxMessagesResponse, InboxMessageBody, InboxReadStatus, MarkInboxMessageDeletedResponse, MarkInboxMessageReadResponse, MarkInboxMessageStarredResponse } from './Inbox';
|
|
8
8
|
import { BuyStoreItemResponse, GetCategoriesStoreResponse, GetStoreHistoryResponse, GetStoreItemsResponse } from './Store';
|
|
9
9
|
import { AchClaimPrizeResponse, AchievementOptinResponse, GetAchCategoriesResponse, GetAchievementMapResponse } from './Missions';
|
|
10
10
|
import { GetTournamentInfoResponse, GetTournamentsResponse, TournamentRegisterResponse } from './Tournaments';
|
|
@@ -134,8 +134,8 @@ declare class SmarticoAPI {
|
|
|
134
134
|
customSectionsGet(user_ext_id: string, force_language?: string): Promise<GetCustomSectionsResponse>;
|
|
135
135
|
customSectionsGetT(user_ext_id: string): Promise<TUICustomSection[]>;
|
|
136
136
|
getTranslationsT(user_ext_id: string, lang_code: string, areas: TranslationArea[], cacheSec?: number): Promise<GetTranslationsResponse>;
|
|
137
|
-
getInboxMessages(user_ext_id: string, limit: number, offset: number, starred_only: boolean, category_id?: InboxCategories): Promise<GetInboxMessagesResponse>;
|
|
138
|
-
getInboxMessagesT(user_ext_id: string, from?: number, to?: number, favoriteOnly?: boolean, categoryId?: InboxCategories): Promise<TInboxMessage[]>;
|
|
137
|
+
getInboxMessages(user_ext_id: string, limit: number, offset: number, starred_only: boolean, category_id?: InboxCategories, read_status?: InboxReadStatus): Promise<GetInboxMessagesResponse>;
|
|
138
|
+
getInboxMessagesT(user_ext_id: string, from?: number, to?: number, favoriteOnly?: boolean, categoryId?: InboxCategories, read_status?: InboxReadStatus): Promise<TInboxMessage[]>;
|
|
139
139
|
getInboxUnreadCountT(user_ext_id: string): Promise<number>;
|
|
140
140
|
getInboxMessageBody(messageGuid: string): Promise<InboxMessageBody>;
|
|
141
141
|
getInboxMessageBodyT(messageGuid: string): Promise<TInboxMessageBody>;
|
package/dist/WSAPI/WSAPI.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { JackpotDetails, JackpotWinnerHistory, JackpotsOptinResponse, JackpotsOp
|
|
|
5
5
|
import { GetRelatedAchTourResponse } from '../Missions/GetRelatedAchTourResponse';
|
|
6
6
|
import { InboxCategories } from '../Inbox/InboxCategories';
|
|
7
7
|
import { TGetJackpotEligibleGamesResponse } from '../Jackpots/GetJackpotEligibleGamesResponse';
|
|
8
|
+
import { InboxReadStatus } from '../Inbox/InboxReadStatus';
|
|
8
9
|
/** @group General API */
|
|
9
10
|
export declare class WSAPI {
|
|
10
11
|
private api;
|
|
@@ -425,7 +426,9 @@ export declare class WSAPI {
|
|
|
425
426
|
*/
|
|
426
427
|
getLeaderBoard(periodType: LeaderBoardPeriodType, getPreviousPeriod?: boolean): Promise<LeaderBoardDetailsT>;
|
|
427
428
|
/** Returns inbox messages based on the provided parameters. "From" and "to" indicate the range of messages to be fetched.
|
|
428
|
-
* The maximum number of messages per request is limited to 20.
|
|
429
|
+
* The maximum number of messages per request is limited to 20.
|
|
430
|
+
* An indicator "onlyFavorite" can be passed to get only messages marked as favorites.
|
|
431
|
+
* An indicator "read_status" can be passed to get only messages marked as read or unread.
|
|
429
432
|
* You can leave this params empty and by default it will return list of messages ranging from 0 to 20.
|
|
430
433
|
* This functions return list of messages without the body of the message.
|
|
431
434
|
* To get the body of the message you need to call getInboxMessageBody function and pass the message guid contained in each message of this request.
|
|
@@ -436,11 +439,12 @@ export declare class WSAPI {
|
|
|
436
439
|
*
|
|
437
440
|
* @param params
|
|
438
441
|
*/
|
|
439
|
-
getInboxMessages({ from, to, onlyFavorite, categoryId, onUpdate, }?: {
|
|
442
|
+
getInboxMessages({ from, to, onlyFavorite, categoryId, read_status, onUpdate, }?: {
|
|
440
443
|
from?: number;
|
|
441
444
|
to?: number;
|
|
442
445
|
onlyFavorite?: boolean;
|
|
443
446
|
categoryId?: InboxCategories;
|
|
447
|
+
read_status?: InboxReadStatus;
|
|
444
448
|
onUpdate?: (data: TInboxMessage[]) => void;
|
|
445
449
|
}): Promise<TInboxMessage[]>;
|
|
446
450
|
/**
|
package/dist/index.js
CHANGED
|
@@ -888,6 +888,12 @@ exports.InboxCategories = void 0;
|
|
|
888
888
|
InboxCategories[InboxCategories["Personal"] = 2] = "Personal";
|
|
889
889
|
})(exports.InboxCategories || (exports.InboxCategories = {}));
|
|
890
890
|
|
|
891
|
+
exports.InboxReadStatus = void 0;
|
|
892
|
+
(function (InboxReadStatus) {
|
|
893
|
+
InboxReadStatus[InboxReadStatus["UnreadOnly"] = 1] = "UnreadOnly";
|
|
894
|
+
InboxReadStatus[InboxReadStatus["ReadOnly"] = 2] = "ReadOnly";
|
|
895
|
+
})(exports.InboxReadStatus || (exports.InboxReadStatus = {}));
|
|
896
|
+
|
|
891
897
|
exports.BuyStoreItemErrorCode = void 0;
|
|
892
898
|
(function (BuyStoreItemErrorCode) {
|
|
893
899
|
/** User don't have enough points on balance */
|
|
@@ -2803,7 +2809,9 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
2803
2809
|
}
|
|
2804
2810
|
}
|
|
2805
2811
|
/** Returns inbox messages based on the provided parameters. "From" and "to" indicate the range of messages to be fetched.
|
|
2806
|
-
* The maximum number of messages per request is limited to 20.
|
|
2812
|
+
* The maximum number of messages per request is limited to 20.
|
|
2813
|
+
* An indicator "onlyFavorite" can be passed to get only messages marked as favorites.
|
|
2814
|
+
* An indicator "read_status" can be passed to get only messages marked as read or unread.
|
|
2807
2815
|
* You can leave this params empty and by default it will return list of messages ranging from 0 to 20.
|
|
2808
2816
|
* This functions return list of messages without the body of the message.
|
|
2809
2817
|
* To get the body of the message you need to call getInboxMessageBody function and pass the message guid contained in each message of this request.
|
|
@@ -2821,13 +2829,14 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
2821
2829
|
to = _ref10.to,
|
|
2822
2830
|
onlyFavorite = _ref10.onlyFavorite,
|
|
2823
2831
|
categoryId = _ref10.categoryId,
|
|
2832
|
+
read_status = _ref10.read_status,
|
|
2824
2833
|
onUpdate = _ref10.onUpdate;
|
|
2825
2834
|
try {
|
|
2826
2835
|
var _this28 = this;
|
|
2827
2836
|
if (onUpdate) {
|
|
2828
2837
|
_this28.onUpdateCallback.set(onUpdateContextKey.InboxMessages, onUpdate);
|
|
2829
2838
|
}
|
|
2830
|
-
return Promise.resolve(_this28.api.getInboxMessagesT(null, from, to, onlyFavorite, categoryId));
|
|
2839
|
+
return Promise.resolve(_this28.api.getInboxMessagesT(null, from, to, onlyFavorite, categoryId, read_status));
|
|
2831
2840
|
} catch (e) {
|
|
2832
2841
|
return Promise.reject(e);
|
|
2833
2842
|
}
|
|
@@ -4648,7 +4657,7 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
4648
4657
|
return Promise.reject(e);
|
|
4649
4658
|
}
|
|
4650
4659
|
};
|
|
4651
|
-
_proto.getInboxMessages = function getInboxMessages(user_ext_id, limit, offset, starred_only, category_id) {
|
|
4660
|
+
_proto.getInboxMessages = function getInboxMessages(user_ext_id, limit, offset, starred_only, category_id, read_status) {
|
|
4652
4661
|
if (limit === void 0) {
|
|
4653
4662
|
limit = 20;
|
|
4654
4663
|
}
|
|
@@ -4661,14 +4670,15 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
4661
4670
|
limit: limit,
|
|
4662
4671
|
offset: offset,
|
|
4663
4672
|
starred_only: starred_only,
|
|
4664
|
-
category_id: category_id
|
|
4673
|
+
category_id: category_id,
|
|
4674
|
+
read_status: read_status
|
|
4665
4675
|
});
|
|
4666
4676
|
return Promise.resolve(_this58.send(message, exports.ClassId.GET_INBOX_MESSAGES_RESPONSE));
|
|
4667
4677
|
} catch (e) {
|
|
4668
4678
|
return Promise.reject(e);
|
|
4669
4679
|
}
|
|
4670
4680
|
};
|
|
4671
|
-
_proto.getInboxMessagesT = function getInboxMessagesT(user_ext_id, from, to, favoriteOnly, categoryId) {
|
|
4681
|
+
_proto.getInboxMessagesT = function getInboxMessagesT(user_ext_id, from, to, favoriteOnly, categoryId, read_status) {
|
|
4672
4682
|
if (from === void 0) {
|
|
4673
4683
|
from = 0;
|
|
4674
4684
|
}
|
|
@@ -4682,7 +4692,7 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
4682
4692
|
var _this59 = this;
|
|
4683
4693
|
var limit = to - from > 20 ? 20 : to - from;
|
|
4684
4694
|
var offset = from;
|
|
4685
|
-
return Promise.resolve(_this59.getInboxMessages(user_ext_id, limit, offset, favoriteOnly, categoryId)).then(function (_this59$getInboxMessa) {
|
|
4695
|
+
return Promise.resolve(_this59.getInboxMessages(user_ext_id, limit, offset, favoriteOnly, categoryId, read_status)).then(function (_this59$getInboxMessa) {
|
|
4686
4696
|
return InboxMessagesTransform(_this59$getInboxMessa.log);
|
|
4687
4697
|
});
|
|
4688
4698
|
} catch (e) {
|