hcloud-sdk 22.29.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 CHANGED
@@ -1,9 +1,5 @@
1
- ## [22.29.0](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/compare/v22.28.0...v22.29.0) (2026-09-09)
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
- * introduce nats message object ([0cfff40](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/0cfff40042da3875cd737c1eb3953ef22e569dc4))
6
-
7
- ### Reverts
8
-
9
- * introduce a new nats subject for standard user information ([8c61176](https://github.com/moovit-sp-gmbh/hcloud-sdk-js/commit/8c6117617ff972db702646307a677eb6c0f756d6))
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: string[];
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 list of member email addresses */
17
- members?: string[];
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 AddressBookMemberRequest = {
26
- /** List of email addresses to add or remove (min 1) */
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
+ };
@@ -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 (by e-mail) to an Address Book.
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 emails List of e-mail addresses to add (min 1)
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, emails: string[], raw?: {
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 (by e-mail) to an Address Book.
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 emails List of e-mail addresses to add (min 1)
120
+ * @param members Members to add (e-mail -> optional display name)
121
121
  * @returns The updated AddressBook
122
122
  */
123
- addAddressBookMembers(orgName, spaceName, bookId, emails, raw) {
123
+ addAddressBookMembers(orgName, spaceName, bookId, members, raw) {
124
124
  return __awaiter(this, void 0, void 0, function* () {
125
- const payload = { emails };
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hcloud-sdk",
3
- "version": "22.29.0",
3
+ "version": "22.30.0",
4
4
  "description": "hcloud platform sdk",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",