attlaz-client 1.10.12 → 1.10.14
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.
|
@@ -2,11 +2,13 @@ import { State } from '../State.js';
|
|
|
2
2
|
export class Workspace {
|
|
3
3
|
id;
|
|
4
4
|
name;
|
|
5
|
+
key;
|
|
5
6
|
state;
|
|
6
7
|
static parse(raw) {
|
|
7
8
|
const workspace = new Workspace();
|
|
8
9
|
workspace.id = raw.id;
|
|
9
10
|
workspace.name = raw.name;
|
|
11
|
+
workspace.key = raw.key;
|
|
10
12
|
workspace.state = State.fromString(raw.state);
|
|
11
13
|
return workspace;
|
|
12
14
|
}
|
|
@@ -3,4 +3,5 @@ import { Workspace } from '../Model/Workspace/Workspace.js';
|
|
|
3
3
|
import { CollectionResult } from '../Model/Result/CollectionResult.js';
|
|
4
4
|
export declare class WorkspaceEndpoint extends Endpoint {
|
|
5
5
|
getAll(): Promise<CollectionResult<Workspace>>;
|
|
6
|
+
save(workspace: Workspace): Promise<Workspace>;
|
|
6
7
|
}
|
|
@@ -13,4 +13,21 @@ export class WorkspaceEndpoint extends Endpoint {
|
|
|
13
13
|
throw e;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
+
async save(workspace) {
|
|
17
|
+
try {
|
|
18
|
+
const url = '/workspace';
|
|
19
|
+
const result = await this.requestObject(url, workspace, Workspace.parse, 'POST');
|
|
20
|
+
const updatedWorkspace = result.getData();
|
|
21
|
+
if (updatedWorkspace === null) {
|
|
22
|
+
throw new Error('Workspace not updated');
|
|
23
|
+
}
|
|
24
|
+
return updatedWorkspace;
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
if (this.httpClient.isDebugEnabled()) {
|
|
28
|
+
console.error('Failed to save workspace: ', error);
|
|
29
|
+
}
|
|
30
|
+
throw error;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
16
33
|
}
|