@inweb/client 25.6.0 → 25.6.2
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/client.js +56 -27
- package/dist/client.js.map +1 -1
- package/dist/client.min.js +1 -1
- package/dist/client.module.js +28 -7
- package/dist/client.module.js.map +1 -1
- package/lib/Api/Assembly.d.ts +2 -1
- package/lib/Api/Client.d.ts +1 -3
- package/lib/Api/File.d.ts +15 -10
- package/lib/Api/Project.d.ts +16 -11
- package/lib/Api/User.d.ts +1 -1
- package/package.json +2 -2
- package/src/Api/Assembly.ts +6 -1
- package/src/Api/Client.ts +1 -5
- package/src/Api/File.ts +25 -11
- package/src/Api/Project.ts +27 -13
- package/src/Api/User.ts +1 -1
package/dist/client.js
CHANGED
|
@@ -928,6 +928,10 @@
|
|
|
928
928
|
console.warn("Assembly does not support preview");
|
|
929
929
|
return Promise.resolve(this);
|
|
930
930
|
}
|
|
931
|
+
deletePreview() {
|
|
932
|
+
console.warn("Assembly does not support preview");
|
|
933
|
+
return Promise.resolve(this);
|
|
934
|
+
}
|
|
931
935
|
/**
|
|
932
936
|
* Returns list of assembly models.
|
|
933
937
|
*
|
|
@@ -2056,7 +2060,7 @@
|
|
|
2056
2060
|
return this.data.owner;
|
|
2057
2061
|
}
|
|
2058
2062
|
/**
|
|
2059
|
-
* File preview image URL. Use {@link File
|
|
2063
|
+
* File preview image URL. Use {@link File.setPreview | setPreview()} to change preview image.
|
|
2060
2064
|
*
|
|
2061
2065
|
* @readonly
|
|
2062
2066
|
*/
|
|
@@ -2187,17 +2191,31 @@
|
|
|
2187
2191
|
* Set or remove the file preview.
|
|
2188
2192
|
*
|
|
2189
2193
|
* @async
|
|
2190
|
-
* @param image - Preview image.
|
|
2191
|
-
*
|
|
2192
|
-
*
|
|
2193
|
-
*
|
|
2194
|
-
*
|
|
2195
|
-
*
|
|
2196
|
-
*
|
|
2197
|
-
* target="_blank">File</a> object. Setting the `image` to `null` will remove the preview.
|
|
2194
|
+
* @param image - Preview image.Can be a
|
|
2195
|
+
* {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}
|
|
2196
|
+
* string,
|
|
2197
|
+
* {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer | ArrayBuffer},
|
|
2198
|
+
* {@link https://developer.mozilla.org/docs/Web/API/Blob/Blob | Blob} or Web API
|
|
2199
|
+
* {@link https://developer.mozilla.org/docs/Web/API/File | File} object. Setting the
|
|
2200
|
+
* `image` to `null` will remove the preview.
|
|
2198
2201
|
*/
|
|
2199
2202
|
async setPreview(image) {
|
|
2200
|
-
|
|
2203
|
+
if (!image) {
|
|
2204
|
+
await this.deletePreview();
|
|
2205
|
+
}
|
|
2206
|
+
else {
|
|
2207
|
+
const response = await this.internalPost("/preview", image);
|
|
2208
|
+
this.data = await response.json();
|
|
2209
|
+
}
|
|
2210
|
+
return this;
|
|
2211
|
+
}
|
|
2212
|
+
/**
|
|
2213
|
+
* Remove the file preview.
|
|
2214
|
+
*
|
|
2215
|
+
* @async
|
|
2216
|
+
*/
|
|
2217
|
+
async deletePreview() {
|
|
2218
|
+
const response = await this.internalDelete("/preview");
|
|
2201
2219
|
this.data = await response.json();
|
|
2202
2220
|
return this;
|
|
2203
2221
|
}
|
|
@@ -3108,7 +3126,7 @@
|
|
|
3108
3126
|
return this.data.owner;
|
|
3109
3127
|
}
|
|
3110
3128
|
/**
|
|
3111
|
-
* Project preview image URL. Use
|
|
3129
|
+
* Project preview image URL. Use {@link Project.setPreview | setPreview()} to change preview image.
|
|
3112
3130
|
*
|
|
3113
3131
|
* @readonly
|
|
3114
3132
|
*/
|
|
@@ -3204,17 +3222,31 @@
|
|
|
3204
3222
|
* Set or remove the project preview.
|
|
3205
3223
|
*
|
|
3206
3224
|
* @async
|
|
3207
|
-
* @param image - Preview image. Can be a
|
|
3208
|
-
*
|
|
3209
|
-
*
|
|
3210
|
-
*
|
|
3211
|
-
*
|
|
3212
|
-
*
|
|
3213
|
-
*
|
|
3214
|
-
* target="_blank">File</a> object. Setting the `image` to `null` will remove the preview.
|
|
3225
|
+
* @param image - Preview image. Can be a
|
|
3226
|
+
* {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}
|
|
3227
|
+
* string,
|
|
3228
|
+
* {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer | ArrayBuffer},
|
|
3229
|
+
* {@link https://developer.mozilla.org/docs/Web/API/Blob/Blob | Blob} or Web API
|
|
3230
|
+
* {@link https://developer.mozilla.org/docs/Web/API/File | File} object. Setting the
|
|
3231
|
+
* `image` to `null` will remove the preview.
|
|
3215
3232
|
*/
|
|
3216
3233
|
async setPreview(image) {
|
|
3217
|
-
|
|
3234
|
+
if (!image) {
|
|
3235
|
+
await this.deletePreview();
|
|
3236
|
+
}
|
|
3237
|
+
else {
|
|
3238
|
+
const response = await this.internalPost("/preview", image);
|
|
3239
|
+
this.data = await response.json();
|
|
3240
|
+
}
|
|
3241
|
+
return this;
|
|
3242
|
+
}
|
|
3243
|
+
/**
|
|
3244
|
+
* Remove the project preview.
|
|
3245
|
+
*
|
|
3246
|
+
* @async
|
|
3247
|
+
*/
|
|
3248
|
+
async deletePreview() {
|
|
3249
|
+
const response = await this.internalDelete("/preview");
|
|
3218
3250
|
this.data = await response.json();
|
|
3219
3251
|
return this;
|
|
3220
3252
|
}
|
|
@@ -3387,7 +3419,7 @@
|
|
|
3387
3419
|
this.data = data;
|
|
3388
3420
|
}
|
|
3389
3421
|
/**
|
|
3390
|
-
* User avatar image URL. Use {@link User
|
|
3422
|
+
* User avatar image URL. Use {@link User.setAvatar | setAvatar()} to change avatar image.
|
|
3391
3423
|
*
|
|
3392
3424
|
* @readonly
|
|
3393
3425
|
*/
|
|
@@ -3797,7 +3829,7 @@
|
|
|
3797
3829
|
.then((data) => ({
|
|
3798
3830
|
...data,
|
|
3799
3831
|
server: data.version,
|
|
3800
|
-
client: "25.6.
|
|
3832
|
+
client: "25.6.2",
|
|
3801
3833
|
}));
|
|
3802
3834
|
}
|
|
3803
3835
|
/**
|
|
@@ -4486,17 +4518,14 @@
|
|
|
4486
4518
|
* @param description - Project description.
|
|
4487
4519
|
* @param startDate - Project start date.
|
|
4488
4520
|
* @param endDate - Project end date.
|
|
4489
|
-
* @param avatarUrl - Project preview image URL. Can be
|
|
4490
|
-
* {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}.
|
|
4491
4521
|
*/
|
|
4492
|
-
createProject(name, description, startDate, endDate
|
|
4522
|
+
createProject(name, description, startDate, endDate) {
|
|
4493
4523
|
return this.httpClient
|
|
4494
4524
|
.post("/projects", {
|
|
4495
4525
|
name,
|
|
4496
4526
|
description,
|
|
4497
4527
|
startDate: startDate instanceof Date ? startDate.toISOString() : startDate,
|
|
4498
4528
|
endDate: endDate instanceof Date ? endDate.toISOString() : endDate,
|
|
4499
|
-
avatarUrl,
|
|
4500
4529
|
})
|
|
4501
4530
|
.then((response) => response.json())
|
|
4502
4531
|
.then((data) => new Project(data, this.httpClient));
|
|
@@ -4525,7 +4554,7 @@
|
|
|
4525
4554
|
}
|
|
4526
4555
|
|
|
4527
4556
|
///////////////////////////////////////////////////////////////////////////////
|
|
4528
|
-
const version = "25.6.
|
|
4557
|
+
const version = "25.6.2";
|
|
4529
4558
|
|
|
4530
4559
|
exports.Assembly = Assembly;
|
|
4531
4560
|
exports.ClashTest = ClashTest;
|