@lumiastream/lumia-types 3.2.4 → 3.2.6

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.
@@ -1038,6 +1038,7 @@ exports.LumiaAlertConfigs = {
1038
1038
  avatar: 'https://static-cdn.jtvnw.net/jtv_user_pictures/2b1fa336-f9b2-42cf-bd2c-98675da74982-profile_image-70x70.png',
1039
1039
  message: 'Great Stream',
1040
1040
  subMonths: 1,
1041
+ streakMonths: 1,
1041
1042
  tier: 'Tier 1',
1042
1043
  subPlan: 1000,
1043
1044
  subPlanName: 'My Day ones',
@@ -1051,6 +1052,7 @@ exports.LumiaAlertConfigs = {
1051
1052
  avatar: 'https://static-cdn.jtvnw.net/jtv_user_pictures/2b1fa336-f9b2-42cf-bd2c-98675da74982-profile_image-70x70.png',
1052
1053
  message: 'Great Stream',
1053
1054
  subMonths: 2,
1055
+ streakMonths: 2,
1054
1056
  tier: 'Tier 2',
1055
1057
  subPlan: 2000,
1056
1058
  subPlanName: 'My Day dos',
@@ -1064,6 +1066,7 @@ exports.LumiaAlertConfigs = {
1064
1066
  avatar: 'https://static-cdn.jtvnw.net/jtv_user_pictures/2b1fa336-f9b2-42cf-bd2c-98675da74982-profile_image-70x70.png',
1065
1067
  message: 'Great Stream',
1066
1068
  subMonths: 3,
1069
+ streakMonths: 3,
1067
1070
  tier: 'Tier 3',
1068
1071
  subPlan: 3000,
1069
1072
  subPlanName: 'My Day tres',
@@ -1077,6 +1080,7 @@ exports.LumiaAlertConfigs = {
1077
1080
  avatar: 'https://static-cdn.jtvnw.net/jtv_user_pictures/2b1fa336-f9b2-42cf-bd2c-98675da74982-profile_image-70x70.png',
1078
1081
  message: 'Great Stream',
1079
1082
  subMonths: 1,
1083
+ streakMonths: 1,
1080
1084
  tier: 'Prime',
1081
1085
  subPlan: 'Prime',
1082
1086
  subPlanName: 'Optimus Prime',
@@ -1113,6 +1117,14 @@ exports.LumiaAlertConfigs = {
1113
1117
  required: false,
1114
1118
  default: 1,
1115
1119
  },
1120
+ {
1121
+ type: 'number',
1122
+ label: 'Streak months subscribed',
1123
+ dynamicField: 'streakMonths',
1124
+ variableField: 'streakMonths',
1125
+ required: false,
1126
+ default: 1,
1127
+ },
1116
1128
  {
1117
1129
  type: 'selection',
1118
1130
  label: 'Sub Plan',
@@ -4864,11 +4876,7 @@ exports.LumiaAlertConfigs = {
4864
4876
  default: 'lumiastream',
4865
4877
  },
4866
4878
  ],
4867
- LumiaVariationConditions: [
4868
- { type: LumiaVariationConditions.RANDOM },
4869
- { type: LumiaVariationConditions.EQUAL_USERNAME },
4870
- { type: LumiaVariationConditions.EQUAL_VARIABLE },
4871
- ],
4879
+ LumiaVariationConditions: [{ type: LumiaVariationConditions.RANDOM }, { type: LumiaVariationConditions.EQUAL_USERNAME }, { type: LumiaVariationConditions.EQUAL_VARIABLE }],
4872
4880
  },
4873
4881
  [activity_types_1.LumiaAlertValues.TIKTOK_SHARE]: {
4874
4882
  connection: event_types_1.LumiaIntegrations.TIKTOK,
@@ -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',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumiastream/lumia-types",
3
- "version": "3.2.4",
3
+ "version": "3.2.6",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "files": [