@allior/wmake-streamelements-events 2.0.4 → 3.1.0

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 (42) hide show
  1. package/README.md +110 -86
  2. package/dist/react/hooks/factory.d.ts +31 -0
  3. package/dist/react/hooks/factory.d.ts.map +1 -0
  4. package/dist/react/hooks/use-on-event-received.d.ts +85 -13
  5. package/dist/react/hooks/use-on-event-received.d.ts.map +1 -1
  6. package/dist/react/index.iife.js +1 -1
  7. package/dist/react/index.iife.js.map +1 -1
  8. package/dist/react/index.js +49 -10
  9. package/dist/react/index.js.map +1 -1
  10. package/dist/root/{aggregate.d.ts → aggregator/index.d.ts} +5 -3
  11. package/dist/root/aggregator/index.d.ts.map +1 -0
  12. package/dist/root/aggregator/types.d.ts +14 -0
  13. package/dist/root/aggregator/types.d.ts.map +1 -0
  14. package/dist/root/classifier.d.ts.map +1 -1
  15. package/dist/root/guards/on-event-received.d.ts +2 -3
  16. package/dist/root/guards/on-event-received.d.ts.map +1 -1
  17. package/dist/root/index.d.ts +1 -1
  18. package/dist/root/index.d.ts.map +1 -1
  19. package/dist/root/index.iife.js +1 -1
  20. package/dist/root/index.iife.js.map +1 -1
  21. package/dist/root/index.js +2 -2
  22. package/dist/root/types/on-event-received/base.d.ts +0 -13
  23. package/dist/root/types/on-event-received/base.d.ts.map +1 -1
  24. package/dist/root/types/on-event-received/button.d.ts +10 -0
  25. package/dist/root/types/on-event-received/button.d.ts.map +1 -0
  26. package/dist/root/types/on-event-received/index.d.ts +8 -8
  27. package/dist/root/types/on-event-received/index.d.ts.map +1 -1
  28. package/dist/root/types/on-event-received/moderation.d.ts +9 -1
  29. package/dist/root/types/on-event-received/moderation.d.ts.map +1 -1
  30. package/dist/root/types/on-event-received/subscriber.d.ts +2 -2
  31. package/dist/root/types/on-event-received/subscriber.d.ts.map +1 -1
  32. package/dist/root/types/on-event-received/unknown.d.ts +6 -0
  33. package/dist/root/types/on-event-received/unknown.d.ts.map +1 -0
  34. package/dist/{root-BzhLLMHq.js → root-DJod-F4M.js} +31 -47
  35. package/dist/root-DJod-F4M.js.map +1 -0
  36. package/package.json +1 -1
  37. package/dist/root/aggregate.d.ts.map +0 -1
  38. package/dist/root/types/on-event-received/donation.d.ts +0 -25
  39. package/dist/root/types/on-event-received/donation.d.ts.map +0 -1
  40. package/dist/root/types/on-event-received/other.d.ts +0 -10
  41. package/dist/root/types/on-event-received/other.d.ts.map +0 -1
  42. package/dist/root-BzhLLMHq.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, d as n, f as r, i, l as a, m as o, n as s, o as c, p as l, r as u, s as d, t as f, u as p } from "../root-BzhLLMHq.js";
2
- export { f as AlertQueue, s as TwitchUserMessageData, u as UserRole, r as classifyEvent, l as getCacheKey, i as getTestAlertKey, e as getTestMessageKey, n as normalizeIncomingEvent, o as parseTier, c as testAlert, a as testAlerts, d as testMessage, t as testMessages, p as testOnWidgetLoadDetail };
1
+ import { a as e, c as t, d as n, f as r, i, l as a, m as o, n as s, o as c, p as l, r as u, s as d, t as f, u as p } from "../root-DJod-F4M.js";
2
+ export { f as AlertQueue, s as TwitchUserMessageData, u as UserRole, n as aggregateIncomingEvent, r as classifyEvent, l as getCacheKey, i as getTestAlertKey, e as getTestMessageKey, o as parseTier, c as testAlert, a as testAlerts, d as testMessage, t as testMessages, p as testOnWidgetLoadDetail };
@@ -42,17 +42,4 @@ export interface ClassifiedTieredBase extends ClassifiedBase {
42
42
  tier: number;
43
43
  tierText: string;
44
44
  }
