@diory/client-js 0.2.0-rc1 → 0.2.0-rc10
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/dioryClient/dioryClient.js +5 -2
- package/dist/index.d.ts +1 -1
- package/dist/types.d.ts +6 -1
- package/package.json +2 -2
- package/src/dioryClient/dioryClient.ts +5 -3
- package/src/index.ts +1 -1
- package/src/types.ts +6 -1
|
@@ -20,7 +20,6 @@ class DioryClient {
|
|
|
20
20
|
this.diograph.resetDiograph();
|
|
21
21
|
await this.getDiograph();
|
|
22
22
|
this.focusDiory({ id: '/' });
|
|
23
|
-
await this.generateDiograph();
|
|
24
23
|
return this.room;
|
|
25
24
|
};
|
|
26
25
|
this.focusDiory = (dioryObject) => {
|
|
@@ -85,7 +84,11 @@ class DioryClient {
|
|
|
85
84
|
await Promise.all(connectionClients.map(async (connectionClient) => {
|
|
86
85
|
const diographObject = await connectionClient.generateDiograph();
|
|
87
86
|
console.info(diographObject);
|
|
88
|
-
|
|
87
|
+
Object.entries(diographObject).forEach(([key, dioryObject]) => {
|
|
88
|
+
key === '/'
|
|
89
|
+
? this.diograph.addDioryLink({ id: '/' }, diographObject['/'])
|
|
90
|
+
: this.diograph.addDiory(dioryObject);
|
|
91
|
+
});
|
|
89
92
|
await connectionClient.saveDiograph(this.diograph.toObject());
|
|
90
93
|
return;
|
|
91
94
|
}));
|
package/dist/index.d.ts
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -5,6 +5,9 @@ export interface IMetadata {
|
|
|
5
5
|
name: string;
|
|
6
6
|
created?: string;
|
|
7
7
|
modified?: string;
|
|
8
|
+
duration?: string;
|
|
9
|
+
thumbnail?: string;
|
|
10
|
+
latlng?: string;
|
|
8
11
|
}
|
|
9
12
|
export interface IFileType {
|
|
10
13
|
ext?: string;
|
|
@@ -23,8 +26,10 @@ export interface IDataClient {
|
|
|
23
26
|
list(url: string): Promise<string[]>;
|
|
24
27
|
getFileNames(url: string): Promise<string[]>;
|
|
25
28
|
getFolderNames(url: string): Promise<string[]>;
|
|
26
|
-
getMetadata(url: string): IMetadata;
|
|
27
29
|
getFileType(url: string): Promise<IFileType>;
|
|
30
|
+
getMetadata(url: string): IMetadata;
|
|
31
|
+
getThumbnail?(imageUrl: string): Promise<string | undefined>;
|
|
32
|
+
getVideoMetadata?(videoUrl: string): Promise<IMetadata>;
|
|
28
33
|
}
|
|
29
34
|
export interface IConnectionClient {
|
|
30
35
|
type: string;
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@diory/client-js",
|
|
3
|
-
"version": "0.2.0-
|
|
3
|
+
"version": "0.2.0-rc10",
|
|
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>",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@diograph/diograph": "0.3.0-rc14",
|
|
10
|
-
"@diograph/folder-generator": "^0.3.0-
|
|
10
|
+
"@diograph/folder-generator": "^0.3.0-rc3",
|
|
11
11
|
"@diory/diosphere-js": "0.2.6-rc2",
|
|
12
12
|
"path-browserify": "^1.0.1",
|
|
13
13
|
"uuid": "8.3.2"
|
|
@@ -39,8 +39,6 @@ class DioryClient implements IDioryClient {
|
|
|
39
39
|
await this.getDiograph()
|
|
40
40
|
this.focusDiory({ id: '/' })
|
|
41
41
|
|
|
42
|
-
await this.generateDiograph()
|
|
43
|
-
|
|
44
42
|
return this.room
|
|
45
43
|
}
|
|
46
44
|
|
|
@@ -126,7 +124,11 @@ class DioryClient implements IDioryClient {
|
|
|
126
124
|
connectionClients.map(async (connectionClient) => {
|
|
127
125
|
const diographObject = await connectionClient.generateDiograph()
|
|
128
126
|
console.info(diographObject)
|
|
129
|
-
|
|
127
|
+
Object.entries(diographObject).forEach(([key, dioryObject]) => {
|
|
128
|
+
key === '/'
|
|
129
|
+
? this.diograph.addDioryLink({ id: '/' }, diographObject['/'])
|
|
130
|
+
: this.diograph.addDiory(dioryObject)
|
|
131
|
+
})
|
|
130
132
|
|
|
131
133
|
await connectionClient.saveDiograph(this.diograph.toObject())
|
|
132
134
|
return
|
package/src/index.ts
CHANGED
package/src/types.ts
CHANGED
|
@@ -11,6 +11,9 @@ export interface IMetadata {
|
|
|
11
11
|
name: string
|
|
12
12
|
created?: string
|
|
13
13
|
modified?: string
|
|
14
|
+
duration?: string
|
|
15
|
+
thumbnail?: string
|
|
16
|
+
latlng?: string
|
|
14
17
|
}
|
|
15
18
|
|
|
16
19
|
export interface IFileType {
|
|
@@ -31,8 +34,10 @@ export interface IDataClient {
|
|
|
31
34
|
list(url: string): Promise<string[]>
|
|
32
35
|
getFileNames(url: string): Promise<string[]>
|
|
33
36
|
getFolderNames(url: string): Promise<string[]>
|
|
34
|
-
getMetadata(url: string): IMetadata
|
|
35
37
|
getFileType(url: string): Promise<IFileType>
|
|
38
|
+
getMetadata(url: string): IMetadata
|
|
39
|
+
getThumbnail?(imageUrl: string): Promise<string | undefined>
|
|
40
|
+
getVideoMetadata?(videoUrl: string): Promise<IMetadata>
|
|
36
41
|
}
|
|
37
42
|
|
|
38
43
|
export interface IConnectionClient {
|