attlaz-client 1.68.0 → 1.70.0
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/Model/Command/CommandExecutionFilter.d.ts +1 -1
- package/dist/Model/Storage/StorageInformation.d.ts +1 -1
- package/dist/Model/Storage/StorageInformation.js +1 -1
- package/dist/Service/CommandExecutionEndpoint.d.ts +4 -0
- package/dist/Service/CommandExecutionEndpoint.js +17 -1
- package/dist/Service/StorageEndpoint.d.ts +9 -5
- package/dist/Service/StorageEndpoint.js +20 -11
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -2,9 +2,13 @@ import { CommandExecutionFilter } from '../Model/Command/CommandExecutionFilter.
|
|
|
2
2
|
import { CommandExecutionHistory } from '../Model/Command/CommandExecutionHistory.js';
|
|
3
3
|
import { CursorPagination } from '../Model/Pagination/CursorPagination.js';
|
|
4
4
|
import { CollectionResult } from '../Model/Result/CollectionResult.js';
|
|
5
|
+
import { UserSummary } from '../Model/User/UserSummary.js';
|
|
5
6
|
import { Endpoint } from './Endpoint.js';
|
|
6
7
|
export declare class CommandExecutionEndpoint extends Endpoint {
|
|
7
8
|
getAll(pagination?: CursorPagination | null, filter?: CommandExecutionFilter | null): Promise<CollectionResult<CommandExecutionHistory>>;
|
|
8
9
|
getById(id: string): Promise<CommandExecutionHistory | null>;
|
|
10
|
+
/** Distinct users that requested commands, resolved to display-safe summaries (for the requester filter). */
|
|
11
|
+
getDistinctRequesters(): Promise<UserSummary[]>;
|
|
12
|
+
private static parseSummary;
|
|
9
13
|
private static parse;
|
|
10
14
|
}
|
|
@@ -2,6 +2,8 @@ import { QueryString } from '../Http/Data/QueryString.js';
|
|
|
2
2
|
import { CommandExecutionHistory } from '../Model/Command/CommandExecutionHistory.js';
|
|
3
3
|
import { CommandExecutionStatus } from '../Model/Command/CommandExecutionStatus.js';
|
|
4
4
|
import { DataValueCollection } from '../Model/DataValueCollection.js';
|
|
5
|
+
import { State } from '../Model/State.js';
|
|
6
|
+
import { UserSummary } from '../Model/User/UserSummary.js';
|
|
5
7
|
import { Utils } from '../Utils.js';
|
|
6
8
|
import { Endpoint } from './Endpoint.js';
|
|
7
9
|
export class CommandExecutionEndpoint extends Endpoint {
|
|
@@ -15,7 +17,7 @@ export class CommandExecutionEndpoint extends Endpoint {
|
|
|
15
17
|
if (filter.type !== undefined && filter.type.length > 0) {
|
|
16
18
|
queryString.set('type', filter.type);
|
|
17
19
|
}
|
|
18
|
-
if (filter.requestedBy !== undefined) {
|
|
20
|
+
if (filter.requestedBy !== undefined && filter.requestedBy.length > 0) {
|
|
19
21
|
queryString.set('requested_by', filter.requestedBy);
|
|
20
22
|
}
|
|
21
23
|
}
|
|
@@ -26,6 +28,20 @@ export class CommandExecutionEndpoint extends Endpoint {
|
|
|
26
28
|
const result = await this.requestObject(queryString, null, CommandExecutionEndpoint.parse, 'GET');
|
|
27
29
|
return result.getData();
|
|
28
30
|
}
|
|
31
|
+
/** Distinct users that requested commands, resolved to display-safe summaries (for the requester filter). */
|
|
32
|
+
async getDistinctRequesters() {
|
|
33
|
+
const queryString = new QueryString('/system/command-executions/users');
|
|
34
|
+
const result = await this.requestCollection(queryString, CommandExecutionEndpoint.parseSummary, null, 'GET');
|
|
35
|
+
return result.getData();
|
|
36
|
+
}
|
|
37
|
+
static parseSummary(raw) {
|
|
38
|
+
const summary = new UserSummary();
|
|
39
|
+
summary.id = raw.id;
|
|
40
|
+
summary.type = raw.type;
|
|
41
|
+
summary.state = (raw.state === null || raw.state === undefined) ? null : State.fromString(raw.state);
|
|
42
|
+
summary.displayName = raw.display_name;
|
|
43
|
+
return summary;
|
|
44
|
+
}
|
|
29
45
|
static parse(raw) {
|
|
30
46
|
const history = new CommandExecutionHistory();
|
|
31
47
|
history.id = raw.id;
|
|
@@ -7,10 +7,14 @@ import { CursorPagination } from '../Model/Pagination/CursorPagination.js';
|
|
|
7
7
|
import { Endpoint } from './Endpoint.js';
|
|
8
8
|
export declare class StorageEndpoint extends Endpoint {
|
|
9
9
|
getInformation(projectEnvironmentId: string, storageType: StorageType): Promise<StorageInformation | null>;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
clearBucket(projectEnvironmentId: string, storageType: StorageType, bucketKey: string): Promise<boolean>;
|
|
11
|
+
getBucketItemsInformation(projectEnvironmentId: string, storageType: StorageType, bucketKey: string, pagination?: CursorPagination | null): Promise<CollectionResult<StorageItemInformation>>;
|
|
12
|
+
/** @deprecated Renamed to getBucketItemsInformation. Kept for backwards compatibility. */
|
|
13
|
+
getPoolItemsInformation(projectEnvironmentId: string, storageType: StorageType, bucketKey: string, pagination?: CursorPagination | null): Promise<CollectionResult<StorageItemInformation>>;
|
|
14
|
+
/** @deprecated Renamed to clearBucket. Kept for backwards compatibility. */
|
|
15
|
+
clearPool(projectEnvironmentId: string, storageType: StorageType, bucketKey: string): Promise<boolean>;
|
|
16
|
+
getItem(projectEnvironmentId: string, storageType: StorageType, bucketKey: string, storageItemKey: string): Promise<StorageItem | null>;
|
|
13
17
|
getBucketItem(storageBucketId: string, storageItemKey: string): Promise<StorageItem | null>;
|
|
14
|
-
setItem(projectEnvironmentId: string, storageType: StorageType,
|
|
15
|
-
deleteItem(projectEnvironmentId: string, storageType: StorageType,
|
|
18
|
+
setItem(projectEnvironmentId: string, storageType: StorageType, bucketKey: string, storageItem: StorageItem): Promise<StorageItem>;
|
|
19
|
+
deleteItem(projectEnvironmentId: string, storageType: StorageType, bucketKey: string, storageItemKey: string): Promise<boolean>;
|
|
16
20
|
}
|
|
@@ -12,7 +12,8 @@ export class StorageEndpoint extends Endpoint {
|
|
|
12
12
|
storageInformation.bytes = raw.bytes;
|
|
13
13
|
storageInformation.bytes_limit = raw.bytes_limit;
|
|
14
14
|
storageInformation.items = raw.items;
|
|
15
|
-
|
|
15
|
+
// Prefer the new `buckets` field; fall back to the legacy `pools` for older API responses.
|
|
16
|
+
storageInformation.buckets = (raw.buckets ?? raw.pools);
|
|
16
17
|
return storageInformation;
|
|
17
18
|
};
|
|
18
19
|
const result = await this.requestObject(cmd, null, parser, 'GET');
|
|
@@ -25,8 +26,8 @@ export class StorageEndpoint extends Endpoint {
|
|
|
25
26
|
throw ex;
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
|
-
async
|
|
29
|
-
const cmd = '/projectenvironments/' + projectEnvironmentId + '/storage/' + storageType + '/' +
|
|
29
|
+
async clearBucket(projectEnvironmentId, storageType, bucketKey) {
|
|
30
|
+
const cmd = '/projectenvironments/' + projectEnvironmentId + '/storage/' + storageType + '/' + bucketKey;
|
|
30
31
|
try {
|
|
31
32
|
const parser = (raw) => raw.deleted;
|
|
32
33
|
const result = await this.requestObject(cmd, null, parser, 'DELETE');
|
|
@@ -43,8 +44,8 @@ export class StorageEndpoint extends Endpoint {
|
|
|
43
44
|
throw ex;
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
|
-
async
|
|
47
|
-
const qs = new QueryString('/projectenvironments/' + projectEnvironmentId + '/storage/' + storageType + '/' +
|
|
47
|
+
async getBucketItemsInformation(projectEnvironmentId, storageType, bucketKey, pagination = null) {
|
|
48
|
+
const qs = new QueryString('/projectenvironments/' + projectEnvironmentId + '/storage/' + storageType + '/' + bucketKey + '/items');
|
|
48
49
|
qs.addPagination(pagination);
|
|
49
50
|
try {
|
|
50
51
|
const result = await this.requestCollection(qs, StorageItemInformation.parse, null, 'GET');
|
|
@@ -57,8 +58,16 @@ export class StorageEndpoint extends Endpoint {
|
|
|
57
58
|
throw ex;
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
/** @deprecated Renamed to getBucketItemsInformation. Kept for backwards compatibility. */
|
|
62
|
+
async getPoolItemsInformation(projectEnvironmentId, storageType, bucketKey, pagination = null) {
|
|
63
|
+
return this.getBucketItemsInformation(projectEnvironmentId, storageType, bucketKey, pagination);
|
|
64
|
+
}
|
|
65
|
+
/** @deprecated Renamed to clearBucket. Kept for backwards compatibility. */
|
|
66
|
+
async clearPool(projectEnvironmentId, storageType, bucketKey) {
|
|
67
|
+
return this.clearBucket(projectEnvironmentId, storageType, bucketKey);
|
|
68
|
+
}
|
|
69
|
+
async getItem(projectEnvironmentId, storageType, bucketKey, storageItemKey) {
|
|
70
|
+
const cmd = '/projectenvironments/' + projectEnvironmentId + '/storage/' + storageType + '/' + bucketKey + '/items/' + storageItemKey;
|
|
62
71
|
try {
|
|
63
72
|
const result = await this.requestObject(cmd, null, StorageItem.parse, 'GET');
|
|
64
73
|
return result.getData();
|
|
@@ -83,8 +92,8 @@ export class StorageEndpoint extends Endpoint {
|
|
|
83
92
|
throw ex;
|
|
84
93
|
}
|
|
85
94
|
}
|
|
86
|
-
async setItem(projectEnvironmentId, storageType,
|
|
87
|
-
const cmd = '/projectenvironments/' + projectEnvironmentId + '/storage/' + storageType + '/' +
|
|
95
|
+
async setItem(projectEnvironmentId, storageType, bucketKey, storageItem) {
|
|
96
|
+
const cmd = '/projectenvironments/' + projectEnvironmentId + '/storage/' + storageType + '/' + bucketKey + '/items/' + storageItem.key;
|
|
88
97
|
try {
|
|
89
98
|
const result = await this.requestObject(cmd, storageItem, StorageItem.parse, 'POST');
|
|
90
99
|
const savedItem = result.getData();
|
|
@@ -100,8 +109,8 @@ export class StorageEndpoint extends Endpoint {
|
|
|
100
109
|
throw ex;
|
|
101
110
|
}
|
|
102
111
|
}
|
|
103
|
-
async deleteItem(projectEnvironmentId, storageType,
|
|
104
|
-
const cmd = '/projectenvironments/' + projectEnvironmentId + '/storage/' + storageType + '/' +
|
|
112
|
+
async deleteItem(projectEnvironmentId, storageType, bucketKey, storageItemKey) {
|
|
113
|
+
const cmd = '/projectenvironments/' + projectEnvironmentId + '/storage/' + storageType + '/' + bucketKey + '/items/' + storageItemKey;
|
|
105
114
|
try {
|
|
106
115
|
const parser = (raw) => ({ deleted: raw.deleted });
|
|
107
116
|
const result = await this.requestObject(cmd, null, parser, 'DELETE');
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.70.0";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "1.
|
|
1
|
+
export const VERSION = "1.70.0";
|