@stripchatdev/ext-helper 0.1.24 → 0.1.26

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 +92 -21
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -149,7 +149,7 @@ declare type TV1ChatMethods = {
149
149
  };
150
150
  };
151
151
 
152
- export declare type TV1Events = TV1ExtEvents & TV1PaymentEvents & TV1ModelEvents & TV1TipEvents & TV1ChatEvents;
152
+ export declare type TV1Events = TV1ExtEvents & TV1PaymentEvents & TV1ModelEvents & TV1SessionEvents & TV1TipEvents & TV1ChatEvents;
153
153
 
154
154
  export declare type TV1ExtContext = {
155
155
  model?: TV1ExtModel;
@@ -219,12 +219,6 @@ declare type TV1ExtMethods = {
219
219
  params: TV1ActionRequestParams;
220
220
  result: TV1ActionResult;
221
221
  };
222
- 'v1.ext.activity.cancel': {
223
- params: {
224
- activityId: string;
225
- };
226
- result: null;
227
- };
228
222
  'v1.ext.activity.request': {
229
223
  params: {
230
224
  durationMs: number;
@@ -325,7 +319,7 @@ export declare type TV1ExtUser = TV1ExtGuestUser | TV1ExtLoggedInUser;
325
319
 
326
320
  export declare type TV1Genders = 'male' | 'female' | 'group' | 'tranny';
327
321
 
328
- export declare type TV1Methods = TV1ExtMethods & TV1SystemMethods & TV1PaymentMethods & TV1ModelMethods & TV1ChatMethods & TV1PrivateMethods & TV1MonitoringMethods & TV1StorageMethods & TV1TipMethods;
322
+ export declare type TV1Methods = TV1ExtMethods & TV1SystemMethods & TV1PaymentMethods & TV1ModelMethods & TV1ChatMethods & TV1PrivateMethods & TV1MonitoringMethods & TV1SessionMethods & TV1StorageMethods & TV1TipMethods;
329
323
 
330
324
  declare type TV1ModelEvents = {
331
325
  'v1.model.ext.settings.set.requested': null;
@@ -419,6 +413,73 @@ declare type TV1SerializedError = {
419
413
  stack?: string;
420
414
  };
421
415
 
416
+ export declare type TV1Session = TV1SessionSelf | TV1SessionOther;
417
+
418
+ export declare type TV1SessionActionType = 'join' | 'finish';
419
+
420
+ declare type TV1SessionEvents = {
421
+ 'v1.session.updated': {
422
+ data: TV1SessionUpdate;
423
+ };
424
+ 'v1.session.whispered.model': TV1SessionWhisperData;
425
+ };
426
+
427
+ declare type TV1SessionMethods = {
428
+ 'v1.session.finish.model': {
429
+ params: null;
430
+ result: null;
431
+ };
432
+ 'v1.session.get': {
433
+ params: null;
434
+ result: {
435
+ session: TV1Session | null;
436
+ };
437
+ };
438
+ 'v1.session.join.model': {
439
+ params: {
440
+ ttl: string;
441
+ };
442
+ result: null;
443
+ };
444
+ 'v1.session.join.user': {
445
+ params: {
446
+ payment: TV1PaymentData;
447
+ ttl: string;
448
+ };
449
+ result: null;
450
+ };
451
+ 'v1.session.whisper.user': {
452
+ params: {
453
+ data: TV1SessionWhisperData;
454
+ };
455
+ result: null;
456
+ };
457
+ };
458
+
459
+ export declare type TV1SessionOther = {
460
+ /** The session exists but belongs to a different extension */
461
+ owner: 'other';
462
+ };
463
+
464
+ export declare type TV1SessionSelf = {
465
+ meta: {
466
+ /** Platform session id */
467
+ sessionId: string;
468
+ /** Remaining lifetime in seconds */
469
+ ttlSec: number;
470
+ };
471
+ /** The session exists but belongs to a different extension: */
472
+ owner: 'self';
473
+ };
474
+
475
+ export declare type TV1SessionUpdate = {
476
+ action: TV1SessionActionType;
477
+ session: TV1Session | null;
478
+ userId: TUserId;
479
+ };
480
+
481
+ export declare type TV1SessionWhisperData = TUnknownDictionary;
482
+
422
483
  declare type TV1StorageMethods = {
423
484
  'v1.storage.int.get': {
424
485
  params: {
@@ -476,7 +537,7 @@ declare type TV1StorageMethods = {
476
537
  mutexName: string;
477
538
  /** Auto-release after this many seconds. Omit or 0 = hold until explicit unlock. */
478
539
  /** @format int64 */
479
- ttlSeconds?: string;
540
+ ttl?: string;
480
541
  };
481
542
  result: {
482
543
  success: boolean;
@@ -495,7 +556,7 @@ declare type TV1StorageMethods = {
495
556
  key: string;
496
557
  /** Auto-delete the key after this many seconds. Omit or 0 = no expiry. */
497
558
  /** @format int64 */
498
- ttlSeconds?: string;
559
+ ttl?: string;
499
560
  value: string;
500
561
  };
501
562
  result: {
@@ -507,6 +568,9 @@ declare type TV1StorageMethods = {
507
568
  key: string;
508
569
  };
509
570
  result: {
571
+ /** `false` when the key has never been set (value will be `''` empty string). */
572
+ exists: boolean;
573
+ /** Stored string value. Empty string if the key was never set. */
510
574
  value: string;
511
575
  };
512
576
  };
@@ -515,7 +579,7 @@ declare type TV1StorageMethods = {
515
579
  key: string;
516
580
  /** Auto-delete the key after this many seconds. Omit or 0 = no expiry. */
517
581
  /** @format int64 */
518
- ttlSeconds?: string;
582
+ ttl?: string;
519
583
  value: string;
520
584
  };
521
585
  result: {
@@ -529,10 +593,10 @@ declare type TV1StorageMethods = {
529
593
  'v1.storage.top.get': {
530
594
  params: {
531
595
  key: string;
596
+ /** Sliding time horizon for summing increments. */
597
+ top: TV1TopWindow;
532
598
  /** How many users to return in `topUsers`. 0 = default 10; max 100. */
533
599
  topN?: number;
534
- /** Sliding time horizon for summing increments. */
535
- window: TV1TopWindow;
536
600
  };
537
601
  result: {
538
602
  topUsers?: TV1TopUserEntry[];
@@ -555,15 +619,11 @@ declare type TV1StorageMethods = {
555
619
  };
556
620
  result: {
557
621
  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. */
622
+ /** Echo of request `userId`; `windowStats` apply to this user. */
562
623
  /** @format int64 */
563
- value30d?: string;
564
- /** Sum within 7-day window after this increment. */
565
- /** @format int64 */
566
- value7d?: string;
624
+ userId?: string;
625
+ /** One entry per standard horizon (1d, 7d, 30d) with that user's total in each window after the increment. */
626
+ windowStats?: TV1TopIncrementWindowStat[];
567
627
  };
568
628
  };
569
629
  /** Clear all increments for a top counter key. */
@@ -688,6 +748,17 @@ declare type TV1TipSource = 'console' | 'tipMenu' | 'goal' | 'epicGoal' | 'fulls
688
748
  /** Custom data that you can pass when requesting token spend. You will receive it on successful payment */
689
749
  export declare type TV1TokenSpendData = TUnknownDictionary;
690
750
 
751
+ /**
752
+ * Per-window statistics for a user after a top counter increment.
753
+ * One entry per standard horizon (1d, 7d, 30d).
754
+ */
755
+ export declare type TV1TopIncrementWindowStat = {
756
+ /** User's summed total within this window after the increment. */
757
+ value: string;
758
+ /** Sliding time horizon (1d, 7d, or 30d). */
759
+ window: TV1TopWindow;
760
+ };
761
+
691
762
  export declare type TV1TopUserEntry = {
692
763
  /** Sum of increment amounts within the sliding window for this user. */
693
764
  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.26",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "module": "./dist/ext-helper.js",