@vnejs/plugins.scenario.fastforward 0.1.11 → 0.1.13

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/index.d.ts CHANGED
@@ -1,3 +1 @@
1
- import "@vnejs/plugins.core.components.contract";
2
- import "@vnejs/plugins.core.media.contract";
3
1
  import "@vnejs/plugins.scenario.fastforward.contract";
package/dist/index.js CHANGED
@@ -1,5 +1,3 @@
1
- import "@vnejs/plugins.core.components.contract";
2
- import "@vnejs/plugins.core.media.contract";
3
1
  import "@vnejs/plugins.scenario.fastforward.contract";
4
2
  import { regPlugin } from "@vnejs/shared";
5
3
  import { CONSTANTS, PARAMS, PLUGIN_NAME, SETTINGS_KEYS, SUBSCRIBE_EVENTS } from "@vnejs/plugins.scenario.fastforward.contract";
@@ -1,6 +1,6 @@
1
- import { Module } from "@vnejs/module";
1
+ import { ModuleCore } from "@vnejs/module.core";
2
2
  import type { FastforwardPluginConstants, FastforwardPluginEvents, FastforwardPluginParams, FastforwardPluginSettings } from "../types.js";
3
- export declare class Fastforward extends Module<FastforwardPluginEvents, FastforwardPluginConstants, FastforwardPluginSettings, FastforwardPluginParams> {
3
+ export declare class Fastforward extends ModuleCore<FastforwardPluginEvents, FastforwardPluginConstants, FastforwardPluginSettings, FastforwardPluginParams> {
4
4
  name: string;
5
5
  emitStop: () => Promise<unknown[]> | undefined;
6
6
  emitFastforwardEmit: () => Promise<unknown[]> | undefined;
@@ -1,5 +1,5 @@
1
- import { Module } from "@vnejs/module";
2
- export class Fastforward extends Module {
1
+ import { ModuleCore } from "@vnejs/module.core";
2
+ export class Fastforward extends ModuleCore {
3
3
  name = "fastforward";
4
4
  emitStop = () => this.emit(this.EVENTS.FASTFORWARD.STOP);
5
5
  emitFastforwardEmit = () => this.emit(this.EVENTS.FASTFORWARD.EMIT);
@@ -1,10 +1,9 @@
1
- import "@vnejs/plugins.core.scenario.contract";
2
1
  import "@vnejs/plugins.text.contract";
3
- import { Module, type ModuleGlobalStateRegistry } from "@vnejs/module";
2
+ import { ModuleCore } from "@vnejs/module.core";
4
3
  import type { TextEmitPayload } from "@vnejs/plugins.text.contract";
5
4
  import type { ModuleGlobalStateFastforwardVisits } from "@vnejs/plugins.scenario.fastforward.contract";
6
5
  import type { FastforwardPluginConstants, FastforwardPluginEvents, FastforwardPluginParams, FastforwardPluginSettings } from "../types.js";
7
- export declare class FastforwardVisits extends Module<FastforwardPluginEvents, FastforwardPluginConstants, FastforwardPluginSettings, FastforwardPluginParams, ModuleGlobalStateFastforwardVisits> {
6
+ export declare class FastforwardVisits extends ModuleCore<FastforwardPluginEvents, FastforwardPluginConstants, FastforwardPluginSettings, FastforwardPluginParams, ModuleGlobalStateFastforwardVisits> {
8
7
  name: string;
9
8
  visits: Record<string, number>;
10
9
  subscribe: () => void;
@@ -15,7 +14,6 @@ export declare class FastforwardVisits extends Module<FastforwardPluginEvents, F
15
14
  source: string;
16
15
  }>;
17
16
  onClear: () => Promise<unknown[]> | undefined;
18
- onStateSet: (payload: ModuleGlobalStateRegistry) => Promise<void>;
19
17
  getHash: () => Promise<unknown> | undefined;
20
18
  getDefaultState: () => ModuleGlobalStateFastforwardVisits;
21
19
  }
@@ -1,7 +1,6 @@
1
- import "@vnejs/plugins.core.scenario.contract";
2
1
  import "@vnejs/plugins.text.contract";
3
- import { Module } from "@vnejs/module";
4
- export class FastforwardVisits extends Module {
2
+ import { ModuleCore } from "@vnejs/module.core";
3
+ export class FastforwardVisits extends ModuleCore {
5
4
  name = "fastforward.visits";
6
5
  visits = {};
7
6
  subscribe = () => {
@@ -9,7 +8,7 @@ export class FastforwardVisits extends Module {
9
8
  this.on(this.EVENTS.FASTFORWARD.CHECK, this.onVisitCheck);
10
9
  this.on(this.EVENTS.FASTFORWARD.CLEAR, this.onClear);
11
10
  this.on(this.EVENTS.STATE.CLEAR, this.setDefaultState);
12
- this.on(this.EVENTS.STATE.SET, this.onStateSet);
11
+ this.on(this.EVENTS.STATE.SET, this.onSetStateClone);
13
12
  };
14
13
  init = async () => {
15
14
  this.visits = (await this.emitOne(this.EVENTS.STORAGE.GET_ALL, { module: this.name }));
@@ -24,7 +23,6 @@ export class FastforwardVisits extends Module {
24
23
  };
25
24
  onVisitCheck = async () => ({ isAllowed: Boolean(this.visits[(await this.getHash())]), source: this.name });
26
25
  onClear = () => this.emit(this.EVENTS.STORAGE.RM_ALL, { module: this.name });
27
- onStateSet = async (payload) => this.setState((await this.emitOne(this.EVENTS.VENDORS.CLONE, this.getStateSlice(payload))));
28
26
  getHash = () => this.emitOne(this.EVENTS.VENDORS.HASH, this.state);
29
27
  getDefaultState = () => ({ text: "", label: "", speaker: "", meet: 0 });
30
28
  }
package/dist/types.d.ts CHANGED
@@ -1,13 +1,7 @@
1
- import type { VnePluginConstantsMapRegistry, VnePluginEventsMapRegistry, VnePluginParamsMapRegistry, VnePluginSettingsMapRegistry } from "@vnejs/shared";
2
- import type { PluginName as InteractPluginName, SubscribeEvents as InteractSubscribeEvents } from "@vnejs/plugins.core.interact.contract";
3
- import type { PluginName as SettingsPluginName, SubscribeEvents as SettingsSubscribeEvents } from "@vnejs/plugins.core.settings.contract";
4
- import type { PluginName as StatePluginName, SubscribeEvents as StateSubscribeEvents } from "@vnejs/plugins.core.state.contract";
5
- import type { PluginName as StoragePluginName, SubscribeEvents as StorageSubscribeEvents } from "@vnejs/plugins.core.storage.contract";
6
- import type { PluginName as SystemPluginName, SubscribeEvents as SystemSubscribeEvents } from "@vnejs/plugins.core.system.contract";
7
- import type { PluginName as VendorsPluginName, SubscribeEvents as VendorsSubscribeEvents } from "@vnejs/plugins.core.vendors.contract";
1
+ import type { ModuleCoreConstants, ModuleCoreEvents, ModuleCoreParams, ModuleCoreSettings } from "@vnejs/module.core";
8
2
  import type { PluginName as TextPluginName, SubscribeEvents as TextSubscribeEvents } from "@vnejs/plugins.text.contract";
9
3
  import type { Constants, Params, PluginName, SettingsKeys, SubscribeEvents } from "@vnejs/plugins.scenario.fastforward.contract";
10
- export type FastforwardPluginEvents = VnePluginEventsMapRegistry & Record<PluginName, SubscribeEvents> & Record<InteractPluginName, InteractSubscribeEvents> & Record<SettingsPluginName, SettingsSubscribeEvents> & Record<StatePluginName, StateSubscribeEvents> & Record<StoragePluginName, StorageSubscribeEvents> & Record<SystemPluginName, SystemSubscribeEvents> & Record<TextPluginName, TextSubscribeEvents> & Record<VendorsPluginName, VendorsSubscribeEvents>;
11
- export type FastforwardPluginConstants = VnePluginConstantsMapRegistry & Record<PluginName, Constants>;
12
- export type FastforwardPluginSettings = VnePluginSettingsMapRegistry & Record<PluginName, SettingsKeys>;
13
- export type FastforwardPluginParams = VnePluginParamsMapRegistry & Record<PluginName, Params>;
4
+ export type FastforwardPluginEvents = ModuleCoreEvents & Record<PluginName, SubscribeEvents> & Record<TextPluginName, TextSubscribeEvents>;
5
+ export type FastforwardPluginConstants = ModuleCoreConstants & Record<PluginName, Constants>;
6
+ export type FastforwardPluginSettings = ModuleCoreSettings & Record<PluginName, SettingsKeys>;
7
+ export type FastforwardPluginParams = ModuleCoreParams & Record<PluginName, Params>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/plugins.scenario.fastforward",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -33,17 +33,8 @@
33
33
  "@vnejs/plugins.scenario.fastforward.contract": "~0.1.0"
34
34
  },
35
35
  "peerDependencies": {
36
- "@vnejs/module": "~0.1.0",
36
+ "@vnejs/module.core": "~0.1.0",
37
37
  "@vnejs/shared": "~0.1.0",
38
- "@vnejs/plugins.core.components.contract": "~0.1.0",
39
- "@vnejs/plugins.core.media.contract": "~0.1.0",
40
- "@vnejs/plugins.core.interact.contract": "~0.1.0",
41
- "@vnejs/plugins.core.scenario.contract": "~0.1.0",
42
- "@vnejs/plugins.core.settings.contract": "~0.1.0",
43
- "@vnejs/plugins.core.state.contract": "~0.1.0",
44
- "@vnejs/plugins.core.storage.contract": "~0.1.0",
45
- "@vnejs/plugins.core.system.contract": "~0.1.0",
46
- "@vnejs/plugins.core.vendors.contract": "~0.1.0",
47
38
  "@vnejs/plugins.text.contract": "~0.1.0"
48
39
  },
49
40
  "devDependencies": {
package/src/index.ts CHANGED
@@ -1,5 +1,3 @@
1
- import "@vnejs/plugins.core.components.contract";
2
- import "@vnejs/plugins.core.media.contract";
3
1
 
4
2
  import "@vnejs/plugins.scenario.fastforward.contract";
5
3
 
@@ -1,10 +1,10 @@
1
- import { Module } from "@vnejs/module";
1
+ import { ModuleCore } from "@vnejs/module.core";
2
2
 
3
3
  import type { FastforwardChangedPayload, FastforwardCheckResult } from "@vnejs/plugins.scenario.fastforward.contract";
4
4
 
5
5
  import type { FastforwardPluginConstants, FastforwardPluginEvents, FastforwardPluginParams, FastforwardPluginSettings } from "../types.js";
6
6
 
7
- export class Fastforward extends Module<FastforwardPluginEvents, FastforwardPluginConstants, FastforwardPluginSettings, FastforwardPluginParams> {
7
+ export class Fastforward extends ModuleCore<FastforwardPluginEvents, FastforwardPluginConstants, FastforwardPluginSettings, FastforwardPluginParams> {
8
8
  name = "fastforward";
9
9
 
10
10
  emitStop = () => this.emit(this.EVENTS.FASTFORWARD.STOP);
@@ -1,13 +1,12 @@
1
- import "@vnejs/plugins.core.scenario.contract";
2
1
  import "@vnejs/plugins.text.contract";
3
2
 
4
- import { Module, type ModuleGlobalStateRegistry } from "@vnejs/module";
3
+ import { ModuleCore } from "@vnejs/module.core";
5
4
  import type { TextEmitPayload } from "@vnejs/plugins.text.contract";
6
5
  import type { FastforwardCheckResult, ModuleGlobalStateFastforwardVisits } from "@vnejs/plugins.scenario.fastforward.contract";
7
6
 
8
7
  import type { FastforwardPluginConstants, FastforwardPluginEvents, FastforwardPluginParams, FastforwardPluginSettings } from "../types.js";
9
8
 
10
- export class FastforwardVisits extends Module<
9
+ export class FastforwardVisits extends ModuleCore<
11
10
  FastforwardPluginEvents,
12
11
  FastforwardPluginConstants,
13
12
  FastforwardPluginSettings,
@@ -25,7 +24,7 @@ export class FastforwardVisits extends Module<
25
24
  this.on(this.EVENTS.FASTFORWARD.CLEAR, this.onClear);
26
25
 
27
26
  this.on(this.EVENTS.STATE.CLEAR, this.setDefaultState);
28
- this.on(this.EVENTS.STATE.SET, this.onStateSet);
27
+ this.on(this.EVENTS.STATE.SET, this.onSetStateClone);
29
28
  };
30
29
 
31
30
  init = async () => {
@@ -49,9 +48,6 @@ export class FastforwardVisits extends Module<
49
48
 
50
49
  onClear = () => this.emit(this.EVENTS.STORAGE.RM_ALL, { module: this.name });
51
50
 
52
- onStateSet = async (payload: ModuleGlobalStateRegistry) =>
53
- this.setState((await this.emitOne(this.EVENTS.VENDORS.CLONE, this.getStateSlice(payload))) as ModuleGlobalStateFastforwardVisits);
54
-
55
51
  getHash = () => this.emitOne(this.EVENTS.VENDORS.HASH, this.state);
56
52
 
57
53
  getDefaultState = (): ModuleGlobalStateFastforwardVisits => ({ text: "", label: "", speaker: "", meet: 0 });
package/src/types.ts CHANGED
@@ -1,25 +1,11 @@
1
- import type { VnePluginConstantsMapRegistry, VnePluginEventsMapRegistry, VnePluginParamsMapRegistry, VnePluginSettingsMapRegistry } from "@vnejs/shared";
2
- import type { PluginName as InteractPluginName, SubscribeEvents as InteractSubscribeEvents } from "@vnejs/plugins.core.interact.contract";
3
- import type { PluginName as SettingsPluginName, SubscribeEvents as SettingsSubscribeEvents } from "@vnejs/plugins.core.settings.contract";
4
- import type { PluginName as StatePluginName, SubscribeEvents as StateSubscribeEvents } from "@vnejs/plugins.core.state.contract";
5
- import type { PluginName as StoragePluginName, SubscribeEvents as StorageSubscribeEvents } from "@vnejs/plugins.core.storage.contract";
6
- import type { PluginName as SystemPluginName, SubscribeEvents as SystemSubscribeEvents } from "@vnejs/plugins.core.system.contract";
7
- import type { PluginName as VendorsPluginName, SubscribeEvents as VendorsSubscribeEvents } from "@vnejs/plugins.core.vendors.contract";
1
+ import type { ModuleCoreConstants, ModuleCoreEvents, ModuleCoreParams, ModuleCoreSettings } from "@vnejs/module.core";
8
2
  import type { PluginName as TextPluginName, SubscribeEvents as TextSubscribeEvents } from "@vnejs/plugins.text.contract";
9
3
  import type { Constants, Params, PluginName, SettingsKeys, SubscribeEvents } from "@vnejs/plugins.scenario.fastforward.contract";
10
4
 
11
- export type FastforwardPluginEvents = VnePluginEventsMapRegistry &
12
- Record<PluginName, SubscribeEvents> &
13
- Record<InteractPluginName, InteractSubscribeEvents> &
14
- Record<SettingsPluginName, SettingsSubscribeEvents> &
15
- Record<StatePluginName, StateSubscribeEvents> &
16
- Record<StoragePluginName, StorageSubscribeEvents> &
17
- Record<SystemPluginName, SystemSubscribeEvents> &
18
- Record<TextPluginName, TextSubscribeEvents> &
19
- Record<VendorsPluginName, VendorsSubscribeEvents>;
5
+ export type FastforwardPluginEvents = ModuleCoreEvents & Record<PluginName, SubscribeEvents> & Record<TextPluginName, TextSubscribeEvents>;
20
6
 
21
- export type FastforwardPluginConstants = VnePluginConstantsMapRegistry & Record<PluginName, Constants>;
7
+ export type FastforwardPluginConstants = ModuleCoreConstants & Record<PluginName, Constants>;
22
8
 
23
- export type FastforwardPluginSettings = VnePluginSettingsMapRegistry & Record<PluginName, SettingsKeys>;
9
+ export type FastforwardPluginSettings = ModuleCoreSettings & Record<PluginName, SettingsKeys>;
24
10
 
25
- export type FastforwardPluginParams = VnePluginParamsMapRegistry & Record<PluginName, Params>;
11
+ export type FastforwardPluginParams = ModuleCoreParams & Record<PluginName, Params>;