@xyo-network/sdk 7.0.2 → 7.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_pkg/module-abstract/neutral/index.mjs +7 -10
- package/dist/_pkg/module-resolver/neutral/ResolveHelper/resolveAddressToInstance.d.ts +5 -5
- package/dist/_pkg/module-resolver/neutral/ResolveHelper/resolveLocalNameToAddress.d.ts +3 -3
- package/dist/_pkg/module-resolver/neutral/ResolveHelper/resolveLocalNameToInstance.d.ts +1 -1
- package/dist/_pkg/module-resolver/neutral/ResolveHelper/resolvePathToAddress.d.ts +1 -1
- package/dist/_pkg/module-resolver/neutral/ResolveHelper/resolvePathToInstance.d.ts +1 -1
- package/dist/_pkg/module-resolver/neutral/index.mjs +17 -23
- package/package.json +21 -21
|
@@ -614,16 +614,13 @@ var AbstractModule = class _AbstractModule extends AbstractCreatable {
|
|
|
614
614
|
}
|
|
615
615
|
case "object": {
|
|
616
616
|
if (Array.isArray(value)) {
|
|
617
|
-
return (
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
(
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
true
|
|
625
|
-
) && valid
|
|
626
|
-
);
|
|
617
|
+
return value.reduce(
|
|
618
|
+
(valid2, value2) => (
|
|
619
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
620
|
+
this.validateConfig(value2, [...parents, key]) && valid2
|
|
621
|
+
),
|
|
622
|
+
true
|
|
623
|
+
) && valid;
|
|
627
624
|
}
|
|
628
625
|
if (!isSerializable(value)) {
|
|
629
626
|
this.logger?.warn(`Fields that are not serializable to JSON are not allowed in config [${parents?.join(".")}.${key}]`);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ModuleInstance } from '../../../module-model/neutral/index.ts';
|
|
2
2
|
import type { XyoAddress } from '../../../sdk-protocol/neutral/index.ts';
|
|
3
3
|
import type { ModuleResolveDirection } from './model.ts';
|
|
4
|
-
export declare const resolveAddressToInstanceDown: (root: ModuleInstance, address: XyoAddress, includePrivate?: boolean
|
|
5
|
-
export declare const resolveAddressToInstanceSiblings: (root: ModuleInstance, address: XyoAddress, includePrivate?: boolean
|
|
6
|
-
export declare const resolveAddressToInstanceUp: (root: ModuleInstance, address: XyoAddress, includePrivate?: boolean
|
|
7
|
-
export declare const resolveAddressToInstanceAll: (root: ModuleInstance, address: XyoAddress, includePrivate?: boolean
|
|
8
|
-
export declare const resolveAddressToInstance: (root: ModuleInstance, address: XyoAddress, includePrivate?: boolean
|
|
4
|
+
export declare const resolveAddressToInstanceDown: (root: ModuleInstance, address: XyoAddress, includePrivate?: boolean, ignore?: XyoAddress[]) => Promise<ModuleInstance | undefined>;
|
|
5
|
+
export declare const resolveAddressToInstanceSiblings: (root: ModuleInstance, address: XyoAddress, includePrivate?: boolean, ignore?: XyoAddress[]) => Promise<ModuleInstance | undefined>;
|
|
6
|
+
export declare const resolveAddressToInstanceUp: (root: ModuleInstance, address: XyoAddress, includePrivate?: boolean, ignore?: XyoAddress[]) => Promise<ModuleInstance | undefined>;
|
|
7
|
+
export declare const resolveAddressToInstanceAll: (root: ModuleInstance, address: XyoAddress, includePrivate?: boolean, ignore?: XyoAddress[]) => Promise<ModuleInstance | undefined>;
|
|
8
|
+
export declare const resolveAddressToInstance: (root: ModuleInstance, address: XyoAddress, includePrivate?: boolean, ignore?: XyoAddress[], direction?: ModuleResolveDirection) => Promise<ModuleInstance | undefined>;
|
|
@@ -2,6 +2,6 @@ import type { ModuleInstance, ModuleName } from '../../../module-model/neutral/i
|
|
|
2
2
|
import type { XyoAddress } from '../../../sdk-protocol/neutral/index.ts';
|
|
3
3
|
import type { ModuleResolveDirection } from './model.ts';
|
|
4
4
|
export declare const resolveLocalNameToAddressUp: (root: ModuleInstance, modName: ModuleName) => Promise<XyoAddress | undefined>;
|
|
5
|
-
export declare const resolveLocalNameToAddressDown: (root: ModuleInstance, modName: ModuleName, includePrivate?: boolean
|
|
6
|
-
export declare const resolveLocalNameToAddressAll: (root: ModuleInstance, modName: ModuleName, includePrivate?: boolean
|
|
7
|
-
export declare const resolveLocalNameToAddress: (root: ModuleInstance, modName: ModuleName, includePrivate?: boolean
|
|
5
|
+
export declare const resolveLocalNameToAddressDown: (root: ModuleInstance, modName: ModuleName, includePrivate?: boolean) => Promise<XyoAddress | undefined>;
|
|
6
|
+
export declare const resolveLocalNameToAddressAll: (root: ModuleInstance, modName: ModuleName, includePrivate?: boolean) => Promise<XyoAddress | undefined>;
|
|
7
|
+
export declare const resolveLocalNameToAddress: (root: ModuleInstance, modName: ModuleName, includePrivate?: boolean, direction?: ModuleResolveDirection) => Promise<XyoAddress | undefined>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ModuleInstance, ModuleName } from '../../../module-model/neutral/index.ts';
|
|
2
2
|
import type { ModuleResolveDirection } from './model.ts';
|
|
3
3
|
export declare const resolveLocalNameToInstanceUp: (root: ModuleInstance, modName: ModuleName) => Promise<ModuleInstance | undefined>;
|
|
4
|
-
export declare const resolveLocalNameToInstanceDown: (root: ModuleInstance, modName: ModuleName, includePrivate?: boolean
|
|
4
|
+
export declare const resolveLocalNameToInstanceDown: (root: ModuleInstance, modName: ModuleName, includePrivate?: boolean) => Promise<ModuleInstance | undefined>;
|
|
5
5
|
export declare const resolveLocalNameToInstanceAll: (root: ModuleInstance, modName: ModuleName, includePrivate?: boolean) => Promise<ModuleInstance | undefined>;
|
|
6
6
|
export declare const resolveLocalNameToInstance: (root: ModuleInstance, modName: ModuleName, includePrivate?: boolean, direction?: ModuleResolveDirection) => Promise<ModuleInstance | undefined>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ModuleIdentifierTransformer, ModuleInstance } from '../../../module-model/neutral/index.ts';
|
|
2
2
|
import type { XyoAddress } from '../../../sdk-protocol/neutral/index.ts';
|
|
3
|
-
export declare const resolvePathToAddress: (root: ModuleInstance, path: string, includePrivate?: boolean
|
|
3
|
+
export declare const resolvePathToAddress: (root: ModuleInstance, path: string, includePrivate?: boolean, transformers?: ModuleIdentifierTransformer[]) => Promise<XyoAddress | undefined>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ModuleIdentifierTransformer, ModuleInstance } from '../../../module-model/neutral/index.ts';
|
|
2
|
-
export declare const resolvePathToInstance: (root: ModuleInstance, path: string, includePrivate?: boolean
|
|
2
|
+
export declare const resolvePathToInstance: (root: ModuleInstance, path: string, includePrivate?: boolean, transformers?: ModuleIdentifierTransformer[]) => Promise<ModuleInstance | undefined>;
|
|
@@ -61,7 +61,7 @@ import {
|
|
|
61
61
|
import { LRUCache } from "lru-cache";
|
|
62
62
|
|
|
63
63
|
// src/ResolveHelper/resolveAddressToInstance.ts
|
|
64
|
-
var resolveAddressToInstanceDown = async (root, address, includePrivate
|
|
64
|
+
var resolveAddressToInstanceDown = async (root, address, includePrivate, ignore = []) => {
|
|
65
65
|
if (root.address === address) {
|
|
66
66
|
return root;
|
|
67
67
|
}
|
|
@@ -78,7 +78,7 @@ var resolveAddressToInstanceDown = async (root, address, includePrivate = void 0
|
|
|
78
78
|
}
|
|
79
79
|
cache?.set(address, null);
|
|
80
80
|
};
|
|
81
|
-
var resolveAddressToInstanceSiblings = async (root, address, includePrivate
|
|
81
|
+
var resolveAddressToInstanceSiblings = async (root, address, includePrivate, ignore = []) => {
|
|
82
82
|
const siblings = await root.siblings?.() ?? [];
|
|
83
83
|
for (const sibling of siblings) {
|
|
84
84
|
const found = await resolveAddressToInstanceDown(sibling, address, includePrivate, ignore);
|
|
@@ -87,7 +87,7 @@ var resolveAddressToInstanceSiblings = async (root, address, includePrivate = vo
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
};
|
|
90
|
-
var resolveAddressToInstanceUp = async (root, address, includePrivate
|
|
90
|
+
var resolveAddressToInstanceUp = async (root, address, includePrivate, ignore = []) => {
|
|
91
91
|
const cache = root.addressCache?.("up", includePrivate ?? true);
|
|
92
92
|
const parents = await root.parents?.() ?? [];
|
|
93
93
|
for (const parent of parents) {
|
|
@@ -99,13 +99,13 @@ var resolveAddressToInstanceUp = async (root, address, includePrivate = void 0,
|
|
|
99
99
|
}
|
|
100
100
|
cache?.set(address, null);
|
|
101
101
|
};
|
|
102
|
-
var resolveAddressToInstanceAll = async (root, address, includePrivate
|
|
102
|
+
var resolveAddressToInstanceAll = async (root, address, includePrivate, ignore = []) => {
|
|
103
103
|
const cache = root.addressCache?.("all", !!includePrivate);
|
|
104
104
|
const result = await resolveAddressToInstanceDown(root, address, includePrivate ?? false, ignore) ?? await resolveAddressToInstanceUp(root, address, includePrivate ?? true, ignore);
|
|
105
105
|
cache?.set(address, result ? new WeakRef(result) : null);
|
|
106
106
|
return result;
|
|
107
107
|
};
|
|
108
|
-
var resolveAddressToInstance = async (root, address, includePrivate
|
|
108
|
+
var resolveAddressToInstance = async (root, address, includePrivate, ignore = [], direction = "all") => {
|
|
109
109
|
switch (direction) {
|
|
110
110
|
case "all": {
|
|
111
111
|
return await resolveAddressToInstanceAll(root, address, includePrivate, ignore);
|
|
@@ -180,7 +180,7 @@ var resolveLocalNameToInstanceUp = async (root, modName) => {
|
|
|
180
180
|
const parents = await root.parents?.() ?? [];
|
|
181
181
|
return parents.find((parent) => parent.config.name === modName);
|
|
182
182
|
};
|
|
183
|
-
var resolveLocalNameToInstanceDown = async (root, modName, includePrivate
|
|
183
|
+
var resolveLocalNameToInstanceDown = async (root, modName, includePrivate) => {
|
|
184
184
|
const privateChildren = (includePrivate ? await root.privateChildren?.() : []) ?? [];
|
|
185
185
|
const publicChildren = await root.publicChildren?.() ?? [];
|
|
186
186
|
const children = [...privateChildren, ...publicChildren];
|
|
@@ -207,13 +207,13 @@ var resolveLocalNameToInstance = async (root, modName, includePrivate = false, d
|
|
|
207
207
|
var resolveLocalNameToAddressUp = async (root, modName) => {
|
|
208
208
|
return (await resolveLocalNameToInstanceUp(root, modName))?.address;
|
|
209
209
|
};
|
|
210
|
-
var resolveLocalNameToAddressDown = async (root, modName, includePrivate
|
|
210
|
+
var resolveLocalNameToAddressDown = async (root, modName, includePrivate) => {
|
|
211
211
|
return (await resolveLocalNameToInstanceDown(root, modName, includePrivate))?.address;
|
|
212
212
|
};
|
|
213
|
-
var resolveLocalNameToAddressAll = async (root, modName, includePrivate
|
|
213
|
+
var resolveLocalNameToAddressAll = async (root, modName, includePrivate) => {
|
|
214
214
|
return (await resolveLocalNameToInstanceAll(root, modName, includePrivate))?.address;
|
|
215
215
|
};
|
|
216
|
-
var resolveLocalNameToAddress = async (root, modName, includePrivate
|
|
216
|
+
var resolveLocalNameToAddress = async (root, modName, includePrivate, direction = "all") => {
|
|
217
217
|
return (await resolveLocalNameToInstance(root, modName, includePrivate, direction))?.address;
|
|
218
218
|
};
|
|
219
219
|
|
|
@@ -227,7 +227,7 @@ var transformModuleIdentifier = async (id, transformers) => {
|
|
|
227
227
|
};
|
|
228
228
|
|
|
229
229
|
// src/ResolveHelper/resolvePathToInstance.ts
|
|
230
|
-
var resolvePathToInstance = async (root, path, includePrivate
|
|
230
|
+
var resolvePathToInstance = async (root, path, includePrivate, transformers = ResolveHelperStatic.transformers) => {
|
|
231
231
|
const parts = path.split(MODULE_PATH_SEPARATOR);
|
|
232
232
|
const first = await transformModuleIdentifier(
|
|
233
233
|
assertEx2(parts.shift(), () => `First part is invalid [${path}]`),
|
|
@@ -247,7 +247,7 @@ var resolvePathToInstance = async (root, path, includePrivate = void 0, transfor
|
|
|
247
247
|
};
|
|
248
248
|
|
|
249
249
|
// src/ResolveHelper/resolvePathToAddress.ts
|
|
250
|
-
var resolvePathToAddress = async (root, path, includePrivate
|
|
250
|
+
var resolvePathToAddress = async (root, path, includePrivate, transformers = ResolveHelperStatic.transformers) => {
|
|
251
251
|
return (await resolvePathToInstance(root, path, includePrivate, transformers))?.address;
|
|
252
252
|
};
|
|
253
253
|
|
|
@@ -483,18 +483,12 @@ var SimpleModuleResolver = class extends AbstractModuleResolver {
|
|
|
483
483
|
}).filter(exists2);
|
|
484
484
|
}
|
|
485
485
|
resolveByQuery(modules, query) {
|
|
486
|
-
return modules.filter((mod) => (
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
return
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
const queryable = mod.queries.includes(query2);
|
|
493
|
-
return supported2 && queryable;
|
|
494
|
-
}, true) || supported
|
|
495
|
-
);
|
|
496
|
-
}, false)
|
|
497
|
-
)).filter(exists2);
|
|
486
|
+
return modules.filter((mod) => query?.reduce((supported, queryList) => {
|
|
487
|
+
return queryList.reduce((supported2, query2) => {
|
|
488
|
+
const queryable = mod.queries.includes(query2);
|
|
489
|
+
return supported2 && queryable;
|
|
490
|
+
}, true) || supported;
|
|
491
|
+
}, false)).filter(exists2);
|
|
498
492
|
}
|
|
499
493
|
};
|
|
500
494
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/sdk",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.3",
|
|
4
4
|
"description": "Self-contained all-in-one SDK for XYO Protocol 2.0",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -106,9 +106,9 @@
|
|
|
106
106
|
"@opentelemetry/sdk-trace-base": "^2.8.0",
|
|
107
107
|
"@scure/base": "~2.2.0",
|
|
108
108
|
"@scure/bip39": "~2.2.0",
|
|
109
|
-
"@xylabs/geo": "
|
|
110
|
-
"@xylabs/sdk": "
|
|
111
|
-
"@xylabs/threads": "
|
|
109
|
+
"@xylabs/geo": "^7.0.1",
|
|
110
|
+
"@xylabs/sdk": "^7.0.1",
|
|
111
|
+
"@xylabs/threads": "^7.0.1",
|
|
112
112
|
"@xylabs/toolchain": "^8.5.3",
|
|
113
113
|
"@xylabs/tsconfig": "^8.5.3",
|
|
114
114
|
"@xyo-network/core-payload-plugins": "^7.0.4",
|
|
@@ -119,31 +119,31 @@
|
|
|
119
119
|
"ajv": "^8.20.0",
|
|
120
120
|
"async-mutex": "^0.5.0",
|
|
121
121
|
"browserslist": "4.28.4",
|
|
122
|
-
"debug": "
|
|
122
|
+
"debug": "^4.4.3",
|
|
123
123
|
"eslint": "^10.6.0",
|
|
124
124
|
"eslint-import-resolver-typescript": "^4.4.5",
|
|
125
125
|
"ethers": "^6.17.0",
|
|
126
126
|
"hash-wasm": "~4.12.0",
|
|
127
127
|
"idb": "^8.0.3",
|
|
128
128
|
"lru-cache": "^11.5.1",
|
|
129
|
-
"observable-fns": "
|
|
129
|
+
"observable-fns": "^0.6.1",
|
|
130
130
|
"typescript": "~6.0.3",
|
|
131
131
|
"vite": "^8.1.0",
|
|
132
132
|
"vitest": "~4.1.9",
|
|
133
133
|
"webextension-polyfill": "^0.12.0",
|
|
134
134
|
"zod": "^4.4.3",
|
|
135
|
-
"@xyo-network/address-payload-plugin": "~7.0.
|
|
136
|
-
"@xyo-network/
|
|
137
|
-
"@xyo-network/
|
|
138
|
-
"@xyo-network/
|
|
139
|
-
"@xyo-network/bridge": "~7.0.
|
|
140
|
-
"@xyo-network/manifest-wrapper": "~7.0.
|
|
141
|
-
"@xyo-network/
|
|
142
|
-
"@xyo-network/
|
|
143
|
-
"@xyo-network/
|
|
144
|
-
"@xyo-network/
|
|
145
|
-
"@xyo-network/sentinel": "~7.0.
|
|
146
|
-
"@xyo-network/
|
|
135
|
+
"@xyo-network/address-payload-plugin": "~7.0.3",
|
|
136
|
+
"@xyo-network/api-location-diviner": "~7.0.3",
|
|
137
|
+
"@xyo-network/archivist": "~7.0.3",
|
|
138
|
+
"@xyo-network/boundwitness-loader": "~7.0.3",
|
|
139
|
+
"@xyo-network/bridge": "~7.0.3",
|
|
140
|
+
"@xyo-network/manifest-wrapper": "~7.0.3",
|
|
141
|
+
"@xyo-network/diviner": "~7.0.3",
|
|
142
|
+
"@xyo-network/module": "~7.0.3",
|
|
143
|
+
"@xyo-network/node": "~7.0.3",
|
|
144
|
+
"@xyo-network/payloadset-plugin": "~7.0.3",
|
|
145
|
+
"@xyo-network/sentinel": "~7.0.3",
|
|
146
|
+
"@xyo-network/witness": "~7.0.3"
|
|
147
147
|
},
|
|
148
148
|
"peerDependencies": {
|
|
149
149
|
"@bitauth/libauth": "~3.0",
|
|
@@ -152,9 +152,9 @@
|
|
|
152
152
|
"@opentelemetry/sdk-trace-base": "^2.7",
|
|
153
153
|
"@scure/base": "~2.2",
|
|
154
154
|
"@scure/bip39": "~2.2",
|
|
155
|
-
"@xylabs/geo": "
|
|
156
|
-
"@xylabs/sdk": "
|
|
157
|
-
"@xylabs/threads": "
|
|
155
|
+
"@xylabs/geo": "^7.0",
|
|
156
|
+
"@xylabs/sdk": "^7.0",
|
|
157
|
+
"@xylabs/threads": "^7.0",
|
|
158
158
|
"ajv": "^8.20",
|
|
159
159
|
"async-mutex": "^0.5",
|
|
160
160
|
"debug": "^4.4",
|