@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.
Files changed (123) hide show
  1. package/.nvmrc +1 -1
  2. package/README.md +23 -44
  3. package/dist/Base/ClassId.d.ts +21 -0
  4. package/dist/Base/ProtocolMessage.d.ts +5 -0
  5. package/dist/Base/ProtocolRequest.d.ts +6 -0
  6. package/dist/Base/ProtocolResponse.d.ts +5 -0
  7. package/dist/Core/GetLabelInfoRequest.d.ts +3 -0
  8. package/dist/Core/GetLabelInfoResponse.d.ts +7 -0
  9. package/dist/Core/GetTranslationsRequest.d.ts +7 -0
  10. package/dist/Core/GetTranslationsResponse.d.ts +7 -0
  11. package/dist/Core/PublicLabelSettings.d.ts +28 -0
  12. package/dist/Core/PublicProperties.d.ts +11 -0
  13. package/dist/Core/ResponseIdentify.d.ts +12 -0
  14. package/dist/Core/TranslationArea.d.ts +9 -0
  15. package/dist/Core/index.d.ts +8 -0
  16. package/dist/ErrorCodes.d.ts +12 -0
  17. package/dist/GResponse.d.ts +9 -0
  18. package/dist/ILogger.d.ts +7 -0
  19. package/dist/IntUtils.d.ts +8 -0
  20. package/dist/MiniGames/SAWAcknowledgeType.d.ts +5 -0
  21. package/dist/MiniGames/SAWAskForUsername.d.ts +4 -0
  22. package/dist/MiniGames/SAWBuyInType.d.ts +10 -0
  23. package/dist/MiniGames/SAWDoSpinRequest.d.ts +5 -0
  24. package/dist/MiniGames/SAWDoSpinResponse.d.ts +9 -0
  25. package/dist/MiniGames/SAWGameType.d.ts +10 -0
  26. package/dist/MiniGames/SAWGetTemplatesRequest.d.ts +3 -0
  27. package/dist/MiniGames/SAWGetTemplatesResponse.d.ts +5 -0
  28. package/dist/MiniGames/SAWPrize.d.ts +11 -0
  29. package/dist/MiniGames/SAWPrizeType.d.ts +8 -0
  30. package/dist/MiniGames/SAWPrizeUI.d.ts +13 -0
  31. package/dist/MiniGames/SAWSpinErrorCode.d.ts +7 -0
  32. package/dist/MiniGames/SAWTemplate.d.ts +26 -0
  33. package/dist/MiniGames/SAWTemplateUI.d.ts +28 -0
  34. package/dist/MiniGames/SAWUtils.d.ts +5 -0
  35. package/dist/MiniGames/SAWWinSoundType.d.ts +12 -0
  36. package/dist/MiniGames/index.d.ts +17 -0
  37. package/dist/OCache.d.ts +11 -0
  38. package/dist/SmarticoAPI.d.ts +35 -0
  39. package/dist/SmarticoPublicAPI.d.ts +23 -0
  40. package/dist/index.d.ts +6 -2
  41. package/dist/index.js +576 -219
  42. package/dist/index.js.map +1 -1
  43. package/dist/index.modern.mjs +417 -218
  44. package/dist/index.modern.mjs.map +1 -1
  45. package/dist/service/index.d.ts +3 -2
  46. package/dist/service/types/ErrorCodes.d.ts +13 -0
  47. package/dist/service/types/GRequest.d.ts +16 -0
  48. package/dist/service/types/GResponse.d.ts +10 -0
  49. package/dist/service/types/Game/GameAttemptType.d.ts +6 -0
  50. package/{src/service/types/Game/GameCanPlayType.ts → dist/service/types/Game/GameCanPlayType.d.ts} +10 -11
  51. package/dist/service/types/Game/GameExternalStatus.d.ts +6 -0
  52. package/{src/service/types/Game/GameInfo.ts → dist/service/types/Game/GameInfo.d.ts} +9 -11
  53. package/{src/service/types/Game/GamePick.ts → dist/service/types/Game/GamePick.d.ts} +90 -104
  54. package/dist/service/types/Game/GameUtil.d.ts +7 -0
  55. package/{src/service/types/SmarticoProto/GetTranslationsRequest.ts → dist/service/types/SmarticoProto/GetTranslationsRequest.d.ts} +7 -9
  56. package/dist/service/types/SmarticoProto/GetTranslationsResponse.d.ts +7 -0
  57. package/dist/service/types/SmarticoProto/ProtocolMessage.d.ts +5 -0
  58. package/dist/service/types/SmarticoProto/ProtocolRequest.d.ts +6 -0
  59. package/dist/service/types/SmarticoProto/ProtocolResponse.d.ts +5 -0
  60. package/dist/service/types/SmarticoProto/PublicLabelInfo.d.ts +34 -0
  61. package/dist/service/types/SmarticoProto/PublicProperties.d.ts +11 -0
  62. package/{src/service/types/SmarticoProto/ResponseIdentify.ts → dist/service/types/SmarticoProto/ResponseIdentify.d.ts} +12 -16
  63. package/dist/service/types/SmarticoProto/SAW/SAWAcknowledgeType.d.ts +5 -0
  64. package/{src/service/types/SmarticoProto/SAW/SAWBuyInType.ts → dist/service/types/SmarticoProto/SAW/SAWBuyInType.d.ts} +5 -5
  65. package/{src/service/types/SmarticoProto/SAW/SAWDoSpinRequest.ts → dist/service/types/SmarticoProto/SAW/SAWDoSpinRequest.d.ts} +5 -8
  66. package/{src/service/types/SmarticoProto/SAW/SAWDoSpinResponse.ts → dist/service/types/SmarticoProto/SAW/SAWDoSpinResponse.d.ts} +15 -18
  67. package/dist/service/types/SmarticoProto/SAW/SAWGameType.d.ts +10 -0
  68. package/{src/service/types/SmarticoProto/SAW/SAWGetTemplatesRequest.ts → dist/service/types/SmarticoProto/SAW/SAWGetTemplatesRequest.d.ts} +3 -5
  69. package/{src/service/types/SmarticoProto/SAW/SAWGetTemplatesResponse.ts → dist/service/types/SmarticoProto/SAW/SAWGetTemplatesResponse.d.ts} +5 -8
  70. package/dist/service/types/SmarticoProto/SAW/SAWPrize.d.ts +11 -0
  71. package/dist/service/types/SmarticoProto/SAW/SAWPrizeType.d.ts +8 -0
  72. package/dist/service/types/SmarticoProto/SAW/SAWPrizeUI.d.ts +13 -0
  73. package/dist/service/types/SmarticoProto/SAW/SAWTemplate.d.ts +21 -0
  74. package/{src/service/types/SmarticoProto/SAW/SAWTemplateUI.ts → dist/service/types/SmarticoProto/SAW/SAWTemplateUI.d.ts} +31 -33
  75. package/dist/service/types/SmarticoProto/SAW/SAWWinSoundType.d.ts +12 -0
  76. package/dist/service/types/SmarticoProto/TranslationArea.d.ts +9 -0
  77. package/{src/service/types/User/UserInfo.ts → dist/service/types/User/UserInfo.d.ts} +10 -12
  78. package/package.json +10 -3
  79. package/src/Base/ClassId.ts +26 -0
  80. package/src/{service/types/SmarticoProto → Base}/ProtocolMessage.ts +0 -0
  81. package/src/{service/types/SmarticoProto → Base}/ProtocolRequest.ts +0 -0
  82. package/src/{service/types/SmarticoProto → Base}/ProtocolResponse.ts +0 -0
  83. package/src/Core/GetLabelInfoRequest.ts +5 -0
  84. package/src/Core/GetLabelInfoResponse.ts +6 -0
  85. package/src/Core/GetTranslationsRequest.ts +10 -0
  86. package/src/{service/types/SmarticoProto → Core}/GetTranslationsResponse.ts +1 -1
  87. package/src/{service/types/SmarticoProto/PublicLabelInfo.ts → Core/PublicLabelSettings.ts} +1 -6
  88. package/src/{service/types/SmarticoProto → Core}/PublicProperties.ts +0 -0
  89. package/src/Core/ResponseIdentify.ts +14 -0
  90. package/src/{service/types/SmarticoProto → Core}/TranslationArea.ts +1 -1
  91. package/src/Core/index.ts +18 -0
  92. package/src/{service/types/ErrorCodes.ts → ErrorCodes.ts} +1 -3
  93. package/src/{service/types/GResponse.ts → GResponse.ts} +0 -0
  94. package/src/ILogger.ts +11 -0
  95. package/src/IntUtils.ts +39 -0
  96. package/src/{service/types/SmarticoProto/SAW → MiniGames}/SAWAcknowledgeType.ts +0 -0
  97. package/src/MiniGames/SAWAskForUsername.ts +5 -0
  98. package/src/MiniGames/SAWBuyInType.ts +11 -0
  99. package/src/MiniGames/SAWDoSpinRequest.ts +8 -0
  100. package/src/MiniGames/SAWDoSpinResponse.ts +11 -0
  101. package/src/{service/types/SmarticoProto/SAW → MiniGames}/SAWGameType.ts +2 -2
  102. package/src/MiniGames/SAWGetTemplatesRequest.ts +5 -0
  103. package/src/MiniGames/SAWGetTemplatesResponse.ts +8 -0
  104. package/src/{service/types/SmarticoProto/SAW → MiniGames}/SAWPrize.ts +0 -0
  105. package/src/{service/types/SmarticoProto/SAW → MiniGames}/SAWPrizeType.ts +0 -0
  106. package/src/{service/types/SmarticoProto/SAW → MiniGames}/SAWPrizeUI.ts +0 -0
  107. package/src/MiniGames/SAWSpinErrorCode.ts +8 -0
  108. package/src/{service/types/SmarticoProto/SAW → MiniGames}/SAWTemplate.ts +5 -0
  109. package/src/MiniGames/SAWTemplateUI.ts +31 -0
  110. package/src/MiniGames/SAWUtils.ts +31 -0
  111. package/src/{service/types/SmarticoProto/SAW → MiniGames}/SAWWinSoundType.ts +0 -0
  112. package/src/MiniGames/index.ts +35 -0
  113. package/src/OCache.ts +54 -0
  114. package/src/SmarticoAPI.ts +296 -0
  115. package/src/index.ts +12 -2
  116. package/tsconfig.json +17 -0
  117. package/src/service/index.ts +0 -12
  118. package/src/service/types/GRequest.ts +0 -18
  119. package/src/service/types/Game/GameAttemptType.ts +0 -8
  120. package/src/service/types/Game/GameExternalStatus.ts +0 -7
  121. package/src/service/types/Game/GameUtil.ts +0 -30
  122. package/src/util/Util.ts +0 -306
  123. package/test/package.json +0 -11
