@xyo-network/sentinel-model 2.84.7 → 2.84.8

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 (48) hide show
  1. package/dist/browser/Automation.d.cts +67 -0
  2. package/dist/browser/Automation.d.cts.map +1 -0
  3. package/dist/browser/Automation.d.mts +67 -0
  4. package/dist/browser/Automation.d.mts.map +1 -0
  5. package/dist/browser/Automation.d.ts +67 -0
  6. package/dist/browser/Automation.d.ts.map +1 -0
  7. package/dist/browser/Config.d.cts +2 -0
  8. package/dist/browser/Config.d.cts.map +1 -1
  9. package/dist/browser/Config.d.mts +2 -0
  10. package/dist/browser/Config.d.mts.map +1 -1
  11. package/dist/browser/Config.d.ts +2 -0
  12. package/dist/browser/Config.d.ts.map +1 -1
  13. package/dist/browser/index.cjs +11 -0
  14. package/dist/browser/index.cjs.map +1 -1
  15. package/dist/browser/index.d.cts +1 -0
  16. package/dist/browser/index.d.cts.map +1 -1
  17. package/dist/browser/index.d.mts +1 -0
  18. package/dist/browser/index.d.mts.map +1 -1
  19. package/dist/browser/index.d.ts +1 -0
  20. package/dist/browser/index.d.ts.map +1 -1
  21. package/dist/browser/index.js +11 -0
  22. package/dist/browser/index.js.map +1 -1
  23. package/dist/node/Automation.d.cts +67 -0
  24. package/dist/node/Automation.d.cts.map +1 -0
  25. package/dist/node/Automation.d.mts +67 -0
  26. package/dist/node/Automation.d.mts.map +1 -0
  27. package/dist/node/Automation.d.ts +67 -0
  28. package/dist/node/Automation.d.ts.map +1 -0
  29. package/dist/node/Config.d.cts +2 -0
  30. package/dist/node/Config.d.cts.map +1 -1
  31. package/dist/node/Config.d.mts +2 -0
  32. package/dist/node/Config.d.mts.map +1 -1
  33. package/dist/node/Config.d.ts +2 -0
  34. package/dist/node/Config.d.ts.map +1 -1
  35. package/dist/node/index.cjs +15 -0
  36. package/dist/node/index.cjs.map +1 -1
  37. package/dist/node/index.d.cts +1 -0
  38. package/dist/node/index.d.cts.map +1 -1
  39. package/dist/node/index.d.mts +1 -0
  40. package/dist/node/index.d.mts.map +1 -1
  41. package/dist/node/index.d.ts +1 -0
  42. package/dist/node/index.d.ts.map +1 -1
  43. package/dist/node/index.js +11 -0
  44. package/dist/node/index.js.map +1 -1
  45. package/package.json +9 -9
  46. package/src/Automation.ts +53 -0
  47. package/src/Config.ts +2 -0
  48. package/src/index.ts +1 -0
