hcloud-sdk 22.32.0 → 22.33.1
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/changelog.md +3 -3
- package/lib/interfaces/global/Storage.d.ts +11 -10
- package/lib/interfaces/nats/index.d.ts +4 -0
- package/lib/interfaces/nats/index.js +5 -0
- package/lib/service/dali/avatar/DaliStorage.d.ts +2 -2
- package/lib/service/idp/organization/storage/index.d.ts +34 -14
- package/lib/service/idp/organization/storage/index.js +43 -17
- package/package.json +1 -1
package/changelog.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
## [22.
|
|
1
|
+
## [22.33.1](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/compare/v22.33.0...v22.33.1) (2026-09-16)
|
|
2
2
|
|
|
3
|
-
###
|
|
3
|
+
### Bug Fixes
|
|
4
4
|
|
|
5
|
-
*
|
|
5
|
+
* storage types ([88b274c](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/88b274c9fe02d51752bef20f5302dcaf1b60e895))
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReducedOrganization, ReducedUser } from "../idp";
|
|
2
|
+
import { ReducedSpace } from "./Space";
|
|
2
3
|
export type Storage = {
|
|
3
4
|
_id: string;
|
|
4
5
|
name: string;
|
|
@@ -7,16 +8,15 @@ export type Storage = {
|
|
|
7
8
|
createDate: number;
|
|
8
9
|
modifyDate: number;
|
|
9
10
|
isDefault: boolean;
|
|
10
|
-
organization
|
|
11
|
+
organization?: ReducedOrganization;
|
|
11
12
|
endpoint: string;
|
|
12
13
|
bucket: string;
|
|
13
14
|
region: string;
|
|
14
15
|
accessKeyId: string;
|
|
15
16
|
secretAccessKey: string;
|
|
17
|
+
spaces: ReducedSpace[];
|
|
16
18
|
valid: boolean;
|
|
17
19
|
errorMessage?: string;
|
|
18
|
-
signedUrl?: string;
|
|
19
|
-
testBucketName?: string;
|
|
20
20
|
};
|
|
21
21
|
export type StorageConfiguration = {
|
|
22
22
|
_id: string;
|
|
@@ -29,12 +29,13 @@ export type StorageConfiguration = {
|
|
|
29
29
|
isDefault: boolean;
|
|
30
30
|
valid: boolean;
|
|
31
31
|
};
|
|
32
|
-
export type
|
|
33
|
-
export type
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
export type StorageDto = Storage & {
|
|
37
|
-
signedUrl?: string;
|
|
38
|
-
testBucketName?: string;
|
|
32
|
+
export type StorageDto = Omit<Storage, "accessKeyId" | "secretAccessKey">;
|
|
33
|
+
export type StorageCreateDto = Pick<Storage, "name" | "endpoint" | "bucket" | "region"> & {
|
|
34
|
+
accessKeyId: string;
|
|
35
|
+
secretAccessKey: string;
|
|
39
36
|
};
|
|
37
|
+
export type StoragePatchDto = Partial<Pick<Storage, "name" | "endpoint" | "bucket" | "region"> & {
|
|
38
|
+
accessKeyId: string;
|
|
39
|
+
secretAccessKey: string;
|
|
40
|
+
}>;
|
|
40
41
|
export type ReducedStorage = Pick<Storage, "_id" | "name" | "isDefault">;
|
|
@@ -24,6 +24,7 @@ declare enum NatsSubject {
|
|
|
24
24
|
IDP_ORGANIZATION_LICENSE = "hcloud.idp.organization.${base64orgName}.license",
|
|
25
25
|
IDP_ORGANIZATION_SETTINGS_OAUTHAPP = "hcloud.idp.organization.${base64orgName}.settings.oauthapp.${oAuthAppId}",
|
|
26
26
|
IDP_ORGANIZATION_SERVICE_ACCOUNTS = "hcloud.idp.organization.${base64orgName}.serviceAccounts",
|
|
27
|
+
IDP_ORGANIZATION_STORAGE = "hcloud.idp.organization.${base64orgName}.storage",
|
|
27
28
|
HIGH5_SPACES = "hcloud.high5.organization.${base64orgName}.spaces",
|
|
28
29
|
HIGH5_SPACE_PERMISSIONS = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.permissions",
|
|
29
30
|
HIGH5_STREAM_EXECUTE = "hcloud.high5.organization.${organizationId}.stream.execute.${base64email}",
|
|
@@ -90,6 +91,7 @@ declare enum NatsObjectType {
|
|
|
90
91
|
TEAM = "TEAM",
|
|
91
92
|
NOTIFICATIONS = "NOTIFICATIONS",
|
|
92
93
|
GENERAL_SETTINGS = "GENERAL_SETTINGS",
|
|
94
|
+
STORAGE = "STORAGE",
|
|
93
95
|
SPACE = "SPACE",
|
|
94
96
|
SPACE_PERMISSION = "SPACE_PERMISSION",
|
|
95
97
|
DESIGN = "DESIGN",
|
|
@@ -146,6 +148,7 @@ interface NatsObject extends NatsNameObject, NatsIdObject, NatsMemberObject, Nat
|
|
|
146
148
|
[NatsSubject.IDP_ORGANIZATION_TEAMS]: NatsNameObject;
|
|
147
149
|
[NatsSubject.IDP_ORGANIZATION_TEAM_MEMBERS]: NatsIdObject;
|
|
148
150
|
[NatsSubject.IDP_ORGANIZATION_LICENSE]: NatsLicenseObject;
|
|
151
|
+
[NatsSubject.IDP_ORGANIZATION_STORAGE]: NatsIdObject;
|
|
149
152
|
[NatsSubject.HIGH5_SPACES]: NatsNameObject;
|
|
150
153
|
[NatsSubject.HIGH5_SPACE_PERMISSIONS]: NatsIdObject;
|
|
151
154
|
[NatsSubject.HIGH5_STREAM_EXECUTE]: High5ExecuteOnAgentRequest | High5ExecutionCancelRequest;
|
|
@@ -276,6 +279,7 @@ declare class NatsSubjects {
|
|
|
276
279
|
ORGANIZATION: (organizationName: string) => string;
|
|
277
280
|
Organization: {
|
|
278
281
|
new (): {};
|
|
282
|
+
STORAGE: (organizationName: string) => string;
|
|
279
283
|
INVITATIONS: (organizationName: string) => string;
|
|
280
284
|
MEMBERS: (organizationName: string) => string & {
|
|
281
285
|
EXECUTION_TARGET: (email: string) => string;
|
|
@@ -27,6 +27,7 @@ var NatsSubject;
|
|
|
27
27
|
NatsSubject["IDP_ORGANIZATION_LICENSE"] = "hcloud.idp.organization.${base64orgName}.license";
|
|
28
28
|
NatsSubject["IDP_ORGANIZATION_SETTINGS_OAUTHAPP"] = "hcloud.idp.organization.${base64orgName}.settings.oauthapp.${oAuthAppId}";
|
|
29
29
|
NatsSubject["IDP_ORGANIZATION_SERVICE_ACCOUNTS"] = "hcloud.idp.organization.${base64orgName}.serviceAccounts";
|
|
30
|
+
NatsSubject["IDP_ORGANIZATION_STORAGE"] = "hcloud.idp.organization.${base64orgName}.storage";
|
|
30
31
|
NatsSubject["HIGH5_SPACES"] = "hcloud.high5.organization.${base64orgName}.spaces";
|
|
31
32
|
NatsSubject["HIGH5_SPACE_PERMISSIONS"] = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.permissions";
|
|
32
33
|
NatsSubject["HIGH5_STREAM_EXECUTE"] = "hcloud.high5.organization.${organizationId}.stream.execute.${base64email}";
|
|
@@ -95,6 +96,7 @@ var NatsObjectType;
|
|
|
95
96
|
NatsObjectType["TEAM"] = "TEAM";
|
|
96
97
|
NatsObjectType["NOTIFICATIONS"] = "NOTIFICATIONS";
|
|
97
98
|
NatsObjectType["GENERAL_SETTINGS"] = "GENERAL_SETTINGS";
|
|
99
|
+
NatsObjectType["STORAGE"] = "STORAGE";
|
|
98
100
|
NatsObjectType["SPACE"] = "SPACE";
|
|
99
101
|
NatsObjectType["SPACE_PERMISSION"] = "SPACE_PERMISSION";
|
|
100
102
|
NatsObjectType["DESIGN"] = "DESIGN";
|
|
@@ -191,6 +193,9 @@ NatsSubjects.IDP = (_a = class {
|
|
|
191
193
|
_a.Organization = (_d = class {
|
|
192
194
|
},
|
|
193
195
|
__setFunctionName(_d, "Organization"),
|
|
196
|
+
_d.STORAGE = (organizationName) => {
|
|
197
|
+
return NatsSubjects.replace(NatsSubject.IDP_ORGANIZATION_STORAGE, { organizationName });
|
|
198
|
+
},
|
|
194
199
|
_d.INVITATIONS = (organizationName) => {
|
|
195
200
|
return NatsSubjects.replace(NatsSubject.IDP_ORGANIZATION_INVITATIONS, { organizationName });
|
|
196
201
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Base, { MaybeRaw } from "../../../Base";
|
|
2
2
|
import { AvatarCreated } from "../../../interfaces/dali";
|
|
3
|
-
import {
|
|
3
|
+
import { Storage } from "../../../interfaces/global/Storage";
|
|
4
4
|
export declare class DaliStorage extends Base {
|
|
5
5
|
/**
|
|
6
6
|
* Creates a default avatar for the specified storage.
|
|
@@ -28,6 +28,6 @@ export declare class DaliStorage extends Base {
|
|
|
28
28
|
*/
|
|
29
29
|
updateAvatar<R extends boolean = false>(orgName: string, storageName: string, file: File, raw?: {
|
|
30
30
|
raw: R;
|
|
31
|
-
}): Promise<MaybeRaw<R,
|
|
31
|
+
}): Promise<MaybeRaw<R, Storage>>;
|
|
32
32
|
protected getEndpoint(endpoint: string): string;
|
|
33
33
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Base, { MaybeRaw } from "../../../../Base";
|
|
2
2
|
import { PaginatedResponse, SearchFilter, Sorting } from "../../../../interfaces/global";
|
|
3
|
-
import { StorageConfiguration, StorageCreateDto,
|
|
3
|
+
import { StorageDto as Storage, StorageConfiguration, StorageCreateDto, StoragePatchDto } from "../../../../interfaces/global/Storage";
|
|
4
4
|
export declare class IdpOrganizationStorages extends Base {
|
|
5
5
|
/**
|
|
6
6
|
* Creates a new Storage in the specified Organization.
|
|
@@ -10,7 +10,7 @@ export declare class IdpOrganizationStorages extends Base {
|
|
|
10
10
|
*/
|
|
11
11
|
createStorage<R extends boolean = false>(orgName: string, storageCreate: StorageCreateDto, raw?: {
|
|
12
12
|
raw: R;
|
|
13
|
-
}): Promise<MaybeRaw<R,
|
|
13
|
+
}): Promise<MaybeRaw<R, Storage>>;
|
|
14
14
|
/**
|
|
15
15
|
* Updates an existing Storage.
|
|
16
16
|
* @param orgName Name of the Organization
|
|
@@ -21,7 +21,37 @@ export declare class IdpOrganizationStorages extends Base {
|
|
|
21
21
|
*/
|
|
22
22
|
patchStorage<R extends boolean = false>(orgName: string, storageId: string, storagePatchDto: StoragePatchDto, raw?: {
|
|
23
23
|
raw: R;
|
|
24
|
-
}): Promise<MaybeRaw<R,
|
|
24
|
+
}): Promise<MaybeRaw<R, Storage>>;
|
|
25
|
+
/**
|
|
26
|
+
* Updates the avatar of the specified storage
|
|
27
|
+
* @param orgName Name of the organization
|
|
28
|
+
* @param storageId ID of the storage
|
|
29
|
+
* @param file Image as Javascript File
|
|
30
|
+
* @returns Storage with updated avatarUrl
|
|
31
|
+
*/
|
|
32
|
+
updateAvatar<R extends boolean = false>(orgName: string, storageId: string, file: File, raw?: {
|
|
33
|
+
raw: R;
|
|
34
|
+
}): Promise<MaybeRaw<R, Storage>>;
|
|
35
|
+
/**
|
|
36
|
+
* Deletes the specified Storage.
|
|
37
|
+
* @param orgName Name of the organization
|
|
38
|
+
* @param storageId ID of the storage
|
|
39
|
+
* @param raw (optional) If true, returns the raw Axios response instead of undefined
|
|
40
|
+
* @returns void
|
|
41
|
+
*/
|
|
42
|
+
deleteStorage<R extends boolean = false>(orgName: string, storageId: string, raw?: {
|
|
43
|
+
raw: R;
|
|
44
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
45
|
+
/**
|
|
46
|
+
* Tests the specified Storage.
|
|
47
|
+
* @param orgName Name of the organization
|
|
48
|
+
* @param storageId ID of the storage
|
|
49
|
+
* @param raw (optional) If true, returns the raw Axios response instead of undefined
|
|
50
|
+
* @returns void
|
|
51
|
+
*/
|
|
52
|
+
testStorage<R extends boolean = false>(orgName: string, storageId: string, raw?: {
|
|
53
|
+
raw: R;
|
|
54
|
+
}): Promise<MaybeRaw<R, Storage>>;
|
|
25
55
|
/**
|
|
26
56
|
* Retrieves all Storages of an Organization that match the provided search filter(s). Returns all Storages if no search filter is provided.
|
|
27
57
|
* @param orgName Name of the organization
|
|
@@ -39,7 +69,7 @@ export declare class IdpOrganizationStorages extends Base {
|
|
|
39
69
|
page?: number;
|
|
40
70
|
}, raw?: {
|
|
41
71
|
raw: R;
|
|
42
|
-
}): Promise<MaybeRaw<R, PaginatedResponse<
|
|
72
|
+
}): Promise<MaybeRaw<R, PaginatedResponse<Storage>>>;
|
|
43
73
|
/**
|
|
44
74
|
* Retrieves the Storage configuration for the specified Storage ID or the default Storage if no ID is provided. Requires a Personal Access Token (PAT) with appropriate permissions.
|
|
45
75
|
*
|
|
@@ -52,15 +82,5 @@ export declare class IdpOrganizationStorages extends Base {
|
|
|
52
82
|
getStorageConfig<R extends boolean = false>(pat: string, storageId?: string, decrypt?: boolean, raw?: {
|
|
53
83
|
raw: R;
|
|
54
84
|
}): Promise<MaybeRaw<R, StorageConfiguration>>;
|
|
55
|
-
/**
|
|
56
|
-
* Updates the avatar of the specified storage
|
|
57
|
-
* @param orgName Name of the organization
|
|
58
|
-
* @param storageId ID of the storage
|
|
59
|
-
* @param file Image as Javascript File
|
|
60
|
-
* @returns Storage with updated avatarUrl
|
|
61
|
-
*/
|
|
62
|
-
updateAvatar<R extends boolean = false>(orgName: string, storageId: string, file: File, raw?: {
|
|
63
|
-
raw: R;
|
|
64
|
-
}): Promise<MaybeRaw<R, StorageDto>>;
|
|
65
85
|
protected getEndpoint(endpoint: string): string;
|
|
66
86
|
}
|
|
@@ -43,6 +43,49 @@ class IdpOrganizationStorages extends Base_1.default {
|
|
|
43
43
|
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Updates the avatar of the specified storage
|
|
48
|
+
* @param orgName Name of the organization
|
|
49
|
+
* @param storageId ID of the storage
|
|
50
|
+
* @param file Image as Javascript File
|
|
51
|
+
* @returns Storage with updated avatarUrl
|
|
52
|
+
*/
|
|
53
|
+
updateAvatar(orgName, storageId, file, raw) {
|
|
54
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
const data = new FormData();
|
|
56
|
+
data.append("avatar", file);
|
|
57
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/${orgName}/storage/${storageId}/avatar`), data, {
|
|
58
|
+
headers: { "Content-Type": "multipart/form-data" },
|
|
59
|
+
});
|
|
60
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Deletes the specified Storage.
|
|
65
|
+
* @param orgName Name of the organization
|
|
66
|
+
* @param storageId ID of the storage
|
|
67
|
+
* @param raw (optional) If true, returns the raw Axios response instead of undefined
|
|
68
|
+
* @returns void
|
|
69
|
+
*/
|
|
70
|
+
deleteStorage(orgName, storageId, raw) {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/${orgName}/storage/${storageId}`));
|
|
73
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Tests the specified Storage.
|
|
78
|
+
* @param orgName Name of the organization
|
|
79
|
+
* @param storageId ID of the storage
|
|
80
|
+
* @param raw (optional) If true, returns the raw Axios response instead of undefined
|
|
81
|
+
* @returns void
|
|
82
|
+
*/
|
|
83
|
+
testStorage(orgName, storageId, raw) {
|
|
84
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
85
|
+
const resp = yield this.axios.get(this.getEndpoint(`/${orgName}/storage/${storageId}/test`));
|
|
86
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
87
|
+
});
|
|
88
|
+
}
|
|
46
89
|
/**
|
|
47
90
|
* Retrieves all Storages of an Organization that match the provided search filter(s). Returns all Storages if no search filter is provided.
|
|
48
91
|
* @param orgName Name of the organization
|
|
@@ -86,23 +129,6 @@ class IdpOrganizationStorages extends Base_1.default {
|
|
|
86
129
|
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
87
130
|
});
|
|
88
131
|
}
|
|
89
|
-
/**
|
|
90
|
-
* Updates the avatar of the specified storage
|
|
91
|
-
* @param orgName Name of the organization
|
|
92
|
-
* @param storageId ID of the storage
|
|
93
|
-
* @param file Image as Javascript File
|
|
94
|
-
* @returns Storage with updated avatarUrl
|
|
95
|
-
*/
|
|
96
|
-
updateAvatar(orgName, storageId, file, raw) {
|
|
97
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
-
const data = new FormData();
|
|
99
|
-
data.append("avatar", file);
|
|
100
|
-
const resp = yield this.axios.patch(this.getEndpoint(`/${orgName}/storage/${storageId}/avatar`), data, {
|
|
101
|
-
headers: { "Content-Type": "multipart/form-data" },
|
|
102
|
-
});
|
|
103
|
-
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
132
|
getEndpoint(endpoint) {
|
|
107
133
|
return `${this.options.server}/api/account/v1/org${endpoint}`;
|
|
108
134
|
}
|