@stripchatdev/ext-helper 0.1.37 → 0.1.39

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 +49 -2
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -173,7 +173,7 @@ declare type TV1ChatMethods = {
173
173
  };
174
174
  };
175
175
 
176
- export declare type TV1Events = TV1ExtEvents & TV1PaymentEvents & TV1ModelEvents & TV1SessionEvents & TV1TipEvents & TV1ChatEvents;
176
+ export declare type TV1Events = TV1ExtEvents & TV1PaymentEvents & TV1ModelEvents & TV1SessionEvents & TV1TipEvents & TV1ChatEvents & TV1GoalEvents;
177
177
 
178
178
  export declare type TV1ExtContext = {
179
179
  model?: TV1ExtModel;
@@ -379,7 +379,36 @@ export declare type TV1ExtViewers = {
379
379
 
380
380
  export declare type TV1Genders = 'male' | 'female' | 'group' | 'tranny';
381
381
 
382
- export declare type TV1Methods = TV1ExtMethods & TV1SystemMethods & TV1PaymentMethods & TV1ModelMethods & TV1ChatMethods & TV1PrivateMethods & TV1MonitoringMethods & TV1SessionMethods & TV1StorageMethods & TV1TipMethods;
382
+ /** Regular goal data */
383
+ export declare type TV1GoalData = {
384
+ /** Goal description */
385
+ description: string;
386
+ /** Whether the goal is fully completed */
387
+ isCompleted: boolean;
388
+ /** Amount of tokens already collected */
389
+ tokensCollected: number;
390
+ /** Target amount in tokens */
391
+ tokensTarget: number;
392
+ };
393
+
394
+ declare type TV1GoalEvents = {
395
+ /** Fired when any field of the active goal changes (description, isCompleted, tokensTarget, or tokensCollected), or the active goal is removed. */
396
+ 'v1.goal.updated': {
397
+ goal: TV1GoalData | null;
398
+ };
399
+ };
400
+
401
+ declare type TV1GoalMethods = {
402
+ /** Get the current active goal. Returns null if no goal is active. */
403
+ 'v1.goal.get': {
404
+ params: null;
405
+ result: {
406
+ goal: TV1GoalData | null;
407
+ };
408
+ };
409
+ };
410
+
411
+ export declare type TV1Methods = TV1ExtMethods & TV1SystemMethods & TV1PaymentMethods & TV1ModelMethods & TV1ChatMethods & TV1PrivateMethods & TV1MonitoringMethods & TV1SessionMethods & TV1StorageMethods & TV1TipMethods & TV1GoalMethods;
383
412
 
384
413
  declare type TV1ModelEvents = {
385
414
  'v1.model.ext.settings.set.requested': null;
@@ -458,6 +487,12 @@ declare type TV1PaymentMethods = {
458
487
  };
459
488
  result: null;
460
489
  };
490
+ /** Opens the token top-up (purchase) modal directly, sending the user straight to buying tokens — without
491
+ * the spend-confirmation step of `v1.payment.tokens.spend`. Use it for an explicit "Buy tokens" CTA. */
492
+ 'v1.payment.tokens.topup': {
493
+ params: null;
494
+ result: null;
495
+ };
461
496
  };
462
497
 
463
498
  declare type TV1PrivateMethods = {
@@ -628,11 +663,23 @@ declare type TV1StorageMethods = {
628
663
  };
629
664
  'v1.storage.string.get': {
630
665
  params: {
666
+ /**
667
+ * When `true`, read from the extension-wide global scope (`model_id=0,owner_id=0`) instead of
668
+ * the current room/owner scope. Use this for backend-seeded shared data that every room sees.
669
+ * Defaults to `false` (per-room read).
670
+ */
671
+ all?: boolean;
631
672
  key: string;
632
673
  };
633
674
  result: {
634
675
  /** `false` when the key has never been set (value will be `''` empty string). */
635
676
  exists: boolean;
677
+ /**
678
+ * Server time (UTC, RFC3339) at which the response was generated. Use this instead of the device
679
+ * clock for time-window logic — a skewed local clock won't desync the extension. Optional so a host
680
+ * that doesn't yet surface it still validates (newer hosts always include it).
681
+ */
682
+ time?: string;
636
683
  /** Stored string value. Empty string if the key was never set. */
637
684
  value: string;
638
685
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stripchatdev/ext-helper",
3
3
  "private": false,
4
- "version": "0.1.37",
4
+ "version": "0.1.39",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "module": "./dist/ext-helper.js",