@olane/o-storage 0.6.7 → 0.6.9

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.
@@ -0,0 +1,6 @@
1
+ import { oAnythingResolver } from '@olane/o-core';
2
+ export declare class PlaceholderResolver extends oAnythingResolver {
3
+ get transports(): string[];
4
+ static get transports(): string[];
5
+ }
6
+ //# sourceMappingURL=placeholder.resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"placeholder.resolver.d.ts","sourceRoot":"","sources":["../../../src/resolvers/placeholder.resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAIlD,qBAAa,mBAAoB,SAAQ,iBAAiB;IACxD,IAAI,UAAU,IAAI,MAAM,EAAE,CAEzB;IACD,MAAM,KAAK,UAAU,IAAI,MAAM,EAAE,CAEhC;CACF"}
@@ -0,0 +1,10 @@
1
+ import { oAnythingResolver } from '@olane/o-core';
2
+ const placeholderTransports = ['/plan'];
3
+ export class PlaceholderResolver extends oAnythingResolver {
4
+ get transports() {
5
+ return placeholderTransports;
6
+ }
7
+ static get transports() {
8
+ return placeholderTransports;
9
+ }
10
+ }
@@ -1,9 +1,5 @@
1
- import { NodeState, oAddress } from '@olane/o-core';
2
- import { expect } from 'chai';
3
- import { oLeaderNode, RegistryMemoryTool } from '@olane/o-leader';
4
- import { IntelligenceTool } from '@olane/o-intelligence';
5
- import { StorageTool } from '../src/index.js';
6
- import { bigfile } from './data/bigfile.js';
1
+ import { oAddress } from '@olane/o-core';
2
+ import { oLeaderNode } from '@olane/o-leader';
7
3
  import { oVirtualTool } from '@olane/o-tool';
8
4
  import dotenv from 'dotenv';
9
5
  dotenv.config();
@@ -18,44 +14,51 @@ const node = new oVirtualTool({
18
14
  });
19
15
  leader.addChildNode(node);
20
16
  describe('o-storage @placeholder', () => {
21
- it('should be able to start a node', async () => {
22
- const registryTool = new RegistryMemoryTool({
23
- parent: leader.address,
24
- leader: leader.address,
25
- });
26
- leader.addChildNode(registryTool);
27
- const intelligenceTool = new IntelligenceTool({
28
- parent: node.address,
29
- leader: node.address,
30
- });
31
- leader.addChildNode(intelligenceTool);
32
- const storageTool = new StorageTool({
33
- parent: node.address,
34
- leader: node.address,
35
- });
36
- leader.addChildNode(storageTool);
37
- await leader.start();
38
- expect(intelligenceTool.state).to.equal(NodeState.RUNNING);
39
- });
40
- it('should be able to perform a put', async () => {
41
- const result = await leader.use(new oAddress('o://leader/storage/placeholder'), {
42
- method: 'put',
43
- params: {
44
- key: 'test-key-1234',
45
- value: bigfile,
46
- intent: 'I want to copy file "bigfile.txt" to "bigfile.txt.copy"',
47
- },
48
- });
49
- console.log(result.result.data);
50
- });
51
- it('should be able to perform a get', async () => {
52
- const result = await leader.use(new oAddress('o://leader/storage/placeholder/test-key-1234'));
53
- const data = result.result.data;
54
- expect(data.value.length > 0).to.be.true;
55
- });
56
- it('should be able to perform an explicit get', async () => {
57
- const result = await leader.use(new oAddress('o://leader/storage/placeholder/test-key-1234/get'));
58
- const data = result.result.data;
59
- expect(data.value.length > 0).to.be.true;
60
- });
17
+ // it('should be able to start a node', async () => {
18
+ // const registryTool = new RegistryMemoryTool({
19
+ // parent: leader.address,
20
+ // leader: leader.address,
21
+ // });
22
+ // leader.addChildNode(registryTool);
23
+ // const intelligenceTool = new IntelligenceTool({
24
+ // parent: node.address,
25
+ // leader: node.address,
26
+ // });
27
+ // leader.addChildNode(intelligenceTool);
28
+ // const storageTool = new StorageTool({
29
+ // parent: node.address,
30
+ // leader: node.address,
31
+ // });
32
+ // leader.addChildNode(storageTool);
33
+ // await leader.start();
34
+ // expect(intelligenceTool.state).to.equal(NodeState.RUNNING);
35
+ // });
36
+ // it('should be able to perform a put', async () => {
37
+ // const result = await leader.use(
38
+ // new oAddress('o://leader/storage/placeholder'),
39
+ // {
40
+ // method: 'put',
41
+ // params: {
42
+ // key: 'test-key-1234',
43
+ // value: bigfile,
44
+ // intent: 'I want to copy file "bigfile.txt" to "bigfile.txt.copy"',
45
+ // },
46
+ // },
47
+ // );
48
+ // console.log(result.result.data);
49
+ // });
50
+ // it('should be able to perform a get', async () => {
51
+ // const result = await leader.use(
52
+ // new oAddress('o://leader/storage/placeholder/test-key-1234'),
53
+ // );
54
+ // const data = result.result.data as any;
55
+ // expect(data.value.length > 0).to.be.true;
56
+ // });
57
+ // it('should be able to perform an explicit get', async () => {
58
+ // const result = await leader.use(
59
+ // new oAddress('o://leader/storage/placeholder/test-key-1234/get'),
60
+ // );
61
+ // const data = result.result.data as any;
62
+ // expect(data.value.length > 0).to.be.true;
63
+ // });
61
64
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@olane/o-storage",
3
- "version": "0.6.7",
3
+ "version": "0.6.9",
4
4
  "type": "module",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
@@ -23,6 +23,7 @@
23
23
  "build": "tsc",
24
24
  "deep:clean": "rm -rf node_modules && rm package-lock.json",
25
25
  "start:prod": "node dist/index.js",
26
+ "update:peers": "npm install @olane/o-core@latest @olane/o-config@latest @olane/o-protocol@latest @olane/o-tool@latest --save-peer",
26
27
  "prepublishOnly": "npm run build",
27
28
  "update:lib": "npm install @olane/o-core@latest",
28
29
  "lint": "eslint src/**/*.ts"
@@ -37,8 +38,8 @@
37
38
  "devDependencies": {
38
39
  "@eslint/eslintrc": "^3.3.1",
39
40
  "@eslint/js": "^9.29.0",
40
- "@olane/o-intelligence": "^0.6.6",
41
- "@olane/o-leader": "^0.6.6",
41
+ "@olane/o-intelligence": "^0.6.7",
42
+ "@olane/o-leader": "^0.6.7",
42
43
  "@tsconfig/node20": "^20.1.6",
43
44
  "@types/jest": "^30.0.0",
44
45
  "@typescript-eslint/eslint-plugin": "^8.34.1",
@@ -57,9 +58,9 @@
57
58
  "typescript": "5.4.5"
58
59
  },
59
60
  "peerDependencies": {
60
- "@olane/o-config": "^0.6.7",
61
- "@olane/o-core": "^0.6.7",
62
- "@olane/o-protocol": "^0.6.7",
61
+ "@olane/o-config": "^0.6.8",
62
+ "@olane/o-core": "^0.6.8",
63
+ "@olane/o-protocol": "^0.6.8",
63
64
  "@olane/o-tool": "^0.6.7"
64
65
  },
65
66
  "dependencies": {