@smartico/public-api 0.0.401 → 0.0.402

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.
@@ -140,7 +140,7 @@ for (const v of variants) {
140
140
 
141
141
  // Newest-first within each base.
142
142
  for (const list of byBase.values()) {
143
- list.sort((a, b) => b.dt_created.localeCompare(a.dt_created));
143
+ list.sort((a, b) => b.dt_created - a.dt_created);
144
144
  }
145
145
 
146
146
  console.log('[smartico] AI variants by base avatar — render as a carousel under each base');
@@ -20,6 +20,6 @@ CDN URL of the AI-customized avatar image
20
20
 
21
21
  ### dt\_created
22
22
 
23
- > **dt\_created**: `string`
23
+ > **dt\_created**: `number`
24
24
 
25
- ISO date string when the customization was created
25
+ Unix-ms timestamp when the customization was created.
@@ -14,17 +14,17 @@ Unique identifier of the event
14
14
 
15
15
  ### event\_resolution\_date
16
16
 
17
- > **event\_resolution\_date**: `number`
17
+ > **event\_resolution\_date**: `string`
18
18
 
19
- Timestamp (ms) when the event was resolved, null if not yet resolved
19
+ ISO 8601 date-time string when the event was resolved; null until resolved.
20
20
 
21
21
  ***
22
22
 
23
23
  ### match\_date
24
24
 
25
- > **match\_date**: `number`
25
+ > **match\_date**: `string`
26
26
 
27
- Timestamp (ms) of the match/event start time
27
+ ISO 8601 date-time string of the match/event start time.
28
28
 
29
29
  ***
30
30
 
@@ -70,9 +70,9 @@ User's total score
70
70
 
71
71
  ### last\_wallet\_sync\_time?
72
72
 
73
- > `optional` **last\_wallet\_sync\_time?**: `Date`
73
+ > `optional` **last\_wallet\_sync\_time?**: `string`
74
74
 
75
- Last time the user's balance was synced from the Smartico platform
75
+ ISO 8601 date-time string of the last time the user's balance was synced from the Smartico platform.
76
76
 
77
77
  ***
78
78
 
@@ -6,6 +6,8 @@
6
6
 
7
7
  > **create\_date**: `number`
8
8
 
9
+ Epoch timestamp in SECONDS (not ms — unlike most SDK timestamps).
10
+
9
11
  ***
10
12
 
11
13
  ### user\_ext\_id
@@ -6,6 +6,8 @@
6
6
 
7
7
  > **create\_date**: `number`
8
8
 
9
+ Epoch timestamp in SECONDS (not ms — unlike most SDK timestamps).
10
+
9
11
  ***
10
12
 
11
13
  ### user\_ext\_id
@@ -22,6 +22,6 @@ Absolute CDN URL of the AI-generated image. Can be passed as `avatar_url` to `se
22
22
 
23
23
  ### dt\_created
24
24
 
25
- > **dt\_created**: `string`
25
+ > **dt\_created**: `number`
26
26
 
27
- ISO date string of when the variant was generated.
27
+ Unix-ms timestamp of when the variant was generated.
@@ -20,7 +20,8 @@ and the mark / favorite / delete mutations.
20
20
 
21
21
  > **sent\_date**: `string`
22
22
 
23
- Date when the message was sent (server timestamp).
23
+ Date-time the message was sent, as a `"dd/MM/yyyy HH:mm:ss"` string
24
+ (server local — NOT ISO-8601, so `new Date(sent_date)` will not parse it).
24
25
 
25
26
  ***
26
27
 
@@ -261,7 +261,9 @@ The date/timestamp indicating when the prize was claimed by the user
261
261
 
262
262
  > `optional` **complete\_date?**: `string`
263
263
 
264
- Time in hours that took this player to complete mission
264
+ Date-time the mission/badge was completed, as a `"dd/MM/yyyy HH:mm:ss"` string
265
+ (server local — NOT ISO-8601, so `new Date(complete_date)` will not parse it).
266
+ Prefer the epoch-ms `complete_date_ts` for date math.
265
267
 
266
268
  ***
267
269
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartico/public-api",
3
- "version": "0.0.401",
3
+ "version": "0.0.402",
4
4
  "description": "Smartico public API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -2,6 +2,7 @@ import { PointChangeSourceType } from './PointChangeSourceType';
2
2
  import { UserBalanceType } from './UserBalanceType';
3
3
 
4
4
  export interface PointsLog {
5
+ /** Epoch timestamp in SECONDS (not ms — unlike most SDK timestamps). */
5
6
  create_date: number;
6
7
  user_ext_id: string;
7
8
  crm_brand_id: number;
@@ -12,6 +13,7 @@ export interface PointsLog {
12
13
  }
13
14
 
14
15
  export interface GemsDiamondsLog {
16
+ /** Epoch timestamp in SECONDS (not ms — unlike most SDK timestamps). */
15
17
  create_date: number;
16
18
  user_ext_id: string;
17
19
  crm_brand_id: number;
@@ -3,6 +3,6 @@ export interface AvatarCustomized {
3
3
  avatar_real_id: number;
4
4
  /** CDN URL of the AI-customized avatar image */
5
5
  url: string;
6
- /** ISO date string when the customization was created */
7
- dt_created: string;
6
+ /** Unix-ms timestamp when the customization was created. */
7
+ dt_created: number;
8
8
  }
@@ -211,10 +211,10 @@ export interface GamePickEventMeta extends QuizEventMeta {
211
211
  export interface GamePickEvent {
212
212
  /** Unique identifier of the event */
213
213
  gp_event_id: number;
214
- /** Timestamp (ms) when the event was resolved, null if not yet resolved */
215
- event_resolution_date: number;
216
- /** Timestamp (ms) of the match/event start time */
217
- match_date: number;
214
+ /** ISO 8601 date-time string when the event was resolved; null until resolved. */
215
+ event_resolution_date: string;
216
+ /** ISO 8601 date-time string of the match/event start time. */
217
+ match_date: string;
218
218
  /** Market type defining the prediction format (e.g. two-team score, quiz question, custom) */
219
219
  market_type_id: SAWGPMarketType;
220
220
  /** Event metadata containing team names, images, sport type, and question details */
@@ -412,8 +412,8 @@ export interface GamePickUserInfo {
412
412
  part_wins_count?: number;
413
413
  /** User's total score */
414
414
  resolution_score?: number;
415
- /** Last time the user's balance was synced from the Smartico platform */
416
- last_wallet_sync_time?: Date;
415
+ /** ISO 8601 date-time string of the last time the user's balance was synced from the Smartico platform. */
416
+ last_wallet_sync_time?: string;
417
417
  /** User's current points balance */
418
418
  ach_points_balance?: number;
419
419
  /** User's current gems balance */
@@ -23,9 +23,9 @@ export interface UserAchievement {
23
23
  start_date_ts?: number;
24
24
  time_limit_ms?: number;
25
25
  progress?: number;
26
- complete_date?: string;
26
+ complete_date?: string; // "dd/MM/yyyy HH:mm:ss" string (not ISO-8601); use complete_date_ts for epoch-ms
27
27
  complete_date_ts?: number;
28
- unlock_date?: string;
28
+ unlock_date?: string; // "dd/MM/yyyy HH:mm:ss" string (not ISO-8601)
29
29
  milliseconds_till_available?: number;
30
30
  completed_tasks?: number;
31
31
  achievementTasks?: UserAchievementTask[];
@@ -37,7 +37,7 @@ export const StoreItemTransform = (items: StoreItem[]): TStoreItem[] => {
37
37
  id: r.id,
38
38
  name: r.itemPublicMeta.name,
39
39
  purchase_type: mapPurchaseType(r.itemPublicMeta.purchase_type),
40
- price: r.itemPublicMeta.price as any as number, // AA: strange why it's string
40
+ price: Number(r.itemPublicMeta.price), // wire delivers price as a string; coerce to the number the type promises
41
41
  image: r.itemPublicMeta.image_url,
42
42
  description: r.itemPublicMeta.description,
43
43
  ribbon: r.itemPublicMeta.label_tag === 'custom' ? r.itemPublicMeta.custom_label_tag : r.itemPublicMeta.label_tag,
@@ -142,7 +142,7 @@ export class WSAPIAvatars extends WSAPIMiniGames {
142
142
  *
143
143
  * // Newest-first within each base.
144
144
  * for (const list of byBase.values()) {
145
- * list.sort((a, b) => b.dt_created.localeCompare(a.dt_created));
145
+ * list.sort((a, b) => b.dt_created - a.dt_created);
146
146
  * }
147
147
  *
148
148
  * console.log('[smartico] AI variants by base avatar — render as a carousel under each base');
@@ -869,7 +869,9 @@ export interface TMissionOrBadge {
869
869
  /** The date/timestamp indicating when the prize was claimed by the user */
870
870
  prize_claimed_date_ts?: number;
871
871
 
872
- /** Time in hours that took this player to complete mission */
872
+ /** Date-time the mission/badge was completed, as a `"dd/MM/yyyy HH:mm:ss"` string
873
+ * (server local — NOT ISO-8601, so `new Date(complete_date)` will not parse it).
874
+ * Prefer the epoch-ms `complete_date_ts` for date math. */
873
875
  complete_date?: string;
874
876
 
875
877
  /** Time of mission/badge being completed, this property shows the epoch time in UTC */
@@ -1032,7 +1034,8 @@ export interface TInboxMessage {
1032
1034
  /** Unique identifier of the message. Pass to `getInboxMessageBody`
1033
1035
  * and the mark / favorite / delete mutations. */
1034
1036
  message_guid: string;
1035
- /** Date when the message was sent (server timestamp). */
1037
+ /** Date-time the message was sent, as a `"dd/MM/yyyy HH:mm:ss"` string
1038
+ * (server local — NOT ISO-8601, so `new Date(sent_date)` will not parse it). */
1036
1039
  sent_date: string;
1037
1040
  /** `true` when the message has been marked read. */
1038
1041
  read: boolean;
@@ -1792,8 +1795,8 @@ export interface TAvatarCustomized {
1792
1795
  avatar_real_id: number;
1793
1796
  /** Absolute CDN URL of the AI-generated image. Can be passed as `avatar_url` to `setAvatar()`. */
1794
1797
  url: string;
1795
- /** ISO date string of when the variant was generated. */
1796
- dt_created: string;
1798
+ /** Unix-ms timestamp of when the variant was generated. */
1799
+ dt_created: number;
1797
1800
  }
1798
1801
 
1799
1802
  /**
package/src/index.ts CHANGED
@@ -5,6 +5,26 @@ export * from './WSAPI/WSAPI';
5
5
  export * from './SmarticoGlobal';
6
6
  export * from './CookieStore';
7
7
 
8
+ // Consumer-facing transformed ("T") types. They are defined in WSAPI/WSAPITypes.ts
9
+ // and returned by the WSAPI methods, but that file is not a barrel export, so the
10
+ // names never reached the package root — integrators could not `import { TX }`.
11
+ // Re-export them by name here. (Names that collide with a domain-module export —
12
+ // AchRelatedGame, BonusStatus, BonusMetaMap, BonusTemplateMetaMap — are intentionally
13
+ // omitted; import those from their domain module.)
14
+ export type {
15
+ TAchCategory, TActivityLog, TAvatarCustomized, TAvatarDefinition, TAvatarPrompt,
16
+ TBonus, TBuyStoreItemResult, TClaimBonusResult, TClan, TClanInfo, TClanJoinResult,
17
+ TClanTournamentPlayers, TClans, TGetTranslations, TInboxMessage, TInboxMessageBody,
18
+ TLevel, TLevelCurrent, TMiniGamePlayBatchResult, TMiniGamePlayResult, TMiniGamePrize,
19
+ TMiniGameTemplate, TMissionClaimRewardResult, TMissionOptInResult, TMissionOrBadge,
20
+ TMissionOrBadgeTask, TRaffle, TRaffleDraw, TRaffleDrawRun, TRaffleOptinResponse,
21
+ TRafflePrize, TRafflePrizeWinner, TRaffleTicket, TSawHistory, TSegmentCheckResult,
22
+ TSetAvatarResult, TStoreCategory, TStoreItem, TTournament, TTournamentDetailed,
23
+ TTournamentRegistrationResult, TUICustomSection, TUserProfile,
24
+ TransformedRaffleClaimPrizeResponse, InboxMarkMessageAction, LeaderBoardDetailsT,
25
+ LeaderBoardUserT, LeaderBoardsRewardsT, UserLevelExtraCountersT,
26
+ } from './WSAPI/WSAPITypes';
27
+
8
28
  export * from './Analytics';
9
29
  export * from './Core';
10
30
  export * from './UserProfile';