@smartico/public-api 0.0.220 → 0.0.221

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/dist/SmarticoAPI.d.ts +1 -0
  2. package/dist/WSAPI/WSAPI.d.ts +1 -1
  3. package/dist/index.js +23 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.modern.mjs +21 -0
  6. package/dist/index.modern.mjs.map +1 -1
  7. package/package.json +1 -1
  8. package/src/SmarticoAPI.ts +28 -0
  9. package/src/WSAPI/WSAPI.ts +1 -1
  10. package/dist/Quiz/MarketsAnswersType.d.ts +0 -22
  11. package/dist/Raffle/GetDrawResponse.d.ts +0 -5
  12. package/dist/SmarticoPublicAPI.d.ts +0 -23
  13. package/dist/Store/BuyShopItemErrorCode.d.ts +0 -10
  14. package/dist/Store/BuyShopItemRequest.d.ts +0 -4
  15. package/dist/Store/BuyShopItemResponse.d.ts +0 -4
  16. package/dist/Store/GetCategoriesShopResponse.d.ts +0 -5
  17. package/dist/Store/GetShopItemsResponse.d.ts +0 -5
  18. package/dist/Store/ShopCategory.d.ts +0 -5
  19. package/dist/Store/ShopCategoryPublicMeta.d.ts +0 -4
  20. package/dist/Store/ShopItem.d.ts +0 -9
  21. package/dist/Store/ShopItemPublicMeta.d.ts +0 -10
  22. package/dist/Store/ShopItemType.d.ts +0 -4
  23. package/dist/Store/StorItemPruchased.d.ts +0 -6
  24. package/dist/service/index.d.ts +0 -5
  25. package/dist/service/types/ErrorCodes.d.ts +0 -13
  26. package/dist/service/types/GRequest.d.ts +0 -16
  27. package/dist/service/types/GResponse.d.ts +0 -10
  28. package/dist/service/types/Game/GameAttemptType.d.ts +0 -6
  29. package/dist/service/types/Game/GameCanPlayType.d.ts +0 -10
  30. package/dist/service/types/Game/GameExternalStatus.d.ts +0 -6
  31. package/dist/service/types/Game/GameInfo.d.ts +0 -9
  32. package/dist/service/types/Game/GamePick.d.ts +0 -90
  33. package/dist/service/types/Game/GameUtil.d.ts +0 -7
  34. package/dist/service/types/SmarticoProto/GetTranslationsRequest.d.ts +0 -7
  35. package/dist/service/types/SmarticoProto/GetTranslationsResponse.d.ts +0 -7
  36. package/dist/service/types/SmarticoProto/ProtocolMessage.d.ts +0 -5
  37. package/dist/service/types/SmarticoProto/ProtocolRequest.d.ts +0 -6
  38. package/dist/service/types/SmarticoProto/ProtocolResponse.d.ts +0 -5
  39. package/dist/service/types/SmarticoProto/PublicLabelInfo.d.ts +0 -34
  40. package/dist/service/types/SmarticoProto/PublicProperties.d.ts +0 -11
  41. package/dist/service/types/SmarticoProto/ResponseIdentify.d.ts +0 -12
  42. package/dist/service/types/SmarticoProto/SAW/SAWAcknowledgeType.d.ts +0 -5
  43. package/dist/service/types/SmarticoProto/SAW/SAWBuyInType.d.ts +0 -5
  44. package/dist/service/types/SmarticoProto/SAW/SAWDoSpinRequest.d.ts +0 -5
  45. package/dist/service/types/SmarticoProto/SAW/SAWDoSpinResponse.d.ts +0 -15
  46. package/dist/service/types/SmarticoProto/SAW/SAWGameType.d.ts +0 -10
  47. package/dist/service/types/SmarticoProto/SAW/SAWGetTemplatesRequest.d.ts +0 -3
  48. package/dist/service/types/SmarticoProto/SAW/SAWGetTemplatesResponse.d.ts +0 -5
  49. package/dist/service/types/SmarticoProto/SAW/SAWPrize.d.ts +0 -11
  50. package/dist/service/types/SmarticoProto/SAW/SAWPrizeType.d.ts +0 -8
  51. package/dist/service/types/SmarticoProto/SAW/SAWPrizeUI.d.ts +0 -13
  52. package/dist/service/types/SmarticoProto/SAW/SAWTemplate.d.ts +0 -21
  53. package/dist/service/types/SmarticoProto/SAW/SAWTemplateUI.d.ts +0 -31
  54. package/dist/service/types/SmarticoProto/SAW/SAWWinSoundType.d.ts +0 -12
  55. package/dist/service/types/SmarticoProto/TranslationArea.d.ts +0 -9
  56. package/dist/service/types/User/UserInfo.d.ts +0 -10
  57. package/dist/util/Util.d.ts +0 -51