@@ -0,0 +1,67 @@
1
+ import { Payload } from '@xyo-network/payload-model';
2
+ export type SentinelAutomationSchema = 'network.xyo.automation';
3
+ export declare const SentinelAutomationSchema: SentinelAutomationSchema;
4
+ export type SentinelIntervalAutomationSchema = 'network.xyo.automation.interval';
5
+ export declare const SentinelIntervalAutomationSchema: SentinelIntervalAutomationSchema;
6
+ export type SentinelEventAutomationSchema = 'network.xyo.automation.event';
7
+ export declare const SentinelEventAutomationSchema: SentinelEventAutomationSchema;
8
+ export type SentinelBaseAutomationPayload<T extends Payload> = Payload<{
9
+ type?: 'interval' | 'event';
10
+ } & T>;
11
+ /** Settings for an Interval Automation */
12
+ export type SentinelIntervalAutomationPayload = SentinelBaseAutomationPayload<{
13
+ /** Epoch after which any reoccurrence stops */
14
+ end?: number;
15
+ /** Time between triggers [non-repeating if undefined] */
16
+ frequency?: number;
17
+ /** Units for frequency field [hour if undefined] */
18
+ frequencyUnits?: 'second' | 'minute' | 'hour' | 'day';
19
+ /** Remaining triggers [infinite if undefined] */
20
+ remaining?: number;
21
+ schema: SentinelIntervalAutomationSchema;
22
+ /** Epoch of the next trigger */
23
+ start: number;
24
+ /** The type of automation */
25
+ type: 'interval';
26
+ }>;
27
+ export declare const isSentinelIntervalAutomation: (x?: unknown) => x is (import("@xyo-network/payload-model").SchemaFields & object & {
28
+ type?: "interval" | "event" | undefined;
29
+ } & {
30
+ /** Epoch after which any reoccurrence stops */
31
+ end?: number | undefined;
32
+ /** Time between triggers [non-repeating if undefined] */
33
+ frequency?: number | undefined;
34
+ /** Units for frequency field [hour if undefined] */
35
+ frequencyUnits?: "second" | "minute" | "hour" | "day" | undefined;
36
+ /** Remaining triggers [infinite if undefined] */
37
+ remaining?: number | undefined;
38
+ schema: SentinelIntervalAutomationSchema;
39
+ /** Epoch of the next trigger */
40
+ start: number;
41
+ /** The type of automation */
42
+ type: 'interval';
43
+ }) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadMetaFields & {
44
+ type?: "interval" | "event" | undefined;
45
+ } & {
46
+ /** Epoch after which any reoccurrence stops */
47
+ end?: number | undefined;
48
+ /** Time between triggers [non-repeating if undefined] */
49
+ frequency?: number | undefined;
50
+ /** Units for frequency field [hour if undefined] */
51
+ frequencyUnits?: "second" | "minute" | "hour" | "day" | undefined;
52
+ /** Remaining triggers [infinite if undefined] */
53
+ remaining?: number | undefined;
54
+ schema: SentinelIntervalAutomationSchema;
55
+ /** Epoch of the next trigger */
56
+ start: number;
57
+ /** The type of automation */
58
+ type: 'interval';
59
+ });
60
+ /** Settings for an Event Automation */
61
+ export type SentinelEventAutomationPayload = SentinelBaseAutomationPayload<{
62
+ schema: SentinelEventAutomationSchema;
63
+ type: 'event';
64
+ }>;
65
+ /** Settings for an Automation */
66
+ export type SentinelAutomationPayload = Payload<SentinelIntervalAutomationPayload | SentinelEventAutomationPayload, SentinelAutomationSchema | SentinelIntervalAutomationSchema | SentinelEventAutomationSchema>;
67
+ //# sourceMappingURL=Automation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Automation.d.ts","sourceRoot":"","sources":["../../src/Automation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAE3E,MAAM,MAAM,wBAAwB,GAAG,wBAAwB,CAAA;AAC/D,eAAO,MAAM,wBAAwB,EAAE,wBAAmD,CAAA;AAE1F,MAAM,MAAM,gCAAgC,GAAG,iCAAiC,CAAA;AAChF,eAAO,MAAM,gCAAgC,EAAE,gCAAoE,CAAA;AAEnH,MAAM,MAAM,6BAA6B,GAAG,8BAA8B,CAAA;AAC1E,eAAO,MAAM,6BAA6B,EAAE,6BAA8D,CAAA;AAE1G,MAAM,MAAM,6BAA6B,CAAC,CAAC,SAAS,OAAO,IAAI,OAAO,CACpE;IACE,IAAI,CAAC,EAAE,UAAU,GAAG,OAAO,CAAA;CAC5B,GAAG,CAAC,CACN,CAAA;AAED,0CAA0C;AAC1C,MAAM,MAAM,iCAAiC,GAAG,6BAA6B,CAAC;IAC5E,+CAA+C;IAC/C,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,oDAAoD;IACpD,cAAc,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAA;IAErD,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,MAAM,EAAE,gCAAgC,CAAA;IAExC,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAA;IAEb,6BAA6B;IAC7B,IAAI,EAAE,UAAU,CAAA;CACjB,CAAC,CAAA;AAEF,eAAO,MAAM,4BAA4B;;;IArBvC,+CAA+C;;IAG/C,yDAAyD;;IAGzD,oDAAoD;;IAGpD,iDAAiD;;YAGzC,gCAAgC;IAExC,gCAAgC;WACzB,MAAM;IAEb,6BAA6B;UACvB,UAAU;;;;IAlBhB,+CAA+C;;IAG/C,yDAAyD;;IAGzD,oDAAoD;;IAGpD,iDAAiD;;YAGzC,gCAAgC;IAExC,gCAAgC;WACzB,MAAM;IAEb,6BAA6B;UACvB,UAAU;EAGoH,CAAA;AAEtI,uCAAuC;AACvC,MAAM,MAAM,8BAA8B,GAAG,6BAA6B,CAAC;IACzE,MAAM,EAAE,6BAA6B,CAAA;IACrC,IAAI,EAAE,OAAO,CAAA;CACd,CAAC,CAAA;AAEF,iCAAiC;AACjC,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAC7C,iCAAiC,GAAG,8BAA8B,EAClE,wBAAwB,GAAG,gCAAgC,GAAG,6BAA6B,CAC5F,CAAA"}
@@ -0,0 +1,67 @@
1
+ import { Payload } from '@xyo-network/payload-model';
2
+ export type SentinelAutomationSchema = 'network.xyo.automation';
3
+ export declare const SentinelAutomationSchema: SentinelAutomationSchema;
4
+ export type SentinelIntervalAutomationSchema = 'network.xyo.automation.interval';
5
+ export declare const SentinelIntervalAutomationSchema: SentinelIntervalAutomationSchema;
6
+ export type SentinelEventAutomationSchema = 'network.xyo.automation.event';
7
+ export declare const SentinelEventAutomationSchema: SentinelEventAutomationSchema;
8
+ export type SentinelBaseAutomationPayload<T extends Payload> = Payload<{
9
+ type?: 'interval' | 'event';
10
+ } & T>;
11
+ /** Settings for an Interval Automation */
12
+ export type SentinelIntervalAutomationPayload = SentinelBaseAutomationPayload<{
13
+ /** Epoch after which any reoccurrence stops */
14
+ end?: number;
15
+ /** Time between triggers [non-repeating if undefined] */
16
+ frequency?: number;
17
+ /** Units for frequency field [hour if undefined] */
18
+ frequencyUnits?: 'second' | 'minute' | 'hour' | 'day';
19
+ /** Remaining triggers [infinite if undefined] */
20
+ remaining?: number;
21
+ schema: SentinelIntervalAutomationSchema;
22
+ /** Epoch of the next trigger */
23
+ start: number;
24
+ /** The type of automation */
25
+ type: 'interval';
26
+ }>;
27
+ export declare const isSentinelIntervalAutomation: (x?: unknown) => x is (import("@xyo-network/payload-model").SchemaFields & object & {
28
+ type?: "interval" | "event" | undefined;
29
+ } & {
30
+ /** Epoch after which any reoccurrence stops */
31
+ end?: number | undefined;
32
+ /** Time between triggers [non-repeating if undefined] */
33
+ frequency?: number | undefined;
34
+ /** Units for frequency field [hour if undefined] */
35
+ frequencyUnits?: "second" | "minute" | "hour" | "day" | undefined;
36
+ /** Remaining triggers [infinite if undefined] */
37
+ remaining?: number | undefined;
38
+ schema: SentinelIntervalAutomationSchema;
39
+ /** Epoch of the next trigger */
40
+ start: number;
41
+ /** The type of automation */
42
+ type: 'interval';
43
+ }) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadMetaFields & {
44
+ type?: "interval" | "event" | undefined;
45
+ } & {
46
+ /** Epoch after which any reoccurrence stops */
47
+ end?: number | undefined;
48
+ /** Time between triggers [non-repeating if undefined] */
49
+ frequency?: number | undefined;
50
+ /** Units for frequency field [hour if undefined] */
51
+ frequencyUnits?: "second" | "minute" | "hour" | "day" | undefined;
52
+ /** Remaining triggers [infinite if undefined] */
53
+ remaining?: number | undefined;
54
+ schema: SentinelIntervalAutomationSchema;
55
+ /** Epoch of the next trigger */
56
+ start: number;
57
+ /** The type of automation */
58
+ type: 'interval';
59
+ });
60
+ /** Settings for an Event Automation */
61
+ export type SentinelEventAutomationPayload = SentinelBaseAutomationPayload<{
62
+ schema: SentinelEventAutomationSchema;
63
+ type: 'event';
64
+ }>;
65
+ /** Settings for an Automation */
66
+ export type SentinelAutomationPayload = Payload<SentinelIntervalAutomationPayload | SentinelEventAutomationPayload, SentinelAutomationSchema | SentinelIntervalAutomationSchema | SentinelEventAutomationSchema>;
67
+ //# sourceMappingURL=Automation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Automation.d.ts","sourceRoot":"","sources":["../../src/Automation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAE3E,MAAM,MAAM,wBAAwB,GAAG,wBAAwB,CAAA;AAC/D,eAAO,MAAM,wBAAwB,EAAE,wBAAmD,CAAA;AAE1F,MAAM,MAAM,gCAAgC,GAAG,iCAAiC,CAAA;AAChF,eAAO,MAAM,gCAAgC,EAAE,gCAAoE,CAAA;AAEnH,MAAM,MAAM,6BAA6B,GAAG,8BAA8B,CAAA;AAC1E,eAAO,MAAM,6BAA6B,EAAE,6BAA8D,CAAA;AAE1G,MAAM,MAAM,6BAA6B,CAAC,CAAC,SAAS,OAAO,IAAI,OAAO,CACpE;IACE,IAAI,CAAC,EAAE,UAAU,GAAG,OAAO,CAAA;CAC5B,GAAG,CAAC,CACN,CAAA;AAED,0CAA0C;AAC1C,MAAM,MAAM,iCAAiC,GAAG,6BAA6B,CAAC;IAC5E,+CAA+C;IAC/C,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,oDAAoD;IACpD,cAAc,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAA;IAErD,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,MAAM,EAAE,gCAAgC,CAAA;IAExC,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAA;IAEb,6BAA6B;IAC7B,IAAI,EAAE,UAAU,CAAA;CACjB,CAAC,CAAA;AAEF,eAAO,MAAM,4BAA4B;;;IArBvC,+CAA+C;;IAG/C,yDAAyD;;IAGzD,oDAAoD;;IAGpD,iDAAiD;;YAGzC,gCAAgC;IAExC,gCAAgC;WACzB,MAAM;IAEb,6BAA6B;UACvB,UAAU;;;;IAlBhB,+CAA+C;;IAG/C,yDAAyD;;IAGzD,oDAAoD;;IAGpD,iDAAiD;;YAGzC,gCAAgC;IAExC,gCAAgC;WACzB,MAAM;IAEb,6BAA6B;UACvB,UAAU;EAGoH,CAAA;AAEtI,uCAAuC;AACvC,MAAM,MAAM,8BAA8B,GAAG,6BAA6B,CAAC;IACzE,MAAM,EAAE,6BAA6B,CAAA;IACrC,IAAI,EAAE,OAAO,CAAA;CACd,CAAC,CAAA;AAEF,iCAAiC;AACjC,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAC7C,iCAAiC,GAAG,8BAA8B,EAClE,wBAAwB,GAAG,gCAAgC,GAAG,6BAA6B,CAC5F,CAAA"}
@@ -0,0 +1,67 @@
1
+ import { Payload } from '@xyo-network/payload-model';
2
+ export type SentinelAutomationSchema = 'network.xyo.automation';
3
+ export declare const SentinelAutomationSchema: SentinelAutomationSchema;
4
+ export type SentinelIntervalAutomationSchema = 'network.xyo.automation.interval';
5
+ export declare const SentinelIntervalAutomationSchema: SentinelIntervalAutomationSchema;
6
+ export type SentinelEventAutomationSchema = 'network.xyo.automation.event';
7
+ export declare const SentinelEventAutomationSchema: SentinelEventAutomationSchema;
8
+ export type SentinelBaseAutomationPayload<T extends Payload> = Payload<{
9
+ type?: 'interval' | 'event';
10
+ } & T>;
11
+ /** Settings for an Interval Automation */
12
+ export type SentinelIntervalAutomationPayload = SentinelBaseAutomationPayload<{
13
+ /** Epoch after which any reoccurrence stops */
14
+ end?: number;
15
+ /** Time between triggers [non-repeating if undefined] */
16
+ frequency?: number;
17
+ /** Units for frequency field [hour if undefined] */
18
+ frequencyUnits?: 'second' | 'minute' | 'hour' | 'day';
19
+ /** Remaining triggers [infinite if undefined] */
20
+ remaining?: number;
21
+ schema: SentinelIntervalAutomationSchema;
22
+ /** Epoch of the next trigger */
23
+ start: number;
24
+ /** The type of automation */
25
+ type: 'interval';
26
+ }>;
27
+ export declare const isSentinelIntervalAutomation: (x?: unknown) => x is (import("@xyo-network/payload-model").SchemaFields & object & {
28
+ type?: "interval" | "event" | undefined;
29
+ } & {
30
+ /** Epoch after which any reoccurrence stops */
31
+ end?: number | undefined;
32
+ /** Time between triggers [non-repeating if undefined] */
33
+ frequency?: number | undefined;
34
+ /** Units for frequency field [hour if undefined] */
35
+ frequencyUnits?: "second" | "minute" | "hour" | "day" | undefined;
36
+ /** Remaining triggers [infinite if undefined] */
37
+ remaining?: number | undefined;
38
+ schema: SentinelIntervalAutomationSchema;
39
+ /** Epoch of the next trigger */
40
+ start: number;
41
+ /** The type of automation */
42
+ type: 'interval';
43
+ }) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadMetaFields & {
44
+ type?: "interval" | "event" | undefined;
45
+ } & {
46
+ /** Epoch after which any reoccurrence stops */
47
+ end?: number | undefined;
48
+ /** Time between triggers [non-repeating if undefined] */
49
+ frequency?: number | undefined;
50
+ /** Units for frequency field [hour if undefined] */
51
+ frequencyUnits?: "second" | "minute" | "hour" | "day" | undefined;
52
+ /** Remaining triggers [infinite if undefined] */
53
+ remaining?: number | undefined;
54
+ schema: SentinelIntervalAutomationSchema;
55
+ /** Epoch of the next trigger */
56
+ start: number;
57
+ /** The type of automation */
58
+ type: 'interval';
59
+ });
60
+ /** Settings for an Event Automation */
61
+ export type SentinelEventAutomationPayload = SentinelBaseAutomationPayload<{
62
+ schema: SentinelEventAutomationSchema;
63
+ type: 'event';
64
+ }>;
65
+ /** Settings for an Automation */
66
+ export type SentinelAutomationPayload = Payload<SentinelIntervalAutomationPayload | SentinelEventAutomationPayload, SentinelAutomationSchema | SentinelIntervalAutomationSchema | SentinelEventAutomationSchema>;
67
+ //# sourceMappingURL=Automation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Automation.d.ts","sourceRoot":"","sources":["../../src/Automation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAE3E,MAAM,MAAM,wBAAwB,GAAG,wBAAwB,CAAA;AAC/D,eAAO,MAAM,wBAAwB,EAAE,wBAAmD,CAAA;AAE1F,MAAM,MAAM,gCAAgC,GAAG,iCAAiC,CAAA;AAChF,eAAO,MAAM,gCAAgC,EAAE,gCAAoE,CAAA;AAEnH,MAAM,MAAM,6BAA6B,GAAG,8BAA8B,CAAA;AAC1E,eAAO,MAAM,6BAA6B,EAAE,6BAA8D,CAAA;AAE1G,MAAM,MAAM,6BAA6B,CAAC,CAAC,SAAS,OAAO,IAAI,OAAO,CACpE;IACE,IAAI,CAAC,EAAE,UAAU,GAAG,OAAO,CAAA;CAC5B,GAAG,CAAC,CACN,CAAA;AAED,0CAA0C;AAC1C,MAAM,MAAM,iCAAiC,GAAG,6BAA6B,CAAC;IAC5E,+CAA+C;IAC/C,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,oDAAoD;IACpD,cAAc,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAA;IAErD,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,MAAM,EAAE,gCAAgC,CAAA;IAExC,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAA;IAEb,6BAA6B;IAC7B,IAAI,EAAE,UAAU,CAAA;CACjB,CAAC,CAAA;AAEF,eAAO,MAAM,4BAA4B;;;IArBvC,+CAA+C;;IAG/C,yDAAyD;;IAGzD,oDAAoD;;IAGpD,iDAAiD;;YAGzC,gCAAgC;IAExC,gCAAgC;WACzB,MAAM;IAEb,6BAA6B;UACvB,UAAU;;;;IAlBhB,+CAA+C;;IAG/C,yDAAyD;;IAGzD,oDAAoD;;IAGpD,iDAAiD;;YAGzC,gCAAgC;IAExC,gCAAgC;WACzB,MAAM;IAEb,6BAA6B;UACvB,UAAU;EAGoH,CAAA;AAEtI,uCAAuC;AACvC,MAAM,MAAM,8BAA8B,GAAG,6BAA6B,CAAC;IACzE,MAAM,EAAE,6BAA6B,CAAA;IACrC,IAAI,EAAE,OAAO,CAAA;CACd,CAAC,CAAA;AAEF,iCAAiC;AACjC,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAC7C,iCAAiC,GAAG,8BAA8B,EAClE,wBAAwB,GAAG,gCAAgC,GAAG,6BAA6B,CAC5F,CAAA"}
@@ -1,9 +1,11 @@
1
1
  import { ModuleConfig } from '@xyo-network/module-model';
