@xyo-network/sentinel-model 2.72.9 → 2.73.0
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/index.d.mts +76 -0
- package/dist/index.d.ts +76 -0
- package/dist/index.js +60 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +26 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +37 -24
- package/tsup.config.ts +16 -0
- package/dist/cjs/Config.js +0 -5
- package/dist/cjs/Config.js.map +0 -1
- package/dist/cjs/EventData.js +0 -3
- package/dist/cjs/EventData.js.map +0 -1
- package/dist/cjs/Events/ReportEnd.js +0 -3
- package/dist/cjs/Events/ReportEnd.js.map +0 -1
- package/dist/cjs/Events/ReportStart.js +0 -3
- package/dist/cjs/Events/ReportStart.js.map +0 -1
- package/dist/cjs/Events/index.js +0 -6
- package/dist/cjs/Events/index.js.map +0 -1
- package/dist/cjs/Instance.js +0 -3
- package/dist/cjs/Instance.js.map +0 -1
- package/dist/cjs/Module.js +0 -3
- package/dist/cjs/Module.js.map +0 -1
- package/dist/cjs/Params.js +0 -3
- package/dist/cjs/Params.js.map +0 -1
- package/dist/cjs/Queries/Report.js +0 -5
- package/dist/cjs/Queries/Report.js.map +0 -1
- package/dist/cjs/Queries/index.js +0 -5
- package/dist/cjs/Queries/index.js.map +0 -1
- package/dist/cjs/Sentinel.js +0 -3
- package/dist/cjs/Sentinel.js.map +0 -1
- package/dist/cjs/index.js +0 -13
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/typeChecks.js +0 -13
- package/dist/cjs/typeChecks.js.map +0 -1
- package/dist/docs.json +0 -5144
- package/dist/esm/Config.js +0 -2
- package/dist/esm/Config.js.map +0 -1
- package/dist/esm/EventData.js +0 -2
- package/dist/esm/EventData.js.map +0 -1
- package/dist/esm/Events/ReportEnd.js +0 -2
- package/dist/esm/Events/ReportEnd.js.map +0 -1
- package/dist/esm/Events/ReportStart.js +0 -2
- package/dist/esm/Events/ReportStart.js.map +0 -1
- package/dist/esm/Events/index.js +0 -3
- package/dist/esm/Events/index.js.map +0 -1
- package/dist/esm/Instance.js +0 -2
- package/dist/esm/Instance.js.map +0 -1
- package/dist/esm/Module.js +0 -2
- package/dist/esm/Module.js.map +0 -1
- package/dist/esm/Params.js +0 -2
- package/dist/esm/Params.js.map +0 -1
- package/dist/esm/Queries/Report.js +0 -2
- package/dist/esm/Queries/Report.js.map +0 -1
- package/dist/esm/Queries/index.js +0 -2
- package/dist/esm/Queries/index.js.map +0 -1
- package/dist/esm/Sentinel.js +0 -2
- package/dist/esm/Sentinel.js.map +0 -1
- package/dist/esm/index.js +0 -10
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/typeChecks.js +0 -10
- package/dist/esm/typeChecks.js.map +0 -1
- package/dist/types/Config.d.ts +0 -10
- package/dist/types/Config.d.ts.map +0 -1
- package/dist/types/EventData.d.ts +0 -5
- package/dist/types/EventData.d.ts.map +0 -1
- package/dist/types/Events/ReportEnd.d.ts +0 -13
- package/dist/types/Events/ReportEnd.d.ts.map +0 -1
- package/dist/types/Events/ReportStart.d.ts +0 -10
- package/dist/types/Events/ReportStart.d.ts.map +0 -1
- package/dist/types/Events/index.d.ts +0 -3
- package/dist/types/Events/index.d.ts.map +0 -1
- package/dist/types/Instance.d.ts +0 -14
- package/dist/types/Instance.d.ts.map +0 -1
- package/dist/types/Module.d.ts +0 -6
- package/dist/types/Module.d.ts.map +0 -1
- package/dist/types/Params.d.ts +0 -5
- package/dist/types/Params.d.ts.map +0 -1
- package/dist/types/Queries/Report.d.ts +0 -7
- package/dist/types/Queries/Report.d.ts.map +0 -1
- package/dist/types/Queries/index.d.ts +0 -8
- package/dist/types/Queries/index.d.ts.map +0 -1
- package/dist/types/Sentinel.d.ts +0 -6
- package/dist/types/Sentinel.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -10
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/typeChecks.d.ts +0 -15
- package/dist/types/typeChecks.d.ts.map +0 -1
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { ArchivingModuleConfig, ArchivistInstance } from '@xyo-network/archivist';
|
|
2
|
+
import { ModuleConfig, EventData } from '@xyo-network/module';
|
|
3
|
+
import { Payload, Query } from '@xyo-network/payload-model';
|
|
4
|
+
import * as _xyo_network_module_model from '@xyo-network/module-model';
|
|
5
|
+
import { Module, ModuleEventArgs, ModuleEventData, AnyConfigSchema, ModuleParams, ModuleInstance, ModuleQueryBase, ModuleQuery } from '@xyo-network/module-model';
|
|
6
|
+
import { BoundWitness } from '@xyo-network/boundwitness-model';
|
|
7
|
+
import { Promisable } from '@xyo-network/promise';
|
|
8
|
+
import { WitnessInstance } from '@xyo-network/witness-model';
|
|
9
|
+
import { AnyObject } from '@xyo-network/core';
|
|
10
|
+
import * as _xyo_network_object_identity from '@xyo-network/object-identity';
|
|
11
|
+
|
|
12
|
+
type SentinelConfigSchema = 'network.xyo.sentinel.config';
|
|
13
|
+
declare const SentinelConfigSchema: SentinelConfigSchema;
|
|
14
|
+
type SentinelConfig<TConfig extends Payload = Payload> = ModuleConfig<ArchivingModuleConfig & {
|
|
15
|
+
schema: SentinelConfigSchema;
|
|
16
|
+
witnesses?: string[];
|
|
17
|
+
} & TConfig>;
|
|
18
|
+
|
|
19
|
+
type ReportEndEventArgs<T extends Module = Module> = ModuleEventArgs<T, {
|
|
20
|
+
boundwitness?: BoundWitness;
|
|
21
|
+
inPayloads?: Payload[];
|
|
22
|
+
outPayloads?: Payload[];
|
|
23
|
+
}>;
|
|
24
|
+
interface ReportEndEventData<T extends Module = Module> extends EventData {
|
|
25
|
+
reportEnd: ReportEndEventArgs<T>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
type ReportStartEventArgs<T extends Module = Module> = ModuleEventArgs<T, {
|
|
29
|
+
inPayloads?: Payload[];
|
|
30
|
+
}>;
|
|
31
|
+
interface ReportStartEventData<T extends Module = Module> extends EventData {
|
|
32
|
+
reportStart: ReportStartEventArgs<T>;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface SentinelModuleEventData<T extends Module = Module> extends ReportEndEventData<T>, ReportStartEventData<T>, ModuleEventData<T> {
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
type SentinelParams<TConfig extends AnyConfigSchema<SentinelConfig> = AnyConfigSchema<SentinelConfig>, TAdditionalParams extends AnyObject | undefined = undefined> = ModuleParams<TConfig, TAdditionalParams>;
|
|
39
|
+
|
|
40
|
+
type SentinelModule<TParams extends SentinelParams = SentinelParams> = Module<TParams, SentinelModuleEventData<SentinelModule>>;
|
|
41
|
+
type CustomSentinelModule<TParams extends SentinelParams = SentinelParams, TEvents extends SentinelModuleEventData<SentinelModule<TParams>> = SentinelModuleEventData<SentinelModule<TParams>>> = Module<TParams, TEvents>;
|
|
42
|
+
|
|
43
|
+
interface Sentinel {
|
|
44
|
+
report: (payloads?: Payload[]) => Promisable<Payload[]>;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
type SentinelInstance<TParams extends SentinelParams = SentinelParams> = SentinelModule<TParams> & Sentinel & ModuleInstance & {
|
|
48
|
+
archivists: () => Promisable<ArchivistInstance[]>;
|
|
49
|
+
witnesses: () => Promisable<WitnessInstance[]>;
|
|
50
|
+
};
|
|
51
|
+
type CustomSentinelInstance<TParams extends SentinelParams = SentinelParams, TEvents extends SentinelModuleEventData<SentinelInstance<TParams>> = SentinelModuleEventData<SentinelInstance<TParams>>> = CustomSentinelModule<TParams, TEvents> & Sentinel & SentinelInstance<TParams>;
|
|
52
|
+
|
|
53
|
+
type SentinelReportQuerySchema = 'network.xyo.query.sentinel.report';
|
|
54
|
+
declare const SentinelReportQuerySchema: SentinelReportQuerySchema;
|
|
55
|
+
type SentinelReportQuery = Query<{
|
|
56
|
+
schema: SentinelReportQuerySchema;
|
|
57
|
+
}>;
|
|
58
|
+
|
|
59
|
+
type SentinelQueryBase = SentinelReportQuery;
|
|
60
|
+
type SentinelModuleQueries = ModuleQueryBase | SentinelQueryBase;
|
|
61
|
+
type SentinelQuery<TQuery extends Query | void = void> = ModuleQuery<TQuery extends Query ? SentinelQueryBase | TQuery : SentinelQueryBase>;
|
|
62
|
+
|
|
63
|
+
declare const isSentinelInstance: _xyo_network_object_identity.ObjectTypeCheck<SentinelInstance>;
|
|
64
|
+
declare const isSentinelModule: _xyo_network_module_model.ModuleTypeCheck<SentinelModule>;
|
|
65
|
+
declare const asSentinelModule: {
|
|
66
|
+
(obj: any, config?: _xyo_network_object_identity.ObjectTypeConfig | undefined): SentinelModule | undefined;
|
|
67
|
+
(obj: any, assert: string | (() => string), config?: _xyo_network_object_identity.ObjectTypeConfig | undefined): SentinelModule;
|
|
68
|
+
};
|
|
69
|
+
declare const asSentinelInstance: {
|
|
70
|
+
(obj: any, config?: _xyo_network_object_identity.ObjectTypeConfig | undefined): SentinelInstance | undefined;
|
|
71
|
+
(obj: any, assert: string | (() => string), config?: _xyo_network_object_identity.ObjectTypeConfig | undefined): SentinelInstance;
|
|
72
|
+
};
|
|
73
|
+
declare const withSentinelModule: <R>(module: any, closure: (module: SentinelModule) => R) => R | undefined;
|
|
74
|
+
declare const withSentinelInstance: <R>(module: any, closure: (module: SentinelInstance) => R) => R | undefined;
|
|
75
|
+
|
|
76
|
+
export { CustomSentinelInstance, CustomSentinelModule, ReportEndEventArgs, ReportEndEventData, ReportStartEventArgs, ReportStartEventData, Sentinel, SentinelConfig, SentinelConfigSchema, SentinelInstance, SentinelModule, SentinelModuleEventData, SentinelModuleQueries, SentinelParams, SentinelQuery, SentinelQueryBase, SentinelReportQuery, SentinelReportQuerySchema, asSentinelInstance, asSentinelModule, isSentinelInstance, isSentinelModule, withSentinelInstance, withSentinelModule };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { ArchivingModuleConfig, ArchivistInstance } from '@xyo-network/archivist';
|
|
2
|
+
import { ModuleConfig, EventData } from '@xyo-network/module';
|
|
3
|
+
import { Payload, Query } from '@xyo-network/payload-model';
|
|
4
|
+
import * as _xyo_network_module_model from '@xyo-network/module-model';
|
|
5
|
+
import { Module, ModuleEventArgs, ModuleEventData, AnyConfigSchema, ModuleParams, ModuleInstance, ModuleQueryBase, ModuleQuery } from '@xyo-network/module-model';
|
|
6
|
+
import { BoundWitness } from '@xyo-network/boundwitness-model';
|
|
7
|
+
import { Promisable } from '@xyo-network/promise';
|
|
8
|
+
import { WitnessInstance } from '@xyo-network/witness-model';
|
|
9
|
+
import { AnyObject } from '@xyo-network/core';
|
|
10
|
+
import * as _xyo_network_object_identity from '@xyo-network/object-identity';
|
|
11
|
+
|
|
12
|
+
type SentinelConfigSchema = 'network.xyo.sentinel.config';
|
|
13
|
+
declare const SentinelConfigSchema: SentinelConfigSchema;
|
|
14
|
+
type SentinelConfig<TConfig extends Payload = Payload> = ModuleConfig<ArchivingModuleConfig & {
|
|
15
|
+
schema: SentinelConfigSchema;
|
|
16
|
+
witnesses?: string[];
|
|
17
|
+
} & TConfig>;
|
|
18
|
+
|
|
19
|
+
type ReportEndEventArgs<T extends Module = Module> = ModuleEventArgs<T, {
|
|
20
|
+
boundwitness?: BoundWitness;
|
|
21
|
+
inPayloads?: Payload[];
|
|
22
|
+
outPayloads?: Payload[];
|
|
23
|
+
}>;
|
|
24
|
+
interface ReportEndEventData<T extends Module = Module> extends EventData {
|
|
25
|
+
reportEnd: ReportEndEventArgs<T>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
type ReportStartEventArgs<T extends Module = Module> = ModuleEventArgs<T, {
|
|
29
|
+
inPayloads?: Payload[];
|
|
30
|
+
}>;
|
|
31
|
+
interface ReportStartEventData<T extends Module = Module> extends EventData {
|
|
32
|
+
reportStart: ReportStartEventArgs<T>;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface SentinelModuleEventData<T extends Module = Module> extends ReportEndEventData<T>, ReportStartEventData<T>, ModuleEventData<T> {
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
type SentinelParams<TConfig extends AnyConfigSchema<SentinelConfig> = AnyConfigSchema<SentinelConfig>, TAdditionalParams extends AnyObject | undefined = undefined> = ModuleParams<TConfig, TAdditionalParams>;
|
|
39
|
+
|
|
40
|
+
type SentinelModule<TParams extends SentinelParams = SentinelParams> = Module<TParams, SentinelModuleEventData<SentinelModule>>;
|
|
41
|
+
type CustomSentinelModule<TParams extends SentinelParams = SentinelParams, TEvents extends SentinelModuleEventData<SentinelModule<TParams>> = SentinelModuleEventData<SentinelModule<TParams>>> = Module<TParams, TEvents>;
|
|
42
|
+
|
|
43
|
+
interface Sentinel {
|
|
44
|
+
report: (payloads?: Payload[]) => Promisable<Payload[]>;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
type SentinelInstance<TParams extends SentinelParams = SentinelParams> = SentinelModule<TParams> & Sentinel & ModuleInstance & {
|
|
48
|
+
archivists: () => Promisable<ArchivistInstance[]>;
|
|
49
|
+
witnesses: () => Promisable<WitnessInstance[]>;
|
|
50
|
+
};
|
|
51
|
+
type CustomSentinelInstance<TParams extends SentinelParams = SentinelParams, TEvents extends SentinelModuleEventData<SentinelInstance<TParams>> = SentinelModuleEventData<SentinelInstance<TParams>>> = CustomSentinelModule<TParams, TEvents> & Sentinel & SentinelInstance<TParams>;
|
|
52
|
+
|
|
53
|
+
type SentinelReportQuerySchema = 'network.xyo.query.sentinel.report';
|
|
54
|
+
declare const SentinelReportQuerySchema: SentinelReportQuerySchema;
|
|
55
|
+
type SentinelReportQuery = Query<{
|
|
56
|
+
schema: SentinelReportQuerySchema;
|
|
57
|
+
}>;
|
|
58
|
+
|
|
59
|
+
type SentinelQueryBase = SentinelReportQuery;
|
|
60
|
+
type SentinelModuleQueries = ModuleQueryBase | SentinelQueryBase;
|
|
61
|
+
type SentinelQuery<TQuery extends Query | void = void> = ModuleQuery<TQuery extends Query ? SentinelQueryBase | TQuery : SentinelQueryBase>;
|
|
62
|
+
|
|
63
|
+
declare const isSentinelInstance: _xyo_network_object_identity.ObjectTypeCheck<SentinelInstance>;
|
|
64
|
+
declare const isSentinelModule: _xyo_network_module_model.ModuleTypeCheck<SentinelModule>;
|
|
65
|
+
declare const asSentinelModule: {
|
|
66
|
+
(obj: any, config?: _xyo_network_object_identity.ObjectTypeConfig | undefined): SentinelModule | undefined;
|
|
67
|
+
(obj: any, assert: string | (() => string), config?: _xyo_network_object_identity.ObjectTypeConfig | undefined): SentinelModule;
|
|
68
|
+
};
|
|
69
|
+
declare const asSentinelInstance: {
|
|
70
|
+
(obj: any, config?: _xyo_network_object_identity.ObjectTypeConfig | undefined): SentinelInstance | undefined;
|
|
71
|
+
(obj: any, assert: string | (() => string), config?: _xyo_network_object_identity.ObjectTypeConfig | undefined): SentinelInstance;
|
|
72
|
+
};
|
|
73
|
+
declare const withSentinelModule: <R>(module: any, closure: (module: SentinelModule) => R) => R | undefined;
|
|
74
|
+
declare const withSentinelInstance: <R>(module: any, closure: (module: SentinelInstance) => R) => R | undefined;
|
|
75
|
+
|
|
76
|
+
export { CustomSentinelInstance, CustomSentinelModule, ReportEndEventArgs, ReportEndEventData, ReportStartEventArgs, ReportStartEventData, Sentinel, SentinelConfig, SentinelConfigSchema, SentinelInstance, SentinelModule, SentinelModuleEventData, SentinelModuleQueries, SentinelParams, SentinelQuery, SentinelQueryBase, SentinelReportQuery, SentinelReportQuerySchema, asSentinelInstance, asSentinelModule, isSentinelInstance, isSentinelModule, withSentinelInstance, withSentinelModule };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
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
|
+
SentinelConfigSchema: () => SentinelConfigSchema,
|
|
24
|
+
SentinelReportQuerySchema: () => SentinelReportQuerySchema,
|
|
25
|
+
asSentinelInstance: () => asSentinelInstance,
|
|
26
|
+
asSentinelModule: () => asSentinelModule,
|
|
27
|
+
isSentinelInstance: () => isSentinelInstance,
|
|
28
|
+
isSentinelModule: () => isSentinelModule,
|
|
29
|
+
withSentinelInstance: () => withSentinelInstance,
|
|
30
|
+
withSentinelModule: () => withSentinelModule
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(src_exports);
|
|
33
|
+
|
|
34
|
+
// src/Config.ts
|
|
35
|
+
var SentinelConfigSchema = "network.xyo.sentinel.config";
|
|
36
|
+
|
|
37
|
+
// src/Queries/Report.ts
|
|
38
|
+
var SentinelReportQuerySchema = "network.xyo.query.sentinel.report";
|
|
39
|
+
|
|
40
|
+
// src/typeChecks.ts
|
|
41
|
+
var import_module_model = require("@xyo-network/module-model");
|
|
42
|
+
var import_object_identity = require("@xyo-network/object-identity");
|
|
43
|
+
var isSentinelInstance = new import_module_model.IsInstanceFactory().create({ report: "function" }, [import_module_model.isModuleInstance]);
|
|
44
|
+
var isSentinelModule = new import_module_model.IsModuleFactory().create([SentinelReportQuerySchema]);
|
|
45
|
+
var asSentinelModule = import_object_identity.AsObjectFactory.create(isSentinelModule);
|
|
46
|
+
var asSentinelInstance = import_object_identity.AsObjectFactory.create(isSentinelInstance);
|
|
47
|
+
var withSentinelModule = import_module_model.WithFactory.create(isSentinelModule);
|
|
48
|
+
var withSentinelInstance = import_module_model.WithFactory.create(isSentinelInstance);
|
|
49
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
50
|
+
0 && (module.exports = {
|
|
51
|
+
SentinelConfigSchema,
|
|
52
|
+
SentinelReportQuerySchema,
|
|
53
|
+
asSentinelInstance,
|
|
54
|
+
asSentinelModule,
|
|
55
|
+
isSentinelInstance,
|
|
56
|
+
isSentinelModule,
|
|
57
|
+
withSentinelInstance,
|
|
58
|
+
withSentinelModule
|
|
59
|
+
});
|
|
60
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/Config.ts","../src/Queries/Report.ts","../src/typeChecks.ts"],"sourcesContent":["export * from './Config'\nexport * from './EventData'\nexport * from './Events'\nexport * from './Instance'\nexport * from './Module'\nexport * from './Params'\nexport * from './Queries'\nexport * from './Sentinel'\nexport * from './typeChecks'\n","import { ArchivingModuleConfig } from '@xyo-network/archivist'\nimport { ModuleConfig } from '@xyo-network/module'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport type SentinelConfigSchema = 'network.xyo.sentinel.config'\nexport const SentinelConfigSchema: SentinelConfigSchema = 'network.xyo.sentinel.config'\n\nexport type SentinelConfig<TConfig extends Payload = Payload> = ModuleConfig<\n ArchivingModuleConfig & {\n schema: SentinelConfigSchema\n witnesses?: string[]\n } & TConfig\n>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type SentinelReportQuerySchema = 'network.xyo.query.sentinel.report'\nexport const SentinelReportQuerySchema: SentinelReportQuerySchema = 'network.xyo.query.sentinel.report'\n\nexport type SentinelReportQuery = Query<{\n schema: SentinelReportQuerySchema\n}>\n","import { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'\nimport { AsObjectFactory } from '@xyo-network/object-identity'\n\nimport { SentinelInstance } from './Instance'\nimport { SentinelModule } from './Module'\nimport { SentinelReportQuerySchema } from './Queries'\n\nexport const isSentinelInstance = new IsInstanceFactory<SentinelInstance>().create({ report: 'function' }, [isModuleInstance])\nexport const isSentinelModule = new IsModuleFactory<SentinelModule>().create([SentinelReportQuerySchema])\n\nexport const asSentinelModule = AsObjectFactory.create(isSentinelModule)\nexport const asSentinelInstance = AsObjectFactory.create(isSentinelInstance)\nexport const withSentinelModule = WithFactory.create(isSentinelModule)\nexport const withSentinelInstance = WithFactory.create(isSentinelInstance)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKO,IAAM,uBAA6C;;;ACFnD,IAAM,4BAAuD;;;ACHpE,0BAAkF;AAClF,6BAAgC;AAMzB,IAAM,qBAAqB,IAAI,sCAAoC,EAAE,OAAO,EAAE,QAAQ,WAAW,GAAG,CAAC,oCAAgB,CAAC;AACtH,IAAM,mBAAmB,IAAI,oCAAgC,EAAE,OAAO,CAAC,yBAAyB,CAAC;AAEjG,IAAM,mBAAmB,uCAAgB,OAAO,gBAAgB;AAChE,IAAM,qBAAqB,uCAAgB,OAAO,kBAAkB;AACpE,IAAM,qBAAqB,gCAAY,OAAO,gBAAgB;AAC9D,IAAM,uBAAuB,gCAAY,OAAO,kBAAkB;","names":[]}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// src/Config.ts
|
|
2
|
+
var SentinelConfigSchema = "network.xyo.sentinel.config";
|
|
3
|
+
|
|
4
|
+
// src/Queries/Report.ts
|
|
5
|
+
var SentinelReportQuerySchema = "network.xyo.query.sentinel.report";
|
|
6
|
+
|
|
7
|
+
// src/typeChecks.ts
|
|
8
|
+
import { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from "@xyo-network/module-model";
|
|
9
|
+
import { AsObjectFactory } from "@xyo-network/object-identity";
|
|
10
|
+
var isSentinelInstance = new IsInstanceFactory().create({ report: "function" }, [isModuleInstance]);
|
|
11
|
+
var isSentinelModule = new IsModuleFactory().create([SentinelReportQuerySchema]);
|
|
12
|
+
var asSentinelModule = AsObjectFactory.create(isSentinelModule);
|
|
13
|
+
var asSentinelInstance = AsObjectFactory.create(isSentinelInstance);
|
|
14
|
+
var withSentinelModule = WithFactory.create(isSentinelModule);
|
|
15
|
+
var withSentinelInstance = WithFactory.create(isSentinelInstance);
|
|
16
|
+
export {
|
|
17
|
+
SentinelConfigSchema,
|
|
18
|
+
SentinelReportQuerySchema,
|
|
19
|
+
asSentinelInstance,
|
|
20
|
+
asSentinelModule,
|
|
21
|
+
isSentinelInstance,
|
|
22
|
+
isSentinelModule,
|
|
23
|
+
withSentinelInstance,
|
|
24
|
+
withSentinelModule
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Config.ts","../src/Queries/Report.ts","../src/typeChecks.ts"],"sourcesContent":["import { ArchivingModuleConfig } from '@xyo-network/archivist'\nimport { ModuleConfig } from '@xyo-network/module'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport type SentinelConfigSchema = 'network.xyo.sentinel.config'\nexport const SentinelConfigSchema: SentinelConfigSchema = 'network.xyo.sentinel.config'\n\nexport type SentinelConfig<TConfig extends Payload = Payload> = ModuleConfig<\n ArchivingModuleConfig & {\n schema: SentinelConfigSchema\n witnesses?: string[]\n } & TConfig\n>\n","import { Query } from '@xyo-network/payload-model'\n\nexport type SentinelReportQuerySchema = 'network.xyo.query.sentinel.report'\nexport const SentinelReportQuerySchema: SentinelReportQuerySchema = 'network.xyo.query.sentinel.report'\n\nexport type SentinelReportQuery = Query<{\n schema: SentinelReportQuerySchema\n}>\n","import { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'\nimport { AsObjectFactory } from '@xyo-network/object-identity'\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":";AAKO,IAAM,uBAA6C;;;ACFnD,IAAM,4BAAuD;;;ACHpE,SAAS,mBAAmB,iBAAiB,kBAAkB,mBAAmB;AAClF,SAAS,uBAAuB;AAMzB,IAAM,qBAAqB,IAAI,kBAAoC,EAAE,OAAO,EAAE,QAAQ,WAAW,GAAG,CAAC,gBAAgB,CAAC;AACtH,IAAM,mBAAmB,IAAI,gBAAgC,EAAE,OAAO,CAAC,yBAAyB,CAAC;AAEjG,IAAM,mBAAmB,gBAAgB,OAAO,gBAAgB;AAChE,IAAM,qBAAqB,gBAAgB,OAAO,kBAAkB;AACpE,IAAM,qBAAqB,YAAY,OAAO,gBAAgB;AAC9D,IAAM,uBAAuB,YAAY,OAAO,kBAAkB;","names":[]}
|
package/package.json
CHANGED
|
@@ -10,43 +10,57 @@
|
|
|
10
10
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xyo-network/archivist": "~2.
|
|
14
|
-
"@xyo-network/boundwitness-model": "~2.
|
|
15
|
-
"@xyo-network/core": "~2.
|
|
16
|
-
"@xyo-network/module": "~2.
|
|
17
|
-
"@xyo-network/module-model": "~2.
|
|
18
|
-
"@xyo-network/object-identity": "~2.
|
|
19
|
-
"@xyo-network/payload-model": "~2.
|
|
20
|
-
"@xyo-network/promise": "~2.
|
|
21
|
-
"@xyo-network/witness-model": "~2.
|
|
13
|
+
"@xyo-network/archivist": "~2.73.0",
|
|
14
|
+
"@xyo-network/boundwitness-model": "~2.73.0",
|
|
15
|
+
"@xyo-network/core": "~2.73.0",
|
|
16
|
+
"@xyo-network/module": "~2.73.0",
|
|
17
|
+
"@xyo-network/module-model": "~2.73.0",
|
|
18
|
+
"@xyo-network/object-identity": "~2.73.0",
|
|
19
|
+
"@xyo-network/payload-model": "~2.73.0",
|
|
20
|
+
"@xyo-network/promise": "~2.73.0",
|
|
21
|
+
"@xyo-network/witness-model": "~2.73.0"
|
|
22
22
|
},
|
|
23
23
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@xylabs/ts-scripts-yarn3": "^2.19.
|
|
26
|
-
"@xylabs/tsconfig": "^2.19.
|
|
25
|
+
"@xylabs/ts-scripts-yarn3": "^2.19.5",
|
|
26
|
+
"@xylabs/tsconfig": "^2.19.5",
|
|
27
|
+
"publint": "^0.2.2",
|
|
28
|
+
"tsup": "^7.2.0",
|
|
27
29
|
"typescript": "^5.2.2"
|
|
28
30
|
},
|
|
29
|
-
"
|
|
31
|
+
"scripts": {
|
|
32
|
+
"package-compile": "tsup && publint",
|
|
33
|
+
"package-recompile": "tsup && publint"
|
|
34
|
+
},
|
|
30
35
|
"docs": "dist/docs.json",
|
|
36
|
+
"types": "dist/index.d.ts",
|
|
31
37
|
"exports": {
|
|
32
38
|
".": {
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
},
|
|
37
|
-
"browser": {
|
|
38
|
-
"import": "./dist/esm/index.js",
|
|
39
|
-
"require": "./dist/cjs/index.js"
|
|
39
|
+
"require": {
|
|
40
|
+
"types": "./dist/index.d.ts",
|
|
41
|
+
"default": "./dist/index.js"
|
|
40
42
|
},
|
|
41
|
-
"
|
|
43
|
+
"import": {
|
|
44
|
+
"types": "./dist/index.d.mts",
|
|
45
|
+
"default": "./dist/index.mjs"
|
|
46
|
+
}
|
|
42
47
|
},
|
|
43
48
|
"./dist/docs.json": {
|
|
44
49
|
"default": "./dist/docs.json"
|
|
45
50
|
},
|
|
51
|
+
"./cjs": {
|
|
52
|
+
"default": "./dist/index.js"
|
|
53
|
+
},
|
|
54
|
+
"./docs": {
|
|
55
|
+
"default": "./dist/docs.json"
|
|
56
|
+
},
|
|
57
|
+
"./esm": {
|
|
58
|
+
"default": "./dist/index.mjs"
|
|
59
|
+
},
|
|
46
60
|
"./package.json": "./package.json"
|
|
47
61
|
},
|
|
48
|
-
"main": "dist/
|
|
49
|
-
"module": "dist/
|
|
62
|
+
"main": "dist/index.js",
|
|
63
|
+
"module": "dist/index.mjs",
|
|
50
64
|
"homepage": "https://xyo.network",
|
|
51
65
|
"license": "LGPL-3.0",
|
|
52
66
|
"publishConfig": {
|
|
@@ -57,6 +71,5 @@
|
|
|
57
71
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
|
|
58
72
|
},
|
|
59
73
|
"sideEffects": false,
|
|
60
|
-
"
|
|
61
|
-
"version": "2.72.9"
|
|
74
|
+
"version": "2.73.0"
|
|
62
75
|
}
|
package/tsup.config.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defineConfig } from 'tsup'
|
|
2
|
+
|
|
3
|
+
// eslint-disable-next-line import/no-default-export
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
bundle: true,
|
|
6
|
+
cjsInterop: true,
|
|
7
|
+
clean: true,
|
|
8
|
+
dts: {
|
|
9
|
+
entry: ['src/index.ts'],
|
|
10
|
+
},
|
|
11
|
+
entry: ['src/index.ts'],
|
|
12
|
+
format: ['cjs', 'esm'],
|
|
13
|
+
sourcemap: true,
|
|
14
|
+
splitting: false,
|
|
15
|
+
tsconfig: 'tsconfig.json',
|
|
16
|
+
})
|
package/dist/cjs/Config.js
DELETED
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"}
|
package/dist/cjs/EventData.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EventData.js","sourceRoot":"","sources":["../../src/EventData.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReportEnd.js","sourceRoot":"","sources":["../../../src/Events/ReportEnd.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReportStart.js","sourceRoot":"","sources":["../../../src/Events/ReportStart.ts"],"names":[],"mappings":""}
|
package/dist/cjs/Events/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Events/index.ts"],"names":[],"mappings":";;;AAAA,sDAA2B;AAC3B,wDAA6B"}
|
package/dist/cjs/Instance.js
DELETED
package/dist/cjs/Instance.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Instance.js","sourceRoot":"","sources":["../../src/Instance.ts"],"names":[],"mappings":""}
|
package/dist/cjs/Module.js
DELETED
package/dist/cjs/Module.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Module.js","sourceRoot":"","sources":["../../src/Module.ts"],"names":[],"mappings":""}
|
package/dist/cjs/Params.js
DELETED
package/dist/cjs/Params.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Params.js","sourceRoot":"","sources":["../../src/Params.ts"],"names":[],"mappings":""}
|
|
@@ -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"}
|
package/dist/cjs/Sentinel.js
DELETED
package/dist/cjs/Sentinel.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Sentinel.js","sourceRoot":"","sources":["../../src/Sentinel.ts"],"names":[],"mappings":""}
|
package/dist/cjs/index.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./Config"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./EventData"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./Events"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./Instance"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./Module"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("./Params"), exports);
|
|
10
|
-
tslib_1.__exportStar(require("./Queries"), exports);
|
|
11
|
-
tslib_1.__exportStar(require("./Sentinel"), exports);
|
|
12
|
-
tslib_1.__exportStar(require("./typeChecks"), exports);
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,mDAAwB;AACxB,sDAA2B;AAC3B,mDAAwB;AACxB,qDAA0B;AAC1B,mDAAwB;AACxB,mDAAwB;AACxB,oDAAyB;AACzB,qDAA0B;AAC1B,uDAA4B"}
|
package/dist/cjs/typeChecks.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.withSentinelInstance = exports.withSentinelModule = exports.asSentinelInstance = exports.asSentinelModule = exports.isSentinelModule = exports.isSentinelInstance = void 0;
|
|
4
|
-
const module_model_1 = require("@xyo-network/module-model");
|
|
5
|
-
const object_identity_1 = require("@xyo-network/object-identity");
|
|
6
|
-
const Queries_1 = require("./Queries");
|
|
7
|
-
exports.isSentinelInstance = new module_model_1.IsInstanceFactory().create({ report: 'function' }, [module_model_1.isModuleInstance]);
|
|
8
|
-
exports.isSentinelModule = new module_model_1.IsModuleFactory().create([Queries_1.SentinelReportQuerySchema]);
|
|
9
|
-
exports.asSentinelModule = object_identity_1.AsObjectFactory.create(exports.isSentinelModule);
|
|
10
|
-
exports.asSentinelInstance = object_identity_1.AsObjectFactory.create(exports.isSentinelInstance);
|
|
11
|
-
exports.withSentinelModule = module_model_1.WithFactory.create(exports.isSentinelModule);
|
|
12
|
-
exports.withSentinelInstance = module_model_1.WithFactory.create(exports.isSentinelInstance);
|
|
13
|
-
//# sourceMappingURL=typeChecks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typeChecks.js","sourceRoot":"","sources":["../../src/typeChecks.ts"],"names":[],"mappings":";;;AAAA,4DAA6G;AAC7G,kEAA8D;AAI9D,uCAAqD;AAExC,QAAA,kBAAkB,GAAG,IAAI,gCAAiB,EAAoB,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,CAAC,+BAAgB,CAAC,CAAC,CAAA;AACjH,QAAA,gBAAgB,GAAG,IAAI,8BAAe,EAAkB,CAAC,MAAM,CAAC,CAAC,mCAAyB,CAAC,CAAC,CAAA;AAE5F,QAAA,gBAAgB,GAAG,iCAAe,CAAC,MAAM,CAAC,wBAAgB,CAAC,CAAA;AAC3D,QAAA,kBAAkB,GAAG,iCAAe,CAAC,MAAM,CAAC,0BAAkB,CAAC,CAAA;AAC/D,QAAA,kBAAkB,GAAG,0BAAW,CAAC,MAAM,CAAC,wBAAgB,CAAC,CAAA;AACzD,QAAA,oBAAoB,GAAG,0BAAW,CAAC,MAAM,CAAC,0BAAkB,CAAC,CAAA"}
|