@smartico/public-api 0.0.8 → 0.0.9
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 +7 -2
- 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 +1 -0
- package/dist/index.js +125 -63
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +105 -40
- package/dist/index.modern.mjs.map +1 -1
- package/package.json +2 -1
- package/src/Core/ActivityTypeLimited.ts +8 -0
- package/src/Core/index.ts +3 -1
- package/src/SmarticoAPI.ts +43 -31
- 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 +1 -0
- 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
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {Tournament} from "./Tournament";
|
|
2
|
+
import {TournamentPlayer} from "./TournamentPlayer";
|
|
3
|
+
import { ProtocolResponse } from "../Base/ProtocolResponse";
|
|
4
|
+
import { TournamentPrize } from "./TournamentPrize";
|
|
5
|
+
|
|
6
|
+
export interface GetTournamentInfoResponse extends ProtocolResponse {
|
|
7
|
+
|
|
8
|
+
/** tournament info */
|
|
9
|
+
tournamentInfo: {
|
|
10
|
+
/** id of label, not in use */
|
|
11
|
+
labelId: number;
|
|
12
|
+
tournamentLobbyInfo: Tournament;
|
|
13
|
+
/** list of registered users */
|
|
14
|
+
players: TournamentPlayer[];
|
|
15
|
+
},
|
|
16
|
+
/** information about current user position */
|
|
17
|
+
userPosition: TournamentPlayer,
|
|
18
|
+
/** prizes structure */
|
|
19
|
+
prizeStructure?: {
|
|
20
|
+
prizes: TournamentPrize[],
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
|
|
7
|
+
export interface Tournament {
|
|
8
|
+
|
|
9
|
+
/** ID of tournament template */
|
|
10
|
+
tournamentId?: number;
|
|
11
|
+
/** ID of tournament instance. Generated every time when tournament based on specific template is scheduled for run */
|
|
12
|
+
tournamentInstanceId?: number;
|
|
13
|
+
/** Type of the tournament. For now only SCHEDULED is support */
|
|
14
|
+
tournamentType?: TournamentType;
|
|
15
|
+
/** Meta information about tournament that should be used to build UI */
|
|
16
|
+
publicMeta?: TournamentPublicMeta;
|
|
17
|
+
/** Cost of registration in the tournament in gamification points */
|
|
18
|
+
buyInAmount?: number;
|
|
19
|
+
/** Not in use */
|
|
20
|
+
prizePool?: number;
|
|
21
|
+
/** The time when tournament is going to start */
|
|
22
|
+
startTime?: string;
|
|
23
|
+
/** The time when tournament is going to finish */
|
|
24
|
+
endTime?: string;
|
|
25
|
+
/** Number of users registered in the tournament */
|
|
26
|
+
registrationCount?: number;
|
|
27
|
+
/** Not in use */
|
|
28
|
+
totalCount?: number;
|
|
29
|
+
/** Type of registration in the tournament */
|
|
30
|
+
registrationType?: TournamentRegistrationType;
|
|
31
|
+
/** Status of registration in the tournament for current user */
|
|
32
|
+
tournamentRegistrationStatus?: TournamentRegistrationStatus;
|
|
33
|
+
/** Status of tournament instance */
|
|
34
|
+
tournamentInstanceStatus?: TournamentInstanceStatus;
|
|
35
|
+
/** flag indicating if current user is registered in the tournament */
|
|
36
|
+
isUserRegistered?: boolean;
|
|
37
|
+
/** Indicator if tournament allows later registration, when tournament is already started */
|
|
38
|
+
allowLateRegistration?: boolean;
|
|
39
|
+
/** Minimum number of participant for this tournament. If tournament doesnt have enough registrations, it will not start */
|
|
40
|
+
playersMinCount?: number;
|
|
41
|
+
/** Maximum number of participant for this tournament. When reached, new users won't be able to register */
|
|
42
|
+
playersMaxCount?: number;
|
|
43
|
+
/** Tournament duration in millisecnnds */
|
|
44
|
+
durationMs?: number;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export enum TournamentInstanceStatus {
|
|
2
|
+
|
|
3
|
+
PUBLISHED = 1,
|
|
4
|
+
REGISTER = 2,
|
|
5
|
+
STARTED = 3,
|
|
6
|
+
FINISHED = 4,
|
|
7
|
+
CANCELLED = 5,
|
|
8
|
+
FAILED = 6,
|
|
9
|
+
FINALIZING = 7,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const TournamentInstanceStatusName = (s: TournamentInstanceStatus): string => {
|
|
13
|
+
return {
|
|
14
|
+
[TournamentInstanceStatus.PUBLISHED]: "PUBLISHED",
|
|
15
|
+
[TournamentInstanceStatus.REGISTER]: "REGISTER",
|
|
16
|
+
[TournamentInstanceStatus.STARTED]: "STARTED",
|
|
17
|
+
[TournamentInstanceStatus.FINISHED]: "FINISHED",
|
|
18
|
+
[TournamentInstanceStatus.CANCELLED]: "CANCELLED",
|
|
19
|
+
[TournamentInstanceStatus.FAILED]: "FAILED",
|
|
20
|
+
[TournamentInstanceStatus.FINALIZING]: "FINALIZING",
|
|
21
|
+
}[s];
|
|
22
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ActivityTypeLimited } from "../Core/ActivityTypeLimited";
|
|
2
|
+
|
|
3
|
+
export interface TournamentPrize {
|
|
4
|
+
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
image_url: string;
|
|
8
|
+
place_from: number;
|
|
9
|
+
place_to: number;
|
|
10
|
+
type: ActivityTypeLimited;
|
|
11
|
+
points: number;
|
|
12
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
|
|
19
|
+
custom_section_id?: number;
|
|
20
|
+
|
|
21
|
+
only_in_custom_section?: boolean;
|
|
22
|
+
|
|
23
|
+
label_tag?: string;
|
|
24
|
+
|
|
25
|
+
featured?: boolean;
|
|
26
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ProtocolResponse } from "../Base/ProtocolResponse";
|
|
2
|
+
import { TournamentRegistrationError } from "./TournamentRegistrationError";
|
|
3
|
+
|
|
4
|
+
export interface TournamentRegisterResponse extends ProtocolResponse {
|
|
5
|
+
|
|
6
|
+
errCode?: TournamentRegistrationError;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export 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,33 @@
|
|
|
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
|
+
|
|
17
|
+
export {
|
|
18
|
+
GetTournamentInfoRequest,
|
|
19
|
+
GetTournamentInfoResponse,
|
|
20
|
+
GetTournamentsRequest,
|
|
21
|
+
GetTournamentsResponse,
|
|
22
|
+
Tournament,
|
|
23
|
+
TournamentInstanceStatus,
|
|
24
|
+
TournamentPlayer,
|
|
25
|
+
TournamentPrize,
|
|
26
|
+
TournamentPublicMeta,
|
|
27
|
+
TournamentRegisterRequest,
|
|
28
|
+
TournamentRegisterResponse,
|
|
29
|
+
TournamentRegistrationError,
|
|
30
|
+
TournamentRegistrationStatus,
|
|
31
|
+
TournamentRegistrationType,
|
|
32
|
+
TournamentType,
|
|
33
|
+
}
|
package/src/index.ts
CHANGED
package/src/Store/ShopItem.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ShopItemPublicMeta } from "./ShopItemPublicMeta";
|
|
2
|
-
import { ShopItemType } from "./ShopItemType";
|
|
3
|
-
|
|
4
|
-
export interface ShopItem {
|
|
5
|
-
id: number;
|
|
6
|
-
itemTypeId: ShopItemType;
|
|
7
|
-
itemPublicMeta: ShopItemPublicMeta;
|
|
8
|
-
categoryIds?: number[];
|
|
9
|
-
canBuy?: boolean;
|
|
10
|
-
}
|