@itwin/access-control-client 4.0.0 → 4.2.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 +22 -0
- package/lib/cjs/accessControlClientInterfaces/GroupClient.d.ts +3 -3
- package/lib/cjs/accessControlClientInterfaces/GroupClient.d.ts.map +1 -1
- package/lib/cjs/accessControlClientInterfaces/GroupClient.js.map +1 -1
- package/lib/cjs/accessControlClientInterfaces/MemberInvitationsClient.d.ts +5 -1
- package/lib/cjs/accessControlClientInterfaces/MemberInvitationsClient.d.ts.map +1 -1
- package/lib/cjs/accessControlClientInterfaces/MemberInvitationsClient.js.map +1 -1
- package/lib/cjs/subClients/GroupsClient.d.ts +4 -4
- package/lib/cjs/subClients/GroupsClient.d.ts.map +1 -1
- package/lib/cjs/subClients/GroupsClient.js +6 -3
- package/lib/cjs/subClients/GroupsClient.js.map +1 -1
- package/lib/cjs/subClients/MemberInvitationsClient.d.ts +18 -1
- package/lib/cjs/subClients/MemberInvitationsClient.d.ts.map +1 -1
- package/lib/cjs/subClients/MemberInvitationsClient.js +23 -0
- package/lib/cjs/subClients/MemberInvitationsClient.js.map +1 -1
- package/lib/cjs/types/Groups.d.ts +19 -0
- package/lib/cjs/types/Groups.d.ts.map +1 -1
- package/lib/cjs/types/Groups.js.map +1 -1
- package/lib/cjs/types/Invitations.d.ts +18 -0
- package/lib/cjs/types/Invitations.d.ts.map +1 -1
- package/lib/cjs/types/Invitations.js.map +1 -1
- package/lib/esm/accessControlClientInterfaces/GroupClient.d.ts +3 -3
- package/lib/esm/accessControlClientInterfaces/GroupClient.d.ts.map +1 -1
- package/lib/esm/accessControlClientInterfaces/GroupClient.js.map +1 -1
- package/lib/esm/accessControlClientInterfaces/MemberInvitationsClient.d.ts +5 -1
- package/lib/esm/accessControlClientInterfaces/MemberInvitationsClient.d.ts.map +1 -1
- package/lib/esm/accessControlClientInterfaces/MemberInvitationsClient.js.map +1 -1
- package/lib/esm/subClients/GroupsClient.d.ts +4 -4
- package/lib/esm/subClients/GroupsClient.d.ts.map +1 -1
- package/lib/esm/subClients/GroupsClient.js +6 -3
- package/lib/esm/subClients/GroupsClient.js.map +1 -1
- package/lib/esm/subClients/MemberInvitationsClient.d.ts +18 -1
- package/lib/esm/subClients/MemberInvitationsClient.d.ts.map +1 -1
- package/lib/esm/subClients/MemberInvitationsClient.js +23 -0
- package/lib/esm/subClients/MemberInvitationsClient.js.map +1 -1
- package/lib/esm/types/Groups.d.ts +19 -0
- package/lib/esm/types/Groups.d.ts.map +1 -1
- package/lib/esm/types/Groups.js.map +1 -1
- package/lib/esm/types/Invitations.d.ts +18 -0
- package/lib/esm/types/Invitations.d.ts.map +1 -1
- package/lib/esm/types/Invitations.js.map +1 -1
- package/package.json +20 -19
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Change Log - @itwin/access-control-client
|
|
2
2
|
|
|
3
|
+
## 4.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
### [4.2.0](https://www.npmjs.com/package/@itwin/access-control-client/v/4.2.0) - 2026-03-19
|
|
8
|
+
|
|
9
|
+
Added new endpoint for accepting user invites
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
### [4.1.1](https://www.npmjs.com/package/@itwin/access-control-client/v/4.1.1) - 2026-03-19
|
|
14
|
+
|
|
15
|
+
Fixed dev dep audit issues and updated packages
|
|
16
|
+
|
|
17
|
+
## 4.1.0
|
|
18
|
+
|
|
19
|
+
### Minor Changes
|
|
20
|
+
|
|
21
|
+
### [4.1.0](https://www.npmjs.com/package/@itwin/access-control-client/v/4.1.0) - 2026-01-13
|
|
22
|
+
|
|
23
|
+
Added Hal links to get all groups endpoint only when paging params are present. Added new endpoint for getting member invite by ID.
|
|
24
|
+
|
|
3
25
|
## 4.0.0
|
|
4
26
|
|
|
5
27
|
### Major Changes
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { AccessToken } from "@itwin/core-bentley";
|
|
2
|
-
import type { BentleyAPIResponse } from "../types/CommonApiTypes";
|
|
3
|
-
import type { Group,
|
|
2
|
+
import type { BentleyAPIResponse, ODataQueryParams } from "../types/CommonApiTypes";
|
|
3
|
+
import type { Group, GroupsResponseWithConditionalLinks, SingleGroupResponse } from "../types/Groups";
|
|
4
4
|
export interface IGroupsClient {
|
|
5
5
|
/** Retrieves a list of groups the for a specified iTwin */
|
|
6
|
-
getITwinGroups(accessToken: AccessToken, iTwinId: string): Promise<BentleyAPIResponse<
|
|
6
|
+
getITwinGroups<T extends Pick<ODataQueryParams, "top" | "skip"> | undefined = undefined>(accessToken: AccessToken, iTwinId: string, arg?: T): Promise<BentleyAPIResponse<GroupsResponseWithConditionalLinks<T>>>;
|
|
7
7
|
/** Retrieves a group for a specified iTwin */
|
|
8
8
|
getITwinGroup(accessToken: AccessToken, iTwinId: string, groupId: string): Promise<BentleyAPIResponse<SingleGroupResponse>>;
|
|
9
9
|
/** Creates a new iTwin group */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupClient.d.ts","sourceRoot":"","sources":["../../../src/accessControlClientInterfaces/GroupClient.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"GroupClient.d.ts","sourceRoot":"","sources":["../../../src/accessControlClientInterfaces/GroupClient.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,KAAK,EAAE,KAAK,EAAE,kCAAkC,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtG,MAAM,WAAW,aAAa;IAC5B,2DAA2D;IAC3D,cAAc,CAAC,CAAC,SAAS,IAAI,CAAC,gBAAgB,EAAE,KAAK,GAAG,MAAM,CAAC,GAAG,SAAS,GAAG,SAAS,EACrF,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,GAAG,CAAC,EAAE,CAAC,GACN,OAAO,CAAC,kBAAkB,CAAC,kCAAkC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEtE,8CAA8C;IAC9C,aAAa,CACX,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAEpD,gCAAgC;IAChC,gBAAgB,CACd,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CAAC,GACzC,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAEpD,sCAAsC;IACtC,gBAAgB,CACd,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC,CAAC;IAE1C,sCAAsC;IACtC,gBAAgB,CACd,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CAAC,GAAG;QAAE,OAAO,EAAE,MAAM,EAAE,CAAC;QAAC,SAAS,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,GAC/F,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC,CAAC;CACrD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupClient.js","sourceRoot":"","sources":["../../../src/accessControlClientInterfaces/GroupClient.ts"],"names":[],"mappings":";AAAA;;;gGAGgG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport type { AccessToken } from \"@itwin/core-bentley\";\nimport type { BentleyAPIResponse } from \"../types/CommonApiTypes\";\nimport type { Group,
|
|
1
|
+
{"version":3,"file":"GroupClient.js","sourceRoot":"","sources":["../../../src/accessControlClientInterfaces/GroupClient.ts"],"names":[],"mappings":";AAAA;;;gGAGgG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport type { AccessToken } from \"@itwin/core-bentley\";\nimport type { BentleyAPIResponse, ODataQueryParams } from \"../types/CommonApiTypes\";\nimport type { Group, GroupsResponseWithConditionalLinks, SingleGroupResponse } from \"../types/Groups\";\n\nexport interface IGroupsClient {\n /** Retrieves a list of groups the for a specified iTwin */\n getITwinGroups<T extends Pick<ODataQueryParams, \"top\" | \"skip\"> | undefined = undefined>(\n accessToken: AccessToken,\n iTwinId: string,\n arg?: T\n ): Promise<BentleyAPIResponse<GroupsResponseWithConditionalLinks<T>>>;\n\n /** Retrieves a group for a specified iTwin */\n getITwinGroup(\n accessToken: AccessToken,\n iTwinId: string,\n groupId: string\n ): Promise<BentleyAPIResponse<SingleGroupResponse>>;\n\n /** Creates a new iTwin group */\n createITwinGroup(\n accessToken: AccessToken,\n iTwinId: string,\n group: Pick<Group, \"name\" | \"description\">\n ): Promise<BentleyAPIResponse<SingleGroupResponse>>;\n\n /** Removes an existing iTwin group */\n deleteITwinGroup(\n accessToken: AccessToken,\n iTwinId: string,\n groupId: string\n ): Promise<BentleyAPIResponse<undefined>>;\n\n /** Updates an existing iTwin group */\n updateITwinGroup(\n accessToken: AccessToken,\n iTwinId: string,\n groupId: string,\n group: Partial<Pick<Group, \"name\" | \"description\"> & { members: string[]; imsGroups: string[] }>\n ): Promise<BentleyAPIResponse<SingleGroupResponse>>;\n}"]}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import type { AccessToken } from "@itwin/core-bentley";
|
|
2
2
|
import type { BentleyAPIResponse, ODataQueryParams } from "../types/CommonApiTypes";
|
|
3
|
-
import type { MultipleMemberInvitationResponse } from "../types/Invitations";
|
|
3
|
+
import type { MultipleMemberInvitationResponse, SingleMemberInvitationResponse } from "../types/Invitations";
|
|
4
4
|
export interface IMemberInvitationsClient {
|
|
5
5
|
/** Retrieves a list of member invitations. */
|
|
6
6
|
queryITwinMemberInvitations(accessToken: AccessToken, iTwinId: string, arg?: Pick<ODataQueryParams, "top" | "skip">): Promise<BentleyAPIResponse<MultipleMemberInvitationResponse>>;
|
|
7
|
+
/** Retrieves a member invitations by invite id. */
|
|
8
|
+
getITwinMemberInvitation(accessToken: AccessToken, iTwinId: string, invitationId: string): Promise<BentleyAPIResponse<SingleMemberInvitationResponse>>;
|
|
7
9
|
/** Removes an existing member invitation. */
|
|
8
10
|
deleteITwinMemberInvitation(accessToken: AccessToken, iTwinId: string, invitationId: string): Promise<BentleyAPIResponse<undefined>>;
|
|
11
|
+
/** Accepts an existing member invitation. */
|
|
12
|
+
acceptITwinMemberInvitation(accessToken: AccessToken, iTwinId: string, invitationId: string): Promise<BentleyAPIResponse<undefined>>;
|
|
9
13
|
}
|
|
10
14
|
//# sourceMappingURL=MemberInvitationsClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MemberInvitationsClient.d.ts","sourceRoot":"","sources":["../../../src/accessControlClientInterfaces/MemberInvitationsClient.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"MemberInvitationsClient.d.ts","sourceRoot":"","sources":["../../../src/accessControlClientInterfaces/MemberInvitationsClient.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,KAAK,EAAE,gCAAgC,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AAE7G,MAAM,WAAW,wBAAwB;IACvC,8CAA8C;IAC9C,2BAA2B,CACzB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,GAAG,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,KAAK,GAAG,MAAM,CAAC,GAC3C,OAAO,CAAC,kBAAkB,CAAC,gCAAgC,CAAC,CAAC,CAAC;IAEjE,mDAAmD;IACnD,wBAAwB,CACtB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,kBAAkB,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAE/D,6CAA6C;IAC7C,2BAA2B,CACzB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC,CAAC;IAE1C,6CAA6C;IAC7C,2BAA2B,CACzB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC,CAAC;CAC3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MemberInvitationsClient.js","sourceRoot":"","sources":["../../../src/accessControlClientInterfaces/MemberInvitationsClient.ts"],"names":[],"mappings":";AAAA;;;gGAGgG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport type { AccessToken } from \"@itwin/core-bentley\";\nimport type { BentleyAPIResponse, ODataQueryParams } from \"../types/CommonApiTypes\";\nimport type { MultipleMemberInvitationResponse } from \"../types/Invitations\";\n\nexport interface IMemberInvitationsClient {\n /** Retrieves a list of member invitations. */\n queryITwinMemberInvitations(\n accessToken: AccessToken,\n iTwinId: string,\n arg?: Pick<ODataQueryParams, \"top\" | \"skip\">\n ): Promise<BentleyAPIResponse<MultipleMemberInvitationResponse>>;\n\n /** Removes an existing member invitation. */\n deleteITwinMemberInvitation(\n accessToken: AccessToken,\n iTwinId: string,\n invitationId: string\n ): Promise<BentleyAPIResponse<undefined>>;\n}"]}
|
|
1
|
+
{"version":3,"file":"MemberInvitationsClient.js","sourceRoot":"","sources":["../../../src/accessControlClientInterfaces/MemberInvitationsClient.ts"],"names":[],"mappings":";AAAA;;;gGAGgG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport type { AccessToken } from \"@itwin/core-bentley\";\nimport type { BentleyAPIResponse, ODataQueryParams } from \"../types/CommonApiTypes\";\nimport type { MultipleMemberInvitationResponse, SingleMemberInvitationResponse } from \"../types/Invitations\";\n\nexport interface IMemberInvitationsClient {\n /** Retrieves a list of member invitations. */\n queryITwinMemberInvitations(\n accessToken: AccessToken,\n iTwinId: string,\n arg?: Pick<ODataQueryParams, \"top\" | \"skip\">\n ): Promise<BentleyAPIResponse<MultipleMemberInvitationResponse>>;\n\n /** Retrieves a member invitations by invite id. */\n getITwinMemberInvitation(\n accessToken: AccessToken,\n iTwinId: string,\n invitationId: string\n ): Promise<BentleyAPIResponse<SingleMemberInvitationResponse>>;\n\n /** Removes an existing member invitation. */\n deleteITwinMemberInvitation(\n accessToken: AccessToken,\n iTwinId: string,\n invitationId: string\n ): Promise<BentleyAPIResponse<undefined>>;\n\n /** Accepts an existing member invitation. */\n acceptITwinMemberInvitation(\n accessToken: AccessToken,\n iTwinId: string,\n invitationId: string\n ): Promise<BentleyAPIResponse<undefined>>;\n}"]}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { AccessToken } from "@itwin/core-bentley";
|
|
5
5
|
import type { IGroupsClient } from "../accessControlClientInterfaces/GroupClient";
|
|
6
|
-
import type { BentleyAPIResponse } from "../types/CommonApiTypes";
|
|
7
|
-
import type { Group,
|
|
6
|
+
import type { BentleyAPIResponse, ODataQueryParams } from "../types/CommonApiTypes";
|
|
7
|
+
import type { Group, GroupsResponseWithConditionalLinks, SingleGroupResponse } from "../types/Groups";
|
|
8
8
|
import { BaseClient } from "./BaseClient";
|
|
9
9
|
/** Client API to perform iTwin group operations.
|
|
10
10
|
*/
|
|
@@ -16,9 +16,9 @@ export declare class GroupsClient extends BaseClient implements IGroupsClient {
|
|
|
16
16
|
/** Retrieves a list of available user roles that are defined for a specified iTwin
|
|
17
17
|
* @param accessToken The client access token string
|
|
18
18
|
* @param iTwinId The id of the iTwin
|
|
19
|
-
* @returns
|
|
19
|
+
* @returns MultipleGroupsResponse
|
|
20
20
|
*/
|
|
21
|
-
getITwinGroups(accessToken: AccessToken, iTwinId: string): Promise<BentleyAPIResponse<
|
|
21
|
+
getITwinGroups<T extends Pick<ODataQueryParams, "top" | "skip"> | undefined = undefined>(accessToken: AccessToken, iTwinId: string, arg?: T): Promise<BentleyAPIResponse<GroupsResponseWithConditionalLinks<T>>>;
|
|
22
22
|
/** Retrieves the specified role for the specified iTwin
|
|
23
23
|
* @param accessToken The client access token string
|
|
24
24
|
* @param iTwinId The id of the iTwin
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupsClient.d.ts","sourceRoot":"","sources":["../../../src/subClients/GroupsClient.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"GroupsClient.d.ts","sourceRoot":"","sources":["../../../src/subClients/GroupsClient.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,KAAK,EAAE,KAAK,EAAE,kCAAkC,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtG,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;GACG;AACH,qBAAa,YAAa,SAAQ,UAAW,YAAW,aAAa;IACnE;;OAEG;gBACgB,GAAG,CAAC,EAAE,MAAM;IAI/B;;;;QAII;IACS,cAAc,CAAC,CAAC,SAAS,IAAI,CAAC,gBAAgB,EAAE,KAAK,GAAG,MAAM,CAAC,GAAG,SAAS,GAAG,SAAS,EAClG,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,GAAG,CAAC,EAAE,CAAC,GACN,OAAO,CAAC,kBAAkB,CAAC,kCAAkC,CAAC,CAAC,CAAC,CAAC,CAAC;IASrE;;;;QAII;IACS,aAAa,CACxB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;IAKnD;;;;;QAKI;IACS,gBAAgB,CAC3B,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,IAAI,CAAE,KAAK,EAAE,MAAM,GAAG,aAAa,CAAC,GAC1C,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;IAKnD;;;;;QAKI;IACS,gBAAgB,CAC3B,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAKzC;;;;;;QAMI;IACS,gBAAgB,CAC3B,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CAAC,GAAG;QAAE,OAAO,EAAE,MAAM,EAAE,CAAC;QAAC,SAAS,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,GAC/F,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;CAIpD"}
|
|
@@ -21,10 +21,13 @@ class GroupsClient extends BaseClient_1.BaseClient {
|
|
|
21
21
|
/** Retrieves a list of available user roles that are defined for a specified iTwin
|
|
22
22
|
* @param accessToken The client access token string
|
|
23
23
|
* @param iTwinId The id of the iTwin
|
|
24
|
-
* @returns
|
|
24
|
+
* @returns MultipleGroupsResponse
|
|
25
25
|
*/
|
|
26
|
-
async getITwinGroups(accessToken, iTwinId) {
|
|
27
|
-
|
|
26
|
+
async getITwinGroups(accessToken, iTwinId, arg) {
|
|
27
|
+
let url = `${this._baseUrl}/${iTwinId}/groups`;
|
|
28
|
+
if (arg) {
|
|
29
|
+
url += `?${this.getQueryString(GroupsClient.paginationParamMapping, { top: arg.top, skip: arg.skip })}`;
|
|
30
|
+
}
|
|
28
31
|
return this.sendGenericAPIRequest(accessToken, "GET", url);
|
|
29
32
|
}
|
|
30
33
|
/** Retrieves the specified role for the specified iTwin
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupsClient.js","sourceRoot":"","sources":["../../../src/subClients/GroupsClient.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAMH,6CAA0C;AAE1C;GACG;AACH,MAAa,YAAa,SAAQ,uBAAU;IAC1C;;OAEG;IACH,YAAmB,GAAY;QAC7B,KAAK,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;IAED;;;;QAII;IACG,KAAK,CAAC,cAAc,CACzB,WAAwB,EACxB,OAAe;
|
|
1
|
+
{"version":3,"file":"GroupsClient.js","sourceRoot":"","sources":["../../../src/subClients/GroupsClient.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAMH,6CAA0C;AAE1C;GACG;AACH,MAAa,YAAa,SAAQ,uBAAU;IAC1C;;OAEG;IACH,YAAmB,GAAY;QAC7B,KAAK,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;IAED;;;;QAII;IACG,KAAK,CAAC,cAAc,CACzB,WAAwB,EACxB,OAAe,EACf,GAAO;QAEP,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC,QAAQ,IAAI,OAAO,SAAS,CAAC;QAE/C,IAAI,GAAG,EAAE,CAAC;YACR,GAAG,IAAI,IAAI,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,sBAAsB,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;QAC1G,CAAC;QACD,OAAO,IAAI,CAAC,qBAAqB,CAAC,WAAW,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IAC7D,CAAC;IAED;;;;QAII;IACG,KAAK,CAAC,aAAa,CACxB,WAAwB,EACxB,OAAe,EACf,OAAe;QAEf,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,QAAQ,IAAI,OAAO,WAAW,OAAO,EAAE,CAAC;QAC5D,OAAO,IAAI,CAAC,qBAAqB,CAAC,WAAW,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;QAKI;IACG,KAAK,CAAC,gBAAgB,CAC3B,WAAwB,EACxB,OAAe,EACf,KAA2C;QAE3C,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,QAAQ,IAAI,OAAO,SAAS,CAAC;QACjD,OAAO,IAAI,CAAC,qBAAqB,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IACrE,CAAC;IAED;;;;;QAKI;IACG,KAAK,CAAC,gBAAgB,CAC3B,WAAwB,EACxB,OAAe,EACf,OAAe;QAEf,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,QAAQ,IAAI,OAAO,WAAW,OAAO,EAAE,CAAC;QAC5D,OAAO,IAAI,CAAC,qBAAqB,CAAC,WAAW,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC;IAChE,CAAC;IAED;;;;;;QAMI;IACG,KAAK,CAAC,gBAAgB,CAC3B,WAAwB,EACxB,OAAe,EACf,OAAe,EACf,KAAgG;QAEhG,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,QAAQ,IAAI,OAAO,WAAW,OAAO,EAAE,CAAC;QAC5D,OAAO,IAAI,CAAC,qBAAqB,CAAC,WAAW,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IACtE,CAAC;CACF;AAtFD,oCAsFC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module AccessControlClient\n */\n\nimport type { AccessToken } from \"@itwin/core-bentley\";\nimport type { IGroupsClient } from \"../accessControlClientInterfaces/GroupClient\";\nimport type { BentleyAPIResponse, ODataQueryParams } from \"../types/CommonApiTypes\";\nimport type { Group, GroupsResponseWithConditionalLinks, SingleGroupResponse } from \"../types/Groups\";\nimport { BaseClient } from \"./BaseClient\";\n\n/** Client API to perform iTwin group operations.\n */\nexport class GroupsClient extends BaseClient implements IGroupsClient{\n /** Create a new GroupsClient instance\n * @param url Optional base URL for the access control service. If not provided, defaults to base url.\n */\n public constructor(url?: string) {\n super(url);\n }\n\n /** Retrieves a list of available user roles that are defined for a specified iTwin\n * @param accessToken The client access token string\n * @param iTwinId The id of the iTwin\n * @returns MultipleGroupsResponse\n */\n public async getITwinGroups<T extends Pick<ODataQueryParams, \"top\" | \"skip\"> | undefined = undefined>(\n accessToken: AccessToken,\n iTwinId: string,\n arg?: T\n ): Promise<BentleyAPIResponse<GroupsResponseWithConditionalLinks<T>>>{\n let url = `${this._baseUrl}/${iTwinId}/groups`;\n\n if (arg) {\n url += `?${this.getQueryString(GroupsClient.paginationParamMapping, { top: arg.top, skip: arg.skip })}`;\n }\n return this.sendGenericAPIRequest(accessToken, \"GET\", url);\n }\n\n /** Retrieves the specified role for the specified iTwin\n * @param accessToken The client access token string\n * @param iTwinId The id of the iTwin\n * @returns Group\n */\n public async getITwinGroup(\n accessToken: AccessToken,\n iTwinId: string,\n groupId: string,\n ): Promise<BentleyAPIResponse<SingleGroupResponse>>{\n const url = `${this._baseUrl}/${iTwinId}/groups/${groupId}`;\n return this.sendGenericAPIRequest(accessToken, \"GET\", url);\n }\n\n /** Creates a new iTwin group\n * @param accessToken The client access token string\n * @param iTwinId The id of the iTwin\n * @param group The group to be created\n * @returns Group\n */\n public async createITwinGroup(\n accessToken: AccessToken,\n iTwinId: string,\n group: Pick< Group, \"name\" | \"description\">\n ): Promise<BentleyAPIResponse<SingleGroupResponse>>{\n const url = `${this._baseUrl}/${iTwinId}/groups`;\n return this.sendGenericAPIRequest(accessToken, \"POST\", url, group);\n }\n\n /** Delete the specified iTwin group\n * @param accessToken The client access token string\n * @param iTwinId The id of the iTwin\n * @param groupId The id of the group to remove\n * @returns No Content\n */\n public async deleteITwinGroup(\n accessToken: AccessToken,\n iTwinId: string,\n groupId: string,\n ): Promise<BentleyAPIResponse<undefined>>{\n const url = `${this._baseUrl}/${iTwinId}/groups/${groupId}`;\n return this.sendGenericAPIRequest(accessToken, \"DELETE\", url);\n }\n\n /** Update the specified iTwin group\n * @param accessToken The client access token string\n * @param iTwinId The id of the iTwin\n * @param groupId The id of the role to update\n * @param group The updated group\n * @returns Group that was updated\n */\n public async updateITwinGroup(\n accessToken: AccessToken,\n iTwinId: string,\n groupId: string,\n group: Partial<Pick<Group, \"name\" | \"description\"> & { members: string[]; imsGroups: string[] }>\n ): Promise<BentleyAPIResponse<SingleGroupResponse>>{\n const url = `${this._baseUrl}/${iTwinId}/groups/${groupId}`;\n return this.sendGenericAPIRequest(accessToken, \"PATCH\", url, group);\n }\n}\n"]}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import type { AccessToken } from "@itwin/core-bentley";
|
|
5
5
|
import type { IMemberInvitationsClient } from "../accessControlClientInterfaces/MemberInvitationsClient";
|
|
6
6
|
import type { BentleyAPIResponse, ODataQueryParams } from "../types/CommonApiTypes";
|
|
7
|
-
import type { MultipleMemberInvitationResponse } from "../types/Invitations";
|
|
7
|
+
import type { MultipleMemberInvitationResponse, SingleMemberInvitationResponse } from "../types/Invitations";
|
|
8
8
|
import { BaseClient } from "./BaseClient";
|
|
9
9
|
/** Client API to perform iTwin member invitation operations.
|
|
10
10
|
*/
|
|
@@ -26,5 +26,22 @@ export declare class MemberInvitationsClient extends BaseClient implements IMemb
|
|
|
26
26
|
* @returns No Content
|
|
27
27
|
*/
|
|
28
28
|
deleteITwinMemberInvitation(accessToken: AccessToken, iTwinId: string, invitationId: string): Promise<BentleyAPIResponse<undefined>>;
|
|
29
|
+
/** Accepts a member invitation.
|
|
30
|
+
* @param accessToken The client access token string
|
|
31
|
+
* @param iTwinId The id of the iTwin
|
|
32
|
+
* @param invitationId The id of the invitation id
|
|
33
|
+
* @returns No Content
|
|
34
|
+
* @beta
|
|
35
|
+
* @remarks On success, the invited user is added as an iTwin member with the roles from all pending invitations for that user. After acceptance, all of that user’s pending invitations for the iTwin are consumed and can no longer be accessed.
|
|
36
|
+
* If the invited user is already a member of the iTwin, the request is treated as a success. Only the invited user can accept this invitation through this API. The invited user must already exist as a member in IMS.
|
|
37
|
+
*/
|
|
38
|
+
acceptITwinMemberInvitation(accessToken: AccessToken, iTwinId: string, invitationId: string): Promise<BentleyAPIResponse<undefined>>;
|
|
39
|
+
/** Deletes a member invitations.
|
|
40
|
+
* @param accessToken The client access token string
|
|
41
|
+
* @param iTwinId The id of the iTwin
|
|
42
|
+
* @param invitationId The id of the invitation id
|
|
43
|
+
* @returns A member invitation or error object
|
|
44
|
+
*/
|
|
45
|
+
getITwinMemberInvitation(accessToken: AccessToken, iTwinId: string, invitationId: string): Promise<BentleyAPIResponse<SingleMemberInvitationResponse>>;
|
|
29
46
|
}
|
|
30
47
|
//# sourceMappingURL=MemberInvitationsClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MemberInvitationsClient.d.ts","sourceRoot":"","sources":["../../../src/subClients/MemberInvitationsClient.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0DAA0D,CAAC;AACzG,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"MemberInvitationsClient.d.ts","sourceRoot":"","sources":["../../../src/subClients/MemberInvitationsClient.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0DAA0D,CAAC;AACzG,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,KAAK,EAAE,gCAAgC,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AAC7G,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;GACG;AACH,qBAAa,uBACX,SAAQ,UACR,YAAW,wBAAwB;IACnC;;OAEG;gBACgB,GAAG,CAAC,EAAE,MAAM;IAI/B;;;;OAIG;IACU,2BAA2B,CACtC,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,GAAG,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,KAAK,GAAG,MAAM,CAAC,GAC3C,OAAO,CAAC,kBAAkB,CAAC,gCAAgC,CAAC,CAAC;IAahE;;;;;OAKG;IACU,2BAA2B,CACtC,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAKzC;;;;;;;;OAQG;IACU,2BAA2B,CACtC,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAKvC;;;;;KAKC;IACU,wBAAwB,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,8BAA8B,CAAC,CAAC;CAKpK"}
|
|
@@ -37,6 +37,29 @@ class MemberInvitationsClient extends BaseClient_1.BaseClient {
|
|
|
37
37
|
const url = `${this._baseUrl}/${iTwinId}/members/invitations/${invitationId}`;
|
|
38
38
|
return this.sendGenericAPIRequest(accessToken, "DELETE", url);
|
|
39
39
|
}
|
|
40
|
+
/** Accepts a member invitation.
|
|
41
|
+
* @param accessToken The client access token string
|
|
42
|
+
* @param iTwinId The id of the iTwin
|
|
43
|
+
* @param invitationId The id of the invitation id
|
|
44
|
+
* @returns No Content
|
|
45
|
+
* @beta
|
|
46
|
+
* @remarks On success, the invited user is added as an iTwin member with the roles from all pending invitations for that user. After acceptance, all of that user’s pending invitations for the iTwin are consumed and can no longer be accessed.
|
|
47
|
+
* If the invited user is already a member of the iTwin, the request is treated as a success. Only the invited user can accept this invitation through this API. The invited user must already exist as a member in IMS.
|
|
48
|
+
*/
|
|
49
|
+
async acceptITwinMemberInvitation(accessToken, iTwinId, invitationId) {
|
|
50
|
+
const url = `${this._baseUrl}/${iTwinId}/members/invitations/${invitationId}/accept`;
|
|
51
|
+
return this.sendGenericAPIRequest(accessToken, "POST", url);
|
|
52
|
+
}
|
|
53
|
+
/** Deletes a member invitations.
|
|
54
|
+
* @param accessToken The client access token string
|
|
55
|
+
* @param iTwinId The id of the iTwin
|
|
56
|
+
* @param invitationId The id of the invitation id
|
|
57
|
+
* @returns A member invitation or error object
|
|
58
|
+
*/
|
|
59
|
+
async getITwinMemberInvitation(accessToken, iTwinId, invitationId) {
|
|
60
|
+
const url = `${this._baseUrl}/${iTwinId}/members/invitations/${invitationId}`;
|
|
61
|
+
return this.sendGenericAPIRequest(accessToken, "GET", url);
|
|
62
|
+
}
|
|
40
63
|
}
|
|
41
64
|
exports.MemberInvitationsClient = MemberInvitationsClient;
|
|
42
65
|
//# sourceMappingURL=MemberInvitationsClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MemberInvitationsClient.js","sourceRoot":"","sources":["../../../src/subClients/MemberInvitationsClient.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAMH,6CAA0C;AAE1C;GACG;AACH,MAAa,uBACX,SAAQ,uBAAU;IAElB;;OAEG;IACH,YAAmB,GAAY;QAC7B,KAAK,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,2BAA2B,CACtC,WAAwB,EACxB,OAAe,EACf,GAA4C;QAE5C,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,QAAQ,IAAI,OAAO,uBACrC,GAAG,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,cAAc,CAAC,uBAAuB,CAAC,sBAAsB,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EACtH,EAAE,CAAC;QAEH,OAAO,IAAI,CAAC,qBAAqB,CAC/B,WAAW,EACX,KAAK,EACL,GAAG,EACH,SAAS,CACV,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,2BAA2B,CACtC,WAAwB,EACxB,OAAe,EACf,YAAoB;QAEpB,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,QAAQ,IAAI,OAAO,wBAAwB,YAAY,EAAE,CAAC;QAC9E,OAAO,IAAI,CAAC,qBAAqB,CAAC,WAAW,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC;IAChE,CAAC;
|
|
1
|
+
{"version":3,"file":"MemberInvitationsClient.js","sourceRoot":"","sources":["../../../src/subClients/MemberInvitationsClient.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAMH,6CAA0C;AAE1C;GACG;AACH,MAAa,uBACX,SAAQ,uBAAU;IAElB;;OAEG;IACH,YAAmB,GAAY;QAC7B,KAAK,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,2BAA2B,CACtC,WAAwB,EACxB,OAAe,EACf,GAA4C;QAE5C,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,QAAQ,IAAI,OAAO,uBACrC,GAAG,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,cAAc,CAAC,uBAAuB,CAAC,sBAAsB,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EACtH,EAAE,CAAC;QAEH,OAAO,IAAI,CAAC,qBAAqB,CAC/B,WAAW,EACX,KAAK,EACL,GAAG,EACH,SAAS,CACV,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,2BAA2B,CACtC,WAAwB,EACxB,OAAe,EACf,YAAoB;QAEpB,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,QAAQ,IAAI,OAAO,wBAAwB,YAAY,EAAE,CAAC;QAC9E,OAAO,IAAI,CAAC,qBAAqB,CAAC,WAAW,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC;IAChE,CAAC;IAED;;;;;;;;OAQG;IACI,KAAK,CAAC,2BAA2B,CACtC,WAAwB,EACxB,OAAe,EACf,YAAoB;QAEpB,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,QAAQ,IAAI,OAAO,wBAAwB,YAAY,SAAS,CAAC;QACrF,OAAO,IAAI,CAAC,qBAAqB,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9D,CAAC;IAEC;;;;;KAKC;IACI,KAAK,CAAC,wBAAwB,CAAC,WAAwB,EAAE,OAAe,EAAE,YAAoB;QACnG,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,QAAQ,IAAI,OAAO,wBAAwB,YAAY,EAAE,CAAC;QAC9E,OAAO,IAAI,CAAC,qBAAqB,CAAC,WAAW,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IAC7D,CAAC;CAEF;AA5ED,0DA4EC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module AccessControlClient\n */\n\nimport type { AccessToken } from \"@itwin/core-bentley\";\nimport type { IMemberInvitationsClient } from \"../accessControlClientInterfaces/MemberInvitationsClient\";\nimport type { BentleyAPIResponse, ODataQueryParams } from \"../types/CommonApiTypes\";\nimport type { MultipleMemberInvitationResponse, SingleMemberInvitationResponse } from \"../types/Invitations\";\nimport { BaseClient } from \"./BaseClient\";\n\n/** Client API to perform iTwin member invitation operations.\n */\nexport class MemberInvitationsClient\n extends BaseClient\n implements IMemberInvitationsClient {\n /** Create a new MemberInvitationsClient instance\n * @param url Optional base URL for the access control service. If not provided, defaults to base url.\n */\n public constructor(url?: string) {\n super(url);\n }\n\n /** Retrieves a list of iTwin member invitations.\n * @param accessToken The client access token string\n * @param iTwinId The id of the iTwin\n * @returns Array of member invitations\n */\n public async queryITwinMemberInvitations(\n accessToken: AccessToken,\n iTwinId: string,\n arg?: Pick<ODataQueryParams, \"top\" | \"skip\">\n ): Promise<BentleyAPIResponse<MultipleMemberInvitationResponse>> {\n const url = `${this._baseUrl}/${iTwinId}/members/invitations${\n arg ? `?${this.getQueryString(MemberInvitationsClient.paginationParamMapping, { top: arg.top, skip: arg.skip })}` : ''\n }`;\n\n return this.sendGenericAPIRequest(\n accessToken,\n \"GET\",\n url,\n undefined,\n );\n }\n\n /** Deletes a member invitations.\n * @param accessToken The client access token string\n * @param iTwinId The id of the iTwin\n * @param invitationId The id of the invitation id\n * @returns No Content\n */\n public async deleteITwinMemberInvitation(\n accessToken: AccessToken,\n iTwinId: string,\n invitationId: string\n ): Promise<BentleyAPIResponse<undefined>> {\n const url = `${this._baseUrl}/${iTwinId}/members/invitations/${invitationId}`;\n return this.sendGenericAPIRequest(accessToken, \"DELETE\", url);\n }\n\n /** Accepts a member invitation.\n * @param accessToken The client access token string\n * @param iTwinId The id of the iTwin\n * @param invitationId The id of the invitation id\n * @returns No Content\n * @beta\n * @remarks On success, the invited user is added as an iTwin member with the roles from all pending invitations for that user. After acceptance, all of that user’s pending invitations for the iTwin are consumed and can no longer be accessed.\n * If the invited user is already a member of the iTwin, the request is treated as a success. Only the invited user can accept this invitation through this API. The invited user must already exist as a member in IMS.\n */\n public async acceptITwinMemberInvitation(\n accessToken: AccessToken,\n iTwinId: string,\n invitationId: string\n ): Promise<BentleyAPIResponse<undefined>> {\n const url = `${this._baseUrl}/${iTwinId}/members/invitations/${invitationId}/accept`;\n return this.sendGenericAPIRequest(accessToken, \"POST\", url);\n }\n\n /** Deletes a member invitations.\n * @param accessToken The client access token string\n * @param iTwinId The id of the iTwin\n * @param invitationId The id of the invitation id\n * @returns A member invitation or error object\n */\n public async getITwinMemberInvitation(accessToken: AccessToken, iTwinId: string, invitationId: string): Promise<BentleyAPIResponse<SingleMemberInvitationResponse>> {\n const url = `${this._baseUrl}/${iTwinId}/members/invitations/${invitationId}`;\n return this.sendGenericAPIRequest(accessToken, \"GET\", url);\n }\n\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Links } from "./links";
|
|
1
2
|
import type { GroupUser } from "./Members";
|
|
2
3
|
/**
|
|
3
4
|
* Represents an access control group within an iTwin.
|
|
@@ -49,6 +50,22 @@ export interface SingleGroupResponse {
|
|
|
49
50
|
/** The group data returned by the API */
|
|
50
51
|
group: Group;
|
|
51
52
|
}
|
|
53
|
+
/** Utility type to determine if any pagination parameters are present */
|
|
54
|
+
export type HasAnyPaginationParam<T> = T extends {
|
|
55
|
+
top?: unknown;
|
|
56
|
+
} | {
|
|
57
|
+
skip?: unknown;
|
|
58
|
+
} ? true : false;
|
|
59
|
+
/**
|
|
60
|
+
* API response wrapper for multiple groups operations.
|
|
61
|
+
* Conditional inclusion of HAL-style links based on pagination parameters.
|
|
62
|
+
*
|
|
63
|
+
* @remarks
|
|
64
|
+
* This interface is used for API responses that return multiple groups,
|
|
65
|
+
* such as GET /groups operations. The array may be empty if no groups
|
|
66
|
+
* match the query criteria or if the iTwin has no groups defined.
|
|
67
|
+
*/
|
|
68
|
+
export type GroupsResponseWithConditionalLinks<T> = HasAnyPaginationParam<T> extends true ? MultipleGroupsResponse : Omit<MultipleGroupsResponse, "_links">;
|
|
52
69
|
/**
|
|
53
70
|
* API response wrapper for multiple groups operations.
|
|
54
71
|
*
|
|
@@ -60,5 +77,7 @@ export interface SingleGroupResponse {
|
|
|
60
77
|
export interface MultipleGroupsResponse {
|
|
61
78
|
/** Array of groups returned by the API */
|
|
62
79
|
groups: Group[];
|
|
80
|
+
/** HAL-style links for pagination and related resources */
|
|
81
|
+
_links: Links;
|
|
63
82
|
}
|
|
64
83
|
//# sourceMappingURL=Groups.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Groups.d.ts","sourceRoot":"","sources":["../../../src/types/Groups.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,WAAW,KAAK;IACpB,mBAAmB;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,+DAA+D;IAC/D,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAClC,yCAAyC;IACzC,KAAK,EAAE,KAAK,CAAC;CACd;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,sBAAsB;IACrC,0CAA0C;IAC1C,MAAM,EAAE,KAAK,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"Groups.d.ts","sourceRoot":"","sources":["../../../src/types/Groups.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,WAAW,KAAK;IACpB,mBAAmB;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,+DAA+D;IAC/D,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAClC,yCAAyC;IACzC,KAAK,EAAE,KAAK,CAAC;CACd;AAED,yEAAyE;AACzE,MAAM,MAAM,qBAAqB,CAAC,CAAC,IACjC,CAAC,SAAS;IAAE,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,GAAG,KAAK,CAAC;AAElE;;;;;;;;GAQG;AACH,MAAM,MAAM,kCAAkC,CAAC,CAAC,IAC9C,qBAAqB,CAAC,CAAC,CAAC,SAAS,IAAI,GACjC,sBAAsB,GACtB,IAAI,CAAC,sBAAsB,EAAE,QAAQ,CAAC,CAAC;AAE7C;;;;;;;GAOG;AACH,MAAM,WAAW,sBAAsB;IACrC,0CAA0C;IAC1C,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,2DAA2D;IAE3D,MAAM,EAAE,KAAK,CAAC;CACf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Groups.js","sourceRoot":"","sources":["../../../src/types/Groups.ts"],"names":[],"mappings":";AAAA;;;gGAGgG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport type { GroupUser } from \"./Members\";\n\n/**\n * Represents an access control group within an iTwin.\n *\n * @remarks\n * Access Control groups provide the ability to manage groups of users at one time.\n * You can create groups on the Account iTwin to manage access across iTwins or\n * create a group for an individual iTwin. Groups created on an individual iTwin\n * are available only on that iTwin.\n *\n * Groups can contain individual users. Groups can also reference Bentley Identity\n * Management System (IMS) groups. By referencing an IMS group, you can manage\n * groups of individuals in your Active Directory, while providing them access to\n * iTwin Platform using role assignments.\n *\n * @example\n * ```typescript\n * const projectGroup: Group = {\n * id: \"550e8400-e29b-41d4-a716-446655440000\",\n * name: \"Project Managers\",\n * description: \"Users with project management responsibilities\",\n * members: [\n * { id: \"user123\", email: \"manager@company.com\", firstName: \"John\", lastName: \"Smith\" }\n * ],\n * imsGroups: [\"COMPANY_ADMINS\", \"PROJECT_LEADS\"]\n * };\n * ```\n */\nexport interface Group {\n /** The Group id */\n id: string;\n /** The name of your Group */\n name: string;\n /** A description of your Group */\n description: string;\n /** List of members assigned to the Group. Max size of 50 */\n members: GroupUser[];\n /** List of IMS Groups assigned to the Group. Max size of 50 */\n imsGroups: string[];\n}\n\n/**\n * API response wrapper for a single group operation.\n *\n * @remarks\n * This interface is used for API responses that return a single group,\n * such as GET /groups/{id}, POST /groups, and PATCH /groups/{id} operations.\n */\nexport interface SingleGroupResponse {\n /** The group data returned by the API */\n group: Group;\n}\n\n/**\n * API response wrapper for multiple groups operations.\n *\n * @remarks\n * This interface is used for API responses that return multiple groups,\n * such as GET /groups operations. The array may be empty if no groups\n * match the query criteria or if the iTwin has no groups defined.\n */\nexport interface MultipleGroupsResponse {\n /** Array of groups returned by the API */\n groups: Group[];\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Groups.js","sourceRoot":"","sources":["../../../src/types/Groups.ts"],"names":[],"mappings":";AAAA;;;gGAGgG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport type { Links } from \"./links\";\nimport type { GroupUser } from \"./Members\";\n\n/**\n * Represents an access control group within an iTwin.\n *\n * @remarks\n * Access Control groups provide the ability to manage groups of users at one time.\n * You can create groups on the Account iTwin to manage access across iTwins or\n * create a group for an individual iTwin. Groups created on an individual iTwin\n * are available only on that iTwin.\n *\n * Groups can contain individual users. Groups can also reference Bentley Identity\n * Management System (IMS) groups. By referencing an IMS group, you can manage\n * groups of individuals in your Active Directory, while providing them access to\n * iTwin Platform using role assignments.\n *\n * @example\n * ```typescript\n * const projectGroup: Group = {\n * id: \"550e8400-e29b-41d4-a716-446655440000\",\n * name: \"Project Managers\",\n * description: \"Users with project management responsibilities\",\n * members: [\n * { id: \"user123\", email: \"manager@company.com\", firstName: \"John\", lastName: \"Smith\" }\n * ],\n * imsGroups: [\"COMPANY_ADMINS\", \"PROJECT_LEADS\"]\n * };\n * ```\n */\nexport interface Group {\n /** The Group id */\n id: string;\n /** The name of your Group */\n name: string;\n /** A description of your Group */\n description: string;\n /** List of members assigned to the Group. Max size of 50 */\n members: GroupUser[];\n /** List of IMS Groups assigned to the Group. Max size of 50 */\n imsGroups: string[];\n}\n\n/**\n * API response wrapper for a single group operation.\n *\n * @remarks\n * This interface is used for API responses that return a single group,\n * such as GET /groups/{id}, POST /groups, and PATCH /groups/{id} operations.\n */\nexport interface SingleGroupResponse {\n /** The group data returned by the API */\n group: Group;\n}\n\n/** Utility type to determine if any pagination parameters are present */\nexport type HasAnyPaginationParam<T> =\n T extends { top?: unknown } | { skip?: unknown } ? true : false;\n\n/**\n * API response wrapper for multiple groups operations.\n * Conditional inclusion of HAL-style links based on pagination parameters.\n *\n * @remarks\n * This interface is used for API responses that return multiple groups,\n * such as GET /groups operations. The array may be empty if no groups\n * match the query criteria or if the iTwin has no groups defined.\n */\nexport type GroupsResponseWithConditionalLinks<T> =\n HasAnyPaginationParam<T> extends true\n ? MultipleGroupsResponse\n : Omit<MultipleGroupsResponse, \"_links\">;\n\n/**\n * API response wrapper for multiple groups operations.\n *\n * @remarks\n * This interface is used for API responses that return multiple groups,\n * such as GET /groups operations. The array may be empty if no groups\n * match the query criteria or if the iTwin has no groups defined.\n */\nexport interface MultipleGroupsResponse {\n /** Array of groups returned by the API */\n groups: Group[];\n /** HAL-style links for pagination and related resources */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n _links: Links;\n}\n"]}
|
|
@@ -76,6 +76,24 @@ export interface MultipleMemberInvitationResponse {
|
|
|
76
76
|
/** HAL-style navigation links for pagination (first, next, prev, last) */
|
|
77
77
|
_links: Links;
|
|
78
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* API response wrapper for a member invitation.
|
|
81
|
+
*
|
|
82
|
+
* @remarks
|
|
83
|
+
* This interface is used for API responses that a single member invitation,
|
|
84
|
+
* such as GET /invitations operations.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```typescript
|
|
88
|
+
* const response: MultipleMemberInvitationResponse = {
|
|
89
|
+
* invitation: {{ id: "inv1", email: "user1@external.com", status: "Pending", ... }} ,
|
|
90
|
+
* };
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export interface SingleMemberInvitationResponse {
|
|
94
|
+
/** The member invitation */
|
|
95
|
+
invitation: MemberInvitation;
|
|
96
|
+
}
|
|
79
97
|
/**
|
|
80
98
|
* Represents an invitation sent to a group member to join an iTwin.
|
|
81
99
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Invitations.d.ts","sourceRoot":"","sources":["../../../src/types/Invitations.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,gBAAgB;IAC/B,2CAA2C;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,cAAc,EAAE,MAAM,CAAC;IACvB,uCAAuC;IACvC,MAAM,EAAE,sBAAsB,CAAC;IAC/B,yDAAyD;IACzD,WAAW,EAAE,MAAM,CAAC;IACpB,qDAAqD;IACrD,cAAc,EAAE,MAAM,CAAC;IACvB,2FAA2F;IAC3F,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;CAChB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,UAAU,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,gCAAgC;IAC/C,sDAAsD;IACtD,WAAW,EAAE,gBAAgB,EAAE,CAAC;IAChC,0EAA0E;IAE1E,MAAM,EAAE,KAAK,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;AAEpE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,qCAAqC;IACpD,4DAA4D;IAC5D,WAAW,EAAE,qBAAqB,EAAE,CAAC;IACrC,0EAA0E;IAE1E,MAAM,EAAE,KAAK,CAAC;CACf"}
|
|
1
|
+
{"version":3,"file":"Invitations.d.ts","sourceRoot":"","sources":["../../../src/types/Invitations.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,gBAAgB;IAC/B,2CAA2C;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,cAAc,EAAE,MAAM,CAAC;IACvB,uCAAuC;IACvC,MAAM,EAAE,sBAAsB,CAAC;IAC/B,yDAAyD;IACzD,WAAW,EAAE,MAAM,CAAC;IACpB,qDAAqD;IACrD,cAAc,EAAE,MAAM,CAAC;IACvB,2FAA2F;IAC3F,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;CAChB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,UAAU,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,gCAAgC;IAC/C,sDAAsD;IACtD,WAAW,EAAE,gBAAgB,EAAE,CAAC;IAChC,0EAA0E;IAE1E,MAAM,EAAE,KAAK,CAAC;CACf;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,8BAA8B;IAC7C,4BAA4B;IAC5B,UAAU,EAAE,gBAAgB,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;AAEpE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,qCAAqC;IACpD,4DAA4D;IAC5D,WAAW,EAAE,qBAAqB,EAAE,CAAC;IACrC,0EAA0E;IAE1E,MAAM,EAAE,KAAK,CAAC;CACf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Invitations.js","sourceRoot":"","sources":["../../../src/types/Invitations.ts"],"names":[],"mappings":";AAAA;;;gGAGgG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport type { Links } from \"./links\";\nimport type { Role } from \"./Role\";\n\n/**\n * Represents an invitation sent to a user to join an iTwin as a member.\n *\n * @remarks\n * Member invitations are created when external users (not in the same organization as the iTwin)\n * are invited to join an iTwin. The invited user receives an email invitation and must accept it\n * to become a member. Invitations have expiration dates and can be in various states.\n *\n * @example\n * ```typescript\n * const invitation: MemberInvitation = {\n * id: \"550e8400-e29b-41d4-a716-446655440000\",\n * email: \"external.user@othercompany.com\",\n * invitedByEmail: \"admin@mycompany.com\",\n * status: \"Pending\",\n * createdDate: \"2023-10-15T10:30:00Z\",\n * expirationDate: \"2023-11-15T10:30:00Z\",\n * roles: [\n * { id: \"viewer-role\", displayName: \"Project Viewer\", description : \"Can view project details\" }\n * ]\n * };\n * ```\n */\nexport interface MemberInvitation {\n /** Unique identifier for the invitation */\n id: string;\n /** Email address of the invited user */\n email: string;\n /** Email address of the user who sent the invitation */\n invitedByEmail: string;\n /** Current status of the invitation */\n status: MemberInvitationStatus;\n /** ISO 8601 timestamp when the invitation was created */\n createdDate: string;\n /** ISO 8601 timestamp when the invitation expires */\n expirationDate: string;\n /** Optional array of roles that will be assigned upon acceptance (excludes permissions) */\n roles?: Role[];\n}\n\n/**\n * Represents the current state of a member invitation.\n *\n * @remarks\n * Invitations start as \"Pending\" when first sent and transition to \"Accepted\"\n * when the invited user accepts the invitation.\n */\nexport type MemberInvitationStatus = \"Pending\" | \"Accepted\";\n\n/**\n * API response wrapper for multiple member invitations with pagination support.\n *\n * @remarks\n * This interface is used for API responses that return collections of member invitations,\n * such as GET /invitations operations. Includes HAL-style navigation links for pagination\n * to handle large numbers of invitations efficiently.\n *\n * @example\n * ```typescript\n * const response: MultipleMemberInvitationResponse = {\n * invitations: [\n * { id: \"inv1\", email: \"user1@external.com\", status: \"Pending\", ... },\n * { id: \"inv2\", email: \"user2@external.com\", status: \"Accepted\", ... }\n * ],\n * _links: {\n * self: { href: \"/members/invitations?$skip=0&$top=100\" },\n * next: { href: \"/members/invitations?$skip=100&$top=100\" },\n * prev: { href: \"/members/invitations?$skip=0&$top=100\" }\n * }\n * };\n * ```\n */\nexport interface MultipleMemberInvitationResponse {\n /** Array of member invitations in the current page */\n invitations: MemberInvitation[];\n /** HAL-style navigation links for pagination (first, next, prev, last) */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n _links: Links;\n}\n\n/**\n * Represents an invitation sent to a group member to join an iTwin.\n *\n * @remarks\n * Retrieves a list of iTwin group member invitations. By default, users will receive the invitations they have sent.\n * If the user is an iTwin Owner, they will receive all invitations for the iTwin.\n * Invitations have an expiration of 7 days after their creation. Once that expiration passes, the invitation will not be returned.\n *\n * @example\n * ```typescript\n * const groupInvitation: GroupMemberInvitation = {\n * id: \"550e8400-e29b-41d4-a716-446655440000\",\n * email: \"group.member@external.com\",\n * invitedByEmail: \"admin@mycompany.com\",\n * status: \"Pending\",\n * createdDate: \"2023-10-15T10:30:00Z\",\n * expirationDate: \"2023-11-15T10:30:00Z\"\n * };\n * ```\n */\nexport type GroupMemberInvitation = Omit<MemberInvitation, \"roles\">;\n\n/**\n * API response wrapper for multiple group member invitations with pagination support.\n *\n * @remarks\n * This interface is used for API responses that return collections of group member invitations.\n * Includes HAL-style navigation links for pagination to handle large numbers of group invitations efficiently.\n *\n * @example\n * ```typescript\n * const response: MultipleGroupMemberInvitationResponse = {\n * invitations: [\n * { id: \"inv1\", email: \"user1@external.com\", status: \"Pending\", ... },\n * { id: \"inv2\", email: \"user2@external.com\", status: \"Accepted\", ... }\n * ],\n * _links: {\n * self: { href: \"/groups/invitations?$skip=0&$top=100\" },\n * next: { href: \"/groups/invitations?$skip=100&$top=100\" },\n * prev: { href: \"/groups/invitations?$skip=0&$top=100\" }\n * }\n * };\n * ```\n */\nexport interface MultipleGroupMemberInvitationResponse {\n /** Array of group member invitations in the current page */\n invitations: GroupMemberInvitation[];\n /** HAL-style navigation links for pagination (first, next, prev, last) */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n _links: Links;\n}"]}
|
|
1
|
+
{"version":3,"file":"Invitations.js","sourceRoot":"","sources":["../../../src/types/Invitations.ts"],"names":[],"mappings":";AAAA;;;gGAGgG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport type { Links } from \"./links\";\nimport type { Role } from \"./Role\";\n\n/**\n * Represents an invitation sent to a user to join an iTwin as a member.\n *\n * @remarks\n * Member invitations are created when external users (not in the same organization as the iTwin)\n * are invited to join an iTwin. The invited user receives an email invitation and must accept it\n * to become a member. Invitations have expiration dates and can be in various states.\n *\n * @example\n * ```typescript\n * const invitation: MemberInvitation = {\n * id: \"550e8400-e29b-41d4-a716-446655440000\",\n * email: \"external.user@othercompany.com\",\n * invitedByEmail: \"admin@mycompany.com\",\n * status: \"Pending\",\n * createdDate: \"2023-10-15T10:30:00Z\",\n * expirationDate: \"2023-11-15T10:30:00Z\",\n * roles: [\n * { id: \"viewer-role\", displayName: \"Project Viewer\", description : \"Can view project details\" }\n * ]\n * };\n * ```\n */\nexport interface MemberInvitation {\n /** Unique identifier for the invitation */\n id: string;\n /** Email address of the invited user */\n email: string;\n /** Email address of the user who sent the invitation */\n invitedByEmail: string;\n /** Current status of the invitation */\n status: MemberInvitationStatus;\n /** ISO 8601 timestamp when the invitation was created */\n createdDate: string;\n /** ISO 8601 timestamp when the invitation expires */\n expirationDate: string;\n /** Optional array of roles that will be assigned upon acceptance (excludes permissions) */\n roles?: Role[];\n}\n\n/**\n * Represents the current state of a member invitation.\n *\n * @remarks\n * Invitations start as \"Pending\" when first sent and transition to \"Accepted\"\n * when the invited user accepts the invitation.\n */\nexport type MemberInvitationStatus = \"Pending\" | \"Accepted\";\n\n/**\n * API response wrapper for multiple member invitations with pagination support.\n *\n * @remarks\n * This interface is used for API responses that return collections of member invitations,\n * such as GET /invitations operations. Includes HAL-style navigation links for pagination\n * to handle large numbers of invitations efficiently.\n *\n * @example\n * ```typescript\n * const response: MultipleMemberInvitationResponse = {\n * invitations: [\n * { id: \"inv1\", email: \"user1@external.com\", status: \"Pending\", ... },\n * { id: \"inv2\", email: \"user2@external.com\", status: \"Accepted\", ... }\n * ],\n * _links: {\n * self: { href: \"/members/invitations?$skip=0&$top=100\" },\n * next: { href: \"/members/invitations?$skip=100&$top=100\" },\n * prev: { href: \"/members/invitations?$skip=0&$top=100\" }\n * }\n * };\n * ```\n */\nexport interface MultipleMemberInvitationResponse {\n /** Array of member invitations in the current page */\n invitations: MemberInvitation[];\n /** HAL-style navigation links for pagination (first, next, prev, last) */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n _links: Links;\n}\n\n/**\n * API response wrapper for a member invitation.\n *\n * @remarks\n * This interface is used for API responses that a single member invitation,\n * such as GET /invitations operations.\n *\n * @example\n * ```typescript\n * const response: MultipleMemberInvitationResponse = {\n * invitation: {{ id: \"inv1\", email: \"user1@external.com\", status: \"Pending\", ... }} ,\n * };\n * ```\n */\nexport interface SingleMemberInvitationResponse {\n /** The member invitation */\n invitation: MemberInvitation;\n}\n\n/**\n * Represents an invitation sent to a group member to join an iTwin.\n *\n * @remarks\n * Retrieves a list of iTwin group member invitations. By default, users will receive the invitations they have sent.\n * If the user is an iTwin Owner, they will receive all invitations for the iTwin.\n * Invitations have an expiration of 7 days after their creation. Once that expiration passes, the invitation will not be returned.\n *\n * @example\n * ```typescript\n * const groupInvitation: GroupMemberInvitation = {\n * id: \"550e8400-e29b-41d4-a716-446655440000\",\n * email: \"group.member@external.com\",\n * invitedByEmail: \"admin@mycompany.com\",\n * status: \"Pending\",\n * createdDate: \"2023-10-15T10:30:00Z\",\n * expirationDate: \"2023-11-15T10:30:00Z\"\n * };\n * ```\n */\nexport type GroupMemberInvitation = Omit<MemberInvitation, \"roles\">;\n\n/**\n * API response wrapper for multiple group member invitations with pagination support.\n *\n * @remarks\n * This interface is used for API responses that return collections of group member invitations.\n * Includes HAL-style navigation links for pagination to handle large numbers of group invitations efficiently.\n *\n * @example\n * ```typescript\n * const response: MultipleGroupMemberInvitationResponse = {\n * invitations: [\n * { id: \"inv1\", email: \"user1@external.com\", status: \"Pending\", ... },\n * { id: \"inv2\", email: \"user2@external.com\", status: \"Accepted\", ... }\n * ],\n * _links: {\n * self: { href: \"/groups/invitations?$skip=0&$top=100\" },\n * next: { href: \"/groups/invitations?$skip=100&$top=100\" },\n * prev: { href: \"/groups/invitations?$skip=0&$top=100\" }\n * }\n * };\n * ```\n */\nexport interface MultipleGroupMemberInvitationResponse {\n /** Array of group member invitations in the current page */\n invitations: GroupMemberInvitation[];\n /** HAL-style navigation links for pagination (first, next, prev, last) */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n _links: Links;\n}"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { AccessToken } from "@itwin/core-bentley";
|
|
2
|
-
import type { BentleyAPIResponse } from "../types/CommonApiTypes";
|
|
3
|
-
import type { Group,
|
|
2
|
+
import type { BentleyAPIResponse, ODataQueryParams } from "../types/CommonApiTypes";
|
|
3
|
+
import type { Group, GroupsResponseWithConditionalLinks, SingleGroupResponse } from "../types/Groups";
|
|
4
4
|
export interface IGroupsClient {
|
|
5
5
|
/** Retrieves a list of groups the for a specified iTwin */
|
|
6
|
-
getITwinGroups(accessToken: AccessToken, iTwinId: string): Promise<BentleyAPIResponse<
|
|
6
|
+
getITwinGroups<T extends Pick<ODataQueryParams, "top" | "skip"> | undefined = undefined>(accessToken: AccessToken, iTwinId: string, arg?: T): Promise<BentleyAPIResponse<GroupsResponseWithConditionalLinks<T>>>;
|
|
7
7
|
/** Retrieves a group for a specified iTwin */
|
|
8
8
|
getITwinGroup(accessToken: AccessToken, iTwinId: string, groupId: string): Promise<BentleyAPIResponse<SingleGroupResponse>>;
|
|
9
9
|
/** Creates a new iTwin group */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupClient.d.ts","sourceRoot":"","sources":["../../../src/accessControlClientInterfaces/GroupClient.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"GroupClient.d.ts","sourceRoot":"","sources":["../../../src/accessControlClientInterfaces/GroupClient.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,KAAK,EAAE,KAAK,EAAE,kCAAkC,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtG,MAAM,WAAW,aAAa;IAC5B,2DAA2D;IAC3D,cAAc,CAAC,CAAC,SAAS,IAAI,CAAC,gBAAgB,EAAE,KAAK,GAAG,MAAM,CAAC,GAAG,SAAS,GAAG,SAAS,EACrF,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,GAAG,CAAC,EAAE,CAAC,GACN,OAAO,CAAC,kBAAkB,CAAC,kCAAkC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEtE,8CAA8C;IAC9C,aAAa,CACX,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAEpD,gCAAgC;IAChC,gBAAgB,CACd,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CAAC,GACzC,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAEpD,sCAAsC;IACtC,gBAAgB,CACd,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC,CAAC;IAE1C,sCAAsC;IACtC,gBAAgB,CACd,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CAAC,GAAG;QAAE,OAAO,EAAE,MAAM,EAAE,CAAC;QAAC,SAAS,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,GAC/F,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC,CAAC;CACrD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupClient.js","sourceRoot":"","sources":["../../../src/accessControlClientInterfaces/GroupClient.ts"],"names":[],"mappings":"AAAA;;;gGAGgG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport type { AccessToken } from \"@itwin/core-bentley\";\nimport type { BentleyAPIResponse } from \"../types/CommonApiTypes\";\nimport type { Group,
|
|
1
|
+
{"version":3,"file":"GroupClient.js","sourceRoot":"","sources":["../../../src/accessControlClientInterfaces/GroupClient.ts"],"names":[],"mappings":"AAAA;;;gGAGgG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport type { AccessToken } from \"@itwin/core-bentley\";\nimport type { BentleyAPIResponse, ODataQueryParams } from \"../types/CommonApiTypes\";\nimport type { Group, GroupsResponseWithConditionalLinks, SingleGroupResponse } from \"../types/Groups\";\n\nexport interface IGroupsClient {\n /** Retrieves a list of groups the for a specified iTwin */\n getITwinGroups<T extends Pick<ODataQueryParams, \"top\" | \"skip\"> | undefined = undefined>(\n accessToken: AccessToken,\n iTwinId: string,\n arg?: T\n ): Promise<BentleyAPIResponse<GroupsResponseWithConditionalLinks<T>>>;\n\n /** Retrieves a group for a specified iTwin */\n getITwinGroup(\n accessToken: AccessToken,\n iTwinId: string,\n groupId: string\n ): Promise<BentleyAPIResponse<SingleGroupResponse>>;\n\n /** Creates a new iTwin group */\n createITwinGroup(\n accessToken: AccessToken,\n iTwinId: string,\n group: Pick<Group, \"name\" | \"description\">\n ): Promise<BentleyAPIResponse<SingleGroupResponse>>;\n\n /** Removes an existing iTwin group */\n deleteITwinGroup(\n accessToken: AccessToken,\n iTwinId: string,\n groupId: string\n ): Promise<BentleyAPIResponse<undefined>>;\n\n /** Updates an existing iTwin group */\n updateITwinGroup(\n accessToken: AccessToken,\n iTwinId: string,\n groupId: string,\n group: Partial<Pick<Group, \"name\" | \"description\"> & { members: string[]; imsGroups: string[] }>\n ): Promise<BentleyAPIResponse<SingleGroupResponse>>;\n}"]}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import type { AccessToken } from "@itwin/core-bentley";
|
|
2
2
|
import type { BentleyAPIResponse, ODataQueryParams } from "../types/CommonApiTypes";
|
|
3
|
-
import type { MultipleMemberInvitationResponse } from "../types/Invitations";
|
|
3
|
+
import type { MultipleMemberInvitationResponse, SingleMemberInvitationResponse } from "../types/Invitations";
|
|
4
4
|
export interface IMemberInvitationsClient {
|
|
5
5
|
/** Retrieves a list of member invitations. */
|
|
6
6
|
queryITwinMemberInvitations(accessToken: AccessToken, iTwinId: string, arg?: Pick<ODataQueryParams, "top" | "skip">): Promise<BentleyAPIResponse<MultipleMemberInvitationResponse>>;
|
|
7
|
+
/** Retrieves a member invitations by invite id. */
|
|
8
|
+
getITwinMemberInvitation(accessToken: AccessToken, iTwinId: string, invitationId: string): Promise<BentleyAPIResponse<SingleMemberInvitationResponse>>;
|
|
7
9
|
/** Removes an existing member invitation. */
|
|
8
10
|
deleteITwinMemberInvitation(accessToken: AccessToken, iTwinId: string, invitationId: string): Promise<BentleyAPIResponse<undefined>>;
|
|
11
|
+
/** Accepts an existing member invitation. */
|
|
12
|
+
acceptITwinMemberInvitation(accessToken: AccessToken, iTwinId: string, invitationId: string): Promise<BentleyAPIResponse<undefined>>;
|
|
9
13
|
}
|
|
10
14
|
//# sourceMappingURL=MemberInvitationsClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MemberInvitationsClient.d.ts","sourceRoot":"","sources":["../../../src/accessControlClientInterfaces/MemberInvitationsClient.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"MemberInvitationsClient.d.ts","sourceRoot":"","sources":["../../../src/accessControlClientInterfaces/MemberInvitationsClient.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,KAAK,EAAE,gCAAgC,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AAE7G,MAAM,WAAW,wBAAwB;IACvC,8CAA8C;IAC9C,2BAA2B,CACzB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,GAAG,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,KAAK,GAAG,MAAM,CAAC,GAC3C,OAAO,CAAC,kBAAkB,CAAC,gCAAgC,CAAC,CAAC,CAAC;IAEjE,mDAAmD;IACnD,wBAAwB,CACtB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,kBAAkB,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAE/D,6CAA6C;IAC7C,2BAA2B,CACzB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC,CAAC;IAE1C,6CAA6C;IAC7C,2BAA2B,CACzB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC,CAAC;CAC3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MemberInvitationsClient.js","sourceRoot":"","sources":["../../../src/accessControlClientInterfaces/MemberInvitationsClient.ts"],"names":[],"mappings":"AAAA;;;gGAGgG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport type { AccessToken } from \"@itwin/core-bentley\";\nimport type { BentleyAPIResponse, ODataQueryParams } from \"../types/CommonApiTypes\";\nimport type { MultipleMemberInvitationResponse } from \"../types/Invitations\";\n\nexport interface IMemberInvitationsClient {\n /** Retrieves a list of member invitations. */\n queryITwinMemberInvitations(\n accessToken: AccessToken,\n iTwinId: string,\n arg?: Pick<ODataQueryParams, \"top\" | \"skip\">\n ): Promise<BentleyAPIResponse<MultipleMemberInvitationResponse>>;\n\n /** Removes an existing member invitation. */\n deleteITwinMemberInvitation(\n accessToken: AccessToken,\n iTwinId: string,\n invitationId: string\n ): Promise<BentleyAPIResponse<undefined>>;\n}"]}
|
|
1
|
+
{"version":3,"file":"MemberInvitationsClient.js","sourceRoot":"","sources":["../../../src/accessControlClientInterfaces/MemberInvitationsClient.ts"],"names":[],"mappings":"AAAA;;;gGAGgG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport type { AccessToken } from \"@itwin/core-bentley\";\nimport type { BentleyAPIResponse, ODataQueryParams } from \"../types/CommonApiTypes\";\nimport type { MultipleMemberInvitationResponse, SingleMemberInvitationResponse } from \"../types/Invitations\";\n\nexport interface IMemberInvitationsClient {\n /** Retrieves a list of member invitations. */\n queryITwinMemberInvitations(\n accessToken: AccessToken,\n iTwinId: string,\n arg?: Pick<ODataQueryParams, \"top\" | \"skip\">\n ): Promise<BentleyAPIResponse<MultipleMemberInvitationResponse>>;\n\n /** Retrieves a member invitations by invite id. */\n getITwinMemberInvitation(\n accessToken: AccessToken,\n iTwinId: string,\n invitationId: string\n ): Promise<BentleyAPIResponse<SingleMemberInvitationResponse>>;\n\n /** Removes an existing member invitation. */\n deleteITwinMemberInvitation(\n accessToken: AccessToken,\n iTwinId: string,\n invitationId: string\n ): Promise<BentleyAPIResponse<undefined>>;\n\n /** Accepts an existing member invitation. */\n acceptITwinMemberInvitation(\n accessToken: AccessToken,\n iTwinId: string,\n invitationId: string\n ): Promise<BentleyAPIResponse<undefined>>;\n}"]}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { AccessToken } from "@itwin/core-bentley";
|
|
5
5
|
import type { IGroupsClient } from "../accessControlClientInterfaces/GroupClient";
|
|
6
|
-
import type { BentleyAPIResponse } from "../types/CommonApiTypes";
|
|
7
|
-
import type { Group,
|
|
6
|
+
import type { BentleyAPIResponse, ODataQueryParams } from "../types/CommonApiTypes";
|
|
7
|
+
import type { Group, GroupsResponseWithConditionalLinks, SingleGroupResponse } from "../types/Groups";
|
|
8
8
|
import { BaseClient } from "./BaseClient";
|
|
9
9
|
/** Client API to perform iTwin group operations.
|
|
10
10
|
*/
|
|
@@ -16,9 +16,9 @@ export declare class GroupsClient extends BaseClient implements IGroupsClient {
|
|
|
16
16
|
/** Retrieves a list of available user roles that are defined for a specified iTwin
|
|
17
17
|
* @param accessToken The client access token string
|
|
18
18
|
* @param iTwinId The id of the iTwin
|
|
19
|
-
* @returns
|
|
19
|
+
* @returns MultipleGroupsResponse
|
|
20
20
|
*/
|
|
21
|
-
getITwinGroups(accessToken: AccessToken, iTwinId: string): Promise<BentleyAPIResponse<
|
|
21
|
+
getITwinGroups<T extends Pick<ODataQueryParams, "top" | "skip"> | undefined = undefined>(accessToken: AccessToken, iTwinId: string, arg?: T): Promise<BentleyAPIResponse<GroupsResponseWithConditionalLinks<T>>>;
|
|
22
22
|
/** Retrieves the specified role for the specified iTwin
|
|
23
23
|
* @param accessToken The client access token string
|
|
24
24
|
* @param iTwinId The id of the iTwin
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupsClient.d.ts","sourceRoot":"","sources":["../../../src/subClients/GroupsClient.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"GroupsClient.d.ts","sourceRoot":"","sources":["../../../src/subClients/GroupsClient.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,KAAK,EAAE,KAAK,EAAE,kCAAkC,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtG,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;GACG;AACH,qBAAa,YAAa,SAAQ,UAAW,YAAW,aAAa;IACnE;;OAEG;gBACgB,GAAG,CAAC,EAAE,MAAM;IAI/B;;;;QAII;IACS,cAAc,CAAC,CAAC,SAAS,IAAI,CAAC,gBAAgB,EAAE,KAAK,GAAG,MAAM,CAAC,GAAG,SAAS,GAAG,SAAS,EAClG,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,GAAG,CAAC,EAAE,CAAC,GACN,OAAO,CAAC,kBAAkB,CAAC,kCAAkC,CAAC,CAAC,CAAC,CAAC,CAAC;IASrE;;;;QAII;IACS,aAAa,CACxB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;IAKnD;;;;;QAKI;IACS,gBAAgB,CAC3B,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,IAAI,CAAE,KAAK,EAAE,MAAM,GAAG,aAAa,CAAC,GAC1C,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;IAKnD;;;;;QAKI;IACS,gBAAgB,CAC3B,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAKzC;;;;;;QAMI;IACS,gBAAgB,CAC3B,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CAAC,GAAG;QAAE,OAAO,EAAE,MAAM,EAAE,CAAC;QAAC,SAAS,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,GAC/F,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;CAIpD"}
|
|
@@ -18,10 +18,13 @@ export class GroupsClient extends BaseClient {
|
|
|
18
18
|
/** Retrieves a list of available user roles that are defined for a specified iTwin
|
|
19
19
|
* @param accessToken The client access token string
|
|
20
20
|
* @param iTwinId The id of the iTwin
|
|
21
|
-
* @returns
|
|
21
|
+
* @returns MultipleGroupsResponse
|
|
22
22
|
*/
|
|
23
|
-
async getITwinGroups(accessToken, iTwinId) {
|
|
24
|
-
|
|
23
|
+
async getITwinGroups(accessToken, iTwinId, arg) {
|
|
24
|
+
let url = `${this._baseUrl}/${iTwinId}/groups`;
|
|
25
|
+
if (arg) {
|
|
26
|
+
url += `?${this.getQueryString(GroupsClient.paginationParamMapping, { top: arg.top, skip: arg.skip })}`;
|
|
27
|
+
}
|
|
25
28
|
return this.sendGenericAPIRequest(accessToken, "GET", url);
|
|
26
29
|
}
|
|
27
30
|
/** Retrieves the specified role for the specified iTwin
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupsClient.js","sourceRoot":"","sources":["../../../src/subClients/GroupsClient.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAMH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;GACG;AACH,MAAM,OAAO,YAAa,SAAQ,UAAU;IAC1C;;OAEG;IACH,YAAmB,GAAY;QAC7B,KAAK,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;IAED;;;;QAII;IACG,KAAK,CAAC,cAAc,CACzB,WAAwB,EACxB,OAAe;
|
|
1
|
+
{"version":3,"file":"GroupsClient.js","sourceRoot":"","sources":["../../../src/subClients/GroupsClient.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAMH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;GACG;AACH,MAAM,OAAO,YAAa,SAAQ,UAAU;IAC1C;;OAEG;IACH,YAAmB,GAAY;QAC7B,KAAK,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;IAED;;;;QAII;IACG,KAAK,CAAC,cAAc,CACzB,WAAwB,EACxB,OAAe,EACf,GAAO;QAEP,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC,QAAQ,IAAI,OAAO,SAAS,CAAC;QAE/C,IAAI,GAAG,EAAE,CAAC;YACR,GAAG,IAAI,IAAI,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,sBAAsB,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;QAC1G,CAAC;QACD,OAAO,IAAI,CAAC,qBAAqB,CAAC,WAAW,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IAC7D,CAAC;IAED;;;;QAII;IACG,KAAK,CAAC,aAAa,CACxB,WAAwB,EACxB,OAAe,EACf,OAAe;QAEf,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,QAAQ,IAAI,OAAO,WAAW,OAAO,EAAE,CAAC;QAC5D,OAAO,IAAI,CAAC,qBAAqB,CAAC,WAAW,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;QAKI;IACG,KAAK,CAAC,gBAAgB,CAC3B,WAAwB,EACxB,OAAe,EACf,KAA2C;QAE3C,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,QAAQ,IAAI,OAAO,SAAS,CAAC;QACjD,OAAO,IAAI,CAAC,qBAAqB,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IACrE,CAAC;IAED;;;;;QAKI;IACG,KAAK,CAAC,gBAAgB,CAC3B,WAAwB,EACxB,OAAe,EACf,OAAe;QAEf,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,QAAQ,IAAI,OAAO,WAAW,OAAO,EAAE,CAAC;QAC5D,OAAO,IAAI,CAAC,qBAAqB,CAAC,WAAW,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC;IAChE,CAAC;IAED;;;;;;QAMI;IACG,KAAK,CAAC,gBAAgB,CAC3B,WAAwB,EACxB,OAAe,EACf,OAAe,EACf,KAAgG;QAEhG,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,QAAQ,IAAI,OAAO,WAAW,OAAO,EAAE,CAAC;QAC5D,OAAO,IAAI,CAAC,qBAAqB,CAAC,WAAW,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IACtE,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module AccessControlClient\n */\n\nimport type { AccessToken } from \"@itwin/core-bentley\";\nimport type { IGroupsClient } from \"../accessControlClientInterfaces/GroupClient\";\nimport type { BentleyAPIResponse, ODataQueryParams } from \"../types/CommonApiTypes\";\nimport type { Group, GroupsResponseWithConditionalLinks, SingleGroupResponse } from \"../types/Groups\";\nimport { BaseClient } from \"./BaseClient\";\n\n/** Client API to perform iTwin group operations.\n */\nexport class GroupsClient extends BaseClient implements IGroupsClient{\n /** Create a new GroupsClient instance\n * @param url Optional base URL for the access control service. If not provided, defaults to base url.\n */\n public constructor(url?: string) {\n super(url);\n }\n\n /** Retrieves a list of available user roles that are defined for a specified iTwin\n * @param accessToken The client access token string\n * @param iTwinId The id of the iTwin\n * @returns MultipleGroupsResponse\n */\n public async getITwinGroups<T extends Pick<ODataQueryParams, \"top\" | \"skip\"> | undefined = undefined>(\n accessToken: AccessToken,\n iTwinId: string,\n arg?: T\n ): Promise<BentleyAPIResponse<GroupsResponseWithConditionalLinks<T>>>{\n let url = `${this._baseUrl}/${iTwinId}/groups`;\n\n if (arg) {\n url += `?${this.getQueryString(GroupsClient.paginationParamMapping, { top: arg.top, skip: arg.skip })}`;\n }\n return this.sendGenericAPIRequest(accessToken, \"GET\", url);\n }\n\n /** Retrieves the specified role for the specified iTwin\n * @param accessToken The client access token string\n * @param iTwinId The id of the iTwin\n * @returns Group\n */\n public async getITwinGroup(\n accessToken: AccessToken,\n iTwinId: string,\n groupId: string,\n ): Promise<BentleyAPIResponse<SingleGroupResponse>>{\n const url = `${this._baseUrl}/${iTwinId}/groups/${groupId}`;\n return this.sendGenericAPIRequest(accessToken, \"GET\", url);\n }\n\n /** Creates a new iTwin group\n * @param accessToken The client access token string\n * @param iTwinId The id of the iTwin\n * @param group The group to be created\n * @returns Group\n */\n public async createITwinGroup(\n accessToken: AccessToken,\n iTwinId: string,\n group: Pick< Group, \"name\" | \"description\">\n ): Promise<BentleyAPIResponse<SingleGroupResponse>>{\n const url = `${this._baseUrl}/${iTwinId}/groups`;\n return this.sendGenericAPIRequest(accessToken, \"POST\", url, group);\n }\n\n /** Delete the specified iTwin group\n * @param accessToken The client access token string\n * @param iTwinId The id of the iTwin\n * @param groupId The id of the group to remove\n * @returns No Content\n */\n public async deleteITwinGroup(\n accessToken: AccessToken,\n iTwinId: string,\n groupId: string,\n ): Promise<BentleyAPIResponse<undefined>>{\n const url = `${this._baseUrl}/${iTwinId}/groups/${groupId}`;\n return this.sendGenericAPIRequest(accessToken, \"DELETE\", url);\n }\n\n /** Update the specified iTwin group\n * @param accessToken The client access token string\n * @param iTwinId The id of the iTwin\n * @param groupId The id of the role to update\n * @param group The updated group\n * @returns Group that was updated\n */\n public async updateITwinGroup(\n accessToken: AccessToken,\n iTwinId: string,\n groupId: string,\n group: Partial<Pick<Group, \"name\" | \"description\"> & { members: string[]; imsGroups: string[] }>\n ): Promise<BentleyAPIResponse<SingleGroupResponse>>{\n const url = `${this._baseUrl}/${iTwinId}/groups/${groupId}`;\n return this.sendGenericAPIRequest(accessToken, \"PATCH\", url, group);\n }\n}\n"]}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import type { AccessToken } from "@itwin/core-bentley";
|
|
5
5
|
import type { IMemberInvitationsClient } from "../accessControlClientInterfaces/MemberInvitationsClient";
|
|
6
6
|
import type { BentleyAPIResponse, ODataQueryParams } from "../types/CommonApiTypes";
|
|
7
|
-
import type { MultipleMemberInvitationResponse } from "../types/Invitations";
|
|
7
|
+
import type { MultipleMemberInvitationResponse, SingleMemberInvitationResponse } from "../types/Invitations";
|
|
8
8
|
import { BaseClient } from "./BaseClient";
|
|
9
9
|
/** Client API to perform iTwin member invitation operations.
|
|
10
10
|
*/
|
|
@@ -26,5 +26,22 @@ export declare class MemberInvitationsClient extends BaseClient implements IMemb
|
|
|
26
26
|
* @returns No Content
|
|
27
27
|
*/
|
|
28
28
|
deleteITwinMemberInvitation(accessToken: AccessToken, iTwinId: string, invitationId: string): Promise<BentleyAPIResponse<undefined>>;
|
|
29
|
+
/** Accepts a member invitation.
|
|
30
|
+
* @param accessToken The client access token string
|
|
31
|
+
* @param iTwinId The id of the iTwin
|
|
32
|
+
* @param invitationId The id of the invitation id
|
|
33
|
+
* @returns No Content
|
|
34
|
+
* @beta
|
|
35
|
+
* @remarks On success, the invited user is added as an iTwin member with the roles from all pending invitations for that user. After acceptance, all of that user’s pending invitations for the iTwin are consumed and can no longer be accessed.
|
|
36
|
+
* If the invited user is already a member of the iTwin, the request is treated as a success. Only the invited user can accept this invitation through this API. The invited user must already exist as a member in IMS.
|
|
37
|
+
*/
|
|
38
|
+
acceptITwinMemberInvitation(accessToken: AccessToken, iTwinId: string, invitationId: string): Promise<BentleyAPIResponse<undefined>>;
|
|
39
|
+
/** Deletes a member invitations.
|
|
40
|
+
* @param accessToken The client access token string
|
|
41
|
+
* @param iTwinId The id of the iTwin
|
|
42
|
+
* @param invitationId The id of the invitation id
|
|
43
|
+
* @returns A member invitation or error object
|
|
44
|
+
*/
|
|
45
|
+
getITwinMemberInvitation(accessToken: AccessToken, iTwinId: string, invitationId: string): Promise<BentleyAPIResponse<SingleMemberInvitationResponse>>;
|
|
29
46
|
}
|
|
30
47
|
//# sourceMappingURL=MemberInvitationsClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MemberInvitationsClient.d.ts","sourceRoot":"","sources":["../../../src/subClients/MemberInvitationsClient.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0DAA0D,CAAC;AACzG,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"MemberInvitationsClient.d.ts","sourceRoot":"","sources":["../../../src/subClients/MemberInvitationsClient.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0DAA0D,CAAC;AACzG,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,KAAK,EAAE,gCAAgC,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AAC7G,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;GACG;AACH,qBAAa,uBACX,SAAQ,UACR,YAAW,wBAAwB;IACnC;;OAEG;gBACgB,GAAG,CAAC,EAAE,MAAM;IAI/B;;;;OAIG;IACU,2BAA2B,CACtC,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,GAAG,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,KAAK,GAAG,MAAM,CAAC,GAC3C,OAAO,CAAC,kBAAkB,CAAC,gCAAgC,CAAC,CAAC;IAahE;;;;;OAKG;IACU,2BAA2B,CACtC,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAKzC;;;;;;;;OAQG;IACU,2BAA2B,CACtC,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAKvC;;;;;KAKC;IACU,wBAAwB,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,8BAA8B,CAAC,CAAC;CAKpK"}
|
|
@@ -34,5 +34,28 @@ export class MemberInvitationsClient extends BaseClient {
|
|
|
34
34
|
const url = `${this._baseUrl}/${iTwinId}/members/invitations/${invitationId}`;
|
|
35
35
|
return this.sendGenericAPIRequest(accessToken, "DELETE", url);
|
|
36
36
|
}
|
|
37
|
+
/** Accepts a member invitation.
|
|
38
|
+
* @param accessToken The client access token string
|
|
39
|
+
* @param iTwinId The id of the iTwin
|
|
40
|
+
* @param invitationId The id of the invitation id
|
|
41
|
+
* @returns No Content
|
|
42
|
+
* @beta
|
|
43
|
+
* @remarks On success, the invited user is added as an iTwin member with the roles from all pending invitations for that user. After acceptance, all of that user’s pending invitations for the iTwin are consumed and can no longer be accessed.
|
|
44
|
+
* If the invited user is already a member of the iTwin, the request is treated as a success. Only the invited user can accept this invitation through this API. The invited user must already exist as a member in IMS.
|
|
45
|
+
*/
|
|
46
|
+
async acceptITwinMemberInvitation(accessToken, iTwinId, invitationId) {
|
|
47
|
+
const url = `${this._baseUrl}/${iTwinId}/members/invitations/${invitationId}/accept`;
|
|
48
|
+
return this.sendGenericAPIRequest(accessToken, "POST", url);
|
|
49
|
+
}
|
|
50
|
+
/** Deletes a member invitations.
|
|
51
|
+
* @param accessToken The client access token string
|
|
52
|
+
* @param iTwinId The id of the iTwin
|
|
53
|
+
* @param invitationId The id of the invitation id
|
|
54
|
+
* @returns A member invitation or error object
|
|
55
|
+
*/
|
|
56
|
+
async getITwinMemberInvitation(accessToken, iTwinId, invitationId) {
|
|
57
|
+
const url = `${this._baseUrl}/${iTwinId}/members/invitations/${invitationId}`;
|
|
58
|
+
return this.sendGenericAPIRequest(accessToken, "GET", url);
|
|
59
|
+
}
|
|
37
60
|
}
|
|
38
61
|
//# sourceMappingURL=MemberInvitationsClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MemberInvitationsClient.js","sourceRoot":"","sources":["../../../src/subClients/MemberInvitationsClient.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAMH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;GACG;AACH,MAAM,OAAO,uBACX,SAAQ,UAAU;IAElB;;OAEG;IACH,YAAmB,GAAY;QAC7B,KAAK,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,2BAA2B,CACtC,WAAwB,EACxB,OAAe,EACf,GAA4C;QAE5C,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,QAAQ,IAAI,OAAO,uBACrC,GAAG,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,cAAc,CAAC,uBAAuB,CAAC,sBAAsB,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EACtH,EAAE,CAAC;QAEH,OAAO,IAAI,CAAC,qBAAqB,CAC/B,WAAW,EACX,KAAK,EACL,GAAG,EACH,SAAS,CACV,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,2BAA2B,CACtC,WAAwB,EACxB,OAAe,EACf,YAAoB;QAEpB,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,QAAQ,IAAI,OAAO,wBAAwB,YAAY,EAAE,CAAC;QAC9E,OAAO,IAAI,CAAC,qBAAqB,CAAC,WAAW,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC;IAChE,CAAC;
|
|
1
|
+
{"version":3,"file":"MemberInvitationsClient.js","sourceRoot":"","sources":["../../../src/subClients/MemberInvitationsClient.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAMH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;GACG;AACH,MAAM,OAAO,uBACX,SAAQ,UAAU;IAElB;;OAEG;IACH,YAAmB,GAAY;QAC7B,KAAK,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,2BAA2B,CACtC,WAAwB,EACxB,OAAe,EACf,GAA4C;QAE5C,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,QAAQ,IAAI,OAAO,uBACrC,GAAG,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,cAAc,CAAC,uBAAuB,CAAC,sBAAsB,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EACtH,EAAE,CAAC;QAEH,OAAO,IAAI,CAAC,qBAAqB,CAC/B,WAAW,EACX,KAAK,EACL,GAAG,EACH,SAAS,CACV,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,2BAA2B,CACtC,WAAwB,EACxB,OAAe,EACf,YAAoB;QAEpB,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,QAAQ,IAAI,OAAO,wBAAwB,YAAY,EAAE,CAAC;QAC9E,OAAO,IAAI,CAAC,qBAAqB,CAAC,WAAW,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC;IAChE,CAAC;IAED;;;;;;;;OAQG;IACI,KAAK,CAAC,2BAA2B,CACtC,WAAwB,EACxB,OAAe,EACf,YAAoB;QAEpB,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,QAAQ,IAAI,OAAO,wBAAwB,YAAY,SAAS,CAAC;QACrF,OAAO,IAAI,CAAC,qBAAqB,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9D,CAAC;IAEC;;;;;KAKC;IACI,KAAK,CAAC,wBAAwB,CAAC,WAAwB,EAAE,OAAe,EAAE,YAAoB;QACnG,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,QAAQ,IAAI,OAAO,wBAAwB,YAAY,EAAE,CAAC;QAC9E,OAAO,IAAI,CAAC,qBAAqB,CAAC,WAAW,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IAC7D,CAAC;CAEF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module AccessControlClient\n */\n\nimport type { AccessToken } from \"@itwin/core-bentley\";\nimport type { IMemberInvitationsClient } from \"../accessControlClientInterfaces/MemberInvitationsClient\";\nimport type { BentleyAPIResponse, ODataQueryParams } from \"../types/CommonApiTypes\";\nimport type { MultipleMemberInvitationResponse, SingleMemberInvitationResponse } from \"../types/Invitations\";\nimport { BaseClient } from \"./BaseClient\";\n\n/** Client API to perform iTwin member invitation operations.\n */\nexport class MemberInvitationsClient\n extends BaseClient\n implements IMemberInvitationsClient {\n /** Create a new MemberInvitationsClient instance\n * @param url Optional base URL for the access control service. If not provided, defaults to base url.\n */\n public constructor(url?: string) {\n super(url);\n }\n\n /** Retrieves a list of iTwin member invitations.\n * @param accessToken The client access token string\n * @param iTwinId The id of the iTwin\n * @returns Array of member invitations\n */\n public async queryITwinMemberInvitations(\n accessToken: AccessToken,\n iTwinId: string,\n arg?: Pick<ODataQueryParams, \"top\" | \"skip\">\n ): Promise<BentleyAPIResponse<MultipleMemberInvitationResponse>> {\n const url = `${this._baseUrl}/${iTwinId}/members/invitations${\n arg ? `?${this.getQueryString(MemberInvitationsClient.paginationParamMapping, { top: arg.top, skip: arg.skip })}` : ''\n }`;\n\n return this.sendGenericAPIRequest(\n accessToken,\n \"GET\",\n url,\n undefined,\n );\n }\n\n /** Deletes a member invitations.\n * @param accessToken The client access token string\n * @param iTwinId The id of the iTwin\n * @param invitationId The id of the invitation id\n * @returns No Content\n */\n public async deleteITwinMemberInvitation(\n accessToken: AccessToken,\n iTwinId: string,\n invitationId: string\n ): Promise<BentleyAPIResponse<undefined>> {\n const url = `${this._baseUrl}/${iTwinId}/members/invitations/${invitationId}`;\n return this.sendGenericAPIRequest(accessToken, \"DELETE\", url);\n }\n\n /** Accepts a member invitation.\n * @param accessToken The client access token string\n * @param iTwinId The id of the iTwin\n * @param invitationId The id of the invitation id\n * @returns No Content\n * @beta\n * @remarks On success, the invited user is added as an iTwin member with the roles from all pending invitations for that user. After acceptance, all of that user’s pending invitations for the iTwin are consumed and can no longer be accessed.\n * If the invited user is already a member of the iTwin, the request is treated as a success. Only the invited user can accept this invitation through this API. The invited user must already exist as a member in IMS.\n */\n public async acceptITwinMemberInvitation(\n accessToken: AccessToken,\n iTwinId: string,\n invitationId: string\n ): Promise<BentleyAPIResponse<undefined>> {\n const url = `${this._baseUrl}/${iTwinId}/members/invitations/${invitationId}/accept`;\n return this.sendGenericAPIRequest(accessToken, \"POST\", url);\n }\n\n /** Deletes a member invitations.\n * @param accessToken The client access token string\n * @param iTwinId The id of the iTwin\n * @param invitationId The id of the invitation id\n * @returns A member invitation or error object\n */\n public async getITwinMemberInvitation(accessToken: AccessToken, iTwinId: string, invitationId: string): Promise<BentleyAPIResponse<SingleMemberInvitationResponse>> {\n const url = `${this._baseUrl}/${iTwinId}/members/invitations/${invitationId}`;\n return this.sendGenericAPIRequest(accessToken, \"GET\", url);\n }\n\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Links } from "./links";
|
|
1
2
|
import type { GroupUser } from "./Members";
|
|
2
3
|
/**
|
|
3
4
|
* Represents an access control group within an iTwin.
|
|
@@ -49,6 +50,22 @@ export interface SingleGroupResponse {
|
|
|
49
50
|
/** The group data returned by the API */
|
|
50
51
|
group: Group;
|
|
51
52
|
}
|
|
53
|
+
/** Utility type to determine if any pagination parameters are present */
|
|
54
|
+
export type HasAnyPaginationParam<T> = T extends {
|
|
55
|
+
top?: unknown;
|
|
56
|
+
} | {
|
|
57
|
+
skip?: unknown;
|
|
58
|
+
} ? true : false;
|
|
59
|
+
/**
|
|
60
|
+
* API response wrapper for multiple groups operations.
|
|
61
|
+
* Conditional inclusion of HAL-style links based on pagination parameters.
|
|
62
|
+
*
|
|
63
|
+
* @remarks
|
|
64
|
+
* This interface is used for API responses that return multiple groups,
|
|
65
|
+
* such as GET /groups operations. The array may be empty if no groups
|
|
66
|
+
* match the query criteria or if the iTwin has no groups defined.
|
|
67
|
+
*/
|
|
68
|
+
export type GroupsResponseWithConditionalLinks<T> = HasAnyPaginationParam<T> extends true ? MultipleGroupsResponse : Omit<MultipleGroupsResponse, "_links">;
|
|
52
69
|
/**
|
|
53
70
|
* API response wrapper for multiple groups operations.
|
|
54
71
|
*
|
|
@@ -60,5 +77,7 @@ export interface SingleGroupResponse {
|
|
|
60
77
|
export interface MultipleGroupsResponse {
|
|
61
78
|
/** Array of groups returned by the API */
|
|
62
79
|
groups: Group[];
|
|
80
|
+
/** HAL-style links for pagination and related resources */
|
|
81
|
+
_links: Links;
|
|
63
82
|
}
|
|
64
83
|
//# sourceMappingURL=Groups.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Groups.d.ts","sourceRoot":"","sources":["../../../src/types/Groups.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,WAAW,KAAK;IACpB,mBAAmB;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,+DAA+D;IAC/D,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAClC,yCAAyC;IACzC,KAAK,EAAE,KAAK,CAAC;CACd;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,sBAAsB;IACrC,0CAA0C;IAC1C,MAAM,EAAE,KAAK,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"Groups.d.ts","sourceRoot":"","sources":["../../../src/types/Groups.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,WAAW,KAAK;IACpB,mBAAmB;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,+DAA+D;IAC/D,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAClC,yCAAyC;IACzC,KAAK,EAAE,KAAK,CAAC;CACd;AAED,yEAAyE;AACzE,MAAM,MAAM,qBAAqB,CAAC,CAAC,IACjC,CAAC,SAAS;IAAE,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,GAAG,KAAK,CAAC;AAElE;;;;;;;;GAQG;AACH,MAAM,MAAM,kCAAkC,CAAC,CAAC,IAC9C,qBAAqB,CAAC,CAAC,CAAC,SAAS,IAAI,GACjC,sBAAsB,GACtB,IAAI,CAAC,sBAAsB,EAAE,QAAQ,CAAC,CAAC;AAE7C;;;;;;;GAOG;AACH,MAAM,WAAW,sBAAsB;IACrC,0CAA0C;IAC1C,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,2DAA2D;IAE3D,MAAM,EAAE,KAAK,CAAC;CACf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Groups.js","sourceRoot":"","sources":["../../../src/types/Groups.ts"],"names":[],"mappings":"AAAA;;;gGAGgG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport type { GroupUser } from \"./Members\";\n\n/**\n * Represents an access control group within an iTwin.\n *\n * @remarks\n * Access Control groups provide the ability to manage groups of users at one time.\n * You can create groups on the Account iTwin to manage access across iTwins or\n * create a group for an individual iTwin. Groups created on an individual iTwin\n * are available only on that iTwin.\n *\n * Groups can contain individual users. Groups can also reference Bentley Identity\n * Management System (IMS) groups. By referencing an IMS group, you can manage\n * groups of individuals in your Active Directory, while providing them access to\n * iTwin Platform using role assignments.\n *\n * @example\n * ```typescript\n * const projectGroup: Group = {\n * id: \"550e8400-e29b-41d4-a716-446655440000\",\n * name: \"Project Managers\",\n * description: \"Users with project management responsibilities\",\n * members: [\n * { id: \"user123\", email: \"manager@company.com\", firstName: \"John\", lastName: \"Smith\" }\n * ],\n * imsGroups: [\"COMPANY_ADMINS\", \"PROJECT_LEADS\"]\n * };\n * ```\n */\nexport interface Group {\n /** The Group id */\n id: string;\n /** The name of your Group */\n name: string;\n /** A description of your Group */\n description: string;\n /** List of members assigned to the Group. Max size of 50 */\n members: GroupUser[];\n /** List of IMS Groups assigned to the Group. Max size of 50 */\n imsGroups: string[];\n}\n\n/**\n * API response wrapper for a single group operation.\n *\n * @remarks\n * This interface is used for API responses that return a single group,\n * such as GET /groups/{id}, POST /groups, and PATCH /groups/{id} operations.\n */\nexport interface SingleGroupResponse {\n /** The group data returned by the API */\n group: Group;\n}\n\n/**\n * API response wrapper for multiple groups operations.\n *\n * @remarks\n * This interface is used for API responses that return multiple groups,\n * such as GET /groups operations. The array may be empty if no groups\n * match the query criteria or if the iTwin has no groups defined.\n */\nexport interface MultipleGroupsResponse {\n /** Array of groups returned by the API */\n groups: Group[];\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Groups.js","sourceRoot":"","sources":["../../../src/types/Groups.ts"],"names":[],"mappings":"AAAA;;;gGAGgG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport type { Links } from \"./links\";\nimport type { GroupUser } from \"./Members\";\n\n/**\n * Represents an access control group within an iTwin.\n *\n * @remarks\n * Access Control groups provide the ability to manage groups of users at one time.\n * You can create groups on the Account iTwin to manage access across iTwins or\n * create a group for an individual iTwin. Groups created on an individual iTwin\n * are available only on that iTwin.\n *\n * Groups can contain individual users. Groups can also reference Bentley Identity\n * Management System (IMS) groups. By referencing an IMS group, you can manage\n * groups of individuals in your Active Directory, while providing them access to\n * iTwin Platform using role assignments.\n *\n * @example\n * ```typescript\n * const projectGroup: Group = {\n * id: \"550e8400-e29b-41d4-a716-446655440000\",\n * name: \"Project Managers\",\n * description: \"Users with project management responsibilities\",\n * members: [\n * { id: \"user123\", email: \"manager@company.com\", firstName: \"John\", lastName: \"Smith\" }\n * ],\n * imsGroups: [\"COMPANY_ADMINS\", \"PROJECT_LEADS\"]\n * };\n * ```\n */\nexport interface Group {\n /** The Group id */\n id: string;\n /** The name of your Group */\n name: string;\n /** A description of your Group */\n description: string;\n /** List of members assigned to the Group. Max size of 50 */\n members: GroupUser[];\n /** List of IMS Groups assigned to the Group. Max size of 50 */\n imsGroups: string[];\n}\n\n/**\n * API response wrapper for a single group operation.\n *\n * @remarks\n * This interface is used for API responses that return a single group,\n * such as GET /groups/{id}, POST /groups, and PATCH /groups/{id} operations.\n */\nexport interface SingleGroupResponse {\n /** The group data returned by the API */\n group: Group;\n}\n\n/** Utility type to determine if any pagination parameters are present */\nexport type HasAnyPaginationParam<T> =\n T extends { top?: unknown } | { skip?: unknown } ? true : false;\n\n/**\n * API response wrapper for multiple groups operations.\n * Conditional inclusion of HAL-style links based on pagination parameters.\n *\n * @remarks\n * This interface is used for API responses that return multiple groups,\n * such as GET /groups operations. The array may be empty if no groups\n * match the query criteria or if the iTwin has no groups defined.\n */\nexport type GroupsResponseWithConditionalLinks<T> =\n HasAnyPaginationParam<T> extends true\n ? MultipleGroupsResponse\n : Omit<MultipleGroupsResponse, \"_links\">;\n\n/**\n * API response wrapper for multiple groups operations.\n *\n * @remarks\n * This interface is used for API responses that return multiple groups,\n * such as GET /groups operations. The array may be empty if no groups\n * match the query criteria or if the iTwin has no groups defined.\n */\nexport interface MultipleGroupsResponse {\n /** Array of groups returned by the API */\n groups: Group[];\n /** HAL-style links for pagination and related resources */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n _links: Links;\n}\n"]}
|
|
@@ -76,6 +76,24 @@ export interface MultipleMemberInvitationResponse {
|
|
|
76
76
|
/** HAL-style navigation links for pagination (first, next, prev, last) */
|
|
77
77
|
_links: Links;
|
|
78
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* API response wrapper for a member invitation.
|
|
81
|
+
*
|
|
82
|
+
* @remarks
|
|
83
|
+
* This interface is used for API responses that a single member invitation,
|
|
84
|
+
* such as GET /invitations operations.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```typescript
|
|
88
|
+
* const response: MultipleMemberInvitationResponse = {
|
|
89
|
+
* invitation: {{ id: "inv1", email: "user1@external.com", status: "Pending", ... }} ,
|
|
90
|
+
* };
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export interface SingleMemberInvitationResponse {
|
|
94
|
+
/** The member invitation */
|
|
95
|
+
invitation: MemberInvitation;
|
|
96
|
+
}
|
|
79
97
|
/**
|
|
80
98
|
* Represents an invitation sent to a group member to join an iTwin.
|
|
81
99
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Invitations.d.ts","sourceRoot":"","sources":["../../../src/types/Invitations.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,gBAAgB;IAC/B,2CAA2C;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,cAAc,EAAE,MAAM,CAAC;IACvB,uCAAuC;IACvC,MAAM,EAAE,sBAAsB,CAAC;IAC/B,yDAAyD;IACzD,WAAW,EAAE,MAAM,CAAC;IACpB,qDAAqD;IACrD,cAAc,EAAE,MAAM,CAAC;IACvB,2FAA2F;IAC3F,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;CAChB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,UAAU,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,gCAAgC;IAC/C,sDAAsD;IACtD,WAAW,EAAE,gBAAgB,EAAE,CAAC;IAChC,0EAA0E;IAE1E,MAAM,EAAE,KAAK,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;AAEpE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,qCAAqC;IACpD,4DAA4D;IAC5D,WAAW,EAAE,qBAAqB,EAAE,CAAC;IACrC,0EAA0E;IAE1E,MAAM,EAAE,KAAK,CAAC;CACf"}
|
|
1
|
+
{"version":3,"file":"Invitations.d.ts","sourceRoot":"","sources":["../../../src/types/Invitations.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,gBAAgB;IAC/B,2CAA2C;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,cAAc,EAAE,MAAM,CAAC;IACvB,uCAAuC;IACvC,MAAM,EAAE,sBAAsB,CAAC;IAC/B,yDAAyD;IACzD,WAAW,EAAE,MAAM,CAAC;IACpB,qDAAqD;IACrD,cAAc,EAAE,MAAM,CAAC;IACvB,2FAA2F;IAC3F,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;CAChB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,UAAU,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,gCAAgC;IAC/C,sDAAsD;IACtD,WAAW,EAAE,gBAAgB,EAAE,CAAC;IAChC,0EAA0E;IAE1E,MAAM,EAAE,KAAK,CAAC;CACf;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,8BAA8B;IAC7C,4BAA4B;IAC5B,UAAU,EAAE,gBAAgB,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;AAEpE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,qCAAqC;IACpD,4DAA4D;IAC5D,WAAW,EAAE,qBAAqB,EAAE,CAAC;IACrC,0EAA0E;IAE1E,MAAM,EAAE,KAAK,CAAC;CACf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Invitations.js","sourceRoot":"","sources":["../../../src/types/Invitations.ts"],"names":[],"mappings":"AAAA;;;gGAGgG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport type { Links } from \"./links\";\nimport type { Role } from \"./Role\";\n\n/**\n * Represents an invitation sent to a user to join an iTwin as a member.\n *\n * @remarks\n * Member invitations are created when external users (not in the same organization as the iTwin)\n * are invited to join an iTwin. The invited user receives an email invitation and must accept it\n * to become a member. Invitations have expiration dates and can be in various states.\n *\n * @example\n * ```typescript\n * const invitation: MemberInvitation = {\n * id: \"550e8400-e29b-41d4-a716-446655440000\",\n * email: \"external.user@othercompany.com\",\n * invitedByEmail: \"admin@mycompany.com\",\n * status: \"Pending\",\n * createdDate: \"2023-10-15T10:30:00Z\",\n * expirationDate: \"2023-11-15T10:30:00Z\",\n * roles: [\n * { id: \"viewer-role\", displayName: \"Project Viewer\", description : \"Can view project details\" }\n * ]\n * };\n * ```\n */\nexport interface MemberInvitation {\n /** Unique identifier for the invitation */\n id: string;\n /** Email address of the invited user */\n email: string;\n /** Email address of the user who sent the invitation */\n invitedByEmail: string;\n /** Current status of the invitation */\n status: MemberInvitationStatus;\n /** ISO 8601 timestamp when the invitation was created */\n createdDate: string;\n /** ISO 8601 timestamp when the invitation expires */\n expirationDate: string;\n /** Optional array of roles that will be assigned upon acceptance (excludes permissions) */\n roles?: Role[];\n}\n\n/**\n * Represents the current state of a member invitation.\n *\n * @remarks\n * Invitations start as \"Pending\" when first sent and transition to \"Accepted\"\n * when the invited user accepts the invitation.\n */\nexport type MemberInvitationStatus = \"Pending\" | \"Accepted\";\n\n/**\n * API response wrapper for multiple member invitations with pagination support.\n *\n * @remarks\n * This interface is used for API responses that return collections of member invitations,\n * such as GET /invitations operations. Includes HAL-style navigation links for pagination\n * to handle large numbers of invitations efficiently.\n *\n * @example\n * ```typescript\n * const response: MultipleMemberInvitationResponse = {\n * invitations: [\n * { id: \"inv1\", email: \"user1@external.com\", status: \"Pending\", ... },\n * { id: \"inv2\", email: \"user2@external.com\", status: \"Accepted\", ... }\n * ],\n * _links: {\n * self: { href: \"/members/invitations?$skip=0&$top=100\" },\n * next: { href: \"/members/invitations?$skip=100&$top=100\" },\n * prev: { href: \"/members/invitations?$skip=0&$top=100\" }\n * }\n * };\n * ```\n */\nexport interface MultipleMemberInvitationResponse {\n /** Array of member invitations in the current page */\n invitations: MemberInvitation[];\n /** HAL-style navigation links for pagination (first, next, prev, last) */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n _links: Links;\n}\n\n/**\n * Represents an invitation sent to a group member to join an iTwin.\n *\n * @remarks\n * Retrieves a list of iTwin group member invitations. By default, users will receive the invitations they have sent.\n * If the user is an iTwin Owner, they will receive all invitations for the iTwin.\n * Invitations have an expiration of 7 days after their creation. Once that expiration passes, the invitation will not be returned.\n *\n * @example\n * ```typescript\n * const groupInvitation: GroupMemberInvitation = {\n * id: \"550e8400-e29b-41d4-a716-446655440000\",\n * email: \"group.member@external.com\",\n * invitedByEmail: \"admin@mycompany.com\",\n * status: \"Pending\",\n * createdDate: \"2023-10-15T10:30:00Z\",\n * expirationDate: \"2023-11-15T10:30:00Z\"\n * };\n * ```\n */\nexport type GroupMemberInvitation = Omit<MemberInvitation, \"roles\">;\n\n/**\n * API response wrapper for multiple group member invitations with pagination support.\n *\n * @remarks\n * This interface is used for API responses that return collections of group member invitations.\n * Includes HAL-style navigation links for pagination to handle large numbers of group invitations efficiently.\n *\n * @example\n * ```typescript\n * const response: MultipleGroupMemberInvitationResponse = {\n * invitations: [\n * { id: \"inv1\", email: \"user1@external.com\", status: \"Pending\", ... },\n * { id: \"inv2\", email: \"user2@external.com\", status: \"Accepted\", ... }\n * ],\n * _links: {\n * self: { href: \"/groups/invitations?$skip=0&$top=100\" },\n * next: { href: \"/groups/invitations?$skip=100&$top=100\" },\n * prev: { href: \"/groups/invitations?$skip=0&$top=100\" }\n * }\n * };\n * ```\n */\nexport interface MultipleGroupMemberInvitationResponse {\n /** Array of group member invitations in the current page */\n invitations: GroupMemberInvitation[];\n /** HAL-style navigation links for pagination (first, next, prev, last) */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n _links: Links;\n}"]}
|
|
1
|
+
{"version":3,"file":"Invitations.js","sourceRoot":"","sources":["../../../src/types/Invitations.ts"],"names":[],"mappings":"AAAA;;;gGAGgG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport type { Links } from \"./links\";\nimport type { Role } from \"./Role\";\n\n/**\n * Represents an invitation sent to a user to join an iTwin as a member.\n *\n * @remarks\n * Member invitations are created when external users (not in the same organization as the iTwin)\n * are invited to join an iTwin. The invited user receives an email invitation and must accept it\n * to become a member. Invitations have expiration dates and can be in various states.\n *\n * @example\n * ```typescript\n * const invitation: MemberInvitation = {\n * id: \"550e8400-e29b-41d4-a716-446655440000\",\n * email: \"external.user@othercompany.com\",\n * invitedByEmail: \"admin@mycompany.com\",\n * status: \"Pending\",\n * createdDate: \"2023-10-15T10:30:00Z\",\n * expirationDate: \"2023-11-15T10:30:00Z\",\n * roles: [\n * { id: \"viewer-role\", displayName: \"Project Viewer\", description : \"Can view project details\" }\n * ]\n * };\n * ```\n */\nexport interface MemberInvitation {\n /** Unique identifier for the invitation */\n id: string;\n /** Email address of the invited user */\n email: string;\n /** Email address of the user who sent the invitation */\n invitedByEmail: string;\n /** Current status of the invitation */\n status: MemberInvitationStatus;\n /** ISO 8601 timestamp when the invitation was created */\n createdDate: string;\n /** ISO 8601 timestamp when the invitation expires */\n expirationDate: string;\n /** Optional array of roles that will be assigned upon acceptance (excludes permissions) */\n roles?: Role[];\n}\n\n/**\n * Represents the current state of a member invitation.\n *\n * @remarks\n * Invitations start as \"Pending\" when first sent and transition to \"Accepted\"\n * when the invited user accepts the invitation.\n */\nexport type MemberInvitationStatus = \"Pending\" | \"Accepted\";\n\n/**\n * API response wrapper for multiple member invitations with pagination support.\n *\n * @remarks\n * This interface is used for API responses that return collections of member invitations,\n * such as GET /invitations operations. Includes HAL-style navigation links for pagination\n * to handle large numbers of invitations efficiently.\n *\n * @example\n * ```typescript\n * const response: MultipleMemberInvitationResponse = {\n * invitations: [\n * { id: \"inv1\", email: \"user1@external.com\", status: \"Pending\", ... },\n * { id: \"inv2\", email: \"user2@external.com\", status: \"Accepted\", ... }\n * ],\n * _links: {\n * self: { href: \"/members/invitations?$skip=0&$top=100\" },\n * next: { href: \"/members/invitations?$skip=100&$top=100\" },\n * prev: { href: \"/members/invitations?$skip=0&$top=100\" }\n * }\n * };\n * ```\n */\nexport interface MultipleMemberInvitationResponse {\n /** Array of member invitations in the current page */\n invitations: MemberInvitation[];\n /** HAL-style navigation links for pagination (first, next, prev, last) */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n _links: Links;\n}\n\n/**\n * API response wrapper for a member invitation.\n *\n * @remarks\n * This interface is used for API responses that a single member invitation,\n * such as GET /invitations operations.\n *\n * @example\n * ```typescript\n * const response: MultipleMemberInvitationResponse = {\n * invitation: {{ id: \"inv1\", email: \"user1@external.com\", status: \"Pending\", ... }} ,\n * };\n * ```\n */\nexport interface SingleMemberInvitationResponse {\n /** The member invitation */\n invitation: MemberInvitation;\n}\n\n/**\n * Represents an invitation sent to a group member to join an iTwin.\n *\n * @remarks\n * Retrieves a list of iTwin group member invitations. By default, users will receive the invitations they have sent.\n * If the user is an iTwin Owner, they will receive all invitations for the iTwin.\n * Invitations have an expiration of 7 days after their creation. Once that expiration passes, the invitation will not be returned.\n *\n * @example\n * ```typescript\n * const groupInvitation: GroupMemberInvitation = {\n * id: \"550e8400-e29b-41d4-a716-446655440000\",\n * email: \"group.member@external.com\",\n * invitedByEmail: \"admin@mycompany.com\",\n * status: \"Pending\",\n * createdDate: \"2023-10-15T10:30:00Z\",\n * expirationDate: \"2023-11-15T10:30:00Z\"\n * };\n * ```\n */\nexport type GroupMemberInvitation = Omit<MemberInvitation, \"roles\">;\n\n/**\n * API response wrapper for multiple group member invitations with pagination support.\n *\n * @remarks\n * This interface is used for API responses that return collections of group member invitations.\n * Includes HAL-style navigation links for pagination to handle large numbers of group invitations efficiently.\n *\n * @example\n * ```typescript\n * const response: MultipleGroupMemberInvitationResponse = {\n * invitations: [\n * { id: \"inv1\", email: \"user1@external.com\", status: \"Pending\", ... },\n * { id: \"inv2\", email: \"user2@external.com\", status: \"Accepted\", ... }\n * ],\n * _links: {\n * self: { href: \"/groups/invitations?$skip=0&$top=100\" },\n * next: { href: \"/groups/invitations?$skip=100&$top=100\" },\n * prev: { href: \"/groups/invitations?$skip=0&$top=100\" }\n * }\n * };\n * ```\n */\nexport interface MultipleGroupMemberInvitationResponse {\n /** Array of group member invitations in the current page */\n invitations: GroupMemberInvitation[];\n /** HAL-style navigation links for pagination (first, next, prev, last) */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n _links: Links;\n}"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/access-control-client",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "Access control client for the iTwin platform",
|
|
5
5
|
"main": "lib/cjs/access-control-client.js",
|
|
6
6
|
"module": "lib/esm/access-control-client.js",
|
|
@@ -27,25 +27,26 @@
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@changesets/cli": "^2.
|
|
31
|
-
"@changesets/types": "6.
|
|
32
|
-
"@eslint/eslintrc": "^3.3.
|
|
33
|
-
"@itwin/build-tools": "^5.
|
|
34
|
-
"@itwin/core-bentley": "^5.
|
|
35
|
-
"@itwin/eslint-plugin": "^
|
|
36
|
-
"@itwin/oidc-signin-tool": "^5.
|
|
37
|
-
"@playwright/test": "1.
|
|
38
|
-
"@types/node": "
|
|
39
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
40
|
-
"@typescript-eslint/parser": "^8.
|
|
30
|
+
"@changesets/cli": "^2.3.0",
|
|
31
|
+
"@changesets/types": "6.1.0",
|
|
32
|
+
"@eslint/eslintrc": "^3.3.5",
|
|
33
|
+
"@itwin/build-tools": "^5.7.2",
|
|
34
|
+
"@itwin/core-bentley": "^5.7.2",
|
|
35
|
+
"@itwin/eslint-plugin": "^6.0.0",
|
|
36
|
+
"@itwin/oidc-signin-tool": "^5.1.1",
|
|
37
|
+
"@playwright/test": "1.56.0",
|
|
38
|
+
"@types/node": "25.5.00",
|
|
39
|
+
"@typescript-eslint/eslint-plugin": "^8.57.1",
|
|
40
|
+
"@typescript-eslint/parser": "^8.57.1",
|
|
41
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
41
42
|
"@vitest/ui": "^3.2.4",
|
|
42
|
-
"dotenv": "^
|
|
43
|
-
"dotenv-expand": "^
|
|
44
|
-
"eslint": "^9.
|
|
45
|
-
"rimraf": "^6.
|
|
46
|
-
"source-map-loader": "^
|
|
47
|
-
"typedoc": "^0.28.
|
|
48
|
-
"typescript": "~5.9.
|
|
43
|
+
"dotenv": "^17.3.0",
|
|
44
|
+
"dotenv-expand": "^12.0.3",
|
|
45
|
+
"eslint": "^9.39.4",
|
|
46
|
+
"rimraf": "^6.1.3",
|
|
47
|
+
"source-map-loader": "^5.0.0",
|
|
48
|
+
"typedoc": "^0.28.17",
|
|
49
|
+
"typescript": "~5.9.3",
|
|
49
50
|
"vite": "^5.4.10",
|
|
50
51
|
"vitest": "^3.2.4"
|
|
51
52
|
},
|