@@ -1,8 +1,5 @@
1
- import { ProtocolRequest } from "./ProtocolRequest";
2
-
3
-
4
- export interface SAWDoSpinRequest extends ProtocolRequest {
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
- export enum SAWSpinErrorCode {
5
- SAW_OK = 0,
6
- SAW_NO_SPINS = 40001,
7
- SAW_PRIZE_POOL_EMPTY = 40002,
8
- SAW_NOT_ENOUGH_POINTS = 40003,
9
- SAW_FAILED_MAX_SPINS_REACHED = 40004,
10
- }
11
-
12
- export interface SAWDoSpinResponse extends ProtocolResponse {
13
- errCode: SAWSpinErrorCode;
14
- errMsg?: string;
15
- request_id: string; // guid
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
+ }
@@ -0,0 +1,10 @@
1
+ export declare enum SAWGameType {
2
+ SpinAWheel = 1,
3
+ ScratchCard = 2,
4
+ SportPick = 3
5
+ }
6
+ export declare const SAWGameTypeName: {
7
+ 1: string;
8
+ 2: string;
9
+ 3: string;
10
+ };
@@ -1,5 +1,3 @@
1
- import { ProtocolRequest } from "../ProtocolRequest";
2
-
3
- export interface SAWGetTemplatesRequest extends ProtocolRequest {
4
-
5
- }
1
+ import { ProtocolRequest } from "../ProtocolRequest";
2
+ export interface SAWGetTemplatesRequest extends ProtocolRequest {
3
+ }
@@ -1,8 +1,5 @@
1
- import { ProtocolResponse } from "../ProtocolResponse";
2
- import { SAWTemplate } from "./SAWTemplate";
3
-
4
-
5
- export interface SAWGetTemplatesResponse extends ProtocolResponse {
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,8 @@
1
+ export declare enum SAWPrizeType {
2
+ NO_PRIZE = 1,
3
+ POINTS = 2,
4
+ BONUS = 3,
5
+ MANUAL = 4,
6
+ SPIN = 5,
7
+ JACKPOT = 6
8
+ }
@@ -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
- promo_image?: string;
28
- promo_text?: string;
29
- ask_for_username?: AskForUsername;
30
- show_prize_board?: boolean;
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
+ }
@@ -0,0 +1,12 @@
1
+ export declare enum SAWWinSoundType {
2
+ Disappointing = 1,
3
+ Positive = 2,
4
+ HighlyPositive = 3,
5
+ NoSound = 4
6
+ }
7
+ export declare const SAWWinSoundFiles: {
8
+ 4: any;
9
+ 1: string;
10
+ 2: string;
11
+ 3: string;
12
+ };
@@ -0,0 +1,9 @@
1
+ declare enum TranslationArea {
2
+ Casino = 1,
3
+ Gamification = 2,
4
+ Trading = 3,
5
+ Archived = 4,
6
+ Affiliation = 5,
7
+ RetentionGames = 6
8
+ }
9
+ export { TranslationArea };
@@ -1,12 +1,10 @@
1
- interface UserInfo {
2
-
3
- ext_user_id: string;
4
- int_user_id: number;
5
- public_username: string;
6
- avatar_url: string;
7
- last_wallet_sync_time?: Date;
8
- ach_points_balance?: number;
9
- pubic_username_set?: boolean;
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",
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
- "pub": "npm run build && npm publish"
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
+ }
@@ -0,0 +1,5 @@
1
+
2
+ import { ProtocolRequest } from "../Base/ProtocolRequest";
3
+
4
+ export interface GetLabelInfoRequest extends ProtocolRequest {
5
+ }
@@ -0,0 +1,6 @@
1
+ import { ProtocolResponse } from "../Base/ProtocolResponse";
2
+
3
+ export interface GetLabelInfoResponse extends ProtocolResponse {
4
+ settings: { [key: string]: string },
5
+ label_id: string,
6
+ }
@@ -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,4 +1,4 @@
1
- import { ProtocolResponse } from "./ProtocolResponse";
1
+ import { ProtocolResponse } from "../Base/ProtocolResponse";
2
2
 
3
3
  export interface GetTranslationsResponse extends ProtocolResponse {
4
4
 
@@ -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
- }
@@ -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 }
@@ -8,4 +8,4 @@ enum TranslationArea {
8
8
  RetentionGames = 6
9
9
  }
