@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
package/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
v13.13.0
|
package/README.md
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
- Describes data types
|
|
1
|
+
# Smartico Public API
|
|
2
|
+
API allows you to build and manage Smartico Gamification context on behalf of the user. It can be used in the JS/TS based frontend or in NodeJS backend
|
|
4
3
|
|
|
5
|
-
#
|
|
4
|
+
# Installation
|
|
6
5
|
|
|
7
6
|
```bash
|
|
8
7
|
npm install --save @smartico/public-api
|
|
@@ -11,65 +10,45 @@ npm install --save @smartico/public-api
|
|
|
11
10
|
## Usage
|
|
12
11
|
|
|
13
12
|
```typescript
|
|
14
|
-
import {
|
|
13
|
+
import { SmarticoAPI } from '@smartico/public-api';
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const message: ProtocolRequest = {
|
|
21
|
-
api_key: rq.label_api_key,
|
|
22
|
-
brand_key: rq.brand_key,
|
|
23
|
-
ext_user_id: rq.smartico_ext_user_id,
|
|
24
|
-
uuid: Util.uuid(),
|
|
25
|
-
ts: new Date().getTime(),
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
return message as any
|
|
29
|
-
}
|
|
15
|
+
const SAPI = new SmarticoAPI( 'your-label-api-key', 'your-brand-key', { logger: console });
|
|
16
|
+
|
|
17
|
+
const response = await SAPI.miniGamesGetTemplates(rsUser.user_ext_id);
|
|
30
18
|
|
|
19
|
+
response.templates.forEach( t => {
|
|
20
|
+
console.log(t.saw_template_ui_definition.name)
|
|
31
21
|
}
|
|
32
|
-
```
|
|
33
22
|
|
|
34
|
-
|
|
23
|
+
```
|
|
35
24
|
|
|
36
|
-
### Set new package version
|
|
37
25
|
|
|
38
|
-
|
|
39
|
-
npm run build
|
|
40
|
-
npm version [<newversion> | major | minor | patch ]
|
|
41
|
-
```
|
|
26
|
+
## Development and publishing process
|
|
42
27
|
|
|
43
|
-
###
|
|
28
|
+
### Publishing process
|
|
44
29
|
|
|
45
30
|
```sh
|
|
31
|
+
git commit
|
|
32
|
+
npm run build
|
|
33
|
+
npm version patch
|
|
46
34
|
npm run pub
|
|
47
35
|
```
|
|
48
36
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
### Enable Debug changes locally
|
|
52
|
-
|
|
53
|
-
(reference article: https://terodox.tech/using-npm-link-for-package-development/)
|
|
37
|
+
### Debug locally
|
|
54
38
|
|
|
55
39
|
In the public-api project console:
|
|
56
40
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
This will create a symlink from the global `node_modules/@smartico/public-api` to your current folder - `<your-local-git-folder-for-this-project>/public-api`
|
|
41
|
+
```sh
|
|
42
|
+
npm link
|
|
43
|
+
# when you are done
|
|
44
|
+
npm unlink
|
|
45
|
+
```
|
|
63
46
|
|
|
64
47
|
Consumer project console:
|
|
65
48
|
```bash
|
|
66
49
|
npm link @smartico/public-api
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
Now you are ready to debug locally the library!
|
|
70
50
|
|
|
71
|
-
|
|
72
|
-
```bash
|
|
51
|
+
# when you are done
|
|
73
52
|
npm unlink npm link @smartico/public-api
|
|
74
53
|
npm install npm link @smartico/public-api
|
|
75
|
-
```
|
|
54
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare 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
|
+
GET_TRANSLATIONS_REQUEST = 13,
|
|
9
|
+
GET_TRANSLATIONS_RESPONSE = 14,
|
|
10
|
+
CHANGE_USERNAME = 159,
|
|
11
|
+
CHANGE_USERNAME_RESPONSE = 160,
|
|
12
|
+
SAW_GET_SPINS_REQUEST = 700,
|
|
13
|
+
SAW_GET_SPINS_RESPONSE = 701,
|
|
14
|
+
SAW_DO_SPIN_REQUEST = 702,
|
|
15
|
+
SAW_DO_SPIN_RESPONSE = 703,
|
|
16
|
+
SAW_AKNOWLEDGE_REQUEST = 704,
|
|
17
|
+
SAW_AKNOWLEDGE_RESPONSE = 705,
|
|
18
|
+
SAW_SPINS_COUNT_PUSH = 706,
|
|
19
|
+
SAW_SHOW_SPIN_PUSH = 707,
|
|
20
|
+
UNSUPPORTED_COMMAND = 99999
|
|
21
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare enum PublicLabelSettings {
|
|
2
|
+
FCM_SENDER_ID = "FCM_SENDER_ID",
|
|
3
|
+
PUBLIC_API_URL = "PUBLIC_API_URL",
|
|
4
|
+
FCM_SW_URL = "FCM_SW_URL",
|
|
5
|
+
RECORDING_ENABLED_FOR_ALL_USERS = "RECORDING_ENABLED_FOR_ALL_USERS",
|
|
6
|
+
JS_INJECTION = "JS_INJECTION",
|
|
7
|
+
GAMIFICATION_UI_MAIN = "GAMIFICATION_UI_MAIN",
|
|
8
|
+
GAMIFICATION_UI_WIDGET = "GAMIFICATION_UI_WIDGET",
|
|
9
|
+
GAMIFICATION_UI_MINI_GAME = "GAMIFICATION_UI_MINI_GAME",
|
|
10
|
+
GAMIFICATION_UI_SETTINGS = "GAMIFICATION_UI_SETTINGS",
|
|
11
|
+
GAMIFICATION_UI_MAIN_TEST = "GAMIFICATION_UI_MAIN_TEST",
|
|
12
|
+
GAMIFICATION_UI_WIDGET_TEST = "GAMIFICATION_UI_WIDGET_TEST",
|
|
13
|
+
GAMIFICATION_UI_SETTINGS_TEST = "GAMIFICATION_UI_SETTINGS_TEST",
|
|
14
|
+
FRONT_END_ALLOWED_LANGUAGES = "FRONT_END_ALLOWED_LANGUAGES",
|
|
15
|
+
FRONT_END_ALLOW_DOMAINS = "FRONT_END_ALLOW_DOMAINS",
|
|
16
|
+
DELAY_ENGAGEMENT_EXECUTION_ON_LOGIN_MS = "DELAY_ENGAGEMENT_EXECUTION_ON_LOGIN_MS",
|
|
17
|
+
SHADOW_LABEL_PUBLIC_KEY = "SHADOW_LABEL_PUBLIC_KEY",
|
|
18
|
+
DYNAMIC_IMAGE_DOMAIN = "DYNAMIC_IMAGE_DOMAIN",
|
|
19
|
+
GAMIFICATION_UI_LEVEL_ENABLED = "GAMIFICATION_UI_LEVEL_ENABLED",
|
|
20
|
+
GAMIFICATION_UI_LEVEL_IMAGE_MOB = "GAMIFICATION_UI_LEVEL_IMAGE_MOB",
|
|
21
|
+
GAMIFICATION_UI_LEVEL_IMAGE_DESK = "GAMIFICATION_UI_LEVEL_IMAGE_DESK",
|
|
22
|
+
GAMIFICATION_LEVELS_LOGIC2 = "GAMIFICATION_LEVELS_LOGIC2",
|
|
23
|
+
AVATAR_CUSTOM_IMAGE_MAX_ID = "AVATAR_CUSTOM_IMAGE_MAX_ID",
|
|
24
|
+
AVATAR_CUSTOM_IMAGE_FOLDER = "AVATAR_CUSTOM_IMAGE_FOLDER",
|
|
25
|
+
RETENTION_GAMES_CUSTOMER_ID = "RETENTION_GAMES_CUSTOMER_ID",
|
|
26
|
+
GAMIFICATION_SHOW_POWERED_BY = "GAMIFICATION_SHOW_POWERED_BY",
|
|
27
|
+
_system_leader_board_mask_username = "_system_leader_board_mask_username"
|
|
28
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface PublicProperties {
|
|
2
|
+
core_user_language?: string;
|
|
3
|
+
ach_points_balance?: number;
|
|
4
|
+
ach_points_ever?: number;
|
|
5
|
+
ach_points_board_period_type_1?: number;
|
|
6
|
+
ach_points_board_period_type_2?: number;
|
|
7
|
+
ach_level_current_id?: number;
|
|
8
|
+
ach_level_current?: string;
|
|
9
|
+
core_is_test_account?: boolean;
|
|
10
|
+
ach_gamification_in_control_group?: boolean;
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ProtocolResponse } from "../Base/ProtocolResponse";
|
|
2
|
+
import { PublicProperties } from "./PublicProperties";
|
|
3
|
+
interface ResponseIdentify extends ProtocolResponse {
|
|
4
|
+
user_id: number;
|
|
5
|
+
ext_user_id: string;
|
|
6
|
+
public_username: string;
|
|
7
|
+
avatar_id: string;
|
|
8
|
+
job: boolean;
|
|
9
|
+
props?: PublicProperties;
|
|
10
|
+
pubic_username_set: boolean;
|
|
11
|
+
}
|
|
12
|
+
export { ResponseIdentify };
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
export { GetTranslationsRequest, GetTranslationsResponse, GetLabelInfoRequest, GetLabelInfoResponse, TranslationArea, PublicLabelSettings, ResponseIdentify };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const ErrorCodes_FatalStartingRange = 100000;
|
|
2
|
+
export declare enum ErrorCodesGame {
|
|
3
|
+
OK = 0,
|
|
4
|
+
NoBetsUpdatedOnSubmit = 3,
|
|
5
|
+
RepeatRequest_Unhandled = 4,
|
|
6
|
+
Fatal_NotValidHash,
|
|
7
|
+
Fatal_WrongCustomerID,
|
|
8
|
+
Fatal_TemplateNotFound,
|
|
9
|
+
Fatal_NoOpenRounds,
|
|
10
|
+
Fatal_Unhandled
|
|
11
|
+
}
|
|
12
|
+
export type ErrorCodes = ErrorCodesGame;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare class IntUtils {
|
|
2
|
+
static uuid(): string;
|
|
3
|
+
static isNotNull(val: any): boolean;
|
|
4
|
+
static isNotEmpty(val: string): boolean;
|
|
5
|
+
static replaceAll(value: string, regex: string, replacement: string | number): string;
|
|
6
|
+
static escapeRegExp(v: string): string;
|
|
7
|
+
}
|
|
8
|
+
export { IntUtils };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ProtocolResponse } from "./../Base/ProtocolResponse";
|
|
2
|
+
import { SAWSpinErrorCode } from "./SAWSpinErrorCode";
|
|
3
|
+
export interface SAWDoSpinResponse extends ProtocolResponse {
|
|
4
|
+
errCode: SAWSpinErrorCode;
|
|
5
|
+
errMsg?: string;
|
|
6
|
+
request_id: string;
|
|
7
|
+
saw_prize_id: number;
|
|
8
|
+
first_spin_in_period: number;
|
|
9
|
+
}
|
|
@@ -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,26 @@
|
|
|
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
|
+
saw_skin_key: string;
|
|
22
|
+
saw_skin_ui_definition: {
|
|
23
|
+
skin_folder: string;
|
|
24
|
+
skin_css: string;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SAWAskForUsername } from "./SAWAskForUsername";
|
|
2
|
+
export interface SAWTemplateUI {
|
|
3
|
+
skin: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
over_limit_message?: string;
|
|
7
|
+
no_attempts_message?: string;
|
|
8
|
+
thumbnail?: string;
|
|
9
|
+
sectors_count: number;
|
|
10
|
+
priority: number;
|
|
11
|
+
flow_builder_only: boolean;
|
|
12
|
+
background_image?: string;
|
|
13
|
+
background_image_mobile?: string;
|
|
14
|
+
background_sound?: string;
|
|
15
|
+
scratch_logo?: string;
|
|
16
|
+
scratch_cover?: string;
|
|
17
|
+
scratch_bg_desktop?: string;
|
|
18
|
+
scratch_bg_mobile?: string;
|
|
19
|
+
scratch_cursor?: string;
|
|
20
|
+
custom_css?: string;
|
|
21
|
+
custom_skin_folder?: string;
|
|
22
|
+
jackpot_symbol?: string;
|
|
23
|
+
promo_image?: string;
|
|
24
|
+
promo_text?: string;
|
|
25
|
+
ask_for_username?: SAWAskForUsername;
|
|
26
|
+
show_prize_board?: boolean;
|
|
27
|
+
max_spins_period_ms?: number;
|
|
28
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SAWUtils } from "./SAWUtils";
|
|
2
|
+
import { SAWAcknowledgeType } from "./SAWAcknowledgeType";
|
|
3
|
+
import { SAWAskForUsername } from "./SAWAskForUsername";
|
|
4
|
+
import { SAWBuyInType, SAWBuyInTypeName } from "./SAWBuyInType";
|
|
5
|
+
import { SAWDoSpinRequest } from "./SAWDoSpinRequest";
|
|
6
|
+
import { SAWDoSpinResponse } from "./SAWDoSpinResponse";
|
|
7
|
+
import { SAWGameType, SAWGameTypeName } from "./SAWGameType";
|
|
8
|
+
import { SAWGetTemplatesRequest } from "./SAWGetTemplatesRequest";
|
|
9
|
+
import { SAWGetTemplatesResponse } from "./SAWGetTemplatesResponse";
|
|
10
|
+
import { SAWPrize } from "./SAWPrize";
|
|
11
|
+
import { SAWPrizeType } from "./SAWPrizeType";
|
|
12
|
+
import { SAWPrizeUI } from "./SAWPrizeUI";
|
|
13
|
+
import { SAWSpinErrorCode } from "./SAWSpinErrorCode";
|
|
14
|
+
import { SAWTemplate } from "./SAWTemplate";
|
|
15
|
+
import { SAWTemplateUI } from "./SAWTemplateUI";
|
|
16
|
+
import { SAWWinSoundType, SAWWinSoundFiles } from "./SAWWinSoundType";
|
|
17
|
+
export { SAWUtils, SAWAcknowledgeType, SAWBuyInType, SAWBuyInTypeName, SAWDoSpinRequest, SAWDoSpinResponse, SAWGameType, SAWGameTypeName, SAWGetTemplatesRequest, SAWGetTemplatesResponse, SAWPrize, SAWPrizeType, SAWPrizeUI, SAWTemplate, SAWTemplateUI, SAWWinSoundType, SAWWinSoundFiles, SAWAskForUsername, SAWSpinErrorCode };
|
package/dist/OCache.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare enum ECacheContext {
|
|
2
|
+
Translations = 0,
|
|
3
|
+
LabelInfo = 1
|
|
4
|
+
}
|
|
5
|
+
export declare class OCache {
|
|
6
|
+
private static cache;
|
|
7
|
+
static get<T>(oKey: any, cacheContext: ECacheContext): T | undefined;
|
|
8
|
+
static set(oKey: any, o: any, cacheContext: ECacheContext, ttlSeconds?: number): void;
|
|
9
|
+
static use<T>(oKey: any, cacheContext: ECacheContext, f: () => Promise<T>, ttlSeconds?: number): Promise<T>;
|
|
10
|
+
static clear(cacheContext: ECacheContext): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ClassId } from "./Base/ClassId";
|
|
2
|
+
import { SAWGetTemplatesResponse } from './MiniGames/SAWGetTemplatesResponse';
|
|
3
|
+
import { SAWTemplate } from './MiniGames/SAWTemplate';
|
|
4
|
+
import { ILogger } from './ILogger';
|
|
5
|
+
import { SAWDoSpinResponse } from './MiniGames';
|
|
6
|
+
import { GetTranslationsResponse, ResponseIdentify, TranslationArea } from './Core';
|
|
7
|
+
import { GetLabelInfoResponse } from './Core/GetLabelInfoResponse';
|
|
8
|
+
interface IOptions {
|
|
9
|
+
logger?: ILogger;
|
|
10
|
+
logCIDs?: ClassId[];
|
|
11
|
+
logHTTPTiming?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare class SmarticoAPI {
|
|
14
|
+
private label_api_key;
|
|
15
|
+
private brand_api_key;
|
|
16
|
+
private publicUrl;
|
|
17
|
+
private avatarDomain;
|
|
18
|
+
private logger;
|
|
19
|
+
private logCIDs;
|
|
20
|
+
private logHTTPTiming;
|
|
21
|
+
constructor(label_api_key: string, brand_api_key: string, options?: IOptions);
|
|
22
|
+
private send;
|
|
23
|
+
private buildMessage;
|
|
24
|
+
coreReportCustomEvent(user_ext_id: string, eventType: string, payload?: any): Promise<any>;
|
|
25
|
+
coreGetTranslations(user_ext_id: string, lang_code: string, areas: TranslationArea[], cacheSec?: number): Promise<GetTranslationsResponse>;
|
|
26
|
+
coreIdentifyLabel(user_ext_id: string, cacheSec?: number): Promise<GetLabelInfoResponse>;
|
|
27
|
+
coreIdentifyUser(user_ext_id: string): Promise<ResponseIdentify>;
|
|
28
|
+
coreChangeUsername(user_ext_id: string, public_username_custom: string): Promise<{
|
|
29
|
+
public_username_custom: string;
|
|
30
|
+
}>;
|
|
31
|
+
sawGetTemplates(user_ext_id: string): Promise<SAWGetTemplatesResponse>;
|
|
32
|
+
sawFormatTemplatesForWidget(templates: SAWTemplate[], pointsBalance: number): Promise<any[]>;
|
|
33
|
+
sawSpinRequest(user_ext_id: string, saw_template_id: number, round_id: number): Promise<SAWDoSpinResponse>;
|
|
34
|
+
}
|
|
35
|
+
export { SmarticoAPI };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ClassId } from "./Base/ClassId";
|
|
2
|
+
import { SAWGetTemplatesResponse } from './MiniGames/SAWGetTemplatesResponse';
|
|
3
|
+
import { SAWTemplate } from './MiniGames/SAWTemplate';
|
|
4
|
+
import { ILogger } from './ILogger';
|
|
5
|
+
interface IOptions {
|
|
6
|
+
logger?: ILogger;
|
|
7
|
+
logCIDs?: ClassId[];
|
|
8
|
+
logHTTPTiming?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare class SmarticoPublicApi {
|
|
11
|
+
private label_api_key;
|
|
12
|
+
private brand_api_key;
|
|
13
|
+
private publicUrl;
|
|
14
|
+
private logger;
|
|
15
|
+
private logCIDs;
|
|
16
|
+
private logHTTPTiming;
|
|
17
|
+
constructor(label_api_key: string, brand_api_key: string, options?: IOptions);
|
|
18
|
+
private send;
|
|
19
|
+
private buildMessage;
|
|
20
|
+
miniGamesGetTemplates(user_ext_id: string): Promise<SAWGetTemplatesResponse>;
|
|
21
|
+
miniGamesFormatTemplatesForWidget(templates: SAWTemplate[], pointsBalance: number): any[];
|
|
22
|
+
}
|
|
23
|
+
export { SmarticoPublicApi };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { ClassId } from './Base/ClassId';
|
|
2
|
+
import { ILogger } from './ILogger';
|
|
3
|
+
import { SmarticoAPI } from './SmarticoAPI';
|
|
4
|
+
export * from './MiniGames';
|
|
5
|
+
export * from './Core';
|
|
6
|
+
export { SmarticoAPI, ClassId, ILogger };
|