@olane/o-storage 0.7.12-alpha.9 → 0.7.12

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,6 @@
1
1
  import { ToolResult } from '@olane/o-tool';
2
2
  import { oRequest } from '@olane/o-core';
3
- import { oLaneTool } from '@olane/o-lane';
4
- import { oNodeToolConfig } from '@olane/o-node';
3
+ import { oNodeTool, oNodeToolConfig } from '@olane/o-node';
5
4
  export interface OSConfigStorageConfig extends oNodeToolConfig {
6
5
  /**
7
6
  * Storage backend to use for OS configuration.
@@ -24,7 +23,7 @@ export interface OSConfigStorageConfig extends oNodeToolConfig {
24
23
  *
25
24
  * Address: o://os-config
26
25
  */
27
- export declare class OSConfigStorageTool extends oLaneTool {
26
+ export declare class OSConfigStorageTool extends oNodeTool {
28
27
  private storageBackend;
29
28
  private configKeyPrefix;
30
29
  constructor(config: OSConfigStorageConfig);
@@ -1 +1 @@
1
- {"version":3,"file":"os-config-storage.tool.d.ts","sourceRoot":"","sources":["../../src/os-config-storage.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAY,QAAQ,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGhD,MAAM,WAAW,qBAAsB,SAAQ,eAAe;IAC5D;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;CAC7C;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,mBAAoB,SAAQ,SAAS;IAChD,OAAO,CAAC,cAAc,CAA6B;IACnD,OAAO,CAAC,eAAe,CAAgB;gBAE3B,MAAM,EAAE,qBAAqB;IAiBzC;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAIzB;;OAEG;IACH,OAAO,CAAC,YAA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,OAAO,CAAC,eAAe,CAAgB;gBAE3B,MAAM,EAAE,qBAAqB;IAiBzC;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAIzB;;OAEG;IACH,OAAO,CAAC,YAAY;IAIpB;;OAEG;IACG,iBAAiB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IA2B/D;;OAEG;IACG,iBAAiB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAgC/D;;OAEG;IACG,kBAAkB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAsBhE;;OAEG;IACG,mBAAmB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IA0BjE;;OAEG;IACG,wBAAwB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IA8DtE;;OAEG;IACG,6BAA6B,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAmE3E;;OAEG;IACG,eAAe,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAkC7D;;OAEG;IACG,qBAAqB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAmDnE;;OAEG;IACG,kBAAkB,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;CAoBjE"}
@@ -1,5 +1,5 @@
1
1
  import { oAddress, oRequest } from '@olane/o-core';
2
- import { oLaneTool } from '@olane/o-lane';
2
+ import { oNodeTool } from '@olane/o-node';
3
3
  import { OS_CONFIG_METHODS } from './methods/os-config.methods.js';
4
4
  /**
5
5
  * OS Configuration Storage Tool
@@ -14,7 +14,7 @@ import { OS_CONFIG_METHODS } from './methods/os-config.methods.js';
14
14
  *
15
15
  * Address: o://os-config
16
16
  */
17
- export class OSConfigStorageTool extends oLaneTool {
17
+ export class OSConfigStorageTool extends oNodeTool {
18
18
  constructor(config) {
19
19
  super({
20
20
  ...config,
@@ -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,8 +1,9 @@
1
1
  import { ToolResult } from '@olane/o-tool';
2
2
  import { oRequest } from '@olane/o-core';
3
3
  import { GetDataResponse } from '../interfaces/get-data.response.js';
4
- import { oLaneTool } from '@olane/o-lane';
5
- export declare abstract class StorageProviderTool extends oLaneTool {
4
+ import { oNodeConfig, oNodeTool } from '@olane/o-node';
5
+ export declare abstract class StorageProviderTool extends oNodeTool {
6
+ constructor(config: oNodeConfig);
6
7
  abstract _tool_put(request: oRequest): Promise<ToolResult>;
7
8
  abstract _tool_get(request: oRequest): Promise<GetDataResponse>;
8
9
  abstract _tool_delete(request: oRequest): Promise<ToolResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"storage-provider.tool.d.ts","sourceRoot":"","sources":["../../../src/providers/storage-provider.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG1C,8BAAsB,mBAAoB,SAAQ,SAAS;IACzD,QAAQ,CAAC,SAAS,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAE1D,QAAQ,CAAC,SAAS,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,eAAe,CAAC;IAE/D,QAAQ,CAAC,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAE7D,QAAQ,CAAC,SAAS,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAEpD,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAIlC"}
1
+ {"version":3,"file":"storage-provider.tool.d.ts","sourceRoot":"","sources":["../../../src/providers/storage-provider.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAErE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAEvD,8BAAsB,mBAAoB,SAAQ,SAAS;gBAC7C,MAAM,EAAE,WAAW;IAI/B,QAAQ,CAAC,SAAS,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAE1D,QAAQ,CAAC,SAAS,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,eAAe,CAAC;IAE/D,QAAQ,CAAC,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAE7D,QAAQ,CAAC,SAAS,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAEpD,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAIlC"}
@@ -1,6 +1,9 @@
1
- import { oLaneTool } from '@olane/o-lane';
2
1
  import { oStorageResolver } from '../router/storage.resolver.js';
3
- export class StorageProviderTool extends oLaneTool {
2
+ import { oNodeTool } from '@olane/o-node';
3
+ export class StorageProviderTool extends oNodeTool {
4
+ constructor(config) {
5
+ super(config);
6
+ }
4
7
  async initialize() {
5
8
  await super.initialize();
6
9
  this.router.addResolver(new oStorageResolver(this.address), true);
@@ -1,6 +1,6 @@
1
1
  import { ResolveRequest } from '@olane/o-core';
2
- import { oLaneTool } from '@olane/o-lane';
2
+ import { oNodeTool } from '@olane/o-node';
3
3
  export interface StorageResolveRequest extends ResolveRequest {
4
- node: oLaneTool;
4
+ node: oNodeTool;
5
5
  }
6
6
  //# sourceMappingURL=storage.resolve-request.d.ts.map
@@ -1,6 +1,5 @@
1
- import { oNodeToolConfig } from '@olane/o-node';
2
- import { oLaneTool } from '@olane/o-lane';
3
- export declare class StorageTool extends oLaneTool {
1
+ import { oNodeTool, oNodeToolConfig } from '@olane/o-node';
2
+ export declare class StorageTool extends oNodeTool {
4
3
  constructor(config: oNodeToolConfig);
5
4
  initialize(): Promise<void>;
6
5
  }
@@ -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;CAoDlC"}
1
+ {"version":3,"file":"storage.tool.d.ts","sourceRoot":"","sources":["../../src/storage.tool.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAE3D,qBAAa,WAAY,SAAQ,SAAS;gBAC5B,MAAM,EAAE,eAAe;IAS7B,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CA0ClC"}
@@ -4,8 +4,8 @@ import { MemoryStorageProvider } from './providers/memory-storage-provider.tool.
4
4
  import { SecureStorageProvider } from './providers/secure-storage-provider.tool.js';
5
5
  import { PlaceholderTool } from './placeholder.tool.js';
6
6
  import { OSConfigStorageTool } from './os-config-storage.tool.js';
7
- import { oLaneTool } from '@olane/o-lane';
8
- export class StorageTool extends oLaneTool {
7
+ import { oNodeTool } from '@olane/o-node';
8
+ export class StorageTool extends oNodeTool {
9
9
  constructor(config) {
10
10
  super({
11
11
  ...config,
@@ -15,49 +15,42 @@ export class StorageTool extends oLaneTool {
15
15
  }
16
16
  async initialize() {
17
17
  await super.initialize();
18
- let node = new DiskStorageProvider({
19
- name: 'disk',
20
- parent: this.address,
21
- leader: this.leader,
22
- address: new oAddress('o://disk'),
23
- });
24
- await node.start();
25
- this.addChildNode(node);
26
- node = new MemoryStorageProvider({
27
- name: 'memory',
28
- parent: this.address,
29
- leader: this.leader,
30
- address: new oAddress('o://memory'),
31
- });
32
- await node.start();
33
- this.addChildNode(node);
34
- node = new SecureStorageProvider({
35
- name: 'secure',
36
- parent: this.address,
37
- leader: this.leader,
38
- address: new oAddress('o://secure'),
39
- });
40
- await node.start();
41
- this.addChildNode(node);
42
- node = new PlaceholderTool({
43
- name: 'placeholder storage',
44
- parent: this.address,
45
- leader: this.leader,
46
- });
47
- await node.start();
48
- this.addChildNode(node);
49
- // Add OS Config Storage Tool for managing OS instance configurations
50
- // Note: This tool provides a unified interface that delegates to storage providers.
51
- // For Lambda/cloud deployments, use 'supabase' backend (configured in o-network-lambda).
52
- // For local deployments, use 'disk' or 'memory' backend.
53
- node = new OSConfigStorageTool({
54
- name: 'os-config',
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,8 +4,8 @@ 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';
8
- import { oLaneTool } from '@olane/o-lane';
7
+ import * as dotenv from 'dotenv';
8
+ import { oNodeTool } from '@olane/o-node';
9
9
  dotenv.config();
10
10
  const leader = new oLeaderNode({
11
11
  parent: null,
@@ -14,7 +14,7 @@ const leader = new oLeaderNode({
14
14
  describe('o-storage @placeholder', () => {
15
15
  it('should be able to start a node', async () => {
16
16
  await leader.start();
17
- const node = new oLaneTool({
17
+ const node = new oNodeTool({
18
18
  parent: leader.address,
19
19
  leader: leader.address,
20
20
  address: new oAddress('o://node'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@olane/o-storage",
3
- "version": "0.7.12-alpha.9",
3
+ "version": "0.7.12",
4
4
  "type": "module",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
@@ -54,14 +54,13 @@
54
54
  "typescript": "5.4.5"
55
55
  },
56
56
  "dependencies": {
57
- "@olane/o-config": "0.7.12-alpha.9",
58
- "@olane/o-core": "0.7.12-alpha.9",
59
- "@olane/o-lane": "0.7.12-alpha.9",
60
- "@olane/o-node": "0.7.12-alpha.9",
61
- "@olane/o-protocol": "0.7.12-alpha.9",
62
- "@olane/o-tool": "0.7.12-alpha.9",
57
+ "@olane/o-config": "0.7.12",
58
+ "@olane/o-core": "0.7.12",
59
+ "@olane/o-node": "0.7.12",
60
+ "@olane/o-protocol": "0.7.12",
61
+ "@olane/o-tool": "0.7.12",
63
62
  "debug": "^4.4.1",
64
63
  "dotenv": "^16.5.0"
65
64
  },
66
- "gitHead": "21427acbdc1d87ff9465bf19bda58cca89e8d3c7"
65
+ "gitHead": "580d8c51fe0a12695ba1d77f077029200f0c8af4"
67
66
  }