@olane/o-storage 0.7.12-alpha.6 → 0.7.12-alpha.61
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StorageProviderTool } from './storage-provider.tool.js';
|
|
2
2
|
import { DEFAULT_CONFIG_PATH, oAddress } from '@olane/o-core';
|
|
3
|
-
import fs from 'fs/promises';
|
|
4
|
-
import path from 'path';
|
|
3
|
+
import * as fs from 'fs/promises';
|
|
4
|
+
import * as path from 'path';
|
|
5
5
|
import { STORAGE_PARAMS } from '../methods/storage.methods.js';
|
|
6
6
|
export class DiskStorageProvider extends StorageProviderTool {
|
|
7
7
|
constructor(config) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { oAddress } from '@olane/o-core';
|
|
2
|
-
import fs from 'fs/promises';
|
|
2
|
+
import * as fs from 'fs/promises';
|
|
3
3
|
import { STORAGE_PARAMS } from '../methods/storage.methods.js';
|
|
4
4
|
import { DiskStorageProvider } from './disk-storage-provider.tool.js';
|
|
5
5
|
export class SecureStorageProvider extends DiskStorageProvider {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.tool.d.ts","sourceRoot":"","sources":["../../src/storage.tool.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,qBAAa,WAAY,SAAQ,SAAS;gBAC5B,MAAM,EAAE,eAAe;IAS7B,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"storage.tool.d.ts","sourceRoot":"","sources":["../../src/storage.tool.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,qBAAa,WAAY,SAAQ,SAAS;gBAC5B,MAAM,EAAE,eAAe;IAS7B,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CA0ClC"}
|
package/dist/src/storage.tool.js
CHANGED
|
@@ -15,49 +15,42 @@ export class StorageTool extends oLaneTool {
|
|
|
15
15
|
}
|
|
16
16
|
async initialize() {
|
|
17
17
|
await super.initialize();
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
parent: this.address,
|
|
56
|
-
leader: this.leader,
|
|
57
|
-
storageBackend: process.env.OS_CONFIG_STORAGE ||
|
|
58
|
-
'disk',
|
|
59
|
-
});
|
|
60
|
-
await node.start();
|
|
61
|
-
this.addChildNode(node);
|
|
18
|
+
const tools = [
|
|
19
|
+
new DiskStorageProvider({
|
|
20
|
+
name: 'disk',
|
|
21
|
+
parent: this.address,
|
|
22
|
+
leader: this.leader,
|
|
23
|
+
address: new oAddress('o://disk'),
|
|
24
|
+
}),
|
|
25
|
+
new MemoryStorageProvider({
|
|
26
|
+
name: 'memory',
|
|
27
|
+
parent: this.address,
|
|
28
|
+
leader: this.leader,
|
|
29
|
+
address: new oAddress('o://memory'),
|
|
30
|
+
}),
|
|
31
|
+
new SecureStorageProvider({
|
|
32
|
+
name: 'secure',
|
|
33
|
+
parent: this.address,
|
|
34
|
+
leader: this.leader,
|
|
35
|
+
address: new oAddress('o://secure'),
|
|
36
|
+
}),
|
|
37
|
+
new PlaceholderTool({
|
|
38
|
+
name: 'placeholder storage',
|
|
39
|
+
parent: this.address,
|
|
40
|
+
leader: this.leader,
|
|
41
|
+
}),
|
|
42
|
+
new OSConfigStorageTool({
|
|
43
|
+
name: 'os-config',
|
|
44
|
+
parent: this.address,
|
|
45
|
+
leader: this.leader,
|
|
46
|
+
storageBackend: process.env.OS_CONFIG_STORAGE || 'disk',
|
|
47
|
+
}),
|
|
48
|
+
];
|
|
49
|
+
for (const tool of tools) {
|
|
50
|
+
tool.hookInitializeFinished = () => {
|
|
51
|
+
this.addChildNode(tool);
|
|
52
|
+
};
|
|
53
|
+
await tool.start();
|
|
54
|
+
}
|
|
62
55
|
}
|
|
63
56
|
}
|
|
@@ -4,7 +4,7 @@ import { oLeaderNode } from '@olane/o-leader';
|
|
|
4
4
|
import { IntelligenceTool } from '@olane/o-intelligence';
|
|
5
5
|
import { StorageTool } from '../src/index.js';
|
|
6
6
|
import { bigfile } from './data/bigfile.js';
|
|
7
|
-
import dotenv from 'dotenv';
|
|
7
|
+
import * as dotenv from 'dotenv';
|
|
8
8
|
import { oLaneTool } from '@olane/o-lane';
|
|
9
9
|
dotenv.config();
|
|
10
10
|
const leader = new oLeaderNode({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@olane/o-storage",
|
|
3
|
-
"version": "0.7.12-alpha.
|
|
3
|
+
"version": "0.7.12-alpha.61",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
@@ -54,14 +54,14 @@
|
|
|
54
54
|
"typescript": "5.4.5"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@olane/o-config": "0.7.12-alpha.
|
|
58
|
-
"@olane/o-core": "0.7.12-alpha.
|
|
59
|
-
"@olane/o-lane": "0.7.12-alpha.
|
|
60
|
-
"@olane/o-node": "0.7.12-alpha.
|
|
61
|
-
"@olane/o-protocol": "0.7.12-alpha.
|
|
62
|
-
"@olane/o-tool": "0.7.12-alpha.
|
|
57
|
+
"@olane/o-config": "0.7.12-alpha.61",
|
|
58
|
+
"@olane/o-core": "0.7.12-alpha.61",
|
|
59
|
+
"@olane/o-lane": "0.7.12-alpha.61",
|
|
60
|
+
"@olane/o-node": "0.7.12-alpha.61",
|
|
61
|
+
"@olane/o-protocol": "0.7.12-alpha.61",
|
|
62
|
+
"@olane/o-tool": "0.7.12-alpha.61",
|
|
63
63
|
"debug": "^4.4.1",
|
|
64
64
|
"dotenv": "^16.5.0"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "358c478df44b742fe83ce096d3e16bf2351815ea"
|
|
67
67
|
}
|