@@ -206,53 +206,45 @@ export class OrganizationAPI extends AbstractAPI {
206
206
}
207
207
208
208
public async getOrganizationMembershipList ( params : GetOrganizationMembershipListParams ) {
209
- const { organizationId, limit , offset } = params ;
209
+ const { organizationId, ... queryParams } = params ;
210
210
this . requireId ( organizationId ) ;
211
211
212
212
return this . request < PaginatedResourceResponse < OrganizationMembership [ ] > > ( {
213
213
method : 'GET' ,
214
214
path : joinPaths ( basePath , organizationId , 'memberships' ) ,
215
- queryParams : { limit , offset } ,
215
+ queryParams,
216
216
} ) ;
217
217
}
218
218
219
219
public async createOrganizationMembership ( params : CreateOrganizationMembershipParams ) {
220
- const { organizationId, userId , role } = params ;
220
+ const { organizationId, ... bodyParams } = params ;
221
221
this . requireId ( organizationId ) ;
222
222
223
223
return this . request < OrganizationMembership > ( {
224
224
method : 'POST' ,
225
225
path : joinPaths ( basePath , organizationId , 'memberships' ) ,
226
- bodyParams : {
227
- userId,
228
- role,
229
- } ,
226
+ bodyParams,
230
227
} ) ;
231
228
}
232
229
233
230
public async updateOrganizationMembership ( params : UpdateOrganizationMembershipParams ) {
234
- const { organizationId, userId, role } = params ;
231
+ const { organizationId, userId, ... bodyParams } = params ;
235
232
this . requireId ( organizationId ) ;
236
233
237
234
return this . request < OrganizationMembership > ( {
238
235
method : 'PATCH' ,
239
236
path : joinPaths ( basePath , organizationId , 'memberships' , userId ) ,
240
- bodyParams : {
241
- role,
242
- } ,
237
+ bodyParams,
243
238
} ) ;
244
239
}
245
240
246
241
public async updateOrganizationMembershipMetadata ( params : UpdateOrganizationMembershipMetadataParams ) {
247
- const { organizationId, userId, publicMetadata , privateMetadata } = params ;
242
+ const { organizationId, userId, ... bodyParams } = params ;
248
243
249
244
return this . request < OrganizationMembership > ( {
250
245
method : 'PATCH' ,
251
246
path : joinPaths ( basePath , organizationId , 'memberships' , userId , 'metadata' ) ,
252
- bodyParams : {
253
- publicMetadata,
254
- privateMetadata,
255
- } ,
247
+ bodyParams,
256
248
} ) ;
257
249
}
258
250
@@ -267,13 +259,13 @@ export class OrganizationAPI extends AbstractAPI {
267
259
}
268
260
269
261
public async getOrganizationInvitationList ( params : GetOrganizationInvitationListParams ) {
270
- const { organizationId, status , limit , offset } = params ;
262
+ const { organizationId, ... queryParams } = params ;
271
263
this . requireId ( organizationId ) ;
272
264
273
265
return this . request < PaginatedResourceResponse < OrganizationInvitation [ ] > > ( {
274
266
method : 'GET' ,
275
267
path : joinPaths ( basePath , organizationId , 'invitations' ) ,
276
- queryParams : { status , limit , offset } ,
268
+ queryParams,
277
269
} ) ;
278
270
}
279
271
@@ -284,7 +276,7 @@ export class OrganizationAPI extends AbstractAPI {
284
276
return this . request < OrganizationInvitation > ( {
285
277
method : 'POST' ,
286
278
path : joinPaths ( basePath , organizationId , 'invitations' ) ,
287
- bodyParams : { ... bodyParams } ,
279
+ bodyParams,
288
280
} ) ;
289
281
}
290
282
@@ -300,40 +292,37 @@ export class OrganizationAPI extends AbstractAPI {
300
292
}
301
293
302
294
public async revokeOrganizationInvitation ( params : RevokeOrganizationInvitationParams ) {
303
- const { organizationId, invitationId, requestingUserId } = params ;
295
+ const { organizationId, invitationId, ... bodyParams } = params ;
304
296
this . requireId ( organizationId ) ;
305
297
306
298
return this . request < OrganizationInvitation > ( {
307
299
method : 'POST' ,
308
300
path : joinPaths ( basePath , organizationId , 'invitations' , invitationId , 'revoke' ) ,
309
- bodyParams : {
310
- requestingUserId,
311
- } ,
301
+ bodyParams,
312
302
} ) ;
313
303
}
314
304
315
305
public async getOrganizationDomainList ( params : GetOrganizationDomainListParams ) {
316
- const { organizationId, limit , offset } = params ;
306
+ const { organizationId, ... queryParams } = params ;
317
307
this . requireId ( organizationId ) ;
318
308
319
309
return this . request < PaginatedResourceResponse < OrganizationDomain [ ] > > ( {
320
310
method : 'GET' ,
321
311
path : joinPaths ( basePath , organizationId , 'domains' ) ,
322
- queryParams : { limit , offset } ,
312
+ queryParams,
323
313
} ) ;
324
314
}
325
315
326
316
public async createOrganizationDomain ( params : CreateOrganizationDomainParams ) {
327
- const { organizationId, name , enrollmentMode , verified = true } = params ;
317
+ const { organizationId, ... bodyParams } = params ;
328
318
this . requireId ( organizationId ) ;
329
319
330
320
return this . request < OrganizationDomain > ( {
331
321
method : 'POST' ,
332
322
path : joinPaths ( basePath , organizationId , 'domains' ) ,
333
323
bodyParams : {
334
- name,
335
- enrollmentMode,
336
- verified,
324
+ ...bodyParams ,
325
+ verified : bodyParams . verified ?? true ,
337
326
} ,
338
327
} ) ;
339
328
}
0 commit comments