@lumiastream/lumia-types 3.2.3 → 3.2.5

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.
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ var _a, _b, _c, _d, _e, _f, _g, _h;
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  exports.LumiaAlertConfigs = exports.LumiaRedemptionCurrencySymbol = exports.LumiaRedemptionCurrency = exports.VariationCurrencySymbol = exports.LumiaVariationCurrency = exports.LumiaVariationConditions = void 0;
4
5
  const activity_types_1 = require("./activity.types");
@@ -4042,6 +4043,7 @@ exports.LumiaAlertConfigs = {
4042
4043
  currencySymbol: '$',
4043
4044
  stickerId: 'emoji_beaming_face',
4044
4045
  stickerName: 'Emoji Beaming Face',
4046
+ imageUrl: (_b = (_a = youtube_superstickers_1.YoutubeSuperstickersData.find((sticker) => sticker.value === 'emoji_beaming_face')) === null || _a === void 0 ? void 0 : _a.imageUrl) !== null && _b !== void 0 ? _b : '',
4045
4047
  },
4046
4048
  },
4047
4049
  {
@@ -4056,6 +4058,7 @@ exports.LumiaAlertConfigs = {
4056
4058
  currencySymbol: '$',
4057
4059
  stickerId: 'emoji_laughing',
4058
4060
  stickerName: 'Emoji Laughing',
4061
+ imageUrl: (_d = (_c = youtube_superstickers_1.YoutubeSuperstickersData.find((sticker) => sticker.value === 'emoji_laughing')) === null || _c === void 0 ? void 0 : _c.imageUrl) !== null && _d !== void 0 ? _d : '',
4059
4062
  },
4060
4063
  },
4061
4064
  {
@@ -4070,6 +4073,7 @@ exports.LumiaAlertConfigs = {
4070
4073
  currencySymbol: '$',
4071
4074
  stickerId: 'emoji_sad',
4072
4075
  stickerName: 'Emoji Sad',
4076
+ imageUrl: (_f = (_e = youtube_superstickers_1.YoutubeSuperstickersData.find((sticker) => sticker.value === 'emoji_sad')) === null || _e === void 0 ? void 0 : _e.imageUrl) !== null && _f !== void 0 ? _f : '',
4073
4077
  },
4074
4078
  },
4075
4079
  ],
@@ -4105,6 +4109,13 @@ exports.LumiaAlertConfigs = {
4105
4109
  required: false,
4106
4110
  default: '$',
4107
4111
  },
4112
+ {
4113
+ type: 'text',
4114
+ label: 'Image URL',
4115
+ variableField: 'imageUrl',
4116
+ required: false,
4117
+ default: (_h = (_g = youtube_superstickers_1.YoutubeSuperstickersData.find((sticker) => sticker.value === 'emoji_beaming_face')) === null || _g === void 0 ? void 0 : _g.imageUrl) !== null && _h !== void 0 ? _h : '',
4118
+ },
4108
4119
  ],
