@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 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#setPreview | setPreview()} to change preview image.
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. Can be a <a
2191
- * href="https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs"
2192
- * target="_blank">Data URL</a> string, <a
2193
- * href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer"
2194
- * target="_blank">ArrayBuffer</a>, <a
2195
- * href="https://developer.mozilla.org/docs/Web/API/Blob/Blob" target="_blank">Blob</a> or
2196
- * Web API <a href="https://developer.mozilla.org/docs/Web/API/File"
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
- const response = await (image ? this.internalPost("/preview", image) : this.internalDelete("/preview"));
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 [setPreview()]{@link Project#setPreview} to change preview image.
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 <a
3208
- * href="https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs"
3209
- * target="_blank">Data URL</a> string, <a
3210
- * href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer"
3211
- * target="_blank">ArrayBuffer</a>, <a
3212
- * href="https://developer.mozilla.org/docs/Web/API/Blob/Blob" target="_blank">Blob</a> or
3213
- * Web API <a href="https://developer.mozilla.org/docs/Web/API/File"
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
- const response = await (image ? this.internalPost("/preview", image) : this.internalDelete("/preview"));
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#setAvatar | setAvatar()} to change avatar image.
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.0",
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, avatarUrl) {
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.0";
4557
+ const version = "25.6.2";
4529
4558
 
4530
4559
  exports.Assembly = Assembly;
4531
4560
  exports.ClashTest = ClashTest;