@widy/sdk 1.0.15 → 1.0.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.
package/dist/enums.d.ts CHANGED
@@ -52,7 +52,9 @@ export declare enum AppEvent {
52
52
  TwitchRewardRedemptionAdd = "TwitchRewardRedemptionAdd",
53
53
  CreateDonationAccount = "CreateDonationAccount",
54
54
  WidgetViewStorage = "WidgetViewStorage",
55
- WidgetControlStorage = "WidgetControlStorage"
55
+ WidgetControlStorage = "WidgetControlStorage",
56
+ NsfwDetection = "NsfwDetection",
57
+ NsfwSettings = "NsfwSettings"
56
58
  }
57
59
  export declare enum StreamElementsEvent {
58
60
  Connect = "Connect",
@@ -129,7 +131,8 @@ export declare enum ServiceType {
129
131
  DonationAlerts = "DonationAlerts",
130
132
  StreamLabs = "StreamLabs",
131
133
  Donatello = "Donatello",
132
- Donatik = "Donatik"
134
+ Donatik = "Donatik",
135
+ DonatePay = "DonatePay"
133
136
  }
134
137
  export declare enum StreamElementsEventType {
135
138
  tip = "tip"
@@ -157,3 +160,10 @@ export declare enum Gender {
157
160
  Male = "Male",
158
161
  Female = "Edge"
159
162
  }
163
+ export declare enum NsfwLabel {
164
+ anus = "anus",
165
+ make_love = "make_love",
166
+ nipple = "nipple",
167
+ penis = "penis",
168
+ vagina = "vagina"
169
+ }
package/dist/enums.js CHANGED
@@ -56,6 +56,8 @@ export var AppEvent;
56
56
  AppEvent["CreateDonationAccount"] = "CreateDonationAccount";
57
57
  AppEvent["WidgetViewStorage"] = "WidgetViewStorage";
58
58
  AppEvent["WidgetControlStorage"] = "WidgetControlStorage";
59
+ AppEvent["NsfwDetection"] = "NsfwDetection";
60
+ AppEvent["NsfwSettings"] = "NsfwSettings";
59
61
  })(AppEvent || (AppEvent = {}));
60
62
  export var StreamElementsEvent;
61
63
  (function (StreamElementsEvent) {
@@ -142,6 +144,7 @@ export var ServiceType;
142
144
  ServiceType["StreamLabs"] = "StreamLabs";
143
145
  ServiceType["Donatello"] = "Donatello";
144
146
  ServiceType["Donatik"] = "Donatik";
147
+ ServiceType["DonatePay"] = "DonatePay";
145
148
  })(ServiceType || (ServiceType = {}));
146
149
  export var StreamElementsEventType;
147
150
  (function (StreamElementsEventType) {
@@ -175,3 +178,11 @@ export var Gender;
175
178
  Gender["Male"] = "Male";
176
179
  Gender["Female"] = "Edge";
177
180
  })(Gender || (Gender = {}));
181
+ export var NsfwLabel;
182
+ (function (NsfwLabel) {
183
+ NsfwLabel["anus"] = "anus";
184
+ NsfwLabel["make_love"] = "make_love";
185
+ NsfwLabel["nipple"] = "nipple";
186
+ NsfwLabel["penis"] = "penis";
187
+ NsfwLabel["vagina"] = "vagina";
188
+ })(NsfwLabel || (NsfwLabel = {}));
@@ -1,6 +1,7 @@
1
1
  import type { RsbuildPlugin } from "@rsbuild/core";
