@inweb/client 25.4.1 → 25.4.3

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.
@@ -5,8 +5,8 @@ import { IShortUserDescription } from "./IUser";
5
5
  */
6
6
  export declare class ClashTest {
7
7
  private _data;
8
- private basePath;
9
- private httpClient;
8
+ basePath: string;
9
+ httpClient: IHttpClient;
10
10
  /**
11
11
  * @param data - Raw test data.
12
12
  * @param basePath - Clash tests API base path for the owner file/assembly.
@@ -1,4 +1,5 @@
1
1
  import { EventEmitter2 } from "@inweb/eventemitter2";
2
+ import { IHttpClient } from "./IHttpClient";
2
3
  import { ClientEventMap } from "./ClientEvents";
3
4
  import { Assembly } from "./Assembly";
4
5
  import { File } from "./File";
@@ -12,7 +13,7 @@ import { User } from "./User";
12
13
  */
13
14
  export declare class Client extends EventEmitter2<ClientEventMap> {
14
15
  private _serverUrl;
15
- private _httpClient;
16
+ httpClient: IHttpClient;
16
17
  private _user;
17
18
  eventEmitter: EventEmitter2;
18
19
  /**
@@ -92,13 +93,22 @@ export declare class Client extends EventEmitter2<ClientEventMap> {
92
93
  */
93
94
  signInWithEmail(email: string, password: string): Promise<User>;
94
95
  /**
95
- * Log in an existing user using API Key.
96
+ * Log in an existing user using access token (API Key).
96
97
  *
97
98
  * @async
98
- * @param token - An access token for authentication request. See
99
- * {@link User#token | User.token} for more details.
99
+ * @param token - An access token for authentication request. See {@link User.token} for more details.
100
100
  */
101
101
  signInWithToken(token: string): Promise<User>;
102
+ /**
103
+ * Get the list of server indentity providers.
104
+ *
105
+ * To sign in with the provider in your web application:
106
+ *
107
+ * - Open the `provider.url` link using `window.open()`.
108
+ * - Add a `/oauth` path (server-defined) handler to the router. In this handler, show an error
109
+ * message if the `error` search parameter is present, or log in with the `token` search parameter.
110
+ */
111
+ getIdentityProviders(): Promise<any>;
102
112
  private setCurrentUser;
103
113
  private clearCurrentUser;
104
114
  /**
package/lib/Api/Job.d.ts CHANGED
@@ -5,7 +5,7 @@ import { IHttpClient } from "./IHttpClient";
5
5
  */
6
6
  export declare class Job {
7
7
  private _data;
8
- protected httpClient: IHttpClient;
8
+ httpClient: IHttpClient;
9
9
  /**
10
10
  * @param data - An object that implements job data storage.
11
11
  * @param httpClient - Http client.
@@ -5,8 +5,8 @@ import { IShortUserDescription } from "./IUser";
5
5
  */
6
6
  export declare class Member {
7
7
  private _data;
8
- protected projectId: string;
9
- protected httpClient: IHttpClient;
8
+ projectId: string;
9
+ httpClient: IHttpClient;
10
10
  /**
11
11
  * @param data - An object that implements member data storage.
12
12
  * @param projectId - Owner project ID.
@@ -5,8 +5,8 @@ import { IHttpClient } from "./IHttpClient";
5
5
  */
6
6
  export declare class Permission {
7
7
  private _data;
8
- protected fileId: string;
9
- protected httpClient: IHttpClient;
8
+ fileId: string;
9
+ httpClient: IHttpClient;
10
10
  /**
11
11
  * @param data - An object that implements permission data storage.
12
12
  * @param fileId - Owner file ID.
@@ -7,7 +7,7 @@ import { Member } from "./Member";
7
7
  */
8
8
  export declare class Project {
9
9
  private _data;
10
- protected httpClient: IHttpClient;
10
+ httpClient: IHttpClient;
11
11
  /**
12
12
  * @param data - An object that implements project data storage.
13
13
  * @param httpClient - Http client.
package/lib/Api/Role.d.ts CHANGED
@@ -4,8 +4,8 @@ import { IHttpClient } from "./IHttpClient";
4
4
  */
5
5
  export declare class Role {
6
6
  private _data;
7
- protected projectId: string;
8
- protected httpClient: IHttpClient;
7
+ projectId: string;
8
+ httpClient: IHttpClient;
9
9
  /**
10
10
  * @param data - An object that implements role data storage.
11
11
  * @param projectId - Owner project ID.
package/lib/Api/User.d.ts CHANGED
@@ -34,7 +34,7 @@ export interface UserParams {
34
34
  */
35
35
  export declare class User {
36
36
  private _data;
37
- protected httpClient: IHttpClient;
37
+ httpClient: IHttpClient;
38
38
  /**
39
39
  * @param data - An object that implements user data storage.
40
40
  * @param httpClient - Http client.
@@ -132,7 +132,7 @@ export declare class User {
132
132
  */
133
133
  get projectsLimit(): number;
134
134
  /**
135
- * The user's API key.
135
+ * The user's access token (API key). Use {@link Client.signInWithToken()} to log in using token.
136
136
  *
137
137
  * @readonly
138
138
  */
package/lib/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export { Client } from "./Api/Client";
3
3
  export { ClashTest } from "./Api/ClashTest";
4
4
  export * from "./Api/ClientEvents";
5
5
  export { File } from "./Api/File";
6
+ export { FetchError, statusText } from "./Api/FetchError";
6
7
  export { Job } from "./Api/Job";
7
8
  export { Member } from "./Api/Member";
8
9
  export { Model } from "./Api/Model";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inweb/client",
3
- "version": "25.4.1",
3
+ "version": "25.4.3",
4
4
  "description": "JavaScript REST API client for the Open Cloud Server",
5
5
  "homepage": "https://cloud.opendesign.com/docs/index.html",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -26,6 +26,6 @@
26
26
  "ts-docs": "typedoc"
27
27
  },
28
28
  "dependencies": {
29
- "@inweb/eventemitter2": "~25.4.1"
29
+ "@inweb/eventemitter2": "~25.4.3"
30
30
  }
31
31
  }
@@ -30,8 +30,8 @@ import { waitFor, userFullName, userInitials } from "./Utils";
30
30
  */
31
31
  export class ClashTest {
32
32
  private _data: any;
33
- private basePath: string;
34
- private httpClient: IHttpClient;
33
+ public basePath: string;
34
+ public httpClient: IHttpClient;
35
35
 
36
36
  /**
37
37
  * @param data - Raw test data.
package/src/Api/Client.ts CHANGED
@@ -40,7 +40,7 @@ import { parseArgs } from "./Utils";
40
40
  */
41
41
  export class Client extends EventEmitter2<ClientEventMap> {
42
42
  private _serverUrl = "";
43
- private _httpClient: IHttpClient = new HttpClient("");
43
+ public httpClient: IHttpClient = new HttpClient("");
44
44
  private _user: User | null = null;
45
45
  public eventEmitter: EventEmitter2 = this;
46
46
 
@@ -114,7 +114,7 @@ export class Client extends EventEmitter2<ClientEventMap> {
114
114
  */
115
115
  configure(params: { serverUrl?: string }): this {
116
116
  this._serverUrl = (params.serverUrl || "").replace(/\/+$/, "");
117
- this._httpClient = new HttpClient(this.serverUrl);
117
+ this.httpClient = new HttpClient(this.serverUrl);
118
118
  this._user = null;
119
119
  return this;
120
120
  }
@@ -133,7 +133,7 @@ export class Client extends EventEmitter2<ClientEventMap> {
133
133
  * @async
134
134
  */
135
135
  version(): Promise<any> {
136
- return this._httpClient
136
+ return this.httpClient
137
137
  .get("/version")
138
138
  .then((response) => response.json())
139
139
  .then((data) => ({
@@ -154,7 +154,7 @@ export class Client extends EventEmitter2<ClientEventMap> {
154
154
  * `username` from email.
155
155
  */
156
156
  registerUser(email: string, password: string, userName?: string): Promise<any> {
157
- return this._httpClient
157
+ return this.httpClient
158
158
  .post("/register", {
159
159
  email,
160
160
  password,
@@ -172,7 +172,7 @@ export class Client extends EventEmitter2<ClientEventMap> {
172
172
  * @param password - User password.
173
173
  */
174
174
  resendConfirmationEmail(email: string, password: string): Promise<any> {
175
- return this._httpClient
175
+ return this.httpClient
176
176
  .post("/register/email-confirmation", { email, password })
177
177
  .then((response) => response.json());
178
178
  }
@@ -184,7 +184,7 @@ export class Client extends EventEmitter2<ClientEventMap> {
184
184
  * @param emailConfirmationId - Confirmation code from the Confirmation Email.
185
185
  */
186
186
  confirmUserEmail(emailConfirmationId: string): Promise<any> {
187
- return this._httpClient
187
+ return this.httpClient
188
188
  .get(`/register/email-confirmation/${emailConfirmationId}`)
189
189
  .then((response) => response.json());
190
190
  }
@@ -198,39 +198,51 @@ export class Client extends EventEmitter2<ClientEventMap> {
198
198
  */
199
199
  async signInWithEmail(email: string, password: string): Promise<User> {
200
200
  const credentials = btoa(unescape(encodeURIComponent(email + ":" + password)));
201
- this._httpClient.headers = { Authorization: "Basic " + credentials };
202
- const response = await this._httpClient.get("/token");
201
+ this.httpClient.headers = { Authorization: "Basic " + credentials };
202
+ const response = await this.httpClient.get("/token");
203
203
  const data = await response.json();
204
204
  return this.setCurrentUser(data);
205
205
  }
206
206
 
207
207
  /**
208
- * Log in an existing user using API Key.
208
+ * Log in an existing user using access token (API Key).
209
209
  *
210
210
  * @async
211
- * @param token - An access token for authentication request. See
212
- * {@link User#token | User.token} for more details.
211
+ * @param token - An access token for authentication request. See {@link User.token} for more details.
213
212
  */
214
213
  async signInWithToken(token: string): Promise<User> {
215
- this._httpClient.headers = { Authorization: token };
216
- const response = await this._httpClient.get("/user");
214
+ this.httpClient.headers = { Authorization: token };
215
+ const response = await this.httpClient.get("/user");
217
216
  const data = await response.json();
218
217
  return this.setCurrentUser(data);
219
218
  }
220
219
 
220
+ /**
221
+ * Get the list of server indentity providers.
222
+ *
223
+ * To sign in with the provider in your web application:
224
+ *
225
+ * - Open the `provider.url` link using `window.open()`.
226
+ * - Add a `/oauth` path (server-defined) handler to the router. In this handler, show an error
227
+ * message if the `error` search parameter is present, or log in with the `token` search parameter.
228
+ */
229
+ getIdentityProviders(): Promise<any> {
230
+ return this.httpClient.get("/identity").then((response) => response.json());
231
+ }
232
+
221
233
  // Save the current logged in user information for internal use.
222
234
 
223
235
  private setCurrentUser(data: any): User {
224
- this._user = new User(data, this._httpClient);
225
- this._httpClient.headers = { Authorization: data.tokenInfo.token };
226
- this._httpClient.signInUserId = this._user.id;
236
+ this._user = new User(data, this.httpClient);
237
+ this.httpClient.headers = { Authorization: data.tokenInfo.token };
238
+ this.httpClient.signInUserId = this._user.id;
227
239
  return this._user;
228
240
  }
229
241
 
230
242
  private clearCurrentUser(): void {
231
243
  this._user = null;
232
- this._httpClient.headers = {};
233
- this._httpClient.signInUserId = "";
244
+ this.httpClient.headers = {};
245
+ this.httpClient.signInUserId = "";
234
246
  }
235
247
 
236
248
  /**
@@ -238,7 +250,7 @@ export class Client extends EventEmitter2<ClientEventMap> {
238
250
  * in or the logged in user has deleted himself.
239
251
  */
240
252
  getCurrentUser(): User | null {
241
- if (this._user && !this._httpClient.signInUserId) this._user = null;
253
+ if (this._user && !this.httpClient.signInUserId) this._user = null;
242
254
  return this._user;
243
255
  }
244
256
 
@@ -249,11 +261,11 @@ export class Client extends EventEmitter2<ClientEventMap> {
249
261
  * @async
250
262
  */
251
263
  getUsers(): Promise<User[]> {
252
- return this._httpClient
264
+ return this.httpClient
253
265
  .get("/users")
254
266
  .then((response) => response.json())
255
267
  .then((array) => array.map((data) => ({ id: data.id, ...data.userBrief })))
256
- .then((array) => array.map((data) => new User(data, this._httpClient)));
268
+ .then((array) => array.map((data) => new User(data, this.httpClient)));
257
269
  }
258
270
 
259
271
  /**
@@ -265,18 +277,18 @@ export class Client extends EventEmitter2<ClientEventMap> {
265
277
  * @param userId - User ID.
266
278
  */
267
279
  getUser(userId: string): Promise<User> {
268
- if (userId === this._httpClient.signInUserId) {
269
- return this._httpClient
280
+ if (userId === this.httpClient.signInUserId) {
281
+ return this.httpClient
270
282
  .get("/user")
271
283
  .then((response) => response.json())
272
284
  .then((data) => ({ id: userId, ...data }))
273
- .then((data) => new User(data, this._httpClient));
285
+ .then((data) => new User(data, this.httpClient));
274
286
  } else {
275
- return this._httpClient
287
+ return this.httpClient
276
288
  .get(`/users/${userId}`)
277
289
  .then((response) => response.json())
278
290
  .then((data) => ({ id: data.id, ...data.userBrief }))
279
- .then((data) => new User(data, this._httpClient));
291
+ .then((data) => new User(data, this.httpClient));
280
292
  }
281
293
  }
282
294
 
@@ -312,7 +324,7 @@ export class Client extends EventEmitter2<ClientEventMap> {
312
324
  } = {}
313
325
  ): Promise<User> {
314
326
  const { isAdmin, userName, ...rest } = params;
315
- return this._httpClient
327
+ return this.httpClient
316
328
  .post("/users", {
317
329
  isAdmin,
318
330
  userBrief: {
@@ -324,7 +336,7 @@ export class Client extends EventEmitter2<ClientEventMap> {
324
336
  })
325
337
  .then((response) => response.json())
326
338
  .then((data) => ({ id: data.id, ...data.userBrief }))
327
- .then((data) => new User(data, this._httpClient));
339
+ .then((data) => new User(data, this.httpClient));
328
340
  }
329
341
 
330
342
  /**
@@ -341,11 +353,11 @@ export class Client extends EventEmitter2<ClientEventMap> {
341
353
  * @returns Returns the raw data of a deleted user.
342
354
  */
343
355
  deleteUser(userId: string): Promise<any> {
344
- return this._httpClient
356
+ return this.httpClient
345
357
  .delete(`/users/${userId}`)
346
358
  .then((response) => response.json())
347
359
  .then((data) => {
348
- if (userId === this._httpClient.signInUserId) {
360
+ if (userId === this.httpClient.signInUserId) {
349
361
  this.clearCurrentUser();
350
362
  }
351
363
  return data;
@@ -408,13 +420,13 @@ export class Client extends EventEmitter2<ClientEventMap> {
408
420
  let queryString = searchParams.toString();
409
421
  if (queryString) queryString = "?" + queryString;
410
422
 
411
- return this._httpClient
423
+ return this.httpClient
412
424
  .get(`/files${queryString}`)
413
425
  .then((response) => response.json())
414
426
  .then((files) => {
415
427
  return {
416
428
  ...files,
417
- result: files.result.map((data) => new File(data, this._httpClient)),
429
+ result: files.result.map((data) => new File(data, this.httpClient)),
418
430
  };
419
431
  });
420
432
  }
@@ -426,10 +438,10 @@ export class Client extends EventEmitter2<ClientEventMap> {
426
438
  * @param fileId - File ID.
427
439
  */
428
440
  getFile(fileId: string): Promise<File> {
429
- return this._httpClient
441
+ return this.httpClient
430
442
  .get(`/files/${fileId}`)
431
443
  .then((response) => response.json())
432
- .then((data) => new File(data, this._httpClient));
444
+ .then((data) => new File(data, this.httpClient));
433
445
  }
434
446
 
435
447
  /**
@@ -478,13 +490,13 @@ export class Client extends EventEmitter2<ClientEventMap> {
478
490
  waitForDone: false,
479
491
  }
480
492
  ): Promise<File> {
481
- const result = await this._httpClient
493
+ const result = await this.httpClient
482
494
  .uploadFile("/files", file, (progress) => {
483
495
  this.emitEvent({ type: "uploadprogress", data: progress, file });
484
496
  params.onProgress?.(progress, file);
485
497
  })
486
498
  .then((xhr: XMLHttpRequest) => JSON.parse(xhr.responseText))
487
- .then((data) => new File(data, this._httpClient));
499
+ .then((data) => new File(data, this.httpClient));
488
500
 
489
501
  const geometryType = typeof params.geometry === "string" ? params.geometry : "vsfx";
490
502
 
@@ -506,7 +518,7 @@ export class Client extends EventEmitter2<ClientEventMap> {
506
518
  * @returns Returns the raw data of a deleted file.
507
519
  */
508
520
  deleteFile(fileId: string): Promise<any> {
509
- return this._httpClient.delete(`/files/${fileId}`).then((response) => response.json());
521
+ return this.httpClient.delete(`/files/${fileId}`).then((response) => response.json());
510
522
  }
511
523
 
512
524
  /**
@@ -520,7 +532,7 @@ export class Client extends EventEmitter2<ClientEventMap> {
520
532
  * and abort it if desired.
521
533
  */
522
534
  downloadFile(fileId: string, onProgress?: (progress: number) => void, signal?: AbortSignal): Promise<ArrayBuffer> {
523
- return this._httpClient
535
+ return this.httpClient
524
536
  .downloadFile(`/files/${fileId}/downloads`, onProgress, signal)
525
537
  .then((response) => response.arrayBuffer());
526
538
  }
@@ -569,12 +581,12 @@ export class Client extends EventEmitter2<ClientEventMap> {
569
581
  let queryString = searchParams.toString();
570
582
  if (queryString) queryString = "?" + queryString;
571
583
 
572
- return this._httpClient
584
+ return this.httpClient
573
585
  .get(`/jobs${queryString}`)
574
586
  .then((response) => response.json())
575
587
  .then((jobs) => ({
576
588
  ...jobs,
577
- result: jobs.result.map((data) => new Job(data, this._httpClient)),
589
+ result: jobs.result.map((data) => new Job(data, this.httpClient)),
578
590
  }));
579
591
  }
580
592
 
@@ -585,10 +597,10 @@ export class Client extends EventEmitter2<ClientEventMap> {
585
597
  * @param jobId - Job ID.
586
598
  */
587
599
  getJob(jobId: string): Promise<Job> {
588
- return this._httpClient
600
+ return this.httpClient
589
601
  .get(`/jobs/${jobId}`)
590
602
  .then((response) => response.json())
591
- .then((data) => new Job(data, this._httpClient));
603
+ .then((data) => new Job(data, this.httpClient));
592
604
  }
593
605
 
594
606
  /**
@@ -610,14 +622,14 @@ export class Client extends EventEmitter2<ClientEventMap> {
610
622
  * for the File Converter tool in form "--arg=value".
611
623
  */
612
624
  createJob(fileId: string, outputFormat: string, parameters?: string | object): Promise<Job> {
613
- return this._httpClient
625
+ return this.httpClient
614
626
  .post("/jobs", {
615
627
  fileId,
616
628
  outputFormat,
617
629
  parameters: parseArgs(parameters),
618
630
  })
619
631
  .then((response) => response.json())
620
- .then((data) => new Job(data, this._httpClient));
632
+ .then((data) => new Job(data, this.httpClient));
621
633
  }
622
634
 
623
635
  /**
@@ -629,7 +641,7 @@ export class Client extends EventEmitter2<ClientEventMap> {
629
641
  * @returns Returns the raw data of a deleted job.
630
642
  */
631
643
  deleteJob(jobId: string): Promise<any> {
632
- return this._httpClient.delete(`/jobs/${jobId}`).then((response) => response.json());
644
+ return this.httpClient.delete(`/jobs/${jobId}`).then((response) => response.json());
633
645
  }
634
646
 
635
647
  /**
@@ -680,13 +692,13 @@ export class Client extends EventEmitter2<ClientEventMap> {
680
692
  let queryString = searchParams.toString();
681
693
  if (queryString) queryString = "?" + queryString;
682
694
 
683
- return this._httpClient
695
+ return this.httpClient
684
696
  .get(`/assemblies${queryString}`)
685
697
  .then((response) => response.json())
686
698
  .then((assemblies) => {
687
699
  return {
688
700
  ...assemblies,
689
- result: assemblies.result.map((data) => new Assembly(data, this._httpClient)),
701
+ result: assemblies.result.map((data) => new Assembly(data, this.httpClient)),
690
702
  };
691
703
  });
692
704
  }
@@ -698,10 +710,10 @@ export class Client extends EventEmitter2<ClientEventMap> {
698
710
  * @param assemblyId - Assembly ID.
699
711
  */
700
712
  getAssembly(assemblyId: string): Promise<Assembly> {
701
- return this._httpClient
713
+ return this.httpClient
702
714
  .get(`/assemblies/${assemblyId}`)
703
715
  .then((response) => response.json())
704
- .then((data) => new Assembly(data, this._httpClient));
716
+ .then((data) => new Assembly(data, this.httpClient));
705
717
  }
706
718
 
707
719
  /**
@@ -724,10 +736,10 @@ export class Client extends EventEmitter2<ClientEventMap> {
724
736
  }
725
737
  ): Promise<Assembly> {
726
738
  const { waitForDone } = params ?? {};
727
- return this._httpClient
739
+ return this.httpClient
728
740
  .post("/assemblies", { name, files })
729
741
  .then((response) => response.json())
730
- .then((data) => new Assembly(data, this._httpClient))
742
+ .then((data) => new Assembly(data, this.httpClient))
731
743
  .then((result) => (waitForDone ? result.waitForDone(params) : result));
732
744
  }
733
745
 
@@ -739,7 +751,7 @@ export class Client extends EventEmitter2<ClientEventMap> {
739
751
  * @returns Returns the raw data of a deleted assembly.
740
752
  */
741
753
  deleteAssembly(assemblyId: string): Promise<any> {
742
- return this._httpClient.delete(`/assemblies/${assemblyId}`).then((response) => response.json());
754
+ return this.httpClient.delete(`/assemblies/${assemblyId}`).then((response) => response.json());
743
755
  }
744
756
 
745
757
  /**
@@ -785,7 +797,7 @@ export class Client extends EventEmitter2<ClientEventMap> {
785
797
 
786
798
  let queryString = searchParams.toString();
787
799
  if (queryString) queryString = "?" + queryString;
788
- return this._httpClient
800
+ return this.httpClient
789
801
  .get(`/projects${queryString}`)
790
802
  .then((response) => response.json())
791
803
  .then((projects) => {
@@ -811,7 +823,7 @@ export class Client extends EventEmitter2<ClientEventMap> {
811
823
  .then((projects) => {
812
824
  return {
813
825
  ...projects,
814
- result: projects.result.map((data) => new Project(data, this._httpClient)),
826
+ result: projects.result.map((data) => new Project(data, this.httpClient)),
815
827
  };
816
828
  });
817
829
  }
@@ -823,10 +835,10 @@ export class Client extends EventEmitter2<ClientEventMap> {
823
835
  * @param projectId - Project ID.
824
836
  */
825
837
  getProject(projectId: string): Promise<Project> {
826
- return this._httpClient
838
+ return this.httpClient
827
839
  .get(`/projects/${projectId}`)
828
840
  .then((response) => response.json())
829
- .then((data) => new Project(data, this._httpClient));
841
+ .then((data) => new Project(data, this.httpClient));
830
842
  }
831
843
 
832
844
  /**
@@ -848,7 +860,7 @@ export class Client extends EventEmitter2<ClientEventMap> {
848
860
  endDate?: Date | string,
849
861
  avatarUrl?: string
850
862
  ): Promise<Project> {
851
- return this._httpClient
863
+ return this.httpClient
852
864
  .post("/projects", {
853
865
  name,
854
866
  description,
@@ -857,7 +869,7 @@ export class Client extends EventEmitter2<ClientEventMap> {
857
869
  avatarUrl,
858
870
  })
859
871
  .then((response) => response.json())
860
- .then((data) => new Project(data, this._httpClient));
872
+ .then((data) => new Project(data, this.httpClient));
861
873
  }
862
874
 
863
875
  /**
@@ -868,7 +880,7 @@ export class Client extends EventEmitter2<ClientEventMap> {
868
880
  * @returns Returns the raw data of a deleted project.
869
881
  */
870
882
  deleteProject(projectId: string): Promise<any> {
871
- return this._httpClient
883
+ return this.httpClient
872
884
  .delete(`/projects/${projectId}`)
873
885
  .then((response) => response.text())
874
886
  .then((text) => {
package/src/Api/Fetch.ts CHANGED
@@ -21,7 +21,7 @@
21
21
  // acknowledge and accept the above terms.
22
22
  ///////////////////////////////////////////////////////////////////////////////
23
23
 
24
- import { FetchError, statusText, error400 } from "./FetchError";
24
+ import { FetchError, error400 } from "./FetchError";
25
25
 
26
26
  function handleFetchError(response: Response): Promise<Response> {
27
27
  if (!response.ok) {
@@ -39,7 +39,7 @@ function handleFetchError(response: Response): Promise<Response> {
39
39
  });
40
40
  }
41
41
  default:
42
- return Promise.reject(new FetchError(response.status, statusText(response.status)));
42
+ return Promise.reject(new FetchError(response.status));
43
43
  }
44
44
  }
45
45
  return Promise.resolve(response);
@@ -26,9 +26,9 @@ import { $fetch } from "./Fetch";
26
26
  import { $xmlhttp } from "./XMLHttp";
27
27
 
28
28
  export class HttpClient implements IHttpClient {
29
- serverUrl: string;
30
- headers: HeadersInit = {};
31
- signInUserId = "";
29
+ public serverUrl: string;
30
+ public headers: HeadersInit = {};
31
+ public signInUserId = "";
32
32
 
33
33
  constructor(serverUrl: string) {
34
34
  this.serverUrl = serverUrl;
package/src/Api/Job.ts CHANGED
@@ -30,7 +30,7 @@ import { waitFor } from "./Utils";
30
30
  */
31
31
  export class Job {
32
32
  private _data: any;
33
- protected httpClient: IHttpClient;
33
+ public httpClient: IHttpClient;
34
34
 
35
35
  /**
36
36
  * @param data - An object that implements job data storage.
package/src/Api/Member.ts CHANGED
@@ -30,8 +30,8 @@ import { userFullName, userInitials } from "./Utils";
30
30
  */
31
31
  export class Member {
32
32
  private _data: any;
33
- protected projectId: string;
34
- protected httpClient: IHttpClient;
33
+ public projectId: string;
34
+ public httpClient: IHttpClient;
35
35
 
36
36
  /**
37
37
  * @param data - An object that implements member data storage.
@@ -29,8 +29,8 @@ import { IHttpClient } from "./IHttpClient";
29
29
  */
30
30
  export class Permission {
31
31
  private _data: any;
32
- protected fileId: string;
33
- protected httpClient: IHttpClient;
32
+ public fileId: string;
33
+ public httpClient: IHttpClient;
34
34
 
35
35
  /**
36
36
  * @param data - An object that implements permission data storage.
@@ -32,7 +32,7 @@ import { userFullName, userInitials } from "./Utils";
32
32
  */
33
33
  export class Project {
34
34
  private _data: any;
35
- protected httpClient: IHttpClient;
35
+ public httpClient: IHttpClient;
36
36
 
37
37
  /**
38
38
  * @param data - An object that implements project data storage.
package/src/Api/Role.ts CHANGED
@@ -28,8 +28,8 @@ import { IHttpClient } from "./IHttpClient";
28
28
  */
29
29
  export class Role {
30
30
  private _data: any;
31
- protected projectId: string;
32
- protected httpClient: IHttpClient;
31
+ public projectId: string;
32
+ public httpClient: IHttpClient;
33
33
 
34
34
  /**
35
35
  * @param data - An object that implements role data storage.