@diory/client-js 0.2.0-rc14 → 0.2.0-rc17
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.
|
@@ -23,7 +23,9 @@ class DioryClient {
|
|
|
23
23
|
this.diosphere.resetRooms();
|
|
24
24
|
const diosphereObject = (_a = (await this.getDiosphere())) !== null && _a !== void 0 ? _a : (0, getDefaultDiosphere_1.getDefaultDiosphere)(connections);
|
|
25
25
|
this.diosphere.addDiosphere(diosphereObject);
|
|
26
|
+
await this.saveDiosphere();
|
|
26
27
|
this.selectRoom({ id: '/' });
|
|
28
|
+
console.info(this.diosphere.toObject());
|
|
27
29
|
return this.diosphere;
|
|
28
30
|
};
|
|
29
31
|
this.getDiosphere = async (connections) => {
|
|
@@ -32,7 +34,7 @@ class DioryClient {
|
|
|
32
34
|
await Promise.all(this.getDiosphereClients(connections).map(async (connectionClient) => {
|
|
33
35
|
try {
|
|
34
36
|
diosphereObject = await connectionClient.getDiosphere();
|
|
35
|
-
console.info(
|
|
37
|
+
console.info(diosphereObject);
|
|
36
38
|
}
|
|
37
39
|
catch (error) {
|
|
38
40
|
console.error(error);
|
|
@@ -65,7 +67,9 @@ class DioryClient {
|
|
|
65
67
|
this.diograph.resetDiograph();
|
|
66
68
|
const diographObject = (_a = (await this.getDiograph())) !== null && _a !== void 0 ? _a : (0, getDefaultDiograph_1.getDefaultDiograph)();
|
|
67
69
|
this.diograph.addDiograph(diographObject);
|
|
70
|
+
await this.saveDiograph();
|
|
68
71
|
this.focusDiory({ id: '/' });
|
|
72
|
+
console.info(this.diograph.toObject());
|
|
69
73
|
return this.diograph;
|
|
70
74
|
};
|
|
71
75
|
this.getDiograph = async (connections) => {
|
|
@@ -97,10 +101,16 @@ class DioryClient {
|
|
|
97
101
|
console.info('generateDiograph', connections);
|
|
98
102
|
await Promise.all(this.getDiographClients(connections).map(async (connectionClient) => {
|
|
99
103
|
const diographObject = await connectionClient.generateDiograph();
|
|
104
|
+
console.info(diographObject);
|
|
100
105
|
Object.entries(diographObject).forEach(([key, dioryObject]) => {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
106
|
+
try {
|
|
107
|
+
key === '/'
|
|
108
|
+
? this.diograph.addDioryLink({ id: '/' }, diographObject['/'])
|
|
109
|
+
: this.diograph.addDiory(dioryObject);
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
console.error(error);
|
|
113
|
+
}
|
|
104
114
|
});
|
|
105
115
|
await connectionClient.saveDiograph(this.diograph.toObject());
|
|
106
116
|
console.info(this.diograph.toObject());
|
package/package.json
CHANGED
|
@@ -47,9 +47,11 @@ class DioryClient implements IDioryClient {
|
|
|
47
47
|
this.diosphere.resetRooms()
|
|
48
48
|
const diosphereObject = (await this.getDiosphere()) ?? getDefaultDiosphere(connections)
|
|
49
49
|
this.diosphere.addDiosphere(diosphereObject)
|
|
50
|
+
await this.saveDiosphere()
|
|
50
51
|
|
|
51
52
|
this.selectRoom({ id: '/' })
|
|
52
53
|
|
|
54
|
+
console.info(this.diosphere.toObject())
|
|
53
55
|
return this.diosphere
|
|
54
56
|
}
|
|
55
57
|
|
|
@@ -63,7 +65,7 @@ class DioryClient implements IDioryClient {
|
|
|
63
65
|
this.getDiosphereClients(connections).map(async (connectionClient) => {
|
|
64
66
|
try {
|
|
65
67
|
diosphereObject = await connectionClient.getDiosphere()
|
|
66
|
-
console.info(
|
|
68
|
+
console.info(diosphereObject)
|
|
67
69
|
} catch (error) {
|
|
68
70
|
console.error(error)
|
|
69
71
|
}
|
|
@@ -104,9 +106,11 @@ class DioryClient implements IDioryClient {
|
|
|
104
106
|
this.diograph.resetDiograph()
|
|
105
107
|
const diographObject = (await this.getDiograph()) ?? getDefaultDiograph()
|
|
106
108
|
this.diograph.addDiograph(diographObject)
|
|
109
|
+
await this.saveDiograph()
|
|
107
110
|
|
|
108
111
|
this.focusDiory({ id: '/' })
|
|
109
112
|
|
|
113
|
+
console.info(this.diograph.toObject())
|
|
110
114
|
return this.diograph
|
|
111
115
|
}
|
|
112
116
|
|
|
@@ -150,10 +154,16 @@ class DioryClient implements IDioryClient {
|
|
|
150
154
|
await Promise.all(
|
|
151
155
|
this.getDiographClients(connections).map(async (connectionClient) => {
|
|
152
156
|
const diographObject = await connectionClient.generateDiograph()
|
|
157
|
+
console.info(diographObject)
|
|
158
|
+
|
|
153
159
|
Object.entries(diographObject).forEach(([key, dioryObject]) => {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
160
|
+
try {
|
|
161
|
+
key === '/'
|
|
162
|
+
? this.diograph.addDioryLink({ id: '/' }, diographObject['/'])
|
|
163
|
+
: this.diograph.addDiory(dioryObject)
|
|
164
|
+
} catch (error) {
|
|
165
|
+
console.error(error)
|
|
166
|
+
}
|
|
157
167
|
})
|
|
158
168
|
|
|
159
169
|
await connectionClient.saveDiograph(this.diograph.toObject())
|