@olane/o-tools-common 0.6.13 → 0.7.2
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/encryption/encryption.tool.d.ts +5 -3
- package/dist/encryption/encryption.tool.d.ts.map +1 -1
- package/dist/encryption/encryption.tool.js +2 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -2
- package/dist/init.d.ts +2 -4
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +5 -16
- package/dist/search/search.tool.d.ts +4 -3
- package/dist/search/search.tool.d.ts.map +1 -1
- package/dist/search/search.tool.js +4 -4
- package/package.json +8 -7
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ToolResult } from '@olane/o-tool';
|
|
2
2
|
import { oRequest } from '@olane/o-core';
|
|
3
|
-
|
|
3
|
+
import { oLaneTool } from '@olane/o-lane';
|
|
4
|
+
import { oNodeToolConfig } from '@olane/o-node';
|
|
5
|
+
export declare class EncryptionTool extends oLaneTool {
|
|
4
6
|
private encryptionService;
|
|
5
|
-
constructor(config:
|
|
7
|
+
constructor(config: oNodeToolConfig);
|
|
6
8
|
_tool_encrypt(request: oRequest): Promise<ToolResult>;
|
|
7
9
|
_tool_decrypt(request: oRequest): Promise<ToolResult>;
|
|
8
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encryption.tool.d.ts","sourceRoot":"","sources":["../../src/encryption/encryption.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"encryption.tool.d.ts","sourceRoot":"","sources":["../../src/encryption/encryption.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,UAAU,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAY,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGnD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,qBAAa,cAAe,SAAQ,SAAS;IAC3C,OAAO,CAAC,iBAAiB,CAAoB;gBAEjC,MAAM,EAAE,eAAe;IAU7B,aAAa,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAWrD,aAAa,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;CAU5D"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { oVirtualTool } from '@olane/o-tool';
|
|
2
1
|
import { oAddress } from '@olane/o-core';
|
|
3
2
|
import { EncryptionService } from './lib/encryption.js';
|
|
4
3
|
import { ENCRYPTION_PARAMS } from './methods/encryption.methods.js';
|
|
5
|
-
|
|
4
|
+
import { oLaneTool } from '@olane/o-lane';
|
|
5
|
+
export class EncryptionTool extends oLaneTool {
|
|
6
6
|
constructor(config) {
|
|
7
7
|
super({
|
|
8
8
|
...config,
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,uBAAuB,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/init.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { RegistryMemoryTool } from '@olane/o-leader';
|
|
2
1
|
import { StorageTool } from '@olane/o-storage';
|
|
3
2
|
import { SearchTool } from './search/search.tool.js';
|
|
4
3
|
import { EncryptionTool } from './encryption/encryption.tool.js';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
export declare const initCommonTools: (oNode: oVirtualTool) => (SearchTool | EncryptionTool | EncryptedPlanStorageTool | RegistryMemoryTool | StorageTool)[];
|
|
4
|
+
import { oLaneTool } from '@olane/o-lane';
|
|
5
|
+
export declare const initCommonTools: (oNode: oLaneTool) => Promise<(SearchTool | EncryptionTool | StorageTool)[]>;
|
|
8
6
|
//# sourceMappingURL=init.d.ts.map
|
package/dist/init.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,eAAO,MAAM,eAAe,UAAiB,SAAS,2DA0BrD,CAAC"}
|
package/dist/init.js
CHANGED
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
import { RegistryMemoryTool } from '@olane/o-leader';
|
|
2
|
-
import { oAddress } from '@olane/o-core';
|
|
3
1
|
import { StorageTool } from '@olane/o-storage';
|
|
4
2
|
import { SearchTool } from './search/search.tool.js';
|
|
5
3
|
import { EncryptionTool } from './encryption/encryption.tool.js';
|
|
6
|
-
|
|
7
|
-
export const initCommonTools = (oNode) => {
|
|
4
|
+
export const initCommonTools = async (oNode) => {
|
|
8
5
|
const params = {
|
|
9
6
|
parent: oNode.address,
|
|
10
|
-
leader: oNode.
|
|
7
|
+
leader: oNode.leader,
|
|
11
8
|
};
|
|
12
9
|
const tools = [
|
|
13
|
-
new RegistryMemoryTool({
|
|
14
|
-
name: 'registry',
|
|
15
|
-
...params,
|
|
16
|
-
}),
|
|
17
10
|
new StorageTool({
|
|
18
11
|
name: 'storage',
|
|
19
12
|
...params,
|
|
@@ -26,14 +19,10 @@ export const initCommonTools = (oNode) => {
|
|
|
26
19
|
name: 'search',
|
|
27
20
|
...params,
|
|
28
21
|
}),
|
|
29
|
-
new EncryptedPlanStorageTool({
|
|
30
|
-
name: 'plan',
|
|
31
|
-
address: new oAddress('o://plan'),
|
|
32
|
-
...params,
|
|
33
|
-
}),
|
|
34
22
|
];
|
|
35
|
-
tools.
|
|
23
|
+
await Promise.all(tools.map(async (tool) => {
|
|
24
|
+
await tool.start();
|
|
36
25
|
oNode.addChildNode(tool);
|
|
37
|
-
});
|
|
26
|
+
}));
|
|
38
27
|
return tools;
|
|
39
28
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { oToolConfig, oVirtualTool } from '@olane/o-tool';
|
|
2
1
|
import { oRequest } from '@olane/o-core';
|
|
3
2
|
import { ToolResult } from '@olane/o-tool';
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { oLaneTool } from '@olane/o-lane';
|
|
4
|
+
import { oNodeToolConfig } from '@olane/o-node';
|
|
5
|
+
export declare class SearchTool extends oLaneTool {
|
|
6
|
+
constructor(config: oNodeToolConfig);
|
|
6
7
|
_tool_vector(request: oRequest): Promise<ToolResult>;
|
|
7
8
|
}
|
|
8
9
|
//# sourceMappingURL=search.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.tool.d.ts","sourceRoot":"","sources":["../../src/search/search.tool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"search.tool.d.ts","sourceRoot":"","sources":["../../src/search/search.tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,QAAQ,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,qBAAa,UAAW,SAAQ,SAAS;gBAC3B,MAAM,EAAE,eAAe;IAS7B,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;CAe3D"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { oVirtualTool } from '@olane/o-tool';
|
|
2
1
|
import { oAddress } from '@olane/o-core';
|
|
3
2
|
import { SEARCH_PARAMS } from './parameters/search.parameters.js';
|
|
4
|
-
|
|
3
|
+
import { oLaneTool } from '@olane/o-lane';
|
|
4
|
+
export class SearchTool extends oLaneTool {
|
|
5
5
|
constructor(config) {
|
|
6
6
|
super({
|
|
7
7
|
...config,
|
|
@@ -11,7 +11,7 @@ export class SearchTool extends oVirtualTool {
|
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
13
|
async _tool_vector(request) {
|
|
14
|
-
const { query } = request.params;
|
|
14
|
+
const { query, limit } = request.params;
|
|
15
15
|
// let's search our available providers to resolve the task
|
|
16
16
|
// first search local providers
|
|
17
17
|
this.logger.debug('Searching network with terms: ', query);
|
|
@@ -20,7 +20,7 @@ export class SearchTool extends oVirtualTool {
|
|
|
20
20
|
method: 'search_similar',
|
|
21
21
|
params: {
|
|
22
22
|
query: query,
|
|
23
|
-
limit: 10,
|
|
23
|
+
limit: limit || 10,
|
|
24
24
|
},
|
|
25
25
|
});
|
|
26
26
|
return response.result.data;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@olane/o-tools-common",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -54,12 +54,13 @@
|
|
|
54
54
|
"typescript": "5.4.5"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"@olane/o-config": "^0.
|
|
58
|
-
"@olane/o-core": "^0.
|
|
59
|
-
"@olane/o-
|
|
60
|
-
"@olane/o-
|
|
61
|
-
"@olane/o-
|
|
62
|
-
"@olane/o-
|
|
57
|
+
"@olane/o-config": "^0.7.1",
|
|
58
|
+
"@olane/o-core": "^0.7.1",
|
|
59
|
+
"@olane/o-lane": "^0.7.1",
|
|
60
|
+
"@olane/o-leader": "^0.7.1",
|
|
61
|
+
"@olane/o-protocol": "^0.7.1",
|
|
62
|
+
"@olane/o-storage": "^0.7.1",
|
|
63
|
+
"@olane/o-tool": "^0.7.1"
|
|
63
64
|
},
|
|
64
65
|
"dependencies": {
|
|
65
66
|
"debug": "^4.4.1",
|