@smartico/public-api 0.0.419 → 0.0.420

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.
@@ -5,6 +5,6 @@ export interface GetActivityLogRequest extends ProtocolMessage {
5
5
  endTimeSeconds: number;
6
6
  limit: number;
7
7
  offset: number;
8
- /** Optional v2 filter — {@link ActivityLogActivities} values to include. */
9
8
  types?: number[];
9
+ src_types?: number[];
10
10
  }
@@ -15,6 +15,7 @@ export declare enum PointChangeSourceType {
15
15
  WinMiniGame = 17,
16
16
  API = 18,
17
17
  DynamicFormula = 19,
18
+ Jackpot = 20,
18
19
  Raffle = 21,
19
20
  Avatars = 22,
20
21
  Clan = 23
@@ -231,9 +231,9 @@ declare class SmarticoAPI {
231
231
  offset: number;
232
232
  limit: number;
233
233
  }): Promise<GetRaffleWonPrizesResponse>;
234
- getActivityLog(user_ext_id: string, startTimeSeconds: number, endTimeSeconds: number, limit: number, offset: number): Promise<GetActivityLogResponse>;
235
- getActivityLogV2(user_ext_id: string, startTimeSeconds: number, endTimeSeconds: number, limit: number, offset: number, types?: number[]): Promise<GetActivityLogResponse>;
236
- getActivityLogT(user_ext_id: string, startTimeSeconds: number, endTimeSeconds: number, from?: number, to?: number): Promise<TActivityLog[]>;
237
- getActivityLogV2T(user_ext_id: string, startTimeSeconds: number, endTimeSeconds: number, from?: number, to?: number, types?: number[]): Promise<TActivityLogEntry[]>;
234
+ getActivityLog(user_ext_id: string, startTimeSeconds: number, endTimeSeconds: number, limit: number, offset: number, types?: number[], src_types?: number[]): Promise<GetActivityLogResponse>;
235
+ getActivityLogV2(user_ext_id: string, startTimeSeconds: number, endTimeSeconds: number, limit: number, offset: number, types?: number[], src_types?: number[]): Promise<GetActivityLogResponse>;
236
+ getActivityLogT(user_ext_id: string, startTimeSeconds: number, endTimeSeconds: number, from?: number, to?: number, types?: number[], src_types?: number[]): Promise<TActivityLog[]>;
237
+ getActivityLogV2T(user_ext_id: string, startTimeSeconds: number, endTimeSeconds: number, from?: number, to?: number, types?: number[], src_types?: number[]): Promise<TActivityLogEntry[]>;
238
238
  }
239
239
  export { SmarticoAPI, MessageSender };
