@xyo-network/sentinel-model 6.1.0 → 7.0.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/neutral/Automation.d.ts +28 -25
- package/dist/neutral/Automation.d.ts.map +1 -1
- package/dist/neutral/Config.d.ts +16 -1
- package/dist/neutral/Config.d.ts.map +1 -1
- package/dist/neutral/Queries/Report.d.ts +11 -5
- package/dist/neutral/Queries/Report.d.ts.map +1 -1
- package/dist/neutral/index.mjs +79 -3
- package/dist/neutral/index.mjs.map +3 -3
- package/package.json +12 -12
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import type { EventName } from '@xylabs/sdk-js';
|
|
2
|
+
import { zodAsFactory, zodIsFactory, zodToFactory } from '@xylabs/sdk-js';
|
|
2
3
|
import type { ModuleIdentifier } from '@xyo-network/module-model';
|
|
3
4
|
import type { Payload } from '@xyo-network/sdk-protocol-js';
|
|
4
|
-
|
|
5
|
+
import * as z from 'zod/mini';
|
|
6
|
+
export declare const SentinelAutomationSchema: 'network.xyo.automation' & {
|
|
5
7
|
readonly __schema: true;
|
|
6
8
|
};
|
|
7
9
|
export type SentinelAutomationSchema = typeof SentinelAutomationSchema;
|
|
8
|
-
export declare const SentinelIntervalAutomationSchema:
|
|
10
|
+
export declare const SentinelIntervalAutomationSchema: 'network.xyo.automation.interval' & {
|
|
9
11
|
readonly __schema: true;
|
|
10
12
|
};
|
|
11
13
|
export type SentinelIntervalAutomationSchema = typeof SentinelIntervalAutomationSchema;
|
|
12
|
-
export declare const SentinelModuleEventAutomationSchema:
|
|
14
|
+
export declare const SentinelModuleEventAutomationSchema: 'network.xyo.automation.event.module' & {
|
|
13
15
|
readonly __schema: true;
|
|
14
16
|
};
|
|
15
17
|
export type SentinelModuleEventAutomationSchema = typeof SentinelModuleEventAutomationSchema;
|
|
@@ -17,29 +19,30 @@ export type SentinelBaseAutomationPayload<T extends Payload> = Payload<{
|
|
|
17
19
|
type?: 'interval' | 'event';
|
|
18
20
|
} & T>;
|
|
19
21
|
/** Settings for an Interval Automation */
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
type: 'interval';
|
|
34
|
-
}>;
|
|
35
|
-
export declare const isSentinelIntervalAutomation: (x?: unknown) => x is SentinelIntervalAutomationPayload;
|
|
22
|
+
export declare const SentinelIntervalAutomationZod: z.ZodMiniObject<{
|
|
23
|
+
end: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
24
|
+
frequency: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
25
|
+
frequencyUnits: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniLiteral<'second'>, z.ZodMiniLiteral<'minute'>, z.ZodMiniLiteral<'hour'>, z.ZodMiniLiteral<'day'>, z.ZodMiniLiteral<'millis'>]>>;
|
|
26
|
+
remaining: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
27
|
+
schema: z.ZodMiniLiteral<SentinelIntervalAutomationSchema>;
|
|
28
|
+
start: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
29
|
+
type: z.ZodMiniLiteral<'interval'>;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
export type SentinelIntervalAutomationPayload = z.infer<typeof SentinelIntervalAutomationZod>;
|
|
32
|
+
export declare const isSentinelIntervalAutomation: ReturnType<typeof zodIsFactory<SentinelIntervalAutomationPayload>>;
|
|
33
|
+
export declare const asSentinelIntervalAutomation: ReturnType<typeof zodAsFactory<SentinelIntervalAutomationPayload>>;
|
|
34
|
+
export declare const toSentinelIntervalAutomation: ReturnType<typeof zodToFactory<SentinelIntervalAutomationPayload>>;
|
|
36
35
|
/** Settings for an Module Event Automation */
|
|
37
|
-
export
|
|
38
|
-
eventName: EventName
|
|
39
|
-
schema: SentinelModuleEventAutomationSchema
|
|
40
|
-
source: ModuleIdentifier
|
|
41
|
-
type: 'event'
|
|
42
|
-
}>;
|
|
36
|
+
export declare const SentinelModuleEventAutomationZod: z.ZodMiniObject<{
|
|
37
|
+
eventName: z.ZodMiniCustom<EventName, EventName>;
|
|
38
|
+
schema: z.ZodMiniLiteral<SentinelModuleEventAutomationSchema>;
|
|
39
|
+
source: z.ZodMiniCustom<ModuleIdentifier, ModuleIdentifier>;
|
|
40
|
+
type: z.ZodMiniLiteral<'event'>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
export type SentinelModuleEventAutomationPayload = z.infer<typeof SentinelModuleEventAutomationZod>;
|
|
43
|
+
export declare const isSentinelModuleEventAutomation: ReturnType<typeof zodIsFactory<SentinelModuleEventAutomationPayload>>;
|
|
44
|
+
export declare const asSentinelModuleEventAutomation: ReturnType<typeof zodAsFactory<SentinelModuleEventAutomationPayload>>;
|
|
45
|
+
export declare const toSentinelModuleEventAutomation: ReturnType<typeof zodToFactory<SentinelModuleEventAutomationPayload>>;
|
|
43
46
|
/** Settings for an Automation */
|
|
44
47
|
export type SentinelAutomationPayload = Payload<SentinelIntervalAutomationPayload | SentinelModuleEventAutomationPayload, SentinelAutomationSchema | SentinelIntervalAutomationSchema | SentinelModuleEventAutomationSchema>;
|
|
45
48
|
//# sourceMappingURL=Automation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Automation.d.ts","sourceRoot":"","sources":["../../src/Automation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AACjE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"Automation.d.ts","sourceRoot":"","sources":["../../src/Automation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,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AI,EAAE,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,CAAA;CAChC,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAId,CAAA;AAEF,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAA;AAEnG,eAAO,MAAM,+BAA+B,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,oCAAoC,CAAC,CAAkD,CAAA;AACpK,eAAO,MAAM,+BAA+B,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,oCAAoC,CAAC,CAAqF,CAAA;AACvM,eAAO,MAAM,+BAA+B,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,oCAAoC,CAAC,CAAqF,CAAA;AAEvM,iCAAiC;AACjC,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAC7C,iCAAiC,GAAG,oCAAoC,EACxE,wBAAwB,GAAG,gCAAgC,GAAG,mCAAmC,CAClG,CAAA"}
|
package/dist/neutral/Config.d.ts
CHANGED
|
@@ -1,12 +1,27 @@
|
|
|
1
1
|
import type { WithAdditional } from '@xylabs/sdk-js';
|
|
2
|
+
import { zodAsFactory, zodIsFactory, zodToFactory } from '@xylabs/sdk-js';
|
|
2
3
|
import type { ModuleConfig } from '@xyo-network/module-model';
|
|
4
|
+
import { ModuleConfigZod } from '@xyo-network/module-model';
|
|
3
5
|
import { type Payload, type Schema } from '@xyo-network/sdk-protocol-js';
|
|
6
|
+
import * as z from 'zod/mini';
|
|
4
7
|
import type { SentinelAutomationPayload } from './Automation.ts';
|
|
5
8
|
import type { Task } from './Task.ts';
|
|
6
|
-
export declare const SentinelConfigSchema:
|
|
9
|
+
export declare const SentinelConfigSchema: 'network.xyo.sentinel.config' & {
|
|
7
10
|
readonly __schema: true;
|
|
8
11
|
};
|
|
9
12
|
export type SentinelConfigSchema = typeof SentinelConfigSchema;
|
|
13
|
+
export declare const SentinelConfigZod: z.ZodMiniObject<Omit<(typeof ModuleConfigZod)['shape'], 'schema'> & {
|
|
14
|
+
schema: z.ZodMiniLiteral<SentinelConfigSchema>;
|
|
15
|
+
} & {
|
|
16
|
+
automations: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniCustom<SentinelAutomationPayload, SentinelAutomationPayload>>>;
|
|
17
|
+
synchronous: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
18
|
+
tasks: z.ZodMiniArray<z.ZodMiniCustom<Task, Task>>;
|
|
19
|
+
throwErrors: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
export type SentinelConfigBase = z.infer<typeof SentinelConfigZod>;
|
|
22
|
+
export declare const isSentinelConfig: ReturnType<typeof zodIsFactory<SentinelConfigBase>>;
|
|
23
|
+
export declare const asSentinelConfig: ReturnType<typeof zodAsFactory<SentinelConfigBase>>;
|
|
24
|
+
export declare const toSentinelConfig: ReturnType<typeof zodToFactory<SentinelConfigBase>>;
|
|
10
25
|
export type SentinelConfig<TConfig extends Payload | void = void, TSchema extends Schema | void = void> = ModuleConfig<WithAdditional<{
|
|
11
26
|
automations?: SentinelAutomationPayload[];
|
|
12
27
|
schema: TConfig extends Payload ? TConfig['schema'] : SentinelConfigSchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EACK,KAAK,OAAO,EAAE,KAAK,MAAM,EACpC,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,EACL,YAAY,EAAE,YAAY,EAAE,Y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BAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAElE,eAAO,MAAM,gBAAgB,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,kBAAkB,CAAC,CAAmC,CAAA;AACpH,eAAO,MAAM,gBAAgB,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,kBAAkB,CAAC,CAAuD,CAAA;AACxI,eAAO,MAAM,gBAAgB,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,kBAAkB,CAAC,CAAuD,CAAA;AAExI,MAAM,MAAM,cAAc,CAAC,OAAO,SAAS,OAAO,GAAG,IAAI,GAAG,IAAI,EAAE,OAAO,SAAS,MAAM,GAAG,IAAI,GAAG,IAAI,IAAI,YAAY,CACpH,cAAc,CACZ;IACE,WAAW,CAAC,EAAE,yBAAyB,EAAE,CAAA;IACzC,MAAM,EAAE,OAAO,SAAS,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,oBAAoB,CAAA;IAC1E,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,EACD,OAAO,CACR,EACD,OAAO,CACR,CAAA"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { zodAsFactory, zodIsFactory, zodToFactory } from '@xylabs/sdk-js';
|
|
2
|
+
import { QueryFieldsZod } from '@xyo-network/sdk-protocol-js';
|
|
3
|
+
import * as z from 'zod/mini';
|
|
4
|
+
export declare const SentinelReportQuerySchema: 'network.xyo.query.sentinel.report' & {
|
|
3
5
|
readonly __schema: true;
|
|
4
6
|
};
|
|
5
7
|
export type SentinelReportQuerySchema = typeof SentinelReportQuerySchema;
|
|
6
|
-
export
|
|
7
|
-
schema: SentinelReportQuerySchema
|
|
8
|
-
}>;
|
|
8
|
+
export declare const SentinelReportQueryZod: z.ZodMiniObject<{
|
|
9
|
+
schema: z.ZodMiniLiteral<SentinelReportQuerySchema>;
|
|
10
|
+
} & (typeof QueryFieldsZod)['shape'], z.core.$strip>;
|
|
11
|
+
export type SentinelReportQuery = z.infer<typeof SentinelReportQueryZod>;
|
|
12
|
+
export declare const isSentinelReportQuery: ReturnType<typeof zodIsFactory<SentinelReportQuery>>;
|
|
13
|
+
export declare const asSentinelReportQuery: ReturnType<typeof zodAsFactory<SentinelReportQuery>>;
|
|
14
|
+
export declare const toSentinelReportQuery: ReturnType<typeof zodToFactory<SentinelReportQuery>>;
|
|
9
15
|
//# sourceMappingURL=Report.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Report.d.ts","sourceRoot":"","sources":["../../../src/Queries/Report.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Report.d.ts","sourceRoot":"","sources":["../../../src/Queries/Report.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAAE,YAAY,EAAE,YAAY,EACzC,MAAM,gBAAgB,CAAA;AACvB,OAAO,EACyB,cAAc,EAC7C,MAAM,8BAA8B,CAAA;AACrC,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAE7B,eAAO,MAAM,yBAAyB,EAAE,mCAAmC,GAAG;IAC5E,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAA;CAC8B,CAAA;AACvD,MAAM,MAAM,yBAAyB,GAAG,OAAO,yBAAyB,CAAA;AAExE,eAAO,MAAM,sBAAsB,EAAE,CAAC,CAAC,aAAa,CAChD;IAAE,MAAM,EAAE,CAAC,CAAC,cAAc,CAAC,yBAAyB,CAAC,CAAA;CAAE,GACvD,CAAC,OAAO,cAAc,CAAC,CAAC,OAAO,CAAC,EAClC,CAAC,CAAC,IAAI,CAAC,MAAM,CACyE,CAAA;AAExF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAExE,eAAO,MAAM,qBAAqB,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,mBAAmB,CAAC,CAAwC,CAAA;AAC/H,eAAO,MAAM,qBAAqB,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,mBAAmB,CAAC,CAAiE,CAAA;AACxJ,eAAO,MAAM,qBAAqB,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,mBAAmB,CAAC,CAAiE,CAAA"}
|
package/dist/neutral/index.mjs
CHANGED
|
@@ -15,8 +15,22 @@ import {
|
|
|
15
15
|
} from "@xyo-network/module-model";
|
|
16
16
|
|
|
17
17
|
// src/Queries/Report.ts
|
|
18
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
zodAsFactory,
|
|
20
|
+
zodIsFactory,
|
|
21
|
+
zodToFactory
|
|
22
|
+
} from "@xylabs/sdk-js";
|
|
23
|
+
import {
|
|
24
|
+
asSchema,
|
|
25
|
+
PayloadZodOfSchema,
|
|
26
|
+
QueryFieldsZod
|
|
27
|
+
} from "@xyo-network/sdk-protocol-js";
|
|
28
|
+
import * as z from "zod/mini";
|
|
19
29
|
var SentinelReportQuerySchema = asSchema("network.xyo.query.sentinel.report", true);
|
|
30
|
+
var SentinelReportQueryZod = z.extend(PayloadZodOfSchema(SentinelReportQuerySchema), { ...QueryFieldsZod.shape });
|
|
31
|
+
var isSentinelReportQuery = zodIsFactory(SentinelReportQueryZod);
|
|
32
|
+
var asSentinelReportQuery = zodAsFactory(SentinelReportQueryZod, "asSentinelReportQuery");
|
|
33
|
+
var toSentinelReportQuery = zodToFactory(SentinelReportQueryZod, "toSentinelReportQuery");
|
|
20
34
|
|
|
21
35
|
// src/typeChecks.ts
|
|
22
36
|
var isSentinelInstance = new IsInstanceFactory().create({ report: "function" }, [isModuleInstance]);
|
|
@@ -43,32 +57,94 @@ var IsAttachableSentinelInstanceFactory = class extends IsObjectFactory2 {
|
|
|
43
57
|
};
|
|
44
58
|
|
|
45
59
|
// src/Automation.ts
|
|
46
|
-
import {
|
|
60
|
+
import {
|
|
61
|
+
zodAsFactory as zodAsFactory2,
|
|
62
|
+
zodIsFactory as zodIsFactory2,
|
|
63
|
+
zodToFactory as zodToFactory2
|
|
64
|
+
} from "@xylabs/sdk-js";
|
|
65
|
+
import { asSchema as asSchema2, PayloadZodOfSchema as PayloadZodOfSchema2 } from "@xyo-network/sdk-protocol-js";
|
|
66
|
+
import * as z2 from "zod/mini";
|
|
47
67
|
var SentinelAutomationSchema = asSchema2("network.xyo.automation", true);
|
|
48
68
|
var SentinelIntervalAutomationSchema = asSchema2("network.xyo.automation.interval", true);
|
|
49
69
|
var SentinelModuleEventAutomationSchema = asSchema2("network.xyo.automation.event.module", true);
|
|
50
|
-
var
|
|
70
|
+
var SentinelIntervalAutomationZod = z2.extend(PayloadZodOfSchema2(SentinelIntervalAutomationSchema), {
|
|
71
|
+
/** Epoch after which any reoccurrence stops */
|
|
72
|
+
end: z2.optional(z2.number()),
|
|
73
|
+
/** Time between triggers [non-repeating if undefined] */
|
|
74
|
+
frequency: z2.optional(z2.number()),
|
|
75
|
+
/** Units for frequency field [hour if undefined] */
|
|
76
|
+
frequencyUnits: z2.optional(z2.union([z2.literal("second"), z2.literal("minute"), z2.literal("hour"), z2.literal("day"), z2.literal("millis")])),
|
|
77
|
+
/** Remaining triggers [infinite if undefined] */
|
|
78
|
+
remaining: z2.optional(z2.number()),
|
|
79
|
+
/** Epoch of the next trigger */
|
|
80
|
+
start: z2.optional(z2.number()),
|
|
81
|
+
/** The type of automation */
|
|
82
|
+
type: z2.literal("interval")
|
|
83
|
+
});
|
|
84
|
+
var isSentinelIntervalAutomation = zodIsFactory2(SentinelIntervalAutomationZod);
|
|
85
|
+
var asSentinelIntervalAutomation = zodAsFactory2(SentinelIntervalAutomationZod, "asSentinelIntervalAutomation");
|
|
86
|
+
var toSentinelIntervalAutomation = zodToFactory2(SentinelIntervalAutomationZod, "toSentinelIntervalAutomation");
|
|
87
|
+
var SentinelModuleEventAutomationZod = z2.extend(PayloadZodOfSchema2(SentinelModuleEventAutomationSchema), {
|
|
88
|
+
eventName: z2.custom(),
|
|
89
|
+
source: z2.custom(),
|
|
90
|
+
type: z2.literal("event")
|
|
91
|
+
});
|
|
92
|
+
var isSentinelModuleEventAutomation = zodIsFactory2(SentinelModuleEventAutomationZod);
|
|
93
|
+
var asSentinelModuleEventAutomation = zodAsFactory2(SentinelModuleEventAutomationZod, "asSentinelModuleEventAutomation");
|
|
94
|
+
var toSentinelModuleEventAutomation = zodToFactory2(SentinelModuleEventAutomationZod, "toSentinelModuleEventAutomation");
|
|
51
95
|
|
|
52
96
|
// src/Config.ts
|
|
97
|
+
import {
|
|
98
|
+
zodAsFactory as zodAsFactory3,
|
|
99
|
+
zodIsFactory as zodIsFactory3,
|
|
100
|
+
zodToFactory as zodToFactory3
|
|
101
|
+
} from "@xylabs/sdk-js";
|
|
102
|
+
import { ModuleConfigZod } from "@xyo-network/module-model";
|
|
53
103
|
import {
|
|
54
104
|
asSchema as asSchema3
|
|
55
105
|
} from "@xyo-network/sdk-protocol-js";
|
|
106
|
+
import * as z3 from "zod/mini";
|
|
56
107
|
var SentinelConfigSchema = asSchema3("network.xyo.sentinel.config", true);
|
|
108
|
+
var SentinelConfigZod = z3.extend(ModuleConfigZod, {
|
|
109
|
+
schema: z3.literal(SentinelConfigSchema),
|
|
110
|
+
automations: z3.optional(z3.array(z3.custom())),
|
|
111
|
+
synchronous: z3.optional(z3.boolean()),
|
|
112
|
+
tasks: z3.array(z3.custom()),
|
|
113
|
+
throwErrors: z3.optional(z3.boolean())
|
|
114
|
+
});
|
|
115
|
+
var isSentinelConfig = zodIsFactory3(SentinelConfigZod);
|
|
116
|
+
var asSentinelConfig = zodAsFactory3(SentinelConfigZod, "asSentinelConfig");
|
|
117
|
+
var toSentinelConfig = zodToFactory3(SentinelConfigZod, "toSentinelConfig");
|
|
57
118
|
export {
|
|
58
119
|
IsAttachableSentinelInstanceFactory,
|
|
59
120
|
SentinelAutomationSchema,
|
|
60
121
|
SentinelConfigSchema,
|
|
122
|
+
SentinelConfigZod,
|
|
61
123
|
SentinelIntervalAutomationSchema,
|
|
124
|
+
SentinelIntervalAutomationZod,
|
|
62
125
|
SentinelModuleEventAutomationSchema,
|
|
126
|
+
SentinelModuleEventAutomationZod,
|
|
63
127
|
SentinelReportQuerySchema,
|
|
128
|
+
SentinelReportQueryZod,
|
|
64
129
|
asAttachableSentinelInstance,
|
|
130
|
+
asSentinelConfig,
|
|
65
131
|
asSentinelInstance,
|
|
132
|
+
asSentinelIntervalAutomation,
|
|
66
133
|
asSentinelModule,
|
|
134
|
+
asSentinelModuleEventAutomation,
|
|
135
|
+
asSentinelReportQuery,
|
|
67
136
|
isAttachableSentinelInstance,
|
|
137
|
+
isSentinelConfig,
|
|
68
138
|
isSentinelInstance,
|
|
69
139
|
isSentinelIntervalAutomation,
|
|
70
140
|
isSentinelModule,
|
|
141
|
+
isSentinelModuleEventAutomation,
|
|
142
|
+
isSentinelReportQuery,
|
|
71
143
|
requiredAttachableSentinelInstanceFunctions,
|
|
144
|
+
toSentinelConfig,
|
|
145
|
+
toSentinelIntervalAutomation,
|
|
146
|
+
toSentinelModuleEventAutomation,
|
|
147
|
+
toSentinelReportQuery,
|
|
72
148
|
withSentinelInstance,
|
|
73
149
|
withSentinelModule
|
|
74
150
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/attachable/asAttachableInstance.ts", "../../src/attachable/isAttachableInstance.ts", "../../src/typeChecks.ts", "../../src/Queries/Report.ts", "../../src/attachable/AttachableInstance.ts", "../../src/Automation.ts", "../../src/Config.ts"],
|
|
4
|
-
"sourcesContent": ["import { AsObjectFactory } from '@xylabs/sdk-js'\n\nimport { isAttachableSentinelInstance } from './isAttachableInstance.ts'\n\nexport const asAttachableSentinelInstance = AsObjectFactory.create(isAttachableSentinelInstance)\n", "import type { ObjectTypeShape, TypeCheck } from '@xylabs/sdk-js'\nimport { IsObjectFactory } from '@xylabs/sdk-js'\nimport { isAttachableModuleInstance } from '@xyo-network/module-model'\n\nimport { isSentinelInstance } from '../typeChecks.ts'\nimport type { AttachableSentinelInstance } from './AttachableInstance.ts'\n\nexport const requiredAttachableSentinelInstanceFunctions: ObjectTypeShape = {}\n\n// we do not use IsInstanceFactory here to prevent a cycle\nconst factory = new IsObjectFactory<AttachableSentinelInstance>()\n\nexport const isAttachableSentinelInstance: TypeCheck<AttachableSentinelInstance> = factory.create(requiredAttachableSentinelInstanceFunctions, [\n isSentinelInstance,\n isAttachableModuleInstance,\n])\n", "import { AsObjectFactory } from '@xylabs/sdk-js'\nimport {\n IsInstanceFactory, isModuleInstance, IsQueryableModuleFactory, WithFactory,\n} from '@xyo-network/module-model'\n\nimport type { SentinelInstance } from './Instance.ts'\nimport type { SentinelModule } from './Module.ts'\nimport { SentinelReportQuerySchema } from './Queries/index.ts'\n\nexport const isSentinelInstance = new IsInstanceFactory<SentinelInstance>().create({ report: 'function' }, [isModuleInstance])\nexport const isSentinelModule = new IsQueryableModuleFactory<SentinelModule>().create([SentinelReportQuerySchema])\n\nexport const asSentinelModule = AsObjectFactory.create(isSentinelModule)\nexport const asSentinelInstance = AsObjectFactory.create(isSentinelInstance)\n\n/** @deprecated use narrowing instead [ if(is) ] */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport const withSentinelModule = WithFactory.create(isSentinelModule)\n/** @deprecated use narrowing instead [ if(is) ] */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport const withSentinelInstance = WithFactory.create(isSentinelInstance)\n", "import { asSchema, type Query } from '@xyo-network/sdk-protocol-js'\n\nexport const SentinelReportQuerySchema = asSchema('network.xyo.query.sentinel.report', true)\nexport type SentinelReportQuerySchema = typeof SentinelReportQuerySchema\n\nexport type SentinelReportQuery = Query<{\n schema: SentinelReportQuerySchema\n}>\n", "import type { TypeCheck } from '@xylabs/sdk-js'\nimport { IsObjectFactory } from '@xylabs/sdk-js'\nimport type { AttachableModuleInstance } from '@xyo-network/module-model'\n\nimport type { SentinelModuleEventData } from '../EventData.ts'\nimport type { SentinelInstance } from '../Instance.ts'\nimport type { SentinelModule } from '../Module.ts'\nimport type { SentinelParams } from '../Params.ts'\n\nexport interface AttachableSentinelInstance<\n TParams extends SentinelParams = SentinelParams,\n TEventData extends SentinelModuleEventData = SentinelModuleEventData,\n> extends SentinelModule<TParams, TEventData>,\n AttachableModuleInstance<TParams, TEventData>,\n SentinelInstance<TParams, TEventData> {}\n\nexport type AttachableSentinelInstanceTypeCheck<T extends AttachableSentinelInstance = AttachableSentinelInstance> = TypeCheck<T>\n\nexport class IsAttachableSentinelInstanceFactory<T extends AttachableSentinelInstance = AttachableSentinelInstance> extends IsObjectFactory<T> {}\n", "import type { EventName } from '@xylabs/sdk-js'\nimport type { ModuleIdentifier } from '@xyo-network/module-model'\nimport type { Payload } from '@xyo-network/sdk-protocol-js'\nimport { asSchema, isPayloadOfSchemaType } from '@xyo-network/sdk-protocol-js'\n\nexport const SentinelAutomationSchema = asSchema('network.xyo.automation', true)\nexport type SentinelAutomationSchema = typeof SentinelAutomationSchema\n\nexport const SentinelIntervalAutomationSchema = asSchema('network.xyo.automation.interval', true)\nexport type SentinelIntervalAutomationSchema = typeof SentinelIntervalAutomationSchema\n\nexport const SentinelModuleEventAutomationSchema = asSchema('network.xyo.automation.event.module', true)\nexport type SentinelModuleEventAutomationSchema = typeof SentinelModuleEventAutomationSchema\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' | 'millis'\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 Module Event Automation */\nexport type SentinelModuleEventAutomationPayload = SentinelBaseAutomationPayload<{\n eventName: EventName\n schema: SentinelModuleEventAutomationSchema\n source: ModuleIdentifier\n type: 'event'\n}>\n\n/** Settings for an Automation */\nexport type SentinelAutomationPayload = Payload<\n SentinelIntervalAutomationPayload | SentinelModuleEventAutomationPayload,\n SentinelAutomationSchema | SentinelIntervalAutomationSchema | SentinelModuleEventAutomationSchema\n>\n", "import type { WithAdditional } from '@xylabs/sdk-js'\nimport type { ModuleConfig } from '@xyo-network/module-model'\nimport {\n asSchema, type Payload, type Schema,\n} from '@xyo-network/sdk-protocol-js'\n\nimport type { SentinelAutomationPayload } from './Automation.ts'\nimport type { Task } from './Task.ts'\n\nexport const SentinelConfigSchema = asSchema('network.xyo.sentinel.config', true)\nexport type SentinelConfigSchema = typeof SentinelConfigSchema\n\nexport type SentinelConfig<TConfig extends Payload | void = void, TSchema extends Schema | 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"],
|
|
5
|
-
"mappings": ";AAAA,SAAS,mBAAAA,wBAAuB;;;ACChC,SAAS,uBAAuB;AAChC,SAAS,kCAAkC;;;ACF3C,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EAAmB;AAAA,EAAkB;AAAA,EAA0B;AAAA,OAC1D;;;ACHP,
|
|
6
|
-
"names": ["AsObjectFactory", "AsObjectFactory", "IsObjectFactory", "asSchema", "asSchema"]
|
|
4
|
+
"sourcesContent": ["import { AsObjectFactory } from '@xylabs/sdk-js'\n\nimport { isAttachableSentinelInstance } from './isAttachableInstance.ts'\n\nexport const asAttachableSentinelInstance = AsObjectFactory.create(isAttachableSentinelInstance)\n", "import type { ObjectTypeShape, TypeCheck } from '@xylabs/sdk-js'\nimport { IsObjectFactory } from '@xylabs/sdk-js'\nimport { isAttachableModuleInstance } from '@xyo-network/module-model'\n\nimport { isSentinelInstance } from '../typeChecks.ts'\nimport type { AttachableSentinelInstance } from './AttachableInstance.ts'\n\nexport const requiredAttachableSentinelInstanceFunctions: ObjectTypeShape = {}\n\n// we do not use IsInstanceFactory here to prevent a cycle\nconst factory = new IsObjectFactory<AttachableSentinelInstance>()\n\nexport const isAttachableSentinelInstance: TypeCheck<AttachableSentinelInstance> = factory.create(requiredAttachableSentinelInstanceFunctions, [\n isSentinelInstance,\n isAttachableModuleInstance,\n])\n", "import { AsObjectFactory } from '@xylabs/sdk-js'\nimport {\n IsInstanceFactory, isModuleInstance, IsQueryableModuleFactory, WithFactory,\n} from '@xyo-network/module-model'\n\nimport type { SentinelInstance } from './Instance.ts'\nimport type { SentinelModule } from './Module.ts'\nimport { SentinelReportQuerySchema } from './Queries/index.ts'\n\nexport const isSentinelInstance = new IsInstanceFactory<SentinelInstance>().create({ report: 'function' }, [isModuleInstance])\nexport const isSentinelModule = new IsQueryableModuleFactory<SentinelModule>().create([SentinelReportQuerySchema])\n\nexport const asSentinelModule = AsObjectFactory.create(isSentinelModule)\nexport const asSentinelInstance = AsObjectFactory.create(isSentinelInstance)\n\n/** @deprecated use narrowing instead [ if(is) ] */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport const withSentinelModule = WithFactory.create(isSentinelModule)\n/** @deprecated use narrowing instead [ if(is) ] */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport const withSentinelInstance = WithFactory.create(isSentinelInstance)\n", "import {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport {\n asSchema, PayloadZodOfSchema, QueryFieldsZod,\n} from '@xyo-network/sdk-protocol-js'\nimport * as z from 'zod/mini'\n\nexport const SentinelReportQuerySchema: 'network.xyo.query.sentinel.report' & {\n readonly __schema: true\n} = asSchema('network.xyo.query.sentinel.report', true)\nexport type SentinelReportQuerySchema = typeof SentinelReportQuerySchema\n\nexport const SentinelReportQueryZod: z.ZodMiniObject<\n & { schema: z.ZodMiniLiteral<SentinelReportQuerySchema> }\n & (typeof QueryFieldsZod)['shape'],\n z.core.$strip\n> = z.extend(PayloadZodOfSchema(SentinelReportQuerySchema), { ...QueryFieldsZod.shape })\n\nexport type SentinelReportQuery = z.infer<typeof SentinelReportQueryZod>\n\nexport const isSentinelReportQuery: ReturnType<typeof zodIsFactory<SentinelReportQuery>> = zodIsFactory(SentinelReportQueryZod)\nexport const asSentinelReportQuery: ReturnType<typeof zodAsFactory<SentinelReportQuery>> = zodAsFactory(SentinelReportQueryZod, 'asSentinelReportQuery')\nexport const toSentinelReportQuery: ReturnType<typeof zodToFactory<SentinelReportQuery>> = zodToFactory(SentinelReportQueryZod, 'toSentinelReportQuery')\n", "import type { TypeCheck } from '@xylabs/sdk-js'\nimport { IsObjectFactory } from '@xylabs/sdk-js'\nimport type { AttachableModuleInstance } from '@xyo-network/module-model'\n\nimport type { SentinelModuleEventData } from '../EventData.ts'\nimport type { SentinelInstance } from '../Instance.ts'\nimport type { SentinelModule } from '../Module.ts'\nimport type { SentinelParams } from '../Params.ts'\n\nexport interface AttachableSentinelInstance<\n TParams extends SentinelParams = SentinelParams,\n TEventData extends SentinelModuleEventData = SentinelModuleEventData,\n> extends SentinelModule<TParams, TEventData>,\n AttachableModuleInstance<TParams, TEventData>,\n SentinelInstance<TParams, TEventData> {}\n\nexport type AttachableSentinelInstanceTypeCheck<T extends AttachableSentinelInstance = AttachableSentinelInstance> = TypeCheck<T>\n\nexport class IsAttachableSentinelInstanceFactory<T extends AttachableSentinelInstance = AttachableSentinelInstance> extends IsObjectFactory<T> {}\n", "import type { EventName } from '@xylabs/sdk-js'\nimport {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport type { ModuleIdentifier } from '@xyo-network/module-model'\nimport type { Payload } from '@xyo-network/sdk-protocol-js'\nimport { asSchema, PayloadZodOfSchema } from '@xyo-network/sdk-protocol-js'\nimport * as z from 'zod/mini'\n\nexport const SentinelAutomationSchema: 'network.xyo.automation' & {\n readonly __schema: true\n} = asSchema('network.xyo.automation', true)\nexport type SentinelAutomationSchema = typeof SentinelAutomationSchema\n\nexport const SentinelIntervalAutomationSchema: 'network.xyo.automation.interval' & {\n readonly __schema: true\n} = asSchema('network.xyo.automation.interval', true)\nexport type SentinelIntervalAutomationSchema = typeof SentinelIntervalAutomationSchema\n\nexport const SentinelModuleEventAutomationSchema: 'network.xyo.automation.event.module' & {\n readonly __schema: true\n} = asSchema('network.xyo.automation.event.module', true)\nexport type SentinelModuleEventAutomationSchema = typeof SentinelModuleEventAutomationSchema\n\nexport type SentinelBaseAutomationPayload<T extends Payload> = Payload<\n {\n type?: 'interval' | 'event'\n } & T\n>\n\n/** Settings for an Interval Automation */\nexport const SentinelIntervalAutomationZod: z.ZodMiniObject<{\n end: z.ZodMiniOptional<z.ZodMiniNumber<number>>\n frequency: z.ZodMiniOptional<z.ZodMiniNumber<number>>\n frequencyUnits: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniLiteral<'second'>, z.ZodMiniLiteral<'minute'>, z.ZodMiniLiteral<'hour'>, z.ZodMiniLiteral<'day'>, z.ZodMiniLiteral<'millis'>]>>\n remaining: z.ZodMiniOptional<z.ZodMiniNumber<number>>\n schema: z.ZodMiniLiteral<SentinelIntervalAutomationSchema>\n start: z.ZodMiniOptional<z.ZodMiniNumber<number>>\n type: z.ZodMiniLiteral<'interval'>\n}, z.core.$strip> = z.extend(PayloadZodOfSchema(SentinelIntervalAutomationSchema), {\n /** Epoch after which any reoccurrence stops */\n end: z.optional(z.number()),\n /** Time between triggers [non-repeating if undefined] */\n frequency: z.optional(z.number()),\n /** Units for frequency field [hour if undefined] */\n frequencyUnits: z.optional(z.union([z.literal('second'), z.literal('minute'), z.literal('hour'), z.literal('day'), z.literal('millis')])),\n /** Remaining triggers [infinite if undefined] */\n remaining: z.optional(z.number()),\n /** Epoch of the next trigger */\n start: z.optional(z.number()),\n /** The type of automation */\n type: z.literal('interval'),\n})\n\nexport type SentinelIntervalAutomationPayload = z.infer<typeof SentinelIntervalAutomationZod>\n\nexport const isSentinelIntervalAutomation: ReturnType<typeof zodIsFactory<SentinelIntervalAutomationPayload>> = zodIsFactory(SentinelIntervalAutomationZod)\nexport const asSentinelIntervalAutomation: ReturnType<typeof zodAsFactory<SentinelIntervalAutomationPayload>> = zodAsFactory(SentinelIntervalAutomationZod, 'asSentinelIntervalAutomation')\nexport const toSentinelIntervalAutomation: ReturnType<typeof zodToFactory<SentinelIntervalAutomationPayload>> = zodToFactory(SentinelIntervalAutomationZod, 'toSentinelIntervalAutomation')\n\n/** Settings for an Module Event Automation */\nexport const SentinelModuleEventAutomationZod: z.ZodMiniObject<{\n eventName: z.ZodMiniCustom<EventName, EventName>\n schema: z.ZodMiniLiteral<SentinelModuleEventAutomationSchema>\n source: z.ZodMiniCustom<ModuleIdentifier, ModuleIdentifier>\n type: z.ZodMiniLiteral<'event'>\n}, z.core.$strip> = z.extend(PayloadZodOfSchema(SentinelModuleEventAutomationSchema), {\n eventName: z.custom<EventName>(),\n source: z.custom<ModuleIdentifier>(),\n type: z.literal('event'),\n})\n\nexport type SentinelModuleEventAutomationPayload = z.infer<typeof SentinelModuleEventAutomationZod>\n\nexport const isSentinelModuleEventAutomation: ReturnType<typeof zodIsFactory<SentinelModuleEventAutomationPayload>> = zodIsFactory(SentinelModuleEventAutomationZod)\nexport const asSentinelModuleEventAutomation: ReturnType<typeof zodAsFactory<SentinelModuleEventAutomationPayload>> = zodAsFactory(SentinelModuleEventAutomationZod, 'asSentinelModuleEventAutomation')\nexport const toSentinelModuleEventAutomation: ReturnType<typeof zodToFactory<SentinelModuleEventAutomationPayload>> = zodToFactory(SentinelModuleEventAutomationZod, 'toSentinelModuleEventAutomation')\n\n/** Settings for an Automation */\nexport type SentinelAutomationPayload = Payload<\n SentinelIntervalAutomationPayload | SentinelModuleEventAutomationPayload,\n SentinelAutomationSchema | SentinelIntervalAutomationSchema | SentinelModuleEventAutomationSchema\n>\n", "import type { WithAdditional } from '@xylabs/sdk-js'\nimport {\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport type { ModuleConfig } from '@xyo-network/module-model'\nimport { ModuleConfigZod } from '@xyo-network/module-model'\nimport {\n asSchema, type Payload, type Schema,\n} from '@xyo-network/sdk-protocol-js'\nimport * as z from 'zod/mini'\n\nimport type { SentinelAutomationPayload } from './Automation.ts'\nimport type { Task } from './Task.ts'\n\nexport const SentinelConfigSchema: 'network.xyo.sentinel.config' & {\n readonly __schema: true\n} = asSchema('network.xyo.sentinel.config', true)\nexport type SentinelConfigSchema = typeof SentinelConfigSchema\n\nexport const SentinelConfigZod: z.ZodMiniObject<\n & Omit<(typeof ModuleConfigZod)['shape'], 'schema'>\n & { schema: z.ZodMiniLiteral<SentinelConfigSchema> }\n & {\n automations: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniCustom<SentinelAutomationPayload, SentinelAutomationPayload>>>\n synchronous: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>\n tasks: z.ZodMiniArray<z.ZodMiniCustom<Task, Task>>\n throwErrors: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>\n },\n z.core.$strip\n> = z.extend(ModuleConfigZod, {\n schema: z.literal(SentinelConfigSchema),\n automations: z.optional(z.array(z.custom<SentinelAutomationPayload>())),\n synchronous: z.optional(z.boolean()),\n tasks: z.array(z.custom<Task>()),\n throwErrors: z.optional(z.boolean()),\n})\n\nexport type SentinelConfigBase = z.infer<typeof SentinelConfigZod>\n\nexport const isSentinelConfig: ReturnType<typeof zodIsFactory<SentinelConfigBase>> = zodIsFactory(SentinelConfigZod)\nexport const asSentinelConfig: ReturnType<typeof zodAsFactory<SentinelConfigBase>> = zodAsFactory(SentinelConfigZod, 'asSentinelConfig')\nexport const toSentinelConfig: ReturnType<typeof zodToFactory<SentinelConfigBase>> = zodToFactory(SentinelConfigZod, 'toSentinelConfig')\n\nexport type SentinelConfig<TConfig extends Payload | void = void, TSchema extends Schema | 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"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,mBAAAA,wBAAuB;;;ACChC,SAAS,uBAAuB;AAChC,SAAS,kCAAkC;;;ACF3C,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EAAmB;AAAA,EAAkB;AAAA,EAA0B;AAAA,OAC1D;;;ACHP;AAAA,EACE;AAAA,EAAc;AAAA,EAAc;AAAA,OACvB;AACP;AAAA,EACE;AAAA,EAAU;AAAA,EAAoB;AAAA,OACzB;AACP,YAAY,OAAO;AAEZ,IAAM,4BAET,SAAS,qCAAqC,IAAI;AAG/C,IAAM,yBAIP,SAAO,mBAAmB,yBAAyB,GAAG,EAAE,GAAG,eAAe,MAAM,CAAC;AAIhF,IAAM,wBAA8E,aAAa,sBAAsB;AACvH,IAAM,wBAA8E,aAAa,wBAAwB,uBAAuB;AAChJ,IAAM,wBAA8E,aAAa,wBAAwB,uBAAuB;;;ADdhJ,IAAM,qBAAqB,IAAI,kBAAoC,EAAE,OAAO,EAAE,QAAQ,WAAW,GAAG,CAAC,gBAAgB,CAAC;AACtH,IAAM,mBAAmB,IAAI,yBAAyC,EAAE,OAAO,CAAC,yBAAyB,CAAC;AAE1G,IAAM,mBAAmB,gBAAgB,OAAO,gBAAgB;AAChE,IAAM,qBAAqB,gBAAgB,OAAO,kBAAkB;AAIpE,IAAM,qBAAqB,YAAY,OAAO,gBAAgB;AAG9D,IAAM,uBAAuB,YAAY,OAAO,kBAAkB;;;ADblE,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AAIM,IAAM,kCAAyGH,cAAa,gCAAgC;AAC5J,IAAM,kCAAyGD,cAAa,kCAAkC,iCAAiC;AAC/L,IAAM,kCAAyGE,cAAa,kCAAkC,iCAAiC;;;AC3EtM;AAAA,EACE,gBAAAI;AAAA,EAAc,gBAAAC;AAAA,EAAc,gBAAAC;AAAA,OACvB;AAEP,SAAS,uBAAuB;AAChC;AAAA,EACE,YAAAC;AAAA,OACK;AACP,YAAYC,QAAO;AAKZ,IAAM,uBAETD,UAAS,+BAA+B,IAAI;AAGzC,IAAM,oBAUP,UAAO,iBAAiB;AAAA,EAC5B,QAAU,WAAQ,oBAAoB;AAAA,EACtC,aAAe,YAAW,SAAQ,UAAkC,CAAC,CAAC;AAAA,EACtE,aAAe,YAAW,WAAQ,CAAC;AAAA,EACnC,OAAS,SAAQ,UAAa,CAAC;AAAA,EAC/B,aAAe,YAAW,WAAQ,CAAC;AACrC,CAAC;AAIM,IAAM,mBAAwEF,cAAa,iBAAiB;AAC5G,IAAM,mBAAwED,cAAa,mBAAmB,kBAAkB;AAChI,IAAM,mBAAwEE,cAAa,mBAAmB,kBAAkB;",
|
|
6
|
+
"names": ["AsObjectFactory", "AsObjectFactory", "IsObjectFactory", "zodAsFactory", "zodIsFactory", "zodToFactory", "asSchema", "PayloadZodOfSchema", "z", "zodAsFactory", "zodIsFactory", "zodToFactory", "asSchema", "z"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/sentinel-model",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -34,29 +34,29 @@
|
|
|
34
34
|
"README.md"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@xyo-network/
|
|
38
|
-
"@xyo-network/
|
|
39
|
-
"@xyo-network/
|
|
40
|
-
"@xyo-network/
|
|
37
|
+
"@xyo-network/archivist-model": "~7.0.0",
|
|
38
|
+
"@xyo-network/diviner-model": "~7.0.0",
|
|
39
|
+
"@xyo-network/witness-model": "~7.0.0",
|
|
40
|
+
"@xyo-network/module-model": "~7.0.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@bitauth/libauth": "~3.0.0",
|
|
44
44
|
"@metamask/providers": "^22.1.1",
|
|
45
45
|
"@noble/post-quantum": "~0.6.1",
|
|
46
46
|
"@opentelemetry/api": "^1.9.1",
|
|
47
|
-
"@opentelemetry/sdk-trace-base": "^2.
|
|
47
|
+
"@opentelemetry/sdk-trace-base": "^2.8.0",
|
|
48
48
|
"@scure/base": "~2.2.0",
|
|
49
49
|
"@scure/bip39": "~2.2.0",
|
|
50
|
-
"@xylabs/geo": "^6.1.
|
|
51
|
-
"@xylabs/sdk-js": "^6.1.
|
|
52
|
-
"@xylabs/threads": "^6.1.
|
|
50
|
+
"@xylabs/geo": "^6.1.1",
|
|
51
|
+
"@xylabs/sdk-js": "^6.1.1",
|
|
52
|
+
"@xylabs/threads": "^6.1.1",
|
|
53
53
|
"@xylabs/toolchain": "^8.1.20",
|
|
54
54
|
"@xylabs/tsconfig": "^8.1.20",
|
|
55
|
-
"@xyo-network/sdk-protocol-js": "
|
|
55
|
+
"@xyo-network/sdk-protocol-js": "~7.0",
|
|
56
56
|
"ajv": "^8.20.0",
|
|
57
57
|
"async-mutex": "^0.5.0",
|
|
58
58
|
"debug": "~4.4.3",
|
|
59
|
-
"eslint": "^10.
|
|
59
|
+
"eslint": "^10.5.0",
|
|
60
60
|
"ethers": "^6.16.0",
|
|
61
61
|
"hash-wasm": "~4.12.0",
|
|
62
62
|
"idb": "^8.0.3",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"@xylabs/geo": "^6.0",
|
|
77
77
|
"@xylabs/sdk-js": "^6.0",
|
|
78
78
|
"@xylabs/threads": "^6.0",
|
|
79
|
-
"@xyo-network/sdk-protocol-js": "^
|
|
79
|
+
"@xyo-network/sdk-protocol-js": "^7.0",
|
|
80
80
|
"ajv": "^8.20",
|
|
81
81
|
"async-mutex": "^0.5",
|
|
82
82
|
"debug": "~4.4",
|