10
10
 
11
- export {TranslationArea};
11
+ export { TranslationArea };
@@ -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 = SAWSpinErrorCode | ErrorCodesGame;
17
+ export type ErrorCodes = ErrorCodesGame;
File without changes
package/src/ILogger.ts ADDED
@@ -0,0 +1,11 @@
1
+
2
+
3
+ export interface ILogger {
4
+
5
+ debug(...any: any[]): void;
6
+ error(...any: any[]): void;
7
+ info(...any: any[]): void;
8
+ warn(...any: any[]): void;
9
+ always(...any: any[]): void;
10
+
11
+ }
@@ -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 }
@@ -0,0 +1,5 @@
1
+
2
+ export enum SAWAskForUsername {
3
+ NOASK = "no-ask",
4
+ ONSUMBIT = "on-submit"
5
+ }
@@ -0,0 +1,11 @@
1
+ export enum SAWBuyInType {
2
+ Free = 1,
3
+ Points = 2,
4
+ Spins = 3
5
+ }
6
+
7
+ export const SAWBuyInTypeName = {
8
+ [SAWBuyInType.Free]: "free",
9
+ [SAWBuyInType.Points]: "points",
10
+ [SAWBuyInType.Spins]: "spins",
11
+ }
@@ -0,0 +1,8 @@
1
+ import { ProtocolRequest } from "./../Base/ProtocolRequest";
2
+
3
+
4
+ export interface SAWDoSpinRequest extends ProtocolRequest {
5
+
6
+ request_id: string; // guid
7
+ saw_template_id: number;
8
+ }
@@ -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
- SportPick = 3
4
+ MatchX = 3
5
5
  }