2
2
  import { Payload } from '@xyo-network/payload-model';
3
+ import { SentinelAutomationPayload } from './Automation';
3
4
  import { Task } from './Task';
4
5
  export type SentinelConfigSchema = 'network.xyo.sentinel.config';
5
6
  export declare const SentinelConfigSchema: SentinelConfigSchema;
6
7
  export type SentinelConfig<TConfig extends Payload | void = void> = ModuleConfig<TConfig, {
8
+ automations?: SentinelAutomationPayload[];
7
9
  synchronous?: boolean;
8
10
  tasks: Task[];
9
11
  throwErrors?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEpD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,MAAM,MAAM,oBAAoB,GAAG,6BAA6B,CAAA;AAChE,eAAO,MAAM,oBAAoB,EAAE,oBAAoD,CAAA;AAEvF,MAAM,MAAM,cAAc,CAAC,OAAO,SAAS,OAAO,GAAG,IAAI,GAAG,IAAI,IAAI,YAAY,CAC9E,OAAO,EACP;IACE,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,EACD,OAAO,SAAS,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,oBAAoB,CACnE,CAAA"}
1
+ {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,MAAM,MAAM,oBAAoB,GAAG,6BAA6B,CAAA;AAChE,eAAO,MAAM,oBAAoB,EAAE,oBAAoD,CAAA;AAEvF,MAAM,MAAM,cAAc,CAAC,OAAO,SAAS,OAAO,GAAG,IAAI,GAAG,IAAI,IAAI,YAAY,CAC9E,OAAO,EACP;IACE,WAAW,CAAC,EAAE,yBAAyB,EAAE,CAAA;IACzC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,EACD,OAAO,SAAS,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,oBAAoB,CACnE,CAAA"}
@@ -1,9 +1,11 @@
1
1
  import { ModuleConfig } from '@xyo-network/module-model';
2
2
  import { Payload } from '@xyo-network/payload-model';
3
+ import { SentinelAutomationPayload } from './Automation';
3
4
  import { Task } from './Task';
4
5
  export type SentinelConfigSchema = 'network.xyo.sentinel.config';
5
6
  export declare const SentinelConfigSchema: SentinelConfigSchema;
6
7
  export type SentinelConfig<TConfig extends Payload | void = void> = ModuleConfig<TConfig, {
8
+ automations?: SentinelAutomationPayload[];
7
9
  synchronous?: boolean;
8
10
  tasks: Task[];
9
11
  throwErrors?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEpD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,MAAM,MAAM,oBAAoB,GAAG,6BAA6B,CAAA;AAChE,eAAO,MAAM,oBAAoB,EAAE,oBAAoD,CAAA;AAEvF,MAAM,MAAM,cAAc,CAAC,OAAO,SAAS,OAAO,GAAG,IAAI,GAAG,IAAI,IAAI,YAAY,CAC9E,OAAO,EACP;IACE,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,EACD,OAAO,SAAS,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,oBAAoB,CACnE,CAAA"}
1
+ {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,MAAM,MAAM,oBAAoB,GAAG,6BAA6B,CAAA;AAChE,eAAO,MAAM,oBAAoB,EAAE,oBAAoD,CAAA;AAEvF,MAAM,MAAM,cAAc,CAAC,OAAO,SAAS,OAAO,GAAG,IAAI,GAAG,IAAI,IAAI,YAAY,CAC9E,OAAO,EACP;IACE,WAAW,CAAC,EAAE,yBAAyB,EAAE,CAAA;IACzC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,EACD,OAAO,SAAS,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,oBAAoB,CACnE,CAAA"}
@@ -1,9 +1,11 @@
1
1
  import { ModuleConfig } from '@xyo-network/module-model';
2
2
  import { Payload } from '@xyo-network/payload-model';
3
+ import { SentinelAutomationPayload } from './Automation';
3
4
  import { Task } from './Task';
4
5
  export type SentinelConfigSchema = 'network.xyo.sentinel.config';
5
6
  export declare const SentinelConfigSchema: SentinelConfigSchema;
6
7
  export type SentinelConfig<TConfig extends Payload | void = void> = ModuleConfig<TConfig, {
8
+ automations?: SentinelAutomationPayload[];
7
9
  synchronous?: boolean;
8
10
  tasks: Task[];
9
11
  throwErrors?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEpD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,MAAM,MAAM,oBAAoB,GAAG,6BAA6B,CAAA;AAChE,eAAO,MAAM,oBAAoB,EAAE,oBAAoD,CAAA;AAEvF,MAAM,MAAM,cAAc,CAAC,OAAO,SAAS,OAAO,GAAG,IAAI,GAAG,IAAI,IAAI,YAAY,CAC9E,OAAO,EACP;IACE,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,EACD,OAAO,SAAS,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,oBAAoB,CACnE,CAAA"}
1
+ {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,MAAM,MAAM,oBAAoB,GAAG,6BAA6B,CAAA;AAChE,eAAO,MAAM,oBAAoB,EAAE,oBAAoD,CAAA;AAEvF,MAAM,MAAM,cAAc,CAAC,OAAO,SAAS,OAAO,GAAG,IAAI,GAAG,IAAI,IAAI,YAAY,CAC9E,OAAO,EACP;IACE,WAAW,CAAC,EAAE,yBAAyB,EAAE,CAAA;IACzC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,EACD,OAAO,SAAS,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,oBAAoB,CACnE,CAAA"}
@@ -20,17 +20,28 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var src_exports = {};
22
22
  __export(src_exports, {
23
+ SentinelAutomationSchema: () => SentinelAutomationSchema,
23
24
  SentinelConfigSchema: () => SentinelConfigSchema,
25
+ SentinelEventAutomationSchema: () => SentinelEventAutomationSchema,
26
+ SentinelIntervalAutomationSchema: () => SentinelIntervalAutomationSchema,
24
27
  SentinelReportQuerySchema: () => SentinelReportQuerySchema,
25
28
  asSentinelInstance: () => asSentinelInstance,
26
29
  asSentinelModule: () => asSentinelModule,
27
30
  isSentinelInstance: () => isSentinelInstance,
31
+ isSentinelIntervalAutomation: () => isSentinelIntervalAutomation,
28
32
  isSentinelModule: () => isSentinelModule,
29
33
  withSentinelInstance: () => withSentinelInstance,
30
34
  withSentinelModule: () => withSentinelModule
31
35
  });
32
36
  module.exports = __toCommonJS(src_exports);
33
37
 
38
+ // src/Automation.ts
39
+ var import_payload_model = require("@xyo-network/payload-model");
40
+ var SentinelAutomationSchema = "network.xyo.automation";
41
+ var SentinelIntervalAutomationSchema = "network.xyo.automation.interval";
42
+ var SentinelEventAutomationSchema = "network.xyo.automation.event";
43
+ var isSentinelIntervalAutomation = (0, import_payload_model.isPayloadOfSchemaType)(SentinelIntervalAutomationSchema);
44
+
34
45
  // src/Config.ts
35
46
  var SentinelConfigSchema = "network.xyo.sentinel.config";
36
47
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts","../../src/Config.ts","../../src/Queries/Report.ts","../../src/typeChecks.ts"],"sourcesContent":["export * from './Config'\nexport * from './EventData'\nexport * from './EventsModels'\nexport * from './Instance'\nexport * from './Job'\nexport * from './Module'\nexport * from './Params'\nexport * from './Queries'\nexport * from './ResolvedTask'\nexport * from './Sentinel'\nexport * from './Task'\nexport * from './typeChecks'\n","import { ModuleConfig } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { Task } from './Task'\n\nexport type SentinelConfigSchema = 'network.xyo.sentinel.config'\nexport const SentinelConfigSchema: SentinelConfigSchema = 'network.xyo.sentinel.config'\n\nexport type SentinelConfig<TConfig extends Payload | void = void> = ModuleConfig<\n TConfig,\n {\n synchronous?: boolean\n tasks: Task[]\n throwErrors?: boolean\n },\n TConfig extends Payload ? TConfig['schema'] : SentinelConfigSchema\n>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type SentinelReportQuerySchema = 'network.xyo.query.sentinel.report'\nexport const SentinelReportQuerySchema: SentinelReportQuerySchema = 'network.xyo.query.sentinel.report'\n\nexport type SentinelReportQuery = Query<{\n schema: SentinelReportQuerySchema\n}>\n","import { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'\nimport { AsObjectFactory } from '@xyo-network/object'\n\nimport { SentinelInstance } from './Instance'\nimport { SentinelModule } from './Module'\nimport { SentinelReportQuerySchema } from './Queries'\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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACMO,IAAM,uBAA6C;;;ACHnD,IAAM,4BAAuD;;;ACHpE,0BAAkF;AAClF,oBAAgC;AAMzB,IAAM,qBAAqB,IAAI,sCAAoC,EAAE,OAAO,EAAE,QAAQ,WAAW,GAAG,CAAC,oCAAgB,CAAC;AACtH,IAAM,mBAAmB,IAAI,oCAAgC,EAAE,OAAO,CAAC,yBAAyB,CAAC;AAEjG,IAAM,mBAAmB,8BAAgB,OAAO,gBAAgB;AAChE,IAAM,qBAAqB,8BAAgB,OAAO,kBAAkB;AACpE,IAAM,qBAAqB,gCAAY,OAAO,gBAAgB;AAC9D,IAAM,uBAAuB,gCAAY,OAAO,kBAAkB;","names":[]}
1
+ {"version":3,"sources":["../../src/index.ts","../../src/Automation.ts","../../src/Config.ts","../../src/Queries/Report.ts","../../src/typeChecks.ts"],"sourcesContent":["export * from './Automation'\nexport * from './Config'\nexport * from './EventData'\nexport * from './EventsModels'\nexport * from './Instance'\nexport * from './Job'\nexport * from './Module'\nexport * from './Params'\nexport * from './Queries'\nexport * from './ResolvedTask'\nexport * from './Sentinel'\nexport * from './Task'\nexport * from './typeChecks'\n","import { isPayloadOfSchemaType, Payload } from '@xyo-network/payload-model'\n\nexport type SentinelAutomationSchema = 'network.xyo.automation'\nexport const SentinelAutomationSchema: SentinelAutomationSchema = 'network.xyo.automation'\n\nexport type SentinelIntervalAutomationSchema = 'network.xyo.automation.interval'\nexport const SentinelIntervalAutomationSchema: SentinelIntervalAutomationSchema = 'network.xyo.automation.interval'\n\nexport type SentinelEventAutomationSchema = 'network.xyo.automation.event'\nexport const SentinelEventAutomationSchema: SentinelEventAutomationSchema = 'network.xyo.automation.event'\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'\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 { ModuleConfig } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { SentinelAutomationPayload } from './Automation'\nimport { Task } from './Task'\n\nexport type SentinelConfigSchema = 'network.xyo.sentinel.config'\nexport const SentinelConfigSchema: SentinelConfigSchema = 'network.xyo.sentinel.config'\n\nexport type SentinelConfig<TConfig extends Payload | void = void> = ModuleConfig<\n TConfig,\n {\n automations?: SentinelAutomationPayload[]\n synchronous?: boolean\n tasks: Task[]\n throwErrors?: boolean\n },\n TConfig extends Payload ? TConfig['schema'] : SentinelConfigSchema\n>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type SentinelReportQuerySchema = 'network.xyo.query.sentinel.report'\nexport const SentinelReportQuerySchema: SentinelReportQuerySchema = 'network.xyo.query.sentinel.report'\n\nexport type SentinelReportQuery = Query<{\n schema: SentinelReportQuerySchema\n}>\n","import { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'\nimport { AsObjectFactory } from '@xyo-network/object'\n\nimport { SentinelInstance } from './Instance'\nimport { SentinelModule } from './Module'\nimport { SentinelReportQuerySchema } from './Queries'\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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,2BAA+C;AAGxC,IAAM,2BAAqD;AAG3D,IAAM,mCAAqE;AAG3E,IAAM,gCAA+D;AA+BrE,IAAM,mCAA+B,4CAAyD,gCAAgC;;;ACjC9H,IAAM,uBAA6C;;;ACJnD,IAAM,4BAAuD;;;ACHpE,0BAAkF;AAClF,oBAAgC;AAMzB,IAAM,qBAAqB,IAAI,sCAAoC,EAAE,OAAO,EAAE,QAAQ,WAAW,GAAG,CAAC,oCAAgB,CAAC;AACtH,IAAM,mBAAmB,IAAI,oCAAgC,EAAE,OAAO,CAAC,yBAAyB,CAAC;AAEjG,IAAM,mBAAmB,8BAAgB,OAAO,gBAAgB;AAChE,IAAM,qBAAqB,8BAAgB,OAAO,kBAAkB;AACpE,IAAM,qBAAqB,gCAAY,OAAO,gBAAgB;AAC9D,IAAM,uBAAuB,gCAAY,OAAO,kBAAkB;","names":[]}
@@ -1,3 +1,4 @@
1
+ export * from './Automation';
1
2
  export * from './Config';
2
3
  export * from './EventData';
3
4
  export * from './EventsModels';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,OAAO,CAAA;AACrB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,OAAO,CAAA;AACrB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA"}
@@ -1,3 +1,4 @@
1
+ export * from './Automation';
1
2
  export * from './Config';
2
3
  export * from './EventData';
3
4
  export * from './EventsModels';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,OAAO,CAAA;AACrB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,OAAO,CAAA;AACrB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA"}
@@ -1,3 +1,4 @@
1
+ export * from './Automation';
1
2
  export * from './Config';
2
3
  export * from './EventData';
3
4
  export * from './EventsModels';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,OAAO,CAAA;AACrB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,OAAO,CAAA;AACrB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA"}
@@ -1,3 +1,10 @@
1
+ // src/Automation.ts
2
+ import { isPayloadOfSchemaType } from "@xyo-network/payload-model";
3
+ var SentinelAutomationSchema = "network.xyo.automation";
4
+ var SentinelIntervalAutomationSchema = "network.xyo.automation.interval";
5
+ var SentinelEventAutomationSchema = "network.xyo.automation.event";
6
+ var isSentinelIntervalAutomation = isPayloadOfSchemaType(SentinelIntervalAutomationSchema);
7
+
1
8
  // src/Config.ts
2
9
  var SentinelConfigSchema = "network.xyo.sentinel.config";
3
10
 
@@ -14,11 +21,15 @@ var asSentinelInstance = AsObjectFactory.create(isSentinelInstance);
14
21
  var withSentinelModule = WithFactory.create(isSentinelModule);
15
22
  var withSentinelInstance = WithFactory.create(isSentinelInstance);
16
23
  export {
24
+ SentinelAutomationSchema,
17
25
  SentinelConfigSchema,
26
+ SentinelEventAutomationSchema,
27
+ SentinelIntervalAutomationSchema,
18
28
  SentinelReportQuerySchema,
19
29
  asSentinelInstance,
20
30
  asSentinelModule,
21
31
  isSentinelInstance,
32
+ isSentinelIntervalAutomation,
22
33
  isSentinelModule,
23
34
  withSentinelInstance,
24
35
  withSentinelModule
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Config.ts","../../src/Queries/Report.ts","../../src/typeChecks.ts"],"sourcesContent":["import { ModuleConfig } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { Task } from './Task'\n\nexport type SentinelConfigSchema = 'network.xyo.sentinel.config'\nexport const SentinelConfigSchema: SentinelConfigSchema = 'network.xyo.sentinel.config'\n\nexport type SentinelConfig<TConfig extends Payload | void = void> = ModuleConfig<\n TConfig,\n {\n synchronous?: boolean\n tasks: Task[]\n throwErrors?: boolean\n },\n TConfig extends Payload ? TConfig['schema'] : SentinelConfigSchema\n>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type SentinelReportQuerySchema = 'network.xyo.query.sentinel.report'\nexport const SentinelReportQuerySchema: SentinelReportQuerySchema = 'network.xyo.query.sentinel.report'\n\nexport type SentinelReportQuery = Query<{\n schema: SentinelReportQuerySchema\n}>\n","import { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'\nimport { AsObjectFactory } from '@xyo-network/object'\n\nimport { SentinelInstance } from './Instance'\nimport { SentinelModule } from './Module'\nimport { SentinelReportQuerySchema } from './Queries'\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"],"mappings":";AAMO,IAAM,uBAA6C;;;ACHnD,IAAM,4BAAuD;;;ACHpE,SAAS,mBAAmB,iBAAiB,kBAAkB,mBAAmB;AAClF,SAAS,uBAAuB;AAMzB,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;","names":[]}
1
+ {"version":3,"sources":["../../src/Automation.ts","../../src/Config.ts","../../src/Queries/Report.ts","../../src/typeChecks.ts"],"sourcesContent":["import { isPayloadOfSchemaType, Payload } from '@xyo-network/payload-model'\n\nexport type SentinelAutomationSchema = 'network.xyo.automation'\nexport const SentinelAutomationSchema: SentinelAutomationSchema = 'network.xyo.automation'\n\nexport type SentinelIntervalAutomationSchema = 'network.xyo.automation.interval'\nexport const SentinelIntervalAutomationSchema: SentinelIntervalAutomationSchema = 'network.xyo.automation.interval'\n\nexport type SentinelEventAutomationSchema = 'network.xyo.automation.event'\nexport const SentinelEventAutomationSchema: SentinelEventAutomationSchema = 'network.xyo.automation.event'\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'\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 { ModuleConfig } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { SentinelAutomationPayload } from './Automation'\nimport { Task } from './Task'\n\nexport type SentinelConfigSchema = 'network.xyo.sentinel.config'\nexport const SentinelConfigSchema: SentinelConfigSchema = 'network.xyo.sentinel.config'\n\nexport type SentinelConfig<TConfig extends Payload | void = void> = ModuleConfig<\n TConfig,\n {\n automations?: SentinelAutomationPayload[]\n synchronous?: boolean\n tasks: Task[]\n throwErrors?: boolean\n },\n TConfig extends Payload ? TConfig['schema'] : SentinelConfigSchema\n>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type SentinelReportQuerySchema = 'network.xyo.query.sentinel.report'\nexport const SentinelReportQuerySchema: SentinelReportQuerySchema = 'network.xyo.query.sentinel.report'\n\nexport type SentinelReportQuery = Query<{\n schema: SentinelReportQuerySchema\n}>\n","import { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'\nimport { AsObjectFactory } from '@xyo-network/object'\n\nimport { SentinelInstance } from './Instance'\nimport { SentinelModule } from './Module'\nimport { SentinelReportQuerySchema } from './Queries'\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"],"mappings":";AAAA,SAAS,6BAAsC;AAGxC,IAAM,2BAAqD;AAG3D,IAAM,mCAAqE;AAG3E,IAAM,gCAA+D;AA+BrE,IAAM,+BAA+B,sBAAyD,gCAAgC;;;ACjC9H,IAAM,uBAA6C;;;ACJnD,IAAM,4BAAuD;;;ACHpE,SAAS,mBAAmB,iBAAiB,kBAAkB,mBAAmB;AAClF,SAAS,uBAAuB;AAMzB,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;","names":[]}
@@ -0,0 +1,67 @@
1
+ import { Payload } from '@xyo-network/payload-model';
2
+ export type SentinelAutomationSchema = 'network.xyo.automation';
3
+ export declare const SentinelAutomationSchema: SentinelAutomationSchema;
4
+ export type SentinelIntervalAutomationSchema = 'network.xyo.automation.interval';
5
+ export declare const SentinelIntervalAutomationSchema: SentinelIntervalAutomationSchema;
6
+ export type SentinelEventAutomationSchema = 'network.xyo.automation.event';
7
+ export declare const SentinelEventAutomationSchema: SentinelEventAutomationSchema;
8
+ export type SentinelBaseAutomationPayload<T extends Payload> = Payload<{
9
+ type?: 'interval' | 'event';
10
+ } & T>;
11
+ /** Settings for an Interval Automation */
12
+ export type SentinelIntervalAutomationPayload = SentinelBaseAutomationPayload<{
13
+ /** Epoch after which any reoccurrence stops */
14
+ end?: number;
15
+ /** Time between triggers [non-repeating if undefined] */
16
+ frequency?: number;
17
+ /** Units for frequency field [hour if undefined] */
18
+ frequencyUnits?: 'second' | 'minute' | 'hour' | 'day';
19
+ /** Remaining triggers [infinite if undefined] */
20
+ remaining?: number;
21
+ schema: SentinelIntervalAutomationSchema;
22
+ /** Epoch of the next trigger */
23
+ start: number;
24
+ /** The type of automation */
25
+ type: 'interval';
26
+ }>;
27
+ export declare const isSentinelIntervalAutomation: (x?: unknown) => x is (import("@xyo-network/payload-model").SchemaFields & object & {
28
+ type?: "interval" | "event" | undefined;
29
+ } & {
30
+ /** Epoch after which any reoccurrence stops */
31
+ end?: number | undefined;
32
+ /** Time between triggers [non-repeating if undefined] */
33
+ frequency?: number | undefined;
34
+ /** Units for frequency field [hour if undefined] */
35
+ frequencyUnits?: "second" | "minute" | "hour" | "day" | undefined;
36
+ /** Remaining triggers [infinite if undefined] */
37
+ remaining?: number | undefined;
38
+ schema: SentinelIntervalAutomationSchema;
39
+ /** Epoch of the next trigger */
40
+ start: number;
41
+ /** The type of automation */
42
+ type: 'interval';
43
+ }) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadMetaFields & {
44
+ type?: "interval" | "event" | undefined;
45
+ } & {
46
+ /** Epoch after which any reoccurrence stops */
47
+ end?: number | undefined;
48
+ /** Time between triggers [non-repeating if undefined] */
49
+ frequency?: number | undefined;
50
+ /** Units for frequency field [hour if undefined] */
51
+ frequencyUnits?: "second" | "minute" | "hour" | "day" | undefined;
52
+ /** Remaining triggers [infinite if undefined] */
53
+ remaining?: number | undefined;
54
+ schema: SentinelIntervalAutomationSchema;
55
+ /** Epoch of the next trigger */
56
+ start: number;
57
+ /** The type of automation */
58
+ type: 'interval';
59
+ });
60
+ /** Settings for an Event Automation */
61
+ export type SentinelEventAutomationPayload = SentinelBaseAutomationPayload<{
62
+ schema: SentinelEventAutomationSchema;
63
+ type: 'event';
64
+ }>;
65
+ /** Settings for an Automation */
66
+ export type SentinelAutomationPayload = Payload<SentinelIntervalAutomationPayload | SentinelEventAutomationPayload, SentinelAutomationSchema | SentinelIntervalAutomationSchema | SentinelEventAutomationSchema>;
67
+ //# sourceMappingURL=Automation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Automation.d.ts","sourceRoot":"","sources":["../../src/Automation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAE3E,MAAM,MAAM,wBAAwB,GAAG,wBAAwB,CAAA;AAC/D,eAAO,MAAM,wBAAwB,EAAE,wBAAmD,CAAA;AAE1F,MAAM,MAAM,gCAAgC,GAAG,iCAAiC,CAAA;AAChF,eAAO,MAAM,gCAAgC,EAAE,gCAAoE,CAAA;AAEnH,MAAM,MAAM,6BAA6B,GAAG,8BAA8B,CAAA;AAC1E,eAAO,MAAM,6BAA6B,EAAE,6BAA8D,CAAA;AAE1G,MAAM,MAAM,6BAA6B,CAAC,CAAC,SAAS,OAAO,IAAI,OAAO,CACpE;IACE,IAAI,CAAC,EAAE,UAAU,GAAG,OAAO,CAAA;CAC5B,GAAG,CAAC,CACN,CAAA;AAED,0CAA0C;AAC1C,MAAM,MAAM,iCAAiC,GAAG,6BAA6B,CAAC;IAC5E,+CAA+C;IAC/C,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,oDAAoD;IACpD,cAAc,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAA;IAErD,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,MAAM,EAAE,gCAAgC,CAAA;IAExC,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAA;IAEb,6BAA6B;IAC7B,IAAI,EAAE,UAAU,CAAA;CACjB,CAAC,CAAA;AAEF,eAAO,MAAM,4BAA4B;;;IArBvC,+CAA+C;;IAG/C,yDAAyD;;IAGzD,oDAAoD;;IAGpD,iDAAiD;;YAGzC,gCAAgC;IAExC,gCAAgC;WACzB,MAAM;IAEb,6BAA6B;UACvB,UAAU;;;;IAlBhB,+CAA+C;;IAG/C,yDAAyD;;IAGzD,oDAAoD;;IAGpD,iDAAiD;;YAGzC,gCAAgC;IAExC,gCAAgC;WACzB,MAAM;IAEb,6BAA6B;UACvB,UAAU;EAGoH,CAAA;AAEtI,uCAAuC;AACvC,MAAM,MAAM,8BAA8B,GAAG,6BAA6B,CAAC;IACzE,MAAM,EAAE,6BAA6B,CAAA;IACrC,IAAI,EAAE,OAAO,CAAA;CACd,CAAC,CAAA;AAEF,iCAAiC;AACjC,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAC7C,iCAAiC,GAAG,8BAA8B,EAClE,wBAAwB,GAAG,gCAAgC,GAAG,6BAA6B,CAC5F,CAAA"}
@@ -0,0 +1,67 @@
1
+ import { Payload } from '@xyo-network/payload-model';
2
+ export type SentinelAutomationSchema = 'network.xyo.automation';
3
+ export declare const SentinelAutomationSchema: SentinelAutomationSchema;
4
+ export type SentinelIntervalAutomationSchema = 'network.xyo.automation.interval';
5
+ export declare const SentinelIntervalAutomationSchema: SentinelIntervalAutomationSchema;
6
+ export type SentinelEventAutomationSchema = 'network.xyo.automation.event';
7
+ export declare const SentinelEventAutomationSchema: SentinelEventAutomationSchema;
8
+ export type SentinelBaseAutomationPayload<T extends Payload> = Payload<{
9
+ type?: 'interval' | 'event';
10
+ } & T>;
11
+ /** Settings for an Interval Automation */
12
+ export type SentinelIntervalAutomationPayload = SentinelBaseAutomationPayload<{
13
+ /** Epoch after which any reoccurrence stops */
14
+ end?: number;
15
+ /** Time between triggers [non-repeating if undefined] */
16
+ frequency?: number;
17
+ /** Units for frequency field [hour if undefined] */
18
+ frequencyUnits?: 'second' | 'minute' | 'hour' | 'day';
19
+ /** Remaining triggers [infinite if undefined] */
20
+ remaining?: number;
21
+ schema: SentinelIntervalAutomationSchema;
22
+ /** Epoch of the next trigger */
23
+ start: number;
24
+ /** The type of automation */
25
+ type: 'interval';
26
+ }>;
27
+ export declare const isSentinelIntervalAutomation: (x?: unknown) => x is (import("@xyo-network/payload-model").SchemaFields & object & {
28
+ type?: "interval" | "event" | undefined;
29
+ } & {
30
+ /** Epoch after which any reoccurrence stops */
31
+ end?: number | undefined;
32
+ /** Time between triggers [non-repeating if undefined] */
33
+ frequency?: number | undefined;
34
+ /** Units for frequency field [hour if undefined] */
35
+ frequencyUnits?: "second" | "minute" | "hour" | "day" | undefined;
36
+ /** Remaining triggers [infinite if undefined] */
37
+ remaining?: number | undefined;
38
+ schema: SentinelIntervalAutomationSchema;
39
+ /** Epoch of the next trigger */
40
+ start: number;
41
+ /** The type of automation */
42
+ type: 'interval';
43
+ }) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadMetaFields & {
44
+ type?: "interval" | "event" | undefined;
45
+ } & {
46
+ /** Epoch after which any reoccurrence stops */
47
+ end?: number | undefined;
48
+ /** Time between triggers [non-repeating if undefined] */
49
+ frequency?: number | undefined;
50
+ /** Units for frequency field [hour if undefined] */
51
+ frequencyUnits?: "second" | "minute" | "hour" | "day" | undefined;
52
+ /** Remaining triggers [infinite if undefined] */
53
+ remaining?: number | undefined;
54
+ schema: SentinelIntervalAutomationSchema;
55
+ /** Epoch of the next trigger */
56
+ start: number;
57
+ /** The type of automation */
58
+ type: 'interval';
59
+ });
60
+ /** Settings for an Event Automation */
61
+ export type SentinelEventAutomationPayload = SentinelBaseAutomationPayload<{
62
+ schema: SentinelEventAutomationSchema;
63
+ type: 'event';
64
+ }>;
65
+ /** Settings for an Automation */
66
+ export type SentinelAutomationPayload = Payload<SentinelIntervalAutomationPayload | SentinelEventAutomationPayload, SentinelAutomationSchema | SentinelIntervalAutomationSchema | SentinelEventAutomationSchema>;
67
+ //# sourceMappingURL=Automation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Automation.d.ts","sourceRoot":"","sources":["../../src/Automation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAE3E,MAAM,MAAM,wBAAwB,GAAG,wBAAwB,CAAA;AAC/D,eAAO,MAAM,wBAAwB,EAAE,wBAAmD,CAAA;AAE1F,MAAM,MAAM,gCAAgC,GAAG,iCAAiC,CAAA;AAChF,eAAO,MAAM,gCAAgC,EAAE,gCAAoE,CAAA;AAEnH,MAAM,MAAM,6BAA6B,GAAG,8BAA8B,CAAA;AAC1E,eAAO,MAAM,6BAA6B,EAAE,6BAA8D,CAAA;AAE1G,MAAM,MAAM,6BAA6B,CAAC,CAAC,SAAS,OAAO,IAAI,OAAO,CACpE;IACE,IAAI,CAAC,EAAE,UAAU,GAAG,OAAO,CAAA;CAC5B,GAAG,CAAC,CACN,CAAA;AAED,0CAA0C;AAC1C,MAAM,MAAM,iCAAiC,GAAG,6BAA6B,CAAC;IAC5E,+CAA+C;IAC/C,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,oDAAoD;IACpD,cAAc,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAA;IAErD,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,MAAM,EAAE,gCAAgC,CAAA;IAExC,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAA;IAEb,6BAA6B;IAC7B,IAAI,EAAE,UAAU,CAAA;CACjB,CAAC,CAAA;AAEF,eAAO,MAAM,4BAA4B;;;IArBvC,+CAA+C;;IAG/C,yDAAyD;;IAGzD,oDAAoD;;IAGpD,iDAAiD;;YAGzC,gCAAgC;IAExC,gCAAgC;WACzB,MAAM;IAEb,6BAA6B;UACvB,UAAU;;;;IAlBhB,+CAA+C;;IAG/C,yDAAyD;;IAGzD,oDAAoD;;IAGpD,iDAAiD;;YAGzC,gCAAgC;IAExC,gCAAgC;WACzB,MAAM;IAEb,6BAA6B;UACvB,UAAU;EAGoH,CAAA;AAEtI,uCAAuC;AACvC,MAAM,MAAM,8BAA8B,GAAG,6BAA6B,CAAC;IACzE,MAAM,EAAE,6BAA6B,CAAA;IACrC,IAAI,EAAE,OAAO,CAAA;CACd,CAAC,CAAA;AAEF,iCAAiC;AACjC,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAC7C,iCAAiC,GAAG,8BAA8B,EAClE,wBAAwB,GAAG,gCAAgC,GAAG,6BAA6B,CAC5F,CAAA"}
@@ -0,0 +1,67 @@
1
+ import { Payload } from '@xyo-network/payload-model';
2
+ export type SentinelAutomationSchema = 'network.xyo.automation';
3
+ export declare const SentinelAutomationSchema: SentinelAutomationSchema;
4
+ export type SentinelIntervalAutomationSchema = 'network.xyo.automation.interval';
5
+ export declare const SentinelIntervalAutomationSchema: SentinelIntervalAutomationSchema;
6
+ export type SentinelEventAutomationSchema = 'network.xyo.automation.event';
7
+ export declare const SentinelEventAutomationSchema: SentinelEventAutomationSchema;
8
+ export type SentinelBaseAutomationPayload<T extends Payload> = Payload<{
9
+ type?: 'interval' | 'event';
10
+ } & T>;
11
+ /** Settings for an Interval Automation */
12
+ export type SentinelIntervalAutomationPayload = SentinelBaseAutomationPayload<{
13
+ /** Epoch after which any reoccurrence stops */
14
+ end?: number;
15
+ /** Time between triggers [non-repeating if undefined] */
16
+ frequency?: number;
17
+ /** Units for frequency field [hour if undefined] */
18
+ frequencyUnits?: 'second' | 'minute' | 'hour' | 'day';
19
+ /** Remaining triggers [infinite if undefined] */
20
+ remaining?: number;
21
+ schema: SentinelIntervalAutomationSchema;
22
+ /** Epoch of the next trigger */
23
+ start: number;
24
+ /** The type of automation */
25
+ type: 'interval';
26
+ }>;
27
+ export declare const isSentinelIntervalAutomation: (x?: unknown) => x is (import("@xyo-network/payload-model").SchemaFields & object & {
28
+ type?: "interval" | "event" | undefined;
29
+ } & {
30
+ /** Epoch after which any reoccurrence stops */
31
+ end?: number | undefined;
32
+ /** Time between triggers [non-repeating if undefined] */
33
+ frequency?: number | undefined;
34
+ /** Units for frequency field [hour if undefined] */
35
+ frequencyUnits?: "second" | "minute" | "hour" | "day" | undefined;
36
+ /** Remaining triggers [infinite if undefined] */
37
+ remaining?: number | undefined;
38
+ schema: SentinelIntervalAutomationSchema;
39
+ /** Epoch of the next trigger */
40
+ start: number;
41
+ /** The type of automation */
42
+ type: 'interval';
43
+ }) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadMetaFields & {
44
+ type?: "interval" | "event" | undefined;
45
+ } & {
46
+ /** Epoch after which any reoccurrence stops */
47
+ end?: number | undefined;
48
+ /** Time between triggers [non-repeating if undefined] */
49
+ frequency?: number | undefined;
50
+ /** Units for frequency field [hour if undefined] */
51
+ frequencyUnits?: "second" | "minute" | "hour" | "day" | undefined;
52
+ /** Remaining triggers [infinite if undefined] */
53
+ remaining?: number | undefined;
54
+ schema: SentinelIntervalAutomationSchema;
55
+ /** Epoch of the next trigger */
56
+ start: number;
57
+ /** The type of automation */
58
+ type: 'interval';
59
+ });
60
+ /** Settings for an Event Automation */
61
+ export type SentinelEventAutomationPayload = SentinelBaseAutomationPayload<{
62
+ schema: SentinelEventAutomationSchema;
63
+ type: 'event';
64
+ }>;
65
+ /** Settings for an Automation */
66
+ export type SentinelAutomationPayload = Payload<SentinelIntervalAutomationPayload | SentinelEventAutomationPayload, SentinelAutomationSchema | SentinelIntervalAutomationSchema | SentinelEventAutomationSchema>;
67
+ //# sourceMappingURL=Automation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Automation.d.ts","sourceRoot":"","sources":["../../src/Automation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAE3E,MAAM,MAAM,wBAAwB,GAAG,wBAAwB,CAAA;AAC/D,eAAO,MAAM,wBAAwB,EAAE,wBAAmD,CAAA;AAE1F,MAAM,MAAM,gCAAgC,GAAG,iCAAiC,CAAA;AAChF,eAAO,MAAM,gCAAgC,EAAE,gCAAoE,CAAA;AAEnH,MAAM,MAAM,6BAA6B,GAAG,8BAA8B,CAAA;AAC1E,eAAO,MAAM,6BAA6B,EAAE,6BAA8D,CAAA;AAE1G,MAAM,MAAM,6BAA6B,CAAC,CAAC,SAAS,OAAO,IAAI,OAAO,CACpE;IACE,IAAI,CAAC,EAAE,UAAU,GAAG,OAAO,CAAA;CAC5B,GAAG,CAAC,CACN,CAAA;AAED,0CAA0C;AAC1C,MAAM,MAAM,iCAAiC,GAAG,6BAA6B,CAAC;IAC5E,+CAA+C;IAC/C,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,oDAAoD;IACpD,cAAc,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAA;IAErD,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,MAAM,EAAE,gCAAgC,CAAA;IAExC,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAA;IAEb,6BAA6B;IAC7B,IAAI,EAAE,UAAU,CAAA;CACjB,CAAC,CAAA;AAEF,eAAO,MAAM,4BAA4B;;;IArBvC,+CAA+C;;IAG/C,yDAAyD;;IAGzD,oDAAoD;;IAGpD,iDAAiD;;YAGzC,gCAAgC;IAExC,gCAAgC;WACzB,MAAM;IAEb,6BAA6B;UACvB,UAAU;;;;IAlBhB,+CAA+C;;IAG/C,yDAAyD;;IAGzD,oDAAoD;;IAGpD,iDAAiD;;YAGzC,gCAAgC;IAExC,gCAAgC;WACzB,MAAM;IAEb,6BAA6B;UACvB,UAAU;EAGoH,CAAA;AAEtI,uCAAuC;AACvC,MAAM,MAAM,8BAA8B,GAAG,6BAA6B,CAAC;IACzE,MAAM,EAAE,6BAA6B,CAAA;IACrC,IAAI,EAAE,OAAO,CAAA;CACd,CAAC,CAAA;AAEF,iCAAiC;AACjC,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAC7C,iCAAiC,GAAG,8BAA8B,EAClE,wBAAwB,GAAG,gCAAgC,GAAG,6BAA6B,CAC5F,CAAA"}
@@ -1,9 +1,11 @@
1
1
  import { ModuleConfig } from '@xyo-network/module-model';
2
2
  import { Payload } from '@xyo-network/payload-model';
3
+ import { SentinelAutomationPayload } from './Automation';
3
4
  import { Task } from './Task';
4
5
  export type SentinelConfigSchema = 'network.xyo.sentinel.config';
5
6
  export declare const SentinelConfigSchema: SentinelConfigSchema;
6
7
  export type SentinelConfig<TConfig extends Payload | void = void> = ModuleConfig<TConfig, {
8
+ automations?: SentinelAutomationPayload[];
7
9
  synchronous?: boolean;
8
10
  tasks: Task[];
9
11
  throwErrors?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEpD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,MAAM,MAAM,oBAAoB,GAAG,6BAA6B,CAAA;AAChE,eAAO,MAAM,oBAAoB,EAAE,oBAAoD,CAAA;AAEvF,MAAM,MAAM,cAAc,CAAC,OAAO,SAAS,OAAO,GAAG,IAAI,GAAG,IAAI,IAAI,YAAY,CAC9E,OAAO,EACP;IACE,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,EACD,OAAO,SAAS,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,oBAAoB,CACnE,CAAA"}
1
+ {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,MAAM,MAAM,oBAAoB,GAAG,6BAA6B,CAAA;AAChE,eAAO,MAAM,oBAAoB,EAAE,oBAAoD,CAAA;AAEvF,MAAM,MAAM,cAAc,CAAC,OAAO,SAAS,OAAO,GAAG,IAAI,GAAG,IAAI,IAAI,YAAY,CAC9E,OAAO,EACP;IACE,WAAW,CAAC,EAAE,yBAAyB,EAAE,CAAA;IACzC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,EACD,OAAO,SAAS,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,oBAAoB,CACnE,CAAA"}
@@ -1,9 +1,11 @@
1
1
  import { ModuleConfig } from '@xyo-network/module-model';
2
2
  import { Payload } from '@xyo-network/payload-model';
3
+ import { SentinelAutomationPayload } from './Automation';
3
4
  import { Task } from './Task';
4
5
  export type SentinelConfigSchema = 'network.xyo.sentinel.config';
5
6
  export declare const SentinelConfigSchema: SentinelConfigSchema;
6
7
  export type SentinelConfig<TConfig extends Payload | void = void> = ModuleConfig<TConfig, {
8
+ automations?: SentinelAutomationPayload[];
7
9
  synchronous?: boolean;
8
10
  tasks: Task[];
9
11
  throwErrors?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEpD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,MAAM,MAAM,oBAAoB,GAAG,6BAA6B,CAAA;AAChE,eAAO,MAAM,oBAAoB,EAAE,oBAAoD,CAAA;AAEvF,MAAM,MAAM,cAAc,CAAC,OAAO,SAAS,OAAO,GAAG,IAAI,GAAG,IAAI,IAAI,YAAY,CAC9E,OAAO,EACP;IACE,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,EACD,OAAO,SAAS,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,oBAAoB,CACnE,CAAA"}
1
+ {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,MAAM,MAAM,oBAAoB,GAAG,6BAA6B,CAAA;AAChE,eAAO,MAAM,oBAAoB,EAAE,oBAAoD,CAAA;AAEvF,MAAM,MAAM,cAAc,CAAC,OAAO,SAAS,OAAO,GAAG,IAAI,GAAG,IAAI,IAAI,YAAY,CAC9E,OAAO,EACP;IACE,WAAW,CAAC,EAAE,yBAAyB,EAAE,CAAA;IACzC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,EACD,OAAO,SAAS,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,oBAAoB,CACnE,CAAA"}
@@ -1,9 +1,11 @@
1
1
  import { ModuleConfig } from '@xyo-network/module-model';
2
2
  import { Payload } from '@xyo-network/payload-model';
3
+ import { SentinelAutomationPayload } from './Automation';
3
4
  import { Task } from './Task';
4
5
  export type SentinelConfigSchema = 'network.xyo.sentinel.config';
5
6
  export declare const SentinelConfigSchema: SentinelConfigSchema;
6
7
  export type SentinelConfig<TConfig extends Payload | void = void> = ModuleConfig<TConfig, {
8
+ automations?: SentinelAutomationPayload[];
7
9
  synchronous?: boolean;
8
10
  tasks: Task[];
9
11
  throwErrors?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEpD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,MAAM,MAAM,oBAAoB,GAAG,6BAA6B,CAAA;AAChE,eAAO,MAAM,oBAAoB,EAAE,oBAAoD,CAAA;AAEvF,MAAM,MAAM,cAAc,CAAC,OAAO,SAAS,OAAO,GAAG,IAAI,GAAG,IAAI,IAAI,YAAY,CAC9E,OAAO,EACP;IACE,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,EACD,OAAO,SAAS,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,oBAAoB,CACnE,CAAA"}
1
+ {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,MAAM,MAAM,oBAAoB,GAAG,6BAA6B,CAAA;AAChE,eAAO,MAAM,oBAAoB,EAAE,oBAAoD,CAAA;AAEvF,MAAM,MAAM,cAAc,CAAC,OAAO,SAAS,OAAO,GAAG,IAAI,GAAG,IAAI,IAAI,YAAY,CAC9E,OAAO,EACP;IACE,WAAW,CAAC,EAAE,yBAAyB,EAAE,CAAA;IACzC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,EACD,OAAO,SAAS,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,oBAAoB,CACnE,CAAA"}
@@ -20,17 +20,28 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var src_exports = {};
22
22
  __export(src_exports, {
23
+ SentinelAutomationSchema: () => SentinelAutomationSchema,
23
24
  SentinelConfigSchema: () => SentinelConfigSchema,
25
+ SentinelEventAutomationSchema: () => SentinelEventAutomationSchema,
26
+ SentinelIntervalAutomationSchema: () => SentinelIntervalAutomationSchema,
24
27
  SentinelReportQuerySchema: () => SentinelReportQuerySchema,
25
28
  asSentinelInstance: () => asSentinelInstance,
26
29
  asSentinelModule: () => asSentinelModule,
27
30
  isSentinelInstance: () => isSentinelInstance,
31
+ isSentinelIntervalAutomation: () => isSentinelIntervalAutomation,
28
32
  isSentinelModule: () => isSentinelModule,
29
33
  withSentinelInstance: () => withSentinelInstance,
30
34
  withSentinelModule: () => withSentinelModule
31
35
  });
32
36
  module.exports = __toCommonJS(src_exports);
33
37
 
38
+ // src/Automation.ts
39
+ var import_payload_model = require("@xyo-network/payload-model");
40
+ var SentinelAutomationSchema = "network.xyo.automation";
41
+ var SentinelIntervalAutomationSchema = "network.xyo.automation.interval";
42
+ var SentinelEventAutomationSchema = "network.xyo.automation.event";
43
+ var isSentinelIntervalAutomation = (0, import_payload_model.isPayloadOfSchemaType)(SentinelIntervalAutomationSchema);
44
+
34
45
  // src/Config.ts
35
46
  var SentinelConfigSchema = "network.xyo.sentinel.config";
36
47
 
@@ -48,11 +59,15 @@ var withSentinelModule = import_module_model.WithFactory.create(isSentinelModule
48
59
  var withSentinelInstance = import_module_model.WithFactory.create(isSentinelInstance);
49
60
  // Annotate the CommonJS export names for ESM import in node:
50
61
  0 && (module.exports = {
62
+ SentinelAutomationSchema,
51
63
  SentinelConfigSchema,
64
+ SentinelEventAutomationSchema,
65
+ SentinelIntervalAutomationSchema,
52
66
  SentinelReportQuerySchema,
53
67
  asSentinelInstance,
54
68
  asSentinelModule,
55
69
  isSentinelInstance,
70
+ isSentinelIntervalAutomation,
56
71
  isSentinelModule,
57
72
  withSentinelInstance,
58
73
  withSentinelModule
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts","../../src/Config.ts","../../src/Queries/Report.ts","../../src/typeChecks.ts"],"sourcesContent":["export * from './Config'\nexport * from './EventData'\nexport * from './EventsModels'\nexport * from './Instance'\nexport * from './Job'\nexport * from './Module'\nexport * from './Params'\nexport * from './Queries'\nexport * from './ResolvedTask'\nexport * from './Sentinel'\nexport * from './Task'\nexport * from './typeChecks'\n","import { ModuleConfig } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { Task } from './Task'\n\nexport type SentinelConfigSchema = 'network.xyo.sentinel.config'\nexport const SentinelConfigSchema: SentinelConfigSchema = 'network.xyo.sentinel.config'\n\nexport type SentinelConfig<TConfig extends Payload | void = void> = ModuleConfig<\n TConfig,\n {\n synchronous?: boolean\n tasks: Task[]\n throwErrors?: boolean\n },\n TConfig extends Payload ? TConfig['schema'] : SentinelConfigSchema\n>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type SentinelReportQuerySchema = 'network.xyo.query.sentinel.report'\nexport const SentinelReportQuerySchema: SentinelReportQuerySchema = 'network.xyo.query.sentinel.report'\n\nexport type SentinelReportQuery = Query<{\n schema: SentinelReportQuerySchema\n}>\n","import { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'\nimport { AsObjectFactory } from '@xyo-network/object'\n\nimport { SentinelInstance } from './Instance'\nimport { SentinelModule } from './Module'\nimport { SentinelReportQuerySchema } from './Queries'\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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACMO,IAAM,uBAA6C;;;ACHnD,IAAM,4BAAuD;;;ACHpE,0BAAkF;AAClF,oBAAgC;AAMzB,IAAM,qBAAqB,IAAI,sCAAoC,EAAE,OAAO,EAAE,QAAQ,WAAW,GAAG,CAAC,oCAAgB,CAAC;AACtH,IAAM,mBAAmB,IAAI,oCAAgC,EAAE,OAAO,CAAC,yBAAyB,CAAC;AAEjG,IAAM,mBAAmB,8BAAgB,OAAO,gBAAgB;AAChE,IAAM,qBAAqB,8BAAgB,OAAO,kBAAkB;AACpE,IAAM,qBAAqB,gCAAY,OAAO,gBAAgB;AAC9D,IAAM,uBAAuB,gCAAY,OAAO,kBAAkB;","names":[]}
1
+ {"version":3,"sources":["../../src/index.ts","../../src/Automation.ts","../../src/Config.ts","../../src/Queries/Report.ts","../../src/typeChecks.ts"],"sourcesContent":["export * from './Automation'\nexport * from './Config'\nexport * from './EventData'\nexport * from './EventsModels'\nexport * from './Instance'\nexport * from './Job'\nexport * from './Module'\nexport * from './Params'\nexport * from './Queries'\nexport * from './ResolvedTask'\nexport * from './Sentinel'\nexport * from './Task'\nexport * from './typeChecks'\n","import { isPayloadOfSchemaType, Payload } from '@xyo-network/payload-model'\n\nexport type SentinelAutomationSchema = 'network.xyo.automation'\nexport const SentinelAutomationSchema: SentinelAutomationSchema = 'network.xyo.automation'\n\nexport type SentinelIntervalAutomationSchema = 'network.xyo.automation.interval'\nexport const SentinelIntervalAutomationSchema: SentinelIntervalAutomationSchema = 'network.xyo.automation.interval'\n\nexport type SentinelEventAutomationSchema = 'network.xyo.automation.event'\nexport const SentinelEventAutomationSchema: SentinelEventAutomationSchema = 'network.xyo.automation.event'\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'\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 { ModuleConfig } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { SentinelAutomationPayload } from './Automation'\nimport { Task } from './Task'\n\nexport type SentinelConfigSchema = 'network.xyo.sentinel.config'\nexport const SentinelConfigSchema: SentinelConfigSchema = 'network.xyo.sentinel.config'\n\nexport type SentinelConfig<TConfig extends Payload | void = void> = ModuleConfig<\n TConfig,\n {\n automations?: SentinelAutomationPayload[]\n synchronous?: boolean\n tasks: Task[]\n throwErrors?: boolean\n },\n TConfig extends Payload ? TConfig['schema'] : SentinelConfigSchema\n>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type SentinelReportQuerySchema = 'network.xyo.query.sentinel.report'\nexport const SentinelReportQuerySchema: SentinelReportQuerySchema = 'network.xyo.query.sentinel.report'\n\nexport type SentinelReportQuery = Query<{\n schema: SentinelReportQuerySchema\n}>\n","import { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'\nimport { AsObjectFactory } from '@xyo-network/object'\n\nimport { SentinelInstance } from './Instance'\nimport { SentinelModule } from './Module'\nimport { SentinelReportQuerySchema } from './Queries'\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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,2BAA+C;AAGxC,IAAM,2BAAqD;AAG3D,IAAM,mCAAqE;AAG3E,IAAM,gCAA+D;AA+BrE,IAAM,mCAA+B,4CAAyD,gCAAgC;;;ACjC9H,IAAM,uBAA6C;;;ACJnD,IAAM,4BAAuD;;;ACHpE,0BAAkF;AAClF,oBAAgC;AAMzB,IAAM,qBAAqB,IAAI,sCAAoC,EAAE,OAAO,EAAE,QAAQ,WAAW,GAAG,CAAC,oCAAgB,CAAC;AACtH,IAAM,mBAAmB,IAAI,oCAAgC,EAAE,OAAO,CAAC,yBAAyB,CAAC;AAEjG,IAAM,mBAAmB,8BAAgB,OAAO,gBAAgB;AAChE,IAAM,qBAAqB,8BAAgB,OAAO,kBAAkB;AACpE,IAAM,qBAAqB,gCAAY,OAAO,gBAAgB;AAC9D,IAAM,uBAAuB,gCAAY,OAAO,kBAAkB;","names":[]}
@@ -1,3 +1,4 @@
1
+ export * from './Automation';
1
2
  export * from './Config';
2
3
  export * from './EventData';
3
4
  export * from './EventsModels';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,OAAO,CAAA;AACrB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,OAAO,CAAA;AACrB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA"}
@@ -1,3 +1,4 @@
1
+ export * from './Automation';
1
2
  export * from './Config';
2
3
  export * from './EventData';
3
4
  export * from './EventsModels';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,OAAO,CAAA;AACrB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,OAAO,CAAA;AACrB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA"}
@@ -1,3 +1,4 @@
1
+ export * from './Automation';
1
2
  export * from './Config';
2
3
  export * from './EventData';
3
4
  export * from './EventsModels';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,OAAO,CAAA;AACrB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,OAAO,CAAA;AACrB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA"}
@@ -1,3 +1,10 @@
1
+ // src/Automation.ts
2
+ import { isPayloadOfSchemaType } from "@xyo-network/payload-model";
3
+ var SentinelAutomationSchema = "network.xyo.automation";
4
+ var SentinelIntervalAutomationSchema = "network.xyo.automation.interval";
5
+ var SentinelEventAutomationSchema = "network.xyo.automation.event";
6
+ var isSentinelIntervalAutomation = isPayloadOfSchemaType(SentinelIntervalAutomationSchema);
7
+
1
8
  // src/Config.ts
2
9
  var SentinelConfigSchema = "network.xyo.sentinel.config";
3
10
 
@@ -14,11 +21,15 @@ var asSentinelInstance = AsObjectFactory.create(isSentinelInstance);
14
21
  var withSentinelModule = WithFactory.create(isSentinelModule);
15
22
  var withSentinelInstance = WithFactory.create(isSentinelInstance);
16
23
  export {
24
+ SentinelAutomationSchema,
17
25
  SentinelConfigSchema,
26
+ SentinelEventAutomationSchema,
27
+ SentinelIntervalAutomationSchema,
18
28
  SentinelReportQuerySchema,
19
29
  asSentinelInstance,
20
30
  asSentinelModule,
21
31
  isSentinelInstance,
32
+ isSentinelIntervalAutomation,
22
33
  isSentinelModule,
23
34
  withSentinelInstance,
24
35
  withSentinelModule
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Config.ts","../../src/Queries/Report.ts","../../src/typeChecks.ts"],"sourcesContent":["import { ModuleConfig } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { Task } from './Task'\n\nexport type SentinelConfigSchema = 'network.xyo.sentinel.config'\nexport const SentinelConfigSchema: SentinelConfigSchema = 'network.xyo.sentinel.config'\n\nexport type SentinelConfig<TConfig extends Payload | void = void> = ModuleConfig<\n TConfig,\n {\n synchronous?: boolean\n tasks: Task[]\n throwErrors?: boolean\n },\n TConfig extends Payload ? TConfig['schema'] : SentinelConfigSchema\n>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type SentinelReportQuerySchema = 'network.xyo.query.sentinel.report'\nexport const SentinelReportQuerySchema: SentinelReportQuerySchema = 'network.xyo.query.sentinel.report'\n\nexport type SentinelReportQuery = Query<{\n schema: SentinelReportQuerySchema\n}>\n","import { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'\nimport { AsObjectFactory } from '@xyo-network/object'\n\nimport { SentinelInstance } from './Instance'\nimport { SentinelModule } from './Module'\nimport { SentinelReportQuerySchema } from './Queries'\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"],"mappings":";AAMO,IAAM,uBAA6C;;;ACHnD,IAAM,4BAAuD;;;ACHpE,SAAS,mBAAmB,iBAAiB,kBAAkB,mBAAmB;AAClF,SAAS,uBAAuB;AAMzB,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;","names":[]}
1
+ {"version":3,"sources":["../../src/Automation.ts","../../src/Config.ts","../../src/Queries/Report.ts","../../src/typeChecks.ts"],"sourcesContent":["import { isPayloadOfSchemaType, Payload } from '@xyo-network/payload-model'\n\nexport type SentinelAutomationSchema = 'network.xyo.automation'\nexport const SentinelAutomationSchema: SentinelAutomationSchema = 'network.xyo.automation'\n\nexport type SentinelIntervalAutomationSchema = 'network.xyo.automation.interval'\nexport const SentinelIntervalAutomationSchema: SentinelIntervalAutomationSchema = 'network.xyo.automation.interval'\n\nexport type SentinelEventAutomationSchema = 'network.xyo.automation.event'\nexport const SentinelEventAutomationSchema: SentinelEventAutomationSchema = 'network.xyo.automation.event'\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'\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 { ModuleConfig } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { SentinelAutomationPayload } from './Automation'\nimport { Task } from './Task'\n\nexport type SentinelConfigSchema = 'network.xyo.sentinel.config'\nexport const SentinelConfigSchema: SentinelConfigSchema = 'network.xyo.sentinel.config'\n\nexport type SentinelConfig<TConfig extends Payload | void = void> = ModuleConfig<\n TConfig,\n {\n automations?: SentinelAutomationPayload[]\n synchronous?: boolean\n tasks: Task[]\n throwErrors?: boolean\n },\n TConfig extends Payload ? TConfig['schema'] : SentinelConfigSchema\n>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type SentinelReportQuerySchema = 'network.xyo.query.sentinel.report'\nexport const SentinelReportQuerySchema: SentinelReportQuerySchema = 'network.xyo.query.sentinel.report'\n\nexport type SentinelReportQuery = Query<{\n schema: SentinelReportQuerySchema\n}>\n","import { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'\nimport { AsObjectFactory } from '@xyo-network/object'\n\nimport { SentinelInstance } from './Instance'\nimport { SentinelModule } from './Module'\nimport { SentinelReportQuerySchema } from './Queries'\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"],"mappings":";AAAA,SAAS,6BAAsC;AAGxC,IAAM,2BAAqD;AAG3D,IAAM,mCAAqE;AAG3E,IAAM,gCAA+D;AA+BrE,IAAM,+BAA+B,sBAAyD,gCAAgC;;;ACjC9H,IAAM,uBAA6C;;;ACJnD,IAAM,4BAAuD;;;ACHpE,SAAS,mBAAmB,iBAAiB,kBAAkB,mBAAmB;AAClF,SAAS,uBAAuB;AAMzB,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;","names":[]}
package/package.json CHANGED
@@ -11,14 +11,14 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@xylabs/promise": "^2.13.20",
14
- "@xyo-network/archivist-model": "~2.84.7",
15
- "@xyo-network/boundwitness-model": "~2.84.7",
16
- "@xyo-network/diviner-model": "~2.84.7",
17
- "@xyo-network/module-events": "~2.84.7",
18
- "@xyo-network/module-model": "~2.84.7",
19
- "@xyo-network/object": "~2.84.7",
20
- "@xyo-network/payload-model": "~2.84.7",
21
- "@xyo-network/witness-model": "~2.84.7"
14
+ "@xyo-network/archivist-model": "~2.84.8",
15
+ "@xyo-network/boundwitness-model": "~2.84.8",
16
+ "@xyo-network/diviner-model": "~2.84.8",
17
+ "@xyo-network/module-events": "~2.84.8",
18
+ "@xyo-network/module-model": "~2.84.8",
19
+ "@xyo-network/object": "~2.84.8",
20
+ "@xyo-network/payload-model": "~2.84.8",
21
+ "@xyo-network/witness-model": "~2.84.8"
22
22
  },
23
23
  "description": "Primary SDK for using XYO Protocol 2.0",
24
24
  "devDependencies": {
@@ -64,6 +64,6 @@
64
64
  "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
65
65
  },
66
66
  "sideEffects": false,
67
- "version": "2.84.7",
67
+ "version": "2.84.8",
68
68
  "type": "module"
69
69
  }
@@ -0,0 +1,53 @@
1
+ import { isPayloadOfSchemaType, Payload } from '@xyo-network/payload-model'
2
+
3
+ export type SentinelAutomationSchema = 'network.xyo.automation'
4
+ export const SentinelAutomationSchema: SentinelAutomationSchema = 'network.xyo.automation'
5
+
6
+ export type SentinelIntervalAutomationSchema = 'network.xyo.automation.interval'
7
+ export const SentinelIntervalAutomationSchema: SentinelIntervalAutomationSchema = 'network.xyo.automation.interval'
8
+
9
+ export type SentinelEventAutomationSchema = 'network.xyo.automation.event'
10
+ export const SentinelEventAutomationSchema: SentinelEventAutomationSchema = 'network.xyo.automation.event'
11
+
12
+ export type SentinelBaseAutomationPayload<T extends Payload> = Payload<
13
+ {
14
+ type?: 'interval' | 'event'
15
+ } & T
16
+ >
17
+
18
+ /** Settings for an Interval Automation */
19
+ export type SentinelIntervalAutomationPayload = SentinelBaseAutomationPayload<{
20
+ /** Epoch after which any reoccurrence stops */
21
+ end?: number
22
+
23
+ /** Time between triggers [non-repeating if undefined] */
24
+ frequency?: number
25
+
26
+ /** Units for frequency field [hour if undefined] */
27
+ frequencyUnits?: 'second' | 'minute' | 'hour' | 'day'
28
+
29
+ /** Remaining triggers [infinite if undefined] */
30
+ remaining?: number
31
+
32
+ schema: SentinelIntervalAutomationSchema
33
+
34
+ /** Epoch of the next trigger */
35
+ start: number
36
+
37
+ /** The type of automation */
38
+ type: 'interval'
39
+ }>
40
+
41
+ export const isSentinelIntervalAutomation = isPayloadOfSchemaType<SentinelIntervalAutomationPayload>(SentinelIntervalAutomationSchema)
42
+
43
+ /** Settings for an Event Automation */
44
+ export type SentinelEventAutomationPayload = SentinelBaseAutomationPayload<{
45
+ schema: SentinelEventAutomationSchema
46
+ type: 'event'
47
+ }>
48
+
49
+ /** Settings for an Automation */
50
+ export type SentinelAutomationPayload = Payload<
51
+ SentinelIntervalAutomationPayload | SentinelEventAutomationPayload,
52
+ SentinelAutomationSchema | SentinelIntervalAutomationSchema | SentinelEventAutomationSchema
53
+ >
package/src/Config.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { ModuleConfig } from '@xyo-network/module-model'
2
2
  import { Payload } from '@xyo-network/payload-model'
3
3
 
4
+ import { SentinelAutomationPayload } from './Automation'
4
5
  import { Task } from './Task'
5
6
 
6
7
  export type SentinelConfigSchema = 'network.xyo.sentinel.config'
@@ -9,6 +10,7 @@ export const SentinelConfigSchema: SentinelConfigSchema = 'network.xyo.sentinel.
9
10
  export type SentinelConfig<TConfig extends Payload | void = void> = ModuleConfig<
10
11
  TConfig,
11
12
  {
13
+ automations?: SentinelAutomationPayload[]
12
14
  synchronous?: boolean
13
15
  tasks: Task[]
14
16
  throwErrors?: boolean
package/src/index.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './Automation'
1
2
  export * from './Config'
2
3
  export * from './EventData'
3
4
  export * from './EventsModels'