@xyo-network/sentinel-model 3.14.17 → 3.14.19

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.
@@ -45,7 +45,7 @@ var IsAttachableSentinelInstanceFactory = class extends IsObjectFactory2 {
45
45
  import { isPayloadOfSchemaType } from "@xyo-network/payload-model";
46
46
  var SentinelAutomationSchema = "network.xyo.automation";
47
47
  var SentinelIntervalAutomationSchema = "network.xyo.automation.interval";
48
- var SentinelEventAutomationSchema = "network.xyo.automation.event";
48
+ var SentinelModuleEventAutomationSchema = "network.xyo.automation.event.module";
49
49
  var isSentinelIntervalAutomation = isPayloadOfSchemaType(SentinelIntervalAutomationSchema);
50
50
 
51
51
  // src/Config.ts
@@ -54,8 +54,8 @@ export {
54
54
  IsAttachableSentinelInstanceFactory,
55
55
  SentinelAutomationSchema,
56
56
  SentinelConfigSchema,
57
- SentinelEventAutomationSchema,
58
57
  SentinelIntervalAutomationSchema,
58
+ SentinelModuleEventAutomationSchema,
59
59
  SentinelReportQuerySchema,
60
60
  asAttachableSentinelInstance,
61
61
  asSentinelInstance,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/attachable/asAttachableInstance.ts","../../src/attachable/isAttachableInstance.ts","../../src/typeChecks.ts","../../src/Queries/Report.ts","../../src/attachable/AttachableInstance.ts","../../src/Automation.ts","../../src/Config.ts"],"sourcesContent":["import { AsObjectFactory } from '@xylabs/object'\n\nimport { isAttachableSentinelInstance } from './isAttachableInstance.ts'\n\nexport const asAttachableSentinelInstance = AsObjectFactory.create(isAttachableSentinelInstance)\n","import type { TypeCheck } from '@xylabs/object'\nimport { IsObjectFactory } from '@xylabs/object'\nimport type { ObjectTypeShape } from '@xylabs/typeof'\nimport { isAttachableModuleInstance } from '@xyo-network/module-model'\n\nimport { isSentinelInstance } from '../typeChecks.ts'\nimport type { AttachableSentinelInstance } from './AttachableInstance.ts'\n\nexport const requiredAttachableSentinelInstanceFunctions: ObjectTypeShape = {}\n\n// we do not use IsInstanceFactory here to prevent a cycle\nconst factory = new IsObjectFactory<AttachableSentinelInstance>()\n\nexport const isAttachableSentinelInstance: TypeCheck<AttachableSentinelInstance> = factory.create(requiredAttachableSentinelInstanceFunctions, [\n isSentinelInstance,\n isAttachableModuleInstance,\n])\n","import { AsObjectFactory } from '@xylabs/object'\nimport {\n IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory,\n} from '@xyo-network/module-model'\n\nimport type { SentinelInstance } from './Instance.ts'\nimport type { SentinelModule } from './Module.ts'\nimport { SentinelReportQuerySchema } from './Queries/index.ts'\n\nexport const isSentinelInstance = new IsInstanceFactory<SentinelInstance>().create({ report: 'function' }, [isModuleInstance])\nexport const isSentinelModule = new IsModuleFactory<SentinelModule>().create([SentinelReportQuerySchema])\n\nexport const asSentinelModule = AsObjectFactory.create(isSentinelModule)\nexport const asSentinelInstance = AsObjectFactory.create(isSentinelInstance)\nexport const withSentinelModule = WithFactory.create(isSentinelModule)\nexport const withSentinelInstance = WithFactory.create(isSentinelInstance)\n","import type { Query } from '@xyo-network/payload-model'\n\nexport const SentinelReportQuerySchema = 'network.xyo.query.sentinel.report' as const\nexport type SentinelReportQuerySchema = typeof SentinelReportQuerySchema\n\nexport type SentinelReportQuery = Query<{\n schema: SentinelReportQuerySchema\n}>\n","import type { TypeCheck } from '@xylabs/object'\nimport { IsObjectFactory } from '@xylabs/object'\nimport type { AttachableModuleInstance } from '@xyo-network/module-model'\n\nimport type { SentinelModuleEventData } from '../EventData.ts'\nimport type { SentinelInstance } from '../Instance.ts'\nimport type { SentinelModule } from '../Module.ts'\nimport type { SentinelParams } from '../Params.ts'\n\nexport interface AttachableSentinelInstance<\n TParams extends SentinelParams = SentinelParams,\n TEventData extends SentinelModuleEventData = SentinelModuleEventData,\n> extends SentinelModule<TParams, TEventData>,\n AttachableModuleInstance<TParams, TEventData>,\n SentinelInstance<TParams, TEventData> {}\n\nexport type AttachableSentinelInstanceTypeCheck<T extends AttachableSentinelInstance = AttachableSentinelInstance> = TypeCheck<T>\n\nexport class IsAttachableSentinelInstanceFactory<T extends AttachableSentinelInstance = AttachableSentinelInstance> extends IsObjectFactory<T> {}\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const SentinelAutomationSchema = 'network.xyo.automation' as const\nexport type SentinelAutomationSchema = typeof SentinelAutomationSchema\n\nexport const SentinelIntervalAutomationSchema = 'network.xyo.automation.interval' as const\nexport type SentinelIntervalAutomationSchema = typeof SentinelIntervalAutomationSchema\n\nexport const SentinelEventAutomationSchema = 'network.xyo.automation.event' as const\nexport type SentinelEventAutomationSchema = typeof SentinelEventAutomationSchema\n\nexport type SentinelBaseAutomationPayload<T extends Payload> = Payload<\n {\n type?: 'interval' | 'event'\n } & T\n>\n\n/** Settings for an Interval Automation */\nexport type SentinelIntervalAutomationPayload = SentinelBaseAutomationPayload<{\n /** Epoch after which any reoccurrence stops */\n end?: number\n\n /** Time between triggers [non-repeating if undefined] */\n frequency?: number\n\n /** Units for frequency field [hour if undefined] */\n frequencyUnits?: 'second' | 'minute' | 'hour' | 'day' | 'millis'\n\n /** Remaining triggers [infinite if undefined] */\n remaining?: number\n\n schema: SentinelIntervalAutomationSchema\n\n /** Epoch of the next trigger */\n start: number\n\n /** The type of automation */\n type: 'interval'\n}>\n\nexport const isSentinelIntervalAutomation = isPayloadOfSchemaType<SentinelIntervalAutomationPayload>(SentinelIntervalAutomationSchema)\n\n/** Settings for an Event Automation */\nexport type SentinelEventAutomationPayload = SentinelBaseAutomationPayload<{\n schema: SentinelEventAutomationSchema\n type: 'event'\n}>\n\n/** Settings for an Automation */\nexport type SentinelAutomationPayload = Payload<\n SentinelIntervalAutomationPayload | SentinelEventAutomationPayload,\n SentinelAutomationSchema | SentinelIntervalAutomationSchema | SentinelEventAutomationSchema\n>\n","import type { WithAdditional } from '@xylabs/object'\nimport type { ModuleConfig } from '@xyo-network/module-model'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport type { SentinelAutomationPayload } from './Automation.ts'\nimport type { Task } from './Task.ts'\n\nexport const SentinelConfigSchema = 'network.xyo.sentinel.config' as const\nexport type SentinelConfigSchema = typeof SentinelConfigSchema\n\nexport type SentinelConfig<TConfig extends Payload | void = void, TSchema extends string | void = void> = ModuleConfig<\n WithAdditional<\n {\n automations?: SentinelAutomationPayload[]\n schema: TConfig extends Payload ? TConfig['schema'] : SentinelConfigSchema\n synchronous?: boolean\n tasks: Task[]\n throwErrors?: boolean\n },\n TConfig\n >,\n TSchema\n>\n"],"mappings":";AAAA,SAAS,mBAAAA,wBAAuB;;;ACChC,SAAS,uBAAuB;AAEhC,SAAS,kCAAkC;;;ACH3C,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EAAmB;AAAA,EAAiB;AAAA,EAAkB;AAAA,OACjD;;;ACDA,IAAM,4BAA4B;;;ADOlC,IAAM,qBAAqB,IAAI,kBAAoC,EAAE,OAAO,EAAE,QAAQ,WAAW,GAAG,CAAC,gBAAgB,CAAC;AACtH,IAAM,mBAAmB,IAAI,gBAAgC,EAAE,OAAO,CAAC,yBAAyB,CAAC;AAEjG,IAAM,mBAAmB,gBAAgB,OAAO,gBAAgB;AAChE,IAAM,qBAAqB,gBAAgB,OAAO,kBAAkB;AACpE,IAAM,qBAAqB,YAAY,OAAO,gBAAgB;AAC9D,IAAM,uBAAuB,YAAY,OAAO,kBAAkB;;;ADPlE,IAAM,8CAA+D,CAAC;AAG7E,IAAM,UAAU,IAAI,gBAA4C;AAEzD,IAAM,+BAAsE,QAAQ,OAAO,6CAA6C;AAAA,EAC7I;AAAA,EACA;AACF,CAAC;;;ADZM,IAAM,+BAA+BC,iBAAgB,OAAO,4BAA4B;;;AIH/F,SAAS,mBAAAC,wBAAuB;AAiBzB,IAAM,sCAAN,cAAqHA,iBAAmB;AAAC;;;ACjBhJ,SAAS,6BAA6B;AAE/B,IAAM,2BAA2B;AAGjC,IAAM,mCAAmC;AAGzC,IAAM,gCAAgC;AAgCtC,IAAM,+BAA+B,sBAAyD,gCAAgC;;;AClC9H,IAAM,uBAAuB;","names":["AsObjectFactory","AsObjectFactory","IsObjectFactory"]}
1
+ {"version":3,"sources":["../../src/attachable/asAttachableInstance.ts","../../src/attachable/isAttachableInstance.ts","../../src/typeChecks.ts","../../src/Queries/Report.ts","../../src/attachable/AttachableInstance.ts","../../src/Automation.ts","../../src/Config.ts"],"sourcesContent":["import { AsObjectFactory } from '@xylabs/object'\n\nimport { isAttachableSentinelInstance } from './isAttachableInstance.ts'\n\nexport const asAttachableSentinelInstance = AsObjectFactory.create(isAttachableSentinelInstance)\n","import type { TypeCheck } from '@xylabs/object'\nimport { IsObjectFactory } from '@xylabs/object'\nimport type { ObjectTypeShape } from '@xylabs/typeof'\nimport { isAttachableModuleInstance } from '@xyo-network/module-model'\n\nimport { isSentinelInstance } from '../typeChecks.ts'\nimport type { AttachableSentinelInstance } from './AttachableInstance.ts'\n\nexport const requiredAttachableSentinelInstanceFunctions: ObjectTypeShape = {}\n\n// we do not use IsInstanceFactory here to prevent a cycle\nconst factory = new IsObjectFactory<AttachableSentinelInstance>()\n\nexport const isAttachableSentinelInstance: TypeCheck<AttachableSentinelInstance> = factory.create(requiredAttachableSentinelInstanceFunctions, [\n isSentinelInstance,\n isAttachableModuleInstance,\n])\n","import { AsObjectFactory } from '@xylabs/object'\nimport {\n IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory,\n} from '@xyo-network/module-model'\n\nimport type { SentinelInstance } from './Instance.ts'\nimport type { SentinelModule } from './Module.ts'\nimport { SentinelReportQuerySchema } from './Queries/index.ts'\n\nexport const isSentinelInstance = new IsInstanceFactory<SentinelInstance>().create({ report: 'function' }, [isModuleInstance])\nexport const isSentinelModule = new IsModuleFactory<SentinelModule>().create([SentinelReportQuerySchema])\n\nexport const asSentinelModule = AsObjectFactory.create(isSentinelModule)\nexport const asSentinelInstance = AsObjectFactory.create(isSentinelInstance)\nexport const withSentinelModule = WithFactory.create(isSentinelModule)\nexport const withSentinelInstance = WithFactory.create(isSentinelInstance)\n","import type { Query } from '@xyo-network/payload-model'\n\nexport const SentinelReportQuerySchema = 'network.xyo.query.sentinel.report' as const\nexport type SentinelReportQuerySchema = typeof SentinelReportQuerySchema\n\nexport type SentinelReportQuery = Query<{\n schema: SentinelReportQuerySchema\n}>\n","import type { TypeCheck } from '@xylabs/object'\nimport { IsObjectFactory } from '@xylabs/object'\nimport type { AttachableModuleInstance } from '@xyo-network/module-model'\n\nimport type { SentinelModuleEventData } from '../EventData.ts'\nimport type { SentinelInstance } from '../Instance.ts'\nimport type { SentinelModule } from '../Module.ts'\nimport type { SentinelParams } from '../Params.ts'\n\nexport interface AttachableSentinelInstance<\n TParams extends SentinelParams = SentinelParams,\n TEventData extends SentinelModuleEventData = SentinelModuleEventData,\n> extends SentinelModule<TParams, TEventData>,\n AttachableModuleInstance<TParams, TEventData>,\n SentinelInstance<TParams, TEventData> {}\n\nexport type AttachableSentinelInstanceTypeCheck<T extends AttachableSentinelInstance = AttachableSentinelInstance> = TypeCheck<T>\n\nexport class IsAttachableSentinelInstanceFactory<T extends AttachableSentinelInstance = AttachableSentinelInstance> extends IsObjectFactory<T> {}\n","import type { EventName } from '@xyo-network/module-events'\nimport type { ModuleIdentifier } from '@xyo-network/module-model'\nimport type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nexport const SentinelAutomationSchema = 'network.xyo.automation' as const\nexport type SentinelAutomationSchema = typeof SentinelAutomationSchema\n\nexport const SentinelIntervalAutomationSchema = 'network.xyo.automation.interval' as const\nexport type SentinelIntervalAutomationSchema = typeof SentinelIntervalAutomationSchema\n\nexport const SentinelModuleEventAutomationSchema = 'network.xyo.automation.event.module' as const\nexport type SentinelModuleEventAutomationSchema = typeof SentinelModuleEventAutomationSchema\n\nexport type SentinelBaseAutomationPayload<T extends Payload> = Payload<\n {\n type?: 'interval' | 'event'\n } & T\n>\n\n/** Settings for an Interval Automation */\nexport type SentinelIntervalAutomationPayload = SentinelBaseAutomationPayload<{\n /** Epoch after which any reoccurrence stops */\n end?: number\n\n /** Time between triggers [non-repeating if undefined] */\n frequency?: number\n\n /** Units for frequency field [hour if undefined] */\n frequencyUnits?: 'second' | 'minute' | 'hour' | 'day' | 'millis'\n\n /** Remaining triggers [infinite if undefined] */\n remaining?: number\n\n schema: SentinelIntervalAutomationSchema\n\n /** Epoch of the next trigger */\n start: number\n\n /** The type of automation */\n type: 'interval'\n}>\n\nexport const isSentinelIntervalAutomation = isPayloadOfSchemaType<SentinelIntervalAutomationPayload>(SentinelIntervalAutomationSchema)\n\n/** Settings for an Module Event Automation */\nexport type SentinelModuleEventAutomationPayload = SentinelBaseAutomationPayload<{\n eventName: EventName\n schema: SentinelModuleEventAutomationSchema\n source: ModuleIdentifier\n type: 'event'\n}>\n\n/** Settings for an Automation */\nexport type SentinelAutomationPayload = Payload<\n SentinelIntervalAutomationPayload | SentinelModuleEventAutomationPayload,\n SentinelAutomationSchema | SentinelIntervalAutomationSchema | SentinelModuleEventAutomationSchema\n>\n","import type { WithAdditional } from '@xylabs/object'\nimport type { ModuleConfig } from '@xyo-network/module-model'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport type { SentinelAutomationPayload } from './Automation.ts'\nimport type { Task } from './Task.ts'\n\nexport const SentinelConfigSchema = 'network.xyo.sentinel.config' as const\nexport type SentinelConfigSchema = typeof SentinelConfigSchema\n\nexport type SentinelConfig<TConfig extends Payload | void = void, TSchema extends string | void = void> = ModuleConfig<\n WithAdditional<\n {\n automations?: SentinelAutomationPayload[]\n schema: TConfig extends Payload ? TConfig['schema'] : SentinelConfigSchema\n synchronous?: boolean\n tasks: Task[]\n throwErrors?: boolean\n },\n TConfig\n >,\n TSchema\n>\n"],"mappings":";AAAA,SAAS,mBAAAA,wBAAuB;;;ACChC,SAAS,uBAAuB;AAEhC,SAAS,kCAAkC;;;ACH3C,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EAAmB;AAAA,EAAiB;AAAA,EAAkB;AAAA,OACjD;;;ACDA,IAAM,4BAA4B;;;ADOlC,IAAM,qBAAqB,IAAI,kBAAoC,EAAE,OAAO,EAAE,QAAQ,WAAW,GAAG,CAAC,gBAAgB,CAAC;AACtH,IAAM,mBAAmB,IAAI,gBAAgC,EAAE,OAAO,CAAC,yBAAyB,CAAC;AAEjG,IAAM,mBAAmB,gBAAgB,OAAO,gBAAgB;AAChE,IAAM,qBAAqB,gBAAgB,OAAO,kBAAkB;AACpE,IAAM,qBAAqB,YAAY,OAAO,gBAAgB;AAC9D,IAAM,uBAAuB,YAAY,OAAO,kBAAkB;;;ADPlE,IAAM,8CAA+D,CAAC;AAG7E,IAAM,UAAU,IAAI,gBAA4C;AAEzD,IAAM,+BAAsE,QAAQ,OAAO,6CAA6C;AAAA,EAC7I;AAAA,EACA;AACF,CAAC;;;ADZM,IAAM,+BAA+BC,iBAAgB,OAAO,4BAA4B;;;AIH/F,SAAS,mBAAAC,wBAAuB;AAiBzB,IAAM,sCAAN,cAAqHA,iBAAmB;AAAC;;;ACfhJ,SAAS,6BAA6B;AAE/B,IAAM,2BAA2B;AAGjC,IAAM,mCAAmC;AAGzC,IAAM,sCAAsC;AAgC5C,IAAM,+BAA+B,sBAAyD,gCAAgC;;;ACpC9H,IAAM,uBAAuB;","names":["AsObjectFactory","AsObjectFactory","IsObjectFactory"]}
@@ -1,10 +1,12 @@
1
+ import type { EventName } from '@xyo-network/module-events';
2
+ import type { ModuleIdentifier } from '@xyo-network/module-model';
1
3
  import type { Payload } from '@xyo-network/payload-model';
2
4
  export declare const SentinelAutomationSchema: "network.xyo.automation";
3
5
  export type SentinelAutomationSchema = typeof SentinelAutomationSchema;
4
6
  export declare const SentinelIntervalAutomationSchema: "network.xyo.automation.interval";
5
7
  export type SentinelIntervalAutomationSchema = typeof SentinelIntervalAutomationSchema;
6
- export declare const SentinelEventAutomationSchema: "network.xyo.automation.event";
7
- export type SentinelEventAutomationSchema = typeof SentinelEventAutomationSchema;
8
+ export declare const SentinelModuleEventAutomationSchema: "network.xyo.automation.event.module";
9
+ export type SentinelModuleEventAutomationSchema = typeof SentinelModuleEventAutomationSchema;
8
10
  export type SentinelBaseAutomationPayload<T extends Payload> = Payload<{
9
11
  type?: 'interval' | 'event';
10
12
  } & T>;
@@ -25,11 +27,13 @@ export type SentinelIntervalAutomationPayload = SentinelBaseAutomationPayload<{
25
27
  type: 'interval';
26
28
  }>;
27
29
  export declare const isSentinelIntervalAutomation: (x?: unknown | null) => x is SentinelIntervalAutomationPayload;
28
- /** Settings for an Event Automation */
29
- export type SentinelEventAutomationPayload = SentinelBaseAutomationPayload<{
30
- schema: SentinelEventAutomationSchema;
30
+ /** Settings for an Module Event Automation */
31
+ export type SentinelModuleEventAutomationPayload = SentinelBaseAutomationPayload<{
32
+ eventName: EventName;
33
+ schema: SentinelModuleEventAutomationSchema;
34
+ source: ModuleIdentifier;
31
35
  type: 'event';
32
36
  }>;
33
37
  /** Settings for an Automation */
34
- export type SentinelAutomationPayload = Payload<SentinelIntervalAutomationPayload | SentinelEventAutomationPayload, SentinelAutomationSchema | SentinelIntervalAutomationSchema | SentinelEventAutomationSchema>;
38
+ export type SentinelAutomationPayload = Payload<SentinelIntervalAutomationPayload | SentinelModuleEventAutomationPayload, SentinelAutomationSchema | SentinelIntervalAutomationSchema | SentinelModuleEventAutomationSchema>;
35
39
  //# sourceMappingURL=Automation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Automation.d.ts","sourceRoot":"","sources":["../../src/Automation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAGzD,eAAO,MAAM,wBAAwB,EAAG,wBAAiC,CAAA;AACzE,MAAM,MAAM,wBAAwB,GAAG,OAAO,wBAAwB,CAAA;AAEtE,eAAO,MAAM,gCAAgC,EAAG,iCAA0C,CAAA;AAC1F,MAAM,MAAM,gCAAgC,GAAG,OAAO,gCAAgC,CAAA;AA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AAM,yBAAyB,GAAG,OAAO,CAC7C,iCAAiC,GAAG,oCAAoC,EACxE,wBAAwB,GAAG,gCAAgC,GAAG,mCAAmC,CAClG,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/sentinel-model",
3
- "version": "3.14.17",
3
+ "version": "3.14.19",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -29,23 +29,22 @@
29
29
  "module": "dist/neutral/index.mjs",
30
30
  "types": "dist/types/index.d.ts",
31
31
  "dependencies": {
32
- "@xylabs/hex": "^4.9.3",
33
- "@xylabs/object": "^4.9.3",
34
- "@xylabs/promise": "^4.9.3",
35
- "@xylabs/typeof": "^4.9.3",
36
- "@xyo-network/account-model": "^3.14.17",
37
- "@xyo-network/archivist-model": "^3.14.17",
38
- "@xyo-network/boundwitness-model": "^3.14.17",
39
- "@xyo-network/diviner-model": "^3.14.17",
40
- "@xyo-network/module-events": "^3.14.17",
41
- "@xyo-network/module-model": "^3.14.17",
42
- "@xyo-network/payload-model": "^3.14.17",
43
- "@xyo-network/witness-model": "^3.14.17"
32
+ "@xylabs/hex": "^4.9.4",
33
+ "@xylabs/object": "^4.9.4",
34
+ "@xylabs/promise": "^4.9.4",
35
+ "@xylabs/typeof": "^4.9.4",
36
+ "@xyo-network/account-model": "^3.14.19",
37
+ "@xyo-network/archivist-model": "^3.14.19",
38
+ "@xyo-network/boundwitness-model": "^3.14.19",
39
+ "@xyo-network/diviner-model": "^3.14.19",
40
+ "@xyo-network/module-events": "^3.14.19",
41
+ "@xyo-network/module-model": "^3.14.19",
42
+ "@xyo-network/payload-model": "^3.14.19",
43
+ "@xyo-network/witness-model": "^3.14.19"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@xylabs/ts-scripts-yarn3": "^6.5.5",
47
47
  "@xylabs/tsconfig": "^6.5.5",
48
- "knip": "^5.54.1",
49
48
  "typescript": "^5.8.3"
50
49
  },
51
50
  "publishConfig": {
package/src/Automation.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import type { EventName } from '@xyo-network/module-events'
2
+ import type { ModuleIdentifier } from '@xyo-network/module-model'
1
3
  import type { Payload } from '@xyo-network/payload-model'
2
4
  import { isPayloadOfSchemaType } from '@xyo-network/payload-model'
3
5
 
@@ -7,8 +9,8 @@ export type SentinelAutomationSchema = typeof SentinelAutomationSchema
7
9
  export const SentinelIntervalAutomationSchema = 'network.xyo.automation.interval' as const
8
10
  export type SentinelIntervalAutomationSchema = typeof SentinelIntervalAutomationSchema
9
11
 
10
- export const SentinelEventAutomationSchema = 'network.xyo.automation.event' as const
11
- export type SentinelEventAutomationSchema = typeof SentinelEventAutomationSchema
12
+ export const SentinelModuleEventAutomationSchema = 'network.xyo.automation.event.module' as const
13
+ export type SentinelModuleEventAutomationSchema = typeof SentinelModuleEventAutomationSchema
12
14
 
13
15
  export type SentinelBaseAutomationPayload<T extends Payload> = Payload<
14
16
  {
@@ -41,14 +43,16 @@ export type SentinelIntervalAutomationPayload = SentinelBaseAutomationPayload<{
41
43
 
42
44
  export const isSentinelIntervalAutomation = isPayloadOfSchemaType<SentinelIntervalAutomationPayload>(SentinelIntervalAutomationSchema)
43
45
 
44
- /** Settings for an Event Automation */
45
- export type SentinelEventAutomationPayload = SentinelBaseAutomationPayload<{
46
- schema: SentinelEventAutomationSchema
46
+ /** Settings for an Module Event Automation */
47
+ export type SentinelModuleEventAutomationPayload = SentinelBaseAutomationPayload<{
48
+ eventName: EventName
49
+ schema: SentinelModuleEventAutomationSchema
50
+ source: ModuleIdentifier
47
51
  type: 'event'
48
52
  }>
49
53
 
50
54
  /** Settings for an Automation */
51
55
  export type SentinelAutomationPayload = Payload<
52
- SentinelIntervalAutomationPayload | SentinelEventAutomationPayload,
53
- SentinelAutomationSchema | SentinelIntervalAutomationSchema | SentinelEventAutomationSchema
56
+ SentinelIntervalAutomationPayload | SentinelModuleEventAutomationPayload,
57
+ SentinelAutomationSchema | SentinelIntervalAutomationSchema | SentinelModuleEventAutomationSchema
54
58
  >