6
6
 
7
7
  export const SAWGameTypeName = {
8
8
  [SAWGameType.SpinAWheel]: "wheel",
9
9
  [SAWGameType.ScratchCard]: "scratch",
10
- [SAWGameType.SportPick]: "sportpick",
10
+ [SAWGameType.MatchX]: "matchx",
11
11
  }
@@ -0,0 +1,5 @@
1
+ import { ProtocolRequest } from "./../Base/ProtocolRequest";
2
+
3
+ export interface SAWGetTemplatesRequest extends ProtocolRequest {
4
+
5
+ }
@@ -0,0 +1,8 @@
1
+ import { ProtocolResponse } from "./../Base/ProtocolResponse";
2
+ import { SAWTemplate } from "./SAWTemplate";
3
+
4
+
5
+ export interface SAWGetTemplatesResponse extends ProtocolResponse {
6
+
7
+ templates: SAWTemplate[];
8
+ }
@@ -0,0 +1,8 @@
1
+
2
+ export 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
+ }
@@ -26,4 +26,9 @@ export interface SAWTemplate {
26
26
  maxSpinsCount: number;
27
27
  maxSpinsPediodMs: number;
28
28
 
29
+ saw_skin_key: string;
30
+ saw_skin_ui_definition: {
31
+ skin_folder: string;
32
+ skin_css: string;
33
+ };
29
34
  }
@@ -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
+ }