@smartico/public-api 0.0.122 → 0.0.123

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.
@@ -25,6 +25,8 @@ export declare enum ClassId {
25
25
  CLIENT_SET_AVATAR_RESPONSE = 158,
26
26
  CLIENT_SET_CUSTOM_USERNAME_REQUEST = 159,
27
27
  CLIENT_SET_CUSTOM_USERNAME_RESPONSE = 160,
28
+ CHECK_SEGMENT_MATCH_REQUEST = 161,
29
+ CHECK_SEGMENT_MATCH_RESPONSE = 162,
28
30
  GET_LEVEL_MAP_REQUEST = 500,
29
31
  GET_LEVEL_MAP_RESPONSE = 501,
30
32
  GET_ACHIEVEMENT_MAP_REQUEST = 502,
@@ -0,0 +1,4 @@
1
+ import { ProtocolRequest } from "../Base/ProtocolRequest";
2
+ export interface CheckSegmentMatchRequest extends ProtocolRequest {
3
+ segment_id: number[];
4
+ }
@@ -0,0 +1,7 @@
1
+ import { ProtocolResponse } from "../Base/ProtocolResponse";
2
+ export interface CheckSegmentMatchResponse extends ProtocolResponse {
3
+ segments: {
4
+ segment_id: number;
5
+ is_matching: boolean;
6
+ }[];
7
+ }
@@ -1,7 +1,9 @@
1
1
  import { ProtocolMessage } from ".././Base/ProtocolMessage";
2
2
  import { SAWPrize } from "./SAWPrize";
3
+ import { SAWTemplate } from "./SAWTemplate";
3
4
  export interface SAWPrizeDropWinPush extends ProtocolMessage {
4
5
  request_id: string;
5
6
  saw_template_id: number;
6
7
  saw_prize: SAWPrize;
8
+ saw_template: SAWTemplate;
7
9
  }
@@ -1,3 +1,3 @@
1
- import { ProtocolMessage } from "../Base/ProtocolMessage";
2
- export interface AchClaimPrizeRequest extends ProtocolMessage {
1
+ import { ProtocolResponse } from "../Base/ProtocolResponse";
2
+ export interface AchClaimPrizeResponse extends ProtocolResponse {
3
3
  }
@@ -15,3 +15,5 @@ export * from './AchCategoryPublicMeta';
15
15
  export * from './AchievementCategory';
16
16
  export * from './GetAchCategoriesResponse';
17
17
  export * from './GetAchCategoriesRequest';
18
+ export * from './AchClaimPrizeRequest';
19
+ export * from './AchClaimPrizeResponse';
@@ -6,12 +6,12 @@ import { GetTranslationsResponse, PublicLabelSettings, ResponseIdentify, Transla
6
6
  import { GetLabelInfoResponse } from './Core/GetLabelInfoResponse';
7
7
  import { GetInboxMessagesResponse, InboxMessageBody, MarkInboxMessageDeletedResponse, MarkInboxMessageReadResponse, MarkInboxMessageStarredResponse } from './Inbox';
8
8
  import { BuyStoreItemResponse, GetCategoriesStoreResponse, GetStoreItemsResponse } from './Store';
9
- import { AchievementOptinResponse, GetAchCategoriesResponse, GetAchievementMapResponse } from './Missions';
9
+ import { AchClaimPrizeResponse, AchievementOptinResponse, GetAchCategoriesResponse, GetAchievementMapResponse } from './Missions';
10
10
  import { GetTournamentInfoResponse, GetTournamentsResponse, TournamentRegisterResponse } from './Tournaments';
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 } from "./WSAPI/WSAPITypes";
14
+ import { TInboxMessage, TInboxMessageBody, TLevel, TMiniGameTemplate, TMissionOrBadge, TStoreCategory, TAchCategory, TStoreItem, TTournament, TTournamentDetailed, LeaderBoardDetailsT, UserLevelExtraCountersT, TSegmentCheckResult } from "./WSAPI/WSAPITypes";
15
15
  import { GetAchievementsUserInfoResponse } from "./Core/GetAchievementsUserInfoResponse";
16
16
  interface Tracker {
17
17
  label_api_key: string;
@@ -55,11 +55,13 @@ declare class SmarticoAPI {
55
55
  coreChangeUsername(user_ext_id: string, public_username_custom: string): Promise<{
56
56
  public_username_custom: string;
57
57
  }>;
58
+ coreCheckSegments(user_ext_id: string, segment_id: number[]): Promise<TSegmentCheckResult[]>;
58
59
  sawGetTemplates(user_ext_id: string, lang?: string, is_visitor_mode?: boolean): Promise<SAWGetTemplatesResponse>;
59
60
  sawGetTemplatesT(user_ext_id: string): Promise<TMiniGameTemplate[]>;
60
61
  doAcknowledgeRequest(user_ext_id: string, request_id: string): Promise<SAWDoAknowledgeResponse>;
61
62
  sawSpinRequest(user_ext_id: string, saw_template_id: number, round_id?: number): Promise<SAWDoSpinResponse>;
62
63
  missionOptIn(user_ext_id: string, mission_id: number): Promise<AchievementOptinResponse>;
64
+ missionClaimPrize(user_ext_id: string, mission_id: number, ach_completed_id: number): Promise<AchClaimPrizeResponse>;
63
65
  registerInTournament(user_ext_id: string, tournamentInstanceId: number): Promise<TournamentRegisterResponse>;
64
66
  buyStoreItem(user_ext_id: string, itemId: number): Promise<BuyStoreItemResponse>;
65
67
  inboxGetMessages(user_ext_id: string, limit?: number, offset?: number): Promise<GetInboxMessagesResponse>;
@@ -1,5 +1,5 @@
1
1
  import { SmarticoAPI } from "../SmarticoAPI";
2
- import { InboxMarkMessageAction, LeaderBoardDetailsT, TAchCategory, TBuyStoreItemResult, TGetTranslations, TInboxMessage, TInboxMessageBody, TLevel, TMiniGamePlayResult, TMiniGameTemplate, TMissionOptInResult, TMissionOrBadge, TStoreCategory, TStoreItem, TTournament, TTournamentDetailed, TTournamentRegistrationResult, TUserProfile, UserLevelExtraCountersT } from "./WSAPITypes";
2
+ import { InboxMarkMessageAction, LeaderBoardDetailsT, TAchCategory, TBuyStoreItemResult, TGetTranslations, TInboxMessage, TInboxMessageBody, TLevel, TMiniGamePlayResult, TMiniGameTemplate, TMissionClaimRewardResult, TMissionOptInResult, TMissionOrBadge, TSegmentCheckResult, TStoreCategory, TStoreItem, TTournament, TTournamentDetailed, TTournamentRegistrationResult, TUserProfile, UserLevelExtraCountersT } from "./WSAPITypes";
3
3
  import { LeaderBoardPeriodType } from "../Leaderboard";
4
4
  /** @group General API */
5
5
  export declare class WSAPI {
@@ -9,6 +9,10 @@ export declare class WSAPI {
9
9
  constructor(api: SmarticoAPI);
10
10
  /** Returns information about current user */
11
11
  getUserProfile(): TUserProfile;
12
+ /** Check if user belongs to specific segments */
13
+ checkSegmentMatch(segment_id: number): Promise<boolean>;
14
+ /** Check if user belongs to specific list of segments */
15
+ checkSegmentListMatch(segment_ids: number[]): Promise<TSegmentCheckResult[]>;
12
16
  /** Returns all the levels available the current user */
13
17
  getLevels(): Promise<TLevel[]>;
14
18
  /** Returns all the missions available the current user.
@@ -46,6 +50,8 @@ export declare class WSAPI {
46
50
  playMiniGame(template_id: number): Promise<TMiniGamePlayResult>;
47
51
  /** Requests an opt-in for the specified mission_id. Returns the err_code. */
48
52
  requestMissionOptIn(mission_id: number): Promise<TMissionOptInResult>;
53
+ /** Request for claim reward for the specified mission id. Returns the err_code. */
54
+ requestMissionClaimReward(mission_id: number, ach_completed_id: number): Promise<TMissionClaimRewardResult>;
49
55
  /** Returns all the active instances of tournaments
50
56
  * The returned list is cached for 30 seconds. But you can pass the onUpdate callback as a parameter. Note that each time you call getTournamentsList with a new onUpdate callback, the old one will be overwritten by the new one.
51
57
  * The onUpdate callback will be called when the user has registered in a tournament. Updated list will be passed to onUpdate callback.*/
@@ -400,6 +400,12 @@ export interface TMissionOrBadge {
400
400
  position?: number;
401
401
  /** The ribbon of the mission/badge item. Can be 'sale', 'hot', 'new', 'vip' or URL to the image in case of custom ribbon */
402
402
  ribbon?: TRibbon;
403
+ /** ID of the completion fact from ach_completed or ach_completed_recurring tables */
404
+ ach_completed_id?: number;
405
+ /** Flag from achievement if the mission prize will be given only after user claims it */
406
+ requires_prize_claim?: boolean;
407
+ /** The date/timestamp indicating when the prize was claimed by the user */
408
+ prize_claimed_date_ts?: number;
403
409
  }
404
410
  export interface AchRelatedGame {
405
411
  /** The ID of the related game */
@@ -444,6 +450,15 @@ export interface TMissionOptInResult {
444
450
  /** Optional error message */
445
451
  err_message: string;
446
452
  }
453
+ /**
454
+ * TMissionClaimRewardResult describes the response of call to _smartico.api.requestMissionClaimReward(mission_id, ach_completed_id) method
455
+ */
456
+ export interface TMissionClaimRewardResult {
457
+ /** Error code that represents outcome of the claim request. Successful claim reward in case err_code is 0 */
458
+ err_code: number;
459
+ /** Optional error message */
460
+ err_message: string;
461
+ }
447
462
  export interface TTournamentRegistrationResult {
448
463
  /** Error code that represents outcome of the tournament registration request. Successful registration in case err_code is 0 */
449
464
  err_code: TournamentRegistrationError;
@@ -539,4 +554,8 @@ export interface UserLevelExtraCountersT {
539
554
  /** The counter of 2nd metric used to reach the level. */
540
555
  level_counter_2?: number;
541
556
  }
557
+ export interface TSegmentCheckResult {
558
+ segment_id: number;
559
+ is_matching: boolean;
560
+ }
542
561
  export {};