@xyo-network/bridge-wrapper 2.107.3 → 2.107.5
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/browser/index.cjs +64 -1
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.js +43 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/neutral/index.cjs +64 -1
- package/dist/neutral/index.cjs.map +1 -1
- package/dist/neutral/index.js +43 -1
- package/dist/neutral/index.js.map +1 -1
- package/dist/node/index.cjs +69 -1
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js +44 -1
- package/dist/node/index.js.map +1 -1
- package/package.json +6 -6
package/dist/browser/index.cjs
CHANGED
|
@@ -1,2 +1,65 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/index.ts
|
|
22
|
+
var src_exports = {};
|
|
23
|
+
__export(src_exports, {
|
|
24
|
+
BridgeWrapper: () => BridgeWrapper
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(src_exports);
|
|
27
|
+
|
|
28
|
+
// src/BridgeWrapper.ts
|
|
29
|
+
var import_bridge_model = require("@xyo-network/bridge-model");
|
|
30
|
+
var import_module_wrapper = require("@xyo-network/module-wrapper");
|
|
31
|
+
(0, import_module_wrapper.constructableModuleWrapper)();
|
|
32
|
+
var BridgeWrapper = class extends import_module_wrapper.ModuleWrapper {
|
|
33
|
+
static {
|
|
34
|
+
__name(this, "BridgeWrapper");
|
|
35
|
+
}
|
|
36
|
+
static instanceIdentityCheck = import_bridge_model.isBridgeInstance;
|
|
37
|
+
static moduleIdentityCheck = import_bridge_model.isBridgeModule;
|
|
38
|
+
async expose(id, options) {
|
|
39
|
+
const filterPayload = {
|
|
40
|
+
id,
|
|
41
|
+
schema: import_bridge_model.ModuleFilterPayloadSchema,
|
|
42
|
+
...options
|
|
43
|
+
};
|
|
44
|
+
const addresses = (await this.sendQuery({
|
|
45
|
+
schema: import_bridge_model.BridgeExposeQuerySchema
|
|
46
|
+
}, [
|
|
47
|
+
filterPayload
|
|
48
|
+
])).map(({ address }) => address);
|
|
49
|
+
return await Promise.all(addresses.map((address) => this.resolve(address)));
|
|
50
|
+
}
|
|
51
|
+
async unexpose(id, options) {
|
|
52
|
+
const filterPayload = {
|
|
53
|
+
id,
|
|
54
|
+
schema: import_bridge_model.ModuleFilterPayloadSchema,
|
|
55
|
+
...options
|
|
56
|
+
};
|
|
57
|
+
const addresses = (await this.sendQuery({
|
|
58
|
+
schema: import_bridge_model.BridgeUnexposeQuerySchema
|
|
59
|
+
}, [
|
|
60
|
+
filterPayload
|
|
61
|
+
])).map(({ address }) => address);
|
|
62
|
+
return addresses ? [] : [];
|
|
63
|
+
}
|
|
64
|
+
};
|
|
2
65
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/BridgeWrapper.ts"],"sourcesContent":["export * from './BridgeWrapper'\n","import { Address } from '@xylabs/hex'\nimport {\n BridgeExposeOptions,\n BridgeExposeQuery,\n BridgeExposeQuerySchema,\n BridgeInstance,\n BridgeModule,\n BridgeUnexposeOptions,\n BridgeUnexposeQuery,\n BridgeUnexposeQuerySchema,\n isBridgeInstance,\n isBridgeModule,\n ModuleFilterPayload,\n ModuleFilterPayloadSchema,\n} from '@xyo-network/bridge-model'\nimport { AddressPayload, ModuleIdentifier, ModuleInstance } from '@xyo-network/module-model'\nimport { constructableModuleWrapper, ModuleWrapper } from '@xyo-network/module-wrapper'\n\nconstructableModuleWrapper()\nexport class BridgeWrapper<TWrappedModule extends BridgeModule = BridgeModule>\n extends ModuleWrapper<TWrappedModule>\n implements BridgeInstance<TWrappedModule['params']>\n{\n static override instanceIdentityCheck = isBridgeInstance\n static override moduleIdentityCheck = isBridgeModule\n\n async expose(id: ModuleIdentifier, options?: BridgeExposeOptions): Promise<ModuleInstance[]> {\n const filterPayload: ModuleFilterPayload = { id, schema: ModuleFilterPayloadSchema, ...options }\n const addresses = (\n await this.sendQuery<BridgeExposeQuery, ModuleFilterPayload, AddressPayload>({ schema: BridgeExposeQuerySchema }, [filterPayload])\n ).map(({ address }) => address)\n return await Promise.all((addresses as Address[]).map((address) => this.resolve(address)))\n }\n\n async unexpose(id: ModuleIdentifier, options?: BridgeUnexposeOptions): Promise<ModuleInstance[]> {\n const filterPayload: ModuleFilterPayload = { id, schema: ModuleFilterPayloadSchema, ...options }\n const addresses = (\n await this.sendQuery<BridgeUnexposeQuery, ModuleFilterPayload, AddressPayload>({ schema: BridgeUnexposeQuerySchema }, [filterPayload])\n ).map(({ address }) => address)\n return addresses ? [] : []\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/BridgeWrapper.ts"],"sourcesContent":["export * from './BridgeWrapper'\n","import { Address } from '@xylabs/hex'\nimport {\n BridgeExposeOptions,\n BridgeExposeQuery,\n BridgeExposeQuerySchema,\n BridgeInstance,\n BridgeModule,\n BridgeUnexposeOptions,\n BridgeUnexposeQuery,\n BridgeUnexposeQuerySchema,\n isBridgeInstance,\n isBridgeModule,\n ModuleFilterPayload,\n ModuleFilterPayloadSchema,\n} from '@xyo-network/bridge-model'\nimport { AddressPayload, ModuleIdentifier, ModuleInstance } from '@xyo-network/module-model'\nimport { constructableModuleWrapper, ModuleWrapper } from '@xyo-network/module-wrapper'\n\nconstructableModuleWrapper()\nexport class BridgeWrapper<TWrappedModule extends BridgeModule = BridgeModule>\n extends ModuleWrapper<TWrappedModule>\n implements BridgeInstance<TWrappedModule['params']>\n{\n static override instanceIdentityCheck = isBridgeInstance\n static override moduleIdentityCheck = isBridgeModule\n\n async expose(id: ModuleIdentifier, options?: BridgeExposeOptions): Promise<ModuleInstance[]> {\n const filterPayload: ModuleFilterPayload = { id, schema: ModuleFilterPayloadSchema, ...options }\n const addresses = (\n await this.sendQuery<BridgeExposeQuery, ModuleFilterPayload, AddressPayload>({ schema: BridgeExposeQuerySchema }, [filterPayload])\n ).map(({ address }) => address)\n return await Promise.all((addresses as Address[]).map((address) => this.resolve(address)))\n }\n\n async unexpose(id: ModuleIdentifier, options?: BridgeUnexposeOptions): Promise<ModuleInstance[]> {\n const filterPayload: ModuleFilterPayload = { id, schema: ModuleFilterPayloadSchema, ...options }\n const addresses = (\n await this.sendQuery<BridgeUnexposeQuery, ModuleFilterPayload, AddressPayload>({ schema: BridgeUnexposeQuerySchema }, [filterPayload])\n ).map(({ address }) => address)\n return addresses ? [] : []\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;ACCA,0BAaO;AAEP,4BAA0D;IAE1DA,kDAAAA;AACO,IAAMC,gBAAN,cACGC,oCAAAA;EAnBV,OAmBUA;;;EAGR,OAAgBC,wBAAwBC;EACxC,OAAgBC,sBAAsBC;EAEtC,MAAMC,OAAOC,IAAsBC,SAA0D;AAC3F,UAAMC,gBAAqC;MAAEF;MAAIG,QAAQC;MAA2B,GAAGH;IAAQ;AAC/F,UAAMI,aACJ,MAAM,KAAKC,UAAkE;MAAEH,QAAQI;IAAwB,GAAG;MAACL;KAAc,GACjIM,IAAI,CAAC,EAAEC,QAAO,MAAOA,OAAAA;AACvB,WAAO,MAAMC,QAAQC,IAAKN,UAAwBG,IAAI,CAACC,YAAY,KAAKG,QAAQH,OAAAA,CAAAA,CAAAA;EAClF;EAEA,MAAMI,SAASb,IAAsBC,SAA4D;AAC/F,UAAMC,gBAAqC;MAAEF;MAAIG,QAAQC;MAA2B,GAAGH;IAAQ;AAC/F,UAAMI,aACJ,MAAM,KAAKC,UAAoE;MAAEH,QAAQW;IAA0B,GAAG;MAACZ;KAAc,GACrIM,IAAI,CAAC,EAAEC,QAAO,MAAOA,OAAAA;AACvB,WAAOJ,YAAY,CAAA,IAAK,CAAA;EAC1B;AACF;","names":["constructableModuleWrapper","BridgeWrapper","ModuleWrapper","instanceIdentityCheck","isBridgeInstance","moduleIdentityCheck","isBridgeModule","expose","id","options","filterPayload","schema","ModuleFilterPayloadSchema","addresses","sendQuery","BridgeExposeQuerySchema","map","address","Promise","all","resolve","unexpose","BridgeUnexposeQuerySchema"]}
|
package/dist/browser/index.js
CHANGED
|
@@ -1,2 +1,44 @@
|
|
|
1
|
-
var
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
4
|
+
// src/BridgeWrapper.ts
|
|
5
|
+
import { BridgeExposeQuerySchema, BridgeUnexposeQuerySchema, isBridgeInstance, isBridgeModule, ModuleFilterPayloadSchema } from "@xyo-network/bridge-model";
|
|
6
|
+
import { constructableModuleWrapper, ModuleWrapper } from "@xyo-network/module-wrapper";
|
|
7
|
+
constructableModuleWrapper();
|
|
8
|
+
var BridgeWrapper = class extends ModuleWrapper {
|
|
9
|
+
static {
|
|
10
|
+
__name(this, "BridgeWrapper");
|
|
11
|
+
}
|
|
12
|
+
static instanceIdentityCheck = isBridgeInstance;
|
|
13
|
+
static moduleIdentityCheck = isBridgeModule;
|
|
14
|
+
async expose(id, options) {
|
|
15
|
+
const filterPayload = {
|
|
16
|
+
id,
|
|
17
|
+
schema: ModuleFilterPayloadSchema,
|
|
18
|
+
...options
|
|
19
|
+
};
|
|
20
|
+
const addresses = (await this.sendQuery({
|
|
21
|
+
schema: BridgeExposeQuerySchema
|
|
22
|
+
}, [
|
|
23
|
+
filterPayload
|
|
24
|
+
])).map(({ address }) => address);
|
|
25
|
+
return await Promise.all(addresses.map((address) => this.resolve(address)));
|
|
26
|
+
}
|
|
27
|
+
async unexpose(id, options) {
|
|
28
|
+
const filterPayload = {
|
|
29
|
+
id,
|
|
30
|
+
schema: ModuleFilterPayloadSchema,
|
|
31
|
+
...options
|
|
32
|
+
};
|
|
33
|
+
const addresses = (await this.sendQuery({
|
|
34
|
+
schema: BridgeUnexposeQuerySchema
|
|
35
|
+
}, [
|
|
36
|
+
filterPayload
|
|
37
|
+
])).map(({ address }) => address);
|
|
38
|
+
return addresses ? [] : [];
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
BridgeWrapper
|
|
43
|
+
};
|
|
2
44
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/BridgeWrapper.ts"],"sourcesContent":["import { Address } from '@xylabs/hex'\nimport {\n BridgeExposeOptions,\n BridgeExposeQuery,\n BridgeExposeQuerySchema,\n BridgeInstance,\n BridgeModule,\n BridgeUnexposeOptions,\n BridgeUnexposeQuery,\n BridgeUnexposeQuerySchema,\n isBridgeInstance,\n isBridgeModule,\n ModuleFilterPayload,\n ModuleFilterPayloadSchema,\n} from '@xyo-network/bridge-model'\nimport { AddressPayload, ModuleIdentifier, ModuleInstance } from '@xyo-network/module-model'\nimport { constructableModuleWrapper, ModuleWrapper } from '@xyo-network/module-wrapper'\n\nconstructableModuleWrapper()\nexport class BridgeWrapper<TWrappedModule extends BridgeModule = BridgeModule>\n extends ModuleWrapper<TWrappedModule>\n implements BridgeInstance<TWrappedModule['params']>\n{\n static override instanceIdentityCheck = isBridgeInstance\n static override moduleIdentityCheck = isBridgeModule\n\n async expose(id: ModuleIdentifier, options?: BridgeExposeOptions): Promise<ModuleInstance[]> {\n const filterPayload: ModuleFilterPayload = { id, schema: ModuleFilterPayloadSchema, ...options }\n const addresses = (\n await this.sendQuery<BridgeExposeQuery, ModuleFilterPayload, AddressPayload>({ schema: BridgeExposeQuerySchema }, [filterPayload])\n ).map(({ address }) => address)\n return await Promise.all((addresses as Address[]).map((address) => this.resolve(address)))\n }\n\n async unexpose(id: ModuleIdentifier, options?: BridgeUnexposeOptions): Promise<ModuleInstance[]> {\n const filterPayload: ModuleFilterPayload = { id, schema: ModuleFilterPayloadSchema, ...options }\n const addresses = (\n await this.sendQuery<BridgeUnexposeQuery, ModuleFilterPayload, AddressPayload>({ schema: BridgeUnexposeQuerySchema }, [filterPayload])\n ).map(({ address }) => address)\n return addresses ? [] : []\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/BridgeWrapper.ts"],"sourcesContent":["import { Address } from '@xylabs/hex'\nimport {\n BridgeExposeOptions,\n BridgeExposeQuery,\n BridgeExposeQuerySchema,\n BridgeInstance,\n BridgeModule,\n BridgeUnexposeOptions,\n BridgeUnexposeQuery,\n BridgeUnexposeQuerySchema,\n isBridgeInstance,\n isBridgeModule,\n ModuleFilterPayload,\n ModuleFilterPayloadSchema,\n} from '@xyo-network/bridge-model'\nimport { AddressPayload, ModuleIdentifier, ModuleInstance } from '@xyo-network/module-model'\nimport { constructableModuleWrapper, ModuleWrapper } from '@xyo-network/module-wrapper'\n\nconstructableModuleWrapper()\nexport class BridgeWrapper<TWrappedModule extends BridgeModule = BridgeModule>\n extends ModuleWrapper<TWrappedModule>\n implements BridgeInstance<TWrappedModule['params']>\n{\n static override instanceIdentityCheck = isBridgeInstance\n static override moduleIdentityCheck = isBridgeModule\n\n async expose(id: ModuleIdentifier, options?: BridgeExposeOptions): Promise<ModuleInstance[]> {\n const filterPayload: ModuleFilterPayload = { id, schema: ModuleFilterPayloadSchema, ...options }\n const addresses = (\n await this.sendQuery<BridgeExposeQuery, ModuleFilterPayload, AddressPayload>({ schema: BridgeExposeQuerySchema }, [filterPayload])\n ).map(({ address }) => address)\n return await Promise.all((addresses as Address[]).map((address) => this.resolve(address)))\n }\n\n async unexpose(id: ModuleIdentifier, options?: BridgeUnexposeOptions): Promise<ModuleInstance[]> {\n const filterPayload: ModuleFilterPayload = { id, schema: ModuleFilterPayloadSchema, ...options }\n const addresses = (\n await this.sendQuery<BridgeUnexposeQuery, ModuleFilterPayload, AddressPayload>({ schema: BridgeUnexposeQuerySchema }, [filterPayload])\n ).map(({ address }) => address)\n return addresses ? [] : []\n }\n}\n"],"mappings":";;;;AACA,SAGEA,yBAKAC,2BACAC,kBACAC,gBAEAC,iCACK;AAEP,SAASC,4BAA4BC,qBAAqB;AAE1DC,2BAAAA;AACO,IAAMC,gBAAN,cACGC,cAAAA;EAnBV,OAmBUA;;;EAGR,OAAgBC,wBAAwBC;EACxC,OAAgBC,sBAAsBC;EAEtC,MAAMC,OAAOC,IAAsBC,SAA0D;AAC3F,UAAMC,gBAAqC;MAAEF;MAAIG,QAAQC;MAA2B,GAAGH;IAAQ;AAC/F,UAAMI,aACJ,MAAM,KAAKC,UAAkE;MAAEH,QAAQI;IAAwB,GAAG;MAACL;KAAc,GACjIM,IAAI,CAAC,EAAEC,QAAO,MAAOA,OAAAA;AACvB,WAAO,MAAMC,QAAQC,IAAKN,UAAwBG,IAAI,CAACC,YAAY,KAAKG,QAAQH,OAAAA,CAAAA,CAAAA;EAClF;EAEA,MAAMI,SAASb,IAAsBC,SAA4D;AAC/F,UAAMC,gBAAqC;MAAEF;MAAIG,QAAQC;MAA2B,GAAGH;IAAQ;AAC/F,UAAMI,aACJ,MAAM,KAAKC,UAAoE;MAAEH,QAAQW;IAA0B,GAAG;MAACZ;KAAc,GACrIM,IAAI,CAAC,EAAEC,QAAO,MAAOA,OAAAA;AACvB,WAAOJ,YAAY,CAAA,IAAK,CAAA;EAC1B;AACF;","names":["BridgeExposeQuerySchema","BridgeUnexposeQuerySchema","isBridgeInstance","isBridgeModule","ModuleFilterPayloadSchema","constructableModuleWrapper","ModuleWrapper","constructableModuleWrapper","BridgeWrapper","ModuleWrapper","instanceIdentityCheck","isBridgeInstance","moduleIdentityCheck","isBridgeModule","expose","id","options","filterPayload","schema","ModuleFilterPayloadSchema","addresses","sendQuery","BridgeExposeQuerySchema","map","address","Promise","all","resolve","unexpose","BridgeUnexposeQuerySchema"]}
|
package/dist/neutral/index.cjs
CHANGED
|
@@ -1,2 +1,65 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/index.ts
|
|
22
|
+
var src_exports = {};
|
|
23
|
+
__export(src_exports, {
|
|
24
|
+
BridgeWrapper: () => BridgeWrapper
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(src_exports);
|
|
27
|
+
|
|
28
|
+
// src/BridgeWrapper.ts
|
|
29
|
+
var import_bridge_model = require("@xyo-network/bridge-model");
|
|
30
|
+
var import_module_wrapper = require("@xyo-network/module-wrapper");
|
|
31
|
+
(0, import_module_wrapper.constructableModuleWrapper)();
|
|
32
|
+
var BridgeWrapper = class extends import_module_wrapper.ModuleWrapper {
|
|
33
|
+
static {
|
|
34
|
+
__name(this, "BridgeWrapper");
|
|
35
|
+
}
|
|
36
|
+
static instanceIdentityCheck = import_bridge_model.isBridgeInstance;
|
|
37
|
+
static moduleIdentityCheck = import_bridge_model.isBridgeModule;
|
|
38
|
+
async expose(id, options) {
|
|
39
|
+
const filterPayload = {
|
|
40
|
+
id,
|
|
41
|
+
schema: import_bridge_model.ModuleFilterPayloadSchema,
|
|
42
|
+
...options
|
|
43
|
+
};
|
|
44
|
+
const addresses = (await this.sendQuery({
|
|
45
|
+
schema: import_bridge_model.BridgeExposeQuerySchema
|
|
46
|
+
}, [
|
|
47
|
+
filterPayload
|
|
48
|
+
])).map(({ address }) => address);
|
|
49
|
+
return await Promise.all(addresses.map((address) => this.resolve(address)));
|
|
50
|
+
}
|
|
51
|
+
async unexpose(id, options) {
|
|
52
|
+
const filterPayload = {
|
|
53
|
+
id,
|
|
54
|
+
schema: import_bridge_model.ModuleFilterPayloadSchema,
|
|
55
|
+
...options
|
|
56
|
+
};
|
|
57
|
+
const addresses = (await this.sendQuery({
|
|
58
|
+
schema: import_bridge_model.BridgeUnexposeQuerySchema
|
|
59
|
+
}, [
|
|
60
|
+
filterPayload
|
|
61
|
+
])).map(({ address }) => address);
|
|
62
|
+
return addresses ? [] : [];
|
|
63
|
+
}
|
|
64
|
+
};
|
|
2
65
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/BridgeWrapper.ts"],"sourcesContent":["export * from './BridgeWrapper'\n","import { Address } from '@xylabs/hex'\nimport {\n BridgeExposeOptions,\n BridgeExposeQuery,\n BridgeExposeQuerySchema,\n BridgeInstance,\n BridgeModule,\n BridgeUnexposeOptions,\n BridgeUnexposeQuery,\n BridgeUnexposeQuerySchema,\n isBridgeInstance,\n isBridgeModule,\n ModuleFilterPayload,\n ModuleFilterPayloadSchema,\n} from '@xyo-network/bridge-model'\nimport { AddressPayload, ModuleIdentifier, ModuleInstance } from '@xyo-network/module-model'\nimport { constructableModuleWrapper, ModuleWrapper } from '@xyo-network/module-wrapper'\n\nconstructableModuleWrapper()\nexport class BridgeWrapper<TWrappedModule extends BridgeModule = BridgeModule>\n extends ModuleWrapper<TWrappedModule>\n implements BridgeInstance<TWrappedModule['params']>\n{\n static override instanceIdentityCheck = isBridgeInstance\n static override moduleIdentityCheck = isBridgeModule\n\n async expose(id: ModuleIdentifier, options?: BridgeExposeOptions): Promise<ModuleInstance[]> {\n const filterPayload: ModuleFilterPayload = { id, schema: ModuleFilterPayloadSchema, ...options }\n const addresses = (\n await this.sendQuery<BridgeExposeQuery, ModuleFilterPayload, AddressPayload>({ schema: BridgeExposeQuerySchema }, [filterPayload])\n ).map(({ address }) => address)\n return await Promise.all((addresses as Address[]).map((address) => this.resolve(address)))\n }\n\n async unexpose(id: ModuleIdentifier, options?: BridgeUnexposeOptions): Promise<ModuleInstance[]> {\n const filterPayload: ModuleFilterPayload = { id, schema: ModuleFilterPayloadSchema, ...options }\n const addresses = (\n await this.sendQuery<BridgeUnexposeQuery, ModuleFilterPayload, AddressPayload>({ schema: BridgeUnexposeQuerySchema }, [filterPayload])\n ).map(({ address }) => address)\n return addresses ? [] : []\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/BridgeWrapper.ts"],"sourcesContent":["export * from './BridgeWrapper'\n","import { Address } from '@xylabs/hex'\nimport {\n BridgeExposeOptions,\n BridgeExposeQuery,\n BridgeExposeQuerySchema,\n BridgeInstance,\n BridgeModule,\n BridgeUnexposeOptions,\n BridgeUnexposeQuery,\n BridgeUnexposeQuerySchema,\n isBridgeInstance,\n isBridgeModule,\n ModuleFilterPayload,\n ModuleFilterPayloadSchema,\n} from '@xyo-network/bridge-model'\nimport { AddressPayload, ModuleIdentifier, ModuleInstance } from '@xyo-network/module-model'\nimport { constructableModuleWrapper, ModuleWrapper } from '@xyo-network/module-wrapper'\n\nconstructableModuleWrapper()\nexport class BridgeWrapper<TWrappedModule extends BridgeModule = BridgeModule>\n extends ModuleWrapper<TWrappedModule>\n implements BridgeInstance<TWrappedModule['params']>\n{\n static override instanceIdentityCheck = isBridgeInstance\n static override moduleIdentityCheck = isBridgeModule\n\n async expose(id: ModuleIdentifier, options?: BridgeExposeOptions): Promise<ModuleInstance[]> {\n const filterPayload: ModuleFilterPayload = { id, schema: ModuleFilterPayloadSchema, ...options }\n const addresses = (\n await this.sendQuery<BridgeExposeQuery, ModuleFilterPayload, AddressPayload>({ schema: BridgeExposeQuerySchema }, [filterPayload])\n ).map(({ address }) => address)\n return await Promise.all((addresses as Address[]).map((address) => this.resolve(address)))\n }\n\n async unexpose(id: ModuleIdentifier, options?: BridgeUnexposeOptions): Promise<ModuleInstance[]> {\n const filterPayload: ModuleFilterPayload = { id, schema: ModuleFilterPayloadSchema, ...options }\n const addresses = (\n await this.sendQuery<BridgeUnexposeQuery, ModuleFilterPayload, AddressPayload>({ schema: BridgeUnexposeQuerySchema }, [filterPayload])\n ).map(({ address }) => address)\n return addresses ? [] : []\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;ACCA,0BAaO;AAEP,4BAA0D;IAE1DA,kDAAAA;AACO,IAAMC,gBAAN,cACGC,oCAAAA;EAnBV,OAmBUA;;;EAGR,OAAgBC,wBAAwBC;EACxC,OAAgBC,sBAAsBC;EAEtC,MAAMC,OAAOC,IAAsBC,SAA0D;AAC3F,UAAMC,gBAAqC;MAAEF;MAAIG,QAAQC;MAA2B,GAAGH;IAAQ;AAC/F,UAAMI,aACJ,MAAM,KAAKC,UAAkE;MAAEH,QAAQI;IAAwB,GAAG;MAACL;KAAc,GACjIM,IAAI,CAAC,EAAEC,QAAO,MAAOA,OAAAA;AACvB,WAAO,MAAMC,QAAQC,IAAKN,UAAwBG,IAAI,CAACC,YAAY,KAAKG,QAAQH,OAAAA,CAAAA,CAAAA;EAClF;EAEA,MAAMI,SAASb,IAAsBC,SAA4D;AAC/F,UAAMC,gBAAqC;MAAEF;MAAIG,QAAQC;MAA2B,GAAGH;IAAQ;AAC/F,UAAMI,aACJ,MAAM,KAAKC,UAAoE;MAAEH,QAAQW;IAA0B,GAAG;MAACZ;KAAc,GACrIM,IAAI,CAAC,EAAEC,QAAO,MAAOA,OAAAA;AACvB,WAAOJ,YAAY,CAAA,IAAK,CAAA;EAC1B;AACF;","names":["constructableModuleWrapper","BridgeWrapper","ModuleWrapper","instanceIdentityCheck","isBridgeInstance","moduleIdentityCheck","isBridgeModule","expose","id","options","filterPayload","schema","ModuleFilterPayloadSchema","addresses","sendQuery","BridgeExposeQuerySchema","map","address","Promise","all","resolve","unexpose","BridgeUnexposeQuerySchema"]}
|
package/dist/neutral/index.js
CHANGED
|
@@ -1,2 +1,44 @@
|
|
|
1
|
-
var
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
4
|
+
// src/BridgeWrapper.ts
|
|
5
|
+
import { BridgeExposeQuerySchema, BridgeUnexposeQuerySchema, isBridgeInstance, isBridgeModule, ModuleFilterPayloadSchema } from "@xyo-network/bridge-model";
|
|
6
|
+
import { constructableModuleWrapper, ModuleWrapper } from "@xyo-network/module-wrapper";
|
|
7
|
+
constructableModuleWrapper();
|
|
8
|
+
var BridgeWrapper = class extends ModuleWrapper {
|
|
9
|
+
static {
|
|
10
|
+
__name(this, "BridgeWrapper");
|
|
11
|
+
}
|
|
12
|
+
static instanceIdentityCheck = isBridgeInstance;
|
|
13
|
+
static moduleIdentityCheck = isBridgeModule;
|
|
14
|
+
async expose(id, options) {
|
|
15
|
+
const filterPayload = {
|
|
16
|
+
id,
|
|
17
|
+
schema: ModuleFilterPayloadSchema,
|
|
18
|
+
...options
|
|
19
|
+
};
|
|
20
|
+
const addresses = (await this.sendQuery({
|
|
21
|
+
schema: BridgeExposeQuerySchema
|
|
22
|
+
}, [
|
|
23
|
+
filterPayload
|
|
24
|
+
])).map(({ address }) => address);
|
|
25
|
+
return await Promise.all(addresses.map((address) => this.resolve(address)));
|
|
26
|
+
}
|
|
27
|
+
async unexpose(id, options) {
|
|
28
|
+
const filterPayload = {
|
|
29
|
+
id,
|
|
30
|
+
schema: ModuleFilterPayloadSchema,
|
|
31
|
+
...options
|
|
32
|
+
};
|
|
33
|
+
const addresses = (await this.sendQuery({
|
|
34
|
+
schema: BridgeUnexposeQuerySchema
|
|
35
|
+
}, [
|
|
36
|
+
filterPayload
|
|
37
|
+
])).map(({ address }) => address);
|
|
38
|
+
return addresses ? [] : [];
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
BridgeWrapper
|
|
43
|
+
};
|
|
2
44
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/BridgeWrapper.ts"],"sourcesContent":["import { Address } from '@xylabs/hex'\nimport {\n BridgeExposeOptions,\n BridgeExposeQuery,\n BridgeExposeQuerySchema,\n BridgeInstance,\n BridgeModule,\n BridgeUnexposeOptions,\n BridgeUnexposeQuery,\n BridgeUnexposeQuerySchema,\n isBridgeInstance,\n isBridgeModule,\n ModuleFilterPayload,\n ModuleFilterPayloadSchema,\n} from '@xyo-network/bridge-model'\nimport { AddressPayload, ModuleIdentifier, ModuleInstance } from '@xyo-network/module-model'\nimport { constructableModuleWrapper, ModuleWrapper } from '@xyo-network/module-wrapper'\n\nconstructableModuleWrapper()\nexport class BridgeWrapper<TWrappedModule extends BridgeModule = BridgeModule>\n extends ModuleWrapper<TWrappedModule>\n implements BridgeInstance<TWrappedModule['params']>\n{\n static override instanceIdentityCheck = isBridgeInstance\n static override moduleIdentityCheck = isBridgeModule\n\n async expose(id: ModuleIdentifier, options?: BridgeExposeOptions): Promise<ModuleInstance[]> {\n const filterPayload: ModuleFilterPayload = { id, schema: ModuleFilterPayloadSchema, ...options }\n const addresses = (\n await this.sendQuery<BridgeExposeQuery, ModuleFilterPayload, AddressPayload>({ schema: BridgeExposeQuerySchema }, [filterPayload])\n ).map(({ address }) => address)\n return await Promise.all((addresses as Address[]).map((address) => this.resolve(address)))\n }\n\n async unexpose(id: ModuleIdentifier, options?: BridgeUnexposeOptions): Promise<ModuleInstance[]> {\n const filterPayload: ModuleFilterPayload = { id, schema: ModuleFilterPayloadSchema, ...options }\n const addresses = (\n await this.sendQuery<BridgeUnexposeQuery, ModuleFilterPayload, AddressPayload>({ schema: BridgeUnexposeQuerySchema }, [filterPayload])\n ).map(({ address }) => address)\n return addresses ? [] : []\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/BridgeWrapper.ts"],"sourcesContent":["import { Address } from '@xylabs/hex'\nimport {\n BridgeExposeOptions,\n BridgeExposeQuery,\n BridgeExposeQuerySchema,\n BridgeInstance,\n BridgeModule,\n BridgeUnexposeOptions,\n BridgeUnexposeQuery,\n BridgeUnexposeQuerySchema,\n isBridgeInstance,\n isBridgeModule,\n ModuleFilterPayload,\n ModuleFilterPayloadSchema,\n} from '@xyo-network/bridge-model'\nimport { AddressPayload, ModuleIdentifier, ModuleInstance } from '@xyo-network/module-model'\nimport { constructableModuleWrapper, ModuleWrapper } from '@xyo-network/module-wrapper'\n\nconstructableModuleWrapper()\nexport class BridgeWrapper<TWrappedModule extends BridgeModule = BridgeModule>\n extends ModuleWrapper<TWrappedModule>\n implements BridgeInstance<TWrappedModule['params']>\n{\n static override instanceIdentityCheck = isBridgeInstance\n static override moduleIdentityCheck = isBridgeModule\n\n async expose(id: ModuleIdentifier, options?: BridgeExposeOptions): Promise<ModuleInstance[]> {\n const filterPayload: ModuleFilterPayload = { id, schema: ModuleFilterPayloadSchema, ...options }\n const addresses = (\n await this.sendQuery<BridgeExposeQuery, ModuleFilterPayload, AddressPayload>({ schema: BridgeExposeQuerySchema }, [filterPayload])\n ).map(({ address }) => address)\n return await Promise.all((addresses as Address[]).map((address) => this.resolve(address)))\n }\n\n async unexpose(id: ModuleIdentifier, options?: BridgeUnexposeOptions): Promise<ModuleInstance[]> {\n const filterPayload: ModuleFilterPayload = { id, schema: ModuleFilterPayloadSchema, ...options }\n const addresses = (\n await this.sendQuery<BridgeUnexposeQuery, ModuleFilterPayload, AddressPayload>({ schema: BridgeUnexposeQuerySchema }, [filterPayload])\n ).map(({ address }) => address)\n return addresses ? [] : []\n }\n}\n"],"mappings":";;;;AACA,SAGEA,yBAKAC,2BACAC,kBACAC,gBAEAC,iCACK;AAEP,SAASC,4BAA4BC,qBAAqB;AAE1DC,2BAAAA;AACO,IAAMC,gBAAN,cACGC,cAAAA;EAnBV,OAmBUA;;;EAGR,OAAgBC,wBAAwBC;EACxC,OAAgBC,sBAAsBC;EAEtC,MAAMC,OAAOC,IAAsBC,SAA0D;AAC3F,UAAMC,gBAAqC;MAAEF;MAAIG,QAAQC;MAA2B,GAAGH;IAAQ;AAC/F,UAAMI,aACJ,MAAM,KAAKC,UAAkE;MAAEH,QAAQI;IAAwB,GAAG;MAACL;KAAc,GACjIM,IAAI,CAAC,EAAEC,QAAO,MAAOA,OAAAA;AACvB,WAAO,MAAMC,QAAQC,IAAKN,UAAwBG,IAAI,CAACC,YAAY,KAAKG,QAAQH,OAAAA,CAAAA,CAAAA;EAClF;EAEA,MAAMI,SAASb,IAAsBC,SAA4D;AAC/F,UAAMC,gBAAqC;MAAEF;MAAIG,QAAQC;MAA2B,GAAGH;IAAQ;AAC/F,UAAMI,aACJ,MAAM,KAAKC,UAAoE;MAAEH,QAAQW;IAA0B,GAAG;MAACZ;KAAc,GACrIM,IAAI,CAAC,EAAEC,QAAO,MAAOA,OAAAA;AACvB,WAAOJ,YAAY,CAAA,IAAK,CAAA;EAC1B;AACF;","names":["BridgeExposeQuerySchema","BridgeUnexposeQuerySchema","isBridgeInstance","isBridgeModule","ModuleFilterPayloadSchema","constructableModuleWrapper","ModuleWrapper","constructableModuleWrapper","BridgeWrapper","ModuleWrapper","instanceIdentityCheck","isBridgeInstance","moduleIdentityCheck","isBridgeModule","expose","id","options","filterPayload","schema","ModuleFilterPayloadSchema","addresses","sendQuery","BridgeExposeQuerySchema","map","address","Promise","all","resolve","unexpose","BridgeUnexposeQuerySchema"]}
|
package/dist/node/index.cjs
CHANGED
|
@@ -1,2 +1,70 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
22
|
+
|
|
23
|
+
// src/index.ts
|
|
24
|
+
var src_exports = {};
|
|
25
|
+
__export(src_exports, {
|
|
26
|
+
BridgeWrapper: () => BridgeWrapper
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(src_exports);
|
|
29
|
+
|
|
30
|
+
// src/BridgeWrapper.ts
|
|
31
|
+
var import_bridge_model = require("@xyo-network/bridge-model");
|
|
32
|
+
var import_module_wrapper = require("@xyo-network/module-wrapper");
|
|
33
|
+
(0, import_module_wrapper.constructableModuleWrapper)();
|
|
34
|
+
var _BridgeWrapper = class _BridgeWrapper extends import_module_wrapper.ModuleWrapper {
|
|
35
|
+
async expose(id, options) {
|
|
36
|
+
const filterPayload = {
|
|
37
|
+
id,
|
|
38
|
+
schema: import_bridge_model.ModuleFilterPayloadSchema,
|
|
39
|
+
...options
|
|
40
|
+
};
|
|
41
|
+
const addresses = (await this.sendQuery({
|
|
42
|
+
schema: import_bridge_model.BridgeExposeQuerySchema
|
|
43
|
+
}, [
|
|
44
|
+
filterPayload
|
|
45
|
+
])).map(({ address }) => address);
|
|
46
|
+
return await Promise.all(addresses.map((address) => this.resolve(address)));
|
|
47
|
+
}
|
|
48
|
+
async unexpose(id, options) {
|
|
49
|
+
const filterPayload = {
|
|
50
|
+
id,
|
|
51
|
+
schema: import_bridge_model.ModuleFilterPayloadSchema,
|
|
52
|
+
...options
|
|
53
|
+
};
|
|
54
|
+
const addresses = (await this.sendQuery({
|
|
55
|
+
schema: import_bridge_model.BridgeUnexposeQuerySchema
|
|
56
|
+
}, [
|
|
57
|
+
filterPayload
|
|
58
|
+
])).map(({ address }) => address);
|
|
59
|
+
return addresses ? [] : [];
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
__name(_BridgeWrapper, "BridgeWrapper");
|
|
63
|
+
__publicField(_BridgeWrapper, "instanceIdentityCheck", import_bridge_model.isBridgeInstance);
|
|
64
|
+
__publicField(_BridgeWrapper, "moduleIdentityCheck", import_bridge_model.isBridgeModule);
|
|
65
|
+
var BridgeWrapper = _BridgeWrapper;
|
|
66
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
67
|
+
0 && (module.exports = {
|
|
68
|
+
BridgeWrapper
|
|
69
|
+
});
|
|
2
70
|
//# sourceMappingURL=index.cjs.map
|
package/dist/node/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/BridgeWrapper.ts"],"sourcesContent":["export * from './BridgeWrapper'\n","import { Address } from '@xylabs/hex'\nimport {\n BridgeExposeOptions,\n BridgeExposeQuery,\n BridgeExposeQuerySchema,\n BridgeInstance,\n BridgeModule,\n BridgeUnexposeOptions,\n BridgeUnexposeQuery,\n BridgeUnexposeQuerySchema,\n isBridgeInstance,\n isBridgeModule,\n ModuleFilterPayload,\n ModuleFilterPayloadSchema,\n} from '@xyo-network/bridge-model'\nimport { AddressPayload, ModuleIdentifier, ModuleInstance } from '@xyo-network/module-model'\nimport { constructableModuleWrapper, ModuleWrapper } from '@xyo-network/module-wrapper'\n\nconstructableModuleWrapper()\nexport class BridgeWrapper<TWrappedModule extends BridgeModule = BridgeModule>\n extends ModuleWrapper<TWrappedModule>\n implements BridgeInstance<TWrappedModule['params']>\n{\n static override instanceIdentityCheck = isBridgeInstance\n static override moduleIdentityCheck = isBridgeModule\n\n async expose(id: ModuleIdentifier, options?: BridgeExposeOptions): Promise<ModuleInstance[]> {\n const filterPayload: ModuleFilterPayload = { id, schema: ModuleFilterPayloadSchema, ...options }\n const addresses = (\n await this.sendQuery<BridgeExposeQuery, ModuleFilterPayload, AddressPayload>({ schema: BridgeExposeQuerySchema }, [filterPayload])\n ).map(({ address }) => address)\n return await Promise.all((addresses as Address[]).map((address) => this.resolve(address)))\n }\n\n async unexpose(id: ModuleIdentifier, options?: BridgeUnexposeOptions): Promise<ModuleInstance[]> {\n const filterPayload: ModuleFilterPayload = { id, schema: ModuleFilterPayloadSchema, ...options }\n const addresses = (\n await this.sendQuery<BridgeUnexposeQuery, ModuleFilterPayload, AddressPayload>({ schema: BridgeUnexposeQuerySchema }, [filterPayload])\n ).map(({ address }) => address)\n return addresses ? [] : []\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/BridgeWrapper.ts"],"sourcesContent":["export * from './BridgeWrapper'\n","import { Address } from '@xylabs/hex'\nimport {\n BridgeExposeOptions,\n BridgeExposeQuery,\n BridgeExposeQuerySchema,\n BridgeInstance,\n BridgeModule,\n BridgeUnexposeOptions,\n BridgeUnexposeQuery,\n BridgeUnexposeQuerySchema,\n isBridgeInstance,\n isBridgeModule,\n ModuleFilterPayload,\n ModuleFilterPayloadSchema,\n} from '@xyo-network/bridge-model'\nimport { AddressPayload, ModuleIdentifier, ModuleInstance } from '@xyo-network/module-model'\nimport { constructableModuleWrapper, ModuleWrapper } from '@xyo-network/module-wrapper'\n\nconstructableModuleWrapper()\nexport class BridgeWrapper<TWrappedModule extends BridgeModule = BridgeModule>\n extends ModuleWrapper<TWrappedModule>\n implements BridgeInstance<TWrappedModule['params']>\n{\n static override instanceIdentityCheck = isBridgeInstance\n static override moduleIdentityCheck = isBridgeModule\n\n async expose(id: ModuleIdentifier, options?: BridgeExposeOptions): Promise<ModuleInstance[]> {\n const filterPayload: ModuleFilterPayload = { id, schema: ModuleFilterPayloadSchema, ...options }\n const addresses = (\n await this.sendQuery<BridgeExposeQuery, ModuleFilterPayload, AddressPayload>({ schema: BridgeExposeQuerySchema }, [filterPayload])\n ).map(({ address }) => address)\n return await Promise.all((addresses as Address[]).map((address) => this.resolve(address)))\n }\n\n async unexpose(id: ModuleIdentifier, options?: BridgeUnexposeOptions): Promise<ModuleInstance[]> {\n const filterPayload: ModuleFilterPayload = { id, schema: ModuleFilterPayloadSchema, ...options }\n const addresses = (\n await this.sendQuery<BridgeUnexposeQuery, ModuleFilterPayload, AddressPayload>({ schema: BridgeUnexposeQuerySchema }, [filterPayload])\n ).map(({ address }) => address)\n return addresses ? [] : []\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;ACCA,0BAaO;AAEP,4BAA0D;IAE1DA,kDAAAA;AACO,IAAMC,iBAAN,MAAMA,uBACHC,oCAAAA;EAMR,MAAMC,OAAOC,IAAsBC,SAA0D;AAC3F,UAAMC,gBAAqC;MAAEF;MAAIG,QAAQC;MAA2B,GAAGH;IAAQ;AAC/F,UAAMI,aACJ,MAAM,KAAKC,UAAkE;MAAEH,QAAQI;IAAwB,GAAG;MAACL;KAAc,GACjIM,IAAI,CAAC,EAAEC,QAAO,MAAOA,OAAAA;AACvB,WAAO,MAAMC,QAAQC,IAAKN,UAAwBG,IAAI,CAACC,YAAY,KAAKG,QAAQH,OAAAA,CAAAA,CAAAA;EAClF;EAEA,MAAMI,SAASb,IAAsBC,SAA4D;AAC/F,UAAMC,gBAAqC;MAAEF;MAAIG,QAAQC;MAA2B,GAAGH;IAAQ;AAC/F,UAAMI,aACJ,MAAM,KAAKC,UAAoE;MAAEH,QAAQW;IAA0B,GAAG;MAACZ;KAAc,GACrIM,IAAI,CAAC,EAAEC,QAAO,MAAOA,OAAAA;AACvB,WAAOJ,YAAY,CAAA,IAAK,CAAA;EAC1B;AACF;AArBUP;AAGR,cAJWD,gBAIKkB,yBAAwBC;AACxC,cALWnB,gBAKKoB,uBAAsBC;AALjC,IAAMrB,gBAAN;","names":["constructableModuleWrapper","BridgeWrapper","ModuleWrapper","expose","id","options","filterPayload","schema","ModuleFilterPayloadSchema","addresses","sendQuery","BridgeExposeQuerySchema","map","address","Promise","all","resolve","unexpose","BridgeUnexposeQuerySchema","instanceIdentityCheck","isBridgeInstance","moduleIdentityCheck","isBridgeModule"]}
|
package/dist/node/index.js
CHANGED
|
@@ -1,2 +1,45 @@
|
|
|
1
|
-
var
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
4
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
|
|
6
|
+
// src/BridgeWrapper.ts
|
|
7
|
+
import { BridgeExposeQuerySchema, BridgeUnexposeQuerySchema, isBridgeInstance, isBridgeModule, ModuleFilterPayloadSchema } from "@xyo-network/bridge-model";
|
|
8
|
+
import { constructableModuleWrapper, ModuleWrapper } from "@xyo-network/module-wrapper";
|
|
9
|
+
constructableModuleWrapper();
|
|
10
|
+
var _BridgeWrapper = class _BridgeWrapper extends ModuleWrapper {
|
|
11
|
+
async expose(id, options) {
|
|
12
|
+
const filterPayload = {
|
|
13
|
+
id,
|
|
14
|
+
schema: ModuleFilterPayloadSchema,
|
|
15
|
+
...options
|
|
16
|
+
};
|
|
17
|
+
const addresses = (await this.sendQuery({
|
|
18
|
+
schema: BridgeExposeQuerySchema
|
|
19
|
+
}, [
|
|
20
|
+
filterPayload
|
|
21
|
+
])).map(({ address }) => address);
|
|
22
|
+
return await Promise.all(addresses.map((address) => this.resolve(address)));
|
|
23
|
+
}
|
|
24
|
+
async unexpose(id, options) {
|
|
25
|
+
const filterPayload = {
|
|
26
|
+
id,
|
|
27
|
+
schema: ModuleFilterPayloadSchema,
|
|
28
|
+
...options
|
|
29
|
+
};
|
|
30
|
+
const addresses = (await this.sendQuery({
|
|
31
|
+
schema: BridgeUnexposeQuerySchema
|
|
32
|
+
}, [
|
|
33
|
+
filterPayload
|
|
34
|
+
])).map(({ address }) => address);
|
|
35
|
+
return addresses ? [] : [];
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
__name(_BridgeWrapper, "BridgeWrapper");
|
|
39
|
+
__publicField(_BridgeWrapper, "instanceIdentityCheck", isBridgeInstance);
|
|
40
|
+
__publicField(_BridgeWrapper, "moduleIdentityCheck", isBridgeModule);
|
|
41
|
+
var BridgeWrapper = _BridgeWrapper;
|
|
42
|
+
export {
|
|
43
|
+
BridgeWrapper
|
|
44
|
+
};
|
|
2
45
|
//# sourceMappingURL=index.js.map
|
package/dist/node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/BridgeWrapper.ts"],"sourcesContent":["import { Address } from '@xylabs/hex'\nimport {\n BridgeExposeOptions,\n BridgeExposeQuery,\n BridgeExposeQuerySchema,\n BridgeInstance,\n BridgeModule,\n BridgeUnexposeOptions,\n BridgeUnexposeQuery,\n BridgeUnexposeQuerySchema,\n isBridgeInstance,\n isBridgeModule,\n ModuleFilterPayload,\n ModuleFilterPayloadSchema,\n} from '@xyo-network/bridge-model'\nimport { AddressPayload, ModuleIdentifier, ModuleInstance } from '@xyo-network/module-model'\nimport { constructableModuleWrapper, ModuleWrapper } from '@xyo-network/module-wrapper'\n\nconstructableModuleWrapper()\nexport class BridgeWrapper<TWrappedModule extends BridgeModule = BridgeModule>\n extends ModuleWrapper<TWrappedModule>\n implements BridgeInstance<TWrappedModule['params']>\n{\n static override instanceIdentityCheck = isBridgeInstance\n static override moduleIdentityCheck = isBridgeModule\n\n async expose(id: ModuleIdentifier, options?: BridgeExposeOptions): Promise<ModuleInstance[]> {\n const filterPayload: ModuleFilterPayload = { id, schema: ModuleFilterPayloadSchema, ...options }\n const addresses = (\n await this.sendQuery<BridgeExposeQuery, ModuleFilterPayload, AddressPayload>({ schema: BridgeExposeQuerySchema }, [filterPayload])\n ).map(({ address }) => address)\n return await Promise.all((addresses as Address[]).map((address) => this.resolve(address)))\n }\n\n async unexpose(id: ModuleIdentifier, options?: BridgeUnexposeOptions): Promise<ModuleInstance[]> {\n const filterPayload: ModuleFilterPayload = { id, schema: ModuleFilterPayloadSchema, ...options }\n const addresses = (\n await this.sendQuery<BridgeUnexposeQuery, ModuleFilterPayload, AddressPayload>({ schema: BridgeUnexposeQuerySchema }, [filterPayload])\n ).map(({ address }) => address)\n return addresses ? [] : []\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/BridgeWrapper.ts"],"sourcesContent":["import { Address } from '@xylabs/hex'\nimport {\n BridgeExposeOptions,\n BridgeExposeQuery,\n BridgeExposeQuerySchema,\n BridgeInstance,\n BridgeModule,\n BridgeUnexposeOptions,\n BridgeUnexposeQuery,\n BridgeUnexposeQuerySchema,\n isBridgeInstance,\n isBridgeModule,\n ModuleFilterPayload,\n ModuleFilterPayloadSchema,\n} from '@xyo-network/bridge-model'\nimport { AddressPayload, ModuleIdentifier, ModuleInstance } from '@xyo-network/module-model'\nimport { constructableModuleWrapper, ModuleWrapper } from '@xyo-network/module-wrapper'\n\nconstructableModuleWrapper()\nexport class BridgeWrapper<TWrappedModule extends BridgeModule = BridgeModule>\n extends ModuleWrapper<TWrappedModule>\n implements BridgeInstance<TWrappedModule['params']>\n{\n static override instanceIdentityCheck = isBridgeInstance\n static override moduleIdentityCheck = isBridgeModule\n\n async expose(id: ModuleIdentifier, options?: BridgeExposeOptions): Promise<ModuleInstance[]> {\n const filterPayload: ModuleFilterPayload = { id, schema: ModuleFilterPayloadSchema, ...options }\n const addresses = (\n await this.sendQuery<BridgeExposeQuery, ModuleFilterPayload, AddressPayload>({ schema: BridgeExposeQuerySchema }, [filterPayload])\n ).map(({ address }) => address)\n return await Promise.all((addresses as Address[]).map((address) => this.resolve(address)))\n }\n\n async unexpose(id: ModuleIdentifier, options?: BridgeUnexposeOptions): Promise<ModuleInstance[]> {\n const filterPayload: ModuleFilterPayload = { id, schema: ModuleFilterPayloadSchema, ...options }\n const addresses = (\n await this.sendQuery<BridgeUnexposeQuery, ModuleFilterPayload, AddressPayload>({ schema: BridgeUnexposeQuerySchema }, [filterPayload])\n ).map(({ address }) => address)\n return addresses ? [] : []\n }\n}\n"],"mappings":";;;;;;AACA,SAGEA,yBAKAC,2BACAC,kBACAC,gBAEAC,iCACK;AAEP,SAASC,4BAA4BC,qBAAqB;AAE1DC,2BAAAA;AACO,IAAMC,iBAAN,MAAMA,uBACHC,cAAAA;EAMR,MAAMC,OAAOC,IAAsBC,SAA0D;AAC3F,UAAMC,gBAAqC;MAAEF;MAAIG,QAAQC;MAA2B,GAAGH;IAAQ;AAC/F,UAAMI,aACJ,MAAM,KAAKC,UAAkE;MAAEH,QAAQI;IAAwB,GAAG;MAACL;KAAc,GACjIM,IAAI,CAAC,EAAEC,QAAO,MAAOA,OAAAA;AACvB,WAAO,MAAMC,QAAQC,IAAKN,UAAwBG,IAAI,CAACC,YAAY,KAAKG,QAAQH,OAAAA,CAAAA,CAAAA;EAClF;EAEA,MAAMI,SAASb,IAAsBC,SAA4D;AAC/F,UAAMC,gBAAqC;MAAEF;MAAIG,QAAQC;MAA2B,GAAGH;IAAQ;AAC/F,UAAMI,aACJ,MAAM,KAAKC,UAAoE;MAAEH,QAAQW;IAA0B,GAAG;MAACZ;KAAc,GACrIM,IAAI,CAAC,EAAEC,QAAO,MAAOA,OAAAA;AACvB,WAAOJ,YAAY,CAAA,IAAK,CAAA;EAC1B;AACF;AArBUP;AAGR,cAJWD,gBAIKkB,yBAAwBC;AACxC,cALWnB,gBAKKoB,uBAAsBC;AALjC,IAAMrB,gBAAN;","names":["BridgeExposeQuerySchema","BridgeUnexposeQuerySchema","isBridgeInstance","isBridgeModule","ModuleFilterPayloadSchema","constructableModuleWrapper","ModuleWrapper","constructableModuleWrapper","BridgeWrapper","ModuleWrapper","expose","id","options","filterPayload","schema","ModuleFilterPayloadSchema","addresses","sendQuery","BridgeExposeQuerySchema","map","address","Promise","all","resolve","unexpose","BridgeUnexposeQuerySchema","instanceIdentityCheck","isBridgeInstance","moduleIdentityCheck","isBridgeModule"]}
|
package/package.json
CHANGED
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@xylabs/hex": "^3.5.1",
|
|
14
|
-
"@xyo-network/bridge-model": "~2.107.
|
|
15
|
-
"@xyo-network/module-model": "~2.107.
|
|
16
|
-
"@xyo-network/module-wrapper": "~2.107.
|
|
14
|
+
"@xyo-network/bridge-model": "~2.107.5",
|
|
15
|
+
"@xyo-network/module-model": "~2.107.5",
|
|
16
|
+
"@xyo-network/module-wrapper": "~2.107.5"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@xylabs/ts-scripts-yarn3": "^3.11.
|
|
20
|
-
"@xylabs/tsconfig": "^3.11.
|
|
19
|
+
"@xylabs/ts-scripts-yarn3": "^3.11.10",
|
|
20
|
+
"@xylabs/tsconfig": "^3.11.10",
|
|
21
21
|
"typescript": "^5.5.2"
|
|
22
22
|
},
|
|
23
23
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
@@ -59,6 +59,6 @@
|
|
|
59
59
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
|
|
60
60
|
},
|
|
61
61
|
"sideEffects": false,
|
|
62
|
-
"version": "2.107.
|
|
62
|
+
"version": "2.107.5",
|
|
63
63
|
"type": "module"
|
|
64
64
|
}
|