@smartico/public-api 0.0.3 → 0.0.5
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/.nvmrc +1 -1
- package/README.md +23 -44
- package/dist/Base/ClassId.d.ts +21 -0
- package/dist/Base/ProtocolMessage.d.ts +5 -0
- package/dist/Base/ProtocolRequest.d.ts +6 -0
- package/dist/Base/ProtocolResponse.d.ts +5 -0
- package/dist/Core/GetLabelInfoRequest.d.ts +3 -0
- package/dist/Core/GetLabelInfoResponse.d.ts +7 -0
- package/dist/Core/GetTranslationsRequest.d.ts +7 -0
- package/dist/Core/GetTranslationsResponse.d.ts +7 -0
- package/dist/Core/PublicLabelSettings.d.ts +28 -0
- package/dist/Core/PublicProperties.d.ts +11 -0
- package/dist/Core/ResponseIdentify.d.ts +12 -0
- package/dist/Core/TranslationArea.d.ts +9 -0
- package/dist/Core/index.d.ts +8 -0
- package/dist/ErrorCodes.d.ts +12 -0
- package/dist/GResponse.d.ts +9 -0
- package/dist/ILogger.d.ts +7 -0
- package/dist/IntUtils.d.ts +8 -0
- package/dist/MiniGames/SAWAcknowledgeType.d.ts +5 -0
- package/dist/MiniGames/SAWAskForUsername.d.ts +4 -0
- package/dist/MiniGames/SAWBuyInType.d.ts +10 -0
- package/dist/MiniGames/SAWDoSpinRequest.d.ts +5 -0
- package/dist/MiniGames/SAWDoSpinResponse.d.ts +9 -0
- package/dist/MiniGames/SAWGameType.d.ts +10 -0
- package/dist/MiniGames/SAWGetTemplatesRequest.d.ts +3 -0
- package/dist/MiniGames/SAWGetTemplatesResponse.d.ts +5 -0
- package/dist/MiniGames/SAWPrize.d.ts +11 -0
- package/dist/MiniGames/SAWPrizeType.d.ts +8 -0
- package/dist/MiniGames/SAWPrizeUI.d.ts +13 -0
- package/dist/MiniGames/SAWSpinErrorCode.d.ts +7 -0
- package/dist/MiniGames/SAWTemplate.d.ts +26 -0
- package/dist/MiniGames/SAWTemplateUI.d.ts +28 -0
- package/dist/MiniGames/SAWUtils.d.ts +5 -0
- package/dist/MiniGames/SAWWinSoundType.d.ts +12 -0
- package/dist/MiniGames/index.d.ts +17 -0
- package/dist/OCache.d.ts +11 -0
- package/dist/SmarticoAPI.d.ts +35 -0
- package/dist/SmarticoPublicAPI.d.ts +23 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.js +576 -219
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +417 -218
- package/dist/index.modern.mjs.map +1 -1
- package/dist/service/index.d.ts +3 -2
- package/dist/service/types/ErrorCodes.d.ts +13 -0
- package/dist/service/types/GRequest.d.ts +16 -0
- package/dist/service/types/GResponse.d.ts +10 -0
- package/dist/service/types/Game/GameAttemptType.d.ts +6 -0
- package/{src/service/types/Game/GameCanPlayType.ts → dist/service/types/Game/GameCanPlayType.d.ts} +10 -11
- package/dist/service/types/Game/GameExternalStatus.d.ts +6 -0
- package/{src/service/types/Game/GameInfo.ts → dist/service/types/Game/GameInfo.d.ts} +9 -11
- package/{src/service/types/Game/GamePick.ts → dist/service/types/Game/GamePick.d.ts} +90 -104
- package/dist/service/types/Game/GameUtil.d.ts +7 -0
- package/{src/service/types/SmarticoProto/GetTranslationsRequest.ts → dist/service/types/SmarticoProto/GetTranslationsRequest.d.ts} +7 -9
- package/dist/service/types/SmarticoProto/GetTranslationsResponse.d.ts +7 -0
- package/dist/service/types/SmarticoProto/ProtocolMessage.d.ts +5 -0
- package/dist/service/types/SmarticoProto/ProtocolRequest.d.ts +6 -0
- package/dist/service/types/SmarticoProto/ProtocolResponse.d.ts +5 -0
- package/dist/service/types/SmarticoProto/PublicLabelInfo.d.ts +34 -0
- package/dist/service/types/SmarticoProto/PublicProperties.d.ts +11 -0
- package/{src/service/types/SmarticoProto/ResponseIdentify.ts → dist/service/types/SmarticoProto/ResponseIdentify.d.ts} +12 -16
- package/dist/service/types/SmarticoProto/SAW/SAWAcknowledgeType.d.ts +5 -0
- package/{src/service/types/SmarticoProto/SAW/SAWBuyInType.ts → dist/service/types/SmarticoProto/SAW/SAWBuyInType.d.ts} +5 -5
- package/{src/service/types/SmarticoProto/SAW/SAWDoSpinRequest.ts → dist/service/types/SmarticoProto/SAW/SAWDoSpinRequest.d.ts} +5 -8
- package/{src/service/types/SmarticoProto/SAW/SAWDoSpinResponse.ts → dist/service/types/SmarticoProto/SAW/SAWDoSpinResponse.d.ts} +15 -18
- package/dist/service/types/SmarticoProto/SAW/SAWGameType.d.ts +10 -0
- package/{src/service/types/SmarticoProto/SAW/SAWGetTemplatesRequest.ts → dist/service/types/SmarticoProto/SAW/SAWGetTemplatesRequest.d.ts} +3 -5
- package/{src/service/types/SmarticoProto/SAW/SAWGetTemplatesResponse.ts → dist/service/types/SmarticoProto/SAW/SAWGetTemplatesResponse.d.ts} +5 -8
- package/dist/service/types/SmarticoProto/SAW/SAWPrize.d.ts +11 -0
- package/dist/service/types/SmarticoProto/SAW/SAWPrizeType.d.ts +8 -0
- package/dist/service/types/SmarticoProto/SAW/SAWPrizeUI.d.ts +13 -0
- package/dist/service/types/SmarticoProto/SAW/SAWTemplate.d.ts +21 -0
- package/{src/service/types/SmarticoProto/SAW/SAWTemplateUI.ts → dist/service/types/SmarticoProto/SAW/SAWTemplateUI.d.ts} +31 -33
- package/dist/service/types/SmarticoProto/SAW/SAWWinSoundType.d.ts +12 -0
- package/dist/service/types/SmarticoProto/TranslationArea.d.ts +9 -0
- package/{src/service/types/User/UserInfo.ts → dist/service/types/User/UserInfo.d.ts} +10 -12
- package/package.json +10 -3
- package/src/Base/ClassId.ts +26 -0
- package/src/{service/types/SmarticoProto → Base}/ProtocolMessage.ts +0 -0
- package/src/{service/types/SmarticoProto → Base}/ProtocolRequest.ts +0 -0
- package/src/{service/types/SmarticoProto → Base}/ProtocolResponse.ts +0 -0
- package/src/Core/GetLabelInfoRequest.ts +5 -0
- package/src/Core/GetLabelInfoResponse.ts +6 -0
- package/src/Core/GetTranslationsRequest.ts +10 -0
- package/src/{service/types/SmarticoProto → Core}/GetTranslationsResponse.ts +1 -1
- package/src/{service/types/SmarticoProto/PublicLabelInfo.ts → Core/PublicLabelSettings.ts} +1 -6
- package/src/{service/types/SmarticoProto → Core}/PublicProperties.ts +0 -0
- package/src/Core/ResponseIdentify.ts +14 -0
- package/src/{service/types/SmarticoProto → Core}/TranslationArea.ts +1 -1
- package/src/Core/index.ts +18 -0
- package/src/{service/types/ErrorCodes.ts → ErrorCodes.ts} +1 -3
- package/src/{service/types/GResponse.ts → GResponse.ts} +0 -0
- package/src/ILogger.ts +11 -0
- package/src/IntUtils.ts +39 -0
- package/src/{service/types/SmarticoProto/SAW → MiniGames}/SAWAcknowledgeType.ts +0 -0
- package/src/MiniGames/SAWAskForUsername.ts +5 -0
- package/src/MiniGames/SAWBuyInType.ts +11 -0
- package/src/MiniGames/SAWDoSpinRequest.ts +8 -0
- package/src/MiniGames/SAWDoSpinResponse.ts +11 -0
- package/src/{service/types/SmarticoProto/SAW → MiniGames}/SAWGameType.ts +2 -2
- package/src/MiniGames/SAWGetTemplatesRequest.ts +5 -0
- package/src/MiniGames/SAWGetTemplatesResponse.ts +8 -0
- package/src/{service/types/SmarticoProto/SAW → MiniGames}/SAWPrize.ts +0 -0
- package/src/{service/types/SmarticoProto/SAW → MiniGames}/SAWPrizeType.ts +0 -0
- package/src/{service/types/SmarticoProto/SAW → MiniGames}/SAWPrizeUI.ts +0 -0
- package/src/MiniGames/SAWSpinErrorCode.ts +8 -0
- package/src/{service/types/SmarticoProto/SAW → MiniGames}/SAWTemplate.ts +5 -0
- package/src/MiniGames/SAWTemplateUI.ts +31 -0
- package/src/MiniGames/SAWUtils.ts +31 -0
- package/src/{service/types/SmarticoProto/SAW → MiniGames}/SAWWinSoundType.ts +0 -0
- package/src/MiniGames/index.ts +35 -0
- package/src/OCache.ts +54 -0
- package/src/SmarticoAPI.ts +296 -0
- package/src/index.ts +12 -2
- package/tsconfig.json +17 -0
- package/src/service/index.ts +0 -12
- package/src/service/types/GRequest.ts +0 -18
- package/src/service/types/Game/GameAttemptType.ts +0 -8
- package/src/service/types/Game/GameExternalStatus.ts +0 -7
- package/src/service/types/Game/GameUtil.ts +0 -30
- package/src/util/Util.ts +0 -306
- package/test/package.json +0 -11
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { ProtocolRequest } from "./ProtocolRequest";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
request_id: string; // guid
|
|
7
|
-
saw_template_id: number;
|
|
8
|
-
}
|
|
1
|
+
import { ProtocolRequest } from "./ProtocolRequest";
|
|
2
|
+
export interface SAWDoSpinRequest extends ProtocolRequest {
|
|
3
|
+
request_id: string;
|
|
4
|
+
saw_template_id: number;
|
|
5
|
+
}
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import { ProtocolResponse } from "../ProtocolResponse";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
saw_prize_id: number;
|
|
17
|
-
first_spin_in_period: number;
|
|
18
|
-
};
|
|
1
|
+
import { ProtocolResponse } from "../ProtocolResponse";
|
|
2
|
+
export declare enum SAWSpinErrorCode {
|
|
3
|
+
SAW_OK = 0,
|
|
4
|
+
SAW_NO_SPINS = 40001,
|
|
5
|
+
SAW_PRIZE_POOL_EMPTY = 40002,
|
|
6
|
+
SAW_NOT_ENOUGH_POINTS = 40003,
|
|
7
|
+
SAW_FAILED_MAX_SPINS_REACHED = 40004
|
|
8
|
+
}
|
|
9
|
+
export interface SAWDoSpinResponse extends ProtocolResponse {
|
|
10
|
+
errCode: SAWSpinErrorCode;
|
|
11
|
+
errMsg?: string;
|
|
12
|
+
request_id: string;
|
|
13
|
+
saw_prize_id: number;
|
|
14
|
+
first_spin_in_period: number;
|
|
15
|
+
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { ProtocolResponse } from "../ProtocolResponse";
|
|
2
|
-
import { SAWTemplate } from "./SAWTemplate";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
templates: SAWTemplate[];
|
|
8
|
-
}
|
|
1
|
+
import { ProtocolResponse } from "../ProtocolResponse";
|
|
2
|
+
import { SAWTemplate } from "./SAWTemplate";
|
|
3
|
+
export interface SAWGetTemplatesResponse extends ProtocolResponse {
|
|
4
|
+
templates: SAWTemplate[];
|
|
5
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SAWPrizeType } from "./SAWPrizeType";
|
|
2
|
+
import { SAWPrizeUI } from "./SAWPrizeUI";
|
|
3
|
+
export interface SAWPrize {
|
|
4
|
+
saw_prize_id: number;
|
|
5
|
+
saw_prize_ui_definition: SAWPrizeUI;
|
|
6
|
+
prize_value?: number;
|
|
7
|
+
prize_type_id: SAWPrizeType;
|
|
8
|
+
place_from?: number;
|
|
9
|
+
place_to?: number;
|
|
10
|
+
sawUniqueWinId?: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SAWAcknowledgeType } from "./SAWAcknowledgeType";
|
|
2
|
+
import { SAWWinSoundType } from "./SAWWinSoundType";
|
|
3
|
+
export interface SAWPrizeUI {
|
|
4
|
+
position?: number;
|
|
5
|
+
name: string;
|
|
6
|
+
aknowledge_message: string;
|
|
7
|
+
sectors: number[];
|
|
8
|
+
acknowledge_type: SAWAcknowledgeType;
|
|
9
|
+
acknowledge_dp?: string;
|
|
10
|
+
font_size?: number;
|
|
11
|
+
sound_type: SAWWinSoundType;
|
|
12
|
+
icon?: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SAWBuyInType } from "./SAWBuyInType";
|
|
2
|
+
import { SAWGameType } from "./SAWGameType";
|
|
3
|
+
import { SAWPrize } from "./SAWPrize";
|
|
4
|
+
import { SAWTemplateUI } from "./SAWTemplateUI";
|
|
5
|
+
export interface SAWTemplate {
|
|
6
|
+
saw_template_id: number;
|
|
7
|
+
saw_game_type_id: SAWGameType;
|
|
8
|
+
saw_template_ui_definition: SAWTemplateUI;
|
|
9
|
+
saw_buyin_type_id: SAWBuyInType;
|
|
10
|
+
buyin_cost_points?: number;
|
|
11
|
+
visibile_when_can_spin: boolean;
|
|
12
|
+
spin_count?: number;
|
|
13
|
+
prizes: SAWPrize[];
|
|
14
|
+
is_visible: boolean;
|
|
15
|
+
jackpot_add_on_attempt: number;
|
|
16
|
+
jackpot_current: number;
|
|
17
|
+
jackpot_guaranteed: number;
|
|
18
|
+
maxActiveSpinsAllowed: number;
|
|
19
|
+
maxSpinsCount: number;
|
|
20
|
+
maxSpinsPediodMs: number;
|
|
21
|
+
}
|
|
@@ -1,33 +1,31 @@
|
|
|
1
|
-
export enum AskForUsername {
|
|
2
|
-
NOASK = "no-ask",
|
|
3
|
-
ONSUMBIT = "on-submit"
|
|
4
|
-
}
|
|
5
|
-
export interface SAWTemplateUI {
|
|
6
|
-
skin: string;
|
|
7
|
-
name: string;
|
|
8
|
-
description?: string;
|
|
9
|
-
over_limit_message?: string;
|
|
10
|
-
no_attempts_message?: string;
|
|
11
|
-
thumbnail?: string;
|
|
12
|
-
sectors_count: number;
|
|
13
|
-
priority: number;
|
|
14
|
-
flow_builder_only: boolean;
|
|
15
|
-
background_image?: string;
|
|
16
|
-
background_image_mobile?: string;
|
|
17
|
-
background_sound?: string;
|
|
18
|
-
scratch_logo?: string;
|
|
19
|
-
scratch_cover?: string;
|
|
20
|
-
scratch_bg_desktop?: string;
|
|
21
|
-
scratch_bg_mobile?: string;
|
|
22
|
-
scratch_cursor?: string;
|
|
23
|
-
custom_css?: string;
|
|
24
|
-
custom_skin_folder?: string;
|
|
25
|
-
jackpot_symbol?: string;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
max_spins_period_ms?: number;
|
|
33
|
-
}
|
|
1
|
+
export declare enum AskForUsername {
|
|
2
|
+
NOASK = "no-ask",
|
|
3
|
+
ONSUMBIT = "on-submit"
|
|
4
|
+
}
|
|
5
|
+
export interface SAWTemplateUI {
|
|
6
|
+
skin: string;
|
|
7
|
+
name: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
over_limit_message?: string;
|
|
10
|
+
no_attempts_message?: string;
|
|
11
|
+
thumbnail?: string;
|
|
12
|
+
sectors_count: number;
|
|
13
|
+
priority: number;
|
|
14
|
+
flow_builder_only: boolean;
|
|
15
|
+
background_image?: string;
|
|
16
|
+
background_image_mobile?: string;
|
|
17
|
+
background_sound?: string;
|
|
18
|
+
scratch_logo?: string;
|
|
19
|
+
scratch_cover?: string;
|
|
20
|
+
scratch_bg_desktop?: string;
|
|
21
|
+
scratch_bg_mobile?: string;
|
|
22
|
+
scratch_cursor?: string;
|
|
23
|
+
custom_css?: string;
|
|
24
|
+
custom_skin_folder?: string;
|
|
25
|
+
jackpot_symbol?: string;
|
|
26
|
+
promo_image?: string;
|
|
27
|
+
promo_text?: string;
|
|
28
|
+
ask_for_username?: AskForUsername;
|
|
29
|
+
show_prize_board?: boolean;
|
|
30
|
+
max_spins_period_ms?: number;
|
|
31
|
+
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
interface UserInfo {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export { UserInfo }
|
|
1
|
+
interface UserInfo {
|
|
2
|
+
ext_user_id: string;
|
|
3
|
+
int_user_id: number;
|
|
4
|
+
public_username: string;
|
|
5
|
+
avatar_url: string;
|
|
6
|
+
last_wallet_sync_time?: Date;
|
|
7
|
+
ach_points_balance?: number;
|
|
8
|
+
pubic_username_set?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export { UserInfo };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smartico/public-api",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Smartico public API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -9,15 +9,22 @@
|
|
|
9
9
|
"scripts": {
|
|
10
10
|
"build": "microbundle --no-compress --format modern,cjs",
|
|
11
11
|
"start": "microbundle watch --no-compress --format modern,cjs",
|
|
12
|
-
"
|
|
12
|
+
"git-commit": "git add -A && git commit -m 'Pre-publish commit'",
|
|
13
|
+
"git-push": "git push --follow-tags",
|
|
14
|
+
"pub": "npm publish",
|
|
15
|
+
"patch": "npm version patch",
|
|
16
|
+
".sm-deploy": "npm-run-all git-commit git-push build patch pub git-push"
|
|
13
17
|
},
|
|
14
18
|
"author": "",
|
|
15
19
|
"license": "ISC",
|
|
16
20
|
"dependencies": {
|
|
17
21
|
"md5-typescript": "^1.0.5",
|
|
22
|
+
"node-cache": "^5.1.2",
|
|
23
|
+
"superagent": "^8.0.6",
|
|
18
24
|
"typescript-map": "^0.1.0"
|
|
19
25
|
},
|
|
20
26
|
"devDependencies": {
|
|
21
|
-
"microbundle": "0.15.0"
|
|
27
|
+
"microbundle": "0.15.0",
|
|
28
|
+
"npm-run-all": "4.1.5"
|
|
22
29
|
}
|
|
23
30
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export enum ClassId {
|
|
2
|
+
GET_LABEL_INFO = 3,
|
|
3
|
+
GET_LABEL_INFO_RESPONSE = 4,
|
|
4
|
+
IDENTIFY = 5,
|
|
5
|
+
IDENTIFY_RESPONSE = 6,
|
|
6
|
+
EVENT = 9,
|
|
7
|
+
EVENT_RESPONSE = 10,
|
|
8
|
+
|
|
9
|
+
GET_TRANSLATIONS_REQUEST = 13,
|
|
10
|
+
GET_TRANSLATIONS_RESPONSE = 14,
|
|
11
|
+
|
|
12
|
+
CHANGE_USERNAME = 159,
|
|
13
|
+
CHANGE_USERNAME_RESPONSE = 160,
|
|
14
|
+
|
|
15
|
+
SAW_GET_SPINS_REQUEST = 700,
|
|
16
|
+
SAW_GET_SPINS_RESPONSE = 701,
|
|
17
|
+
SAW_DO_SPIN_REQUEST = 702,
|
|
18
|
+
SAW_DO_SPIN_RESPONSE = 703,
|
|
19
|
+
SAW_AKNOWLEDGE_REQUEST = 704,
|
|
20
|
+
SAW_AKNOWLEDGE_RESPONSE = 705,
|
|
21
|
+
|
|
22
|
+
SAW_SPINS_COUNT_PUSH = 706,
|
|
23
|
+
SAW_SHOW_SPIN_PUSH = 707,
|
|
24
|
+
|
|
25
|
+
UNSUPPORTED_COMMAND = 99999.
|
|
26
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
|
|
2
|
+
import { ProtocolRequest } from "../Base/ProtocolRequest";
|
|
3
|
+
import { TranslationArea } from "./TranslationArea";
|
|
4
|
+
|
|
5
|
+
export interface GetTranslationsRequest extends ProtocolRequest {
|
|
6
|
+
|
|
7
|
+
hash_code: number;
|
|
8
|
+
areas: TranslationArea[];
|
|
9
|
+
lang_code: string;
|
|
10
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
export enum PublicLabelSettings {
|
|
2
3
|
FCM_SENDER_ID = "FCM_SENDER_ID",
|
|
3
4
|
PUBLIC_API_URL = "PUBLIC_API_URL",
|
|
@@ -31,9 +32,3 @@ export enum PublicLabelSettings {
|
|
|
31
32
|
GAMIFICATION_SHOW_POWERED_BY = "GAMIFICATION_SHOW_POWERED_BY",
|
|
32
33
|
_system_leader_board_mask_username = "_system_leader_board_mask_username",
|
|
33
34
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
export interface ResponseIdentifyLabelInfo {
|
|
37
|
-
settings: { [key: string]: string },
|
|
38
|
-
label_id: string,
|
|
39
|
-
}
|
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ProtocolResponse } from "../Base/ProtocolResponse";
|
|
2
|
+
import { PublicProperties } from "./PublicProperties";
|
|
3
|
+
|
|
4
|
+
interface ResponseIdentify extends ProtocolResponse {
|
|
5
|
+
user_id: number;
|
|
6
|
+
ext_user_id: string;
|
|
7
|
+
public_username: string;
|
|
8
|
+
avatar_id: string;
|
|
9
|
+
job: boolean;
|
|
10
|
+
props?: PublicProperties;
|
|
11
|
+
pubic_username_set: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { ResponseIdentify }
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { GetLabelInfoRequest } from './GetLabelInfoRequest'
|
|
2
|
+
import { GetLabelInfoResponse } from './GetLabelInfoResponse'
|
|
3
|
+
import { GetTranslationsRequest } from './GetTranslationsRequest'
|
|
4
|
+
import { GetTranslationsResponse } from './GetTranslationsResponse'
|
|
5
|
+
import { PublicLabelSettings } from './PublicLabelSettings'
|
|
6
|
+
import { ResponseIdentify } from './ResponseIdentify'
|
|
7
|
+
import { TranslationArea } from './TranslationArea'
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export {
|
|
11
|
+
GetTranslationsRequest,
|
|
12
|
+
GetTranslationsResponse,
|
|
13
|
+
GetLabelInfoRequest,
|
|
14
|
+
GetLabelInfoResponse,
|
|
15
|
+
TranslationArea,
|
|
16
|
+
PublicLabelSettings,
|
|
17
|
+
ResponseIdentify
|
|
18
|
+
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { SAWSpinErrorCode } from "./SmarticoProto/SAW/SAWDoSpinResponse";
|
|
2
|
-
|
|
3
1
|
export const ErrorCodes_FatalStartingRange = 100000;
|
|
4
2
|
|
|
5
3
|
export enum ErrorCodesGame {
|
|
@@ -16,4 +14,4 @@ export enum ErrorCodesGame {
|
|
|
16
14
|
}
|
|
17
15
|
|
|
18
16
|
|
|
19
|
-
export type ErrorCodes =
|
|
17
|
+
export type ErrorCodes = ErrorCodesGame;
|
|
File without changes
|
package/src/ILogger.ts
ADDED
package/src/IntUtils.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class IntUtils {
|
|
5
|
+
|
|
6
|
+
public static uuid(): string {
|
|
7
|
+
let a: any;
|
|
8
|
+
let b: any;
|
|
9
|
+
for (b = a = ""; a++ < 36; b += a * 51 & 52 ? (a ^ 15 ? 8 ^ Math.random() * (a ^ 20 ? 16 : 4) : 4).toString(16) : "-") {}
|
|
10
|
+
return b;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
public static isNotNull(val: any): boolean {
|
|
14
|
+
return typeof val !== "undefined" && val !== null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
public static isNotEmpty(val: string): boolean {
|
|
18
|
+
return typeof val !== "undefined" && val !== null && val.length > 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
public static replaceAll(value: string, regex: string, replacement: string | number): string {
|
|
22
|
+
if (IntUtils.isNotNull(value)) {
|
|
23
|
+
return value.replace(new RegExp(IntUtils.escapeRegExp(regex), "g"), replacement?.toString());
|
|
24
|
+
}
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public static escapeRegExp(v: string): string {
|
|
29
|
+
if (IntUtils.isNotEmpty(v)) {
|
|
30
|
+
return v.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
31
|
+
}
|
|
32
|
+
return v;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
export { IntUtils }
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ProtocolResponse } from "./../Base/ProtocolResponse";
|
|
2
|
+
import { SAWSpinErrorCode } from "./SAWSpinErrorCode";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export interface SAWDoSpinResponse extends ProtocolResponse {
|
|
6
|
+
errCode: SAWSpinErrorCode;
|
|
7
|
+
errMsg?: string;
|
|
8
|
+
request_id: string; // guid
|
|
9
|
+
saw_prize_id: number;
|
|
10
|
+
first_spin_in_period: number;
|
|
11
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export enum SAWGameType {
|
|
2
2
|
SpinAWheel = 1,
|
|
3
3
|
ScratchCard = 2,
|
|
4
|
-
|
|
4
|
+
MatchX = 3
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
export const SAWGameTypeName = {
|
|
8
8
|
[SAWGameType.SpinAWheel]: "wheel",
|
|
9
9
|
[SAWGameType.ScratchCard]: "scratch",
|
|
10
|
-
[SAWGameType.
|
|
10
|
+
[SAWGameType.MatchX]: "matchx",
|
|
11
11
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { SAWAskForUsername } from "./SAWAskForUsername";
|
|
2
|
+
|
|
3
|
+
export interface SAWTemplateUI {
|
|
4
|
+
skin: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
over_limit_message?: string;
|
|
8
|
+
no_attempts_message?: string;
|
|
9
|
+
thumbnail?: string;
|
|
10
|
+
sectors_count: number;
|
|
11
|
+
priority: number;
|
|
12
|
+
flow_builder_only: boolean;
|
|
13
|
+
background_image?: string;
|
|
14
|
+
background_image_mobile?: string;
|
|
15
|
+
background_sound?: string;
|
|
16
|
+
scratch_logo?: string;
|
|
17
|
+
scratch_cover?: string;
|
|
18
|
+
scratch_bg_desktop?: string;
|
|
19
|
+
scratch_bg_mobile?: string;
|
|
20
|
+
scratch_cursor?: string;
|
|
21
|
+
custom_css?: string;
|
|
22
|
+
custom_skin_folder?: string;
|
|
23
|
+
jackpot_symbol?: string;
|
|
24
|
+
|
|
25
|
+
promo_image?: string;
|
|
26
|
+
promo_text?: string;
|
|
27
|
+
ask_for_username?: SAWAskForUsername;
|
|
28
|
+
show_prize_board?: boolean;
|
|
29
|
+
|
|
30
|
+
max_spins_period_ms?: number;
|
|
31
|
+
}
|