@xyo-network/sentinel 2.68.0 → 2.69.0-rc.1
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/cjs/AbstractSentinel.js +23 -34
- package/dist/cjs/AbstractSentinel.js.map +1 -1
- package/dist/cjs/MemorySentinel.js +4 -45
- package/dist/cjs/MemorySentinel.js.map +1 -1
- package/dist/cjs/SentinelRunner.js.map +1 -1
- package/dist/cjs/Wrapper.js +3 -3
- package/dist/cjs/Wrapper.js.map +1 -1
- package/dist/cjs/index.js +1 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/model/Config.js.map +1 -0
- package/dist/cjs/{SentinelModel.js → model/EventData.js} +1 -1
- package/dist/cjs/model/EventData.js.map +1 -0
- package/dist/cjs/model/Events/ReportEnd.js +3 -0
- package/dist/cjs/model/Events/ReportEnd.js.map +1 -0
- package/dist/cjs/model/Events/ReportStart.js +3 -0
- package/dist/cjs/model/Events/ReportStart.js.map +1 -0
- package/dist/cjs/model/Events/index.js +6 -0
- package/dist/cjs/model/Events/index.js.map +1 -0
- package/dist/cjs/model/Instance.js +3 -0
- package/dist/cjs/model/Instance.js.map +1 -0
- package/dist/cjs/model/Module.js +3 -0
- package/dist/cjs/model/Module.js.map +1 -0
- package/dist/cjs/model/Params.js +3 -0
- package/dist/cjs/model/Params.js.map +1 -0
- package/dist/cjs/model/Queries/Report.js.map +1 -0
- package/dist/cjs/model/Queries/index.js.map +1 -0
- package/dist/cjs/model/Sentinel.js +3 -0
- package/dist/cjs/model/Sentinel.js.map +1 -0
- package/dist/cjs/model/index.js +12 -0
- package/dist/cjs/model/index.js.map +1 -0
- package/dist/cjs/typeChecks.js +2 -2
- package/dist/cjs/typeChecks.js.map +1 -1
- package/dist/esm/AbstractSentinel.js +19 -31
- package/dist/esm/AbstractSentinel.js.map +1 -1
- package/dist/esm/MemorySentinel.js +4 -39
- package/dist/esm/MemorySentinel.js.map +1 -1
- package/dist/esm/SentinelRunner.js.map +1 -1
- package/dist/esm/Wrapper.js +1 -1
- package/dist/esm/Wrapper.js.map +1 -1
- package/dist/esm/index.js +1 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/model/Config.js.map +1 -0
- package/dist/esm/model/EventData.js +2 -0
- package/dist/esm/model/EventData.js.map +1 -0
- package/dist/esm/model/Events/ReportEnd.js +2 -0
- package/dist/esm/model/Events/ReportEnd.js.map +1 -0
- package/dist/esm/model/Events/ReportStart.js +2 -0
- package/dist/esm/model/Events/ReportStart.js.map +1 -0
- package/dist/esm/model/Events/index.js +3 -0
- package/dist/esm/model/Events/index.js.map +1 -0
- package/dist/esm/model/Instance.js +2 -0
- package/dist/esm/model/Instance.js.map +1 -0
- package/dist/esm/model/Module.js +2 -0
- package/dist/esm/model/Module.js.map +1 -0
- package/dist/esm/model/Params.js +2 -0
- package/dist/esm/model/Params.js.map +1 -0
- package/dist/esm/model/Queries/Report.js.map +1 -0
- package/dist/esm/model/Queries/index.js.map +1 -0
- package/dist/esm/model/Sentinel.js +2 -0
- package/dist/esm/model/Sentinel.js.map +1 -0
- package/dist/esm/model/index.js +9 -0
- package/dist/esm/model/index.js.map +1 -0
- package/dist/esm/typeChecks.js +1 -1
- package/dist/esm/typeChecks.js.map +1 -1
- package/dist/types/AbstractSentinel.d.ts +6 -7
- package/dist/types/AbstractSentinel.d.ts.map +1 -1
- package/dist/types/MemorySentinel.d.ts +4 -7
- package/dist/types/MemorySentinel.d.ts.map +1 -1
- package/dist/types/SentinelRunner.d.ts +1 -1
- package/dist/types/SentinelRunner.d.ts.map +1 -1
- package/dist/types/Wrapper.d.ts +1 -1
- package/dist/types/Wrapper.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/model/Config.d.ts.map +1 -0
- package/dist/types/model/EventData.d.ts +5 -0
- package/dist/types/model/EventData.d.ts.map +1 -0
- package/dist/types/model/Events/ReportEnd.d.ts +13 -0
- package/dist/types/model/Events/ReportEnd.d.ts.map +1 -0
- package/dist/types/model/Events/ReportStart.d.ts +10 -0
- package/dist/types/model/Events/ReportStart.d.ts.map +1 -0
- package/dist/types/model/Events/index.d.ts +3 -0
- package/dist/types/model/Events/index.d.ts.map +1 -0
- package/dist/types/model/Instance.d.ts +8 -0
- package/dist/types/model/Instance.d.ts.map +1 -0
- package/dist/types/model/Module.d.ts +6 -0
- package/dist/types/model/Module.d.ts.map +1 -0
- package/dist/types/model/Params.d.ts +5 -0
- package/dist/types/model/Params.d.ts.map +1 -0
- package/dist/types/model/Queries/Report.d.ts.map +1 -0
- package/dist/types/model/Queries/index.d.ts.map +1 -0
- package/dist/types/model/Sentinel.d.ts +6 -0
- package/dist/types/model/Sentinel.d.ts.map +1 -0
- package/dist/types/model/index.d.ts +9 -0
- package/dist/types/model/index.d.ts.map +1 -0
- package/dist/types/typeChecks.d.ts +1 -1
- package/dist/types/typeChecks.d.ts.map +1 -1
- package/package.json +14 -14
- package/src/AbstractSentinel.ts +34 -44
- package/src/MemorySentinel.ts +9 -53
- package/src/SentinelRunner.ts +1 -1
- package/src/Wrapper.ts +1 -2
- package/src/index.ts +1 -3
- package/src/model/EventData.ts +5 -0
- package/src/model/Events/ReportEnd.ts +17 -0
- package/src/model/Events/ReportStart.ts +14 -0
- package/src/model/Events/index.ts +2 -0
- package/src/model/Instance.ts +13 -0
- package/src/model/Module.ts +11 -0
- package/src/model/Params.ts +9 -0
- package/src/model/Sentinel.ts +6 -0
- package/src/model/index.ts +8 -0
- package/src/typeChecks.ts +1 -2
- package/dist/cjs/Config.js.map +0 -1
- package/dist/cjs/Queries/Report.js.map +0 -1
- package/dist/cjs/Queries/index.js.map +0 -1
- package/dist/cjs/SentinelModel.js.map +0 -1
- package/dist/esm/Config.js.map +0 -1
- package/dist/esm/Queries/Report.js.map +0 -1
- package/dist/esm/Queries/index.js.map +0 -1
- package/dist/esm/SentinelModel.js +0 -2
- package/dist/esm/SentinelModel.js.map +0 -1
- package/dist/types/Config.d.ts.map +0 -1
- package/dist/types/Queries/Report.d.ts.map +0 -1
- package/dist/types/Queries/index.d.ts.map +0 -1
- package/dist/types/SentinelModel.d.ts +0 -30
- package/dist/types/SentinelModel.d.ts.map +0 -1
- package/src/SentinelModel.ts +0 -53
- /package/dist/cjs/{Config.js → model/Config.js} +0 -0
- /package/dist/cjs/{Queries → model/Queries}/Report.js +0 -0
- /package/dist/cjs/{Queries → model/Queries}/index.js +0 -0
- /package/dist/esm/{Config.js → model/Config.js} +0 -0
- /package/dist/esm/{Queries → model/Queries}/Report.js +0 -0
- /package/dist/esm/{Queries → model/Queries}/index.js +0 -0
- /package/dist/types/{Config.d.ts → model/Config.d.ts} +0 -0
- /package/dist/types/{Queries → model/Queries}/Report.d.ts +0 -0
- /package/dist/types/{Queries → model/Queries}/index.d.ts +0 -0
- /package/src/{Config.ts → model/Config.ts} +0 -0
- /package/src/{Queries → model/Queries}/Report.ts +0 -0
- /package/src/{Queries → model/Queries}/index.ts +0 -0
package/src/MemorySentinel.ts
CHANGED
|
@@ -1,34 +1,26 @@
|
|
|
1
1
|
import { assertEx } from '@xylabs/assert'
|
|
2
2
|
import { fulfilled, rejected } from '@xylabs/promise'
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { AnyConfigSchema, ModuleConfig, ModuleErrorBuilder, ModuleQueryResult } from '@xyo-network/module'
|
|
7
|
-
import { ModuleError, Payload } from '@xyo-network/payload-model'
|
|
3
|
+
import { handleError } from '@xyo-network/error'
|
|
4
|
+
import { AnyConfigSchema } from '@xyo-network/module'
|
|
5
|
+
import { Payload } from '@xyo-network/payload-model'
|
|
8
6
|
import { WitnessInstance } from '@xyo-network/witness'
|
|
9
7
|
|
|
10
8
|
import { AbstractSentinel } from './AbstractSentinel'
|
|
11
|
-
import { SentinelConfig, SentinelConfigSchema } from './
|
|
12
|
-
import { SentinelQuery, SentinelReportQuerySchema } from './Queries'
|
|
13
|
-
import { SentinelModule, SentinelModuleEventData, SentinelParams } from './SentinelModel'
|
|
9
|
+
import { SentinelConfig, SentinelConfigSchema, SentinelInstance, SentinelModuleEventData, SentinelParams, SentinelReportQuerySchema } from './model'
|
|
14
10
|
|
|
15
11
|
export type MemorySentinelParams<TConfig extends AnyConfigSchema<SentinelConfig> = AnyConfigSchema<SentinelConfig>> = SentinelParams<
|
|
16
12
|
AnyConfigSchema<TConfig>
|
|
17
13
|
>
|
|
18
14
|
|
|
19
15
|
export class MemorySentinel<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
extends AbstractSentinel<TParams, TEventData>
|
|
24
|
-
implements SentinelModule<TParams, TEventData>
|
|
25
|
-
{
|
|
16
|
+
TParams extends MemorySentinelParams = MemorySentinelParams,
|
|
17
|
+
TEventData extends SentinelModuleEventData<SentinelInstance<TParams>> = SentinelModuleEventData<SentinelInstance<TParams>>,
|
|
18
|
+
> extends AbstractSentinel<TParams, TEventData> {
|
|
26
19
|
static override configSchemas = [SentinelConfigSchema]
|
|
27
20
|
|
|
28
|
-
async
|
|
21
|
+
async reportHandler(payloads: Payload[] = []): Promise<Payload[]> {
|
|
29
22
|
await this.started('throw')
|
|
30
23
|
const errors: Error[] = []
|
|
31
|
-
await this.emit('reportStart', { inPayloads: payloads, module: this as SentinelModule })
|
|
32
24
|
const allWitnesses = [...(await this.getWitnesses())]
|
|
33
25
|
const resultPayloads: Payload[] = []
|
|
34
26
|
|
|
@@ -43,47 +35,11 @@ export class MemorySentinel<
|
|
|
43
35
|
})
|
|
44
36
|
}
|
|
45
37
|
|
|
46
|
-
const [
|
|
38
|
+
const [boundWitness] = await this.bindQueryResult({ schema: SentinelReportQuerySchema }, resultPayloads)
|
|
47
39
|
this.history.push(assertEx(boundWitness))
|
|
48
|
-
await this.emit('reportEnd', { boundWitness, errors, inPayloads: payloads, module: this as SentinelModule, outPayloads: resultPayloads })
|
|
49
40
|
return [boundWitness, ...resultPayloads]
|
|
50
41
|
}
|
|
51
42
|
|
|
52
|
-
protected override async queryHandler<T extends QueryBoundWitness = QueryBoundWitness, TConfig extends ModuleConfig = ModuleConfig>(
|
|
53
|
-
query: T,
|
|
54
|
-
payloads?: Payload[],
|
|
55
|
-
queryConfig?: TConfig,
|
|
56
|
-
): Promise<ModuleQueryResult> {
|
|
57
|
-
const wrapper = QueryBoundWitnessWrapper.parseQuery<SentinelQuery>(query, payloads)
|
|
58
|
-
const queryPayload = await wrapper.getQuery()
|
|
59
|
-
assertEx(this.queryable(query, payloads, queryConfig))
|
|
60
|
-
const queryAccount = Account.randomSync()
|
|
61
|
-
const resultPayloads: Payload[] = []
|
|
62
|
-
const errorPayloads: ModuleError[] = []
|
|
63
|
-
try {
|
|
64
|
-
switch (queryPayload.schema) {
|
|
65
|
-
case SentinelReportQuerySchema: {
|
|
66
|
-
resultPayloads.push(...(await this.report(payloads)))
|
|
67
|
-
break
|
|
68
|
-
}
|
|
69
|
-
default:
|
|
70
|
-
return super.queryHandler(query, payloads)
|
|
71
|
-
}
|
|
72
|
-
} catch (ex) {
|
|
73
|
-
await handleErrorAsync(ex, async (error) => {
|
|
74
|
-
errorPayloads.push(
|
|
75
|
-
new ModuleErrorBuilder()
|
|
76
|
-
.sources([await wrapper.hashAsync()])
|
|
77
|
-
.name(this.config.name ?? '<Unknown>')
|
|
78
|
-
.query(query.schema)
|
|
79
|
-
.message(error.message)
|
|
80
|
-
.build(),
|
|
81
|
-
)
|
|
82
|
-
})
|
|
83
|
-
}
|
|
84
|
-
return (await this.bindQueryResult(queryPayload, resultPayloads, [queryAccount], errorPayloads))[0]
|
|
85
|
-
}
|
|
86
|
-
|
|
87
43
|
private async generateResults(witnesses: WitnessInstance[]): Promise<[Payload[], Error[]]> {
|
|
88
44
|
const results = await Promise.allSettled(witnesses?.map((witness) => witness.observe()))
|
|
89
45
|
const payloads = results
|
package/src/SentinelRunner.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { Payload } from '@xyo-network/payload-model'
|
|
|
3
3
|
import { PayloadWrapper } from '@xyo-network/payload-wrapper'
|
|
4
4
|
|
|
5
5
|
import { SentinelAutomationPayload, SentinelIntervalAutomationPayload } from './Automation'
|
|
6
|
+
import { SentinelInstance } from './model'
|
|
6
7
|
import { SentinelIntervalAutomationWrapper } from './SentinelIntervalAutomationWrapper'
|
|
7
|
-
import { SentinelInstance } from './SentinelModel'
|
|
8
8
|
|
|
9
9
|
export type OnSentinelRunnerTriggerResult = (result: Payload[]) => void
|
|
10
10
|
|
package/src/Wrapper.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { constructableModuleWrapper, ModuleWrapper } from '@xyo-network/module'
|
|
2
2
|
import { Payload } from '@xyo-network/payload-model'
|
|
3
3
|
|
|
4
|
-
import { SentinelReportQuery, SentinelReportQuerySchema } from './
|
|
5
|
-
import { SentinelInstance, SentinelModule } from './SentinelModel'
|
|
4
|
+
import { SentinelInstance, SentinelModule, SentinelReportQuery, SentinelReportQuerySchema } from './model'
|
|
6
5
|
import { isSentinelInstance, isSentinelModule } from './typeChecks'
|
|
7
6
|
|
|
8
7
|
constructableModuleWrapper()
|
package/src/index.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
export * from './AbstractSentinel'
|
|
2
2
|
export * from './Automation'
|
|
3
|
-
export * from './Config'
|
|
4
3
|
export * from './MemorySentinel'
|
|
5
|
-
export * from './
|
|
4
|
+
export * from './model'
|
|
6
5
|
export * from './SentinelIntervalAutomationWrapper'
|
|
7
|
-
export * from './SentinelModel'
|
|
8
6
|
export * from './SentinelRunner'
|
|
9
7
|
export * from './typeChecks'
|
|
10
8
|
export * from './Wrapper'
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Module, ModuleEventData } from '@xyo-network/module-model'
|
|
2
|
+
|
|
3
|
+
import { ReportEndEventData, ReportStartEventData } from './Events'
|
|
4
|
+
|
|
5
|
+
export interface SentinelModuleEventData<T extends Module = Module> extends ReportEndEventData<T>, ReportStartEventData<T>, ModuleEventData<T> {}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BoundWitness } from '@xyo-network/boundwitness-model'
|
|
2
|
+
import { EventData } from '@xyo-network/module'
|
|
3
|
+
import { Module, ModuleEventArgs } from '@xyo-network/module-model'
|
|
4
|
+
import { Payload } from '@xyo-network/payload-model'
|
|
5
|
+
|
|
6
|
+
export type ReportEndEventArgs<T extends Module = Module> = ModuleEventArgs<
|
|
7
|
+
T,
|
|
8
|
+
{
|
|
9
|
+
boundwitness?: BoundWitness
|
|
10
|
+
inPayloads?: Payload[]
|
|
11
|
+
outPayloads?: Payload[]
|
|
12
|
+
}
|
|
13
|
+
>
|
|
14
|
+
|
|
15
|
+
export interface ReportEndEventData<T extends Module = Module> extends EventData {
|
|
16
|
+
reportEnd: ReportEndEventArgs<T>
|
|
17
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EventData } from '@xyo-network/module'
|
|
2
|
+
import { Module, ModuleEventArgs } from '@xyo-network/module-model'
|
|
3
|
+
import { Payload } from '@xyo-network/payload-model'
|
|
4
|
+
|
|
5
|
+
export type ReportStartEventArgs<T extends Module = Module> = ModuleEventArgs<
|
|
6
|
+
T,
|
|
7
|
+
{
|
|
8
|
+
inPayloads?: Payload[]
|
|
9
|
+
}
|
|
10
|
+
>
|
|
11
|
+
|
|
12
|
+
export interface ReportStartEventData<T extends Module = Module> extends EventData {
|
|
13
|
+
reportStart: ReportStartEventArgs<T>
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ModuleInstance } from '@xyo-network/module-model'
|
|
2
|
+
|
|
3
|
+
import { SentinelModuleEventData } from './EventData'
|
|
4
|
+
import { CustomSentinelModule, SentinelModule } from './Module'
|
|
5
|
+
import { SentinelParams } from './Params'
|
|
6
|
+
import { Sentinel } from './Sentinel'
|
|
7
|
+
|
|
8
|
+
export type SentinelInstance<TParams extends SentinelParams = SentinelParams> = SentinelModule<TParams> & Sentinel & ModuleInstance
|
|
9
|
+
|
|
10
|
+
export type CustomSentinelInstance<
|
|
11
|
+
TParams extends SentinelParams = SentinelParams,
|
|
12
|
+
TEvents extends SentinelModuleEventData<SentinelInstance<TParams>> = SentinelModuleEventData<SentinelInstance<TParams>>,
|
|
13
|
+
> = CustomSentinelModule<TParams, TEvents> & Sentinel & ModuleInstance<TParams, TEvents>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Module } from '@xyo-network/module-model'
|
|
2
|
+
|
|
3
|
+
import { SentinelModuleEventData } from './EventData'
|
|
4
|
+
import { SentinelParams } from './Params'
|
|
5
|
+
|
|
6
|
+
export type SentinelModule<TParams extends SentinelParams = SentinelParams> = Module<TParams, SentinelModuleEventData<SentinelModule>>
|
|
7
|
+
|
|
8
|
+
export type CustomSentinelModule<
|
|
9
|
+
TParams extends SentinelParams = SentinelParams,
|
|
10
|
+
TEvents extends SentinelModuleEventData<SentinelModule<TParams>> = SentinelModuleEventData<SentinelModule<TParams>>,
|
|
11
|
+
> = Module<TParams, TEvents>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AnyObject } from '@xyo-network/core'
|
|
2
|
+
import { AnyConfigSchema, ModuleParams } from '@xyo-network/module-model'
|
|
3
|
+
|
|
4
|
+
import { SentinelConfig } from './Config'
|
|
5
|
+
|
|
6
|
+
export type SentinelParams<
|
|
7
|
+
TConfig extends AnyConfigSchema<SentinelConfig> = AnyConfigSchema<SentinelConfig>,
|
|
8
|
+
TAdditionalParams extends AnyObject | undefined = undefined,
|
|
9
|
+
> = ModuleParams<TConfig, TAdditionalParams>
|
package/src/typeChecks.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'
|
|
2
2
|
import { AsObjectFactory } from '@xyo-network/object-identity'
|
|
3
3
|
|
|
4
|
-
import { SentinelReportQuerySchema } from './
|
|
5
|
-
import { SentinelInstance, SentinelModule } from './SentinelModel'
|
|
4
|
+
import { SentinelInstance, SentinelModule, SentinelReportQuerySchema } from './model'
|
|
6
5
|
|
|
7
6
|
export const isSentinelInstance = new IsInstanceFactory<SentinelInstance>().create({ report: 'function' }, [isModuleInstance])
|
|
8
7
|
export const isSentinelModule = new IsModuleFactory<SentinelModule>().create([SentinelReportQuerySchema])
|
package/dist/cjs/Config.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Config.js","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":";;;AAKa,QAAA,oBAAoB,GAAyB,6BAA6B,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Report.js","sourceRoot":"","sources":["../../../src/Queries/Report.ts"],"names":[],"mappings":";;;AAGa,QAAA,yBAAyB,GAA8B,mCAAmC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Queries/index.ts"],"names":[],"mappings":";;;AAAA,mDAAwB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SentinelModel.js","sourceRoot":"","sources":["../../src/SentinelModel.ts"],"names":[],"mappings":""}
|
package/dist/esm/Config.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Config.js","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,oBAAoB,GAAyB,6BAA6B,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Report.js","sourceRoot":"","sources":["../../../src/Queries/Report.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,yBAAyB,GAA8B,mCAAmC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Queries/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SentinelModel.js","sourceRoot":"","sources":["../../src/SentinelModel.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEpD,MAAM,MAAM,oBAAoB,GAAG,6BAA6B,CAAA;AAChE,eAAO,MAAM,oBAAoB,EAAE,oBAAoD,CAAA;AAEvF,MAAM,MAAM,cAAc,CAAC,OAAO,SAAS,OAAO,GAAG,OAAO,IAAI,YAAY,CAC1E,qBAAqB,GAAG;IACtB,MAAM,EAAE,oBAAoB,CAAA;IAC5B,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;CACrB,GAAG,OAAO,CACZ,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Report.d.ts","sourceRoot":"","sources":["../../../src/Queries/Report.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAElD,MAAM,MAAM,yBAAyB,GAAG,mCAAmC,CAAA;AAC3E,eAAO,MAAM,yBAAyB,EAAE,yBAA+D,CAAA;AAEvG,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC;IACtC,MAAM,EAAE,yBAAyB,CAAA;CAClC,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Queries/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AAExB,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AACxE,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAE9C,MAAM,MAAM,iBAAiB,GAAG,mBAAmB,CAAA;AACnD,MAAM,MAAM,qBAAqB,GAAG,eAAe,GAAG,iBAAiB,CAAA;AACvE,MAAM,MAAM,aAAa,CAAC,MAAM,SAAS,KAAK,GAAG,IAAI,GAAG,IAAI,IAAI,WAAW,CAAC,MAAM,SAAS,KAAK,GAAG,iBAAiB,GAAG,MAAM,GAAG,iBAAiB,CAAC,CAAA"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { BoundWitness } from '@xyo-network/boundwitness-model';
|
|
2
|
-
import { AnyObject } from '@xyo-network/core';
|
|
3
|
-
import { AnyConfigSchema, EventData, Module, ModuleEventArgs, ModuleEventData, ModuleInstance, ModuleParams } from '@xyo-network/module';
|
|
4
|
-
import { Payload } from '@xyo-network/payload-model';
|
|
5
|
-
import { Promisable } from '@xyo-network/promise';
|
|
6
|
-
import { SentinelConfig } from './Config';
|
|
7
|
-
export interface Sentinel {
|
|
8
|
-
report: (payloads?: Payload[]) => Promisable<Payload[]>;
|
|
9
|
-
}
|
|
10
|
-
export type SentinelReportEndEventArgs = ModuleEventArgs<SentinelModule, {
|
|
11
|
-
boundWitness?: BoundWitness;
|
|
12
|
-
errors?: Error[];
|
|
13
|
-
inPayloads?: Payload[];
|
|
14
|
-
outPayloads: Payload[];
|
|
15
|
-
}>;
|
|
16
|
-
export interface SentinelReportEndEventData extends EventData {
|
|
17
|
-
reportEnd: SentinelReportEndEventArgs;
|
|
18
|
-
}
|
|
19
|
-
export type SentinelReportStartEventArgs = ModuleEventArgs<SentinelModule, {
|
|
20
|
-
inPayloads?: Payload[];
|
|
21
|
-
}>;
|
|
22
|
-
export interface SentinelReportStartEventData extends EventData {
|
|
23
|
-
reportStart: SentinelReportStartEventArgs;
|
|
24
|
-
}
|
|
25
|
-
export interface SentinelModuleEventData extends SentinelReportEndEventData, SentinelReportStartEventData, ModuleEventData {
|
|
26
|
-
}
|
|
27
|
-
export type SentinelParams<TConfig extends AnyConfigSchema<SentinelConfig> = AnyConfigSchema<SentinelConfig>, TAdditionalParams extends AnyObject | undefined = undefined> = ModuleParams<TConfig, TAdditionalParams>;
|
|
28
|
-
export type SentinelModule<TParams extends SentinelParams = SentinelParams, TEventData extends SentinelModuleEventData = SentinelModuleEventData> = Module<TParams, TEventData>;
|
|
29
|
-
export type SentinelInstance<TParams extends SentinelParams = SentinelParams, TEventData extends SentinelModuleEventData = SentinelModuleEventData> = SentinelModule<TParams, TEventData> & ModuleInstance & Sentinel;
|
|
30
|
-
//# sourceMappingURL=SentinelModel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SentinelModel.d.ts","sourceRoot":"","sources":["../../src/SentinelModel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,eAAe,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACxI,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEjD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAEzC,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,KAAK,UAAU,CAAC,OAAO,EAAE,CAAC,CAAA;CACxD;AAED,MAAM,MAAM,0BAA0B,GAAG,eAAe,CACtD,cAAc,EACd;IACE,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,MAAM,CAAC,EAAE,KAAK,EAAE,CAAA;IAChB,UAAU,CAAC,EAAE,OAAO,EAAE,CAAA;IACtB,WAAW,EAAE,OAAO,EAAE,CAAA;CACvB,CACF,CAAA;AAED,MAAM,WAAW,0BAA2B,SAAQ,SAAS;IAC3D,SAAS,EAAE,0BAA0B,CAAA;CACtC;AAED,MAAM,MAAM,4BAA4B,GAAG,eAAe,CACxD,cAAc,EACd;IACE,UAAU,CAAC,EAAE,OAAO,EAAE,CAAA;CACvB,CACF,CAAA;AAED,MAAM,WAAW,4BAA6B,SAAQ,SAAS;IAC7D,WAAW,EAAE,4BAA4B,CAAA;CAC1C;AAED,MAAM,WAAW,uBAAwB,SAAQ,0BAA0B,EAAE,4BAA4B,EAAE,eAAe;CAAG;AAE7H,MAAM,MAAM,cAAc,CACxB,OAAO,SAAS,eAAe,CAAC,cAAc,CAAC,GAAG,eAAe,CAAC,cAAc,CAAC,EACjF,iBAAiB,SAAS,SAAS,GAAG,SAAS,GAAG,SAAS,IACzD,YAAY,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAA;AAE5C,MAAM,MAAM,cAAc,CACxB,OAAO,SAAS,cAAc,GAAG,cAAc,EAC/C,UAAU,SAAS,uBAAuB,GAAG,uBAAuB,IAClE,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA;AAE/B,MAAM,MAAM,gBAAgB,CAC1B,OAAO,SAAS,cAAc,GAAG,cAAc,EAC/C,UAAU,SAAS,uBAAuB,GAAG,uBAAuB,IAClE,cAAc,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,cAAc,GAAG,QAAQ,CAAA"}
|
package/src/SentinelModel.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { BoundWitness } from '@xyo-network/boundwitness-model'
|
|
2
|
-
import { AnyObject } from '@xyo-network/core'
|
|
3
|
-
import { AnyConfigSchema, EventData, Module, ModuleEventArgs, ModuleEventData, ModuleInstance, ModuleParams } from '@xyo-network/module'
|
|
4
|
-
import { Payload } from '@xyo-network/payload-model'
|
|
5
|
-
import { Promisable } from '@xyo-network/promise'
|
|
6
|
-
|
|
7
|
-
import { SentinelConfig } from './Config'
|
|
8
|
-
|
|
9
|
-
export interface Sentinel {
|
|
10
|
-
report: (payloads?: Payload[]) => Promisable<Payload[]>
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export type SentinelReportEndEventArgs = ModuleEventArgs<
|
|
14
|
-
SentinelModule,
|
|
15
|
-
{
|
|
16
|
-
boundWitness?: BoundWitness
|
|
17
|
-
errors?: Error[]
|
|
18
|
-
inPayloads?: Payload[]
|
|
19
|
-
outPayloads: Payload[]
|
|
20
|
-
}
|
|
21
|
-
>
|
|
22
|
-
|
|
23
|
-
export interface SentinelReportEndEventData extends EventData {
|
|
24
|
-
reportEnd: SentinelReportEndEventArgs
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export type SentinelReportStartEventArgs = ModuleEventArgs<
|
|
28
|
-
SentinelModule,
|
|
29
|
-
{
|
|
30
|
-
inPayloads?: Payload[]
|
|
31
|
-
}
|
|
32
|
-
>
|
|
33
|
-
|
|
34
|
-
export interface SentinelReportStartEventData extends EventData {
|
|
35
|
-
reportStart: SentinelReportStartEventArgs
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface SentinelModuleEventData extends SentinelReportEndEventData, SentinelReportStartEventData, ModuleEventData {}
|
|
39
|
-
|
|
40
|
-
export type SentinelParams<
|
|
41
|
-
TConfig extends AnyConfigSchema<SentinelConfig> = AnyConfigSchema<SentinelConfig>,
|
|
42
|
-
TAdditionalParams extends AnyObject | undefined = undefined,
|
|
43
|
-
> = ModuleParams<TConfig, TAdditionalParams>
|
|
44
|
-
|
|
45
|
-
export type SentinelModule<
|
|
46
|
-
TParams extends SentinelParams = SentinelParams,
|
|
47
|
-
TEventData extends SentinelModuleEventData = SentinelModuleEventData,
|
|
48
|
-
> = Module<TParams, TEventData>
|
|
49
|
-
|
|
50
|
-
export type SentinelInstance<
|
|
51
|
-
TParams extends SentinelParams = SentinelParams,
|
|
52
|
-
TEventData extends SentinelModuleEventData = SentinelModuleEventData,
|
|
53
|
-
> = SentinelModule<TParams, TEventData> & ModuleInstance & Sentinel
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|