@xyo-network/bridge-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/bridge-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/boundwitness-model": "~5.3.20",
40
- "@xyo-network/module-model": "~5.3.20",
41
- "@xyo-network/payload-model": "~5.3.20"
39
+ "@xyo-network/boundwitness-model": "~5.3.24",
40
+ "@xyo-network/module-model": "~5.3.24",
41
+ "@xyo-network/payload-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/payload-model": "~5.3.24",
56
+ "@xyo-network/module-model": "~5.3.24",
57
+ "@xyo-network/boundwitness-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
+ }
package/src/Config.ts DELETED
@@ -1,38 +0,0 @@
1
- import type { EmptyObject, WithAdditional } from '@xylabs/sdk-js'
2
- import type { CacheConfig, 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 BridgeConfigSchema = asSchema('network.xyo.bridge.config', true)
10
- export type BridgeConfigSchema = typeof BridgeConfigSchema
11
-
12
- export type BridgeClientConfig = {
13
- cache?: CacheConfig | true
14
- discoverRoots?: 'start' | 'lazy'
15
- maxDepth?: number
16
- }
17
-
18
- export type BridgeHostConfig = {
19
- cache?: CacheConfig | true
20
- maxDepth?: number
21
- }
22
-
23
- export type BridgeConfig<
24
- TConfig extends Payload | EmptyObject | void = void,
25
- TSchema extends Schema | void = void,
26
- TClient extends EmptyObject | void = void,
27
- THost extends EmptyObject | void = void,
28
- > = ModuleConfig<
29
- WithAdditional<
30
- {
31
- client?: WithAdditional<BridgeClientConfig, TClient>
32
- host?: WithAdditional<BridgeHostConfig, THost>
33
- schema: TConfig extends Payload ? TConfig['schema'] : BridgeConfigSchema
34
- },
35
- TConfig
36
- >,
37
- TSchema
38
- >
package/src/EventData.ts DELETED
@@ -1,19 +0,0 @@
1
- import type { ModuleEventData } from '@xyo-network/module-model'
2
-
3
- import type {
4
- ExposedEventData,
5
- QueryFulfillFinishedEventData,
6
- QueryFulfillStartedEventData,
7
- QuerySendFinishedEventData,
8
- QuerySendStartedEventData,
9
- UnexposedEventData,
10
- } from './Events/index.ts'
11
-
12
- export interface BridgeModuleEventData
13
- extends QuerySendFinishedEventData,
14
- QuerySendStartedEventData,
15
- QueryFulfillFinishedEventData,
16
- QueryFulfillStartedEventData,
17
- ExposedEventData,
18
- UnexposedEventData,
19
- ModuleEventData {}
@@ -1,16 +0,0 @@
1
- import type { EventData } from '@xylabs/sdk-js'
2
- import type {
3
- ModuleEventArgs, ModuleInstance,
4
- QueryableModule,
5
- } from '@xyo-network/module-model'
6
-
7
- export type ExposedEventArgs<T extends QueryableModule = QueryableModule> = ModuleEventArgs<
8
- T,
9
- {
10
- modules: ModuleInstance[]
11
- }
12
- >
13
-
14
- export interface ExposedEventData<T extends QueryableModule = QueryableModule> extends EventData {
15
- exposed: ExposedEventArgs<T>
16
- }
@@ -1,21 +0,0 @@
1
- import type { EventData } from '@xylabs/sdk-js'
2
- import type { QueryBoundWitness } from '@xyo-network/boundwitness-model'
3
- import type {
4
- ModuleEventArgs, ModuleQueryResult,
5
- QueryableModule,
6
- } from '@xyo-network/module-model'
7
- import type { Payload } from '@xyo-network/payload-model'
8
-
9
- export type QueryFulfillFinishedEventArgs<T extends QueryableModule = QueryableModule> = ModuleEventArgs<
10
- T,
11
- {
12
- payloads?: Payload[]
13
- query: QueryBoundWitness
14
- result?: ModuleQueryResult
15
- status: 'success' | 'failure'
16
- }
17
- >
18
-
19
- export interface QueryFulfillFinishedEventData<T extends QueryableModule = QueryableModule> extends EventData {
20
- queryFulfillFinished: QueryFulfillFinishedEventArgs<T>
21
- }
@@ -1,16 +0,0 @@
1
- import type { EventData } from '@xylabs/sdk-js'
2
- import type { QueryBoundWitness } from '@xyo-network/boundwitness-model'
3
- import type { ModuleEventArgs, QueryableModule } from '@xyo-network/module-model'
4
- import type { Payload } from '@xyo-network/payload-model'
5
-
6
- export type QueryFulfillStartedEventArgs<T extends QueryableModule = QueryableModule> = ModuleEventArgs<
7
- T,
8
- {
9
- payloads?: Payload[]
10
- query: QueryBoundWitness
11
- }
12
- >
13
-
14
- export interface QueryFulfillStartedEventData<T extends QueryableModule = QueryableModule> extends EventData {
15
- queryFulfillStarted: QueryFulfillStartedEventArgs<T>
16
- }
@@ -1,21 +0,0 @@
1
- import type { EventData } from '@xylabs/sdk-js'
2
- import type { QueryBoundWitness } from '@xyo-network/boundwitness-model'
3
- import type {
4
- ModuleEventArgs, ModuleQueryResult,
5
- QueryableModule,
6
- } from '@xyo-network/module-model'
7
- import type { Payload } from '@xyo-network/payload-model'
8
-
9
- export type QuerySendFinishedEventArgs<T extends QueryableModule = QueryableModule> = ModuleEventArgs<
10
- T,
11
- {
12
- payloads?: Payload[]
13
- query: QueryBoundWitness
14
- result?: ModuleQueryResult
15
- status: 'success' | 'failure'
16
- }
17
- >
18
-
19
- export interface QuerySendFinishedEventData<T extends QueryableModule = QueryableModule> extends EventData {
20
- querySendFinished: QuerySendFinishedEventArgs<T>
21
- }
@@ -1,16 +0,0 @@
1
- import type { EventData } from '@xylabs/sdk-js'
2
- import type { QueryBoundWitness } from '@xyo-network/boundwitness-model'
3
- import type { ModuleEventArgs, QueryableModule } from '@xyo-network/module-model'
4
- import type { Payload } from '@xyo-network/payload-model'
5
-
6
- export type QuerySendStartedEventArgs<T extends QueryableModule = QueryableModule> = ModuleEventArgs<
7
- T,
8
- {
9
- payloads?: Payload[]
10
- query: QueryBoundWitness
11
- }
12
- >
13
-
14
- export interface QuerySendStartedEventData<T extends QueryableModule = QueryableModule> extends EventData {
15
- querySendStarted: QuerySendStartedEventArgs<T>
16
- }
@@ -1,16 +0,0 @@
1
- import type { EventData } from '@xylabs/sdk-js'
2
- import type {
3
- ModuleEventArgs, ModuleInstance,
4
- QueryableModule,
5
- } from '@xyo-network/module-model'
6
-
7
- export type UnexposedEventArgs<T extends QueryableModule = QueryableModule> = ModuleEventArgs<
8
- T,
9
- {
10
- modules: ModuleInstance[]
11
- }
12
- >
13
-
14
- export interface UnexposedEventData<T extends QueryableModule = QueryableModule> extends EventData {
15
- unexposed: UnexposedEventArgs<T>
16
- }
@@ -1,6 +0,0 @@
1
- export * from './Exposed.ts'
2
- export * from './QueryFulfillFinished.ts'
3
- export * from './QueryFulfillStarted.ts'
4
- export * from './QuerySendFinished.ts'
5
- export * from './QuerySendStarted.ts'
6
- export * from './Unexposed.ts'
package/src/Instance.ts DELETED
@@ -1,14 +0,0 @@
1
- import type { Address, Promisable } from '@xylabs/sdk-js'
2
- import type { ModuleInstance } from '@xyo-network/module-model'
3
-
4
- import type { BridgeModuleEventData } from './EventData.ts'
5
- import type { BridgeModule } from './Module.ts'
6
- import type { BridgeParams } from './Params.ts'
7
- import type { BridgeQueryFunctions } from './QueryFunctions.ts'
8
-
9
- export interface BridgeInstance<TParams extends BridgeParams = BridgeParams, TEventData extends BridgeModuleEventData = BridgeModuleEventData>
10
- extends BridgeModule<TParams, TEventData>,
11
- BridgeQueryFunctions,
12
- ModuleInstance<TParams, TEventData> {
13
- exposed?: () => Promisable<Address[]>
14
- }
package/src/Module.ts DELETED
@@ -1,7 +0,0 @@
1
- import type { QueryableModule } from '@xyo-network/module-model'
2
-
3
- import type { BridgeModuleEventData } from './EventData.ts'
4
- import type { BridgeParams } from './Params.ts'
5
-
6
- export interface BridgeModule<TParams extends BridgeParams = BridgeParams, TEventData extends BridgeModuleEventData = BridgeModuleEventData>
7
- extends QueryableModule<TParams, TEventData> {}
package/src/Params.ts DELETED
@@ -1,12 +0,0 @@
1
- import type {
2
- AnyConfigSchema, ModuleResolverInstance,
3
- QueryableModuleParams,
4
- } from '@xyo-network/module-model'
5
-
6
- import type { BridgeConfig } from './Config.ts'
7
-
8
- export interface BridgeParams<TConfig extends AnyConfigSchema<BridgeConfig> = AnyConfigSchema<BridgeConfig>>
9
- extends QueryableModuleParams<TConfig>,
10
- QueryableModuleParams<TConfig> {
11
- resolver?: ModuleResolverInstance
12
- }
@@ -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 BridgeConnectQuerySchema = asSchema('network.xyo.query.bridge.connect', true)
5
- export type BridgeConnectQuerySchema = typeof BridgeConnectQuerySchema
6
-
7
- export type BridgeConnectQuery = Query<{
8
- id?: ModuleIdentifier
9
- maxDepth?: number
10
- schema: BridgeConnectQuerySchema
11
- }>
@@ -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 BridgeDisconnectQuerySchema = asSchema('network.xyo.query.bridge.disconnect', true)
5
- export type BridgeDisconnectQuerySchema = typeof BridgeDisconnectQuerySchema
6
-
7
- export type BridgeDisconnectQuery = Query<{
8
- id?: ModuleIdentifier
9
- maxDepth?: number
10
- schema: BridgeDisconnectQuerySchema
11
- }>
@@ -1,19 +0,0 @@
1
- import type { ModuleIdentifier } from '@xyo-network/module-model'
2
- import {
3
- asSchema, type Payload, type Query,
4
- } from '@xyo-network/payload-model'
5
-
6
- export const BridgeExposeQuerySchema = asSchema('network.xyo.query.bridge.expose', true)
7
- export type BridgeExposeQuerySchema = typeof BridgeExposeQuerySchema
8
-
9
- export interface BridgeExposeOptions {
10
- maxDepth?: number
11
- required?: boolean
12
- }
13
-
14
- export const ModuleFilterPayloadSchema = asSchema('network.xyo.module.filter', true)
15
- export type ModuleFilterPayloadSchema = typeof ModuleFilterPayloadSchema
16
-
17
- export type ModuleFilterPayload = Payload<{ id: ModuleIdentifier } & BridgeExposeOptions, ModuleFilterPayloadSchema>
18
-
19
- export type BridgeExposeQuery = Query<void, BridgeExposeQuerySchema>
@@ -1,10 +0,0 @@
1
- import { asSchema, type Query } from '@xyo-network/payload-model'
2
-
3
- import type { BridgeExposeOptions } from './Expose.ts'
4
-
5
- export const BridgeUnexposeQuerySchema = asSchema('network.xyo.query.bridge.unexpose', true)
6
- export type BridgeUnexposeQuerySchema = typeof BridgeUnexposeQuerySchema
7
-
8
- export interface BridgeUnexposeOptions extends BridgeExposeOptions {}
9
-
10
- export type BridgeUnexposeQuery = Query<void, BridgeUnexposeQuerySchema>
@@ -1,14 +0,0 @@
1
- import type { ModuleQueries } from '@xyo-network/module-model'
2
-
3
- import type { BridgeConnectQuery } from './Connect.ts'
4
- import type { BridgeDisconnectQuery } from './Disconnect.ts'
5
- import type { BridgeExposeQuery } from './Expose.ts'
6
- import type { BridgeUnexposeQuery } from './Unexpose.ts'
7
-
8
- export * from './Connect.ts'
9
- export * from './Disconnect.ts'
10
- export * from './Expose.ts'
11
- export * from './Unexpose.ts'
12
-
13
- export type BridgeQueries = BridgeConnectQuery | BridgeDisconnectQuery | BridgeExposeQuery | BridgeUnexposeQuery
14
- export type BridgeModuleQueries = ModuleQueries | BridgeQueries
@@ -1,11 +0,0 @@
1
- import type { Address, Promisable } from '@xylabs/sdk-js'
2
- import type { ModuleIdentifier, ModuleInstance } from '@xyo-network/module-model'
3
-
4
- import type { BridgeExposeOptions, BridgeUnexposeOptions } from './Queries/index.ts'
5
-
6
- export interface BridgeQueryFunctions {
7
- connect?: (id: ModuleIdentifier, maxDepth?: number) => Promisable<Address | undefined>
8
- disconnect?: (id: ModuleIdentifier, maxDepth?: number) => Promisable<Address | undefined>
9
- expose: (id: ModuleIdentifier, options?: BridgeExposeOptions) => Promisable<ModuleInstance[]>
10
- unexpose?: (id: ModuleIdentifier, options?: BridgeUnexposeOptions) => Promisable<Address[]>
11
- }
@@ -1,11 +0,0 @@
1
- import type { Promisable } from '@xylabs/sdk-js'
2
- import type { ModuleIdentifier, ModuleQueryResult } from '@xyo-network/module-model'
3
-
4
- import type { BridgeExposeOptions, BridgeUnexposeOptions } from './Queries/index.ts'
5
-
6
- export interface BridgeRawQueryFunctions {
7
- connectQuery?: (id: ModuleIdentifier, maxDepth?: number) => Promisable<ModuleQueryResult>
8
- disconnectQuery?: (id: ModuleIdentifier, maxDepth?: number) => Promisable<ModuleQueryResult>
9
- exposeQuery: (id: ModuleIdentifier, options?: BridgeExposeOptions) => Promisable<ModuleQueryResult>
10
- unexposeQuery?: (id: ModuleIdentifier, options?: BridgeUnexposeOptions) => Promisable<ModuleQueryResult>
11
- }
@@ -1,19 +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 { BridgeModuleEventData } from '../EventData.ts'
6
- import type { BridgeInstance } from '../Instance.ts'
7
- import type { BridgeModule } from '../Module.ts'
8
- import type { BridgeParams } from '../Params.ts'
9
-
10
- export interface AttachableBridgeInstance<
11
- TParams extends BridgeParams = BridgeParams,
12
- TEventData extends BridgeModuleEventData = BridgeModuleEventData,
13
- > extends BridgeModule<TParams, TEventData>,
14
- AttachableModuleInstance<TParams, TEventData>,
15
- BridgeInstance<TParams, TEventData> {}
16
-
17
- export type AttachableBridgeInstanceTypeCheck<T extends AttachableBridgeInstance = AttachableBridgeInstance> = TypeCheck<T>
18
-
19
- export class IsAttachableBridgeInstanceFactory<T extends AttachableBridgeInstance = AttachableBridgeInstance> extends IsObjectFactory<T> {}
@@ -1,5 +0,0 @@
1
- import { AsObjectFactory } from '@xylabs/sdk-js'
2
-
3
- import { isAttachableBridgeInstance } from './isAttachableInstance.ts'
4
-
5
- export const asAttachableBridgeInstance = AsObjectFactory.create(isAttachableBridgeInstance)
@@ -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 { isBridgeInstance } from '../typeChecks.ts'
6
- import type { AttachableBridgeInstance } from './AttachableInstance.ts'
7
-
8
- export const requiredAttachableBridgeInstanceFunctions: ObjectTypeShape = {}
9
-
10
- // we do not use IsInstanceFactory here to prevent a cycle
11
- const factory = new IsObjectFactory<AttachableBridgeInstance>()
12
-
13
- export const isAttachableBridgeInstance: TypeCheck<AttachableBridgeInstance> = factory.create(requiredAttachableBridgeInstanceFunctions, [
14
- isBridgeInstance,
15
- isAttachableModuleInstance,
16
- ])
package/src/index.ts DELETED
@@ -1,11 +0,0 @@
1
- export * from './attachable/index.ts'
2
- export * from './Config.ts'
3
- export * from './EventData.ts'
4
- export * from './Events/index.ts'
5
- export * from './Instance.ts'
6
- export * from './Module.ts'
7
- export * from './Params.ts'
8
- export * from './Queries/index.ts'
9
- export * from './QueryFunctions.ts'
10
- export * from './RawQueryFunctions.ts'
11
- export * from './typeChecks.ts'
package/src/typeChecks.ts DELETED
@@ -1,25 +0,0 @@
1
- import { AsObjectFactory } from '@xylabs/sdk-js'
2
- import {
3
- // eslint-disable-next-line sonarjs/deprecation
4
- IsInstanceFactory, isModuleInstance, IsQueryableModuleFactory, WithFactory,
5
- } from '@xyo-network/module-model'
6
-
7
- import type { BridgeInstance } from './Instance.ts'
8
- import type { BridgeModule } from './Module.ts'
9
- import { BridgeConnectQuerySchema, BridgeDisconnectQuerySchema } from './Queries/index.ts'
10
-
11
- export const isBridgeInstance = new IsInstanceFactory<BridgeInstance>().create(
12
- { expose: 'function' },
13
- [isModuleInstance],
14
- )
15
- export const isBridgeModule = new IsQueryableModuleFactory<BridgeModule>().create([BridgeConnectQuerySchema, BridgeDisconnectQuerySchema])
16
-
17
- export const asBridgeModule = AsObjectFactory.create(isBridgeModule)
18
- export const asBridgeInstance = AsObjectFactory.create(isBridgeInstance)
19
-
20
- /** @deprecated use narrowing instead [ if(is) ] */
21
- // eslint-disable-next-line sonarjs/deprecation, @typescript-eslint/no-deprecated
22
- export const withBridgeModule = WithFactory.create(isBridgeModule)
23
- /** @deprecated use narrowing instead [ if(is) ] */
24
- // eslint-disable-next-line sonarjs/deprecation, @typescript-eslint/no-deprecated
25
- export const withBridgeInstance = WithFactory.create(isBridgeInstance)