@smartico/public-api 0.0.53 → 0.0.55
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/PublicLabelSettings.d.ts +0 -1
- package/dist/SmarticoAPI.d.ts +2 -1
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +7 -5
- package/dist/index.modern.mjs.map +1 -1
- package/package.json +1 -1
- package/src/Core/PublicLabelSettings.ts +0 -2
- package/src/SmarticoAPI.ts +10 -4
|
@@ -22,7 +22,6 @@ export declare enum PublicLabelSettings {
|
|
|
22
22
|
GAMIFICATION_LEVELS_LOGIC2 = "GAMIFICATION_LEVELS_LOGIC2",
|
|
23
23
|
AVATAR_CUSTOM_IMAGE_MAX_ID = "AVATAR_CUSTOM_IMAGE_MAX_ID",
|
|
24
24
|
AVATAR_CUSTOM_IMAGE_FOLDER = "AVATAR_CUSTOM_IMAGE_FOLDER",
|
|
25
|
-
RETENTION_GAMES_CUSTOMER_ID = "RETENTION_GAMES_CUSTOMER_ID",
|
|
26
25
|
GAMIFICATION_SHOW_POWERED_BY = "GAMIFICATION_SHOW_POWERED_BY",
|
|
27
26
|
_system_leader_board_mask_username = "_system_leader_board_mask_username",
|
|
28
27
|
INBOX_PUBLIC_CDN = "INBOX_PUBLIC_CDN"
|
package/dist/SmarticoAPI.d.ts
CHANGED
|
@@ -36,7 +36,8 @@ declare class SmarticoAPI {
|
|
|
36
36
|
private logHTTPTiming;
|
|
37
37
|
tracker?: Tracker;
|
|
38
38
|
constructor(label_api_key: string, brand_api_key: string, messageSender: MessageSender, options?: IOptions);
|
|
39
|
-
static
|
|
39
|
+
static getEnvDnsSuffix(label_api_key: string): string;
|
|
40
|
+
static getEnvId(label_api_key: string): number;
|
|
40
41
|
static getCleanLabelApiKey(label_api_key: string): string;
|
|
41
42
|
static getPublicUrl(label_api_key: string): string;
|
|
42
43
|
static getPublicWsUrl(label_api_key: string): string;
|
package/dist/index.js
CHANGED
|
@@ -401,7 +401,6 @@ exports.PublicLabelSettings = void 0;
|
|
|
401
401
|
PublicLabelSettings["GAMIFICATION_LEVELS_LOGIC2"] = "GAMIFICATION_LEVELS_LOGIC2";
|
|
402
402
|
PublicLabelSettings["AVATAR_CUSTOM_IMAGE_MAX_ID"] = "AVATAR_CUSTOM_IMAGE_MAX_ID";
|
|
403
403
|
PublicLabelSettings["AVATAR_CUSTOM_IMAGE_FOLDER"] = "AVATAR_CUSTOM_IMAGE_FOLDER";
|
|
404
|
-
PublicLabelSettings["RETENTION_GAMES_CUSTOMER_ID"] = "RETENTION_GAMES_CUSTOMER_ID";
|
|
405
404
|
PublicLabelSettings["GAMIFICATION_SHOW_POWERED_BY"] = "GAMIFICATION_SHOW_POWERED_BY";
|
|
406
405
|
PublicLabelSettings["_system_leader_board_mask_username"] = "_system_leader_board_mask_username";
|
|
407
406
|
PublicLabelSettings["INBOX_PUBLIC_CDN"] = "INBOX_PUBLIC_CDN";
|
|
@@ -827,24 +826,27 @@ var SmarticoAPI = /*#__PURE__*/function () {
|
|
|
827
826
|
this.avatarDomain = SmarticoAPI.getAvatarUrl(label_api_key || ((_options$tracker = options.tracker) == null ? void 0 : _options$tracker.label_api_key));
|
|
828
827
|
this.label_api_key = SmarticoAPI.getCleanLabelApiKey(label_api_key);
|
|
829
828
|
}
|
|
830
|
-
SmarticoAPI.
|
|
829
|
+
SmarticoAPI.getEnvDnsSuffix = function getEnvDnsSuffix(label_api_key) {
|
|
831
830
|
var ENV_ID = label_api_key.length === 38 ? label_api_key.substring(37, 38) : '';
|
|
832
831
|
if (ENV_ID === '1' || ENV_ID === '2') {
|
|
833
832
|
ENV_ID = '';
|
|
834
833
|
}
|
|
835
834
|
return ENV_ID;
|
|
836
835
|
};
|
|
836
|
+
SmarticoAPI.getEnvId = function getEnvId(label_api_key) {
|
|
837
|
+
return label_api_key.length === 38 ? parseInt(label_api_key.substring(37, 38), 10) : 2;
|
|
838
|
+
};
|
|
837
839
|
SmarticoAPI.getCleanLabelApiKey = function getCleanLabelApiKey(label_api_key) {
|
|
838
840
|
return label_api_key.substring(0, 36);
|
|
839
841
|
};
|
|
840
842
|
SmarticoAPI.getPublicUrl = function getPublicUrl(label_api_key) {
|
|
841
|
-
return PUBLIC_API_URL.replace('{ENV_ID}', SmarticoAPI.
|
|
843
|
+
return PUBLIC_API_URL.replace('{ENV_ID}', SmarticoAPI.getEnvDnsSuffix(label_api_key));
|
|
842
844
|
};
|
|
843
845
|
SmarticoAPI.getPublicWsUrl = function getPublicWsUrl(label_api_key) {
|
|
844
|
-
return C_SOCKET_PROD.replace('{ENV_ID}', SmarticoAPI.
|
|
846
|
+
return C_SOCKET_PROD.replace('{ENV_ID}', SmarticoAPI.getEnvDnsSuffix(label_api_key));
|
|
845
847
|
};
|
|
846
848
|
SmarticoAPI.getAvatarUrl = function getAvatarUrl(label_api_key) {
|
|
847
|
-
return AVATAR_DOMAIN.replace('{ENV_ID}', SmarticoAPI.
|
|
849
|
+
return AVATAR_DOMAIN.replace('{ENV_ID}', SmarticoAPI.getEnvDnsSuffix(label_api_key));
|
|
848
850
|
};
|
|
849
851
|
var _proto = SmarticoAPI.prototype;
|
|
850
852
|
_proto.send = function send(message, expectCID) {
|