@xyo-network/sentinel-model 2.107.3 → 2.107.4
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/index.cjs +65 -1
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.js +42 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/neutral/index.cjs +65 -1
- package/dist/neutral/index.cjs.map +1 -1
- package/dist/neutral/index.js +42 -1
- package/dist/neutral/index.js.map +1 -1
- package/dist/node/index.cjs +80 -1
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js +42 -1
- package/dist/node/index.js.map +1 -1
- package/package.json +11 -11
package/dist/browser/index.cjs
CHANGED
|
@@ -1,2 +1,66 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
SentinelAutomationSchema: () => SentinelAutomationSchema,
|
|
24
|
+
SentinelConfigSchema: () => SentinelConfigSchema,
|
|
25
|
+
SentinelEventAutomationSchema: () => SentinelEventAutomationSchema,
|
|
26
|
+
SentinelIntervalAutomationSchema: () => SentinelIntervalAutomationSchema,
|
|
27
|
+
SentinelReportQuerySchema: () => SentinelReportQuerySchema,
|
|
28
|
+
asSentinelInstance: () => asSentinelInstance,
|
|
29
|
+
asSentinelModule: () => asSentinelModule,
|
|
30
|
+
isSentinelInstance: () => isSentinelInstance,
|
|
31
|
+
isSentinelIntervalAutomation: () => isSentinelIntervalAutomation,
|
|
32
|
+
isSentinelModule: () => isSentinelModule,
|
|
33
|
+
withSentinelInstance: () => withSentinelInstance,
|
|
34
|
+
withSentinelModule: () => withSentinelModule
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(src_exports);
|
|
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
|
+
|
|
45
|
+
// src/Config.ts
|
|
46
|
+
var SentinelConfigSchema = "network.xyo.sentinel.config";
|
|
47
|
+
|
|
48
|
+
// src/Queries/Report.ts
|
|
49
|
+
var SentinelReportQuerySchema = "network.xyo.query.sentinel.report";
|
|
50
|
+
|
|
51
|
+
// src/typeChecks.ts
|
|
52
|
+
var import_object = require("@xylabs/object");
|
|
53
|
+
var import_module_model = require("@xyo-network/module-model");
|
|
54
|
+
var isSentinelInstance = new import_module_model.IsInstanceFactory().create({
|
|
55
|
+
report: "function"
|
|
56
|
+
}, [
|
|
57
|
+
import_module_model.isModuleInstance
|
|
58
|
+
]);
|
|
59
|
+
var isSentinelModule = new import_module_model.IsModuleFactory().create([
|
|
60
|
+
SentinelReportQuerySchema
|
|
61
|
+
]);
|
|
62
|
+
var asSentinelModule = import_object.AsObjectFactory.create(isSentinelModule);
|
|
63
|
+
var asSentinelInstance = import_object.AsObjectFactory.create(isSentinelInstance);
|
|
64
|
+
var withSentinelModule = import_module_model.WithFactory.create(isSentinelModule);
|
|
65
|
+
var withSentinelInstance = import_module_model.WithFactory.create(isSentinelInstance);
|
|
2
66
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
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 { WithAdditional } from '@xylabs/object'\nimport { ModuleConfig } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { SentinelAutomationPayload } from './Automation'\nimport { Task } from './Task'\n\nexport const SentinelConfigSchema = 'network.xyo.sentinel.config' as const\nexport type SentinelConfigSchema = typeof SentinelConfigSchema\n\nexport type SentinelConfig<TConfig extends Payload | void = void, TSchema extends string | void = void> = ModuleConfig<\n WithAdditional<\n {\n automations?: SentinelAutomationPayload[]\n schema: TConfig extends Payload ? TConfig['schema'] : SentinelConfigSchema\n synchronous?: boolean\n tasks: Task[]\n throwErrors?: boolean\n },\n TConfig\n >,\n TSchema\n>\n","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 { AsObjectFactory } from '@xylabs/object'\nimport { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'\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":"
|
|
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 { WithAdditional } from '@xylabs/object'\nimport { ModuleConfig } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { SentinelAutomationPayload } from './Automation'\nimport { Task } from './Task'\n\nexport const SentinelConfigSchema = 'network.xyo.sentinel.config' as const\nexport type SentinelConfigSchema = typeof SentinelConfigSchema\n\nexport type SentinelConfig<TConfig extends Payload | void = void, TSchema extends string | void = void> = ModuleConfig<\n WithAdditional<\n {\n automations?: SentinelAutomationPayload[]\n schema: TConfig extends Payload ? TConfig['schema'] : SentinelConfigSchema\n synchronous?: boolean\n tasks: Task[]\n throwErrors?: boolean\n },\n TConfig\n >,\n TSchema\n>\n","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 { AsObjectFactory } from '@xylabs/object'\nimport { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'\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;;;;;;;;;;;;;;;;;;ACAA,2BAA+C;AAGxC,IAAMA,2BAAqD;AAG3D,IAAMC,mCAAqE;AAG3E,IAAMC,gCAA+D;AA+BrE,IAAMC,mCAA+BC,4CAAyDH,gCAAAA;;;ACjC9F,IAAMI,uBAAuB;;;ACJ7B,IAAMC,4BAAuD;;;ACHpE,oBAAgC;AAChC,0BAAkF;AAM3E,IAAMC,qBAAqB,IAAIC,sCAAAA,EAAsCC,OAAO;EAAEC,QAAQ;AAAW,GAAG;EAACC;CAAiB;AACtH,IAAMC,mBAAmB,IAAIC,oCAAAA,EAAkCJ,OAAO;EAACK;CAA0B;AAEjG,IAAMC,mBAAmBC,8BAAgBP,OAAOG,gBAAAA;AAChD,IAAMK,qBAAqBD,8BAAgBP,OAAOF,kBAAAA;AAClD,IAAMW,qBAAqBC,gCAAYV,OAAOG,gBAAAA;AAC9C,IAAMQ,uBAAuBD,gCAAYV,OAAOF,kBAAAA;","names":["SentinelAutomationSchema","SentinelIntervalAutomationSchema","SentinelEventAutomationSchema","isSentinelIntervalAutomation","isPayloadOfSchemaType","SentinelConfigSchema","SentinelReportQuerySchema","isSentinelInstance","IsInstanceFactory","create","report","isModuleInstance","isSentinelModule","IsModuleFactory","SentinelReportQuerySchema","asSentinelModule","AsObjectFactory","asSentinelInstance","withSentinelModule","WithFactory","withSentinelInstance"]}
|
package/dist/browser/index.js
CHANGED
|
@@ -1,2 +1,43 @@
|
|
|
1
|
-
|
|
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
|
+
|
|
8
|
+
// src/Config.ts
|
|
9
|
+
var SentinelConfigSchema = "network.xyo.sentinel.config";
|
|
10
|
+
|
|
11
|
+
// src/Queries/Report.ts
|
|
12
|
+
var SentinelReportQuerySchema = "network.xyo.query.sentinel.report";
|
|
13
|
+
|
|
14
|
+
// src/typeChecks.ts
|
|
15
|
+
import { AsObjectFactory } from "@xylabs/object";
|
|
16
|
+
import { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from "@xyo-network/module-model";
|
|
17
|
+
var isSentinelInstance = new IsInstanceFactory().create({
|
|
18
|
+
report: "function"
|
|
19
|
+
}, [
|
|
20
|
+
isModuleInstance
|
|
21
|
+
]);
|
|
22
|
+
var isSentinelModule = new IsModuleFactory().create([
|
|
23
|
+
SentinelReportQuerySchema
|
|
24
|
+
]);
|
|
25
|
+
var asSentinelModule = AsObjectFactory.create(isSentinelModule);
|
|
26
|
+
var asSentinelInstance = AsObjectFactory.create(isSentinelInstance);
|
|
27
|
+
var withSentinelModule = WithFactory.create(isSentinelModule);
|
|
28
|
+
var withSentinelInstance = WithFactory.create(isSentinelInstance);
|
|
29
|
+
export {
|
|
30
|
+
SentinelAutomationSchema,
|
|
31
|
+
SentinelConfigSchema,
|
|
32
|
+
SentinelEventAutomationSchema,
|
|
33
|
+
SentinelIntervalAutomationSchema,
|
|
34
|
+
SentinelReportQuerySchema,
|
|
35
|
+
asSentinelInstance,
|
|
36
|
+
asSentinelModule,
|
|
37
|
+
isSentinelInstance,
|
|
38
|
+
isSentinelIntervalAutomation,
|
|
39
|
+
isSentinelModule,
|
|
40
|
+
withSentinelInstance,
|
|
41
|
+
withSentinelModule
|
|
42
|
+
};
|
|
2
43
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
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 { WithAdditional } from '@xylabs/object'\nimport { ModuleConfig } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { SentinelAutomationPayload } from './Automation'\nimport { Task } from './Task'\n\nexport const SentinelConfigSchema = 'network.xyo.sentinel.config' as const\nexport type SentinelConfigSchema = typeof SentinelConfigSchema\n\nexport type SentinelConfig<TConfig extends Payload | void = void, TSchema extends string | void = void> = ModuleConfig<\n WithAdditional<\n {\n automations?: SentinelAutomationPayload[]\n schema: TConfig extends Payload ? TConfig['schema'] : SentinelConfigSchema\n synchronous?: boolean\n tasks: Task[]\n throwErrors?: boolean\n },\n TConfig\n >,\n TSchema\n>\n","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 { AsObjectFactory } from '@xylabs/object'\nimport { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'\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,
|
|
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 { WithAdditional } from '@xylabs/object'\nimport { ModuleConfig } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { SentinelAutomationPayload } from './Automation'\nimport { Task } from './Task'\n\nexport const SentinelConfigSchema = 'network.xyo.sentinel.config' as const\nexport type SentinelConfigSchema = typeof SentinelConfigSchema\n\nexport type SentinelConfig<TConfig extends Payload | void = void, TSchema extends string | void = void> = ModuleConfig<\n WithAdditional<\n {\n automations?: SentinelAutomationPayload[]\n schema: TConfig extends Payload ? TConfig['schema'] : SentinelConfigSchema\n synchronous?: boolean\n tasks: Task[]\n throwErrors?: boolean\n },\n TConfig\n >,\n TSchema\n>\n","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 { AsObjectFactory } from '@xylabs/object'\nimport { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'\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,SAASA,6BAAsC;AAGxC,IAAMC,2BAAqD;AAG3D,IAAMC,mCAAqE;AAG3E,IAAMC,gCAA+D;AA+BrE,IAAMC,+BAA+BJ,sBAAyDE,gCAAAA;;;ACjC9F,IAAMG,uBAAuB;;;ACJ7B,IAAMC,4BAAuD;;;ACHpE,SAASC,uBAAuB;AAChC,SAASC,mBAAmBC,iBAAiBC,kBAAkBC,mBAAmB;AAM3E,IAAMC,qBAAqB,IAAIC,kBAAAA,EAAsCC,OAAO;EAAEC,QAAQ;AAAW,GAAG;EAACC;CAAiB;AACtH,IAAMC,mBAAmB,IAAIC,gBAAAA,EAAkCJ,OAAO;EAACK;CAA0B;AAEjG,IAAMC,mBAAmBC,gBAAgBP,OAAOG,gBAAAA;AAChD,IAAMK,qBAAqBD,gBAAgBP,OAAOF,kBAAAA;AAClD,IAAMW,qBAAqBC,YAAYV,OAAOG,gBAAAA;AAC9C,IAAMQ,uBAAuBD,YAAYV,OAAOF,kBAAAA;","names":["isPayloadOfSchemaType","SentinelAutomationSchema","SentinelIntervalAutomationSchema","SentinelEventAutomationSchema","isSentinelIntervalAutomation","SentinelConfigSchema","SentinelReportQuerySchema","AsObjectFactory","IsInstanceFactory","IsModuleFactory","isModuleInstance","WithFactory","isSentinelInstance","IsInstanceFactory","create","report","isModuleInstance","isSentinelModule","IsModuleFactory","SentinelReportQuerySchema","asSentinelModule","AsObjectFactory","asSentinelInstance","withSentinelModule","WithFactory","withSentinelInstance"]}
|
package/dist/neutral/index.cjs
CHANGED
|
@@ -1,2 +1,66 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
SentinelAutomationSchema: () => SentinelAutomationSchema,
|
|
24
|
+
SentinelConfigSchema: () => SentinelConfigSchema,
|
|
25
|
+
SentinelEventAutomationSchema: () => SentinelEventAutomationSchema,
|
|
26
|
+
SentinelIntervalAutomationSchema: () => SentinelIntervalAutomationSchema,
|
|
27
|
+
SentinelReportQuerySchema: () => SentinelReportQuerySchema,
|
|
28
|
+
asSentinelInstance: () => asSentinelInstance,
|
|
29
|
+
asSentinelModule: () => asSentinelModule,
|
|
30
|
+
isSentinelInstance: () => isSentinelInstance,
|
|
31
|
+
isSentinelIntervalAutomation: () => isSentinelIntervalAutomation,
|
|
32
|
+
isSentinelModule: () => isSentinelModule,
|
|
33
|
+
withSentinelInstance: () => withSentinelInstance,
|
|
34
|
+
withSentinelModule: () => withSentinelModule
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(src_exports);
|
|
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
|
+
|
|
45
|
+
// src/Config.ts
|
|
46
|
+
var SentinelConfigSchema = "network.xyo.sentinel.config";
|
|
47
|
+
|
|
48
|
+
// src/Queries/Report.ts
|
|
49
|
+
var SentinelReportQuerySchema = "network.xyo.query.sentinel.report";
|
|
50
|
+
|
|
51
|
+
// src/typeChecks.ts
|
|
52
|
+
var import_object = require("@xylabs/object");
|
|
53
|
+
var import_module_model = require("@xyo-network/module-model");
|
|
54
|
+
var isSentinelInstance = new import_module_model.IsInstanceFactory().create({
|
|
55
|
+
report: "function"
|
|
56
|
+
}, [
|
|
57
|
+
import_module_model.isModuleInstance
|
|
58
|
+
]);
|
|
59
|
+
var isSentinelModule = new import_module_model.IsModuleFactory().create([
|
|
60
|
+
SentinelReportQuerySchema
|
|
61
|
+
]);
|
|
62
|
+
var asSentinelModule = import_object.AsObjectFactory.create(isSentinelModule);
|
|
63
|
+
var asSentinelInstance = import_object.AsObjectFactory.create(isSentinelInstance);
|
|
64
|
+
var withSentinelModule = import_module_model.WithFactory.create(isSentinelModule);
|
|
65
|
+
var withSentinelInstance = import_module_model.WithFactory.create(isSentinelInstance);
|
|
2
66
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
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 { WithAdditional } from '@xylabs/object'\nimport { ModuleConfig } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { SentinelAutomationPayload } from './Automation'\nimport { Task } from './Task'\n\nexport const SentinelConfigSchema = 'network.xyo.sentinel.config' as const\nexport type SentinelConfigSchema = typeof SentinelConfigSchema\n\nexport type SentinelConfig<TConfig extends Payload | void = void, TSchema extends string | void = void> = ModuleConfig<\n WithAdditional<\n {\n automations?: SentinelAutomationPayload[]\n schema: TConfig extends Payload ? TConfig['schema'] : SentinelConfigSchema\n synchronous?: boolean\n tasks: Task[]\n throwErrors?: boolean\n },\n TConfig\n >,\n TSchema\n>\n","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 { AsObjectFactory } from '@xylabs/object'\nimport { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'\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":"
|
|
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 { WithAdditional } from '@xylabs/object'\nimport { ModuleConfig } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { SentinelAutomationPayload } from './Automation'\nimport { Task } from './Task'\n\nexport const SentinelConfigSchema = 'network.xyo.sentinel.config' as const\nexport type SentinelConfigSchema = typeof SentinelConfigSchema\n\nexport type SentinelConfig<TConfig extends Payload | void = void, TSchema extends string | void = void> = ModuleConfig<\n WithAdditional<\n {\n automations?: SentinelAutomationPayload[]\n schema: TConfig extends Payload ? TConfig['schema'] : SentinelConfigSchema\n synchronous?: boolean\n tasks: Task[]\n throwErrors?: boolean\n },\n TConfig\n >,\n TSchema\n>\n","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 { AsObjectFactory } from '@xylabs/object'\nimport { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'\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;;;;;;;;;;;;;;;;;;ACAA,2BAA+C;AAGxC,IAAMA,2BAAqD;AAG3D,IAAMC,mCAAqE;AAG3E,IAAMC,gCAA+D;AA+BrE,IAAMC,mCAA+BC,4CAAyDH,gCAAAA;;;ACjC9F,IAAMI,uBAAuB;;;ACJ7B,IAAMC,4BAAuD;;;ACHpE,oBAAgC;AAChC,0BAAkF;AAM3E,IAAMC,qBAAqB,IAAIC,sCAAAA,EAAsCC,OAAO;EAAEC,QAAQ;AAAW,GAAG;EAACC;CAAiB;AACtH,IAAMC,mBAAmB,IAAIC,oCAAAA,EAAkCJ,OAAO;EAACK;CAA0B;AAEjG,IAAMC,mBAAmBC,8BAAgBP,OAAOG,gBAAAA;AAChD,IAAMK,qBAAqBD,8BAAgBP,OAAOF,kBAAAA;AAClD,IAAMW,qBAAqBC,gCAAYV,OAAOG,gBAAAA;AAC9C,IAAMQ,uBAAuBD,gCAAYV,OAAOF,kBAAAA;","names":["SentinelAutomationSchema","SentinelIntervalAutomationSchema","SentinelEventAutomationSchema","isSentinelIntervalAutomation","isPayloadOfSchemaType","SentinelConfigSchema","SentinelReportQuerySchema","isSentinelInstance","IsInstanceFactory","create","report","isModuleInstance","isSentinelModule","IsModuleFactory","SentinelReportQuerySchema","asSentinelModule","AsObjectFactory","asSentinelInstance","withSentinelModule","WithFactory","withSentinelInstance"]}
|
package/dist/neutral/index.js
CHANGED
|
@@ -1,2 +1,43 @@
|
|
|
1
|
-
|
|
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
|
+
|
|
8
|
+
// src/Config.ts
|
|
9
|
+
var SentinelConfigSchema = "network.xyo.sentinel.config";
|
|
10
|
+
|
|
11
|
+
// src/Queries/Report.ts
|
|
12
|
+
var SentinelReportQuerySchema = "network.xyo.query.sentinel.report";
|
|
13
|
+
|
|
14
|
+
// src/typeChecks.ts
|
|
15
|
+
import { AsObjectFactory } from "@xylabs/object";
|
|
16
|
+
import { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from "@xyo-network/module-model";
|
|
17
|
+
var isSentinelInstance = new IsInstanceFactory().create({
|
|
18
|
+
report: "function"
|
|
19
|
+
}, [
|
|
20
|
+
isModuleInstance
|
|
21
|
+
]);
|
|
22
|
+
var isSentinelModule = new IsModuleFactory().create([
|
|
23
|
+
SentinelReportQuerySchema
|
|
24
|
+
]);
|
|
25
|
+
var asSentinelModule = AsObjectFactory.create(isSentinelModule);
|
|
26
|
+
var asSentinelInstance = AsObjectFactory.create(isSentinelInstance);
|
|
27
|
+
var withSentinelModule = WithFactory.create(isSentinelModule);
|
|
28
|
+
var withSentinelInstance = WithFactory.create(isSentinelInstance);
|
|
29
|
+
export {
|
|
30
|
+
SentinelAutomationSchema,
|
|
31
|
+
SentinelConfigSchema,
|
|
32
|
+
SentinelEventAutomationSchema,
|
|
33
|
+
SentinelIntervalAutomationSchema,
|
|
34
|
+
SentinelReportQuerySchema,
|
|
35
|
+
asSentinelInstance,
|
|
36
|
+
asSentinelModule,
|
|
37
|
+
isSentinelInstance,
|
|
38
|
+
isSentinelIntervalAutomation,
|
|
39
|
+
isSentinelModule,
|
|
40
|
+
withSentinelInstance,
|
|
41
|
+
withSentinelModule
|
|
42
|
+
};
|
|
2
43
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
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 { WithAdditional } from '@xylabs/object'\nimport { ModuleConfig } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { SentinelAutomationPayload } from './Automation'\nimport { Task } from './Task'\n\nexport const SentinelConfigSchema = 'network.xyo.sentinel.config' as const\nexport type SentinelConfigSchema = typeof SentinelConfigSchema\n\nexport type SentinelConfig<TConfig extends Payload | void = void, TSchema extends string | void = void> = ModuleConfig<\n WithAdditional<\n {\n automations?: SentinelAutomationPayload[]\n schema: TConfig extends Payload ? TConfig['schema'] : SentinelConfigSchema\n synchronous?: boolean\n tasks: Task[]\n throwErrors?: boolean\n },\n TConfig\n >,\n TSchema\n>\n","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 { AsObjectFactory } from '@xylabs/object'\nimport { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'\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,
|
|
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 { WithAdditional } from '@xylabs/object'\nimport { ModuleConfig } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { SentinelAutomationPayload } from './Automation'\nimport { Task } from './Task'\n\nexport const SentinelConfigSchema = 'network.xyo.sentinel.config' as const\nexport type SentinelConfigSchema = typeof SentinelConfigSchema\n\nexport type SentinelConfig<TConfig extends Payload | void = void, TSchema extends string | void = void> = ModuleConfig<\n WithAdditional<\n {\n automations?: SentinelAutomationPayload[]\n schema: TConfig extends Payload ? TConfig['schema'] : SentinelConfigSchema\n synchronous?: boolean\n tasks: Task[]\n throwErrors?: boolean\n },\n TConfig\n >,\n TSchema\n>\n","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 { AsObjectFactory } from '@xylabs/object'\nimport { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'\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,SAASA,6BAAsC;AAGxC,IAAMC,2BAAqD;AAG3D,IAAMC,mCAAqE;AAG3E,IAAMC,gCAA+D;AA+BrE,IAAMC,+BAA+BJ,sBAAyDE,gCAAAA;;;ACjC9F,IAAMG,uBAAuB;;;ACJ7B,IAAMC,4BAAuD;;;ACHpE,SAASC,uBAAuB;AAChC,SAASC,mBAAmBC,iBAAiBC,kBAAkBC,mBAAmB;AAM3E,IAAMC,qBAAqB,IAAIC,kBAAAA,EAAsCC,OAAO;EAAEC,QAAQ;AAAW,GAAG;EAACC;CAAiB;AACtH,IAAMC,mBAAmB,IAAIC,gBAAAA,EAAkCJ,OAAO;EAACK;CAA0B;AAEjG,IAAMC,mBAAmBC,gBAAgBP,OAAOG,gBAAAA;AAChD,IAAMK,qBAAqBD,gBAAgBP,OAAOF,kBAAAA;AAClD,IAAMW,qBAAqBC,YAAYV,OAAOG,gBAAAA;AAC9C,IAAMQ,uBAAuBD,YAAYV,OAAOF,kBAAAA;","names":["isPayloadOfSchemaType","SentinelAutomationSchema","SentinelIntervalAutomationSchema","SentinelEventAutomationSchema","isSentinelIntervalAutomation","SentinelConfigSchema","SentinelReportQuerySchema","AsObjectFactory","IsInstanceFactory","IsModuleFactory","isModuleInstance","WithFactory","isSentinelInstance","IsInstanceFactory","create","report","isModuleInstance","isSentinelModule","IsModuleFactory","SentinelReportQuerySchema","asSentinelModule","AsObjectFactory","asSentinelInstance","withSentinelModule","WithFactory","withSentinelInstance"]}
|
package/dist/node/index.cjs
CHANGED
|
@@ -1,2 +1,81 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
SentinelAutomationSchema: () => SentinelAutomationSchema,
|
|
24
|
+
SentinelConfigSchema: () => SentinelConfigSchema,
|
|
25
|
+
SentinelEventAutomationSchema: () => SentinelEventAutomationSchema,
|
|
26
|
+
SentinelIntervalAutomationSchema: () => SentinelIntervalAutomationSchema,
|
|
27
|
+
SentinelReportQuerySchema: () => SentinelReportQuerySchema,
|
|
28
|
+
asSentinelInstance: () => asSentinelInstance,
|
|
29
|
+
asSentinelModule: () => asSentinelModule,
|
|
30
|
+
isSentinelInstance: () => isSentinelInstance,
|
|
31
|
+
isSentinelIntervalAutomation: () => isSentinelIntervalAutomation,
|
|
32
|
+
isSentinelModule: () => isSentinelModule,
|
|
33
|
+
withSentinelInstance: () => withSentinelInstance,
|
|
34
|
+
withSentinelModule: () => withSentinelModule
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(src_exports);
|
|
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
|
+
|
|
45
|
+
// src/Config.ts
|
|
46
|
+
var SentinelConfigSchema = "network.xyo.sentinel.config";
|
|
47
|
+
|
|
48
|
+
// src/Queries/Report.ts
|
|
49
|
+
var SentinelReportQuerySchema = "network.xyo.query.sentinel.report";
|
|
50
|
+
|
|
51
|
+
// src/typeChecks.ts
|
|
52
|
+
var import_object = require("@xylabs/object");
|
|
53
|
+
var import_module_model = require("@xyo-network/module-model");
|
|
54
|
+
var isSentinelInstance = new import_module_model.IsInstanceFactory().create({
|
|
55
|
+
report: "function"
|
|
56
|
+
}, [
|
|
57
|
+
import_module_model.isModuleInstance
|
|
58
|
+
]);
|
|
59
|
+
var isSentinelModule = new import_module_model.IsModuleFactory().create([
|
|
60
|
+
SentinelReportQuerySchema
|
|
61
|
+
]);
|
|
62
|
+
var asSentinelModule = import_object.AsObjectFactory.create(isSentinelModule);
|
|
63
|
+
var asSentinelInstance = import_object.AsObjectFactory.create(isSentinelInstance);
|
|
64
|
+
var withSentinelModule = import_module_model.WithFactory.create(isSentinelModule);
|
|
65
|
+
var withSentinelInstance = import_module_model.WithFactory.create(isSentinelInstance);
|
|
66
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
67
|
+
0 && (module.exports = {
|
|
68
|
+
SentinelAutomationSchema,
|
|
69
|
+
SentinelConfigSchema,
|
|
70
|
+
SentinelEventAutomationSchema,
|
|
71
|
+
SentinelIntervalAutomationSchema,
|
|
72
|
+
SentinelReportQuerySchema,
|
|
73
|
+
asSentinelInstance,
|
|
74
|
+
asSentinelModule,
|
|
75
|
+
isSentinelInstance,
|
|
76
|
+
isSentinelIntervalAutomation,
|
|
77
|
+
isSentinelModule,
|
|
78
|
+
withSentinelInstance,
|
|
79
|
+
withSentinelModule
|
|
80
|
+
});
|
|
2
81
|
//# sourceMappingURL=index.cjs.map
|
package/dist/node/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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 { WithAdditional } from '@xylabs/object'\nimport { ModuleConfig } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { SentinelAutomationPayload } from './Automation'\nimport { Task } from './Task'\n\nexport const SentinelConfigSchema = 'network.xyo.sentinel.config' as const\nexport type SentinelConfigSchema = typeof SentinelConfigSchema\n\nexport type SentinelConfig<TConfig extends Payload | void = void, TSchema extends string | void = void> = ModuleConfig<\n WithAdditional<\n {\n automations?: SentinelAutomationPayload[]\n schema: TConfig extends Payload ? TConfig['schema'] : SentinelConfigSchema\n synchronous?: boolean\n tasks: Task[]\n throwErrors?: boolean\n },\n TConfig\n >,\n TSchema\n>\n","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 { AsObjectFactory } from '@xylabs/object'\nimport { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'\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":"
|
|
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 { WithAdditional } from '@xylabs/object'\nimport { ModuleConfig } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { SentinelAutomationPayload } from './Automation'\nimport { Task } from './Task'\n\nexport const SentinelConfigSchema = 'network.xyo.sentinel.config' as const\nexport type SentinelConfigSchema = typeof SentinelConfigSchema\n\nexport type SentinelConfig<TConfig extends Payload | void = void, TSchema extends string | void = void> = ModuleConfig<\n WithAdditional<\n {\n automations?: SentinelAutomationPayload[]\n schema: TConfig extends Payload ? TConfig['schema'] : SentinelConfigSchema\n synchronous?: boolean\n tasks: Task[]\n throwErrors?: boolean\n },\n TConfig\n >,\n TSchema\n>\n","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 { AsObjectFactory } from '@xylabs/object'\nimport { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'\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;;;;;;;;;;;;;;;;;;ACAA,2BAA+C;AAGxC,IAAMA,2BAAqD;AAG3D,IAAMC,mCAAqE;AAG3E,IAAMC,gCAA+D;AA+BrE,IAAMC,mCAA+BC,4CAAyDH,gCAAAA;;;ACjC9F,IAAMI,uBAAuB;;;ACJ7B,IAAMC,4BAAuD;;;ACHpE,oBAAgC;AAChC,0BAAkF;AAM3E,IAAMC,qBAAqB,IAAIC,sCAAAA,EAAsCC,OAAO;EAAEC,QAAQ;AAAW,GAAG;EAACC;CAAiB;AACtH,IAAMC,mBAAmB,IAAIC,oCAAAA,EAAkCJ,OAAO;EAACK;CAA0B;AAEjG,IAAMC,mBAAmBC,8BAAgBP,OAAOG,gBAAAA;AAChD,IAAMK,qBAAqBD,8BAAgBP,OAAOF,kBAAAA;AAClD,IAAMW,qBAAqBC,gCAAYV,OAAOG,gBAAAA;AAC9C,IAAMQ,uBAAuBD,gCAAYV,OAAOF,kBAAAA;","names":["SentinelAutomationSchema","SentinelIntervalAutomationSchema","SentinelEventAutomationSchema","isSentinelIntervalAutomation","isPayloadOfSchemaType","SentinelConfigSchema","SentinelReportQuerySchema","isSentinelInstance","IsInstanceFactory","create","report","isModuleInstance","isSentinelModule","IsModuleFactory","SentinelReportQuerySchema","asSentinelModule","AsObjectFactory","asSentinelInstance","withSentinelModule","WithFactory","withSentinelInstance"]}
|
package/dist/node/index.js
CHANGED
|
@@ -1,2 +1,43 @@
|
|
|
1
|
-
|
|
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
|
+
|
|
8
|
+
// src/Config.ts
|
|
9
|
+
var SentinelConfigSchema = "network.xyo.sentinel.config";
|
|
10
|
+
|
|
11
|
+
// src/Queries/Report.ts
|
|
12
|
+
var SentinelReportQuerySchema = "network.xyo.query.sentinel.report";
|
|
13
|
+
|
|
14
|
+
// src/typeChecks.ts
|
|
15
|
+
import { AsObjectFactory } from "@xylabs/object";
|
|
16
|
+
import { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from "@xyo-network/module-model";
|
|
17
|
+
var isSentinelInstance = new IsInstanceFactory().create({
|
|
18
|
+
report: "function"
|
|
19
|
+
}, [
|
|
20
|
+
isModuleInstance
|
|
21
|
+
]);
|
|
22
|
+
var isSentinelModule = new IsModuleFactory().create([
|
|
23
|
+
SentinelReportQuerySchema
|
|
24
|
+
]);
|
|
25
|
+
var asSentinelModule = AsObjectFactory.create(isSentinelModule);
|
|
26
|
+
var asSentinelInstance = AsObjectFactory.create(isSentinelInstance);
|
|
27
|
+
var withSentinelModule = WithFactory.create(isSentinelModule);
|
|
28
|
+
var withSentinelInstance = WithFactory.create(isSentinelInstance);
|
|
29
|
+
export {
|
|
30
|
+
SentinelAutomationSchema,
|
|
31
|
+
SentinelConfigSchema,
|
|
32
|
+
SentinelEventAutomationSchema,
|
|
33
|
+
SentinelIntervalAutomationSchema,
|
|
34
|
+
SentinelReportQuerySchema,
|
|
35
|
+
asSentinelInstance,
|
|
36
|
+
asSentinelModule,
|
|
37
|
+
isSentinelInstance,
|
|
38
|
+
isSentinelIntervalAutomation,
|
|
39
|
+
isSentinelModule,
|
|
40
|
+
withSentinelInstance,
|
|
41
|
+
withSentinelModule
|
|
42
|
+
};
|
|
2
43
|
//# sourceMappingURL=index.js.map
|
package/dist/node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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 { WithAdditional } from '@xylabs/object'\nimport { ModuleConfig } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { SentinelAutomationPayload } from './Automation'\nimport { Task } from './Task'\n\nexport const SentinelConfigSchema = 'network.xyo.sentinel.config' as const\nexport type SentinelConfigSchema = typeof SentinelConfigSchema\n\nexport type SentinelConfig<TConfig extends Payload | void = void, TSchema extends string | void = void> = ModuleConfig<\n WithAdditional<\n {\n automations?: SentinelAutomationPayload[]\n schema: TConfig extends Payload ? TConfig['schema'] : SentinelConfigSchema\n synchronous?: boolean\n tasks: Task[]\n throwErrors?: boolean\n },\n TConfig\n >,\n TSchema\n>\n","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 { AsObjectFactory } from '@xylabs/object'\nimport { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'\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,
|
|
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 { WithAdditional } from '@xylabs/object'\nimport { ModuleConfig } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { SentinelAutomationPayload } from './Automation'\nimport { Task } from './Task'\n\nexport const SentinelConfigSchema = 'network.xyo.sentinel.config' as const\nexport type SentinelConfigSchema = typeof SentinelConfigSchema\n\nexport type SentinelConfig<TConfig extends Payload | void = void, TSchema extends string | void = void> = ModuleConfig<\n WithAdditional<\n {\n automations?: SentinelAutomationPayload[]\n schema: TConfig extends Payload ? TConfig['schema'] : SentinelConfigSchema\n synchronous?: boolean\n tasks: Task[]\n throwErrors?: boolean\n },\n TConfig\n >,\n TSchema\n>\n","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 { AsObjectFactory } from '@xylabs/object'\nimport { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'\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,SAASA,6BAAsC;AAGxC,IAAMC,2BAAqD;AAG3D,IAAMC,mCAAqE;AAG3E,IAAMC,gCAA+D;AA+BrE,IAAMC,+BAA+BJ,sBAAyDE,gCAAAA;;;ACjC9F,IAAMG,uBAAuB;;;ACJ7B,IAAMC,4BAAuD;;;ACHpE,SAASC,uBAAuB;AAChC,SAASC,mBAAmBC,iBAAiBC,kBAAkBC,mBAAmB;AAM3E,IAAMC,qBAAqB,IAAIC,kBAAAA,EAAsCC,OAAO;EAAEC,QAAQ;AAAW,GAAG;EAACC;CAAiB;AACtH,IAAMC,mBAAmB,IAAIC,gBAAAA,EAAkCJ,OAAO;EAACK;CAA0B;AAEjG,IAAMC,mBAAmBC,gBAAgBP,OAAOG,gBAAAA;AAChD,IAAMK,qBAAqBD,gBAAgBP,OAAOF,kBAAAA;AAClD,IAAMW,qBAAqBC,YAAYV,OAAOG,gBAAAA;AAC9C,IAAMQ,uBAAuBD,YAAYV,OAAOF,kBAAAA;","names":["isPayloadOfSchemaType","SentinelAutomationSchema","SentinelIntervalAutomationSchema","SentinelEventAutomationSchema","isSentinelIntervalAutomation","SentinelConfigSchema","SentinelReportQuerySchema","AsObjectFactory","IsInstanceFactory","IsModuleFactory","isModuleInstance","WithFactory","isSentinelInstance","IsInstanceFactory","create","report","isModuleInstance","isSentinelModule","IsModuleFactory","SentinelReportQuerySchema","asSentinelModule","AsObjectFactory","asSentinelInstance","withSentinelModule","WithFactory","withSentinelInstance"]}
|
package/package.json
CHANGED
|
@@ -13,19 +13,19 @@
|
|
|
13
13
|
"@xylabs/hex": "^3.5.1",
|
|
14
14
|
"@xylabs/object": "^3.5.1",
|
|
15
15
|
"@xylabs/promise": "^3.5.1",
|
|
16
|
-
"@xyo-network/account-model": "~2.107.
|
|
17
|
-
"@xyo-network/archivist-model": "~2.107.
|
|
18
|
-
"@xyo-network/boundwitness-model": "~2.107.
|
|
19
|
-
"@xyo-network/diviner-model": "~2.107.
|
|
20
|
-
"@xyo-network/module-events": "~2.107.
|
|
21
|
-
"@xyo-network/module-model": "~2.107.
|
|
22
|
-
"@xyo-network/payload-model": "~2.107.
|
|
23
|
-
"@xyo-network/witness-model": "~2.107.
|
|
16
|
+
"@xyo-network/account-model": "~2.107.4",
|
|
17
|
+
"@xyo-network/archivist-model": "~2.107.4",
|
|
18
|
+
"@xyo-network/boundwitness-model": "~2.107.4",
|
|
19
|
+
"@xyo-network/diviner-model": "~2.107.4",
|
|
20
|
+
"@xyo-network/module-events": "~2.107.4",
|
|
21
|
+
"@xyo-network/module-model": "~2.107.4",
|
|
22
|
+
"@xyo-network/payload-model": "~2.107.4",
|
|
23
|
+
"@xyo-network/witness-model": "~2.107.4"
|
|
24
24
|
},
|
|
25
25
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@xylabs/ts-scripts-yarn3": "^3.11.
|
|
28
|
-
"@xylabs/tsconfig": "^3.11.
|
|
27
|
+
"@xylabs/ts-scripts-yarn3": "^3.11.10",
|
|
28
|
+
"@xylabs/tsconfig": "^3.11.10",
|
|
29
29
|
"typescript": "^5.5.2"
|
|
30
30
|
},
|
|
31
31
|
"types": "dist/node/index.d.ts",
|
|
@@ -66,6 +66,6 @@
|
|
|
66
66
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
|
|
67
67
|
},
|
|
68
68
|
"sideEffects": false,
|
|
69
|
-
"version": "2.107.
|
|
69
|
+
"version": "2.107.4",
|
|
70
70
|
"type": "module"
|
|
71
71
|
}
|