@xyo-network/sentinel-memory 3.9.17 → 3.9.19

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.
@@ -0,0 +1,17 @@
1
+ import type { AnyConfigSchema } from '@xyo-network/module-model';
2
+ import type { Payload, Schema } from '@xyo-network/payload-model';
3
+ import { AbstractSentinel } from '@xyo-network/sentinel-abstract';
4
+ import type { SentinelConfig, SentinelInstance, SentinelModuleEventData, SentinelParams } from '@xyo-network/sentinel-model';
5
+ export type MemorySentinelParams<TConfig extends AnyConfigSchema<SentinelConfig> = AnyConfigSchema<SentinelConfig>> = SentinelParams<TConfig>;
6
+ export declare class MemorySentinel<TParams extends MemorySentinelParams = MemorySentinelParams, TEventData extends SentinelModuleEventData<SentinelInstance<TParams>> = SentinelModuleEventData<SentinelInstance<TParams>>> extends AbstractSentinel<TParams, TEventData> {
7
+ static readonly configSchemas: Schema[];
8
+ static readonly defaultConfigSchema: Schema;
9
+ private runner?;
10
+ reportHandler(inPayloads?: Payload[]): Promise<Payload[]>;
11
+ start(timeout?: number | undefined): Promise<boolean>;
12
+ stop(timeout?: number | undefined): Promise<boolean>;
13
+ private inputAddresses;
14
+ private processPreviousResults;
15
+ private runJob;
16
+ }
17
+ //# sourceMappingURL=MemorySentinel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MemorySentinel.d.ts","sourceRoot":"","sources":["../../src/MemorySentinel.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAoB,MAAM,2BAA2B,CAAA;AAClF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACjE,OAAO,KAAK,EAEV,cAAc,EACd,gBAAgB,EAChB,uBAAuB,EACvB,cAAc,EACf,MAAM,6BAA6B,CAAA;AASpC,MAAM,MAAM,oBAAoB,CAAC,OAAO,SAAS,eAAe,CAAC,cAAc,CAAC,GAAG,eAAe,CAAC,cAAc,CAAC,IAAI,cAAc,CAAC,OAAO,CAAC,CAAA;AAE7I,qBAAa,cAAc,CACzB,OAAO,SAAS,oBAAoB,GAAG,oBAAoB,EAC3D,UAAU,SAAS,uBAAuB,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,GAAG,uBAAuB,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAC1H,SAAQ,gBAAgB,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7C,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAAiD;IACjG,gBAAyB,mBAAmB,EAAE,MAAM,CAAuB;IAE3E,OAAO,CAAC,MAAM,CAAC,CAAgB;IAEzB,aAAa,CAAC,UAAU,GAAE,OAAO,EAAO,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAiBpD,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC;IAWrD,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC;YAQrD,cAAc;IAS5B,OAAO,CAAC,sBAAsB;YAIhB,MAAM;CA2ErB"}
@@ -0,0 +1,21 @@
1
+ import { PayloadWrapper } from '@xyo-network/payload-wrapper';
2
+ import type { SentinelIntervalAutomationPayload } from '@xyo-network/sentinel-model';
3
+ export declare class SentinelIntervalAutomationWrapper<T extends SentinelIntervalAutomationPayload = SentinelIntervalAutomationPayload> extends PayloadWrapper<T> {
4
+ constructor(payload: T);
5
+ protected get frequencyMillis(): number;
6
+ protected get remaining(): number;
7
+ next(): this;
8
+ protected checkEnd(): void;
9
+ protected consumeRemaining(count?: number): void;
10
+ /**
11
+ * Sets the remaining of the wrapped automation
12
+ * @param remaining The remaining time in milliseconds
13
+ */
14
+ protected setRemaining(remaining: number): void;
15
+ /**
16
+ * Sets the start of the wrapped automation
17
+ * @param start The start time in milliseconds
18
+ */
19
+ protected setStart(start: number): void;
20
+ }
21
+ //# sourceMappingURL=SentinelIntervalAutomationWrapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SentinelIntervalAutomationWrapper.d.ts","sourceRoot":"","sources":["../../src/SentinelIntervalAutomationWrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,6BAA6B,CAAA;AAEpF,qBAAa,iCAAiC,CAC5C,CAAC,SAAS,iCAAiC,GAAG,iCAAiC,CAC/E,SAAQ,cAAc,CAAC,CAAC,CAAC;gBACb,OAAO,EAAE,CAAC;IAItB,SAAS,KAAK,eAAe,WAwB5B;IAED,SAAS,KAAK,SAAS,WAEtB;IAED,IAAI;IAWJ,SAAS,CAAC,QAAQ;IAMlB,SAAS,CAAC,gBAAgB,CAAC,KAAK,SAAI;IAMpC;;;OAGG;IACH,SAAS,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM;IAIxC;;;OAGG;IACH,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM;CAGjC"}
@@ -0,0 +1,22 @@
1
+ import type { Payload } from '@xyo-network/payload-model';
2
+ import type { SentinelAutomationPayload, SentinelInstance } from '@xyo-network/sentinel-model';
3
+ export type OnSentinelRunnerTriggerResult = (result: Payload[]) => void;
4
+ export declare class SentinelRunner {
5
+ protected _automations: Record<string, SentinelAutomationPayload>;
6
+ protected onTriggerResult: OnSentinelRunnerTriggerResult | undefined;
7
+ protected sentinel: SentinelInstance;
8
+ protected timeoutId?: NodeJS.Timeout | string | number;
9
+ constructor(sentinel: SentinelInstance, automations?: SentinelAutomationPayload[], onTriggerResult?: OnSentinelRunnerTriggerResult);
10
+ get automations(): Record<string, SentinelAutomationPayload>;
11
+ private get next();
12
+ add(automation: SentinelAutomationPayload, restart?: boolean): Promise<Lowercase<string>>;
13
+ find(hash: string): [string, SentinelAutomationPayload] | undefined;
14
+ remove(hash: string, restart?: boolean): void;
15
+ removeAll(): void;
16
+ restart(): void;
17
+ start(): void;
18
+ stop(): void;
19
+ update(hash: string, automation: SentinelAutomationPayload, restart?: boolean): Promise<void>;
20
+ private trigger;
21
+ }
22
+ //# sourceMappingURL=SentinelRunner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SentinelRunner.d.ts","sourceRoot":"","sources":["../../src/SentinelRunner.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,KAAK,EACV,yBAAyB,EACzB,gBAAgB,EAEjB,MAAM,6BAA6B,CAAA;AAKpC,MAAM,MAAM,6BAA6B,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,IAAI,CAAA;AAEvE,qBAAa,cAAc;IACzB,SAAS,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAK;IACtE,SAAS,CAAC,eAAe,EAAE,6BAA6B,GAAG,SAAS,CAAA;IACpE,SAAS,CAAC,QAAQ,EAAE,gBAAgB,CAAA;IACpC,SAAS,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;gBAE1C,QAAQ,EAAE,gBAAgB,EAAE,WAAW,CAAC,EAAE,yBAAyB,EAAE,EAAE,eAAe,CAAC,EAAE,6BAA6B;IAOlI,IAAI,WAAW,8CAEd;IAED,OAAO,KAAK,IAAI,GASf;IAEK,GAAG,CAAC,UAAU,EAAE,yBAAyB,EAAE,OAAO,UAAO;IAO/D,IAAI,CAAC,IAAI,EAAE,MAAM;IAIjB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,UAAO;IAKnC,SAAS;IAKT,OAAO;IAKP,KAAK;IAuBL,IAAI;IAOE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,yBAAyB,EAAE,OAAO,UAAO;YAMlE,OAAO;CAStB"}
@@ -1,51 +1,4 @@
1
- import { AnyConfigSchema } from '@xyo-network/module-model';
2
- import { Schema, Payload } from '@xyo-network/payload-model';
3
- import { AbstractSentinel } from '@xyo-network/sentinel-abstract';
4
- import { SentinelConfig, SentinelParams, SentinelModuleEventData, SentinelInstance, SentinelIntervalAutomationPayload, SentinelAutomationPayload } from '@xyo-network/sentinel-model';
5
- import { PayloadWrapper } from '@xyo-network/payload-wrapper';
6
-
7
- type MemorySentinelParams<TConfig extends AnyConfigSchema<SentinelConfig> = AnyConfigSchema<SentinelConfig>> = SentinelParams<TConfig>;
8
- declare class MemorySentinel<TParams extends MemorySentinelParams = MemorySentinelParams, TEventData extends SentinelModuleEventData<SentinelInstance<TParams>> = SentinelModuleEventData<SentinelInstance<TParams>>> extends AbstractSentinel<TParams, TEventData> {
9
- static readonly configSchemas: Schema[];
10
- static readonly defaultConfigSchema: Schema;
11
- private runner?;
12
- reportHandler(inPayloads?: Payload[]): Promise<Payload[]>;
13
- start(timeout?: number | undefined): Promise<boolean>;
14
- stop(timeout?: number | undefined): Promise<boolean>;
15
- private inputAddresses;
16
- private processPreviousResults;
17
- private runJob;
18
- }
19
-
20
- declare class SentinelIntervalAutomationWrapper<T extends SentinelIntervalAutomationPayload = SentinelIntervalAutomationPayload> extends PayloadWrapper<T> {
21
- constructor(payload: T);
22
- protected get frequencyMillis(): number;
23
- protected get remaining(): number;
24
- next(): this;
25
- protected checkEnd(): void;
26
- protected consumeRemaining(count?: number): void;
27
- protected setRemaining(remaining: number): void;
28
- protected setStart(start: number): void;
29
- }
30
-
31
- type OnSentinelRunnerTriggerResult = (result: Payload[]) => void;
32
- declare class SentinelRunner {
33
- protected _automations: Record<string, SentinelAutomationPayload>;
34
- protected onTriggerResult: OnSentinelRunnerTriggerResult | undefined;
35
- protected sentinel: SentinelInstance;
36
- protected timeoutId?: NodeJS.Timeout | string | number;
37
- constructor(sentinel: SentinelInstance, automations?: SentinelAutomationPayload[], onTriggerResult?: OnSentinelRunnerTriggerResult);
38
- get automations(): Record<string, SentinelAutomationPayload>;
39
- private get next();
40
- add(automation: SentinelAutomationPayload, restart?: boolean): Promise<Lowercase<string>>;
41
- find(hash: string): [string, SentinelAutomationPayload] | undefined;
42
- remove(hash: string, restart?: boolean): void;
43
- removeAll(): void;
44
- restart(): void;
45
- start(): void;
46
- stop(): void;
47
- update(hash: string, automation: SentinelAutomationPayload, restart?: boolean): Promise<void>;
48
- private trigger;
49
- }
50
-
51
- export { MemorySentinel, type MemorySentinelParams, type OnSentinelRunnerTriggerResult, SentinelIntervalAutomationWrapper, SentinelRunner };
1
+ export * from './MemorySentinel.ts';
2
+ export * from './SentinelIntervalAutomationWrapper.ts';
3
+ export * from './SentinelRunner.ts';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,wCAAwC,CAAA;AACtD,cAAc,qBAAqB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/sentinel-memory",
3
- "version": "3.9.17",
3
+ "version": "3.9.19",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -33,27 +33,27 @@
33
33
  "@xylabs/forget": "^4.5.1",