@@ -486,13 +486,18 @@ export declare class WSAPIUser extends WSAPIBase {
486
486
  * `from` by 50 between calls. Both `startTimeSeconds` and `endTimeSeconds`
487
487
  * are epoch seconds bounding the window the server scans.
488
488
  *
489
+ * **Filtering** — optional server-side filters (SMR-52608):
490
+ * - `types` — {@link ActivityLogActivities} / `type_id` values (e.g. Points=3, Gems=1)
491
+ * - `src_types` — {@link PointChangeSourceType} / `source_type_id` values
492
+ * Omit both for an unfiltered window.
493
+ *
489
494
  * **Subscription model (`onUpdate`)**
490
495
  * The callback fires when the user's `ach_points_balance`,
491
496
  * `ach_gems_balance`, or `ach_diamonds_balance` changes (i.e. whenever a
492
497
  * wallet event lands). The pushed payload is a FIXED re-fetch of the
493
498
  * **last 10 minutes / first 50 entries** — it does NOT honor the original
494
- * call's `startTimeSeconds` / `endTimeSeconds` / `from` / `to`. Consumers
495
- * maintaining a long historical view must re-call `getActivityLog` with
499
+ * call's `startTimeSeconds` / `endTimeSeconds` / `from` / `to` / filters.
500
+ * Consumers maintaining a long historical view must re-call `getActivityLog` with
496
501
  * their own params after receiving an `onUpdate` notification.
497
502
  *
498
503
  * **Refresh**
@@ -516,6 +521,8 @@ export declare class WSAPIUser extends WSAPIBase {
516
521
  * endTimeSeconds: now,
517
522
  * from: 0,
518
523
  * to: 50,
524
+ * types: [1], // Gems only (ActivityLogActivities.Gems)
525
+ * src_types: [11], // Tournament wins only (PointChangeSourceType.Tournament)
519
526
  * onUpdate: (refreshed) => {
520
527
  * console.log('[smartico] wallet changed — refreshed payload is last 10 min / 50 entries:', refreshed.length, 'rows');
521
528
  * // If the consumer is showing a full 30-day view, re-call getActivityLog with the original params here.
@@ -528,7 +535,7 @@ export declare class WSAPIUser extends WSAPIBase {
528
535
  * }
529
536
  * ```
530
537
  */
531
- getActivityLog({ startTimeSeconds, endTimeSeconds, from, to, onUpdate, }: {
538
+ getActivityLog({ startTimeSeconds, endTimeSeconds, from, to, types, src_types, onUpdate, }: {
532
539
  /** Window start in epoch seconds. */
533
540
  startTimeSeconds: number;
534
541
  /** Window end in epoch seconds. */
@@ -537,6 +544,10 @@ export declare class WSAPIUser extends WSAPIBase {
537
544
  from: number;
538
545
  /** Pagination ceiling (exclusive); server caps `to - from` at 50. */
539
546
  to: number;
547
+ /** Optional — filter by {@link ActivityLogActivities} / `type_id`. */
548
+ types?: number[];
549
+ /** Optional — filter by {@link PointChangeSourceType} / `source_type_id`. */
550
+ src_types?: number[];
540
551
  /** Optional push callback; payload is a fixed 10-min / 50-entry refresh on every wallet change (see Subscription model). */
541
552
  onUpdate?: (data: TActivityLog[]) => void;
542
553
  }): Promise<TActivityLog[]>;
@@ -555,16 +566,19 @@ export declare class WSAPIUser extends WSAPIBase {
555
566
  * **Pagination** — same `from` / `to` offset model as {@link getActivityLog}
556
567
  * (server caps a single response at 50 entries).
557
568
  *
558
- * **Filtering** — pass `types` with {@link ActivityLogActivities} values to
559
- * request a server-side subset (e.g. missions only). Omit for all activity types.
569
+ * **Filtering** — optional server-side filters:
570
+ * - `types` — {@link ActivityLogActivities} values (`type_id`)
571
+ * - `src_types` — {@link PointChangeSourceType} values (`source_type_id`)
572
+ * Omit both for all activity types / sources.
560
573
  *
561
574
  * @returns Array of {@link TActivityLogEntry} ordered newest-first.
562
575
  */
563
- getActivityLogV2({ startTimeSeconds, endTimeSeconds, from, to, types, }: {
576
+ getActivityLogV2({ startTimeSeconds, endTimeSeconds, from, to, types, src_types, }: {
564
577
  startTimeSeconds: number;
565
578
  endTimeSeconds: number;
566
579
  from: number;
567
580
  to: number;
568
581
  types?: number[];
582
+ src_types?: number[];
569
583
  }): Promise<TActivityLogEntry[]>;
570
584
  }
package/dist/index.js CHANGED
@@ -3055,13 +3055,18 @@ var WSAPIUser = /*#__PURE__*/function (_WSAPIBase) {
3055
3055
  * `from` by 50 between calls. Both `startTimeSeconds` and `endTimeSeconds`
3056
3056
  * are epoch seconds bounding the window the server scans.
3057
3057
  *
3058
+ * **Filtering** — optional server-side filters (SMR-52608):
3059
+ * - `types` — {@link ActivityLogActivities} / `type_id` values (e.g. Points=3, Gems=1)
3060
+ * - `src_types` — {@link PointChangeSourceType} / `source_type_id` values
3061
+ * Omit both for an unfiltered window.
3062
+ *
3058
3063
  * **Subscription model (`onUpdate`)**
3059
3064
  * The callback fires when the user's `ach_points_balance`,
3060
3065
  * `ach_gems_balance`, or `ach_diamonds_balance` changes (i.e. whenever a
3061
3066
  * wallet event lands). The pushed payload is a FIXED re-fetch of the
3062
3067
  * **last 10 minutes / first 50 entries** — it does NOT honor the original
3063
- * call's `startTimeSeconds` / `endTimeSeconds` / `from` / `to`. Consumers
3064
- * maintaining a long historical view must re-call `getActivityLog` with
3068
+ * call's `startTimeSeconds` / `endTimeSeconds` / `from` / `to` / filters.
3069
+ * Consumers maintaining a long historical view must re-call `getActivityLog` with
3065
3070
  * their own params after receiving an `onUpdate` notification.
3066
3071
  *
3067
3072
  * **Refresh**
@@ -3085,6 +3090,8 @@ var WSAPIUser = /*#__PURE__*/function (_WSAPIBase) {
3085
3090
  * endTimeSeconds: now,
3086
3091
  * from: 0,
3087
3092
  * to: 50,
3093
+ * types: [1], // Gems only (ActivityLogActivities.Gems)
3094
+ * src_types: [11], // Tournament wins only (PointChangeSourceType.Tournament)
3088
3095
  * onUpdate: (refreshed) => {
3089
3096
  * console.log('[smartico] wallet changed — refreshed payload is last 10 min / 50 entries:', refreshed.length, 'rows');
3090
3097
  * // If the consumer is showing a full 30-day view, re-call getActivityLog with the original params here.
@@ -3103,10 +3110,13 @@ var WSAPIUser = /*#__PURE__*/function (_WSAPIBase) {
3103
3110
  endTimeSeconds = _ref.endTimeSeconds,
3104
3111
  from = _ref.from,
3105
3112
  to = _ref.to,
3113
+ types = _ref.types,
3114
+ src_types = _ref.src_types,
3106
3115
  onUpdate = _ref.onUpdate;
3107
3116
  try {
3117
+ var _types$join, _src_types$join;
3108
3118
  var _this7 = this;
3109
- var cacheKey = onUpdateContextKey.ActivityLog + ":" + startTimeSeconds + ":" + endTimeSeconds + ":" + from + ":" + to;
3119
+ var cacheKey = onUpdateContextKey.ActivityLog + ":" + startTimeSeconds + ":" + endTimeSeconds + ":" + from + ":" + to + ":" + ((_types$join = types == null ? void 0 : types.join(',')) != null ? _types$join : '') + ":" + ((_src_types$join = src_types == null ? void 0 : src_types.join(',')) != null ? _src_types$join : '');
3110
3120
  if (typeof onUpdate === 'function') {
3111
3121
  _this7.onUpdateCallback.set(onUpdateContextKey.ActivityLog, onUpdate);
3112
3122
  // Remember the requested window so a push refresh re-fetches THIS window
@@ -3115,11 +3125,13 @@ var WSAPIUser = /*#__PURE__*/function (_WSAPIBase) {
3115
3125
  startTimeSeconds: startTimeSeconds,
3116
3126
  endTimeSeconds: endTimeSeconds,
3117
3127
  from: from,
3118
- to: to
3128
+ to: to,
3129
+ types: types,
3130
+ src_types: src_types
3119
3131
  };
3120
3132
  }
3121
3133
  return Promise.resolve(OCache.use(cacheKey, exports.ECacheContext.WSAPI, function () {
3122
- return _this7.api.getActivityLogT(_this7.userExtId, startTimeSeconds, endTimeSeconds, from, to);
3134
+ return _this7.api.getActivityLogT(_this7.userExtId, startTimeSeconds, endTimeSeconds, from, to, types, src_types);
3123
3135
  }, CACHE_DATA_SEC));
3124
3136
  } catch (e) {
3125
3137
  return Promise.reject(e);
@@ -3133,8 +3145,9 @@ var WSAPIUser = /*#__PURE__*/function (_WSAPIBase) {
3133
3145
  if (!params) {
3134
3146
  return Promise.resolve();
3135
3147
  }
3136
- return Promise.resolve(_this8.api.getActivityLogT(_this8.userExtId, params.startTimeSeconds, params.endTimeSeconds, params.from, params.to)).then(function (payload) {
3137
- var cacheKey = onUpdateContextKey.ActivityLog + ":" + params.startTimeSeconds + ":" + params.endTimeSeconds + ":" + params.from + ":" + params.to;
3148
+ return Promise.resolve(_this8.api.getActivityLogT(_this8.userExtId, params.startTimeSeconds, params.endTimeSeconds, params.from, params.to, params.types, params.src_types)).then(function (payload) {
3149
+ var _params$types$join, _params$types, _params$src_types$joi, _params$src_types;
3150
+ var cacheKey = onUpdateContextKey.ActivityLog + ":" + params.startTimeSeconds + ":" + params.endTimeSeconds + ":" + params.from + ":" + params.to + ":" + ((_params$types$join = (_params$types = params.types) == null ? void 0 : _params$types.join(',')) != null ? _params$types$join : '') + ":" + ((_params$src_types$joi = (_params$src_types = params.src_types) == null ? void 0 : _params$src_types.join(',')) != null ? _params$src_types$joi : '');
3138
3151
  OCache.set(cacheKey, payload, exports.ECacheContext.WSAPI);
3139
3152
  var onUpdate = _this8.onUpdateCallback.get(onUpdateContextKey.ActivityLog);
3140
3153
  if (typeof onUpdate === 'function') {
@@ -3156,8 +3169,10 @@ var WSAPIUser = /*#__PURE__*/function (_WSAPIBase) {
3156
3169
  * **Pagination** — same `from` / `to` offset model as {@link getActivityLog}
3157
3170
  * (server caps a single response at 50 entries).
3158
3171
  *
3159
- * **Filtering** — pass `types` with {@link ActivityLogActivities} values to
3160
- * request a server-side subset (e.g. missions only). Omit for all activity types.
3172
+ * **Filtering** — optional server-side filters:
3173
+ * - `types` — {@link ActivityLogActivities} values (`type_id`)
3174
+ * - `src_types` — {@link PointChangeSourceType} values (`source_type_id`)
3175
+ * Omit both for all activity types / sources.
3161
3176
  *
3162
3177
  * @returns Array of {@link TActivityLogEntry} ordered newest-first.
3163
3178
  */
@@ -3167,13 +3182,14 @@ var WSAPIUser = /*#__PURE__*/function (_WSAPIBase) {
3167
3182
  endTimeSeconds = _ref2.endTimeSeconds,
3168
3183
  from = _ref2.from,
3169
3184
  to = _ref2.to,
3170
- types = _ref2.types;
3185
+ types = _ref2.types,
3186
+ src_types = _ref2.src_types;
3171
3187
  try {
3172
- var _types$join;
3188
+ var _types$join2, _src_types$join2;
3173
3189
  var _this9 = this;
3174
- var cacheKey = onUpdateContextKey.ActivityLogV2 + ":" + startTimeSeconds + ":" + endTimeSeconds + ":" + from + ":" + to + ":" + ((_types$join = types == null ? void 0 : types.join(',')) != null ? _types$join : '');
3190
+ var cacheKey = onUpdateContextKey.ActivityLogV2 + ":" + startTimeSeconds + ":" + endTimeSeconds + ":" + from + ":" + to + ":" + ((_types$join2 = types == null ? void 0 : types.join(',')) != null ? _types$join2 : '') + ":" + ((_src_types$join2 = src_types == null ? void 0 : src_types.join(',')) != null ? _src_types$join2 : '');
3175
3191
  return Promise.resolve(OCache.use(cacheKey, exports.ECacheContext.WSAPI, function () {
3176
- return _this9.api.getActivityLogV2T(_this9.userExtId, startTimeSeconds, endTimeSeconds, from, to, types);
3192
+ return _this9.api.getActivityLogV2T(_this9.userExtId, startTimeSeconds, endTimeSeconds, from, to, types, src_types);
3177
3193
  }, CACHE_DATA_SEC));
3178
3194
  } catch (e) {
3179
3195
  return Promise.reject(e);
@@ -10447,6 +10463,7 @@ exports.PointChangeSourceType = void 0;
10447
10463
  PointChangeSourceType[PointChangeSourceType["WinMiniGame"] = 17] = "WinMiniGame";
10448
10464
  PointChangeSourceType[PointChangeSourceType["API"] = 18] = "API";
10449
10465
  PointChangeSourceType[PointChangeSourceType["DynamicFormula"] = 19] = "DynamicFormula";
10466
+ PointChangeSourceType[PointChangeSourceType["Jackpot"] = 20] = "Jackpot";
10450
10467
  PointChangeSourceType[PointChangeSourceType["Raffle"] = 21] = "Raffle";
10451
10468
  PointChangeSourceType[PointChangeSourceType["Avatars"] = 22] = "Avatars";
10452
10469
  PointChangeSourceType[PointChangeSourceType["Clan"] = 23] = "Clan";
@@ -12330,21 +12347,25 @@ var SmarticoAPI = /*#__PURE__*/function () {
12330
12347
  return Promise.reject(e);
12331
12348
  }
12332
12349
  };
12333
- _proto.getActivityLog = function getActivityLog(user_ext_id, startTimeSeconds, endTimeSeconds, limit, offset) {
12350
+ _proto.getActivityLog = function getActivityLog(user_ext_id, startTimeSeconds, endTimeSeconds, limit, offset, types, src_types) {
12334
12351
  try {
12335
12352
  var _this102 = this;
12336
- var message = _this102.buildMessage(user_ext_id, exports.ClassId.GET_POINT_HISTORY_REQUEST, {
12353
+ var message = _this102.buildMessage(user_ext_id, exports.ClassId.GET_POINT_HISTORY_REQUEST, _extends({
12337
12354
  startTimeSeconds: Math.floor(startTimeSeconds),
12338
12355
  endTimeSeconds: Math.floor(endTimeSeconds),
12339
12356
  limit: limit,
12340
12357
  offset: offset
12341
- });
12358
+ }, types ? {
12359
+ types: types
12360
+ } : {}, src_types ? {
12361
+ src_types: src_types
12362
+ } : {}));
12342
12363
  return Promise.resolve(_this102.send(message, exports.ClassId.GET_POINT_HISTORY_RESPONSE));
12343
12364
  } catch (e) {
12344
12365
  return Promise.reject(e);
12345
12366
  }
12346
12367
  };
12347
- _proto.getActivityLogV2 = function getActivityLogV2(user_ext_id, startTimeSeconds, endTimeSeconds, limit, offset, types) {
12368
+ _proto.getActivityLogV2 = function getActivityLogV2(user_ext_id, startTimeSeconds, endTimeSeconds, limit, offset, types, src_types) {
12348
12369
  try {
12349
12370
  var _this103 = this;
12350
12371
  var message = _this103.buildMessage(user_ext_id, exports.ClassId.GET_POINT_HISTORY_REQUEST, _extends({
@@ -12354,13 +12375,15 @@ var SmarticoAPI = /*#__PURE__*/function () {
12354
12375
  offset: offset
12355
12376
  }, types ? {
12356
12377
  types: types
12378
+ } : {}, src_types ? {
12379
+ src_types: src_types
12357
12380
  } : {}));
12358
12381
  return Promise.resolve(_this103.send(message, exports.ClassId.GET_POINT_HISTORY_RESPONSE));
12359
12382
  } catch (e) {
12360
12383
  return Promise.reject(e);
12361
12384
  }
12362
12385
  };
12363
- _proto.getActivityLogT = function getActivityLogT(user_ext_id, startTimeSeconds, endTimeSeconds, from, to) {
12386
+ _proto.getActivityLogT = function getActivityLogT(user_ext_id, startTimeSeconds, endTimeSeconds, from, to, types, src_types) {
12364
12387
  if (from === void 0) {
12365
12388
  from = 0;
12366
12389
  }
@@ -12371,14 +12394,14 @@ var SmarticoAPI = /*#__PURE__*/function () {
12371
12394
  var _this104 = this;
12372
12395
  var limit = to - from > 50 ? 50 : to - from;
12373
12396
  var offset = from;
12374
- return Promise.resolve(_this104.getActivityLog(user_ext_id, startTimeSeconds, endTimeSeconds, limit, offset)).then(function (_this104$getActivityL) {
12397
+ return Promise.resolve(_this104.getActivityLog(user_ext_id, startTimeSeconds, endTimeSeconds, limit, offset, types, src_types)).then(function (_this104$getActivityL) {
12375
12398
  return ActivityLogTransform(_this104$getActivityL.logHistory);
12376
12399
  });
12377
12400
  } catch (e) {
12378
12401
  return Promise.reject(e);
12379
12402
  }
12380
12403
  };
12381
- _proto.getActivityLogV2T = function getActivityLogV2T(user_ext_id, startTimeSeconds, endTimeSeconds, from, to, types) {
12404
+ _proto.getActivityLogV2T = function getActivityLogV2T(user_ext_id, startTimeSeconds, endTimeSeconds, from, to, types, src_types) {
12382
12405
  if (from === void 0) {
12383
12406
  from = 0;
12384
12407
  }
@@ -12389,7 +12412,7 @@ var SmarticoAPI = /*#__PURE__*/function () {
12389
12412
  var _this105 = this;
12390
12413
  var limit = to - from > 50 ? 50 : to - from;
12391
12414
  var offset = from;
12392
- return Promise.resolve(_this105.getActivityLogV2(user_ext_id, startTimeSeconds, endTimeSeconds, limit, offset, types)).then(function (_this105$getActivityL) {
12415
+ return Promise.resolve(_this105.getActivityLogV2(user_ext_id, startTimeSeconds, endTimeSeconds, limit, offset, types, src_types)).then(function (_this105$getActivityL) {
12393
12416
  return ActivityLogV2Transform(_this105$getActivityL.logHistory);
12394
12417
  });
12395
12418
  } catch (e) {