45
- export interface CacheLike {
46
- _has(key: string): boolean;
47
- _set(key: string, value: boolean): void;
48
- }
49
- export interface CacheSubsByType {
50
- _has?(key: string): boolean;
51
- _set?(key: string, value: boolean): void;
52
- [type: string]: CacheLike | ((k: string) => boolean) | ((k: string, v: boolean) => void) | undefined;
53
- }
54
- export interface NormalizerOptions {
55
- cacheSubs?: CacheSubsByType;
56
- broadcasterLogin?: string;
57
- }
58
45
  //# sourceMappingURL=base.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/root/types/on-event-received/base.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,MAAM,EAAE,CAAC,GAAG,OAAO;IACnD,QAAQ,EAAE,CAAC,CAAC;IACZ,KAAK,EAAE,CAAC,CAAC;CACT;AAED,MAAM,WAAW,YAChB,SAAQ,OAAO,CACd,WAAW,CACV,MAAM,EACN;IACC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACvB,CACD,CACD;CAAG;AAEL,MAAM,WAAW,cAAc;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE;QACP,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QACvB,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACvB,CAAC;CACF;AAED,MAAM,WA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BAA0B,GAC1B,gBAAgB,GAChB,UAAU,GACV,qBAAqB,GACrB,aAAa,GACb,QAAQ,GACR,gBAAgB,GAChB,iBAAiB,GACjB,QAAQ,GACR,SAAS,GACT,2BAA2B,GAC3B,sBAAsB,GACtB,sBAAsB,GACtB,mBAAmB,GACnB,YAAY,GACZ,OAAO,GACP,MAAM,GACN,UAAU,GACV,MAAM,CAAC;AAEV,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,cAAc,CAAC;CACrB;AAED,MAAM,WAAW,oBAAqB,SAAQ,cAAc;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CACjB"}
@@ -0,0 +1,10 @@
1
+ import type { ClassifiedBase, EventDetail } from "./base";
2
+ export type TestButtonDetail = EventDetail<"event:test", {
3
+ listener: "widget-button";
4
+ field: string;
5
+ }>;
6
+ export interface ClassifiedButtonClick<T = string> extends ClassifiedBase {
7
+ type: "button";
8
+ field: T;
9
+ }
10
+ //# sourceMappingURL=button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../src/root/types/on-event-received/button.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAE1D,MAAM,MAAM,gBAAgB,GAAG,WAAW,CACzC,YAAY,EACZ;IACC,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;CACd,CACD,CAAC;AAEF,MAAM,WAAW,qBAAqB,CAAC,CAAC,GAAG,MAAM,CAAE,SAAQ,cAAc;IACxE,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,CAAC,CAAC;CACT"}
@@ -1,25 +1,25 @@
1
1
  export * from "./base";
2
+ export * from "./button";
2
3
  export * from "./cheer";
3
- export * from "./donation";
4
4
  export * from "./follower";
5
5
  export * from "./message";
6
6
  export * from "./moderation";
7
- export * from "./other";
8
7
  export * from "./raid";
9
8
  export * from "./subscriber";
9
+ export * from "./unknown";
10
10
  import type { CheerDetail } from "./cheer";
11
- import type { DonationDetail } from "./donation";
12
11
  import type { FollowerDetail } from "./follower";
13
12
  import type { TwitchMessageDetail } from "./message";
14
13
  import type { DeleteMessageDetail, DeleteMessagesDetail } from "./moderation";
15
14
  import type { RaidDetail } from "./raid";
16
15
  import type { CommunityGiftPurchaseDetail, SubscriberDetail, SubscriberLatestDetail } from "./subscriber";
17
- export type AlertDetail = FollowerDetail | SubscriberLatestDetail | CommunityGiftPurchaseDetail | SubscriberDetail | CheerDetail | RaidDetail | DonationDetail | DeleteMessageDetail | DeleteMessagesDetail | TwitchMessageDetail;
16
+ export type AlertDetail = FollowerDetail | SubscriberLatestDetail | CommunityGiftPurchaseDetail | SubscriberDetail | CheerDetail | RaidDetail | DeleteMessageDetail | DeleteMessagesDetail | TwitchMessageDetail;
17
+ import type { ClassifiedButtonClick } from "./button";
18
18
  import type { ClassifiedCheer } from "./cheer";
19
- import type { ClassifiedDonation } from "./donation";
20
19
  import type { ClassifiedFollower } from "./follower";
21
- import type { ClassifiedUnknown } from "./other";
20
+ import type { ClassifiedDeleteMessage, ClassifiedDeleteMessages } from "./moderation";
22
21
  import type { ClassifiedRaid } from "./raid";
