@stripchatdev/ext-helper 0.1.14 → 0.1.16

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 +106 -29
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -63,6 +63,9 @@ export declare type TExtPageResolverMethods = {
63
63
  };
64
64
  };
65
65
 
66
+ /** Unique identifier for a guest user **/
67
+ export declare type TGuestHash = string;
68
+
66
69
  export declare type TMethods = TV1Methods;
67
70
 
68
71
  export declare type TModelId = TUserId;
@@ -163,6 +166,52 @@ declare type TV1ExtEvents = {
163
166
  'v1.ext.whispered.local': TV1WhisperData;
164
167
  };
165
168
 
169
+ /** Guest user (not logged in). */
170
+ export declare type TV1ExtGuestUser = {
171
+ /** Unique identifier for a guest user. */
172
+ guestHash: TGuestHash;
173
+ /** User is a guest (not logged in). */
174
+ isGuest: true;
175
+ };
176
+
177
+ /** Logged-in user. */
178
+ export declare type TV1ExtLoggedInUser = {
179
+ /** User's fan club data. Contains information regarding user's subscription to the model's fan club. */
180
+ fanClub: TV1UsersFanClub;
181
+ /** User previously purchased tokens. */
182
+ hasPaidBefore: boolean;
183
+ /** User has tokens. */
184
+ hasTokens: boolean;
185
+ /** User currently has Ultimate membership. */
186
+ hasUltimateSubscription: boolean;
187
+ /** User ID. */
188
+ id: TUserId;
189
+ /** User is logged in. */
190
+ isGuest: false;
191
+ /** User is the highest tipper in the room over past 12 hours. */
192
+ isKing: boolean;
193
+ /** User is a knight of the model. */
194
+ isKnight: boolean;
195
+ /** Current user is a model. */
196
+ isModel: boolean;
197
+ /**
198
+ * Current show/session state for this user.
199
+ *
200
+ * - `public` — public broadcast context
201
+ * - `private` — private show context
202
+ * - `exclusivePrivate` — exclusive private show context
203
+ * - `groupShow` — group show context
204
+ * - `ticketShow` — ticket show context
205
+ * - `off` — offline
206
+ * - `spy` — spying on a private show
207
+ */
208
+ status: TV1UserStatus;
209
+ /** User username. */
210
+ username: string;
211
+ /** User activity ranking data when available. */
212
+ userRanking?: TV1UserRanking;
213
+ };
214
+
166
215
  declare type TV1ExtMethods = {
167
216
  'v1.ext.actions.call': {
168
217
  params: TV1ActionRequestParams;
@@ -205,6 +254,7 @@ declare type TV1ExtMethods = {
205
254
  settings: TV1ExtSettings;
206
255
  };
207
256
  };
257
+ /** Opens Stripchat sign-up dialog for anonymous users. Use this when your extension requires a registered account to function */
208
258
  'v1.ext.signup.open': {
209
259
  params: {
210
260
  type: 'user';
@@ -269,38 +319,11 @@ export declare type TV1ExtModel = {
269
319
 
270
320
  export declare type TV1ExtSettings = unknown;
271
321
 
272
- export declare type TV1ExtUser = {
273
- /** User previously purchased tokens */
274
- hasPaidBefore: boolean;
275
- /** User has tokens */
276
- hasTokens: boolean;
277
- /** User currently has Ultimate membership */
278
- hasUltimateSubscription: boolean;
279
- /** User ID. */
280
- id: TUserId;
281
- /** Current user is a model. */
282
- isModel: boolean;
283
- /**
284
- * Current show/session state for this user.
285
- *
286
- * - `public` — public broadcast context
287
- * - `private` — private show context
288
- * - `exclusivePrivate` — exclusive private show context
289
- * - `groupShow` — group show context
290
- * - `ticketShow` — ticket show context
291
- * - `off` — offline
292
- * - `spy` — spying on a private show
293
- */
294
- status: TV1UserStatus;
295
- /** User username. */
296
- username: string;
297
- /** User activity ranking data when available. */
298
- userRanking?: TV1UserRanking;
299
- };
322
+ export declare type TV1ExtUser = TV1ExtGuestUser | TV1ExtLoggedInUser;
300
323
 
301
324
  export declare type TV1Genders = 'male' | 'female' | 'group' | 'tranny';
302
325
 
303
- export declare type TV1Methods = TV1ExtMethods & TV1SystemMethods & TV1PaymentMethods & TV1ModelMethods & TV1ChatMethods & TV1PrivateMethods & TV1MonitoringMethods & TV1StorageMethods;
326
+ export declare type TV1Methods = TV1ExtMethods & TV1SystemMethods & TV1PaymentMethods & TV1ModelMethods & TV1ChatMethods & TV1PrivateMethods & TV1MonitoringMethods & TV1StorageMethods & TV1TipMethods;
304
327
 
305
328
  declare type TV1ModelEvents = {
306
329
  'v1.model.ext.settings.set.requested': null;
@@ -604,12 +627,46 @@ export declare type TV1TipData = {
604
627
  };
605
628
 
606
629
  declare type TV1TipEvents = {
630
+ /** Fired when the tip menu has been updated.*/
631
+ 'v1.tipMenu.updated': {
632
+ /** The current tip menu data. */
633
+ tipMenu: TV1TipMenu;
634
+ };
607
635
  /** Fired on every tip in chat for both model and user. Doesn't fire on private tips during public shows */
608
636
  'v1.tokens.spent': {
609
637
  tipData: TV1TipData;
610
638
  };
611
639
  };
612
640
 
641
+ /** Tip menu data */
642
+ export declare type TV1TipMenu = {
643
+ /** Whether tip menu is enabled or not. If it's disabled, the `items` array will be empty. */
644
+ isEnabled: boolean;
645
+ /** The list of tip menu items sorted by the model. */
646
+ items: TV1TipMenuItem[];
647
+ };
648
+
649
+ /** Tip menu item defined by the model. */
650
+ export declare type TV1TipMenuItem = {
651
+ /** Activity name */
652
+ activity: string;
653
+ /** Price of the activity for the current user applying all discounts.
654
+ * Discounds can be applied based on the user's fan club memberhip.
655
+ * */
656
+ price: number;
657
+ };
658
+
659
+ declare type TV1TipMethods = {
660
+ /** Get the current tip menu. Tip menu data might change during the broadcast, so subscribe to `v1.tipMenu.updated` to listen to these changes. */
661
+ 'v1.tipMenu.get': {
662
+ params: null;
663
+ result: {
664
+ /** The current tip menu data. */
665
+ tipMenu: TV1TipMenu;
666
+ };
667
+ };
668
+ };
669
+
613
670
  /** Source of the tip. Could be one of the following:
614
671
  *
615
672
  * `console` - tip was sent using / command
@@ -658,6 +715,26 @@ export declare type TV1UserRanking = {
658
715
  level: number;
659
716
  };
660
717
 
718
+ export declare type TV1UsersFanClub = TV1UsersFanClubSubscribed | TV1UsersFanClubNotSubscribed;
719
+
720
+ export declare type TV1UsersFanClubNotSubscribed = {
721
+ /** Whether user is subscribed to the model's fan club or not */
722
+ isSubscribed: false;
723
+ };
724
+
725
+ export declare type TV1UsersFanClubSubscribed = {
726
+ /** Whether user is subscribed to the model's fan club or not */
727
+ isSubscribed: true;
728
+ /** The tier of the fan club subscription. Could be `soldier`, `lord` or `prince`.
729
+ * The higher the tier, the more benefits the user gets.
730
+ *
731
+ * `Soldier` is the first tier. It has basic benefits
732
+ * `Lord` is the second tier. It has more benefits than `soldier`
733
+ * `Prince` is the third tier. It has the most benefits.
734
+ * **/
735
+ tier: 'soldier' | 'lord' | 'prince';
736
+ };
737
+
661
738
  export declare type TV1UserStatus = Exclude<(typeof V1_SHOW_STATUSES)[keyof typeof V1_SHOW_STATUSES], 'idle'>;
662
739
 
663
740
  export declare type TV1WhisperData = TUnknownDictionary;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stripchatdev/ext-helper",
3
3
  "private": false,
4
- "version": "0.1.14",
4
+ "version": "0.1.16",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "module": "./dist/ext-helper.js",