@smartico/public-api 0.0.8 → 0.0.10
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/Core/ActivityTypeLimited.d.ts +7 -0
- package/dist/Core/index.d.ts +2 -1
- package/dist/SmarticoAPI.d.ts +11 -4
- package/dist/Store/BuyStoreItemErrorCode.d.ts +10 -0
- package/dist/Store/BuyStoreItemRequest.d.ts +4 -0
- package/dist/Store/BuyStoreItemResponse.d.ts +4 -0
- package/dist/Store/GetCategoriesStoreResponse.d.ts +5 -0
- package/dist/Store/GetStoreItemsResponse.d.ts +5 -0
- package/dist/Store/StoreCategory.d.ts +5 -0
- package/dist/Store/StoreCategoryPublicMeta.d.ts +4 -0
- package/dist/Store/StoreItem.d.ts +9 -0
- package/dist/Store/StoreItemPublicMeta.d.ts +10 -0
- package/dist/Store/StoreItemType.d.ts +4 -0
- package/dist/Store/index.d.ts +11 -11
- package/dist/Tournaments/GetTournamentInfoRequest.d.ts +4 -0
- package/dist/Tournaments/GetTournamentInfoResponse.d.ts +20 -0
- package/dist/Tournaments/GetTournamentsRequest.d.ts +3 -0
- package/dist/Tournaments/GetTournamentsResponse.d.ts +6 -0
- package/dist/Tournaments/Tournament.d.ts +43 -0
- package/dist/Tournaments/TournamentInstanceStatus.d.ts +10 -0
- package/dist/Tournaments/TournamentPlayer.d.ts +9 -0
- package/dist/Tournaments/TournamentPrize.d.ts +10 -0
- package/dist/Tournaments/TournamentPublicMeta.d.ts +22 -0
- package/dist/Tournaments/TournamentRegisterRequest.d.ts +4 -0
- package/dist/Tournaments/TournamentRegisterResponse.d.ts +5 -0
- package/dist/Tournaments/TournamentRegistrationError.d.ts +11 -0
- package/dist/Tournaments/TournamentRegistrationStatus.d.ts +9 -0
- package/dist/Tournaments/TournamentRegistrationType.d.ts +7 -0
- package/dist/Tournaments/TournamentType.d.ts +5 -0
- package/dist/Tournaments/index.d.ts +16 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +121 -66
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +102 -43
- package/dist/index.modern.mjs.map +1 -1
- package/package.json +2 -2
- package/src/Core/ActivityTypeLimited.ts +8 -0
- package/src/Core/index.ts +3 -1
- package/src/SmarticoAPI.ts +47 -37
- package/src/Store/{BuyShopItemErrorCode.ts → BuyStoreItemErrorCode.ts} +1 -1
- package/src/Store/{BuyShopItemRequest.ts → BuyStoreItemRequest.ts} +1 -1
- package/src/Store/{BuyShopItemResponse.ts → BuyStoreItemResponse.ts} +1 -1
- package/src/Store/GetCategoriesStoreResponse.ts +11 -0
- package/src/Store/GetStoreItemsResponse.ts +7 -0
- package/src/Store/StoreCategory.ts +7 -0
- package/src/Store/StoreCategoryPublicMeta.ts +5 -0
- package/src/Store/StoreItem.ts +10 -0
- package/src/Store/{ShopItemPublicMeta.ts → StoreItemPublicMeta.ts} +1 -1
- package/src/Store/{ShopItemType.ts → StoreItemType.ts} +1 -1
- package/src/Store/index.ts +20 -20
- package/src/Tournaments/GetTournamentInfoRequest.ts +6 -0
- package/src/Tournaments/GetTournamentInfoResponse.ts +25 -0
- package/src/Tournaments/GetTournamentsRequest.ts +5 -0
- package/src/Tournaments/GetTournamentsResponse.ts +8 -0
- package/src/Tournaments/Tournament.ts +47 -0
- package/src/Tournaments/TournamentInstanceStatus.ts +22 -0
- package/src/Tournaments/TournamentPlayer.ts +11 -0
- package/src/Tournaments/TournamentPrize.ts +12 -0
- package/src/Tournaments/TournamentPublicMeta.ts +26 -0
- package/src/Tournaments/TournamentRegisterRequest.ts +6 -0
- package/src/Tournaments/TournamentRegisterResponse.ts +10 -0
- package/src/Tournaments/TournamentRegistrationError.ts +11 -0
- package/src/Tournaments/TournamentRegistrationStatus.ts +11 -0
- package/src/Tournaments/TournamentRegistrationType.ts +9 -0
- package/src/Tournaments/TournamentType.ts +6 -0
- package/src/Tournaments/index.ts +33 -0
- package/src/index.ts +3 -1
- package/src/Store/GetCategoriesShopResponse.ts +0 -11
- package/src/Store/GetShopItemsResponse.ts +0 -7
- package/src/Store/ShopCategory.ts +0 -7
- package/src/Store/ShopCategoryPublicMeta.ts +0 -5
- package/src/Store/ShopItem.ts +0 -10
package/dist/Core/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ActivityTypeLimited } from './ActivityTypeLimited';
|
|
1
2
|
import { GetLabelInfoRequest } from './GetLabelInfoRequest';
|
|
2
3
|
import { GetLabelInfoResponse } from './GetLabelInfoResponse';
|
|
3
4
|
import { GetTranslationsRequest } from './GetTranslationsRequest';
|
|
@@ -5,4 +6,4 @@ import { GetTranslationsResponse } from './GetTranslationsResponse';
|
|
|
5
6
|
import { PublicLabelSettings } from './PublicLabelSettings';
|
|
6
7
|
import { ResponseIdentify } from './ResponseIdentify';
|
|
7
8
|
import { TranslationArea } from './TranslationArea';
|
|
8
|
-
export { GetTranslationsRequest, GetTranslationsResponse, GetLabelInfoRequest, GetLabelInfoResponse, TranslationArea, PublicLabelSettings, ResponseIdentify };
|
|
9
|
+
export { GetTranslationsRequest, GetTranslationsResponse, GetLabelInfoRequest, GetLabelInfoResponse, TranslationArea, PublicLabelSettings, ResponseIdentify, ActivityTypeLimited };
|
package/dist/SmarticoAPI.d.ts
CHANGED
|
@@ -1,25 +1,29 @@
|
|
|
1
1
|
import { ClassId } from "./Base/ClassId";
|
|
2
2
|
import { SAWGetTemplatesResponse } from './MiniGames/SAWGetTemplatesResponse';
|
|
3
|
-
import { SAWTemplate } from './MiniGames/SAWTemplate';
|
|
4
3
|
import { ILogger } from './ILogger';
|
|
5
4
|
import { SAWDoSpinResponse } from './MiniGames';
|
|
6
5
|
import { GetTranslationsResponse, ResponseIdentify, TranslationArea } from './Core';
|
|
7
6
|
import { GetLabelInfoResponse } from './Core/GetLabelInfoResponse';
|
|
8
7
|
import { GetInboxMessagesResponse } from './Inbox';
|
|
8
|
+
import { GetStoreItemsResponse } from './Store';
|
|
9
|
+
import { GetAchievementMapResponse } from './Missions';
|
|
10
|
+
import { GetTournamentInfoResponse, GetTournamentsResponse } from './Tournaments';
|
|
9
11
|
interface IOptions {
|
|
10
12
|
logger?: ILogger;
|
|
11
13
|
logCIDs?: ClassId[];
|
|
12
14
|
logHTTPTiming?: boolean;
|
|
13
15
|
}
|
|
16
|
+
type MessageSender = (message: any, publicApuUrl: string) => Promise<any>;
|
|
14
17
|
declare class SmarticoAPI {
|
|
15
18
|
private label_api_key;
|
|
16
19
|
private brand_api_key;
|
|
20
|
+
private messageSender;
|
|
17
21
|
private publicUrl;
|
|
18
22
|
private avatarDomain;
|
|
19
23
|
private logger;
|
|
20
24
|
private logCIDs;
|
|
21
25
|
private logHTTPTiming;
|
|
22
|
-
constructor(label_api_key: string, brand_api_key: string, options?: IOptions);
|
|
26
|
+
constructor(label_api_key: string, brand_api_key: string, messageSender: MessageSender, options?: IOptions);
|
|
23
27
|
private send;
|
|
24
28
|
private buildMessage;
|
|
25
29
|
coreReportCustomEvent(user_ext_id: string, eventType: string, payload?: any): Promise<any>;
|
|
@@ -30,8 +34,11 @@ declare class SmarticoAPI {
|
|
|
30
34
|
public_username_custom: string;
|
|
31
35
|
}>;
|
|
32
36
|
sawGetTemplates(user_ext_id: string): Promise<SAWGetTemplatesResponse>;
|
|
33
|
-
sawFormatTemplatesForWidget(templates: SAWTemplate[], pointsBalance: number): Promise<any[]>;
|
|
34
37
|
sawSpinRequest(user_ext_id: string, saw_template_id: number, round_id: number): Promise<SAWDoSpinResponse>;
|
|
35
38
|
inboxGetMessages(user_ext_id: string, limit?: number, offset?: number): Promise<GetInboxMessagesResponse>;
|
|
39
|
+
storeGetItems(user_ext_id: string): Promise<GetStoreItemsResponse>;
|
|
40
|
+
missionsGetItems(user_ext_id: string): Promise<GetAchievementMapResponse>;
|
|
41
|
+
tournamentsGetLobby(user_ext_id: string): Promise<GetTournamentsResponse>;
|
|
42
|
+
tournamentsGetInfo(user_ext_id: string, tournamentInstanceId: number): Promise<GetTournamentInfoResponse>;
|
|
36
43
|
}
|
|
37
|
-
export { SmarticoAPI };
|
|
44
|
+
export { SmarticoAPI, MessageSender };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare enum BuyStoreItemErrorCode {
|
|
2
|
+
FAILED_TO_BUY_SHOP_ITEM = 121,
|
|
3
|
+
SHOP_NO_BALANCE = 11000,
|
|
4
|
+
SHOP_WRONG_LABEL = 11001,
|
|
5
|
+
SHOP_FAILED_TO_BUY_BONUS = 11002,
|
|
6
|
+
SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION = 11003,
|
|
7
|
+
SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION_PURSHASE = 11004,
|
|
8
|
+
SHOP_FAILED_TO_BUY_MATCHING_BONUS = 11005,
|
|
9
|
+
SHOP_FAILED_MAX_BOUGHT_ITEMS_REACHED = 11006
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { StoreItemPublicMeta } from "./StoreItemPublicMeta";
|
|
2
|
+
import { StoreItemType } from "./StoreItemType";
|
|
3
|
+
export interface StoreItem {
|
|
4
|
+
id: number;
|
|
5
|
+
itemTypeId: StoreItemType;
|
|
6
|
+
itemPublicMeta: StoreItemPublicMeta;
|
|
7
|
+
categoryIds?: number[];
|
|
8
|
+
canBuy?: boolean;
|
|
9
|
+
}
|
package/dist/Store/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
export {
|
|
1
|
+
import { BuyStoreItemErrorCode } from "./BuyStoreItemErrorCode";
|
|
2
|
+
import { BuyStoreItemRequest } from "./BuyStoreItemRequest";
|
|
3
|
+
import { BuyStoreItemResponse } from "./BuyStoreItemResponse";
|
|
4
|
+
import { GetCategoriesStoreResponse } from "./GetCategoriesStoreResponse";
|
|
5
|
+
import { GetStoreItemsResponse } from "./GetStoreItemsResponse";
|
|
6
|
+
import { StoreCategory } from "./StoreCategory";
|
|
7
|
+
import { StoreCategoryPublicMeta } from "./StoreCategoryPublicMeta";
|
|
8
|
+
import { StoreItem } from "./StoreItem";
|
|
9
|
+
import { StoreItemPublicMeta } from "./StoreItemPublicMeta";
|
|
10
|
+
import { StoreItemType } from "./StoreItemType";
|
|
11
|
+
export { BuyStoreItemErrorCode, BuyStoreItemRequest, BuyStoreItemResponse, GetCategoriesStoreResponse, GetStoreItemsResponse, StoreCategory, StoreCategoryPublicMeta, StoreItem, StoreItemPublicMeta, StoreItemType, };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Tournament } from "./Tournament";
|
|
2
|
+
import { TournamentPlayer } from "./TournamentPlayer";
|
|
3
|
+
import { ProtocolResponse } from "../Base/ProtocolResponse";
|
|
4
|
+
import { TournamentPrize } from "./TournamentPrize";
|
|
5
|
+
export interface GetTournamentInfoResponse extends ProtocolResponse {
|
|
6
|
+
/** tournament info */
|
|
7
|
+
tournamentInfo: {
|
|
8
|
+
/** id of label, not in use */
|
|
9
|
+
labelId: number;
|
|
10
|
+
tournamentLobbyInfo: Tournament;
|
|
11
|
+
/** list of registered users */
|
|
12
|
+
players: TournamentPlayer[];
|
|
13
|
+
};
|
|
14
|
+
/** information about current user position */
|
|
15
|
+
userPosition: TournamentPlayer;
|
|
16
|
+
/** prizes structure */
|
|
17
|
+
prizeStructure?: {
|
|
18
|
+
prizes: TournamentPrize[];
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { TournamentRegistrationType } from "./TournamentRegistrationType";
|
|
2
|
+
import { TournamentInstanceStatus } from "./TournamentInstanceStatus";
|
|
3
|
+
import { TournamentRegistrationStatus } from "./TournamentRegistrationStatus";
|
|
4
|
+
import { TournamentType } from "./TournamentType";
|
|
5
|
+
import { TournamentPublicMeta } from "./TournamentPublicMeta";
|
|
6
|
+
export interface Tournament {
|
|
7
|
+
/** ID of tournament template */
|
|
8
|
+
tournamentId?: number;
|
|
9
|
+
/** ID of tournament instance. Generated every time when tournament based on specific template is scheduled for run */
|
|
10
|
+
tournamentInstanceId?: number;
|
|
11
|
+
/** Type of the tournament. For now only SCHEDULED is support */
|
|
12
|
+
tournamentType?: TournamentType;
|
|
13
|
+
/** Meta information about tournament that should be used to build UI */
|
|
14
|
+
publicMeta?: TournamentPublicMeta;
|
|
15
|
+
/** Cost of registration in the tournament in gamification points */
|
|
16
|
+
buyInAmount?: number;
|
|
17
|
+
/** Not in use */
|
|
18
|
+
prizePool?: number;
|
|
19
|
+
/** The time when tournament is going to start */
|
|
20
|
+
startTime?: string;
|
|
21
|
+
/** The time when tournament is going to finish */
|
|
22
|
+
endTime?: string;
|
|
23
|
+
/** Number of users registered in the tournament */
|
|
24
|
+
registrationCount?: number;
|
|
25
|
+
/** Not in use */
|
|
26
|
+
totalCount?: number;
|
|
27
|
+
/** Type of registration in the tournament */
|
|
28
|
+
registrationType?: TournamentRegistrationType;
|
|
29
|
+
/** Status of registration in the tournament for current user */
|
|
30
|
+
tournamentRegistrationStatus?: TournamentRegistrationStatus;
|
|
31
|
+
/** Status of tournament instance */
|
|
32
|
+
tournamentInstanceStatus?: TournamentInstanceStatus;
|
|
33
|
+
/** flag indicating if current user is registered in the tournament */
|
|
34
|
+
isUserRegistered?: boolean;
|
|
35
|
+
/** Indicator if tournament allows later registration, when tournament is already started */
|
|
36
|
+
allowLateRegistration?: boolean;
|
|
37
|
+
/** Minimum number of participant for this tournament. If tournament doesnt have enough registrations, it will not start */
|
|
38
|
+
playersMinCount?: number;
|
|
39
|
+
/** Maximum number of participant for this tournament. When reached, new users won't be able to register */
|
|
40
|
+
playersMaxCount?: number;
|
|
41
|
+
/** Tournament duration in millisecnnds */
|
|
42
|
+
durationMs?: number;
|
|
43
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface TournamentPublicMeta {
|
|
2
|
+
/** Name of tournament */
|
|
3
|
+
name?: string;
|
|
4
|
+
/** 1st image */
|
|
5
|
+
image_url?: string;
|
|
6
|
+
/** 2nd image */
|
|
7
|
+
image_url2?: string;
|
|
8
|
+
/** Description, html capable */
|
|
9
|
+
description?: string;
|
|
10
|
+
/** Short explanation of prize pool */
|
|
11
|
+
prize_pool_short?: string;
|
|
12
|
+
/** Message to show when user is not matching to the segment allowed to register (error code 30005 in registration response) */
|
|
13
|
+
segment_dont_match_message?: string;
|
|
14
|
+
/** Short explanation of registration price */
|
|
15
|
+
custom_price_text?: string;
|
|
16
|
+
/** Indicator if the scores of other users should be shown in the leaderboard of tournament */
|
|
17
|
+
show_other_users_score?: boolean;
|
|
18
|
+
custom_section_id?: number;
|
|
19
|
+
only_in_custom_section?: boolean;
|
|
20
|
+
label_tag?: string;
|
|
21
|
+
featured?: boolean;
|
|
22
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare enum TournamentRegistrationError {
|
|
2
|
+
NO_ERROR = 0,
|
|
3
|
+
TOURNAMENT_INSTANCE_NOT_FOUND = 30001,
|
|
4
|
+
TOURNAMENT_REGISTRATION_NOT_ENOUGH_POINTS = 30002,
|
|
5
|
+
TOURNAMENT_INSTANCE_NOT_IN_STATE = 30003,
|
|
6
|
+
TOURNAMENT_ALREADY_REGISTERED = 30004,
|
|
7
|
+
TOURNAMENT_USER_DONT_MATCH_CONDITIONS = 30005,
|
|
8
|
+
TOURNAMENT_USER_NOT_REGISTERED = 30006,
|
|
9
|
+
TOURNAMENT_CANT_CHANGE_REGISTRATION_STATUS = 30007,
|
|
10
|
+
TOURNAMENT_MAX_REGISTRATIONS_REACHED = 30008
|
|
11
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { GetTournamentInfoRequest } from "./GetTournamentInfoRequest";
|
|
2
|
+
import { GetTournamentInfoResponse } from "./GetTournamentInfoResponse";
|
|
3
|
+
import { GetTournamentsRequest } from "./GetTournamentsRequest";
|
|
4
|
+
import { GetTournamentsResponse } from "./GetTournamentsResponse";
|
|
5
|
+
import { Tournament } from "./Tournament";
|
|
6
|
+
import { TournamentInstanceStatus } from "./TournamentInstanceStatus";
|
|
7
|
+
import { TournamentPlayer } from "./TournamentPlayer";
|
|
8
|
+
import { TournamentPrize } from "./TournamentPrize";
|
|
9
|
+
import { TournamentPublicMeta } from "./TournamentPublicMeta";
|
|
10
|
+
import { TournamentRegisterRequest } from "./TournamentRegisterRequest";
|
|
11
|
+
import { TournamentRegisterResponse } from "./TournamentRegisterResponse";
|
|
12
|
+
import { TournamentRegistrationError } from "./TournamentRegistrationError";
|
|
13
|
+
import { TournamentRegistrationStatus } from "./TournamentRegistrationStatus";
|
|
14
|
+
import { TournamentRegistrationType } from "./TournamentRegistrationType";
|
|
15
|
+
import { TournamentType } from "./TournamentType";
|
|
16
|
+
export { GetTournamentInfoRequest, GetTournamentInfoResponse, GetTournamentsRequest, GetTournamentsResponse, Tournament, TournamentInstanceStatus, TournamentPlayer, TournamentPrize, TournamentPublicMeta, TournamentRegisterRequest, TournamentRegisterResponse, TournamentRegistrationError, TournamentRegistrationStatus, TournamentRegistrationType, TournamentType, };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ClassId } from './Base/ClassId';
|
|
2
2
|
import { ILogger } from './ILogger';
|
|
3
|
-
import { SmarticoAPI } from './SmarticoAPI';
|
|
3
|
+
import { MessageSender, SmarticoAPI } from './SmarticoAPI';
|
|
4
4
|
export * from './Core';
|
|
5
5
|
export * from './Inbox';
|
|
6
6
|
export * from './Leaderboard';
|
|
7
7
|
export * from './MiniGames';
|
|
8
8
|
export * from './Missions';
|
|
9
9
|
export * from './Store';
|
|
10
|
-
export
|
|
10
|
+
export * from './Tournaments';
|
|
11
|
+
export { SmarticoAPI, MessageSender, ClassId, ILogger };
|