@smartico/public-api 0.0.4 → 0.0.6

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 (57) hide show
  1. package/README.md +23 -44
  2. package/dist/Base/ClassId.d.ts +53 -4
  3. package/dist/Core/GetLabelInfoRequest.d.ts +3 -0
  4. package/dist/Core/GetLabelInfoResponse.d.ts +7 -0
  5. package/dist/Core/GetTranslationsRequest.d.ts +7 -0
  6. package/dist/Core/GetTranslationsResponse.d.ts +7 -0
  7. package/dist/Core/PublicLabelSettings.d.ts +28 -0
  8. package/dist/Core/PublicProperties.d.ts +11 -0
  9. package/dist/Core/ResponseIdentify.d.ts +12 -0
  10. package/dist/Core/TranslationArea.d.ts +9 -0
  11. package/dist/Core/index.d.ts +8 -0
  12. package/dist/Inbox/GetInboxMessagesRequest.d.ts +5 -0
  13. package/dist/Inbox/GetInboxMessagesResponse.d.ts +5 -0
  14. package/dist/Inbox/InboxMessage.d.ts +12 -0
  15. package/dist/Inbox/InboxMessageType.d.ts +11 -0
  16. package/dist/Inbox/index.d.ts +5 -0
  17. package/dist/MiniGames/SAWAskForUsername.d.ts +4 -0
  18. package/dist/MiniGames/SAWDoSpinResponse.d.ts +1 -7
  19. package/dist/MiniGames/SAWSpinErrorCode.d.ts +7 -0
  20. package/dist/MiniGames/SAWTemplateUI.d.ts +2 -5
  21. package/dist/MiniGames/SAWUtils.d.ts +5 -0
  22. package/dist/MiniGames/index.d.ts +5 -2
  23. package/dist/NodeCache.d.ts +9 -0
  24. package/dist/OCache.d.ts +11 -0
  25. package/dist/SmarticoAPI.d.ts +16 -2
  26. package/dist/index.d.ts +2 -0
  27. package/dist/index.js +431 -40
  28. package/dist/index.js.map +1 -1
  29. package/dist/index.modern.mjs +324 -23
  30. package/dist/index.modern.mjs.map +1 -1
  31. package/package.json +11 -3
  32. package/src/Base/ClassId.ts +64 -6
  33. package/src/Base/ProtocolMessage.ts +6 -1
  34. package/src/Core/GetLabelInfoRequest.ts +5 -0
  35. package/src/Core/GetLabelInfoResponse.ts +6 -0
  36. package/src/Core/GetTranslationsRequest.ts +10 -0
  37. package/src/Core/GetTranslationsResponse.ts +8 -0
  38. package/src/Core/PublicLabelSettings.ts +34 -0
  39. package/src/Core/PublicProperties.ts +11 -0
  40. package/src/Core/ResponseIdentify.ts +14 -0
  41. package/src/Core/TranslationArea.ts +11 -0
  42. package/src/Core/index.ts +18 -0
  43. package/src/Inbox/GetInboxMessagesRequest.ts +7 -0
  44. package/src/Inbox/GetInboxMessagesResponse.ts +7 -0
  45. package/src/Inbox/InboxMessage.ts +14 -0
  46. package/src/Inbox/InboxMessageType.ts +13 -0
  47. package/src/Inbox/index.ts +11 -0
  48. package/src/MiniGames/SAWAskForUsername.ts +5 -0
  49. package/src/MiniGames/SAWDoSpinResponse.ts +1 -8
  50. package/src/MiniGames/SAWSpinErrorCode.ts +8 -0
  51. package/src/MiniGames/SAWTemplateUI.ts +3 -5
  52. package/src/MiniGames/SAWUtils.ts +31 -0
  53. package/src/MiniGames/index.ts +8 -3
  54. package/src/NodeCache.ts +45 -0
  55. package/src/OCache.ts +55 -0
  56. package/src/SmarticoAPI.ts +142 -9
  57. package/src/index.ts +2 -0
package/README.md CHANGED
@@ -1,8 +1,7 @@
1
- # The library for communication with Smartico API
2
- - Allows to make requests and receive a response over https
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
- # Install in your application
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 { ProtocolRequest, GBaseRequest } from '@smartico/public-api';
13
+ import { SmarticoAPI } from '@smartico/public-api';
15
14
 
