@smartico/public-api 0.0.217 → 0.0.218
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/InboxCategories.d.ts +5 -0
- package/dist/Inbox/InboxMessage.d.ts +2 -0
- package/dist/Inbox/index.d.ts +1 -0
- package/dist/SmarticoAPI.d.ts +3 -2
- package/dist/WSAPI/WSAPI.d.ts +3 -1
- package/dist/WSAPI/WSAPITypes.d.ts +3 -0
- 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 +1 -0
- package/docs/interfaces/TInboxMessage.md +8 -0
- package/package.json +1 -1
- package/src/Inbox/GetInboxMessagesRequest.ts +2 -0
- package/src/Inbox/GetInboxMessagesResponse.ts +1 -0
- package/src/Inbox/InboxCategories.ts +5 -0
- package/src/Inbox/InboxMessage.ts +3 -0
- package/src/Inbox/index.ts +1 -0
- package/src/SmarticoAPI.ts +5 -1
- package/src/WSAPI/WSAPI.ts +4 -3
- package/src/WSAPI/WSAPITypes.ts +3 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { InboxCategories } from './InboxCategories';
|
|
1
2
|
import { ProtocolMessage } from '../Base/ProtocolMessage';
|
|
2
3
|
export interface GetInboxMessagesRequest extends ProtocolMessage {
|
|
3
4
|
limit?: number;
|
|
4
5
|
offset?: number;
|
|
5
6
|
starred_only?: boolean;
|
|
7
|
+
category_id?: InboxCategories;
|
|
6
8
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TInboxMessageBody } from '../WSAPI/WSAPITypes';
|
|
2
|
+
import { InboxCategories } from './InboxCategories';
|
|
2
3
|
import { InboxMessageType } from './InboxMessageType';
|
|
3
4
|
import { OpenLinksType } from './OpenLinksType';
|
|
4
5
|
export interface InboxMessageBody {
|
|
@@ -24,5 +25,6 @@ export interface InboxMessage {
|
|
|
24
25
|
is_read: boolean;
|
|
25
26
|
is_starred: boolean;
|
|
26
27
|
is_deleted?: boolean;
|
|
28
|
+
category_id?: InboxCategories;
|
|
27
29
|
}
|
|
28
30
|
export declare const InboxMessageBodyTransform: (item: InboxMessageBody) => TInboxMessageBody;
|
package/dist/Inbox/index.d.ts
CHANGED
package/dist/SmarticoAPI.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ import { SAWDoSpinBatchResponse } from './MiniGames/SAWDoSpinBatchResponse';
|
|
|
20
20
|
import { SAWDoAcknowledgeBatchResponse } from './MiniGames/SAWDoAcknowledgeBatchResponse';
|
|
21
21
|
import { GetRelatedAchTourResponse } from './Missions/GetRelatedAchTourResponse';
|
|
22
22
|
import { GetRafflesResponse } from './Raffle/GetRafflesResponse';
|
|
23
|
+
import { InboxCategories } from './Inbox/InboxCategories';
|
|
23
24
|
interface Tracker {
|
|
24
25
|
label_api_key: string;
|
|
25
26
|
userPublicProps: any;
|
|
@@ -117,8 +118,8 @@ declare class SmarticoAPI {
|
|
|
117
118
|
getCustomSections(user_ext_id: string): Promise<GetCustomSectionsResponse>;
|
|
118
119
|
getCustomSectionsT(user_ext_id: string): Promise<TUICustomSection[]>;
|
|
119
120
|
getTranslationsT(user_ext_id: string, lang_code: string, areas: TranslationArea[], cacheSec?: number): Promise<GetTranslationsResponse>;
|
|
120
|
-
getInboxMessages(user_ext_id: string, limit: number, offset: number, starred_only: boolean): Promise<GetInboxMessagesResponse>;
|
|
121
|
-
getInboxMessagesT(user_ext_id: string, from?: number, to?: number, favoriteOnly?: boolean): Promise<TInboxMessage[]>;
|
|
121
|
+
getInboxMessages(user_ext_id: string, limit: number, offset: number, starred_only: boolean, category_id?: InboxCategories): Promise<GetInboxMessagesResponse>;
|
|
122
|
+
getInboxMessagesT(user_ext_id: string, from?: number, to?: number, favoriteOnly?: boolean, categoryId?: InboxCategories): Promise<TInboxMessage[]>;
|
|
122
123
|
getInboxMessageBody(messageGuid: string): Promise<InboxMessageBody>;
|
|
123
124
|
getInboxMessageBodyT(messageGuid: string): Promise<TInboxMessageBody>;
|
|
124
125
|
markInboxMessageRead(user_ext_id: string, messageGuid: string): Promise<MarkInboxMessageReadResponse>;
|
package/dist/WSAPI/WSAPI.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { LeaderBoardPeriodType } from '../Leaderboard';
|
|
|
4
4
|
import { JackpotDetails, JackpotsOptinResponse, JackpotsOptoutResponse } from '../Jackpots';
|
|
5
5
|
import { GetRelatedAchTourResponse } from 'src/Missions/GetRelatedAchTourResponse';
|
|
6
6
|
import { GetRafflesResponse } from '../Raffle/GetRafflesResponse';
|
|
7
|
+
import { InboxCategories } from '../Inbox/InboxCategories';
|
|
7
8
|
/** @group General API */
|
|
8
9
|
export declare class WSAPI {
|
|
9
10
|
private api;
|
|
@@ -412,10 +413,11 @@ export declare class WSAPI {
|
|
|
412
413
|
*
|
|
413
414
|
* @param params
|
|
414
415
|
*/
|
|
415
|
-
getInboxMessages({ from, to, onlyFavorite, onUpdate, }?: {
|
|
416
|
+
getInboxMessages({ from, to, onlyFavorite, categoryId, onUpdate, }?: {
|
|
416
417
|
from?: number;
|
|
417
418
|
to?: number;
|
|
418
419
|
onlyFavorite?: boolean;
|
|
420
|
+
categoryId?: InboxCategories;
|
|
419
421
|
onUpdate?: (data: TInboxMessage[]) => void;
|
|
420
422
|
}): Promise<TInboxMessage[]>;
|
|
421
423
|
/**
|
|
@@ -6,6 +6,7 @@ import { LeaderBoardPeriodType } from '../Leaderboard';
|
|
|
6
6
|
import { AchCustomLayoutTheme, AchCustomSectionType, AchMissionsTabsOptions, AchOverviewMissionsFilter } from '../CustomSections';
|
|
7
7
|
import { BonusStatus, BonusTemplateMetaMap, BonusMetaMap } from '../Bonuses';
|
|
8
8
|
import { PrizeModifiers } from '../MiniGames/PrizeModifiers';
|
|
9
|
+
import { InboxCategories } from '../Inbox/InboxCategories';
|
|
9
10
|
type TRibbon = 'sale' | 'hot' | 'new' | 'vip' | string;
|
|
10
11
|
/**
|
|
11
12
|
* TMiniGamePrize describes the information of prize in the array of prizes in the TMiniGameTemplate
|
|
@@ -620,6 +621,8 @@ export interface TInboxMessage {
|
|
|
620
621
|
read: boolean;
|
|
621
622
|
/** Indicator if a message is added to favorites */
|
|
622
623
|
favorite: boolean;
|
|
624
|
+
/** Category id per inbox message, can be part of System inboxes, Personal inboxes or General inbox messages */
|
|
625
|
+
category_id?: InboxCategories;
|
|
623
626
|
}
|
|
624
627
|
export interface TInboxMessageBody {
|
|
625
628
|
/** Message title */
|
package/dist/index.js
CHANGED
|
@@ -763,7 +763,8 @@ var InboxMessagesTransform = function InboxMessagesTransform(items) {
|
|
|
763
763
|
sent_date: item.createDate,
|
|
764
764
|
message_guid: item.engagement_uid,
|
|
765
765
|
read: item.is_read,
|
|
766
|
-
favorite: item.is_starred
|
|
766
|
+
favorite: item.is_starred,
|
|
767
|
+
category_id: item.category_id
|
|
767
768
|
};
|
|
768
769
|
return x;
|
|
769
770
|
});
|
|
@@ -810,6 +811,13 @@ exports.OpenLinksType = void 0;
|
|
|
810
811
|
OpenLinksType[OpenLinksType["CurrentWindow"] = 2] = "CurrentWindow";
|
|
811
812
|
})(exports.OpenLinksType || (exports.OpenLinksType = {}));
|
|
812
813
|
|
|
814
|
+
exports.InboxCategories = void 0;
|
|
815
|
+
(function (InboxCategories) {
|
|
816
|
+
InboxCategories[InboxCategories["General"] = 0] = "General";
|
|
817
|
+
InboxCategories[InboxCategories["Platform"] = 1] = "Platform";
|
|
818
|
+
InboxCategories[InboxCategories["Personal"] = 2] = "Personal";
|
|
819
|
+
})(exports.InboxCategories || (exports.InboxCategories = {}));
|
|
820
|
+
|
|
813
821
|
exports.BuyStoreItemErrorCode = void 0;
|
|
814
822
|
(function (BuyStoreItemErrorCode) {
|
|
815
823
|
BuyStoreItemErrorCode[BuyStoreItemErrorCode["FAILED_TO_BUY_SHOP_ITEM"] = 121] = "FAILED_TO_BUY_SHOP_ITEM";
|
|
@@ -2330,13 +2338,14 @@ var WSAPI = /*#__PURE__*/function () {
|
|
|
2330
2338
|
from = _ref9.from,
|
|
2331
2339
|
to = _ref9.to,
|
|
2332
2340
|
onlyFavorite = _ref9.onlyFavorite,
|
|
2341
|
+
categoryId = _ref9.categoryId,
|
|
2333
2342
|
onUpdate = _ref9.onUpdate;
|
|
2334
2343
|
try {
|
|
2335
2344
|
var _this27 = this;
|
|
2336
2345
|
if (onUpdate) {
|
|
2337
2346
|
_this27.onUpdateCallback.set(onUpdateContextKey.InboxMessages, onUpdate);
|
|
2338
2347
|
}
|
|
2339
|
-
return Promise.resolve(_this27.api.getInboxMessagesT(null, from, to, onlyFavorite));
|
|
2348
|
+
return Promise.resolve(_this27.api.getInboxMessagesT(null, from, to, onlyFavorite, categoryId));
|
|
2340
2349
|
} catch (e) {
|
|
2341
2350
|
return Promise.reject(e);
|
|
2342
2351
|
}
|
|
@@ -3746,7 +3755,7 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
3746
3755
|
return Promise.reject(e);
|
|
3747
3756
|
}
|
|
3748
3757
|
};
|
|
3749
|
-
_proto.getInboxMessages = function getInboxMessages(user_ext_id, limit, offset, starred_only) {
|
|
3758
|
+
_proto.getInboxMessages = function getInboxMessages(user_ext_id, limit, offset, starred_only, category_id) {
|
|
3750
3759
|
if (limit === void 0) {
|
|
3751
3760
|
limit = 20;
|
|
3752
3761
|
}
|
|
@@ -3758,14 +3767,15 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
3758
3767
|
var message = _this53.buildMessage(user_ext_id, exports.ClassId.GET_INBOX_MESSAGES_REQUEST, {
|
|
3759
3768
|
limit: limit,
|
|
3760
3769
|
offset: offset,
|
|
3761
|
-
starred_only: starred_only
|
|
3770
|
+
starred_only: starred_only,
|
|
3771
|
+
category_id: category_id
|
|
3762
3772
|
});
|
|
3763
3773
|
return Promise.resolve(_this53.send(message, exports.ClassId.GET_INBOX_MESSAGES_RESPONSE));
|
|
3764
3774
|
} catch (e) {
|
|
3765
3775
|
return Promise.reject(e);
|
|
3766
3776
|
}
|
|
3767
3777
|
};
|
|
3768
|
-
_proto.getInboxMessagesT = function getInboxMessagesT(user_ext_id, from, to, favoriteOnly) {
|
|
3778
|
+
_proto.getInboxMessagesT = function getInboxMessagesT(user_ext_id, from, to, favoriteOnly, categoryId) {
|
|
3769
3779
|
if (from === void 0) {
|
|
3770
3780
|
from = 0;
|
|
3771
3781
|
}
|
|
@@ -3779,7 +3789,7 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
3779
3789
|
var _this54 = this;
|
|
3780
3790
|
var limit = to - from > 20 ? 20 : to - from;
|
|
3781
3791
|
var offset = from;
|
|
3782
|
-
return Promise.resolve(_this54.getInboxMessages(user_ext_id, limit, offset, favoriteOnly)).then(function (_this54$getInboxMessa) {
|
|
3792
|
+
return Promise.resolve(_this54.getInboxMessages(user_ext_id, limit, offset, favoriteOnly, categoryId)).then(function (_this54$getInboxMessa) {
|
|
3783
3793
|
return InboxMessagesTransform(_this54$getInboxMessa.log);
|
|
3784
3794
|
});
|
|
3785
3795
|
} catch (e) {
|