@xyo-network/node-model 3.0.2 → 3.0.3
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/index.mjs.map +1 -1
- package/package.json +11 -11
- package/src/ChildCertification.ts +2 -2
- package/src/Config.ts +3 -3
- package/src/EventsModels/ModuleAttached.ts +2 -2
- package/src/EventsModels/ModuleDetached.ts +2 -2
- package/src/EventsModels/ModuleRegistered.ts +2 -2
- package/src/EventsModels/ModuleUnregistered.ts +2 -2
- package/src/Node.ts +3 -3
- package/src/Params.ts +3 -3
- package/src/Queries/Attach.ts +2 -2
- package/src/Queries/Attached.ts +1 -1
- package/src/Queries/Certify.ts +2 -2
- package/src/Queries/Detach.ts +2 -2
- package/src/Queries/Registered.ts +1 -1
- package/src/Queries/index.ts +6 -6
- package/src/attachable/AttachableInstance.ts +6 -5
- package/src/attachable/isAttachableInstance.ts +3 -2
- package/src/instance.ts +6 -6
- package/src/typeChecks.ts +2 -2
- package/xy.config.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/attachable/asAttachableInstance.ts","../../src/attachable/isAttachableInstance.ts","../../src/typeChecks.ts","../../src/Queries/Attach.ts","../../src/Queries/Attached.ts","../../src/Queries/Certify.ts","../../src/Queries/Detach.ts","../../src/Queries/Registered.ts","../../src/attachable/AttachableInstance.ts","../../src/ChildCertification.ts","../../src/Config.ts"],"sourcesContent":["import { AsObjectFactory } from '@xylabs/object'\n\nimport { isAttachableNodeInstance } from './isAttachableInstance.ts'\n\nexport const asAttachableNodeInstance = AsObjectFactory.create(isAttachableNodeInstance)\n","import {
|
|
1
|
+
{"version":3,"sources":["../../src/attachable/asAttachableInstance.ts","../../src/attachable/isAttachableInstance.ts","../../src/typeChecks.ts","../../src/Queries/Attach.ts","../../src/Queries/Attached.ts","../../src/Queries/Certify.ts","../../src/Queries/Detach.ts","../../src/Queries/Registered.ts","../../src/attachable/AttachableInstance.ts","../../src/ChildCertification.ts","../../src/Config.ts"],"sourcesContent":["import { AsObjectFactory } from '@xylabs/object'\n\nimport { isAttachableNodeInstance } from './isAttachableInstance.ts'\n\nexport const asAttachableNodeInstance = AsObjectFactory.create(isAttachableNodeInstance)\n","import type { ObjectTypeShape, TypeCheck } from '@xylabs/object'\nimport { IsObjectFactory } from '@xylabs/object'\nimport { isAttachableModuleInstance } from '@xyo-network/module-model'\n\nimport { isNodeInstance } from '../typeChecks.ts'\nimport type { AttachableNodeInstance } from './AttachableInstance.ts'\n\nexport const requiredAttachableNodeInstanceFunctions: ObjectTypeShape = {}\n\n// we do not use IsInstanceFactory here to prevent a cycle\nconst factory = new IsObjectFactory<AttachableNodeInstance>()\n\nexport const isAttachableNodeInstance: TypeCheck<AttachableNodeInstance> = factory.create(requiredAttachableNodeInstanceFunctions, [\n isNodeInstance,\n isAttachableModuleInstance,\n])\n","import { AsObjectFactory } from '@xylabs/object'\nimport { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'\n\nimport type { NodeInstance } from './instance.ts'\nimport type { NodeModule } from './Node.ts'\nimport { NodeAttachedQuerySchema } from './Queries/index.ts'\n\nconst instanceFactory = new IsInstanceFactory<NodeInstance>()\n\nexport const isNodeInstance = instanceFactory.create(\n {\n attach: 'function',\n attached: 'function',\n certify: 'function',\n detach: 'function',\n registered: 'function',\n },\n [isModuleInstance],\n)\n\nconst moduleFactory = new IsModuleFactory<NodeModule>()\n\nexport const isNodeModule = moduleFactory.create([NodeAttachedQuerySchema])\n\nexport const asNodeModule = AsObjectFactory.create(isNodeModule)\nexport const asNodeInstance = AsObjectFactory.create(isNodeInstance)\nexport const withNodeModule = WithFactory.create(isNodeModule)\nexport const withNodeInstance = WithFactory.create(isNodeInstance)\n","import type { ModuleIdentifier } from '@xyo-network/module-model'\nimport type { Query } from '@xyo-network/payload-model'\n\nexport type NodeAttachQuerySchema = 'network.xyo.query.node.attach'\nexport const NodeAttachQuerySchema: NodeAttachQuerySchema = 'network.xyo.query.node.attach'\n\nexport type NodeAttachQuery = Query<{\n external?: boolean\n id: ModuleIdentifier\n schema: NodeAttachQuerySchema\n}>\n","import type { Query } from '@xyo-network/payload-model'\n\nexport type NodeAttachedQuerySchema = 'network.xyo.query.node.attached'\nexport const NodeAttachedQuerySchema: NodeAttachedQuerySchema = 'network.xyo.query.node.attached'\n\nexport type NodeAttachedQuery = Query<{\n schema: NodeAttachedQuerySchema\n}>\n","import type { ModuleIdentifier } from '@xyo-network/module-model'\nimport type { Query } from '@xyo-network/payload-model'\n\nexport type NodeCertifyQuerySchema = 'network.xyo.query.node.certify'\nexport const NodeCertifyQuerySchema: NodeCertifyQuerySchema = 'network.xyo.query.node.certify'\n\nexport type NodeCertifyQuery = Query<{\n id: ModuleIdentifier\n schema: NodeCertifyQuerySchema\n}>\n","import type { ModuleIdentifier } from '@xyo-network/module-model'\nimport type { Query } from '@xyo-network/payload-model'\n\nexport type NodeDetachQuerySchema = 'network.xyo.query.node.detach'\nexport const NodeDetachQuerySchema: NodeDetachQuerySchema = 'network.xyo.query.node.detach'\n\nexport type NodeDetachQuery = Query<{\n id: ModuleIdentifier\n schema: NodeDetachQuerySchema\n}>\n","import type { Query } from '@xyo-network/payload-model'\n\nexport type NodeRegisteredQuerySchema = 'network.xyo.query.node.registered'\nexport const NodeRegisteredQuerySchema: NodeRegisteredQuerySchema = 'network.xyo.query.node.registered'\n\nexport type NodeRegisteredQuery = Query<{\n schema: NodeRegisteredQuerySchema\n}>\n","import type { TypeCheck } from '@xylabs/object'\nimport { IsObjectFactory } from '@xylabs/object'\nimport type { AttachableModuleInstance } from '@xyo-network/module-model'\n\nimport type { NodeInstance } from '../instance.ts'\nimport type { NodeModule, NodeModuleEventData } from '../Node.ts'\nimport type { NodeParams } from '../Params.ts'\n\nexport interface AttachableNodeInstance<TParams extends NodeParams = NodeParams, TEventData extends NodeModuleEventData = NodeModuleEventData>\n extends NodeModule<TParams, TEventData>,\n AttachableModuleInstance<TParams, TEventData>,\n NodeInstance<TParams, TEventData> {}\n\nexport type AttachableNodeInstanceTypeCheck<T extends AttachableNodeInstance = AttachableNodeInstance> = TypeCheck<T>\n\nexport class IsAttachableNodeInstanceFactory<T extends AttachableNodeInstance = AttachableNodeInstance> extends IsObjectFactory<T> {}\n","import type { Address } from '@xylabs/hex'\nimport type { Payload } from '@xyo-network/payload-model'\n\nexport const ChildCertificationSchema = 'network.xyo.child.certification' as const\nexport type ChildCertificationSchema = typeof ChildCertificationSchema\n\nexport interface ChildCertificationFields {\n address: Address\n expiration: number\n}\n\nexport type ChildCertification = Payload<ChildCertificationFields, ChildCertificationSchema>\n","import type { EmptyObject, WithAdditional } from '@xylabs/object'\nimport type { ModuleConfig } from '@xyo-network/module-model'\nimport type { Payload } from '@xyo-network/payload-model'\n\nexport const NodeConfigSchema = 'network.xyo.node.config' as const\nexport type NodeConfigSchema = typeof NodeConfigSchema\n\nexport type NodeConfig<TConfig extends EmptyObject | Payload | void = void, TSchema extends string | void = void> = ModuleConfig<\n WithAdditional<\n {\n archivist?: string\n },\n TConfig\n >,\n TSchema extends void ?\n TConfig extends Payload ?\n TConfig['schema']\n : NodeConfigSchema\n : TSchema\n>\n"],"mappings":";;;;AAAA,SAASA,mBAAAA,wBAAuB;;;ACChC,SAASC,uBAAuB;AAChC,SAASC,kCAAkC;;;ACF3C,SAASC,uBAAuB;AAChC,SAASC,mBAAmBC,iBAAiBC,kBAAkBC,mBAAmB;;;ACG3E,IAAMC,wBAA+C;;;ACDrD,IAAMC,0BAAmD;;;ACCzD,IAAMC,yBAAiD;;;ACAvD,IAAMC,wBAA+C;;;ACDrD,IAAMC,4BAAuD;;;ALIpE,IAAMC,kBAAkB,IAAIC,kBAAAA;AAErB,IAAMC,iBAAiBF,gBAAgBG,OAC5C;EACEC,QAAQ;EACRC,UAAU;EACVC,SAAS;EACTC,QAAQ;EACRC,YAAY;AACd,GACA;EAACC;CAAiB;AAGpB,IAAMC,gBAAgB,IAAIC,gBAAAA;AAEnB,IAAMC,eAAeF,cAAcP,OAAO;EAACU;CAAwB;AAEnE,IAAMC,eAAeC,gBAAgBZ,OAAOS,YAAAA;AAC5C,IAAMI,iBAAiBD,gBAAgBZ,OAAOD,cAAAA;AAC9C,IAAMe,iBAAiBC,YAAYf,OAAOS,YAAAA;AAC1C,IAAMO,mBAAmBD,YAAYf,OAAOD,cAAAA;;;ADpB5C,IAAMkB,0CAA2D,CAAC;AAGzE,IAAMC,UAAU,IAAIC,gBAAAA;AAEb,IAAMC,2BAA8DF,QAAQG,OAAOJ,yCAAyC;EACjIK;EACAC;CACD;;;ADXM,IAAMC,2BAA2BC,iBAAgBC,OAAOC,wBAAAA;;;AQH/D,SAASC,mBAAAA,wBAAuB;AAczB,IAAMC,kCAAN,cAAyGC,iBAAAA;EAdhH,OAcgHA;;;AAAoB;;;ACZ7H,IAAMC,2BAA2B;;;ACCjC,IAAMC,mBAAmB;","names":["AsObjectFactory","IsObjectFactory","isAttachableModuleInstance","AsObjectFactory","IsInstanceFactory","IsModuleFactory","isModuleInstance","WithFactory","NodeAttachQuerySchema","NodeAttachedQuerySchema","NodeCertifyQuerySchema","NodeDetachQuerySchema","NodeRegisteredQuerySchema","instanceFactory","IsInstanceFactory","isNodeInstance","create","attach","attached","certify","detach","registered","isModuleInstance","moduleFactory","IsModuleFactory","isNodeModule","NodeAttachedQuerySchema","asNodeModule","AsObjectFactory","asNodeInstance","withNodeModule","WithFactory","withNodeInstance","requiredAttachableNodeInstanceFunctions","factory","IsObjectFactory","isAttachableNodeInstance","create","isNodeInstance","isAttachableModuleInstance","asAttachableNodeInstance","AsObjectFactory","create","isAttachableNodeInstance","IsObjectFactory","IsAttachableNodeInstanceFactory","IsObjectFactory","ChildCertificationSchema","NodeConfigSchema"]}
|
package/package.json
CHANGED
|
@@ -7,19 +7,19 @@
|
|
|
7
7
|
},
|
|
8
8
|
"bugs": {
|
|
9
9
|
"email": "support@xyo.network",
|
|
10
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
|
|
10
|
+
"url": "git+https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xylabs/hex": "^4.0.
|
|
14
|
-
"@xylabs/object": "^4.0.
|
|
15
|
-
"@xyo-network/account-model": "^3.0.
|
|
16
|
-
"@xyo-network/module-events": "^3.0.
|
|
17
|
-
"@xyo-network/module-model": "^3.0.
|
|
18
|
-
"@xyo-network/payload-model": "^3.0.
|
|
13
|
+
"@xylabs/hex": "^4.0.2",
|
|
14
|
+
"@xylabs/object": "^4.0.2",
|
|
15
|
+
"@xyo-network/account-model": "^3.0.3",
|
|
16
|
+
"@xyo-network/module-events": "^3.0.3",
|
|
17
|
+
"@xyo-network/module-model": "^3.0.3",
|
|
18
|
+
"@xyo-network/payload-model": "^3.0.3"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@xylabs/ts-scripts-yarn3": "^4.0.0-rc.
|
|
22
|
-
"@xylabs/tsconfig": "^4.0.0-rc.
|
|
21
|
+
"@xylabs/ts-scripts-yarn3": "^4.0.0-rc.20",
|
|
22
|
+
"@xylabs/tsconfig": "^4.0.0-rc.20",
|
|
23
23
|
"typescript": "^5.5.4"
|
|
24
24
|
},
|
|
25
25
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
},
|
|
40
40
|
"repository": {
|
|
41
41
|
"type": "git",
|
|
42
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
|
|
42
|
+
"url": "git+https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
|
|
43
43
|
},
|
|
44
44
|
"sideEffects": false,
|
|
45
|
-
"version": "3.0.
|
|
45
|
+
"version": "3.0.3",
|
|
46
46
|
"type": "module"
|
|
47
47
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Address } from '@xylabs/hex'
|
|
2
|
-
import { Payload } from '@xyo-network/payload-model'
|
|
1
|
+
import type { Address } from '@xylabs/hex'
|
|
2
|
+
import type { Payload } from '@xyo-network/payload-model'
|
|
3
3
|
|
|
4
4
|
export const ChildCertificationSchema = 'network.xyo.child.certification' as const
|
|
5
5
|
export type ChildCertificationSchema = typeof ChildCertificationSchema
|
package/src/Config.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { EmptyObject, WithAdditional } from '@xylabs/object'
|
|
2
|
-
import { ModuleConfig } from '@xyo-network/module-model'
|
|
3
|
-
import { Payload } from '@xyo-network/payload-model'
|
|
1
|
+
import type { EmptyObject, WithAdditional } from '@xylabs/object'
|
|
2
|
+
import type { ModuleConfig } from '@xyo-network/module-model'
|
|
3
|
+
import type { Payload } from '@xyo-network/payload-model'
|
|
4
4
|
|
|
5
5
|
export const NodeConfigSchema = 'network.xyo.node.config' as const
|
|
6
6
|
export type NodeConfigSchema = typeof NodeConfigSchema
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EventData } from '@xyo-network/module-events'
|
|
2
|
-
import { Module, ModuleEventArgs } from '@xyo-network/module-model'
|
|
1
|
+
import type { EventData } from '@xyo-network/module-events'
|
|
2
|
+
import type { Module, ModuleEventArgs } from '@xyo-network/module-model'
|
|
3
3
|
|
|
4
4
|
export type ModuleAttachedEventArgs<TModule extends Module = Module> = ModuleEventArgs<TModule>
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EventData } from '@xyo-network/module-events'
|
|
2
|
-
import { Module, ModuleEventArgs } from '@xyo-network/module-model'
|
|
1
|
+
import type { EventData } from '@xyo-network/module-events'
|
|
2
|
+
import type { Module, ModuleEventArgs } from '@xyo-network/module-model'
|
|
3
3
|
|
|
4
4
|
export type ModuleDetachedEventArgs<TModule extends Module = Module> = ModuleEventArgs<TModule>
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EventData } from '@xyo-network/module-events'
|
|
2
|
-
import { Module, ModuleEventArgs } from '@xyo-network/module-model'
|
|
1
|
+
import type { EventData } from '@xyo-network/module-events'
|
|
2
|
+
import type { Module, ModuleEventArgs } from '@xyo-network/module-model'
|
|
3
3
|
|
|
4
4
|
export type ModuleRegisteredEventArgs<TModule extends Module = Module> = ModuleEventArgs<TModule>
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EventData } from '@xyo-network/module-events'
|
|
2
|
-
import { Module, ModuleEventArgs } from '@xyo-network/module-model'
|
|
1
|
+
import type { EventData } from '@xyo-network/module-events'
|
|
2
|
+
import type { Module, ModuleEventArgs } from '@xyo-network/module-model'
|
|
3
3
|
|
|
4
4
|
export type ModuleUnregisteredEventArgs<TModule extends Module = Module> = ModuleEventArgs<TModule>
|
|
5
5
|
|
package/src/Node.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Module, ModuleEventData } from '@xyo-network/module-model'
|
|
1
|
+
import type { Module, ModuleEventData } from '@xyo-network/module-model'
|
|
2
2
|
|
|
3
|
-
import { ModuleAttachedEventData, ModuleDetachedEventData, ModuleRegisteredEventData, ModuleUnregisteredEventData } from './EventsModels/index.ts'
|
|
4
|
-
import { NodeParams } from './Params.ts'
|
|
3
|
+
import type { ModuleAttachedEventData, ModuleDetachedEventData, ModuleRegisteredEventData, ModuleUnregisteredEventData } from './EventsModels/index.ts'
|
|
4
|
+
import type { NodeParams } from './Params.ts'
|
|
5
5
|
|
|
6
6
|
export interface NodeModuleEventData
|
|
7
7
|
extends ModuleAttachedEventData,
|
package/src/Params.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { EmptyObject } from '@xylabs/object'
|
|
2
|
-
import { AnyConfigSchema, ModuleParams } from '@xyo-network/module-model'
|
|
1
|
+
import type { EmptyObject } from '@xylabs/object'
|
|
2
|
+
import type { AnyConfigSchema, ModuleParams } from '@xyo-network/module-model'
|
|
3
3
|
|
|
4
|
-
import { NodeConfig } from './Config.ts'
|
|
4
|
+
import type { NodeConfig } from './Config.ts'
|
|
5
5
|
|
|
6
6
|
export type NodeParams<
|
|
7
7
|
TConfig extends AnyConfigSchema<NodeConfig> = AnyConfigSchema<NodeConfig>,
|
package/src/Queries/Attach.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ModuleIdentifier } from '@xyo-network/module-model'
|
|
2
|
-
import { Query } from '@xyo-network/payload-model'
|
|
1
|
+
import type { ModuleIdentifier } from '@xyo-network/module-model'
|
|
2
|
+
import type { Query } from '@xyo-network/payload-model'
|
|
3
3
|
|
|
4
4
|
export type NodeAttachQuerySchema = 'network.xyo.query.node.attach'
|
|
5
5
|
export const NodeAttachQuerySchema: NodeAttachQuerySchema = 'network.xyo.query.node.attach'
|
package/src/Queries/Attached.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Query } from '@xyo-network/payload-model'
|
|
1
|
+
import type { Query } from '@xyo-network/payload-model'
|
|
2
2
|
|
|
3
3
|
export type NodeAttachedQuerySchema = 'network.xyo.query.node.attached'
|
|
4
4
|
export const NodeAttachedQuerySchema: NodeAttachedQuerySchema = 'network.xyo.query.node.attached'
|
package/src/Queries/Certify.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ModuleIdentifier } from '@xyo-network/module-model'
|
|
2
|
-
import { Query } from '@xyo-network/payload-model'
|
|
1
|
+
import type { ModuleIdentifier } from '@xyo-network/module-model'
|
|
2
|
+
import type { Query } from '@xyo-network/payload-model'
|
|
3
3
|
|
|
4
4
|
export type NodeCertifyQuerySchema = 'network.xyo.query.node.certify'
|
|
5
5
|
export const NodeCertifyQuerySchema: NodeCertifyQuerySchema = 'network.xyo.query.node.certify'
|
package/src/Queries/Detach.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ModuleIdentifier } from '@xyo-network/module-model'
|
|
2
|
-
import { Query } from '@xyo-network/payload-model'
|
|
1
|
+
import type { ModuleIdentifier } from '@xyo-network/module-model'
|
|
2
|
+
import type { Query } from '@xyo-network/payload-model'
|
|
3
3
|
|
|
4
4
|
export type NodeDetachQuerySchema = 'network.xyo.query.node.detach'
|
|
5
5
|
export const NodeDetachQuerySchema: NodeDetachQuerySchema = 'network.xyo.query.node.detach'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Query } from '@xyo-network/payload-model'
|
|
1
|
+
import type { Query } from '@xyo-network/payload-model'
|
|
2
2
|
|
|
3
3
|
export type NodeRegisteredQuerySchema = 'network.xyo.query.node.registered'
|
|
4
4
|
export const NodeRegisteredQuerySchema: NodeRegisteredQuerySchema = 'network.xyo.query.node.registered'
|
package/src/Queries/index.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ModuleQueries } from '@xyo-network/module-model'
|
|
1
|
+
import type { ModuleQueries } from '@xyo-network/module-model'
|
|
2
2
|
|
|
3
|
-
import { NodeAttachQuery } from './Attach.ts'
|
|
4
|
-
import { NodeAttachedQuery } from './Attached.ts'
|
|
5
|
-
import { NodeCertifyQuery } from './Certify.ts'
|
|
6
|
-
import { NodeDetachQuery } from './Detach.ts'
|
|
7
|
-
import { NodeRegisteredQuery } from './Registered.ts'
|
|
3
|
+
import type { NodeAttachQuery } from './Attach.ts'
|
|
4
|
+
import type { NodeAttachedQuery } from './Attached.ts'
|
|
5
|
+
import type { NodeCertifyQuery } from './Certify.ts'
|
|
6
|
+
import type { NodeDetachQuery } from './Detach.ts'
|
|
7
|
+
import type { NodeRegisteredQuery } from './Registered.ts'
|
|
8
8
|
|
|
9
9
|
export * from './Attach.ts'
|
|
10
10
|
export * from './Attached.ts'
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { TypeCheck } from '@xylabs/object'
|
|
2
|
+
import { IsObjectFactory } from '@xylabs/object'
|
|
3
|
+
import type { AttachableModuleInstance } from '@xyo-network/module-model'
|
|
3
4
|
|
|
4
|
-
import { NodeInstance } from '../instance.ts'
|
|
5
|
-
import { NodeModule, NodeModuleEventData } from '../Node.ts'
|
|
6
|
-
import { NodeParams } from '../Params.ts'
|
|
5
|
+
import type { NodeInstance } from '../instance.ts'
|
|
6
|
+
import type { NodeModule, NodeModuleEventData } from '../Node.ts'
|
|
7
|
+
import type { NodeParams } from '../Params.ts'
|
|
7
8
|
|
|
8
9
|
export interface AttachableNodeInstance<TParams extends NodeParams = NodeParams, TEventData extends NodeModuleEventData = NodeModuleEventData>
|
|
9
10
|
extends NodeModule<TParams, TEventData>,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ObjectTypeShape, TypeCheck } from '@xylabs/object'
|
|
2
|
+
import { IsObjectFactory } from '@xylabs/object'
|
|
2
3
|
import { isAttachableModuleInstance } from '@xyo-network/module-model'
|
|
3
4
|
|
|
4
5
|
import { isNodeInstance } from '../typeChecks.ts'
|
|
5
|
-
import { AttachableNodeInstance } from './AttachableInstance.ts'
|
|
6
|
+
import type { AttachableNodeInstance } from './AttachableInstance.ts'
|
|
6
7
|
|
|
7
8
|
export const requiredAttachableNodeInstanceFunctions: ObjectTypeShape = {}
|
|
8
9
|
|
package/src/instance.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Address } from '@xylabs/hex'
|
|
2
|
-
import { AccountInstance } from '@xyo-network/account-model'
|
|
3
|
-
import { AddressPayload, AttachableModuleInstance, ModuleIdentifier, ModuleInstance, ModuleQueryResult } from '@xyo-network/module-model'
|
|
1
|
+
import type { Address } from '@xylabs/hex'
|
|
2
|
+
import type { AccountInstance } from '@xyo-network/account-model'
|
|
3
|
+
import type { AddressPayload, AttachableModuleInstance, ModuleIdentifier, ModuleInstance, ModuleQueryResult } from '@xyo-network/module-model'
|
|
4
4
|
|
|
5
|
-
import { ChildCertification, ChildCertificationFields } from './ChildCertification.ts'
|
|
6
|
-
import { NodeModule, NodeModuleEventData } from './Node.ts'
|
|
7
|
-
import { NodeParams } from './Params.ts'
|
|
5
|
+
import type { ChildCertification, ChildCertificationFields } from './ChildCertification.ts'
|
|
6
|
+
import type { NodeModule, NodeModuleEventData } from './Node.ts'
|
|
7
|
+
import type { NodeParams } from './Params.ts'
|
|
8
8
|
|
|
9
9
|
export interface NodeQueryFunctions {
|
|
10
10
|
attach: (id: ModuleIdentifier, external?: boolean) => Promise<Address | undefined>
|
package/src/typeChecks.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AsObjectFactory } from '@xylabs/object'
|
|
2
2
|
import { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'
|
|
3
3
|
|
|
4
|
-
import { NodeInstance } from './instance.ts'
|
|
5
|
-
import { NodeModule } from './Node.ts'
|
|
4
|
+
import type { NodeInstance } from './instance.ts'
|
|
5
|
+
import type { NodeModule } from './Node.ts'
|
|
6
6
|
import { NodeAttachedQuerySchema } from './Queries/index.ts'
|
|
7
7
|
|
|
8
8
|
const instanceFactory = new IsInstanceFactory<NodeInstance>()
|
package/xy.config.ts
CHANGED