4109
4120
  LumiaVariationConditions: [
4110
4121
  { type: LumiaVariationConditions.RANDOM },
@@ -13,6 +13,32 @@ title: Important notes
13
13
  The different options are: `isSelf, mod, vip, tier3, tier2, tier1, subscriber, follower`.
14
14
  In your code you should use `const levels = await getVariable('userLevelsRaw');` and then you can check a level with `if (levels.subscriber) {}` since these are all booleans
15
15
 
16
+ - We also expose `{{originType}}` so your custom code can tell where the activity came from. Use `const originType = await getVariable('originType');` when you need to branch between alerts and command-based triggers.
17
+ Common values are: `alert`, `chat`, `chatbot`, `twitch-points`, `twitch-extension`, `kick-points`, `system`, and `api`.
18
+ Important: "commands" are not a single origin type. If you want to run only for command-style triggers you will usually want to check for a list like `chat`, `chatbot`, `twitch-points`, `twitch-extension`, and `kick-points`.
19
+
20
+ ```js
21
+ async function() {
22
+ const originType = await getVariable('originType');
23
+ const commandOrigins = ['chat', 'chatbot', 'twitch-points', 'twitch-extension', 'kick-points'];
24
+
25
+ if (originType === 'alert') {
26
+ chatbot({ message: 'This custom code was triggered by an alert.' });
27
+ done();
28
+ return;
29
+ }
30
+
31
+ if (commandOrigins.includes(originType)) {
32
+ chatbot({ message: `Command trigger detected from ${originType}.` });
33
+ done();
34
+ return;
35
+ }
36
+
37
+ log(`Skipping custom code for originType: ${originType}`);
38
+ done();
39
+ }
40
+ ```
41
+
16
42
  - To quickly log out information for easier debugging, use `log("")`. You can also use `console.log` which will do the same thing. This will popup a toast message with what you are trying to log as well as add it to the logs in the dashboard
17
43
 
18
44
  - Everything ran is in a safe JavaScript worker thread away from the Lumia Stream thread so no need to worry about scripts slowing down the app. Make sure you do avoid memory leaks by calling `done()` when you're done with your script
@@ -8,6 +8,8 @@ import { LumiaAlertValues } from './custom-overlays';
8
8
 
9
9
  /** Known platforms (extendable). */
10
10
  type Platform = 'twitch' | 'youtube' | 'kick' | 'tiktok' | 'facebook' | string;
11
+ /** Known Lumia activity origins (extendable). */
12
+ type ActivityOrigin = 'system' | 'alert' | 'chat' | 'chatbot' | 'twitch-points' | 'twitch-extension' | 'kick-points' | 'api' | 'lumiastreamlink' | 'streamdeck' | 'touchportal' | 'avermedia' | 'loupedeck' | string;
11
13
 
12
14
  /** ISO-8601 timestamp branding for better editor hints. */
13
15
  type ISODateString = string & { __iso8601: true };
@@ -27,6 +29,8 @@ type Timing = { checkTimingType: false } | { checkTimingType: true; timingType:
27
29
  interface CommonExtras {
28
30
  /** Origin site/platform for this alert (e.g., "twitch"). */
29
31
  site: Platform;
32
+ /** Lumia queue/activity origin type (e.g., "alert", "chat", "chatbot", "system"). */
33
+ originType?: ActivityOrigin;
30
34
  /** ISO-8601 timestamp when the alert originated. */
31
35
  timestamp: ISODateString;
32
36
 
@@ -127,6 +127,8 @@ export interface AlertEvent {
127
127
  timestamp: string;
128
128
  /** Platform where the alert originated */
129
129
  site: 'twitch' | 'kick' | 'youtube' | 'tiktok' | 'facebook' | string;
130
+ /** Lumia queue/activity origin type (e.g., "alert", "chat", "chatbot", "system") */
131
+ originType?: 'system' | 'alert' | 'chat' | 'chatbot' | 'twitch-points' | 'twitch-extension' | 'kick-points' | 'api' | 'lumiastreamlink' | 'streamdeck' | 'touchportal' | 'avermedia' | 'loupedeck' | string;
130
132
  /** Whether timing type should be checked */
131
133
  checkTimingType: boolean;
132
134
  /** Type of timing for the alert */
@@ -127,6 +127,8 @@ export interface AlertEvent {
127
127
  timestamp: string;
128
128
  /** Platform where the alert originated */
129
129
  site: 'twitch' | 'kick' | 'youtube' | 'tiktok' | 'facebook' | string;
130
+ /** Lumia queue/activity origin type (e.g., "alert", "chat", "chatbot", "system") */
131
+ originType?: 'system' | 'alert' | 'chat' | 'chatbot' | 'twitch-points' | 'twitch-extension' | 'kick-points' | 'api' | 'lumiastreamlink' | 'streamdeck' | 'touchportal' | 'avermedia' | 'loupedeck' | string;
130
132
  /** Whether timing type should be checked */
131
133
  checkTimingType: boolean;
132
134
  /** Type of timing for the alert */
@@ -1,4 +1,4 @@
1
- import { LumiaActivityCommandTypes } from './activity.types';
1
+ import { LumiaActivityCommandTypes, LumiaActivityOriginTypes } from './activity.types';
2
2
  export interface ILumiaSendPack {
3
3
  type: LumiaActivityCommandTypes;
4
4
  params?: {
@@ -19,6 +19,7 @@ export interface ILumiaSendPack {
19
19
  extraSettings?: {
20
20
  username?: string;
21
21
  bits?: number;
22
+ originType?: LumiaActivityOriginTypes;
22
23
  };
23
24
  };
24
25
  }
@@ -723,6 +723,7 @@ exports.ReservedVariables = [
723
723
  'userId',
724
724
  'value',
725
725
  'site',
726
+ 'originType',
726
727
  'command',
727
728
  'merch',
728
729
  'message',
@@ -940,6 +941,7 @@ exports.AllVariables = {
940
941
  'userLevelsRaw',
941
942
  'channelDescription',
942
943
  'channelViews',
944
+ 'originType',
943
945
  'command',
944
946
  'message',
945
947
  'messageId',
@@ -964,6 +966,7 @@ exports.AllVariables = {
964
966
  'userLevelsRaw',
965
967
  'channelDescription',
966
968
  'channelViews',
969
+ 'originType',
967
970
  'command',
968
971
  'message',
969
972
  'messageId',
@@ -984,6 +987,7 @@ exports.AllVariables = {
984
987
  'avatar',
985
988
  'channelDescription',
986
989
  'channelViews',
990
+ 'originType',
987
991
  'command',
988
992
  'prompt',
989
993
  'message',
@@ -1000,6 +1004,7 @@ exports.AllVariables = {
1000
1004
  'avatar',
1001
1005
  'channelDescription',
1002
1006
  'channelViews',
1007
+ 'originType',
1003
1008
  'command',
1004
1009
  'prompt',
1005
1010
  'message',
@@ -1016,6 +1021,7 @@ exports.AllVariables = {
1016
1021
  'avatar',
1017
1022
  'channelDescription',
1018
1023
  'channelViews',
1024
+ 'originType',
1019
1025
  'command',
1020
1026
  'prompt',
1021
1027
  'message',
@@ -1038,6 +1044,7 @@ exports.AllVariables = {
1038
1044
  'userLevelsRaw',
1039
1045
  'channelDescription',
1040
1046
  'channelViews',
1047
+ 'originType',
1041
1048
  'command',
1042
1049
  'message',
1043
1050
  'messageId',
@@ -2029,7 +2036,7 @@ exports.AllVariables = {
2029
2036
  sessionGiftMembers: ['total', 'previousTotal'],
2030
2037
  superchat: ['username', 'displayname', 'currency', 'currencySymbol', 'amount', 'message'],
2031
2038
  sessionSuperchats: ['total', 'previousTotal', 'currency', 'currencySymbol'],
2032
- supersticker: ['username', 'displayname', 'stickerId', 'stickerName', 'amount', 'currency', 'currencySymbol'],
2039
+ supersticker: ['username', 'displayname', 'stickerId', 'stickerName', 'amount', 'currency', 'currencySymbol', 'imageUrl'],
2033
2040
  sessionSuperstickers: ['total', 'previousTotal', 'currency', 'currencySymbol'],
2034
2041
  like: ['likes', 'dislikes'],
2035
2042
  viewers: ['viewers'],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumiastream/lumia-types",
3
- "version": "3.2.3",
3
+ "version": "3.2.5",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "files": [