23
- import type { ClassifiedCommunityGiftPurchase, ClassifiedRecipient, ClassifiedSelfSub, ClassifiedSoloSub, ClassifiedSubRenewal } from "./subscriber";
24
- export type ClassifiedEvent = ClassifiedCommunityGiftPurchase | ClassifiedRecipient | ClassifiedSoloSub | ClassifiedSubRenewal | ClassifiedSelfSub | ClassifiedFollower | ClassifiedCheer | ClassifiedRaid | ClassifiedDonation | ClassifiedUnknown;
22
+ import type { AggregatedCommunityGift, AggregatedRecipient, ClassifiedSelfSub, ClassifiedSoloSub, ClassifiedSubRenewal } from "./subscriber";
23
+ import type { ClassifiedUnknown } from "./unknown";
24
+ export type ClassifiedEvent = AggregatedCommunityGift | AggregatedRecipient | ClassifiedSoloSub | ClassifiedSubRenewal | ClassifiedSelfSub | ClassifiedFollower | ClassifiedCheer | ClassifiedRaid | ClassifiedDeleteMessage | ClassifiedDeleteMessages | ClassifiedButtonClick | ClassifiedUnknown;
25
25
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/root/types/on-event-received/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAE7B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,KAAK,EACX,2BAA2B,EAC3B,gBAAgB,EAChB,sBAAsB,EACtB,MAAM,cAAc,CAAC;AAEtB,MAAM,MAAM,WAAW,GACpB,cAAc,GACd,sBAAsB,GACtB,2BAA2B,GAC3B,gBAAgB,GAChB,WAAW,GACX,UAAU,GACV,cAAc,GACd,mBAAmB,GACnB,oBAAoB,GACpB,mBAAmB,CAAC;AAEvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,KAAK,EACX,+BAA+B,EAC/B,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,MAAM,cAAc,CAAC;AAEtB,MAAM,MAAM,eAAe,GACxB,+BAA+B,GAC/B,mBAAmB,GACnB,iBAAiB,GACjB,oBAAoB,GACpB,iBAAiB,GACjB,kBAAkB,GAClB,eAAe,GACf,cAAc,GACd,kBAAkB,GAClB,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/root/types/on-event-received/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAE1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,KAAK,EACX,2BAA2B,EAC3B,gBAAgB,EAChB,sBAAsB,EACtB,MAAM,cAAc,CAAC;AAEtB,MAAM,MAAM,WAAW,GACpB,cAAc,GACd,sBAAsB,GACtB,2BAA2B,GAC3B,gBAAgB,GAChB,WAAW,GACX,UAAU,GACV,mBAAmB,GACnB,oBAAoB,GACpB,mBAAmB,CAAC;AAEvB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,KAAK,EACX,uBAAuB,EACvB,wBAAwB,EACxB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,KAAK,EACX,uBAAuB,EACvB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnD,MAAM,MAAM,eAAe,GACxB,uBAAuB,GACvB,mBAAmB,GACnB,iBAAiB,GACjB,oBAAoB,GACpB,iBAAiB,GACjB,kBAAkB,GAClB,eAAe,GACf,cAAc,GACd,uBAAuB,GACvB,wBAAwB,GACxB,qBAAqB,GACrB,iBAAiB,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { EventDetail } from "./base";
1
+ import type { ClassifiedBase, EventDetail } from "./base";
2
2
  export interface DeleteMessageDetail extends EventDetail<"delete-message", {
3
3
  msgId: string;
4
4
  }> {
@@ -7,4 +7,12 @@ export interface DeleteMessagesDetail extends EventDetail<"delete-messages", {
7
7
  userId: string;
8
8
  }> {
9
9
  }
10
+ export interface ClassifiedDeleteMessage extends ClassifiedBase {
11
+ type: "delete-message";
12
+ messageId: string;
13
+ }
14
+ export interface ClassifiedDeleteMessages extends ClassifiedBase {
15
+ type: "delete-messages";
16
+ userName: string;
17
+ }
10
18
  //# sourceMappingURL=moderation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"moderation.d.ts","sourceRoot":"","sources":["../../../../src/root/types/on-event-received/moderation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAE1C,MAAM,WAAW,mBAChB,SAAQ,WAAW,CAAC,gBAAgB,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;CAAG;AAE5D,MAAM,WAAW,oBAChB,SAAQ,WAAW,CAAC,iBAAiB,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;CAAG"}
1
+ {"version":3,"file":"moderation.d.ts","sourceRoot":"","sources":["../../../../src/root/types/on-event-received/moderation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAE1D,MAAM,WAAW,mBAChB,SAAQ,WAAW,CAAC,gBAAgB,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;CAAG;AAE5D,MAAM,WAAW,oBAChB,SAAQ,WAAW,CAAC,iBAAiB,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;CAAG;AAE9D,MAAM,WAAW,uBAAwB,SAAQ,cAAc;IAC9D,IAAI,EAAE,gBAAgB,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,wBAAyB,SAAQ,cAAc;IAC/D,IAAI,EAAE,iBAAiB,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;CACjB"}
@@ -37,14 +37,14 @@ export interface CommunityGiftPurchaseDetail extends EventDetail<"event", {
37
37
  activityId: string;
38
38
  }> {
39
39
  }
40
- export interface ClassifiedCommunityGiftPurchase extends ClassifiedTieredBase {
40
+ export interface AggregatedCommunityGift extends ClassifiedTieredBase {
41
41
  type: "community-gift" | "community-gift-anonymous";
42
42
  totalAmount: number;
43
43
  recipients: string[];
44
44
  sender?: string;
45
45
  anonymousDisplayName?: string;
46
46
  }
47
- export interface ClassifiedRecipient extends ClassifiedTieredBase {
47
+ export interface AggregatedRecipient extends ClassifiedTieredBase {
48
48
  _role: "recipient";
49
49
  activityGroup: string;
50
50
  recipient: string;
@@ -1 +1 @@
1
- {"version":3,"file":"subscriber.d.ts","sourceRoot":"","sources":["../../../../src/root/types/on-event-received/subscriber.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAEhE,MAAM,WAAW,sBAChB,SAAQ,WAAW,CAAC,mBAAmB,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;CAAG;AAE9E,MAAM,WAAW,gBAChB,SAAQ,WAAW,CAClB,OAAO,EACP;IACC,IAAI,EAAE,YAAY,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE;QACL,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;CACnB,CACD;CAAG;AAEL,MAAM,WAAW,2BAChB,SAAQ,WAAW,CAClB,OAAO,EACP;IACC,IAAI,EAAE,uBAAuB,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE;QACL,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;CACnB,CACD;CAAG;AAEL,MAAM,WA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AE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,oBAAqB,SAAQ,oBAAoB;IACjE,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAkB,SAAQ,oBAAoB;IAC9D,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACb"}
@@ -0,0 +1,6 @@
1
+ import type { ClassifiedBase, IncomingDetail } from "./base";
2
+ export interface ClassifiedUnknown extends ClassifiedBase {
3
+ type: "unknown";
4
+ detail: IncomingDetail;
5
+ }
6
+ //# sourceMappingURL=unknown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unknown.d.ts","sourceRoot":"","sources":["../../../../src/root/types/on-event-received/unknown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAE7D,MAAM,WAAW,iBAAkB,SAAQ,cAAc;IACxD,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,EAAE,cAAc,CAAC;CACvB"}
@@ -155,25 +155,22 @@ function n(t) {
155
155
  viewers: e
156
156
  };
157
157
  }
158
- if (n === "donation") {
159
- let e = t.event?.data;
160
- return {
161
- type: "donation",
162
- amount: e?.amount_main ?? e?.amount ?? 0,
163
- currency: e?.currency,
164
- username: e?.username,
165
- message: e?.message,
166
- billingSystem: e?.billing_system,
167
- id: e?.id
168
- };
169
- }
170
- return {
158
+ return n === "delete-message" ? {
159
+ type: "delete-message",
160
+ messageId: r.msgId ?? ""
161
+ } : n === "delete-messages" ? {
162
+ type: "delete-messages",
163
+ userName: r.userId ?? ""
164
+ } : n === "event:test" && r.listener === "widget-button" ? {
165
+ type: "button",
166
+ field: r.field
167
+ } : {
171
168
  type: "unknown",
172
169
  detail: t
173
170
  };
174
171
  }
175
172
  //#endregion
176
- //#region src/root/aggregate.ts
173
+ //#region src/root/aggregator/index.ts
177
174
  var r = 2500, i = {}, a = {};
178
175
  function o(e, t) {
179
176
  if (!e) return null;
@@ -206,15 +203,15 @@ function c(e, t, n, r) {
206
203
  recipients: m
207
204
  }, t, n));
208
205
  }
209
- function l(e, s, l) {
210
- let u = s?.cacheSubs, d = s?.broadcasterLogin ?? "", f = n(e);
211
- if (!f) {
212
- l(null);
206
+ function l(e, o, s) {
207
+ let l = o?.cacheSubs, u = o?.broadcasterLogin ?? "", d = n(e);
208
+ if (!d) {
209
+ s(null);
213
210
  return;
214
211
  }
215
- let p = o(u, f.type), m = t(e), h = e.event ?? {}, g = h.data ?? h;
216
- if (f._role === "recipient") {
217
- let e = f, t = e.activityGroup ?? m;
212
+ let f = t(e), p = e.event ?? {}, m = p.data ?? p;
213
+ if (d._role === "recipient") {
214
+ let e = d, t = e.activityGroup ?? f;
218
215
  i[t] || (i[t] = {
219
216
  type: e.type,
220
217
  subscribers: [],
@@ -222,20 +219,20 @@ function l(e, s, l) {
222
219
  tierText: e.tierText,
223
220
  totalAmount: 0
224
221
  }), a[t] && clearTimeout(a[t]), a[t] = setTimeout(() => {
225
- c(t, u, l, d);
222
+ c(t, l, s, u);
226
223
  }, r), i[t].subscribers.push({
227
224
  recipient: e.recipient,
228
- username: g.username,
229
- name: g.displayName,
230
- sender: g.sender
225
+ username: m.username,
226
+ name: m.displayName,
227
+ sender: m.sender
231
228
  }), i[t].totalAmount === 0 && (i[t].totalAmount = 1);
232
229
  return;
233
230
  }
234
- if (f.type === "community-gift-anonymous" || f.type === "community-gift") {
235
- if (e.listener === "event" && h.type === "communityGiftPurchase") {
236
- let e = h.activityGroup ?? g?.activityGroup ?? m, t = f;
231
+ if (d.type === "community-gift-anonymous" || d.type === "community-gift") {
232
+ if (e.listener === "event" && p.type === "communityGiftPurchase") {
233
+ let e = p.activityGroup ?? m?.activityGroup ?? f, t = d;
237
234
  i[e] ? (i[e].purchase = t, i[e].tier = t.tier, i[e].tierText = t.tierText, i[e].totalAmount = t.totalAmount ?? i[e].totalAmount, i[e].sender = t.sender, a[e] && clearTimeout(a[e]), a[e] = setTimeout(() => {
238
- c(e, u, l, d);
235
+ c(e, l, s, u);
239
236
  }, r)) : (i[e] = {
240
237
  type: t.type,
241
238
  purchase: t,
@@ -245,33 +242,20 @@ function l(e, s, l) {
245
242
  totalAmount: Number(t.totalAmount) || 0,
246
243
  sender: t.sender
247
244
  }, a[e] = setTimeout(() => {
248
- c(e, u, l, d);
245
+ c(e, l, s, u);
249
246
  }, r));
250
247
  return;
251
248
  }
252
249
  if (e.listener === "subscriber-latest") {
253
- let e = f;
254
- if (f.type === "community-gift" && d && e.sender === d) {
255
- l(null);
250
+ let e = d;
251
+ if (d.type === "community-gift" && u && e.sender === u) {
252
+ s(null);
256
253
  return;
257
254
  }
258
255
  return;
259
256
  }
260
257
  return;
261
258
  }
262
- if (f.type === "self-sub" || f.type === "solo-sub-to-someone" || f.type === "sub-renewal") {
263
- if (p?._has(m)) {
264
- l(null);
265
- return;
266
- }
267
- p && p._set(m, !0);
268
- let e = f;
269
- if (f.type === "solo-sub-to-someone" && d && e.sender === d) {
270
- l(null);
271
- return;
272
- }
273
- l(f);
274
- }
275
259
  }
276
260
  //#endregion
277
261
  //#region src/root/sources/on-widget-load-detail.ts
@@ -2931,4 +2915,4 @@ var v = /* @__PURE__ */ function(e) {
2931
2915
  //#endregion
2932
2916
  export { g as a, f as c, l as d, n as f, _ as i, d as l, e as m, y as n, h as o, t as p, v as r, m as s, b as t, u };
2933
2917
 
2934
- //# sourceMappingURL=root-BzhLLMHq.js.map
2918
+ //# sourceMappingURL=root-DJod-F4M.js.map