@xyo-network/bridge-model 3.6.8 → 3.6.10
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 +11 -16
- package/dist/neutral/index.mjs.map +1 -1
- package/package.json +10 -10
package/dist/neutral/index.mjs
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
1
|
// src/attachable/asAttachableInstance.ts
|
|
5
2
|
import { AsObjectFactory as AsObjectFactory2 } from "@xylabs/object";
|
|
6
3
|
|
|
@@ -10,7 +7,12 @@ import { isAttachableModuleInstance } from "@xyo-network/module-model";
|
|
|
10
7
|
|
|
11
8
|
// src/typeChecks.ts
|
|
12
9
|
import { AsObjectFactory } from "@xylabs/object";
|
|
13
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
IsInstanceFactory,
|
|
12
|
+
IsModuleFactory,
|
|
13
|
+
isModuleInstance,
|
|
14
|
+
WithFactory
|
|
15
|
+
} from "@xyo-network/module-model";
|
|
14
16
|
|
|
15
17
|
// src/Queries/Connect.ts
|
|
16
18
|
var BridgeConnectQuerySchema = "network.xyo.query.bridge.connect";
|
|
@@ -26,15 +28,11 @@ var ModuleFilterPayloadSchema = "network.xyo.module.filter";
|
|
|
26
28
|
var BridgeUnexposeQuerySchema = "network.xyo.query.bridge.unexpose";
|
|
27
29
|
|
|
28
30
|
// src/typeChecks.ts
|
|
29
|
-
var isBridgeInstance = new IsInstanceFactory().create(
|
|
30
|
-
expose: "function"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
]);
|
|
34
|
-
var isBridgeModule = new IsModuleFactory().create([
|
|
35
|
-
BridgeConnectQuerySchema,
|
|
36
|
-
BridgeDisconnectQuerySchema
|
|
37
|
-
]);
|
|
31
|
+
var isBridgeInstance = new IsInstanceFactory().create(
|
|
32
|
+
{ expose: "function" },
|
|
33
|
+
[isModuleInstance]
|
|
34
|
+
);
|
|
35
|
+
var isBridgeModule = new IsModuleFactory().create([BridgeConnectQuerySchema, BridgeDisconnectQuerySchema]);
|
|
38
36
|
var asBridgeModule = AsObjectFactory.create(isBridgeModule);
|
|
39
37
|
var asBridgeInstance = AsObjectFactory.create(isBridgeInstance);
|
|
40
38
|
var withBridgeModule = WithFactory.create(isBridgeModule);
|
|
@@ -54,9 +52,6 @@ var asAttachableBridgeInstance = AsObjectFactory2.create(isAttachableBridgeInsta
|
|
|
54
52
|
// src/attachable/AttachableInstance.ts
|
|
55
53
|
import { IsObjectFactory as IsObjectFactory2 } from "@xylabs/object";
|
|
56
54
|
var IsAttachableBridgeInstanceFactory = class extends IsObjectFactory2 {
|
|
57
|
-
static {
|
|
58
|
-
__name(this, "IsAttachableBridgeInstanceFactory");
|
|
59
|
-
}
|
|
60
55
|
};
|
|
61
56
|
|
|
62
57
|
// src/Config.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/attachable/asAttachableInstance.ts","../../src/attachable/isAttachableInstance.ts","../../src/typeChecks.ts","../../src/Queries/Connect.ts","../../src/Queries/Disconnect.ts","../../src/Queries/Expose.ts","../../src/Queries/Unexpose.ts","../../src/attachable/AttachableInstance.ts","../../src/Config.ts"],"sourcesContent":["import { AsObjectFactory } from '@xylabs/object'\n\nimport { isAttachableBridgeInstance } from './isAttachableInstance.ts'\n\nexport const asAttachableBridgeInstance = AsObjectFactory.create(isAttachableBridgeInstance)\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 { isBridgeInstance } from '../typeChecks.ts'\nimport type { AttachableBridgeInstance } from './AttachableInstance.ts'\n\nexport const requiredAttachableBridgeInstanceFunctions: ObjectTypeShape = {}\n\n// we do not use IsInstanceFactory here to prevent a cycle\nconst factory = new IsObjectFactory<AttachableBridgeInstance>()\n\nexport const isAttachableBridgeInstance: TypeCheck<AttachableBridgeInstance> = factory.create(requiredAttachableBridgeInstanceFunctions, [\n isBridgeInstance,\n isAttachableModuleInstance,\n])\n","import { AsObjectFactory } from '@xylabs/object'\nimport {\n IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory,\n} from '@xyo-network/module-model'\n\nimport type { BridgeInstance } from './Instance.ts'\nimport type { BridgeModule } from './Module.ts'\nimport { BridgeConnectQuerySchema, BridgeDisconnectQuerySchema } from './Queries/index.ts'\n\nexport const isBridgeInstance = new IsInstanceFactory<BridgeInstance>().create(\n { expose: 'function' },\n [isModuleInstance],\n)\nexport const isBridgeModule = new IsModuleFactory<BridgeModule>().create([BridgeConnectQuerySchema, BridgeDisconnectQuerySchema])\n\nexport const asBridgeModule = AsObjectFactory.create(isBridgeModule)\nexport const asBridgeInstance = AsObjectFactory.create(isBridgeInstance)\nexport const withBridgeModule = WithFactory.create(isBridgeModule)\nexport const withBridgeInstance = WithFactory.create(isBridgeInstance)\n","import type { ModuleIdentifier } from '@xyo-network/module-model'\nimport type { Query } from '@xyo-network/payload-model'\n\nexport const BridgeConnectQuerySchema = 'network.xyo.query.bridge.connect' as const\nexport type BridgeConnectQuerySchema = typeof BridgeConnectQuerySchema\n\nexport type BridgeConnectQuery = Query<{\n id?: ModuleIdentifier\n maxDepth?: number\n schema: BridgeConnectQuerySchema\n}>\n","import type { ModuleIdentifier } from '@xyo-network/module-model'\nimport type { Query } from '@xyo-network/payload-model'\n\nexport type BridgeDisconnectQuerySchema = 'network.xyo.query.bridge.disconnect'\nexport const BridgeDisconnectQuerySchema: BridgeDisconnectQuerySchema = 'network.xyo.query.bridge.disconnect'\n\nexport type BridgeDisconnectQuery = Query<{\n id?: ModuleIdentifier\n maxDepth?: number\n schema: BridgeDisconnectQuerySchema\n}>\n","import type { ModuleIdentifier } from '@xyo-network/module-model'\nimport type { Payload, Query } from '@xyo-network/payload-model'\n\nexport const BridgeExposeQuerySchema = 'network.xyo.query.bridge.expose' as const\nexport type BridgeExposeQuerySchema = typeof BridgeExposeQuerySchema\n\nexport interface BridgeExposeOptions {\n maxDepth?: number\n required?: boolean\n}\n\nexport const ModuleFilterPayloadSchema = 'network.xyo.module.filter'\nexport type ModuleFilterPayloadSchema = typeof ModuleFilterPayloadSchema\n\nexport type ModuleFilterPayload = Payload<{ id: ModuleIdentifier } & BridgeExposeOptions, ModuleFilterPayloadSchema>\n\nexport type BridgeExposeQuery = Query<void, BridgeExposeQuerySchema>\n","import type { Query } from '@xyo-network/payload-model'\n\nimport type { BridgeExposeOptions } from './Expose.ts'\n\nexport const BridgeUnexposeQuerySchema = 'network.xyo.query.bridge.unexpose' as const\nexport type BridgeUnexposeQuerySchema = typeof BridgeUnexposeQuerySchema\n\nexport interface BridgeUnexposeOptions extends BridgeExposeOptions {}\n\nexport type BridgeUnexposeQuery = Query<void, BridgeUnexposeQuerySchema>\n","import type { TypeCheck } from '@xylabs/object'\nimport { IsObjectFactory } from '@xylabs/object'\nimport type { AttachableModuleInstance } from '@xyo-network/module-model'\n\nimport type { BridgeModuleEventData } from '../EventData.ts'\nimport type { BridgeInstance } from '../Instance.ts'\nimport type { BridgeModule } from '../Module.ts'\nimport type { BridgeParams } from '../Params.ts'\n\nexport interface AttachableBridgeInstance<\n TParams extends BridgeParams = BridgeParams,\n TEventData extends BridgeModuleEventData = BridgeModuleEventData,\n> extends BridgeModule<TParams, TEventData>,\n AttachableModuleInstance<TParams, TEventData>,\n BridgeInstance<TParams, TEventData> {}\n\nexport type AttachableBridgeInstanceTypeCheck<T extends AttachableBridgeInstance = AttachableBridgeInstance> = TypeCheck<T>\n\nexport class IsAttachableBridgeInstanceFactory<T extends AttachableBridgeInstance = AttachableBridgeInstance> extends IsObjectFactory<T> {}\n","import type { EmptyObject, WithAdditional } from '@xylabs/object'\nimport type { CacheConfig, ModuleConfig } from '@xyo-network/module-model'\nimport type { Payload } from '@xyo-network/payload-model'\n\nexport const BridgeConfigSchema = 'network.xyo.bridge.config' as const\nexport type BridgeConfigSchema = typeof BridgeConfigSchema\n\nexport type BridgeClientConfig = {\n cache?: CacheConfig | true\n discoverRoots?: 'start' | 'lazy'\n maxDepth?: number\n}\n\nexport type BridgeHostConfig = {\n cache?: CacheConfig | true\n maxDepth?: number\n}\n\nexport type BridgeConfig<\n TConfig extends Payload | EmptyObject | void = void,\n TSchema extends string | void = void,\n TClient extends EmptyObject | void = void,\n THost extends EmptyObject | void = void,\n> = ModuleConfig<\n WithAdditional<\n {\n client?: WithAdditional<BridgeClientConfig, TClient>\n /** @deprecated use client.discoverRoots instead */\n discoverRoots?: 'start' | 'lazy'\n host?: WithAdditional<BridgeHostConfig, THost>\n schema: TConfig extends Payload ? TConfig['schema'] : BridgeConfigSchema\n },\n TConfig\n >,\n TSchema\n>\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/attachable/asAttachableInstance.ts","../../src/attachable/isAttachableInstance.ts","../../src/typeChecks.ts","../../src/Queries/Connect.ts","../../src/Queries/Disconnect.ts","../../src/Queries/Expose.ts","../../src/Queries/Unexpose.ts","../../src/attachable/AttachableInstance.ts","../../src/Config.ts"],"sourcesContent":["import { AsObjectFactory } from '@xylabs/object'\n\nimport { isAttachableBridgeInstance } from './isAttachableInstance.ts'\n\nexport const asAttachableBridgeInstance = AsObjectFactory.create(isAttachableBridgeInstance)\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 { isBridgeInstance } from '../typeChecks.ts'\nimport type { AttachableBridgeInstance } from './AttachableInstance.ts'\n\nexport const requiredAttachableBridgeInstanceFunctions: ObjectTypeShape = {}\n\n// we do not use IsInstanceFactory here to prevent a cycle\nconst factory = new IsObjectFactory<AttachableBridgeInstance>()\n\nexport const isAttachableBridgeInstance: TypeCheck<AttachableBridgeInstance> = factory.create(requiredAttachableBridgeInstanceFunctions, [\n isBridgeInstance,\n isAttachableModuleInstance,\n])\n","import { AsObjectFactory } from '@xylabs/object'\nimport {\n IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory,\n} from '@xyo-network/module-model'\n\nimport type { BridgeInstance } from './Instance.ts'\nimport type { BridgeModule } from './Module.ts'\nimport { BridgeConnectQuerySchema, BridgeDisconnectQuerySchema } from './Queries/index.ts'\n\nexport const isBridgeInstance = new IsInstanceFactory<BridgeInstance>().create(\n { expose: 'function' },\n [isModuleInstance],\n)\nexport const isBridgeModule = new IsModuleFactory<BridgeModule>().create([BridgeConnectQuerySchema, BridgeDisconnectQuerySchema])\n\nexport const asBridgeModule = AsObjectFactory.create(isBridgeModule)\nexport const asBridgeInstance = AsObjectFactory.create(isBridgeInstance)\nexport const withBridgeModule = WithFactory.create(isBridgeModule)\nexport const withBridgeInstance = WithFactory.create(isBridgeInstance)\n","import type { ModuleIdentifier } from '@xyo-network/module-model'\nimport type { Query } from '@xyo-network/payload-model'\n\nexport const BridgeConnectQuerySchema = 'network.xyo.query.bridge.connect' as const\nexport type BridgeConnectQuerySchema = typeof BridgeConnectQuerySchema\n\nexport type BridgeConnectQuery = Query<{\n id?: ModuleIdentifier\n maxDepth?: number\n schema: BridgeConnectQuerySchema\n}>\n","import type { ModuleIdentifier } from '@xyo-network/module-model'\nimport type { Query } from '@xyo-network/payload-model'\n\nexport type BridgeDisconnectQuerySchema = 'network.xyo.query.bridge.disconnect'\nexport const BridgeDisconnectQuerySchema: BridgeDisconnectQuerySchema = 'network.xyo.query.bridge.disconnect'\n\nexport type BridgeDisconnectQuery = Query<{\n id?: ModuleIdentifier\n maxDepth?: number\n schema: BridgeDisconnectQuerySchema\n}>\n","import type { ModuleIdentifier } from '@xyo-network/module-model'\nimport type { Payload, Query } from '@xyo-network/payload-model'\n\nexport const BridgeExposeQuerySchema = 'network.xyo.query.bridge.expose' as const\nexport type BridgeExposeQuerySchema = typeof BridgeExposeQuerySchema\n\nexport interface BridgeExposeOptions {\n maxDepth?: number\n required?: boolean\n}\n\nexport const ModuleFilterPayloadSchema = 'network.xyo.module.filter'\nexport type ModuleFilterPayloadSchema = typeof ModuleFilterPayloadSchema\n\nexport type ModuleFilterPayload = Payload<{ id: ModuleIdentifier } & BridgeExposeOptions, ModuleFilterPayloadSchema>\n\nexport type BridgeExposeQuery = Query<void, BridgeExposeQuerySchema>\n","import type { Query } from '@xyo-network/payload-model'\n\nimport type { BridgeExposeOptions } from './Expose.ts'\n\nexport const BridgeUnexposeQuerySchema = 'network.xyo.query.bridge.unexpose' as const\nexport type BridgeUnexposeQuerySchema = typeof BridgeUnexposeQuerySchema\n\nexport interface BridgeUnexposeOptions extends BridgeExposeOptions {}\n\nexport type BridgeUnexposeQuery = Query<void, BridgeUnexposeQuerySchema>\n","import type { TypeCheck } from '@xylabs/object'\nimport { IsObjectFactory } from '@xylabs/object'\nimport type { AttachableModuleInstance } from '@xyo-network/module-model'\n\nimport type { BridgeModuleEventData } from '../EventData.ts'\nimport type { BridgeInstance } from '../Instance.ts'\nimport type { BridgeModule } from '../Module.ts'\nimport type { BridgeParams } from '../Params.ts'\n\nexport interface AttachableBridgeInstance<\n TParams extends BridgeParams = BridgeParams,\n TEventData extends BridgeModuleEventData = BridgeModuleEventData,\n> extends BridgeModule<TParams, TEventData>,\n AttachableModuleInstance<TParams, TEventData>,\n BridgeInstance<TParams, TEventData> {}\n\nexport type AttachableBridgeInstanceTypeCheck<T extends AttachableBridgeInstance = AttachableBridgeInstance> = TypeCheck<T>\n\nexport class IsAttachableBridgeInstanceFactory<T extends AttachableBridgeInstance = AttachableBridgeInstance> extends IsObjectFactory<T> {}\n","import type { EmptyObject, WithAdditional } from '@xylabs/object'\nimport type { CacheConfig, ModuleConfig } from '@xyo-network/module-model'\nimport type { Payload } from '@xyo-network/payload-model'\n\nexport const BridgeConfigSchema = 'network.xyo.bridge.config' as const\nexport type BridgeConfigSchema = typeof BridgeConfigSchema\n\nexport type BridgeClientConfig = {\n cache?: CacheConfig | true\n discoverRoots?: 'start' | 'lazy'\n maxDepth?: number\n}\n\nexport type BridgeHostConfig = {\n cache?: CacheConfig | true\n maxDepth?: number\n}\n\nexport type BridgeConfig<\n TConfig extends Payload | EmptyObject | void = void,\n TSchema extends string | void = void,\n TClient extends EmptyObject | void = void,\n THost extends EmptyObject | void = void,\n> = ModuleConfig<\n WithAdditional<\n {\n client?: WithAdditional<BridgeClientConfig, TClient>\n /** @deprecated use client.discoverRoots instead */\n discoverRoots?: 'start' | 'lazy'\n host?: WithAdditional<BridgeHostConfig, THost>\n schema: TConfig extends Payload ? TConfig['schema'] : BridgeConfigSchema\n },\n TConfig\n >,\n TSchema\n>\n"],"mappings":";AAAA,SAAS,mBAAAA,wBAAuB;;;ACChC,SAAS,uBAAuB;AAEhC,SAAS,kCAAkC;;;ACH3C,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EAAmB;AAAA,EAAiB;AAAA,EAAkB;AAAA,OACjD;;;ACAA,IAAM,2BAA2B;;;ACCjC,IAAM,8BAA2D;;;ACDjE,IAAM,0BAA0B;AAQhC,IAAM,4BAA4B;;;ACPlC,IAAM,4BAA4B;;;AJKlC,IAAM,mBAAmB,IAAI,kBAAkC,EAAE;AAAA,EACtE,EAAE,QAAQ,WAAW;AAAA,EACrB,CAAC,gBAAgB;AACnB;AACO,IAAM,iBAAiB,IAAI,gBAA8B,EAAE,OAAO,CAAC,0BAA0B,2BAA2B,CAAC;AAEzH,IAAM,iBAAiB,gBAAgB,OAAO,cAAc;AAC5D,IAAM,mBAAmB,gBAAgB,OAAO,gBAAgB;AAChE,IAAM,mBAAmB,YAAY,OAAO,cAAc;AAC1D,IAAM,qBAAqB,YAAY,OAAO,gBAAgB;;;ADV9D,IAAM,4CAA6D,CAAC;AAG3E,IAAM,UAAU,IAAI,gBAA0C;AAEvD,IAAM,6BAAkE,QAAQ,OAAO,2CAA2C;AAAA,EACvI;AAAA,EACA;AACF,CAAC;;;ADZM,IAAM,6BAA6BC,iBAAgB,OAAO,0BAA0B;;;AOH3F,SAAS,mBAAAC,wBAAuB;AAiBzB,IAAM,oCAAN,cAA+GA,iBAAmB;AAAC;;;ACdnI,IAAM,qBAAqB;","names":["AsObjectFactory","AsObjectFactory","IsObjectFactory"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/bridge-model",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.10",
|
|
4
4
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -29,19 +29,19 @@
|
|
|
29
29
|
"module": "dist/neutral/index.mjs",
|
|
30
30
|
"types": "dist/neutral/index.d.ts",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@xylabs/hex": "^4.
|
|
33
|
-
"@xylabs/object": "^4.
|
|
34
|
-
"@xylabs/promise": "^4.
|
|
35
|
-
"@xylabs/typeof": "^4.
|
|
36
|
-
"@xyo-network/boundwitness-model": "^3.6.
|
|
37
|
-
"@xyo-network/module-events": "^3.6.
|
|
38
|
-
"@xyo-network/module-model": "^3.6.
|
|
39
|
-
"@xyo-network/payload-model": "^3.6.
|
|
32
|
+
"@xylabs/hex": "^4.5.1",
|
|
33
|
+
"@xylabs/object": "^4.5.1",
|
|
34
|
+
"@xylabs/promise": "^4.5.1",
|
|
35
|
+
"@xylabs/typeof": "^4.5.1",
|
|
36
|
+
"@xyo-network/boundwitness-model": "^3.6.10",
|
|
37
|
+
"@xyo-network/module-events": "^3.6.10",
|
|
38
|
+
"@xyo-network/module-model": "^3.6.10",
|
|
39
|
+
"@xyo-network/payload-model": "^3.6.10"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@xylabs/ts-scripts-yarn3": "^4.2.6",
|
|
43
43
|
"@xylabs/tsconfig": "^4.2.6",
|
|
44
|
-
"typescript": "^5.7.
|
|
44
|
+
"typescript": "^5.7.3"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|