@xyo-network/node-model 5.3.20 → 5.3.24

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/node-model",
3
- "version": "5.3.20",
3
+ "version": "5.3.24",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -30,23 +30,31 @@
30
30
  "types": "dist/neutral/index.d.ts",
31
31
  "files": [
32
32
  "dist",
33
- "src",
34
33
  "!**/*.bench.*",
35
34
  "!**/*.spec.*",
36
- "!**/*.test.*"
35
+ "!**/*.test.*",
36
+ "README.md"
37
37
  ],
38
38
  "dependencies": {
39
- "@xyo-network/account-model": "~5.3.20",
40
- "@xyo-network/module-model": "~5.3.20",
41
- "@xyo-network/payload-model": "~5.3.20"
39
+ "@xyo-network/module-model": "~5.3.24",
40
+ "@xyo-network/payload-model": "~5.3.24",
41
+ "@xyo-network/account-model": "~5.3.24"
42
42
  },
43
43
  "devDependencies": {
44
- "@xylabs/sdk-js": "^5.0.90",
45
- "@xylabs/ts-scripts-common": "~7.5.6",
46
- "@xylabs/ts-scripts-yarn3": "~7.5.6",
47
- "@xylabs/tsconfig": "~7.5.6",
44
+ "@opentelemetry/api": "^1.9.1",
45
+ "@types/node": "^25.5.0",
46
+ "@xylabs/sdk-js": "^5.0.93",
47
+ "@xylabs/ts-scripts-common": "~7.6.16",
48
+ "@xylabs/ts-scripts-pnpm": "~7.6.16",
49
+ "@xylabs/tsconfig": "~7.6.16",
50
+ "acorn": "^8.16.0",
51
+ "axios": "^1.14.0",
52
+ "esbuild": "^0.28.0",
48
53
  "typescript": "~5.9.3",
49
- "zod": "^4.3.6"
54
+ "zod": "^4.3.6",
55
+ "@xyo-network/account-model": "~5.3.24",
56
+ "@xyo-network/module-model": "~5.3.24",
57
+ "@xyo-network/payload-model": "~5.3.24"
50
58
  },