34
34
  "@xylabs/hex": "^4.5.1",
35
35
  "@xylabs/promise": "^4.5.1",
36
- "@xyo-network/diviner-model": "^3.9.17",
37
- "@xyo-network/module-model": "^3.9.17",
38
- "@xyo-network/payload-builder": "^3.9.17",
39
- "@xyo-network/payload-model": "^3.9.17",
40
- "@xyo-network/payload-wrapper": "^3.9.17",
41
- "@xyo-network/sentinel-abstract": "^3.9.17",
42
- "@xyo-network/sentinel-model": "^3.9.17",
43
- "@xyo-network/witness-model": "^3.9.17"
36
+ "@xyo-network/diviner-model": "^3.9.19",
37
+ "@xyo-network/module-model": "^3.9.19",
38
+ "@xyo-network/payload-builder": "^3.9.19",
39
+ "@xyo-network/payload-model": "^3.9.19",
40
+ "@xyo-network/payload-wrapper": "^3.9.19",
41
+ "@xyo-network/sentinel-abstract": "^3.9.19",
42
+ "@xyo-network/sentinel-model": "^3.9.19",
43
+ "@xyo-network/witness-model": "^3.9.19"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@xylabs/delay": "^4.5.1",
47
- "@xylabs/ts-scripts-yarn3": "^5.0.24",
48
- "@xylabs/tsconfig": "^5.0.24",
47
+ "@xylabs/ts-scripts-yarn3": "^5.0.39",
48
+ "@xylabs/tsconfig": "^5.0.39",
49
49
  "@xylabs/vitest-extended": "^4.5.1",
50
- "@xyo-network/abstract-witness": "^3.9.17",
51
- "@xyo-network/archivist-memory": "^3.9.17",
52
- "@xyo-network/id-payload-plugin": "^3.9.17",
53
- "@xyo-network/node-memory": "^3.9.17",
54
- "@xyo-network/witness-adhoc": "^3.9.17",
55
- "typescript": "^5.7.3",
56
- "vitest": "^3.0.6"
50
+ "@xyo-network/abstract-witness": "^3.9.19",
51
+ "@xyo-network/archivist-memory": "^3.9.19",
52
+ "@xyo-network/id-payload-plugin": "^3.9.19",
53
+ "@xyo-network/node-memory": "^3.9.19",
54
+ "@xyo-network/witness-adhoc": "^3.9.19",
55
+ "typescript": "^5.8.2",
56
+ "vitest": "^3.0.7"
57
57
  },
58
58
  "publishConfig": {
59
59
  "access": "public"