@did-space/core 0.2.117 → 0.2.118
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/drivers/base.js +13 -39
- package/dist/space/index.js +29 -81
- package/package.json +4 -4
package/dist/drivers/base.js
CHANGED
|
@@ -27,14 +27,10 @@ class BaseDriver {
|
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
isSpaceCreated() {
|
|
30
|
-
return
|
|
31
|
-
return this.spaceOperator.isSpaceCreated();
|
|
32
|
-
});
|
|
30
|
+
return this.spaceOperator.isSpaceCreated();
|
|
33
31
|
}
|
|
34
32
|
getSpaceSize() {
|
|
35
|
-
return
|
|
36
|
-
return this.spaceOperator.getSpaceSize();
|
|
37
|
-
});
|
|
33
|
+
return this.spaceOperator.getSpaceSize();
|
|
38
34
|
}
|
|
39
35
|
createAppSpace(options) {
|
|
40
36
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -47,9 +43,7 @@ class BaseDriver {
|
|
|
47
43
|
});
|
|
48
44
|
}
|
|
49
45
|
getAppSpacePath(options) {
|
|
50
|
-
return
|
|
51
|
-
return this.spaceOperator.getAppSpacePath(options);
|
|
52
|
-
});
|
|
46
|
+
return this.spaceOperator.getAppSpacePath(options);
|
|
53
47
|
}
|
|
54
48
|
createConfig(spaceConfig) {
|
|
55
49
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -67,9 +61,7 @@ class BaseDriver {
|
|
|
67
61
|
});
|
|
68
62
|
}
|
|
69
63
|
get(key) {
|
|
70
|
-
return
|
|
71
|
-
return this.spaceConfig.get(key);
|
|
72
|
-
});
|
|
64
|
+
return this.spaceConfig.get(key);
|
|
73
65
|
}
|
|
74
66
|
setListable(options, value) {
|
|
75
67
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -87,19 +79,13 @@ class BaseDriver {
|
|
|
87
79
|
});
|
|
88
80
|
}
|
|
89
81
|
isListable(options) {
|
|
90
|
-
return
|
|
91
|
-
return this.spaceConfig.isListable(options);
|
|
92
|
-
});
|
|
82
|
+
return this.spaceConfig.isListable(options);
|
|
93
83
|
}
|
|
94
84
|
isReadable(options) {
|
|
95
|
-
return
|
|
96
|
-
return this.spaceConfig.isReadable(options);
|
|
97
|
-
});
|
|
85
|
+
return this.spaceConfig.isReadable(options);
|
|
98
86
|
}
|
|
99
87
|
isWritable(options) {
|
|
100
|
-
return
|
|
101
|
-
return this.spaceConfig.isWritable(options);
|
|
102
|
-
});
|
|
88
|
+
return this.spaceConfig.isWritable(options);
|
|
103
89
|
}
|
|
104
90
|
write(options) {
|
|
105
91
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -129,9 +115,7 @@ class BaseDriver {
|
|
|
129
115
|
});
|
|
130
116
|
}
|
|
131
117
|
getHash(options) {
|
|
132
|
-
return
|
|
133
|
-
return this.spaceOperator.getHash(options);
|
|
134
|
-
});
|
|
118
|
+
return this.spaceOperator.getHash(options);
|
|
135
119
|
}
|
|
136
120
|
exists(options) {
|
|
137
121
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -145,32 +129,22 @@ class BaseDriver {
|
|
|
145
129
|
});
|
|
146
130
|
}
|
|
147
131
|
lists(options) {
|
|
148
|
-
return
|
|
149
|
-
return this.spaceOperator.lists(options);
|
|
150
|
-
});
|
|
132
|
+
return this.spaceOperator.lists(options);
|
|
151
133
|
}
|
|
152
134
|
list(options) {
|
|
153
135
|
return this.spaceOperator.list(options);
|
|
154
136
|
}
|
|
155
137
|
writeAsOwner(key, data) {
|
|
156
|
-
return
|
|
157
|
-
return this.spaceOperator.writeAsOwner(key, data);
|
|
158
|
-
});
|
|
138
|
+
return this.spaceOperator.writeAsOwner(key, data);
|
|
159
139
|
}
|
|
160
140
|
deleteAsOwner(key) {
|
|
161
|
-
return
|
|
162
|
-
return this.spaceOperator.deleteAsOwner(key);
|
|
163
|
-
});
|
|
141
|
+
return this.spaceOperator.deleteAsOwner(key);
|
|
164
142
|
}
|
|
165
143
|
readAsOwner(key) {
|
|
166
|
-
return
|
|
167
|
-
return this.spaceOperator.readAsOwner(key);
|
|
168
|
-
});
|
|
144
|
+
return this.spaceOperator.readAsOwner(key);
|
|
169
145
|
}
|
|
170
146
|
existsAsOwner(key) {
|
|
171
|
-
return
|
|
172
|
-
return this.spaceOperator.existsAsOwner(key);
|
|
173
|
-
});
|
|
147
|
+
return this.spaceOperator.existsAsOwner(key);
|
|
174
148
|
}
|
|
175
149
|
}
|
|
176
150
|
exports.BaseDriver = BaseDriver;
|
package/dist/space/index.js
CHANGED
|
@@ -19,89 +19,55 @@ class Space {
|
|
|
19
19
|
this.driver = driver;
|
|
20
20
|
}
|
|
21
21
|
createSpace(spaceConfiguration) {
|
|
22
|
-
return
|
|
23
|
-
return this.driver.createSpace(spaceConfiguration);
|
|
24
|
-
});
|
|
22
|
+
return this.driver.createSpace(spaceConfiguration);
|
|
25
23
|
}
|
|
26
24
|
destroySpace() {
|
|
27
|
-
return
|
|
28
|
-
return this.driver.destroySpace();
|
|
29
|
-
});
|
|
25
|
+
return this.driver.destroySpace();
|
|
30
26
|
}
|
|
31
27
|
isSpaceCreated() {
|
|
32
|
-
return
|
|
33
|
-
return this.driver.isSpaceCreated();
|
|
34
|
-
});
|
|
28
|
+
return this.driver.isSpaceCreated();
|
|
35
29
|
}
|
|
36
30
|
getSpaceSize() {
|
|
37
|
-
return
|
|
38
|
-
return this.driver.getSpaceSize();
|
|
39
|
-
});
|
|
31
|
+
return this.driver.getSpaceSize();
|
|
40
32
|
}
|
|
41
33
|
createAppSpace(options) {
|
|
42
|
-
return
|
|
43
|
-
return this.driver.createAppSpace(options);
|
|
44
|
-
});
|
|
34
|
+
return this.driver.createAppSpace(options);
|
|
45
35
|
}
|
|
46
36
|
destroyAppSpace(options) {
|
|
47
|
-
return
|
|
48
|
-
return this.driver.destroyAppSpace(options);
|
|
49
|
-
});
|
|
37
|
+
return this.driver.destroyAppSpace(options);
|
|
50
38
|
}
|
|
51
39
|
getAppSpacePath(options) {
|
|
52
|
-
return
|
|
53
|
-
return this.driver.getAppSpacePath(options);
|
|
54
|
-
});
|
|
40
|
+
return this.driver.getAppSpacePath(options);
|
|
55
41
|
}
|
|
56
42
|
createConfig(spaceConfig) {
|
|
57
|
-
return
|
|
58
|
-
return this.driver.createConfig(spaceConfig);
|
|
59
|
-
});
|
|
43
|
+
return this.driver.createConfig(spaceConfig);
|
|
60
44
|
}
|
|
61
45
|
destroyConfig() {
|
|
62
|
-
return
|
|
63
|
-
return this.driver.destroyConfig();
|
|
64
|
-
});
|
|
46
|
+
return this.driver.destroyConfig();
|
|
65
47
|
}
|
|
66
48
|
set(key, value) {
|
|
67
|
-
return
|
|
68
|
-
return this.driver.set(key, value);
|
|
69
|
-
});
|
|
49
|
+
return this.driver.set(key, value);
|
|
70
50
|
}
|
|
71
51
|
get(key) {
|
|
72
|
-
return
|
|
73
|
-
return this.driver.get(key);
|
|
74
|
-
});
|
|
52
|
+
return this.driver.get(key);
|
|
75
53
|
}
|
|
76
54
|
setListable(options, value) {
|
|
77
|
-
return
|
|
78
|
-
return this.driver.setListable(options, value);
|
|
79
|
-
});
|
|
55
|
+
return this.driver.setListable(options, value);
|
|
80
56
|
}
|
|
81
57
|
setReadable(options, value) {
|
|
82
|
-
return
|
|
83
|
-
return this.driver.setReadable(options, value);
|
|
84
|
-
});
|
|
58
|
+
return this.driver.setReadable(options, value);
|
|
85
59
|
}
|
|
86
60
|
setWritable(options, value) {
|
|
87
|
-
return
|
|
88
|
-
return this.driver.setWritable(options, value);
|
|
89
|
-
});
|
|
61
|
+
return this.driver.setWritable(options, value);
|
|
90
62
|
}
|
|
91
63
|
isListable(options) {
|
|
92
|
-
return
|
|
93
|
-
return this.driver.isListable(options);
|
|
94
|
-
});
|
|
64
|
+
return this.driver.isListable(options);
|
|
95
65
|
}
|
|
96
66
|
isReadable(options) {
|
|
97
|
-
return
|
|
98
|
-
return this.driver.isReadable(options);
|
|
99
|
-
});
|
|
67
|
+
return this.driver.isReadable(options);
|
|
100
68
|
}
|
|
101
69
|
isWritable(options) {
|
|
102
|
-
return
|
|
103
|
-
return this.driver.isWritable(options);
|
|
104
|
-
});
|
|
70
|
+
return this.driver.isWritable(options);
|
|
105
71
|
}
|
|
106
72
|
getSpaceStatus() {
|
|
107
73
|
var _a, _b;
|
|
@@ -162,34 +128,22 @@ class Space {
|
|
|
162
128
|
});
|
|
163
129
|
}
|
|
164
130
|
delete(options) {
|
|
165
|
-
return
|
|
166
|
-
return this.driver.delete(options);
|
|
167
|
-
});
|
|
131
|
+
return this.driver.delete(options);
|
|
168
132
|
}
|
|
169
133
|
read(options) {
|
|
170
|
-
return
|
|
171
|
-
return this.driver.read(options);
|
|
172
|
-
});
|
|
134
|
+
return this.driver.read(options);
|
|
173
135
|
}
|
|
174
136
|
getHash(options) {
|
|
175
|
-
return
|
|
176
|
-
return this.driver.getHash(options);
|
|
177
|
-
});
|
|
137
|
+
return this.driver.getHash(options);
|
|
178
138
|
}
|
|
179
139
|
exists(options) {
|
|
180
|
-
return
|
|
181
|
-
return this.driver.exists(options);
|
|
182
|
-
});
|
|
140
|
+
return this.driver.exists(options);
|
|
183
141
|
}
|
|
184
142
|
lists(options) {
|
|
185
|
-
return
|
|
186
|
-
return this.driver.lists(options);
|
|
187
|
-
});
|
|
143
|
+
return this.driver.lists(options);
|
|
188
144
|
}
|
|
189
145
|
list(options) {
|
|
190
|
-
return
|
|
191
|
-
return this.driver.list(options);
|
|
192
|
-
});
|
|
146
|
+
return this.driver.list(options);
|
|
193
147
|
}
|
|
194
148
|
writeAsOwner(key, data) {
|
|
195
149
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -205,22 +159,16 @@ class Space {
|
|
|
205
159
|
});
|
|
206
160
|
}
|
|
207
161
|
deleteAsOwner(key) {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
return this.driver.deleteAsOwner(key);
|
|
213
|
-
});
|
|
162
|
+
if (Space.READONLY_OBJECT_KEYS.includes(key)) {
|
|
163
|
+
throw new Error(`Object ${key} cannot be deleted`);
|
|
164
|
+
}
|
|
165
|
+
return this.driver.deleteAsOwner(key);
|
|
214
166
|
}
|
|
215
167
|
readAsOwner(key) {
|
|
216
|
-
return
|
|
217
|
-
return this.driver.readAsOwner(key);
|
|
218
|
-
});
|
|
168
|
+
return this.driver.readAsOwner(key);
|
|
219
169
|
}
|
|
220
170
|
existsAsOwner(key) {
|
|
221
|
-
return
|
|
222
|
-
return this.driver.existsAsOwner(key);
|
|
223
|
-
});
|
|
171
|
+
return this.driver.existsAsOwner(key);
|
|
224
172
|
}
|
|
225
173
|
static editable(key) {
|
|
226
174
|
return !Space.READONLY_OBJECT_KEYS.includes(key);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@did-space/core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.118",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
]
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@arcblock/validator": "^1.18.
|
|
35
|
+
"@arcblock/validator": "^1.18.84",
|
|
36
36
|
"joi": "^17.9.2",
|
|
37
37
|
"xbytes": "^1.8.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@arcblock/eslint-config-ts": "^0.2.
|
|
40
|
+
"@arcblock/eslint-config-ts": "^0.2.4",
|
|
41
41
|
"@types/jest": "^28.1.5",
|
|
42
42
|
"@types/node": "15.12.2",
|
|
43
43
|
"@typescript-eslint/eslint-plugin": "^5.30.6",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"ts-jest": "^28.0.6",
|
|
48
48
|
"typescript": "^4.9.5"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "ae24b656fb484cb1147c3bccce6d4c8f956e7c30"
|
|
51
51
|
}
|