@xyo-network/sentinel 2.84.6 → 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.
- package/dist/browser/MemorySentinel.d.cts +3 -0
- package/dist/browser/MemorySentinel.d.cts.map +1 -1
- package/dist/browser/MemorySentinel.d.mts +3 -0
- package/dist/browser/MemorySentinel.d.mts.map +1 -1
- package/dist/browser/MemorySentinel.d.ts +3 -0
- package/dist/browser/MemorySentinel.d.ts.map +1 -1
- package/dist/browser/SentinelIntervalAutomationWrapper.d.cts +11 -1
- package/dist/browser/SentinelIntervalAutomationWrapper.d.cts.map +1 -1
- package/dist/browser/SentinelIntervalAutomationWrapper.d.mts +11 -1
- package/dist/browser/SentinelIntervalAutomationWrapper.d.mts.map +1 -1
- package/dist/browser/SentinelIntervalAutomationWrapper.d.ts +11 -1
- package/dist/browser/SentinelIntervalAutomationWrapper.d.ts.map +1 -1
- package/dist/browser/SentinelRunner.d.cts +1 -2
- package/dist/browser/SentinelRunner.d.cts.map +1 -1
- package/dist/browser/SentinelRunner.d.mts +1 -2
- package/dist/browser/SentinelRunner.d.mts.map +1 -1
- package/dist/browser/SentinelRunner.d.ts +1 -2
- package/dist/browser/SentinelRunner.d.ts.map +1 -1
- package/dist/browser/index.cjs +148 -110
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.d.cts +0 -1
- package/dist/browser/index.d.cts.map +1 -1
- package/dist/browser/index.d.mts +0 -1
- package/dist/browser/index.d.mts.map +1 -1
- package/dist/browser/index.d.ts +0 -1
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js +143 -103
- package/dist/browser/index.js.map +1 -1
- package/dist/node/MemorySentinel.d.cts +3 -0
- package/dist/node/MemorySentinel.d.cts.map +1 -1
- package/dist/node/MemorySentinel.d.mts +3 -0
- package/dist/node/MemorySentinel.d.mts.map +1 -1
- package/dist/node/MemorySentinel.d.ts +3 -0
- package/dist/node/MemorySentinel.d.ts.map +1 -1
- package/dist/node/SentinelIntervalAutomationWrapper.d.cts +11 -1
- package/dist/node/SentinelIntervalAutomationWrapper.d.cts.map +1 -1
- package/dist/node/SentinelIntervalAutomationWrapper.d.mts +11 -1
- package/dist/node/SentinelIntervalAutomationWrapper.d.mts.map +1 -1
- package/dist/node/SentinelIntervalAutomationWrapper.d.ts +11 -1
- package/dist/node/SentinelIntervalAutomationWrapper.d.ts.map +1 -1
- package/dist/node/SentinelRunner.d.cts +1 -2
- package/dist/node/SentinelRunner.d.cts.map +1 -1
- package/dist/node/SentinelRunner.d.mts +1 -2
- package/dist/node/SentinelRunner.d.mts.map +1 -1
- package/dist/node/SentinelRunner.d.ts +1 -2
- package/dist/node/SentinelRunner.d.ts.map +1 -1
- package/dist/node/index.cjs +150 -114
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +0 -1
- package/dist/node/index.d.cts.map +1 -1
- package/dist/node/index.d.mts +0 -1
- package/dist/node/index.d.mts.map +1 -1
- package/dist/node/index.d.ts +0 -1
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +145 -103
- package/dist/node/index.js.map +1 -1
- package/package.json +18 -18
- package/src/MemorySentinel.ts +28 -5
- package/src/SentinelIntervalAutomationWrapper.ts +41 -18
- package/src/SentinelRunner.ts +27 -19
- package/src/Wrapper.ts +2 -2
- package/src/index.ts +0 -1
- package/dist/browser/Automation.d.cts +0 -71
- package/dist/browser/Automation.d.cts.map +0 -1
- package/dist/browser/Automation.d.mts +0 -71
- package/dist/browser/Automation.d.mts.map +0 -1
- package/dist/browser/Automation.d.ts +0 -71
- package/dist/browser/Automation.d.ts.map +0 -1
- package/dist/node/Automation.d.cts +0 -71
- package/dist/node/Automation.d.cts.map +0 -1
- package/dist/node/Automation.d.mts +0 -71
- package/dist/node/Automation.d.mts.map +0 -1
- package/dist/node/Automation.d.ts +0 -71
- package/dist/node/Automation.d.ts.map +0 -1
- package/src/Automation.ts +0 -55
package/src/SentinelRunner.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { assertEx } from '@xylabs/assert'
|
|
2
2
|
import { Payload } from '@xyo-network/payload-model'
|
|
3
3
|
import { PayloadWrapper } from '@xyo-network/payload-wrapper'
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
isSentinelIntervalAutomation,
|
|
6
|
+
SentinelAutomationPayload,
|
|
7
|
+
SentinelInstance,
|
|
8
|
+
SentinelIntervalAutomationPayload,
|
|
9
|
+
} from '@xyo-network/sentinel-model'
|
|
5
10
|
|
|
6
|
-
import { isSentinelIntervalAutomation, SentinelAutomationPayload, SentinelIntervalAutomationPayload } from './Automation'
|
|
7
11
|
import { SentinelIntervalAutomationWrapper } from './SentinelIntervalAutomationWrapper'
|
|
8
12
|
|
|
9
13
|
export type OnSentinelRunnerTriggerResult = (result: Payload[]) => void
|
|
@@ -17,7 +21,7 @@ export class SentinelRunner {
|
|
|
17
21
|
constructor(sentinel: SentinelInstance, automations?: SentinelAutomationPayload[], onTriggerResult?: OnSentinelRunnerTriggerResult) {
|
|
18
22
|
this.sentinel = sentinel
|
|
19
23
|
this.onTriggerResult = onTriggerResult
|
|
20
|
-
automations
|
|
24
|
+
if (automations) for (const automation of automations) this.add(automation)
|
|
21
25
|
}
|
|
22
26
|
|
|
23
27
|
get automations() {
|
|
@@ -25,13 +29,13 @@ export class SentinelRunner {
|
|
|
25
29
|
}
|
|
26
30
|
|
|
27
31
|
private get next() {
|
|
32
|
+
// eslint-disable-next-line unicorn/no-array-reduce
|
|
28
33
|
return Object.values(this._automations).reduce<SentinelAutomationPayload | undefined>((previous, current) => {
|
|
29
|
-
if (isSentinelIntervalAutomation(current)) {
|
|
30
|
-
|
|
31
|
-
return current.start < (previous?.start ?? Infinity) ? current : previous
|
|
32
|
-
}
|
|
34
|
+
if (isSentinelIntervalAutomation(current) && isSentinelIntervalAutomation(previous)) {
|
|
35
|
+
return current.start < (previous?.start ?? Number.POSITIVE_INFINITY) ? current : previous
|
|
33
36
|
}
|
|
34
37
|
return current
|
|
38
|
+
// eslint-disable-next-line unicorn/no-useless-undefined
|
|
35
39
|
}, undefined)
|
|
36
40
|
}
|
|
37
41
|
|
|
@@ -62,21 +66,25 @@ export class SentinelRunner {
|
|
|
62
66
|
}
|
|
63
67
|
|
|
64
68
|
async start() {
|
|
69
|
+
// NOTE: Keep async to match module start signature
|
|
70
|
+
await Promise.resolve()
|
|
65
71
|
assertEx(this.timeoutId === undefined, 'Already started')
|
|
66
72
|
const automation = this.next
|
|
67
73
|
if (isSentinelIntervalAutomation(automation)) {
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
this.
|
|
74
|
+
const now = Date.now()
|
|
75
|
+
const start = Math.max(automation.start ?? now, now)
|
|
76
|
+
const delay = Math.max(start - now, 0)
|
|
77
|
+
if (delay < Number.POSITIVE_INFINITY) {
|
|
78
|
+
this.timeoutId = setTimeout(async () => {
|
|
79
|
+
try {
|
|
80
|
+
// Run the automation
|
|
81
|
+
await this.trigger(automation)
|
|
82
|
+
this.stop()
|
|
83
|
+
} finally {
|
|
84
|
+
// No matter what start the next automation
|
|
76
85
|
await this.start()
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
)
|
|
86
|
+
}
|
|
87
|
+
}, delay)
|
|
80
88
|
}
|
|
81
89
|
}
|
|
82
90
|
}
|
|
@@ -101,6 +109,6 @@ export class SentinelRunner {
|
|
|
101
109
|
await this.add(wrapper.jsonPayload(), false)
|
|
102
110
|
const triggerResult = await this.sentinel.report()
|
|
103
111
|
this.onTriggerResult?.(triggerResult)
|
|
104
|
-
await this.start()
|
|
112
|
+
// await this.start()
|
|
105
113
|
}
|
|
106
114
|
}
|
package/src/Wrapper.ts
CHANGED
|
@@ -21,7 +21,7 @@ export class SentinelWrapper<TModule extends SentinelModule = SentinelModule>
|
|
|
21
21
|
static override requiredQueries = [SentinelReportQuerySchema, ...super.requiredQueries]
|
|
22
22
|
|
|
23
23
|
archivists(): Promise<ArchivistInstance[]> {
|
|
24
|
-
throw Error('Not supported')
|
|
24
|
+
throw new Error('Not supported')
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
async report(payloads?: Payload[]): Promise<Payload[]> {
|
|
@@ -31,6 +31,6 @@ export class SentinelWrapper<TModule extends SentinelModule = SentinelModule>
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
witnesses(): Promise<WitnessInstance[]> {
|
|
34
|
-
throw Error('Not supported')
|
|
34
|
+
throw new Error('Not supported')
|
|
35
35
|
}
|
|
36
36
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { Payload } from '@xyo-network/payload-model';
|
|
2
|
-
import { Task } from '@xyo-network/sentinel-model';
|
|
3
|
-
export type SentinelAutomationSchema = 'network.xyo.automation';
|
|
4
|
-
export declare const SentinelAutomationSchema: SentinelAutomationSchema;
|
|
5
|
-
export type SentinelIntervalAutomationSchema = 'network.xyo.automation.interval';
|
|
6
|
-
export declare const SentinelIntervalAutomationSchema: SentinelIntervalAutomationSchema;
|
|
7
|
-
export type SentinelEventAutomationSchema = 'network.xyo.automation.event';
|
|
8
|
-
export declare const SentinelEventAutomationSchema: SentinelEventAutomationSchema;
|
|
9
|
-
export type SentinelBaseAutomationPayload<T extends Payload> = Payload<{
|
|
10
|
-
tasks?: Task[];
|
|
11
|
-
type?: 'interval' | 'event';
|
|
12
|
-
} & T>;
|
|
13
|
-
/** Settings for an Interval Automation */
|
|
14
|
-
export type SentinelIntervalAutomationPayload = SentinelBaseAutomationPayload<{
|
|
15
|
-
/** Epoch after which any reoccurrence stops */
|
|
16
|
-
end?: number;
|
|
17
|
-
/** Time between triggers [non-repeating if undefined] */
|
|
18
|
-
frequency?: number;
|
|
19
|
-
/** Units for frequency field [hour if undefined] */
|
|
20
|
-
frequencyUnits?: 'second' | 'minute' | 'hour' | 'day';
|
|
21
|
-
/** Remaining triggers [infinite if undefined] */
|
|
22
|
-
remaining?: number;
|
|
23
|
-
schema: SentinelIntervalAutomationSchema;
|
|
24
|
-
/** Epoch of the next trigger */
|
|
25
|
-
start: number;
|
|
26
|
-
/** The type of automation */
|
|
27
|
-
type: 'interval';
|
|
28
|
-
}>;
|
|
29
|
-
export declare const isSentinelIntervalAutomation: (x?: unknown) => x is (import("@xyo-network/payload-model").SchemaFields & object & {
|
|
30
|
-
tasks?: Task[] | undefined;
|
|
31
|
-
type?: "interval" | "event" | undefined;
|
|
32
|
-
} & {
|
|
33
|
-
/** Epoch after which any reoccurrence stops */
|
|
34
|
-
end?: number | undefined;
|
|
35
|
-
/** Time between triggers [non-repeating if undefined] */
|
|
36
|
-
frequency?: number | undefined;
|
|
37
|
-
/** Units for frequency field [hour if undefined] */
|
|
38
|
-
frequencyUnits?: "second" | "minute" | "hour" | "day" | undefined;
|
|
39
|
-
/** Remaining triggers [infinite if undefined] */
|
|
40
|
-
remaining?: number | undefined;
|
|
41
|
-
schema: SentinelIntervalAutomationSchema;
|
|
42
|
-
/** Epoch of the next trigger */
|
|
43
|
-
start: number;
|
|
44
|
-
/** The type of automation */
|
|
45
|
-
type: 'interval';
|
|
46
|
-
}) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadMetaFields & {
|
|
47
|
-
tasks?: Task[] | undefined;
|
|
48
|
-
type?: "interval" | "event" | undefined;
|
|
49
|
-
} & {
|
|
50
|
-
/** Epoch after which any reoccurrence stops */
|
|
51
|
-
end?: number | undefined;
|
|
52
|
-
/** Time between triggers [non-repeating if undefined] */
|
|
53
|
-
frequency?: number | undefined;
|
|
54
|
-
/** Units for frequency field [hour if undefined] */
|
|
55
|
-
frequencyUnits?: "second" | "minute" | "hour" | "day" | undefined;
|
|
56
|
-
/** Remaining triggers [infinite if undefined] */
|
|
57
|
-
remaining?: number | undefined;
|
|
58
|
-
schema: SentinelIntervalAutomationSchema;
|
|
59
|
-
/** Epoch of the next trigger */
|
|
60
|
-
start: number;
|
|
61
|
-
/** The type of automation */
|
|
62
|
-
type: 'interval';
|
|
63
|
-
});
|
|
64
|
-
/** Settings for an Event Automation */
|
|
65
|
-
export type SentinelEventAutomationPayload = SentinelBaseAutomationPayload<{
|
|
66
|
-
schema: SentinelEventAutomationSchema;
|
|
67
|
-
type: 'event';
|
|
68
|
-
}>;
|
|
69
|
-
/** Settings for an Automation */
|
|
70
|
-
export type SentinelAutomationPayload = Payload<SentinelIntervalAutomationPayload | SentinelEventAutomationPayload, SentinelAutomationSchema | SentinelIntervalAutomationSchema | SentinelEventAutomationSchema>;
|
|
71
|
-
//# sourceMappingURL=Automation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Automation.d.ts","sourceRoot":"","sources":["../../src/Automation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AAElD,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,KAAK,CAAC,EAAE,IAAI,EAAE,CAAA;IACd,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,71 +0,0 @@
|
|
|
1
|
-
import { Payload } from '@xyo-network/payload-model';
|
|
2
|
-
import { Task } from '@xyo-network/sentinel-model';
|
|
3
|
-
export type SentinelAutomationSchema = 'network.xyo.automation';
|
|
4
|
-
export declare const SentinelAutomationSchema: SentinelAutomationSchema;
|
|
5
|
-
export type SentinelIntervalAutomationSchema = 'network.xyo.automation.interval';
|
|
6
|
-
export declare const SentinelIntervalAutomationSchema: SentinelIntervalAutomationSchema;
|
|
7
|
-
export type SentinelEventAutomationSchema = 'network.xyo.automation.event';
|
|
8
|
-
export declare const SentinelEventAutomationSchema: SentinelEventAutomationSchema;
|
|
9
|
-
export type SentinelBaseAutomationPayload<T extends Payload> = Payload<{
|
|
10
|
-
tasks?: Task[];
|
|
11
|
-
type?: 'interval' | 'event';
|
|
12
|
-
} & T>;
|
|
13
|
-
/** Settings for an Interval Automation */
|
|
14
|
-
export type SentinelIntervalAutomationPayload = SentinelBaseAutomationPayload<{
|
|
15
|
-
/** Epoch after which any reoccurrence stops */
|
|
16
|
-
end?: number;
|
|
17
|
-
/** Time between triggers [non-repeating if undefined] */
|
|
18
|
-
frequency?: number;
|
|
19
|
-
/** Units for frequency field [hour if undefined] */
|
|
20
|
-
frequencyUnits?: 'second' | 'minute' | 'hour' | 'day';
|
|
21
|
-
/** Remaining triggers [infinite if undefined] */
|
|
22
|
-
remaining?: number;
|
|
23
|
-
schema: SentinelIntervalAutomationSchema;
|
|
24
|
-
/** Epoch of the next trigger */
|
|
25
|
-
start: number;
|
|
26
|
-
/** The type of automation */
|
|
27
|
-
type: 'interval';
|
|
28
|
-
}>;
|
|
29
|
-
export declare const isSentinelIntervalAutomation: (x?: unknown) => x is (import("@xyo-network/payload-model").SchemaFields & object & {
|
|
30
|
-
tasks?: Task[] | undefined;
|
|
31
|
-
type?: "interval" | "event" | undefined;
|
|
32
|
-
} & {
|
|
33
|
-
/** Epoch after which any reoccurrence stops */
|
|
34
|
-
end?: number | undefined;
|
|
35
|
-
/** Time between triggers [non-repeating if undefined] */
|
|
36
|
-
frequency?: number | undefined;
|
|
37
|
-
/** Units for frequency field [hour if undefined] */
|
|
38
|
-
frequencyUnits?: "second" | "minute" | "hour" | "day" | undefined;
|
|
39
|
-
/** Remaining triggers [infinite if undefined] */
|
|
40
|
-
remaining?: number | undefined;
|
|
41
|
-
schema: SentinelIntervalAutomationSchema;
|
|
42
|
-
/** Epoch of the next trigger */
|
|
43
|
-
start: number;
|
|
44
|
-
/** The type of automation */
|
|
45
|
-
type: 'interval';
|
|
46
|
-
}) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadMetaFields & {
|
|
47
|
-
tasks?: Task[] | undefined;
|
|
48
|
-
type?: "interval" | "event" | undefined;
|
|
49
|
-
} & {
|
|
50
|
-
/** Epoch after which any reoccurrence stops */
|
|
51
|
-
end?: number | undefined;
|
|
52
|
-
/** Time between triggers [non-repeating if undefined] */
|
|
53
|
-
frequency?: number | undefined;
|
|
54
|
-
/** Units for frequency field [hour if undefined] */
|
|
55
|
-
frequencyUnits?: "second" | "minute" | "hour" | "day" | undefined;
|
|
56
|
-
/** Remaining triggers [infinite if undefined] */
|
|
57
|
-
remaining?: number | undefined;
|
|
58
|
-
schema: SentinelIntervalAutomationSchema;
|
|
59
|
-
/** Epoch of the next trigger */
|
|
60
|
-
start: number;
|
|
61
|
-
/** The type of automation */
|
|
62
|
-
type: 'interval';
|
|
63
|
-
});
|
|
64
|
-
/** Settings for an Event Automation */
|
|
65
|
-
export type SentinelEventAutomationPayload = SentinelBaseAutomationPayload<{
|
|
66
|
-
schema: SentinelEventAutomationSchema;
|
|
67
|
-
type: 'event';
|
|
68
|
-
}>;
|
|
69
|
-
/** Settings for an Automation */
|
|
70
|
-
export type SentinelAutomationPayload = Payload<SentinelIntervalAutomationPayload | SentinelEventAutomationPayload, SentinelAutomationSchema | SentinelIntervalAutomationSchema | SentinelEventAutomationSchema>;
|
|
71
|
-
//# sourceMappingURL=Automation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Automation.d.ts","sourceRoot":"","sources":["../../src/Automation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AAElD,MAAM,MAAM,wBAAwB,GAAG,wBAAwB,CAAA;AAC/D,eAAO,MAAM,wBAAwB,EAAE,wBAAmD,CAAA;AAE1F,MAAM,MAAM,gCAAgC,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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,71 +0,0 @@
|
|
|
1
|
-
import { Payload } from '@xyo-network/payload-model';
|
|
2
|
-
import { Task } from '@xyo-network/sentinel-model';
|
|
3
|
-
export type SentinelAutomationSchema = 'network.xyo.automation';
|
|
4
|
-
export declare const SentinelAutomationSchema: SentinelAutomationSchema;
|
|
5
|
-
export type SentinelIntervalAutomationSchema = 'network.xyo.automation.interval';
|
|
6
|
-
export declare const SentinelIntervalAutomationSchema: SentinelIntervalAutomationSchema;
|
|
7
|
-
export type SentinelEventAutomationSchema = 'network.xyo.automation.event';
|
|
8
|
-
export declare const SentinelEventAutomationSchema: SentinelEventAutomationSchema;
|
|
9
|
-
export type SentinelBaseAutomationPayload<T extends Payload> = Payload<{
|
|
10
|
-
tasks?: Task[];
|
|
11
|
-
type?: 'interval' | 'event';
|
|
12
|
-
} & T>;
|
|
13
|
-
/** Settings for an Interval Automation */
|
|
14
|
-
export type SentinelIntervalAutomationPayload = SentinelBaseAutomationPayload<{
|
|
15
|
-
/** Epoch after which any reoccurrence stops */
|
|
16
|
-
end?: number;
|
|
17
|
-
/** Time between triggers [non-repeating if undefined] */
|
|
18
|
-
frequency?: number;
|
|
19
|
-
/** Units for frequency field [hour if undefined] */
|
|
20
|
-
frequencyUnits?: 'second' | 'minute' | 'hour' | 'day';
|
|
21
|
-
/** Remaining triggers [infinite if undefined] */
|
|
22
|
-
remaining?: number;
|
|
23
|
-
schema: SentinelIntervalAutomationSchema;
|
|
24
|
-
/** Epoch of the next trigger */
|
|
25
|
-
start: number;
|
|
26
|
-
/** The type of automation */
|
|
27
|
-
type: 'interval';
|
|
28
|
-
}>;
|
|
29
|
-
export declare const isSentinelIntervalAutomation: (x?: unknown) => x is (import("@xyo-network/payload-model").SchemaFields & object & {
|
|
30
|
-
tasks?: Task[] | undefined;
|
|
31
|
-
type?: "interval" | "event" | undefined;
|
|
32
|
-
} & {
|
|
33
|
-
/** Epoch after which any reoccurrence stops */
|
|
34
|
-
end?: number | undefined;
|
|
35
|
-
/** Time between triggers [non-repeating if undefined] */
|
|
36
|
-
frequency?: number | undefined;
|
|
37
|
-
/** Units for frequency field [hour if undefined] */
|
|
38
|
-
frequencyUnits?: "second" | "minute" | "hour" | "day" | undefined;
|
|
39
|
-
/** Remaining triggers [infinite if undefined] */
|
|
40
|
-
remaining?: number | undefined;
|
|
41
|
-
schema: SentinelIntervalAutomationSchema;
|
|
42
|
-
/** Epoch of the next trigger */
|
|
43
|
-
start: number;
|
|
44
|
-
/** The type of automation */
|
|
45
|
-
type: 'interval';
|
|
46
|
-
}) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadMetaFields & {
|
|
47
|
-
tasks?: Task[] | undefined;
|
|
48
|
-
type?: "interval" | "event" | undefined;
|
|
49
|
-
} & {
|
|
50
|
-
/** Epoch after which any reoccurrence stops */
|
|
51
|
-
end?: number | undefined;
|
|
52
|
-
/** Time between triggers [non-repeating if undefined] */
|
|
53
|
-
frequency?: number | undefined;
|
|
54
|
-
/** Units for frequency field [hour if undefined] */
|
|
55
|
-
frequencyUnits?: "second" | "minute" | "hour" | "day" | undefined;
|
|
56
|
-
/** Remaining triggers [infinite if undefined] */
|
|
57
|
-
remaining?: number | undefined;
|
|
58
|
-
schema: SentinelIntervalAutomationSchema;
|
|
59
|
-
/** Epoch of the next trigger */
|
|
60
|
-
start: number;
|
|
61
|
-
/** The type of automation */
|
|
62
|
-
type: 'interval';
|
|
63
|
-
});
|
|
64
|
-
/** Settings for an Event Automation */
|
|
65
|
-
export type SentinelEventAutomationPayload = SentinelBaseAutomationPayload<{
|
|
66
|
-
schema: SentinelEventAutomationSchema;
|
|
67
|
-
type: 'event';
|
|
68
|
-
}>;
|
|
69
|
-
/** Settings for an Automation */
|
|
70
|
-
export type SentinelAutomationPayload = Payload<SentinelIntervalAutomationPayload | SentinelEventAutomationPayload, SentinelAutomationSchema | SentinelIntervalAutomationSchema | SentinelEventAutomationSchema>;
|
|
71
|
-
//# sourceMappingURL=Automation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Automation.d.ts","sourceRoot":"","sources":["../../src/Automation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AAElD,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,KAAK,CAAC,EAAE,IAAI,EAAE,CAAA;IACd,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,71 +0,0 @@
|
|
|
1
|
-
import { Payload } from '@xyo-network/payload-model';
|
|
2
|
-
import { Task } from '@xyo-network/sentinel-model';
|
|
3
|
-
export type SentinelAutomationSchema = 'network.xyo.automation';
|
|
4
|
-
export declare const SentinelAutomationSchema: SentinelAutomationSchema;
|
|
5
|
-
export type SentinelIntervalAutomationSchema = 'network.xyo.automation.interval';
|
|
6
|
-
export declare const SentinelIntervalAutomationSchema: SentinelIntervalAutomationSchema;
|
|
7
|
-
export type SentinelEventAutomationSchema = 'network.xyo.automation.event';
|
|
8
|
-
export declare const SentinelEventAutomationSchema: SentinelEventAutomationSchema;
|
|
9
|
-
export type SentinelBaseAutomationPayload<T extends Payload> = Payload<{
|
|
10
|
-
tasks?: Task[];
|
|
11
|
-
type?: 'interval' | 'event';
|
|
12
|
-
} & T>;
|
|
13
|
-
/** Settings for an Interval Automation */
|
|
14
|
-
export type SentinelIntervalAutomationPayload = SentinelBaseAutomationPayload<{
|
|
15
|
-
/** Epoch after which any reoccurrence stops */
|
|
16
|
-
end?: number;
|
|
17
|
-
/** Time between triggers [non-repeating if undefined] */
|
|
18
|
-
frequency?: number;
|
|
19
|
-
/** Units for frequency field [hour if undefined] */
|
|
20
|
-
frequencyUnits?: 'second' | 'minute' | 'hour' | 'day';
|
|
21
|
-
/** Remaining triggers [infinite if undefined] */
|
|
22
|
-
remaining?: number;
|
|
23
|
-
schema: SentinelIntervalAutomationSchema;
|
|
24
|
-
/** Epoch of the next trigger */
|
|
25
|
-
start: number;
|
|
26
|
-
/** The type of automation */
|
|
27
|
-
type: 'interval';
|
|
28
|
-
}>;
|
|
29
|
-
export declare const isSentinelIntervalAutomation: (x?: unknown) => x is (import("@xyo-network/payload-model").SchemaFields & object & {
|
|
30
|
-
tasks?: Task[] | undefined;
|
|
31
|
-
type?: "interval" | "event" | undefined;
|
|
32
|
-
} & {
|
|
33
|
-
/** Epoch after which any reoccurrence stops */
|
|
34
|
-
end?: number | undefined;
|
|
35
|
-
/** Time between triggers [non-repeating if undefined] */
|
|
36
|
-
frequency?: number | undefined;
|
|
37
|
-
/** Units for frequency field [hour if undefined] */
|
|
38
|
-
frequencyUnits?: "second" | "minute" | "hour" | "day" | undefined;
|
|
39
|
-
/** Remaining triggers [infinite if undefined] */
|
|
40
|
-
remaining?: number | undefined;
|
|
41
|
-
schema: SentinelIntervalAutomationSchema;
|
|
42
|
-
/** Epoch of the next trigger */
|
|
43
|
-
start: number;
|
|
44
|
-
/** The type of automation */
|
|
45
|
-
type: 'interval';
|
|
46
|
-
}) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadMetaFields & {
|
|
47
|
-
tasks?: Task[] | undefined;
|
|
48
|
-
type?: "interval" | "event" | undefined;
|
|
49
|
-
} & {
|
|
50
|
-
/** Epoch after which any reoccurrence stops */
|
|
51
|
-
end?: number | undefined;
|
|
52
|
-
/** Time between triggers [non-repeating if undefined] */
|
|
53
|
-
frequency?: number | undefined;
|
|
54
|
-
/** Units for frequency field [hour if undefined] */
|
|
55
|
-
frequencyUnits?: "second" | "minute" | "hour" | "day" | undefined;
|
|
56
|
-
/** Remaining triggers [infinite if undefined] */
|
|
57
|
-
remaining?: number | undefined;
|
|
58
|
-
schema: SentinelIntervalAutomationSchema;
|
|
59
|
-
/** Epoch of the next trigger */
|
|
60
|
-
start: number;
|
|
61
|
-
/** The type of automation */
|
|
62
|
-
type: 'interval';
|
|
63
|
-
});
|
|
64
|
-
/** Settings for an Event Automation */
|
|
65
|
-
export type SentinelEventAutomationPayload = SentinelBaseAutomationPayload<{
|
|
66
|
-
schema: SentinelEventAutomationSchema;
|
|
67
|
-
type: 'event';
|
|
68
|
-
}>;
|
|
69
|
-
/** Settings for an Automation */
|
|
70
|
-
export type SentinelAutomationPayload = Payload<SentinelIntervalAutomationPayload | SentinelEventAutomationPayload, SentinelAutomationSchema | SentinelIntervalAutomationSchema | SentinelEventAutomationSchema>;
|
|
71
|
-
//# sourceMappingURL=Automation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Automation.d.ts","sourceRoot":"","sources":["../../src/Automation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AAElD,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,C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load-model';
|
|
2
|
-
import { Task } from '@xyo-network/sentinel-model';
|
|
3
|
-
export type SentinelAutomationSchema = 'network.xyo.automation';
|
|
4
|
-
export declare const SentinelAutomationSchema: SentinelAutomationSchema;
|
|
5
|
-
export type SentinelIntervalAutomationSchema = 'network.xyo.automation.interval';
|
|
6
|
-
export declare const SentinelIntervalAutomationSchema: SentinelIntervalAutomationSchema;
|
|
7
|
-
export type SentinelEventAutomationSchema = 'network.xyo.automation.event';
|
|
8
|
-
export declare const SentinelEventAutomationSchema: SentinelEventAutomationSchema;
|
|
9
|
-
export type SentinelBaseAutomationPayload<T extends Payload> = Payload<{
|
|
10
|
-
tasks?: Task[];
|
|
11
|
-
type?: 'interval' | 'event';
|
|
12
|
-
} & T>;
|
|
13
|
-
/** Settings for an Interval Automation */
|
|
14
|
-
export type SentinelIntervalAutomationPayload = SentinelBaseAutomationPayload<{
|
|
15
|
-
/** Epoch after which any reoccurrence stops */
|
|
16
|
-
end?: number;
|
|
17
|
-
/** Time between triggers [non-repeating if undefined] */
|
|
18
|
-
frequency?: number;
|
|
19
|
-
/** Units for frequency field [hour if undefined] */
|
|
20
|
-
frequencyUnits?: 'second' | 'minute' | 'hour' | 'day';
|
|
21
|
-
/** Remaining triggers [infinite if undefined] */
|
|
22
|
-
remaining?: number;
|
|
23
|
-
schema: SentinelIntervalAutomationSchema;
|
|
24
|
-
/** Epoch of the next trigger */
|
|
25
|
-
start: number;
|
|
26
|
-
/** The type of automation */
|
|
27
|
-
type: 'interval';
|
|
28
|
-
}>;
|
|
29
|
-
export declare const isSentinelIntervalAutomation: (x?: unknown) => x is (import("@xyo-network/payload-model").SchemaFields & object & {
|
|
30
|
-
tasks?: Task[] | undefined;
|
|
31
|
-
type?: "interval" | "event" | undefined;
|
|
32
|
-
} & {
|
|
33
|
-
/** Epoch after which any reoccurrence stops */
|
|
34
|
-
end?: number | undefined;
|
|
35
|
-
/** Time between triggers [non-repeating if undefined] */
|
|
36
|
-
frequency?: number | undefined;
|
|
37
|
-
/** Units for frequency field [hour if undefined] */
|
|
38
|
-
frequencyUnits?: "second" | "minute" | "hour" | "day" | undefined;
|
|
39
|
-
/** Remaining triggers [infinite if undefined] */
|
|
40
|
-
remaining?: number | undefined;
|
|
41
|
-
schema: SentinelIntervalAutomationSchema;
|
|
42
|
-
/** Epoch of the next trigger */
|
|
43
|
-
start: number;
|
|
44
|
-
/** The type of automation */
|
|
45
|
-
type: 'interval';
|
|
46
|
-
}) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadMetaFields & {
|
|
47
|
-
tasks?: Task[] | undefined;
|
|
48
|
-
type?: "interval" | "event" | undefined;
|
|
49
|
-
} & {
|
|
50
|
-
/** Epoch after which any reoccurrence stops */
|
|
51
|
-
end?: number | undefined;
|
|
52
|
-
/** Time between triggers [non-repeating if undefined] */
|
|
53
|
-
frequency?: number | undefined;
|
|
54
|
-
/** Units for frequency field [hour if undefined] */
|
|
55
|
-
frequencyUnits?: "second" | "minute" | "hour" | "day" | undefined;
|
|
56
|
-
/** Remaining triggers [infinite if undefined] */
|
|
57
|
-
remaining?: number | undefined;
|
|
58
|
-
schema: SentinelIntervalAutomationSchema;
|
|
59
|
-
/** Epoch of the next trigger */
|
|
60
|
-
start: number;
|
|
61
|
-
/** The type of automation */
|
|
62
|
-
type: 'interval';
|
|
63
|
-
});
|
|
64
|
-
/** Settings for an Event Automation */
|
|
65
|
-
export type SentinelEventAutomationPayload = SentinelBaseAutomationPayload<{
|
|
66
|
-
schema: SentinelEventAutomationSchema;
|
|
67
|
-
type: 'event';
|
|
68
|
-
}>;
|
|
69
|
-
/** Settings for an Automation */
|
|
70
|
-
export type SentinelAutomationPayload = Payload<SentinelIntervalAutomationPayload | SentinelEventAutomationPayload, SentinelAutomationSchema | SentinelIntervalAutomationSchema | SentinelEventAutomationSchema>;
|
|
71
|
-
//# sourceMappingURL=Automation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Automation.d.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AAU;;;;;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,71 +0,0 @@
|
|
|
1
|
-
import { Payload } from '@xyo-network/payload-model';
|
|
2
|
-
import { Task } from '@xyo-network/sentinel-model';
|
|
3
|
-
export type SentinelAutomationSchema = 'network.xyo.automation';
|
|
4
|
-
export declare const SentinelAutomationSchema: SentinelAutomationSchema;
|
|
5
|
-
export type SentinelIntervalAutomationSchema = 'network.xyo.automation.interval';
|
|
6
|
-
export declare const SentinelIntervalAutomationSchema: SentinelIntervalAutomationSchema;
|
|
7
|
-
export type SentinelEventAutomationSchema = 'network.xyo.automation.event';
|
|
8
|
-
export declare const SentinelEventAutomationSchema: SentinelEventAutomationSchema;
|
|
9
|
-
export type SentinelBaseAutomationPayload<T extends Payload> = Payload<{
|
|
10
|
-
tasks?: Task[];
|
|
11
|
-
type?: 'interval' | 'event';
|
|
12
|
-
} & T>;
|
|
13
|
-
/** Settings for an Interval Automation */
|
|
14
|
-
export type SentinelIntervalAutomationPayload = SentinelBaseAutomationPayload<{
|
|
15
|
-
/** Epoch after which any reoccurrence stops */
|
|
16
|
-
end?: number;
|
|
17
|
-
/** Time between triggers [non-repeating if undefined] */
|
|
18
|
-
frequency?: number;
|
|
19
|
-
/** Units for frequency field [hour if undefined] */
|
|
20
|
-
frequencyUnits?: 'second' | 'minute' | 'hour' | 'day';
|
|
21
|
-
/** Remaining triggers [infinite if undefined] */
|
|
22
|
-
remaining?: number;
|
|
23
|
-
schema: SentinelIntervalAutomationSchema;
|
|
24
|
-
/** Epoch of the next trigger */
|
|
25
|
-
start: number;
|
|
26
|
-
/** The type of automation */
|
|
27
|
-
type: 'interval';
|
|
28
|
-
}>;
|
|
29
|
-
export declare const isSentinelIntervalAutomation: (x?: unknown) => x is (import("@xyo-network/payload-model").SchemaFields & object & {
|
|
30
|
-
tasks?: Task[] | undefined;
|
|
31
|
-
type?: "interval" | "event" | undefined;
|
|
32
|
-
} & {
|
|
33
|
-
/** Epoch after which any reoccurrence stops */
|
|
34
|
-
end?: number | undefined;
|
|
35
|
-
/** Time between triggers [non-repeating if undefined] */
|
|
36
|
-
frequency?: number | undefined;
|
|
37
|
-
/** Units for frequency field [hour if undefined] */
|
|
38
|
-
frequencyUnits?: "second" | "minute" | "hour" | "day" | undefined;
|
|
39
|
-
/** Remaining triggers [infinite if undefined] */
|
|
40
|
-
remaining?: number | undefined;
|
|
41
|
-
schema: SentinelIntervalAutomationSchema;
|
|
42
|
-
/** Epoch of the next trigger */
|
|
43
|
-
start: number;
|
|
44
|
-
/** The type of automation */
|
|
45
|
-
type: 'interval';
|
|
46
|
-
}) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadMetaFields & {
|
|
47
|
-
tasks?: Task[] | undefined;
|
|
48
|
-
type?: "interval" | "event" | undefined;
|
|
49
|
-
} & {
|
|
50
|
-
/** Epoch after which any reoccurrence stops */
|
|
51
|
-
end?: number | undefined;
|
|
52
|
-
/** Time between triggers [non-repeating if undefined] */
|
|
53
|
-
frequency?: number | undefined;
|
|
54
|
-
/** Units for frequency field [hour if undefined] */
|
|
55
|
-
frequencyUnits?: "second" | "minute" | "hour" | "day" | undefined;
|
|
56
|
-
/** Remaining triggers [infinite if undefined] */
|
|
57
|
-
remaining?: number | undefined;
|
|
58
|
-
schema: SentinelIntervalAutomationSchema;
|
|
59
|
-
/** Epoch of the next trigger */
|
|
60
|
-
start: number;
|
|
61
|
-
/** The type of automation */
|
|
62
|
-
type: 'interval';
|
|
63
|
-
});
|
|
64
|
-
/** Settings for an Event Automation */
|
|
65
|
-
export type SentinelEventAutomationPayload = SentinelBaseAutomationPayload<{
|
|
66
|
-
schema: SentinelEventAutomationSchema;
|
|
67
|
-
type: 'event';
|
|
68
|
-
}>;
|
|
69
|
-
/** Settings for an Automation */
|
|
70
|
-
export type SentinelAutomationPayload = Payload<SentinelIntervalAutomationPayload | SentinelEventAutomationPayload, SentinelAutomationSchema | SentinelIntervalAutomationSchema | SentinelEventAutomationSchema>;
|
|
71
|
-
//# sourceMappingURL=Automation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Automation.d.ts","sourceRoot":"","sources":["../../src/Automation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AAElD,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,KAAK,CAAC,EAAE,IAAI,EAAE,CAAA;IACd,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"}
|
package/src/Automation.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { isPayloadOfSchemaType, Payload } from '@xyo-network/payload-model'
|
|
2
|
-
import { Task } from '@xyo-network/sentinel-model'
|
|
3
|
-
|
|
4
|
-
export type SentinelAutomationSchema = 'network.xyo.automation'
|
|
5
|
-
export const SentinelAutomationSchema: SentinelAutomationSchema = 'network.xyo.automation'
|
|
6
|
-
|
|
7
|
-
export type SentinelIntervalAutomationSchema = 'network.xyo.automation.interval'
|
|
8
|
-
export const SentinelIntervalAutomationSchema: SentinelIntervalAutomationSchema = 'network.xyo.automation.interval'
|
|
9
|
-
|
|
10
|
-
export type SentinelEventAutomationSchema = 'network.xyo.automation.event'
|
|
11
|
-
export const SentinelEventAutomationSchema: SentinelEventAutomationSchema = 'network.xyo.automation.event'
|
|
12
|
-
|
|
13
|
-
export type SentinelBaseAutomationPayload<T extends Payload> = Payload<
|
|
14
|
-
{
|
|
15
|
-
tasks?: Task[]
|
|
16
|
-
type?: 'interval' | 'event'
|
|
17
|
-
} & T
|
|
18
|
-
>
|
|
19
|
-
|
|
20
|
-
/** Settings for an Interval Automation */
|
|
21
|
-
export type SentinelIntervalAutomationPayload = SentinelBaseAutomationPayload<{
|
|
22
|
-
/** Epoch after which any reoccurrence stops */
|
|
23
|
-
end?: number
|
|
24
|
-
|
|
25
|
-
/** Time between triggers [non-repeating if undefined] */
|
|
26
|
-
frequency?: number
|
|
27
|
-
|
|
28
|
-
/** Units for frequency field [hour if undefined] */
|
|
29
|
-
frequencyUnits?: 'second' | 'minute' | 'hour' | 'day'
|
|
30
|
-
|
|
31
|
-
/** Remaining triggers [infinite if undefined] */
|
|
32
|
-
remaining?: number
|
|
33
|
-
|
|
34
|
-
schema: SentinelIntervalAutomationSchema
|
|
35
|
-
|
|
36
|
-
/** Epoch of the next trigger */
|
|
37
|
-
start: number
|
|
38
|
-
|
|
39
|
-
/** The type of automation */
|
|
40
|
-
type: 'interval'
|
|
41
|
-
}>
|
|
42
|
-
|
|
43
|
-
export const isSentinelIntervalAutomation = isPayloadOfSchemaType<SentinelIntervalAutomationPayload>(SentinelIntervalAutomationSchema)
|
|
44
|
-
|
|
45
|
-
/** Settings for an Event Automation */
|
|
46
|
-
export type SentinelEventAutomationPayload = SentinelBaseAutomationPayload<{
|
|
47
|
-
schema: SentinelEventAutomationSchema
|
|
48
|
-
type: 'event'
|
|
49
|
-
}>
|
|
50
|
-
|
|
51
|
-
/** Settings for an Automation */
|
|
52
|
-
export type SentinelAutomationPayload = Payload<
|
|
53
|
-
SentinelIntervalAutomationPayload | SentinelEventAutomationPayload,
|
|
54
|
-
SentinelAutomationSchema | SentinelIntervalAutomationSchema | SentinelEventAutomationSchema
|
|
55
|
-
>
|