@xyo-network/diviner-model 4.0.3 → 4.1.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/types → build/neutral}/typeChecks.d.ts +3 -2
- package/build/neutral/typeChecks.d.ts.map +1 -0
- package/dist/neutral/index.d.ts +108 -0
- package/dist/neutral/index.mjs.map +1 -1
- package/package.json +13 -13
- package/src/typeChecks.ts +3 -2
- package/dist/types/typeChecks.d.ts.map +0 -1
- /package/{dist/types → build/neutral}/Config.d.ts +0 -0
- /package/{dist/types → build/neutral}/Config.d.ts.map +0 -0
- /package/{dist/types → build/neutral}/DivinerQueryFunctions.d.ts +0 -0
- /package/{dist/types → build/neutral}/DivinerQueryFunctions.d.ts.map +0 -0
- /package/{dist/types → build/neutral}/EventData.d.ts +0 -0
- /package/{dist/types → build/neutral}/EventData.d.ts.map +0 -0
- /package/{dist/types → build/neutral}/EventsModels/DivineEnd.d.ts +0 -0
- /package/{dist/types → build/neutral}/EventsModels/DivineEnd.d.ts.map +0 -0
- /package/{dist/types → build/neutral}/EventsModels/DivineStart.d.ts +0 -0
- /package/{dist/types → build/neutral}/EventsModels/DivineStart.d.ts.map +0 -0
- /package/{dist/types → build/neutral}/EventsModels/index.d.ts +0 -0
- /package/{dist/types → build/neutral}/EventsModels/index.d.ts.map +0 -0
- /package/{dist/types → build/neutral}/Instance.d.ts +0 -0
- /package/{dist/types → build/neutral}/Instance.d.ts.map +0 -0
- /package/{dist/types → build/neutral}/Module.d.ts +0 -0
- /package/{dist/types → build/neutral}/Module.d.ts.map +0 -0
- /package/{dist/types → build/neutral}/Params.d.ts +0 -0
- /package/{dist/types → build/neutral}/Params.d.ts.map +0 -0
- /package/{dist/types → build/neutral}/Payload.d.ts +0 -0
- /package/{dist/types → build/neutral}/Payload.d.ts.map +0 -0
- /package/{dist/types → build/neutral}/Queries/Divine.d.ts +0 -0
- /package/{dist/types → build/neutral}/Queries/Divine.d.ts.map +0 -0
- /package/{dist/types → build/neutral}/Queries/index.d.ts +0 -0
- /package/{dist/types → build/neutral}/Queries/index.d.ts.map +0 -0
- /package/{dist/types → build/neutral}/SearchableStorage.d.ts +0 -0
- /package/{dist/types → build/neutral}/SearchableStorage.d.ts.map +0 -0
- /package/{dist/types → build/neutral}/attachable/AttachableInstance.d.ts +0 -0
- /package/{dist/types → build/neutral}/attachable/AttachableInstance.d.ts.map +0 -0
- /package/{dist/types → build/neutral}/attachable/asAttachableInstance.d.ts +0 -0
- /package/{dist/types → build/neutral}/attachable/asAttachableInstance.d.ts.map +0 -0
- /package/{dist/types → build/neutral}/attachable/index.d.ts +0 -0
- /package/{dist/types → build/neutral}/attachable/index.d.ts.map +0 -0
- /package/{dist/types → build/neutral}/attachable/isAttachableInstance.d.ts +0 -0
- /package/{dist/types → build/neutral}/attachable/isAttachableInstance.d.ts.map +0 -0
- /package/{dist/types → build/neutral}/index.d.ts +0 -0
- /package/{dist/types → build/neutral}/index.d.ts.map +0 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { TypeCheck } from '@xylabs/object';
|
|
1
2
|
import type { DivinerInstance } from './Instance.ts';
|
|
2
3
|
import type { DivinerModule } from './Module.ts';
|
|
3
|
-
export declare const isDivinerInstance:
|
|
4
|
-
export declare const isDivinerModule:
|
|
4
|
+
export declare const isDivinerInstance: TypeCheck<DivinerInstance>;
|
|
5
|
+
export declare const isDivinerModule: TypeCheck<DivinerModule>;
|
|
5
6
|
export declare const asDivinerModule: import("@xylabs/object").AsTypeFunction<DivinerModule<import("./Params.ts").DivinerParams<import("@xyo-network/module-model").AnyConfigSchema<import("./Config.ts").DivinerConfig>>, import("./EventData.ts").DivinerModuleEventData>>;
|
|
6
7
|
export declare const asDivinerInstance: import("@xylabs/object").AsTypeFunction<DivinerInstance<import("./Params.ts").DivinerParams<import("@xyo-network/module-model").AnyConfigSchema<import("./Config.ts").DivinerConfig>>, import("@xyo-network/payload-model").Payload, import("@xyo-network/payload-model").Payload, import("./EventData.ts").DivinerModuleEventData>>;
|
|
7
8
|
export declare const withDivinerModule: <R>(mod: any, closure: (mod: DivinerModule<import("./Params.ts").DivinerParams<import("@xyo-network/module-model").AnyConfigSchema<import("./Config.ts").DivinerConfig>>, import("./EventData.ts").DivinerModuleEventData>) => R) => R | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeChecks.d.ts","sourceRoot":"","sources":["../../src/typeChecks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAM/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAGhD,eAAO,MAAM,iBAAiB,EAAE,SAAS,CAAC,eAAe,CAA+F,CAAA;AACxJ,eAAO,MAAM,eAAe,EAAE,SAAS,CAAC,aAAa,CAA2E,CAAA;AAEhI,eAAO,MAAM,eAAe,wOAA0C,CAAA;AACtE,eAAO,MAAM,iBAAiB,sUAA4C,CAAA;AAC1E,eAAO,MAAM,iBAAiB,oPAAsC,CAAA;AACpE,eAAO,MAAM,mBAAmB,kVAAwC,CAAA"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import * as _xylabs_object from '@xylabs/object';
|
|
2
|
+
import { EmptyObject, WithAdditional, TypeCheck, IsObjectFactory } from '@xylabs/object';
|
|
3
|
+
import * as _xyo_network_module_model from '@xyo-network/module-model';
|
|
4
|
+
import { Module, ModuleEventArgs, ModuleInstance, ModuleEventData, ModuleQueryResult, ModuleConfig, ModuleIdentifier, AnyConfigSchema, ModuleParams, AttachableModuleInstance, ModuleQueries } from '@xyo-network/module-model';
|
|
5
|
+
import * as _xyo_network_payload_model from '@xyo-network/payload-model';
|
|
6
|
+
import { Payload, WithoutPrivateStorageMeta, Schema, WithSchema, Query } from '@xyo-network/payload-model';
|
|
7
|
+
import { EventData } from '@xylabs/events';
|
|
8
|
+
import { RetryConfig } from '@xylabs/retry';
|
|
9
|
+
import { AccountInstance } from '@xyo-network/account-model';
|
|
10
|
+
import { ObjectTypeShape } from '@xylabs/typeof';
|
|
11
|
+
import { Hash } from '@xylabs/hex';
|
|
12
|
+
|
|
13
|
+
type DivineEndEventArgs<T extends Module = Module, TIn extends Payload = Payload, TOut extends Payload = Payload> = ModuleEventArgs<T, {
|
|
14
|
+
errors: Error[];
|
|
15
|
+
inPayloads: TIn[];
|
|
16
|
+
outPayloads: TOut[];
|
|
17
|
+
}>;
|
|
18
|
+
interface DivineEndEventData<T extends Module = Module, TIn extends Payload = Payload, TOut extends Payload = Payload> extends EventData {
|
|
19
|
+
divineEnd: DivineEndEventArgs<T, TIn, TOut>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
type DivineStartEventArgs<T extends Module = Module, TIn extends Payload = Payload> = ModuleEventArgs<T, {
|
|
23
|
+
inPayloads: TIn[];
|
|
24
|
+
}>;
|
|
25
|
+
interface DivineStartEventData<T extends Module = Module, TIn extends Payload = Payload> extends EventData {
|
|
26
|
+
divineStart: DivineStartEventArgs<T, TIn>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
type DivinerModuleEventData<TInstance extends ModuleInstance = ModuleInstance, TIn extends Payload = Payload, TOut extends Payload = Payload> = DivineEndEventData<TInstance, TIn, TOut> & DivineStartEventData<TInstance, TIn> & ModuleEventData<TInstance>;
|
|
30
|
+
|
|
31
|
+
type DivinerDivineResult<T extends Payload> = WithoutPrivateStorageMeta<T>;
|
|
32
|
+
interface DivinerQueryFunctions<TIn extends Payload = Payload, TOut extends Payload = Payload> {
|
|
33
|
+
divine: (payloads?: TIn[], retry?: RetryConfig) => Promise<DivinerDivineResult<TOut>[]>;
|
|
34
|
+
divineQuery: (payloads?: TIn[], account?: AccountInstance, retry?: RetryConfig) => Promise<ModuleQueryResult<TOut>>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
declare const DivinerConfigSchema: "network.xyo.diviner.config";
|
|
38
|
+
type DivinerConfigSchema = typeof DivinerConfigSchema;
|
|
39
|
+
interface ModuleEventSubscription {
|
|
40
|
+
sourceEvent: string;
|
|
41
|
+
sourceModule: ModuleIdentifier;
|
|
42
|
+
targetModuleFunction?: string;
|
|
43
|
+
}
|
|
44
|
+
type DivinerConfig<TConfig extends Payload | EmptyObject | void = void, TSchema extends Schema | void = void> = ModuleConfig<WithAdditional<{
|
|
45
|
+
eventSubscriptions?: ModuleEventSubscription[];
|
|
46
|
+
schema: TConfig extends Payload ? TConfig['schema'] : DivinerConfigSchema;
|
|
47
|
+
}, TConfig>, TSchema>;
|
|
48
|
+
|
|
49
|
+
interface DivinerParams<TConfig extends AnyConfigSchema<DivinerConfig> = AnyConfigSchema<DivinerConfig>> extends ModuleParams<TConfig> {
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
interface DivinerModule<TParams extends DivinerParams = DivinerParams, TEvents extends DivinerModuleEventData = DivinerModuleEventData> extends Module<TParams, TEvents> {
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
interface DivinerInstance<TParams extends DivinerParams = DivinerParams, TIn extends Payload = Payload, TOut extends Payload = Payload, TEvents extends DivinerModuleEventData = DivinerModuleEventData> extends DivinerModule<TParams, TEvents>, DivinerQueryFunctions<TIn, TOut>, ModuleInstance<TParams, TEvents> {
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
interface AttachableDivinerInstance<TParams extends DivinerParams = DivinerParams, TIn extends Payload = Payload, TOut extends Payload = Payload, TEventData extends DivinerModuleEventData = DivinerModuleEventData> extends DivinerInstance<TParams, TIn, TOut, TEventData>, AttachableModuleInstance<TParams, TEventData> {
|
|
59
|
+
}
|
|
60
|
+
type AttachableDivinerInstanceTypeCheck<T extends AttachableDivinerInstance = AttachableDivinerInstance> = TypeCheck<T>;
|
|
61
|
+
declare class IsAttachableDivinerInstanceFactory<T extends AttachableDivinerInstance = AttachableDivinerInstance> extends IsObjectFactory<T> {
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
declare const asAttachableDivinerInstance: _xylabs_object.AsTypeFunction<AttachableDivinerInstance<DivinerParams<_xyo_network_module_model.AnyConfigSchema<DivinerConfig>>, _xyo_network_payload_model.Payload, _xyo_network_payload_model.Payload, DivinerModuleEventData>>;
|
|
65
|
+
|
|
66
|
+
declare const requiredAttachableDivinerInstanceFunctions: ObjectTypeShape;
|
|
67
|
+
declare const isAttachableDivinerInstance: TypeCheck<AttachableDivinerInstance>;
|
|
68
|
+
|
|
69
|
+
type DivinedPayload<T extends void | EmptyObject | WithSchema = void, S extends Schema | void = void> = Payload<WithAdditional<{
|
|
70
|
+
sources: Hash[];
|
|
71
|
+
}, T>, S>;
|
|
72
|
+
|
|
73
|
+
type DivinerDivineQuerySchema = 'network.xyo.query.diviner.divine';
|
|
74
|
+
declare const DivinerDivineQuerySchema: DivinerDivineQuerySchema;
|
|
75
|
+
type DivinerDivineQuery = Query<{
|
|
76
|
+
schema: DivinerDivineQuerySchema;
|
|
77
|
+
}>;
|
|
78
|
+
|
|
79
|
+
type DivinerQueries = DivinerDivineQuery;
|
|
80
|
+
type DivinerModuleQueries = ModuleQueries | DivinerQueries;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Configuration for searchable storage of local state
|
|
84
|
+
*/
|
|
85
|
+
interface SearchableStorage {
|
|
86
|
+
/**
|
|
87
|
+
* Name/Address of the archivist where intermediate communications are stored
|
|
88
|
+
*/
|
|
89
|
+
archivist: ModuleIdentifier;
|
|
90
|
+
/**
|
|
91
|
+
* Name/Address of the diviner where intermediate communications are filtered
|
|
92
|
+
*/
|
|
93
|
+
boundWitnessDiviner?: ModuleIdentifier;
|
|
94
|
+
/**
|
|
95
|
+
* Name/Address of the diviner where intermediate communications are filtered
|
|
96
|
+
*/
|
|
97
|
+
payloadDiviner?: ModuleIdentifier;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
declare const isDivinerInstance: TypeCheck<DivinerInstance>;
|
|
101
|
+
declare const isDivinerModule: TypeCheck<DivinerModule>;
|
|
102
|
+
declare const asDivinerModule: _xylabs_object.AsTypeFunction<DivinerModule<DivinerParams<_xyo_network_module_model.AnyConfigSchema<DivinerConfig>>, DivinerModuleEventData>>;
|
|
103
|
+
declare const asDivinerInstance: _xylabs_object.AsTypeFunction<DivinerInstance<DivinerParams<_xyo_network_module_model.AnyConfigSchema<DivinerConfig>>, _xyo_network_payload_model.Payload, _xyo_network_payload_model.Payload, DivinerModuleEventData>>;
|
|
104
|
+
declare const withDivinerModule: <R>(mod: any, closure: (mod: DivinerModule<DivinerParams<_xyo_network_module_model.AnyConfigSchema<DivinerConfig>>, DivinerModuleEventData>) => R) => R | undefined;
|
|
105
|
+
declare const withDivinerInstance: <R>(mod: any, closure: (mod: DivinerInstance<DivinerParams<_xyo_network_module_model.AnyConfigSchema<DivinerConfig>>, _xyo_network_payload_model.Payload, _xyo_network_payload_model.Payload, DivinerModuleEventData>) => R) => R | undefined;
|
|
106
|
+
|
|
107
|
+
export { DivinerConfigSchema, DivinerDivineQuerySchema, IsAttachableDivinerInstanceFactory, asAttachableDivinerInstance, asDivinerInstance, asDivinerModule, isAttachableDivinerInstance, isDivinerInstance, isDivinerModule, requiredAttachableDivinerInstanceFunctions, withDivinerInstance, withDivinerModule };
|
|
108
|
+
export type { AttachableDivinerInstance, AttachableDivinerInstanceTypeCheck, DivineEndEventArgs, DivineEndEventData, DivineStartEventArgs, DivineStartEventData, DivinedPayload, DivinerConfig, DivinerDivineQuery, DivinerDivineResult, DivinerInstance, DivinerModule, DivinerModuleEventData, DivinerModuleQueries, DivinerParams, DivinerQueries, DivinerQueryFunctions, ModuleEventSubscription, SearchableStorage };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/attachable/asAttachableInstance.ts","../../src/attachable/isAttachableInstance.ts","../../src/typeChecks.ts","../../src/Queries/Divine.ts","../../src/attachable/AttachableInstance.ts","../../src/Config.ts"],"sourcesContent":["import { AsObjectFactory } from '@xylabs/object'\n\nimport { isAttachableDivinerInstance } from './isAttachableInstance.ts'\n\nexport const asAttachableDivinerInstance = AsObjectFactory.create(isAttachableDivinerInstance)\n","import type { TypeCheck } from '@xylabs/object'\nimport { IsObjectFactory } from '@xylabs/object'\nimport type { ObjectTypeShape } from '@xylabs/typeof'\nimport { isAttachableModuleInstance } from '@xyo-network/module-model'\n\nimport { isDivinerInstance } from '../typeChecks.ts'\nimport type { AttachableDivinerInstance } from './AttachableInstance.ts'\n\nexport const requiredAttachableDivinerInstanceFunctions: ObjectTypeShape = {}\n\n// we do not use IsInstanceFactory here to prevent a cycle\nconst factory = new IsObjectFactory<AttachableDivinerInstance>()\n\nexport const isAttachableDivinerInstance: TypeCheck<AttachableDivinerInstance> = factory.create(requiredAttachableDivinerInstanceFunctions, [\n isDivinerInstance,\n isAttachableModuleInstance,\n])\n","import { AsObjectFactory } from '@xylabs/object'\nimport {\n IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory,\n} from '@xyo-network/module-model'\n\nimport type { DivinerInstance } from './Instance.ts'\nimport type { DivinerModule } from './Module.ts'\nimport { DivinerDivineQuerySchema } from './Queries/index.ts'\n\nexport const isDivinerInstance = new IsInstanceFactory<DivinerInstance>().create({ divine: 'function' }, [isModuleInstance])\nexport const isDivinerModule = new IsModuleFactory<DivinerModule>().create([DivinerDivineQuerySchema])\n\nexport const asDivinerModule = AsObjectFactory.create(isDivinerModule)\nexport const asDivinerInstance = AsObjectFactory.create(isDivinerInstance)\nexport const withDivinerModule = WithFactory.create(isDivinerModule)\nexport const withDivinerInstance = WithFactory.create(isDivinerInstance)\n","import type { Query } from '@xyo-network/payload-model'\n\nexport type DivinerDivineQuerySchema = 'network.xyo.query.diviner.divine'\nexport const DivinerDivineQuerySchema: DivinerDivineQuerySchema = 'network.xyo.query.diviner.divine'\n\nexport type DivinerDivineQuery = Query<{\n schema: DivinerDivineQuerySchema\n}>\n","import type { TypeCheck } from '@xylabs/object'\nimport { IsObjectFactory } from '@xylabs/object'\nimport type { AttachableModuleInstance } from '@xyo-network/module-model'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport type { DivinerModuleEventData } from '../EventData.ts'\nimport type { DivinerInstance } from '../Instance.ts'\nimport type { DivinerParams } from '../Params.ts'\n\nexport interface AttachableDivinerInstance<\n TParams extends DivinerParams = DivinerParams,\n TIn extends Payload = Payload,\n TOut extends Payload = Payload,\n TEventData extends DivinerModuleEventData = DivinerModuleEventData,\n> extends DivinerInstance<TParams, TIn, TOut, TEventData>,\n AttachableModuleInstance<TParams, TEventData> {}\n\nexport type AttachableDivinerInstanceTypeCheck<T extends AttachableDivinerInstance = AttachableDivinerInstance> = TypeCheck<T>\n\nexport class IsAttachableDivinerInstanceFactory<T extends AttachableDivinerInstance = AttachableDivinerInstance> extends IsObjectFactory<T> {}\n","import type { EmptyObject, WithAdditional } from '@xylabs/object'\nimport type { ModuleConfig, ModuleIdentifier } from '@xyo-network/module-model'\nimport type { Payload, Schema } from '@xyo-network/payload-model'\n\nexport const DivinerConfigSchema = 'network.xyo.diviner.config' as const\nexport type DivinerConfigSchema = typeof DivinerConfigSchema\n\nexport interface ModuleEventSubscription {\n sourceEvent: string\n sourceModule: ModuleIdentifier\n targetModuleFunction?: string\n}\n\nexport type DivinerConfig<TConfig extends Payload | EmptyObject | void = void, TSchema extends Schema | void = void> = ModuleConfig<\n WithAdditional<\n {\n eventSubscriptions?: ModuleEventSubscription[]\n schema: TConfig extends Payload ? TConfig['schema'] : DivinerConfigSchema\n },\n TConfig\n >,\n TSchema\n>\n"],"mappings":";AAAA,SAAS,mBAAAA,wBAAuB;;;ACChC,SAAS,uBAAuB;AAEhC,SAAS,kCAAkC;;;
|
|
1
|
+
{"version":3,"sources":["../../src/attachable/asAttachableInstance.ts","../../src/attachable/isAttachableInstance.ts","../../src/typeChecks.ts","../../src/Queries/Divine.ts","../../src/attachable/AttachableInstance.ts","../../src/Config.ts"],"sourcesContent":["import { AsObjectFactory } from '@xylabs/object'\n\nimport { isAttachableDivinerInstance } from './isAttachableInstance.ts'\n\nexport const asAttachableDivinerInstance = AsObjectFactory.create(isAttachableDivinerInstance)\n","import type { TypeCheck } from '@xylabs/object'\nimport { IsObjectFactory } from '@xylabs/object'\nimport type { ObjectTypeShape } from '@xylabs/typeof'\nimport { isAttachableModuleInstance } from '@xyo-network/module-model'\n\nimport { isDivinerInstance } from '../typeChecks.ts'\nimport type { AttachableDivinerInstance } from './AttachableInstance.ts'\n\nexport const requiredAttachableDivinerInstanceFunctions: ObjectTypeShape = {}\n\n// we do not use IsInstanceFactory here to prevent a cycle\nconst factory = new IsObjectFactory<AttachableDivinerInstance>()\n\nexport const isAttachableDivinerInstance: TypeCheck<AttachableDivinerInstance> = factory.create(requiredAttachableDivinerInstanceFunctions, [\n isDivinerInstance,\n isAttachableModuleInstance,\n])\n","import type { TypeCheck } from '@xylabs/object'\nimport { AsObjectFactory } from '@xylabs/object'\nimport {\n IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory,\n} from '@xyo-network/module-model'\n\nimport type { DivinerInstance } from './Instance.ts'\nimport type { DivinerModule } from './Module.ts'\nimport { DivinerDivineQuerySchema } from './Queries/index.ts'\n\nexport const isDivinerInstance: TypeCheck<DivinerInstance> = new IsInstanceFactory<DivinerInstance>().create({ divine: 'function' }, [isModuleInstance])\nexport const isDivinerModule: TypeCheck<DivinerModule> = new IsModuleFactory<DivinerModule>().create([DivinerDivineQuerySchema])\n\nexport const asDivinerModule = AsObjectFactory.create(isDivinerModule)\nexport const asDivinerInstance = AsObjectFactory.create(isDivinerInstance)\nexport const withDivinerModule = WithFactory.create(isDivinerModule)\nexport const withDivinerInstance = WithFactory.create(isDivinerInstance)\n","import type { Query } from '@xyo-network/payload-model'\n\nexport type DivinerDivineQuerySchema = 'network.xyo.query.diviner.divine'\nexport const DivinerDivineQuerySchema: DivinerDivineQuerySchema = 'network.xyo.query.diviner.divine'\n\nexport type DivinerDivineQuery = Query<{\n schema: DivinerDivineQuerySchema\n}>\n","import type { TypeCheck } from '@xylabs/object'\nimport { IsObjectFactory } from '@xylabs/object'\nimport type { AttachableModuleInstance } from '@xyo-network/module-model'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport type { DivinerModuleEventData } from '../EventData.ts'\nimport type { DivinerInstance } from '../Instance.ts'\nimport type { DivinerParams } from '../Params.ts'\n\nexport interface AttachableDivinerInstance<\n TParams extends DivinerParams = DivinerParams,\n TIn extends Payload = Payload,\n TOut extends Payload = Payload,\n TEventData extends DivinerModuleEventData = DivinerModuleEventData,\n> extends DivinerInstance<TParams, TIn, TOut, TEventData>,\n AttachableModuleInstance<TParams, TEventData> {}\n\nexport type AttachableDivinerInstanceTypeCheck<T extends AttachableDivinerInstance = AttachableDivinerInstance> = TypeCheck<T>\n\nexport class IsAttachableDivinerInstanceFactory<T extends AttachableDivinerInstance = AttachableDivinerInstance> extends IsObjectFactory<T> {}\n","import type { EmptyObject, WithAdditional } from '@xylabs/object'\nimport type { ModuleConfig, ModuleIdentifier } from '@xyo-network/module-model'\nimport type { Payload, Schema } from '@xyo-network/payload-model'\n\nexport const DivinerConfigSchema = 'network.xyo.diviner.config' as const\nexport type DivinerConfigSchema = typeof DivinerConfigSchema\n\nexport interface ModuleEventSubscription {\n sourceEvent: string\n sourceModule: ModuleIdentifier\n targetModuleFunction?: string\n}\n\nexport type DivinerConfig<TConfig extends Payload | EmptyObject | void = void, TSchema extends Schema | void = void> = ModuleConfig<\n WithAdditional<\n {\n eventSubscriptions?: ModuleEventSubscription[]\n schema: TConfig extends Payload ? TConfig['schema'] : DivinerConfigSchema\n },\n TConfig\n >,\n TSchema\n>\n"],"mappings":";AAAA,SAAS,mBAAAA,wBAAuB;;;ACChC,SAAS,uBAAuB;AAEhC,SAAS,kCAAkC;;;ACF3C,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EAAmB;AAAA,EAAiB;AAAA,EAAkB;AAAA,OACjD;;;ACDA,IAAM,2BAAqD;;;ADO3D,IAAM,oBAAgD,IAAI,kBAAmC,EAAE,OAAO,EAAE,QAAQ,WAAW,GAAG,CAAC,gBAAgB,CAAC;AAChJ,IAAM,kBAA4C,IAAI,gBAA+B,EAAE,OAAO,CAAC,wBAAwB,CAAC;AAExH,IAAM,kBAAkB,gBAAgB,OAAO,eAAe;AAC9D,IAAM,oBAAoB,gBAAgB,OAAO,iBAAiB;AAClE,IAAM,oBAAoB,YAAY,OAAO,eAAe;AAC5D,IAAM,sBAAsB,YAAY,OAAO,iBAAiB;;;ADRhE,IAAM,6CAA8D,CAAC;AAG5E,IAAM,UAAU,IAAI,gBAA2C;AAExD,IAAM,8BAAoE,QAAQ,OAAO,4CAA4C;AAAA,EAC1I;AAAA,EACA;AACF,CAAC;;;ADZM,IAAM,8BAA8BC,iBAAgB,OAAO,2BAA2B;;;AIH7F,SAAS,mBAAAC,wBAAuB;AAkBzB,IAAM,qCAAN,cAAkHA,iBAAmB;AAAC;;;ACftI,IAAM,sBAAsB;","names":["AsObjectFactory","AsObjectFactory","IsObjectFactory"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/diviner-model",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -21,26 +21,26 @@
|
|
|
21
21
|
"type": "module",
|
|
22
22
|
"exports": {
|
|
23
23
|
".": {
|
|
24
|
-
"types": "./dist/
|
|
24
|
+
"types": "./dist/neutral/index.d.ts",
|
|
25
25
|
"default": "./dist/neutral/index.mjs"
|
|
26
26
|
},
|
|
27
27
|
"./package.json": "./package.json"
|
|
28
28
|
},
|
|
29
29
|
"module": "dist/neutral/index.mjs",
|
|
30
|
-
"types": "dist/
|
|
30
|
+
"types": "dist/neutral/index.d.ts",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@xylabs/events": "^4.13.
|
|
33
|
-
"@xylabs/hex": "^4.13.
|
|
34
|
-
"@xylabs/object": "^4.13.
|
|
35
|
-
"@xylabs/retry": "^4.13.
|
|
36
|
-
"@xylabs/typeof": "^4.13.
|
|
37
|
-
"@xyo-network/account-model": "^4.0
|
|
38
|
-
"@xyo-network/module-model": "^4.0
|
|
39
|
-
"@xyo-network/payload-model": "^4.0
|
|
32
|
+
"@xylabs/events": "^4.13.15",
|
|
33
|
+
"@xylabs/hex": "^4.13.15",
|
|
34
|
+
"@xylabs/object": "^4.13.15",
|
|
35
|
+
"@xylabs/retry": "^4.13.15",
|
|
36
|
+
"@xylabs/typeof": "^4.13.15",
|
|
37
|
+
"@xyo-network/account-model": "^4.1.0",
|
|
38
|
+
"@xyo-network/module-model": "^4.1.0",
|
|
39
|
+
"@xyo-network/payload-model": "^4.1.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@xylabs/ts-scripts-yarn3": "^
|
|
43
|
-
"@xylabs/tsconfig": "^
|
|
42
|
+
"@xylabs/ts-scripts-yarn3": "^7.0.0-rc.20",
|
|
43
|
+
"@xylabs/tsconfig": "^7.0.0-rc.20",
|
|
44
44
|
"typescript": "^5.8.3"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
package/src/typeChecks.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { TypeCheck } from '@xylabs/object'
|
|
1
2
|
import { AsObjectFactory } from '@xylabs/object'
|
|
2
3
|
import {
|
|
3
4
|
IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory,
|
|
@@ -7,8 +8,8 @@ import type { DivinerInstance } from './Instance.ts'
|
|
|
7
8
|
import type { DivinerModule } from './Module.ts'
|
|
8
9
|
import { DivinerDivineQuerySchema } from './Queries/index.ts'
|
|
9
10
|
|
|
10
|
-
export const isDivinerInstance = new IsInstanceFactory<DivinerInstance>().create({ divine: 'function' }, [isModuleInstance])
|
|
11
|
-
export const isDivinerModule = new IsModuleFactory<DivinerModule>().create([DivinerDivineQuerySchema])
|
|
11
|
+
export const isDivinerInstance: TypeCheck<DivinerInstance> = new IsInstanceFactory<DivinerInstance>().create({ divine: 'function' }, [isModuleInstance])
|
|
12
|
+
export const isDivinerModule: TypeCheck<DivinerModule> = new IsModuleFactory<DivinerModule>().create([DivinerDivineQuerySchema])
|
|
12
13
|
|
|
13
14
|
export const asDivinerModule = AsObjectFactory.create(isDivinerModule)
|
|
14
15
|
export const asDivinerInstance = AsObjectFactory.create(isDivinerInstance)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typeChecks.d.ts","sourceRoot":"","sources":["../../src/typeChecks.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAGhD,eAAO,MAAM,iBAAiB,iUAA8F,CAAA;AAC5H,eAAO,MAAM,eAAe,oPAA0E,CAAA;AAEtG,eAAO,MAAM,eAAe,wOAA0C,CAAA;AACtE,eAAO,MAAM,iBAAiB,sUAA4C,CAAA;AAC1E,eAAO,MAAM,iBAAiB,oPAAsC,CAAA;AACpE,eAAO,MAAM,mBAAmB,kVAAwC,CAAA"}
|
|
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
|
|
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
|
|
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
|