16
- class Example {
17
-
18
- private static buildMessage<TRequest,TResponse>(rq: GBaseRequest): TResponse {
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
- ## Pre-requisite for publish new version of package
23
+ ```
35
24
 
36
- ### Set new package version
37
25
 
38
- ```sh
39
- npm run build
40
- npm version [<newversion> | major | minor | patch ]
41
- ```
26
+ ## Development and publishing process
42
27
 
43
- ### Manual publish new version
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
- # Developing & debugging locally
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
- 1. Assure you are in the project folder (`cd <your-local-git-folder-for-this-project>/public-api `)
58
- 2. Run:
59
- ```sh
60
- npm link
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
- ### Before you deploy !!! Cleanup if you enabled the debug changes locally steps above
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
+ ```
@@ -1,14 +1,60 @@
1
1
  export declare enum ClassId {
2
- GET_LABEL_INFO = 3,
3
- GET_LABEL_INFO_RESPONSE = 4,
2
+ INIT = 3,
3
+ INIT_RESPONSE = 4,
4
4
  IDENTIFY = 5,
5
5
  IDENTIFY_RESPONSE = 6,
6
+ LOGIN = 7,
7
+ LOGOUT = 8,
6
8
  EVENT = 9,
7
9
  EVENT_RESPONSE = 10,
10
+ LOGIN_RESPONSE = 11,
11
+ LOGOUT_RESPONSE = 12,
8
12
  GET_TRANSLATIONS_REQUEST = 13,
9
13
  GET_TRANSLATIONS_RESPONSE = 14,
10
- CHANGE_USERNAME = 159,
11
- CHANGE_USERNAME_RESPONSE = 160,
14
+ CLIENT_ENGAGEMENT_IMPRESSION_REQUEST = 103,
15
+ CLIENT_ENGAGEMENT_ACTION_REQUEST = 104,
16
+ CLIENT_EXECUTE_DEEPLINK_EVENT = 105,
17
+ CLIENT_ENGAGEMENT_FAILED_REQUEST = 106,
18
+ CLIENT_EXECUTE_JS_EVENT = 107,
19
+ CLIENT_PUBLIC_PROPERTIES_CHANGED_EVENT = 108,
20
+ CLIENT_ENGAGEMENT_EVENT_NEW = 110,
21
+ CLIENT_SET_AVATAR_REQUEST = 157,
22
+ CLIENT_SET_AVATAR_RESPONSE = 158,
23
+ CLIENT_SET_CUSTOM_USERNAME_REQUEST = 159,
24
+ CLIENT_SET_CUSTOM_USERNAME_RESPONSE = 160,
25
+ GET_LEVEL_MAP_REQUEST = 500,
26
+ GET_LEVEL_MAP_RESPONSE = 501,
27
+ GET_ACHIEVEMENT_MAP_REQUEST = 502,
28
+ GET_ACHIEVEMENT_MAP_RESPONSE = 503,
29
+ RELOAD_ACHIEVEMENTS_EVENT = 504,
30
+ GET_LEADERS_BOARD_REQUEST = 505,
31
+ GET_LEADERS_BOARD_RESPONSE = 506,
32
+ GET_ACTIVITY_LOG_REQUEST = 507,
33
+ GET_ACTIVITY_LOG_RESPONSE = 508,
34
+ GET_SHOP_ITEMS_REQUEST = 509,
35
+ GET_SHOP_ITEMS_RESPONSE = 510,
36
+ BUY_SHOP_ITEM_REQUEST = 511,
37
+ BUY_SHOP_ITEM_RESPONSE = 512,
38
+ GET_INBOX_MESSAGES_REQUEST = 513,
39
+ GET_INBOX_MESSAGES_RESPONSE = 514,
40
+ GET_SHOP_CATEGORIES_REQUEST = 515,
41
+ GET_SHOP_CATEGORIES_RESPONSE = 516,
42
+ GET_TOURNAMENT_LOBBY_REQUEST = 517,
43
+ GET_TOURNAMENT_LOBBY_RESPONSE = 518,
44
+ GET_TOURNAMENT_INFO_REQUEST = 519,
45
+ GET_TOURNAMENT_INFO_RESPONSE = 520,
46
+ TOURNAMENT_REGISTER_REQUEST = 521,
47
+ TOURNAMENT_REGISTER_RESPONSE = 522,
48
+ GET_CUSTOM_SECTIONS_REQUEST = 523,
49
+ GET_CUSTOM_SECTIONS_RESPONSE = 524,
50
+ MISSION_OPTIN_REQUEST = 525,
51
+ MISSION_OPTIN_RESPONSE = 526,
52
+ GET_ACHIEVEMENT_USER_REQUEST = 527,
53
+ GET_ACHIEVEMENT_USER_RESPONSE = 528,
54
+ GET_BONUSES_REQUEST = 600,
55
+ GET_BONUSES_RESPONSE = 601,
56
+ CLAIM_BONUS_REQUEST = 602,
57
+ CLAIM_BONUS_RESPONSE = 603,
12
58
  SAW_GET_SPINS_REQUEST = 700,
13
59
  SAW_GET_SPINS_RESPONSE = 701,
14
60
  SAW_DO_SPIN_REQUEST = 702,
@@ -17,5 +63,8 @@ export declare enum ClassId {
17
63
  SAW_AKNOWLEDGE_RESPONSE = 705,
18
64
  SAW_SPINS_COUNT_PUSH = 706,
19
65
  SAW_SHOW_SPIN_PUSH = 707,
66
+ REGISTER_PUSH_NOTIFICATIONS_TOKEN_REQ = 1003,
67
+ REGISTER_PUSH_NOTIFICATIONS_TOKEN_RESP = 2003,
68
+ CLIENT_DEBUG_REQUEST = 77777,
20
69
  UNSUPPORTED_COMMAND = 99999
21
70
  }
@@ -0,0 +1,3 @@
1
+ import { ProtocolRequest } from "../Base/ProtocolRequest";
2
+ export interface GetLabelInfoRequest extends ProtocolRequest {
3
+ }
@@ -0,0 +1,7 @@
1
+ import { ProtocolResponse } from "../Base/ProtocolResponse";
2
+ export interface GetLabelInfoResponse extends ProtocolResponse {
3
+ settings: {
4
+ [key: string]: string;
5
+ };
6
+ label_id: string;
7
+ }
@@ -0,0 +1,7 @@
1
+ import { ProtocolRequest } from "../Base/ProtocolRequest";
2
+ import { TranslationArea } from "./TranslationArea";
3
+ export interface GetTranslationsRequest extends ProtocolRequest {
4
+ hash_code: number;
5
+ areas: TranslationArea[];
6
+ lang_code: string;
7
+ }
@@ -0,0 +1,7 @@
1
+ import { ProtocolResponse } from "../Base/ProtocolResponse";
2
+ export interface GetTranslationsResponse extends ProtocolResponse {
3
+ hash_code: number;
4
+ translations: {
5
+ [key: string]: string;
6
+ };
7
+ }
@@ -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,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 };
@@ -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,5 @@
1
+ import { ProtocolMessage } from "../Base/ProtocolMessage";
2
+ export interface GetInboxMessagesRequest extends ProtocolMessage {
3
+ limit?: number;
4
+ offset?: number;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { ProtocolResponse } from "../Base/ProtocolResponse";
2
+ import { InboxMessage } from "./InboxMessage";
3
+ export interface GetInboxMessagesResponse extends ProtocolResponse {
4
+ log: InboxMessage[];
5
+ }
@@ -0,0 +1,12 @@
1
+ import { InboxMessageType } from "./InboxMessageType";
2
+ export interface InboxMessage {
3
+ createDate: string;
4
+ body: {
5
+ action: string;
6
+ body: string;
7
+ type: InboxMessageType;
8
+ image: string;
9
+ title: string;
10
+ html_body: string;
11
+ };
12
+ }
@@ -0,0 +1,11 @@
1
+ export declare enum InboxMessageType {
2
+ Custom = 0,
3
+ MissionCompleted = 1,
4
+ MissionUnlocked = 2,
5
+ LeaderboardWon = 3,
6
+ LevelChanged = 4,
7
+ BonusGiven = 5,
8
+ PointsAdded = 6,
9
+ PointsUsed = 7,
10
+ PersonalMessage = 8
11
+ }
@@ -0,0 +1,5 @@
1
+ import { GetInboxMessagesRequest } from "./GetInboxMessagesRequest";
2
+ import { GetInboxMessagesResponse } from "./GetInboxMessagesResponse";
3
+ import { InboxMessage } from "./InboxMessage";
4
+ import { InboxMessageType } from "./InboxMessageType";
5
+ export { InboxMessage, InboxMessageType, GetInboxMessagesRequest, GetInboxMessagesResponse, };
@@ -0,0 +1,4 @@
1
+ export declare enum SAWAskForUsername {
2
+ NOASK = "no-ask",
3
+ ONSUMBIT = "on-submit"
4
+ }
@@ -1,11 +1,5 @@
1
1
  import { ProtocolResponse } from "./../Base/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
- }
2
+ import { SAWSpinErrorCode } from "./SAWSpinErrorCode";
9
3
  export interface SAWDoSpinResponse extends ProtocolResponse {
10
4
  errCode: SAWSpinErrorCode;
11
5
  errMsg?: string;
@@ -0,0 +1,7 @@
1
+ export declare enum SAWSpinErrorCode {
2
+ SAW_OK = 0,
3
+ SAW_NO_SPINS = 40001,
4
+ SAW_PRIZE_POOL_EMPTY = 40002,
5
+ SAW_NOT_ENOUGH_POINTS = 40003,
6
+ SAW_FAILED_MAX_SPINS_REACHED = 40004
7
+ }
@@ -1,7 +1,4 @@
1
- export declare enum AskForUsername {
2
- NOASK = "no-ask",
3
- ONSUMBIT = "on-submit"
4
- }
1
+ import { SAWAskForUsername } from "./SAWAskForUsername";
5
2
  export interface SAWTemplateUI {
6
3
  skin: string;
7
4
  name: string;
@@ -25,7 +22,7 @@ export interface SAWTemplateUI {
25
22
  jackpot_symbol?: string;
26
23
  promo_image?: string;
27
24
  promo_text?: string;
28
- ask_for_username?: AskForUsername;
25
+ ask_for_username?: SAWAskForUsername;
29
26
  show_prize_board?: boolean;
30
27
  max_spins_period_ms?: number;
31
28
  }
@@ -0,0 +1,5 @@
1
+ import { SAWTemplate } from "./SAWTemplate";
2
+ declare class SAWUtils {
3
+ static canPlay: (t: SAWTemplate, pointsBalance: number) => boolean;
4
+ }
5
+ export { SAWUtils };
@@ -1,14 +1,17 @@
1
+ import { SAWUtils } from "./SAWUtils";
1
2
  import { SAWAcknowledgeType } from "./SAWAcknowledgeType";
3
+ import { SAWAskForUsername } from "./SAWAskForUsername";
2
4
  import { SAWBuyInType, SAWBuyInTypeName } from "./SAWBuyInType";
3
5
  import { SAWDoSpinRequest } from "./SAWDoSpinRequest";
4
- import { SAWDoSpinResponse, SAWSpinErrorCode } from "./SAWDoSpinResponse";
6
+ import { SAWDoSpinResponse } from "./SAWDoSpinResponse";
5
7
  import { SAWGameType, SAWGameTypeName } from "./SAWGameType";
6
8
  import { SAWGetTemplatesRequest } from "./SAWGetTemplatesRequest";
7
9
  import { SAWGetTemplatesResponse } from "./SAWGetTemplatesResponse";
8
10
  import { SAWPrize } from "./SAWPrize";
9
11
  import { SAWPrizeType } from "./SAWPrizeType";
10
12
  import { SAWPrizeUI } from "./SAWPrizeUI";
13
+ import { SAWSpinErrorCode } from "./SAWSpinErrorCode";
11
14
  import { SAWTemplate } from "./SAWTemplate";
12
15
  import { SAWTemplateUI } from "./SAWTemplateUI";
13
16
  import { SAWWinSoundType, SAWWinSoundFiles } from "./SAWWinSoundType";
14
- export { SAWAcknowledgeType, SAWBuyInType, SAWBuyInTypeName, SAWDoSpinRequest, SAWDoSpinResponse, SAWSpinErrorCode, SAWGameType, SAWGameTypeName, SAWGetTemplatesRequest, SAWGetTemplatesResponse, SAWPrize, SAWPrizeType, SAWPrizeUI, SAWTemplate, SAWTemplateUI, SAWWinSoundType, SAWWinSoundFiles };
17
+ export { SAWUtils, SAWAcknowledgeType, SAWBuyInType, SAWBuyInTypeName, SAWDoSpinRequest, SAWDoSpinResponse, SAWGameType, SAWGameTypeName, SAWGetTemplatesRequest, SAWGetTemplatesResponse, SAWPrize, SAWPrizeType, SAWPrizeUI, SAWTemplate, SAWTemplateUI, SAWWinSoundType, SAWWinSoundFiles, SAWAskForUsername, SAWSpinErrorCode };
@@ -0,0 +1,9 @@
1
+ declare class NodeCache {
2
+ private static ttlChecker;
3
+ private static cache;
4
+ constructor();
5
+ get(key: string): any;
6
+ set(key: string, value: any, ttlSeconds?: number): void;
7
+ flushAll(): void;
8
+ }
9
+ export { NodeCache };
@@ -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
+ }
@@ -2,6 +2,10 @@ import { ClassId } from "./Base/ClassId";
2
2
  import { SAWGetTemplatesResponse } from './MiniGames/SAWGetTemplatesResponse';
3
3
  import { SAWTemplate } from './MiniGames/SAWTemplate';
4
4
  import { ILogger } from './ILogger';
5
+ import { SAWDoSpinResponse } from './MiniGames';
6
+ import { GetTranslationsResponse, ResponseIdentify, TranslationArea } from './Core';
7
+ import { GetLabelInfoResponse } from './Core/GetLabelInfoResponse';
8
+ import { GetInboxMessagesResponse } from './Inbox';
5
9
  interface IOptions {
6
10
  logger?: ILogger;
7
11
  logCIDs?: ClassId[];
@@ -11,13 +15,23 @@ declare class SmarticoAPI {
11
15
  private label_api_key;
12
16
  private brand_api_key;
13
17
  private publicUrl;
18
+ private avatarDomain;
14
19
  private logger;
15
20
  private logCIDs;
16
21
  private logHTTPTiming;
17
22
  constructor(label_api_key: string, brand_api_key: string, options?: IOptions);
18
23
  private send;
19
24
  private buildMessage;
20
- miniGamesGetTemplates(user_ext_id: string): Promise<SAWGetTemplatesResponse>;
21
- miniGamesFormatTemplatesForWidget(templates: SAWTemplate[], pointsBalance: number): any[];
25
+ coreReportCustomEvent(user_ext_id: string, eventType: string, payload?: any): Promise<any>;
26
+ coreGetTranslations(user_ext_id: string, lang_code: string, areas: TranslationArea[], cacheSec?: number): Promise<GetTranslationsResponse>;
27
+ coreIdentifyLabel(user_ext_id: string, cacheSec?: number): Promise<GetLabelInfoResponse>;
28
+ coreIdentifyUser(user_ext_id: string): Promise<ResponseIdentify>;
29
+ coreChangeUsername(user_ext_id: string, public_username_custom: string): Promise<{
30
+ public_username_custom: string;
31
+ }>;
32
+ sawGetTemplates(user_ext_id: string): Promise<SAWGetTemplatesResponse>;
33
+ sawFormatTemplatesForWidget(templates: SAWTemplate[], pointsBalance: number): Promise<any[]>;
34
+ sawSpinRequest(user_ext_id: string, saw_template_id: number, round_id: number): Promise<SAWDoSpinResponse>;
35
+ inboxGetMessages(user_ext_id: string, limit?: number, offset?: number): Promise<GetInboxMessagesResponse>;
22
36
  }
23
37
  export { SmarticoAPI };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  import { ClassId } from './Base/ClassId';
2
2
  import { ILogger } from './ILogger';
3
3
  import { SmarticoAPI } from './SmarticoAPI';
4
+ export * from './Core';
4
5
  export * from './MiniGames';
6
+ export * from './Inbox';
5
7
  export { SmarticoAPI, ClassId, ILogger };