hcloud-sdk 22.28.0 → 22.30.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/changelog.md +2 -2
- package/lib/interfaces/cosmo/addressBook/index.d.ts +19 -5
- package/lib/interfaces/nats/index.d.ts +5 -8
- package/lib/interfaces/nats/index.js +0 -4
- package/lib/service/cosmo/addressBook/index.d.ts +31 -4
- package/lib/service/cosmo/addressBook/index.js +41 -4
- package/package.json +1 -1
package/changelog.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
## [22.
|
|
1
|
+
## [22.30.0](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/compare/v22.29.0...v22.30.0) (2026-09-11)
|
|
2
2
|
|
|
3
3
|
### Features
|
|
4
4
|
|
|
5
|
-
*
|
|
5
|
+
* implements teams in addressbook ([6a185f8](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/6a185f89d80bd4dbaa1c9027f9bb2c49008936fb))
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { ReducedUser } from "../../idp/user";
|
|
2
|
+
/** Members as key-value pairs: mandatory e-mail address -> optional display name */
|
|
3
|
+
export type AddressBookMembers = Record<string, string | undefined>;
|
|
2
4
|
export type AddressBook = {
|
|
3
5
|
_id: string;
|
|
4
6
|
name: string;
|
|
5
7
|
description?: string;
|
|
6
|
-
members:
|
|
8
|
+
members: AddressBookMembers;
|
|
9
|
+
/** IDs of internal teams referenced by the address book */
|
|
10
|
+
teamIds: string[];
|
|
7
11
|
createDate: number;
|
|
8
12
|
modifyDate: number;
|
|
9
13
|
creator: ReducedUser;
|
|
@@ -13,8 +17,10 @@ export type AddressBookCreate = {
|
|
|
13
17
|
name: string;
|
|
14
18
|
/** Optional description (max 512 chars) */
|
|
15
19
|
description?: string;
|
|
16
|
-
/** Initial
|
|
17
|
-
members?:
|
|
20
|
+
/** Initial members (e-mail -> optional display name) */
|
|
21
|
+
members?: AddressBookMembers;
|
|
22
|
+
/** Initial list of internal team IDs to reference */
|
|
23
|
+
teamIds?: string[];
|
|
18
24
|
};
|
|
19
25
|
export type AddressBookUpdate = {
|
|
20
26
|
/** New name of the address book (1–128 chars) */
|
|
@@ -22,7 +28,15 @@ export type AddressBookUpdate = {
|
|
|
22
28
|
/** Updated description (max 512 chars) */
|
|
23
29
|
description?: string;
|
|
24
30
|
};
|
|
25
|
-
export type
|
|
26
|
-
/**
|
|
31
|
+
export type AddressBookMemberAddRequest = {
|
|
32
|
+
/** Members to add (e-mail -> optional display name, min 1) */
|
|
33
|
+
members: AddressBookMembers;
|
|
34
|
+
};
|
|
35
|
+
export type AddressBookMemberRemoveRequest = {
|
|
36
|
+
/** List of email addresses to remove (min 1) */
|
|
27
37
|
emails: string[];
|
|
28
38
|
};
|
|
39
|
+
export type AddressBookTeamRequest = {
|
|
40
|
+
/** List of internal team IDs to add or remove (min 1) */
|
|
41
|
+
teamIds: string[];
|
|
42
|
+
};
|
|
@@ -5,7 +5,6 @@ import { High5ExecuteOnAgentRequest, High5ExecutionCancelRequest } from "../high
|
|
|
5
5
|
import { CapturedRequest } from "../high5/space/request";
|
|
6
6
|
import { LicenseTier } from "../idp";
|
|
7
7
|
declare enum NatsSubject {
|
|
8
|
-
IDP_USER = "hcloud.idp.user.${userId}",
|
|
9
8
|
IDP_USER_GENERAL = "hcloud.idp.user.${userId}.general",
|
|
10
9
|
IDP_USER_PROFILE = "hcloud.idp.user.${userId}.profile",
|
|
11
10
|
IDP_USER_NOTIFICATIONS = "hcloud.idp.user.${userId}.notifications",
|
|
@@ -133,9 +132,8 @@ interface NatsMessage {
|
|
|
133
132
|
object: NatsObject;
|
|
134
133
|
objectType: NatsObjectType;
|
|
135
134
|
}
|
|
136
|
-
interface NatsObject extends NatsNameObject, NatsIdObject,
|
|
137
|
-
[NatsSubject.IDP_USER_GENERAL]:
|
|
138
|
-
[NatsSubject.IDP_USER]: NatsUserInformObject;
|
|
135
|
+
interface NatsObject extends NatsNameObject, NatsIdObject, NatsMemberObject, NatsSecretObject, NatsExecTargetObject, High5ExecuteOnAgentRequest, High5ExecutionCancelRequest, CapturedRequest, NatsLicenseObject, NatsCustomNodeObject, NatsAssetObject, NatsIdNoUnderscoreObject, NatsTargetObject, NatsAgentConnectionObject, NatsCosmoStatusObject, NatsMessageObject {
|
|
136
|
+
[NatsSubject.IDP_USER_GENERAL]: NatsMessageObject;
|
|
139
137
|
[NatsSubject.IDP_USER_PROFILE]: NatsIdObject;
|
|
140
138
|
[NatsSubject.IDP_USER_SECURITY_PATS]: NatsIdObject;
|
|
141
139
|
[NatsSubject.IDP_USER_SECURITY_GENERAL]: unknown;
|
|
@@ -192,12 +190,12 @@ interface NatsNameObject {
|
|
|
192
190
|
interface NatsIdObject {
|
|
193
191
|
_id: string;
|
|
194
192
|
}
|
|
193
|
+
interface NatsMessageObject extends NatsIdObject {
|
|
194
|
+
msg?: string;
|
|
195
|
+
}
|
|
195
196
|
interface NatsIdNoUnderscoreObject {
|
|
196
197
|
id: string;
|
|
197
198
|
}
|
|
198
|
-
interface NatsUserInformObject extends NatsIdObject {
|
|
199
|
-
msg: string;
|
|
200
|
-
}
|
|
201
199
|
interface NatsAssetObject {
|
|
202
200
|
_id: string;
|
|
203
201
|
parent?: {
|
|
@@ -255,7 +253,6 @@ type NatsCallback = (err: Error | null, msg?: NatsMessage, rawMsg?: Msg) => void
|
|
|
255
253
|
declare class NatsSubjects {
|
|
256
254
|
static IDP: {
|
|
257
255
|
new (): {};
|
|
258
|
-
USER: (userId: string, msg: string) => string;
|
|
259
256
|
User: {
|
|
260
257
|
new (): {};
|
|
261
258
|
GENERAL: (userId: string) => string;
|
|
@@ -8,7 +8,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
exports.NatsSubjects = exports.NatsSubject = exports.NatsObjectType = exports.NatsMessageType = void 0;
|
|
9
9
|
var NatsSubject;
|
|
10
10
|
(function (NatsSubject) {
|
|
11
|
-
NatsSubject["IDP_USER"] = "hcloud.idp.user.${userId}";
|
|
12
11
|
NatsSubject["IDP_USER_GENERAL"] = "hcloud.idp.user.${userId}.general";
|
|
13
12
|
NatsSubject["IDP_USER_PROFILE"] = "hcloud.idp.user.${userId}.profile";
|
|
14
13
|
NatsSubject["IDP_USER_NOTIFICATIONS"] = "hcloud.idp.user.${userId}.notifications";
|
|
@@ -142,9 +141,6 @@ exports.NatsSubjects = NatsSubjects;
|
|
|
142
141
|
NatsSubjects.IDP = (_a = class {
|
|
143
142
|
},
|
|
144
143
|
__setFunctionName(_a, "IDP"),
|
|
145
|
-
_a.USER = (userId, msg) => {
|
|
146
|
-
return NatsSubjects.replace(NatsSubject.IDP_USER, { userId, msg });
|
|
147
|
-
},
|
|
148
144
|
_a.User = (_b = class {
|
|
149
145
|
},
|
|
150
146
|
__setFunctionName(_b, "User"),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Base, { MaybeRaw } from "../../../Base";
|
|
2
|
-
import { AddressBook, AddressBookCreate, AddressBookUpdate } from "../../../interfaces/cosmo/addressBook";
|
|
2
|
+
import { AddressBook, AddressBookCreate, AddressBookMembers, AddressBookUpdate } from "../../../interfaces/cosmo/addressBook";
|
|
3
3
|
import { SearchFilter, Sorting } from "../../../interfaces/global/SearchFilters";
|
|
4
4
|
/**
|
|
5
5
|
* @class CosmoAddressBook
|
|
@@ -84,16 +84,16 @@ export declare class CosmoAddressBook extends Base {
|
|
|
84
84
|
raw: R;
|
|
85
85
|
}): Promise<MaybeRaw<R, void>>;
|
|
86
86
|
/**
|
|
87
|
-
* Add one or more members
|
|
87
|
+
* Add one or more members to an Address Book.
|
|
88
88
|
* @remarks
|
|
89
89
|
* **Under development, breaking changes possible**
|
|
90
90
|
* @param orgName Name of the Organization
|
|
91
91
|
* @param spaceName Name of the Space
|
|
92
92
|
* @param bookId ID of the Address Book
|
|
93
|
-
* @param
|
|
93
|
+
* @param members Members to add (e-mail -> optional display name)
|
|
94
94
|
* @returns The updated AddressBook
|
|
95
95
|
*/
|
|
96
|
-
addAddressBookMembers<R extends boolean = false>(orgName: string, spaceName: string, bookId: string,
|
|
96
|
+
addAddressBookMembers<R extends boolean = false>(orgName: string, spaceName: string, bookId: string, members: AddressBookMembers, raw?: {
|
|
97
97
|
raw: R;
|
|
98
98
|
}): Promise<MaybeRaw<R, AddressBook>>;
|
|
99
99
|
/**
|
|
@@ -109,4 +109,31 @@ export declare class CosmoAddressBook extends Base {
|
|
|
109
109
|
removeAddressBookMembers<R extends boolean = false>(orgName: string, spaceName: string, bookId: string, emails: string[], raw?: {
|
|
110
110
|
raw: R;
|
|
111
111
|
}): Promise<MaybeRaw<R, AddressBook>>;
|
|
112
|
+
/**
|
|
113
|
+
* Add one or more internal team references to an Address Book. Team membership stays live: changes to a
|
|
114
|
+
* referenced team are reflected in the address book's recipients.
|
|
115
|
+
* @remarks
|
|
116
|
+
* **Under development, breaking changes possible**
|
|
117
|
+
* @param orgName Name of the Organization
|
|
118
|
+
* @param spaceName Name of the Space
|
|
119
|
+
* @param bookId ID of the Address Book
|
|
120
|
+
* @param teamIds List of internal team IDs to add (min 1)
|
|
121
|
+
* @returns The updated AddressBook
|
|
122
|
+
*/
|
|
123
|
+
addAddressBookTeams<R extends boolean = false>(orgName: string, spaceName: string, bookId: string, teamIds: string[], raw?: {
|
|
124
|
+
raw: R;
|
|
125
|
+
}): Promise<MaybeRaw<R, AddressBook>>;
|
|
126
|
+
/**
|
|
127
|
+
* Remove one or more internal team references from an Address Book.
|
|
128
|
+
* @remarks
|
|
129
|
+
* **Under development, breaking changes possible**
|
|
130
|
+
* @param orgName Name of the Organization
|
|
131
|
+
* @param spaceName Name of the Space
|
|
132
|
+
* @param bookId ID of the Address Book
|
|
133
|
+
* @param teamIds List of internal team IDs to remove (min 1)
|
|
134
|
+
* @returns The updated AddressBook
|
|
135
|
+
*/
|
|
136
|
+
removeAddressBookTeams<R extends boolean = false>(orgName: string, spaceName: string, bookId: string, teamIds: string[], raw?: {
|
|
137
|
+
raw: R;
|
|
138
|
+
}): Promise<MaybeRaw<R, AddressBook>>;
|
|
112
139
|
}
|
|
@@ -111,18 +111,18 @@ class CosmoAddressBook extends Base_1.default {
|
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
113
|
/**
|
|
114
|
-
* Add one or more members
|
|
114
|
+
* Add one or more members to an Address Book.
|
|
115
115
|
* @remarks
|
|
116
116
|
* **Under development, breaking changes possible**
|
|
117
117
|
* @param orgName Name of the Organization
|
|
118
118
|
* @param spaceName Name of the Space
|
|
119
119
|
* @param bookId ID of the Address Book
|
|
120
|
-
* @param
|
|
120
|
+
* @param members Members to add (e-mail -> optional display name)
|
|
121
121
|
* @returns The updated AddressBook
|
|
122
122
|
*/
|
|
123
|
-
addAddressBookMembers(orgName, spaceName, bookId,
|
|
123
|
+
addAddressBookMembers(orgName, spaceName, bookId, members, raw) {
|
|
124
124
|
return __awaiter(this, void 0, void 0, function* () {
|
|
125
|
-
const payload = {
|
|
125
|
+
const payload = { members };
|
|
126
126
|
const resp = yield this.axios.post(this.getEndpoint(`${this.basePath(orgName, spaceName)}/${bookId}/members`), payload);
|
|
127
127
|
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
128
128
|
});
|
|
@@ -146,5 +146,42 @@ class CosmoAddressBook extends Base_1.default {
|
|
|
146
146
|
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
|
+
/**
|
|
150
|
+
* Add one or more internal team references to an Address Book. Team membership stays live: changes to a
|
|
151
|
+
* referenced team are reflected in the address book's recipients.
|
|
152
|
+
* @remarks
|
|
153
|
+
* **Under development, breaking changes possible**
|
|
154
|
+
* @param orgName Name of the Organization
|
|
155
|
+
* @param spaceName Name of the Space
|
|
156
|
+
* @param bookId ID of the Address Book
|
|
157
|
+
* @param teamIds List of internal team IDs to add (min 1)
|
|
158
|
+
* @returns The updated AddressBook
|
|
159
|
+
*/
|
|
160
|
+
addAddressBookTeams(orgName, spaceName, bookId, teamIds, raw) {
|
|
161
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
162
|
+
const payload = { teamIds };
|
|
163
|
+
const resp = yield this.axios.post(this.getEndpoint(`${this.basePath(orgName, spaceName)}/${bookId}/teams`), payload);
|
|
164
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Remove one or more internal team references from an Address Book.
|
|
169
|
+
* @remarks
|
|
170
|
+
* **Under development, breaking changes possible**
|
|
171
|
+
* @param orgName Name of the Organization
|
|
172
|
+
* @param spaceName Name of the Space
|
|
173
|
+
* @param bookId ID of the Address Book
|
|
174
|
+
* @param teamIds List of internal team IDs to remove (min 1)
|
|
175
|
+
* @returns The updated AddressBook
|
|
176
|
+
*/
|
|
177
|
+
removeAddressBookTeams(orgName, spaceName, bookId, teamIds, raw) {
|
|
178
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
179
|
+
const payload = { teamIds };
|
|
180
|
+
const resp = yield this.axios.delete(this.getEndpoint(`${this.basePath(orgName, spaceName)}/${bookId}/teams`), {
|
|
181
|
+
data: payload,
|
|
182
|
+
});
|
|
183
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
184
|
+
});
|
|
185
|
+
}
|
|
149
186
|
}
|
|
150
187
|
exports.CosmoAddressBook = CosmoAddressBook;
|