@smartico/public-api 0.0.133 → 0.0.135

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.
@@ -1,4 +1,5 @@
1
1
  declare class CoreUtils {
2
2
  static avatarUrl: (avatar_id: string, avatarDomain: string) => string;
3
+ static currencySymbol(currency: string): string;
3
4
  }
4
5
  export { CoreUtils };
@@ -423,6 +423,10 @@ export interface TMissionOrBadge {
423
423
  requires_prize_claim?: boolean;
424
424
  /** The date/timestamp indicating when the prize was claimed by the user */
425
425
  prize_claimed_date_ts?: number;
426
+ /** Time in hours that took this player to complete mission */
427
+ complete_date?: string;
428
+ /** Time of mission/badge being completed, this property shows the epoch time in UTC */
429
+ complete_date_ts?: number;
426
430
  /** Flag for mission/badge indicating that mission/badge completed today */
427
431
  completed_today?: boolean;
428
432
  /** Flag for mission/badge indicating that mission/badge completed this week */
package/dist/index.js CHANGED
@@ -186,7 +186,7 @@ IntUtils.JsonOrText = function (str) {
186
186
  };
187
187
  IntUtils.isWithinPeriod = function (timestamp, period) {
188
188
  var now = new Date();
189
- var completedDate = new Date(timestamp * 1000);
189
+ var completedDate = new Date(timestamp);
190
190
  switch (period) {
191
191
  case 'today':
192
192
  return now.getFullYear() === completedDate.getFullYear() && now.getMonth() === completedDate.getMonth() && now.getDate() === completedDate.getDate();
@@ -537,7 +537,14 @@ exports.ActivityTypeLimited = void 0;
537
537
  ActivityTypeLimited[ActivityTypeLimited["UnTagCustomer"] = 505] = "UnTagCustomer";
538
538
  })(exports.ActivityTypeLimited || (exports.ActivityTypeLimited = {}));
539
539
 
540
- var CoreUtils = function CoreUtils() {};
540
+ var CoreUtils = /*#__PURE__*/function () {
541
+ function CoreUtils() {}
542
+ CoreUtils.currencySymbol = function currencySymbol(currency) {
543
+ var _currency$toUpperCase;
544
+ return (_currency$toUpperCase = {}, _currency$toUpperCase[currency.toUpperCase()] = currency.toUpperCase(), _currency$toUpperCase.USD = "$", _currency$toUpperCase.EUR = "€", _currency$toUpperCase.JPY = "¥", _currency$toUpperCase.GBP = "£", _currency$toUpperCase.AUD = "A$", _currency$toUpperCase.CAD = "C$", _currency$toUpperCase.CHF = "CHF", _currency$toUpperCase.CNY = "¥", _currency$toUpperCase.SEK = "kr", _currency$toUpperCase.NZD = "NZ$", _currency$toUpperCase.MXN = "MX$", _currency$toUpperCase.SGD = "S$", _currency$toUpperCase.HKD = "HK$", _currency$toUpperCase.NOK = "kr", _currency$toUpperCase.KRW = "₩", _currency$toUpperCase.TRY = "₺", _currency$toUpperCase.INR = "₹", _currency$toUpperCase.RUB = "₽", _currency$toUpperCase.BRL = "R$", _currency$toUpperCase.ZAR = "R", _currency$toUpperCase)[currency.toUpperCase()];
545
+ };
546
+ return CoreUtils;
547
+ }();
541
548
  CoreUtils.avatarUrl = function (avatar_id, avatarDomain) {
542
549
  if (avatarDomain && avatar_id !== null && avatar_id !== undefined && !(avatar_id.startsWith && avatar_id.startsWith('http'))) {
543
550
  if (avatarDomain.endsWith('/')) {
@@ -808,6 +815,8 @@ var UserAchievementTransform = function UserAchievementTransform(items) {
808
815
  ach_completed_id: r.ach_completed_id,
809
816
  requires_prize_claim: r.requires_prize_claim,
810
817
  prize_claimed_date_ts: r.prize_claimed_date_ts,
818
+ complete_date: r.complete_date,
819
+ complete_date_ts: r.complete_date_ts,
811
820
  completed_today: completedToday,
812
821
  completed_this_week: completedThisWeek,
813
822
  completed_this_month: completedThisMonth