51
59
  "peerDependencies": {
52
60
  "@xylabs/sdk-js": "^5",
@@ -55,4 +63,4 @@
55
63
  "publishConfig": {
56
64
  "access": "public"
57
65
  }
58
- }
66
+ }
@@ -1,12 +0,0 @@
1
- import type { Address } from '@xylabs/sdk-js'
2
- import { asSchema, type Payload } from '@xyo-network/payload-model'
3
-
4
- export const ChildCertificationSchema = asSchema('network.xyo.child.certification', true)
5
- export type ChildCertificationSchema = typeof ChildCertificationSchema
6
-
7
- export interface ChildCertificationFields {
8
- address: Address
9
- expiration: number
10
- }
11
-
12
- export type ChildCertification = Payload<ChildCertificationFields, ChildCertificationSchema>
package/src/Config.ts DELETED
@@ -1,24 +0,0 @@
1
- import type { EmptyObject, WithAdditional } from '@xylabs/sdk-js'
2
- import type { ModuleConfig } from '@xyo-network/module-model'
3
- import type {
4
- Payload,
5
- Schema,
6
- } from '@xyo-network/payload-model'
7
- import { asSchema } from '@xyo-network/payload-model'
8
-
9
- export const NodeConfigSchema = asSchema('network.xyo.node.config', true)
10
- export type NodeConfigSchema = typeof NodeConfigSchema
11
-
12
- export type NodeConfig<TConfig extends EmptyObject | Payload | void = void, TSchema extends Schema | void = void> = ModuleConfig<
13
- WithAdditional<
14
- {
15
- archivist?: string
16
- },
17
- TConfig
18
- >,
19
- TSchema extends void
20
- ? TConfig extends Payload
21
- ? TConfig['schema']
22
- : NodeConfigSchema
23
- : TSchema
24
- >
@@ -1,8 +0,0 @@
1
- import type { EventData } from '@xylabs/sdk-js'
2
- import type { ModuleEventArgs, QueryableModule } from '@xyo-network/module-model'
3
-
4
- export type ModuleAttachedEventArgs<TModule extends QueryableModule = QueryableModule> = ModuleEventArgs<TModule>
5
-
6
- export interface ModuleAttachedEventData extends EventData {
7
- moduleAttached: ModuleAttachedEventArgs
8
- }
@@ -1,8 +0,0 @@
1
- import type { EventData } from '@xylabs/sdk-js'
2
- import type { ModuleEventArgs, QueryableModule } from '@xyo-network/module-model'
3
-
4
- export type ModuleDetachedEventArgs<TModule extends QueryableModule = QueryableModule> = ModuleEventArgs<TModule>
5
-
6
- export interface ModuleDetachedEventData extends EventData {
7
- moduleDetached: ModuleDetachedEventArgs
8
- }
@@ -1,8 +0,0 @@
1
- import type { EventData } from '@xylabs/sdk-js'
2
- import type { ModuleEventArgs, QueryableModule } from '@xyo-network/module-model'
3
-
4
- export type ModuleRegisteredEventArgs<TModule extends QueryableModule = QueryableModule> = ModuleEventArgs<TModule>
5
-
6
- export interface ModuleRegisteredEventData extends EventData {
7
- moduleRegistered: ModuleRegisteredEventArgs
8
- }
@@ -1,8 +0,0 @@
1
- import type { EventData } from '@xylabs/sdk-js'
2
- import type { ModuleEventArgs, QueryableModule } from '@xyo-network/module-model'
3
-
4
- export type ModuleUnregisteredEventArgs<TModule extends QueryableModule = QueryableModule> = ModuleEventArgs<TModule>
5
-
6
- export interface ModuleUnregisteredEventData extends EventData {
7
- moduleUnregistered: ModuleUnregisteredEventArgs
8
- }
@@ -1,4 +0,0 @@
1
- export * from './ModuleAttached.ts'
2
- export * from './ModuleDetached.ts'
3
- export * from './ModuleRegistered.ts'
4
- export * from './ModuleUnregistered.ts'
package/src/Node.ts DELETED
@@ -1,16 +0,0 @@
1
- import type { ModuleEventData, QueryableModule } from '@xyo-network/module-model'
2
-
3
- import type {
4
- ModuleAttachedEventData, ModuleDetachedEventData, ModuleRegisteredEventData, ModuleUnregisteredEventData,
5
- } from './EventsModels/index.ts'
6
- import type { NodeParams } from './Params.ts'
7
-
8
- export interface NodeModuleEventData
9
- extends ModuleAttachedEventData,
10
- ModuleDetachedEventData,
11
- ModuleRegisteredEventData,
12
- ModuleUnregisteredEventData,
13
- ModuleEventData {}
14
-
15
- export interface NodeModule<TParams extends NodeParams = NodeParams, TEventData extends NodeModuleEventData = NodeModuleEventData>
16
- extends QueryableModule<TParams, TEventData> {}
package/src/Params.ts DELETED
@@ -1,13 +0,0 @@
1
- import type {
2
- AnyConfigSchema, ModuleInstanceParams, QueryableModuleParams,
3
- } from '@xyo-network/module-model'
4
-
5
- import type { NodeConfig } from './Config.ts'
6
-
7
- export interface NodeParams<
8
- TConfig extends AnyConfigSchema<NodeConfig> = AnyConfigSchema<NodeConfig>,
9
- > extends QueryableModuleParams<TConfig> {}
10
-
11
- export interface NodeInstanceParams<
12
- TConfig extends AnyConfigSchema<NodeConfig> = AnyConfigSchema<NodeConfig>,
13
- > extends ModuleInstanceParams<TConfig> {}
@@ -1,11 +0,0 @@
1
- import type { ModuleIdentifier } from '@xyo-network/module-model'
2
- import { asSchema, type Query } from '@xyo-network/payload-model'
3
-
4
- export const NodeAttachQuerySchema = asSchema('network.xyo.query.node.attach', true)
5
- export type NodeAttachQuerySchema = typeof NodeAttachQuerySchema
6
-
7
- export type NodeAttachQuery = Query<{
8
- external?: boolean
9
- id: ModuleIdentifier
10
- schema: NodeAttachQuerySchema
11
- }>
@@ -1,8 +0,0 @@
1
- import { asSchema, type Query } from '@xyo-network/payload-model'
2
-
3
- export const NodeAttachedQuerySchema = asSchema('network.xyo.query.node.attached', true)
4
- export type NodeAttachedQuerySchema = typeof NodeAttachedQuerySchema
5
-
6
- export type NodeAttachedQuery = Query<{
7
- schema: NodeAttachedQuerySchema
8
- }>
@@ -1,10 +0,0 @@
1
- import type { ModuleIdentifier } from '@xyo-network/module-model'
2
- import { asSchema, type Query } from '@xyo-network/payload-model'
3
-
4
- export const NodeCertifyQuerySchema = asSchema('network.xyo.query.node.certify', true)
5
- export type NodeCertifyQuerySchema = typeof NodeCertifyQuerySchema
6
-
7
- export type NodeCertifyQuery = Query<{
8
- id: ModuleIdentifier
9
- schema: NodeCertifyQuerySchema
10
- }>
@@ -1,10 +0,0 @@
1
- import type { ModuleIdentifier } from '@xyo-network/module-model'
2
- import { asSchema, type Query } from '@xyo-network/payload-model'
3
-
4
- export const NodeDetachQuerySchema = asSchema('network.xyo.query.node.detach', true)
5
- export type NodeDetachQuerySchema = typeof NodeDetachQuerySchema
6
-
7
- export type NodeDetachQuery = Query<{
8
- id: ModuleIdentifier
9
- schema: NodeDetachQuerySchema
10
- }>
@@ -1,8 +0,0 @@
1
- import { asSchema, type Query } from '@xyo-network/payload-model'
2
-
3
- export const NodeRegisteredQuerySchema = asSchema('network.xyo.query.node.registered', true)
4
- export type NodeRegisteredQuerySchema = typeof NodeRegisteredQuerySchema
5
-
6
- export type NodeRegisteredQuery = Query<{
7
- schema: NodeRegisteredQuerySchema
8
- }>
@@ -1,16 +0,0 @@
1
- import type { ModuleQueries } from '@xyo-network/module-model'
2
-
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
-
9
- export * from './Attach.ts'
10
- export * from './Attached.ts'
11
- export * from './Certify.ts'
12
- export * from './Detach.ts'
13
- export * from './Registered.ts'
14
-
15
- export type NodeQueries = NodeAttachQuery | NodeCertifyQuery | NodeDetachQuery | NodeAttachedQuery | NodeRegisteredQuery
16
- export type NodeModuleQueries = ModuleQueries | NodeQueries
@@ -1,16 +0,0 @@
1
- import type { TypeCheck } from '@xylabs/sdk-js'
2
- import { IsObjectFactory } from '@xylabs/sdk-js'
3
- import type { AttachableModuleInstance } from '@xyo-network/module-model'
4
-
5
- import type { NodeInstance } from '../instance.ts'
6
- import type { NodeModule, NodeModuleEventData } from '../Node.ts'
7
- import type { NodeParams } from '../Params.ts'
8
-
9
- export interface AttachableNodeInstance<TParams extends NodeParams = NodeParams, TEventData extends NodeModuleEventData = NodeModuleEventData>
10
- extends NodeModule<TParams, TEventData>,
11
- AttachableModuleInstance<TParams, TEventData>,
12
- NodeInstance<TParams, TEventData> {}
13
-
14
- export type AttachableNodeInstanceTypeCheck<T extends AttachableNodeInstance = AttachableNodeInstance> = TypeCheck<T>
15
-
16
- export class IsAttachableNodeInstanceFactory<T extends AttachableNodeInstance = AttachableNodeInstance> extends IsObjectFactory<T> {}
@@ -1,5 +0,0 @@
1
- import { AsObjectFactory } from '@xylabs/sdk-js'
2
-
3
- import { isAttachableNodeInstance } from './isAttachableInstance.ts'
4
-
5
- export const asAttachableNodeInstance = AsObjectFactory.create(isAttachableNodeInstance)
@@ -1,3 +0,0 @@
1
- export * from './asAttachableInstance.ts'
2
- export * from './AttachableInstance.ts'
3
- export * from './isAttachableInstance.ts'
@@ -1,16 +0,0 @@
1
- import type { ObjectTypeShape, TypeCheck } from '@xylabs/sdk-js'
2
- import { IsObjectFactory } from '@xylabs/sdk-js'
3
- import { isAttachableModuleInstance } from '@xyo-network/module-model'
4
-
5
- import { isNodeInstance } from '../typeChecks.ts'
6
- import type { AttachableNodeInstance } from './AttachableInstance.ts'
7
-
8
- export const requiredAttachableNodeInstanceFunctions: ObjectTypeShape = {}
9
-
10
- // we do not use IsInstanceFactory here to prevent a cycle
11
- const factory = new IsObjectFactory<AttachableNodeInstance>()
12
-
13
- export const isAttachableNodeInstance: TypeCheck<AttachableNodeInstance> = factory.create(requiredAttachableNodeInstanceFunctions, [
14
- isNodeInstance,
15
- isAttachableModuleInstance,
16
- ])
package/src/index.ts DELETED
@@ -1,9 +0,0 @@
1
- export * from './attachable/index.ts'
2
- export * from './ChildCertification.ts'
3
- export * from './Config.ts'
4
- export * from './EventsModels/index.ts'
5
- export * from './instance.ts'
6
- export * from './Node.ts'
7
- export * from './Params.ts'
8
- export * from './Queries/index.ts'
9
- export * from './typeChecks.ts'
package/src/instance.ts DELETED
@@ -1,34 +0,0 @@
1
- import type { Address } from '@xylabs/sdk-js'
2
- import type { AccountInstance } from '@xyo-network/account-model'
3
- import type {
4
- AddressPayload, AttachableModuleInstance, ModuleIdentifier, ModuleInstance, ModuleQueryResult,
5
- } from '@xyo-network/module-model'
6
-
7
- import type { ChildCertification, ChildCertificationFields } from './ChildCertification.ts'
8
- import type { NodeModule, NodeModuleEventData } from './Node.ts'
9
- import type { NodeParams } from './Params.ts'
10
-
11
- export interface NodeQueryFunctions {
12
- attach: (id: ModuleIdentifier, external?: boolean) => Promise<Address | undefined>
13
- attachQuery: (id: ModuleIdentifier, external?: boolean, account?: AccountInstance) => Promise<ModuleQueryResult<AddressPayload>>
14
- attached: () => Promise<Address[]>
15
- attachedQuery: (account?: AccountInstance) => Promise<ModuleQueryResult<AddressPayload>>
16
- certify: (id: ModuleIdentifier) => Promise<ChildCertificationFields | undefined>
17
- certifyQuery: (id: ModuleIdentifier, account?: AccountInstance) => Promise<ModuleQueryResult<ChildCertification>>
18
- detach: (id: ModuleIdentifier) => Promise<Address | undefined>
19
- detachQuery: (id: ModuleIdentifier, account?: AccountInstance) => Promise<ModuleQueryResult<AddressPayload>>
20
- registered: () => Promise<Address[]>
21
- registeredQuery: (account?: AccountInstance) => Promise<ModuleQueryResult<AddressPayload>>
22
- }
23
-
24
- export interface NodeRegistrationFunctions {
25
- register?: (mod: AttachableModuleInstance) => Promise<void>
26
- registeredModules?: () => AttachableModuleInstance[]
27
- unregister?: (mod: ModuleInstance) => Promise<ModuleInstance>
28
- }
29
-
30
- export interface NodeInstance<TParams extends NodeParams = NodeParams, TEventData extends NodeModuleEventData = NodeModuleEventData>
31
- extends NodeModule<TParams, TEventData>,
32
- NodeQueryFunctions,
33
- NodeRegistrationFunctions,
34
- ModuleInstance<TParams, TEventData> {}
package/src/typeChecks.ts DELETED
@@ -1,35 +0,0 @@
1
- import type { TypeCheck } from '@xylabs/sdk-js'
2
- import { AsObjectFactory } from '@xylabs/sdk-js'
3
- import {
4
- // eslint-disable-next-line sonarjs/deprecation
5
- IsInstanceFactory, isModuleInstance, IsQueryableModuleFactory, WithFactory,
6
- } from '@xyo-network/module-model'
7
-
8
- import type { NodeInstance } from './instance.ts'
9
- import type { NodeModule } from './Node.ts'
10
- import { NodeAttachedQuerySchema } from './Queries/index.ts'
11
-
12
- const instanceFactory = new IsInstanceFactory<NodeInstance>()
13
-
14
- export const isNodeInstance: TypeCheck<NodeInstance> = instanceFactory.create(
15
- {
16
- attach: 'function',
17
- attached: 'function',
18
- certify: 'function',
19
- detach: 'function',
20
- registered: 'function',
21
- },
22
- [isModuleInstance],
23
- )
24
-
25
- export const isNodeModule: TypeCheck<NodeModule> = new IsQueryableModuleFactory<NodeModule>().create([NodeAttachedQuerySchema])
26
-
27
- export const asNodeModule = AsObjectFactory.create(isNodeModule)
28
- export const asNodeInstance = AsObjectFactory.create(isNodeInstance)
29
-
30
- /** @deprecated use narrowing instead [ if(is) ] */
31
- // eslint-disable-next-line sonarjs/deprecation, @typescript-eslint/no-deprecated
32
- export const withNodeModule = WithFactory.create(isNodeModule)
33
- /** @deprecated use narrowing instead [ if(is) ] */
34
- // eslint-disable-next-line sonarjs/deprecation, @typescript-eslint/no-deprecated
35
- export const withNodeInstance = WithFactory.create(isNodeInstance)