@@ -49,6 +49,7 @@ declare class SmarticoAPI {
49
49
  tracker?: Tracker;
50
50
  constructor(label_api_key: string, brand_api_key: string, messageSender: MessageSender, options?: IOptions);
51
51
  static getEnvDnsSuffix(label_api_key: string): string;
52
+ private replaceDomains;
52
53
  static getEnvId(label_api_key: string): number;
53
54
  static getCleanLabelApiKey(label_api_key: string): string;
54
55
  static getPublicUrl(label_api_key: string): string;
@@ -2,7 +2,7 @@ import { SmarticoAPI } from '../SmarticoAPI';
2
2
  import { InboxMarkMessageAction, LeaderBoardDetailsT, TAchCategory, TBuyStoreItemResult, TGetTranslations, TInboxMessage, TInboxMessageBody, TLevel, TMiniGamePlayResult, TMiniGameTemplate, TMissionClaimRewardResult, TMissionOptInResult, TMissionOrBadge, TSegmentCheckResult, TStoreCategory, TStoreItem, TTournament, TTournamentDetailed, TTournamentRegistrationResult, TUICustomSection, TUserProfile, UserLevelExtraCountersT, TBonus, TClaimBonusResult, TMiniGamePlayBatchResult, TSawHistory } from './WSAPITypes';
3
3
  import { LeaderBoardPeriodType } from '../Leaderboard';
4
4
  import { JackpotDetails, JackpotsOptinResponse, JackpotsOptoutResponse } from '../Jackpots';
5
- import { GetRelatedAchTourResponse } from 'src/Missions/GetRelatedAchTourResponse';
5
+ import { GetRelatedAchTourResponse } from '../Missions/GetRelatedAchTourResponse';
6
6
  import { GetRafflesResponse } from '../Raffle/GetRafflesResponse';
7
7
  import { InboxCategories } from '../Inbox/InboxCategories';
8
8
  /** @group General API */
package/dist/index.js CHANGED
@@ -2919,6 +2919,26 @@ var SmarticoAPI = /*#__PURE__*/function () {
2919
2919
  }
2920
2920
  return ENV_ID;
2921
2921
  };
2922
+ var _proto = SmarticoAPI.prototype;
2923
+ _proto.replaceDomains = function replaceDomains(obj) {
2924
+ var domains = {
2925
+ 'static4.smr.vc': 'd146b4m7rkvjkw.cloudfront.net',
2926
+ 'img4.smr.vc': 'dvm0p9vsezqr2.cloudfront.net'
2927
+ };
2928
+ var newObject = obj;
2929
+ var oldDomains = Object.keys(domains);
2930
+ for (var _i = 0, _oldDomains = oldDomains; _i < _oldDomains.length; _i++) {
2931
+ var oldDomain = _oldDomains[_i];
2932
+ var stringified = JSON.stringify(newObject);
2933
+ try {
2934
+ var replacedString = stringified.replace(new RegExp(oldDomain, 'g'), domains[oldDomain]);
2935
+ newObject = JSON.parse(replacedString);
2936
+ } catch (error) {
2937
+ console.error(error);
2938
+ }
2939
+ }
2940
+ return newObject;
2941
+ };
2922
2942
  SmarticoAPI.getEnvId = function getEnvId(label_api_key) {
2923
2943
  return label_api_key.length === 38 ? parseInt(label_api_key.substring(37, 38), 10) : 2;
2924
2944
  };
@@ -2939,7 +2959,6 @@ var SmarticoAPI = /*#__PURE__*/function () {
2939
2959
  return AVATAR_DOMAIN.replace('{ENV_ID}', SmarticoAPI.getEnvDnsSuffix(label_api_key));
2940
2960
  }
2941
2961
  };
2942
- var _proto = SmarticoAPI.prototype;
2943
2962
  _proto.send = function send(message, expectCID, force_language) {
2944
2963
  try {
2945
2964
  var _temp2 = function _temp2(_result) {
@@ -2998,6 +3017,9 @@ var SmarticoAPI = /*#__PURE__*/function () {
2998
3017
  return Promise.resolve(_this.messageSender(message, _this.publicUrl, expectCID)).then(function (_this$messageSender) {
2999
3018
  result = _this$messageSender;
3000
3019
  var timeEnd = new Date().getTime();
3020
+ if (_this.label_api_key === 'a6e7ac26-c368-4892-9380-96e7ff82cf3e-4' && result) {
3021
+ result = _this.replaceDomains(result);
3022
+ }
3001
3023
  if (_this.logHTTPTiming) {
3002
3024
  _this.logger.always('HTTP time, ms:' + (timeEnd - timeStart));
3003
3025
  }