@stripchatdev/ext-helper 0.1.24 → 0.1.25

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 (2) hide show
  1. package/dist/index.d.ts +23 -13
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -476,7 +476,7 @@ declare type TV1StorageMethods = {
476
476
  mutexName: string;
477
477
  /** Auto-release after this many seconds. Omit or 0 = hold until explicit unlock. */
478
478
  /** @format int64 */
479
- ttlSeconds?: string;
479
+ ttl?: string;
480
480
  };
481
481
  result: {
482
482
  success: boolean;
@@ -495,7 +495,7 @@ declare type TV1StorageMethods = {
495
495
  key: string;
496
496
  /** Auto-delete the key after this many seconds. Omit or 0 = no expiry. */
497
497
  /** @format int64 */
498
- ttlSeconds?: string;
498
+ ttl?: string;
499
499
  value: string;
500
500
  };
501
501
  result: {
@@ -507,6 +507,9 @@ declare type TV1StorageMethods = {
507
507
  key: string;
508
508
  };
509
509
  result: {
510
+ /** `false` when the key has never been set (value will be `''` empty string). */
511
+ exists: boolean;
512
+ /** Stored string value. Empty string if the key was never set. */
510
513
  value: string;
511
514
  };
512
515
  };
@@ -515,7 +518,7 @@ declare type TV1StorageMethods = {
515
518
  key: string;
516
519
  /** Auto-delete the key after this many seconds. Omit or 0 = no expiry. */
517
520
  /** @format int64 */
518
- ttlSeconds?: string;
521
+ ttl?: string;
519
522
  value: string;
520
523
  };
521
524
  result: {
@@ -529,10 +532,10 @@ declare type TV1StorageMethods = {
529
532
  'v1.storage.top.get': {
530
533
  params: {
531
534
  key: string;
535
+ /** Sliding time horizon for summing increments. */
536
+ top: TV1TopWindow;
532
537
  /** How many users to return in `topUsers`. 0 = default 10; max 100. */
533
538
  topN?: number;
534
- /** Sliding time horizon for summing increments. */
535
- window: TV1TopWindow;
536
539
  };
537
540
  result: {
538
541
  topUsers?: TV1TopUserEntry[];
@@ -555,15 +558,11 @@ declare type TV1StorageMethods = {
555
558
  };
556
559
  result: {
557
560
  success: boolean;
558
- /** Sum within 1-day window after this increment. */
559
- /** @format int64 */
560
- value1d?: string;
561
- /** Sum within 30-day window after this increment. */
562
- /** @format int64 */
563
- value30d?: string;
564
- /** Sum within 7-day window after this increment. */
561
+ /** Echo of request `userId`; `windowStats` apply to this user. */
565
562
  /** @format int64 */
566
- value7d?: string;
563
+ userId?: string;
564
+ /** One entry per standard horizon (1d, 7d, 30d) with that user's total in each window after the increment. */
565
+ windowStats?: TV1TopIncrementWindowStat[];
567
566
  };
568
567
  };
569
568
  /** Clear all increments for a top counter key. */
@@ -688,6 +687,17 @@ declare type TV1TipSource = 'console' | 'tipMenu' | 'goal' | 'epicGoal' | 'fulls
688
687
  /** Custom data that you can pass when requesting token spend. You will receive it on successful payment */
689
688
  export declare type TV1TokenSpendData = TUnknownDictionary;
690
689
 
690
+ /**
691
+ * Per-window statistics for a user after a top counter increment.
692
+ * One entry per standard horizon (1d, 7d, 30d).
693
+ */
694
+ export declare type TV1TopIncrementWindowStat = {
695
+ /** User's summed total within this window after the increment. */
696
+ value: string;
697
+ /** Sliding time horizon (1d, 7d, or 30d). */
698
+ window: TV1TopWindow;
699
+ };
700
+
691
701
  export declare type TV1TopUserEntry = {
692
702
  /** Sum of increment amounts within the sliding window for this user. */
693
703
  total: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stripchatdev/ext-helper",
3
3
  "private": false,
4
- "version": "0.1.24",
4
+ "version": "0.1.25",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "module": "./dist/ext-helper.js",