2
- export declare function rsBuildHotReloadPlugin({ port, delay, entryFilePath, }: {
2
+ export declare function rsBuildHotReloadPlugin({ port, delay, entryFilePath, isExtension, }: {
3
3
  port?: number;
4
4
  delay?: number;
5
5
  entryFilePath: string;
6
+ isExtension?: boolean;
6
7
  }): RsbuildPlugin;
@@ -1,5 +1,5 @@
1
1
  import { WebSocketServer } from "ws";
2
- export function rsBuildHotReloadPlugin({ port = 4777, delay = 400, entryFilePath, }) {
2
+ export function rsBuildHotReloadPlugin({ port = 4777, delay = 400, entryFilePath, isExtension = false, }) {
3
3
  const isWatch = process.argv.includes("--watch");
4
4
  return {
5
5
  name: "hot-reload-widget",
@@ -9,6 +9,9 @@ export function rsBuildHotReloadPlugin({ port = 4777, delay = 400, entryFilePath
9
9
  const ws = new WebSocketServer({ port });
10
10
  api.transform({}, ({ code, resourcePath }) => {
11
11
  if (resourcePath === entryFilePath) {
12
+ const runtimeReload = isExtension
13
+ ? "chrome.runtime.reload()"
14
+ : "window.location.reload()";
12
15
  const hotReloadSnippet = `
13
16
  (function() {
14
17
  function connect() {
@@ -16,7 +19,7 @@ export function rsBuildHotReloadPlugin({ port = 4777, delay = 400, entryFilePath
16
19
 
17
20
  ws.addEventListener('message', (event) => {
18
21
  if (event.data === 'hot-reload-widget') {
19
- setTimeout(() => window.location.reload(), ${delay});
22
+ setTimeout(() => ${runtimeReload}, ${delay});
20
23
  }
21
24
  });
22
25
 
package/dist/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { AlertVariationConditions, AppEvent, Currency, Gender, GoalProgressLayout, GoalTextPosition, GoalType, MediaType, MessageType, ServiceType, StreamElementsEventType, TtsType, ViewType, WidyNetwork } from "./enums";
1
+ import type { AlertVariationConditions, AppEvent, Currency, Gender, GoalProgressLayout, GoalTextPosition, GoalType, MediaType, MessageType, NsfwLabel, ServiceType, StreamElementsEventType, TtsType, ViewType, WidyNetwork } from "./enums";
2
2
  export interface IClientMessage {
3
3
  id: string;
4
4
  type: MessageType;
@@ -213,9 +213,12 @@ export interface IImportedLot {
213
213
  investors: [];
214
214
  }
215
215
  export interface IEventsService extends ISubscriptions {
216
+ connected: boolean;
216
217
  connect: () => void;
217
218
  disconnect: () => void;
218
219
  send: <T>(message: IEventMessage<T>) => void;
220
+ addStatusListener: (listener: (connected: boolean) => void) => void;
221
+ removeStatusListener: (listener: (connected: boolean) => void) => void;
219
222
  }
220
223
  export interface IGoal {
221
224
  id: string;
@@ -255,6 +258,9 @@ export interface IStreamElementsAuth {
255
258
  export interface IDonationAlertsAuth {
256
259
  token: string;
257
260
  }
261
+ export interface IDonatePayAuth {
262
+ access_token: string;
263
+ }
258
264
  export interface IStreamLabsAuth {
259
265
  jwt: string;
260
266
  }
@@ -400,3 +406,24 @@ export interface IManifest {
400
406
  scopes: string[];
401
407
  connect_src: string[];
402
408
  }
409
+ export interface IWindowInfo {
410
+ title: string;
411
+ id: number;
412
+ selected: boolean;
413
+ }
414
+ export interface INsfwSettings {
415
+ id: number;
416
+ labels_confidence: ILabelsConfidence;
417
+ blur_timeout_duration: number;
418
+ }
419
+ export interface ILabelsConfidence {
420
+ anus: number;
421
+ make_love: number;
422
+ nipple: number;
423
+ penis: number;
424
+ vagina: number;
425
+ }
426
+ export interface INsfwDetection {
427
+ label: NsfwLabel;
428
+ confidence: number;
429
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widy/sdk",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "description": "A TypeScript SDK for Widy widget integrations.",
5
5
  "license": "ISC",
6
6
  "author": "ik1s3v",