@diory/client-js 0.4.4-rc4 → 0.4.4-rc6

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.
@@ -11,6 +11,6 @@ export declare class DioryClient implements IDioryClient {
11
11
  addDiograph: (address: string, diographObject: IDiographObject) => IDioryClient;
12
12
  getDiograph: (address: string) => IDiograph | undefined;
13
13
  fetchDiograph: (address: string) => Promise<IDioryClient>;
14
- generateDiograph: (address: string, options?: GenerateDiographOptions) => Promise<IDioryClient>;
14
+ generateDiograph: (root: string, path?: string, options?: GenerateDiographOptions) => Promise<IDioryClient>;
15
15
  saveDiograph: (address: string) => () => any;
16
16
  }
@@ -42,12 +42,13 @@ class DioryClient {
42
42
  }
43
43
  return this;
44
44
  };
45
- this.generateDiograph = async (address, options) => {
46
- const { client, path } = resolveConnection(address);
45
+ this.generateDiograph = async (root, path = '/', options) => {
46
+ const { client } = resolveConnection(root);
47
47
  const dataClient = findDataClient(this.dataClients, client);
48
48
  if (dataClient) {
49
49
  // TODO save based on client properties
50
- const diographObject = await (0, folder_generator_1.generateDiograph)(path, '/', dataClient, options);
50
+ const diographObject = await (0, folder_generator_1.generateDiograph)(root, path, dataClient, options);
51
+ const address = (0, path_browserify_1.join)(root, path);
51
52
  if (diographObject)
52
53
  this.addDiograph(address, diographObject);
53
54
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diory/client-js",
3
- "version": "0.4.4-rc4",
3
+ "version": "0.4.4-rc6",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "author": "Olli-Pekka Pohjola <op@diory.me>, Jouni Alanen <jouni@diory.me>",
@@ -59,14 +59,16 @@ export class DioryClient implements IDioryClient {
59
59
  }
60
60
 
61
61
  generateDiograph = async (
62
- address: string,
62
+ root: string,
63
+ path = '/',
63
64
  options?: GenerateDiographOptions,
64
65
  ): Promise<IDioryClient> => {
65
- const { client, path } = resolveConnection(address)
66
+ const { client } = resolveConnection(root)
66
67
  const dataClient = findDataClient(this.dataClients, client)
67
68
  if (dataClient) {
68
69
  // TODO save based on client properties
69
- const diographObject = await generateDiograph(path, '/', dataClient, options)
70
+ const diographObject = await generateDiograph(root, path, dataClient, options)
71
+ const address = join(root, path)
70
72
  if (diographObject) this.addDiograph(address, diographObject)
71
73
  }
72
74