@crowdedkingdomstudios/crowdyjs 5.2.0 → 5.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MIGRATION.md +22 -0
- package/dist/client.d.ts +98 -5
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +74 -5
- package/dist/crowdy-client.d.ts +31 -0
- package/dist/crowdy-client.d.ts.map +1 -1
- package/dist/crowdy-client.js +8 -0
- package/dist/domains/actors.d.ts +87 -4
- package/dist/domains/actors.d.ts.map +1 -1
- package/dist/domains/actors.js +87 -4
- package/dist/domains/apps.d.ts +95 -41
- package/dist/domains/apps.d.ts.map +1 -1
- package/dist/domains/apps.js +80 -33
- package/dist/domains/auth.d.ts +139 -19
- package/dist/domains/auth.d.ts.map +1 -1
- package/dist/domains/auth.js +137 -17
- package/dist/domains/channels.d.ts +264 -5
- package/dist/domains/channels.d.ts.map +1 -1
- package/dist/domains/channels.js +264 -5
- package/dist/domains/chunks.d.ts +116 -3
- package/dist/domains/chunks.d.ts.map +1 -1
- package/dist/domains/chunks.js +116 -3
- package/dist/domains/gameModel.d.ts +412 -6
- package/dist/domains/gameModel.d.ts.map +1 -1
- package/dist/domains/gameModel.js +412 -6
- package/dist/domains/platform.d.ts +36 -20
- package/dist/domains/platform.d.ts.map +1 -1
- package/dist/domains/platform.js +29 -18
- package/dist/domains/serverStatus.d.ts +74 -6
- package/dist/domains/serverStatus.d.ts.map +1 -1
- package/dist/domains/serverStatus.js +74 -6
- package/dist/domains/state.d.ts +50 -2
- package/dist/domains/state.d.ts.map +1 -1
- package/dist/domains/state.js +50 -2
- package/dist/domains/teams.d.ts +263 -5
- package/dist/domains/teams.d.ts.map +1 -1
- package/dist/domains/teams.js +263 -5
- package/dist/domains/teleport.d.ts +30 -2
- package/dist/domains/teleport.d.ts.map +1 -1
- package/dist/domains/teleport.js +30 -2
- package/dist/domains/udp.d.ts +341 -5
- package/dist/domains/udp.d.ts.map +1 -1
- package/dist/domains/udp.js +341 -5
- package/dist/domains/users.d.ts +42 -11
- package/dist/domains/users.d.ts.map +1 -1
- package/dist/domains/users.js +41 -10
- package/dist/domains/voxels.d.ts +107 -2
- package/dist/domains/voxels.d.ts.map +1 -1
- package/dist/domains/voxels.js +107 -2
- package/dist/errors.d.ts +116 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +100 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/realtime.d.ts +226 -0
- package/dist/realtime.d.ts.map +1 -1
- package/dist/realtime.js +90 -0
- package/dist/session.d.ts +46 -0
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +35 -0
- package/dist/types.d.ts +429 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +53 -0
- package/dist/utils.d.ts +86 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +86 -0
- package/dist/world.d.ts +192 -0
- package/dist/world.d.ts.map +1 -1
- package/dist/world.js +170 -0
- package/package.json +1 -1
package/dist/domains/teams.d.ts
CHANGED
|
@@ -1,34 +1,292 @@
|
|
|
1
1
|
import type { GraphQLClient } from '../client.js';
|
|
2
2
|
import { type MyTeamsQuery, type MyTeamsQueryVariables, type TeamsQuery, type TeamsQueryVariables, type TeamQuery, type TeamQueryVariables, type TeamMembersQuery, type TeamMembersQueryVariables, type TeamRolesQuery, type TeamRolesQueryVariables, type TeamPolicyQuery, type TeamPolicyQueryVariables, type SetTeamPolicyMutation, type SetTeamPolicyMutationVariables, type CreateTeamMutation, type CreateTeamMutationVariables, type UpdateTeamMutation, type UpdateTeamMutationVariables, type DeleteTeamMutationVariables, type JoinTeamMutation, type JoinTeamMutationVariables, type RequestToJoinTeamMutation, type RequestToJoinTeamMutationVariables, type LeaveTeamMutationVariables, type AddTeamMemberMutation, type AddTeamMemberMutationVariables, type RemoveTeamMemberMutationVariables, type SetTeamMemberRolesMutation, type SetTeamMemberRolesMutationVariables, type CreateTeamRoleMutation, type CreateTeamRoleMutationVariables, type UpdateTeamRoleMutation, type UpdateTeamRoleMutationVariables, type DeleteTeamRoleMutationVariables } from '../generated/graphql.js';
|
|
3
3
|
/**
|
|
4
|
-
* Teams: app-scoped player groups with roles and delegated management
|
|
5
|
-
*
|
|
6
|
-
* CRUD, membership, and roles run over the game-api GraphQL endpoint. Unlike
|
|
7
|
-
* channels, teams have no realtime messaging path.
|
|
4
|
+
* Teams: app-scoped player groups with roles and delegated management on the
|
|
5
|
+
* **game-api**. Exposed as `client.teams`.
|
|
8
6
|
*
|
|
9
|
-
*
|
|
7
|
+
* A team is a named, app-scoped set of players with a role/permission model,
|
|
8
|
+
* built on the same generic groups subsystem as Channels (`group_type='team'`).
|
|
9
|
+
* The methods here cover a team's full lifecycle — creating teams, listing and
|
|
10
|
+
* fetching them, managing membership (join / request-to-join / leave / add /
|
|
11
|
+
* remove), roles, and the per-app team policy — all over the game-api GraphQL
|
|
12
|
+
* endpoint. Unlike channels, teams have no realtime messaging path.
|
|
13
|
+
*
|
|
14
|
+
* `BigInt` ids (`appId`, `groupId`, `userId`, `groupRoleId`) are sent and
|
|
15
|
+
* received as decimal strings.
|
|
16
|
+
*
|
|
17
|
+
* Every method requires an authenticated session (a Bearer token set via
|
|
18
|
+
* `client.auth.login()` or `client.setToken()`) and the caller must be
|
|
19
|
+
* entitled to the target app; membership/role/policy mutations additionally
|
|
20
|
+
* require a specific team permission (e.g. `manage_group`, `manage_members`,
|
|
21
|
+
* `manage_roles`) or app-admin (`manage_apps`). Failures throw
|
|
22
|
+
* {@link CrowdyGraphQLError} carrying a stable `extensions.code` such as
|
|
23
|
+
* `UNAUTHENTICATED`, `SCOPE_MISSING`, or `FORBIDDEN`.
|
|
10
24
|
*/
|
|
11
25
|
export declare class TeamsAPI {
|
|
12
26
|
private gql;
|
|
13
27
|
constructor(gql: GraphQLClient);
|
|
28
|
+
/**
|
|
29
|
+
* List the caller's own teams in an app, each with the caller's roles and
|
|
30
|
+
* effective team permissions. Use this to discover which teams the current
|
|
31
|
+
* user belongs to and what they may do in each.
|
|
32
|
+
*
|
|
33
|
+
* @param appId - The app (tenant) to list the caller's teams within, as a
|
|
34
|
+
* decimal `BigInt` string.
|
|
35
|
+
* @returns One {@link GroupMembership} per team the caller belongs to (the
|
|
36
|
+
* team {@link Group}, the caller's {@link GroupRole}s, their effective
|
|
37
|
+
* permission keys, and the join time).
|
|
38
|
+
* @throws {CrowdyGraphQLError} `UNAUTHENTICATED` if there is no valid token,
|
|
39
|
+
* or `SCOPE_MISSING` / `FORBIDDEN` if the caller isn't entitled to the app.
|
|
40
|
+
*/
|
|
14
41
|
mine(appId: MyTeamsQueryVariables['appId']): Promise<MyTeamsQuery['myTeams']>;
|
|
42
|
+
/**
|
|
43
|
+
* List all active teams in an app — not just the caller's. Use {@link mine}
|
|
44
|
+
* instead when you only want the teams the caller belongs to.
|
|
45
|
+
*
|
|
46
|
+
* @param appId - The app (tenant) whose teams to list, as a decimal `BigInt`
|
|
47
|
+
* string.
|
|
48
|
+
* @returns Every active team in the app as {@link Group} records.
|
|
49
|
+
* @throws {CrowdyGraphQLError} `UNAUTHENTICATED`, or `SCOPE_MISSING` /
|
|
50
|
+
* `FORBIDDEN` if the caller isn't entitled to the app.
|
|
51
|
+
*/
|
|
15
52
|
list(appId: TeamsQueryVariables['appId']): Promise<TeamsQuery['teams']>;
|
|
53
|
+
/**
|
|
54
|
+
* Fetch a single team by its group id.
|
|
55
|
+
*
|
|
56
|
+
* @param groupId - The team's group id, as a decimal `BigInt` string.
|
|
57
|
+
* @returns The team as a {@link Group}.
|
|
58
|
+
* @throws {CrowdyGraphQLError} if the id does not resolve to a team (e.g. it
|
|
59
|
+
* is a channel, or does not exist), or `UNAUTHENTICATED` / `FORBIDDEN` if
|
|
60
|
+
* the caller isn't entitled to the app.
|
|
61
|
+
*/
|
|
16
62
|
get(groupId: TeamQueryVariables['groupId']): Promise<TeamQuery['team']>;
|
|
63
|
+
/**
|
|
64
|
+
* List a team's members, including pending join requests, each with their
|
|
65
|
+
* membership status and roles.
|
|
66
|
+
*
|
|
67
|
+
* @param groupId - The team whose members to list, as a decimal `BigInt`
|
|
68
|
+
* string.
|
|
69
|
+
* @returns The team's members as {@link GroupMember} records.
|
|
70
|
+
* @throws {CrowdyGraphQLError} `UNAUTHENTICATED` / `FORBIDDEN` if the caller
|
|
71
|
+
* isn't entitled to the team's app.
|
|
72
|
+
*/
|
|
17
73
|
members(groupId: TeamMembersQueryVariables['groupId']): Promise<TeamMembersQuery['teamMembers']>;
|
|
74
|
+
/**
|
|
75
|
+
* List a team's roles, including the system `leader` role, each with the
|
|
76
|
+
* group-management permission keys it grants.
|
|
77
|
+
*
|
|
78
|
+
* @param groupId - The team whose roles to list, as a decimal `BigInt`
|
|
79
|
+
* string.
|
|
80
|
+
* @returns The team's roles as {@link GroupRole} records.
|
|
81
|
+
* @throws {CrowdyGraphQLError} `UNAUTHENTICATED` / `FORBIDDEN` if the caller
|
|
82
|
+
* isn't entitled to the team's app.
|
|
83
|
+
*/
|
|
18
84
|
roles(groupId: TeamRolesQueryVariables['groupId']): Promise<TeamRolesQuery['teamRoles']>;
|
|
85
|
+
/**
|
|
86
|
+
* Read an app's current team policy: who may create teams and the default
|
|
87
|
+
* membership policy applied to new teams. Falls back to app defaults when
|
|
88
|
+
* unset.
|
|
89
|
+
*
|
|
90
|
+
* @param appId - The app (tenant) whose team policy to read, as a decimal
|
|
91
|
+
* `BigInt` string.
|
|
92
|
+
* @returns The effective {@link AppGroupPolicy} for teams in the app
|
|
93
|
+
* (creation policy, default membership policy, and any member/group caps).
|
|
94
|
+
* @throws {CrowdyGraphQLError} `UNAUTHENTICATED` / `FORBIDDEN` if the caller
|
|
95
|
+
* isn't entitled to the app.
|
|
96
|
+
*/
|
|
19
97
|
policy(appId: TeamPolicyQueryVariables['appId']): Promise<TeamPolicyQuery['teamPolicy']>;
|
|
98
|
+
/**
|
|
99
|
+
* Create a team in an app. Whether the caller may create one is governed by
|
|
100
|
+
* the per-app team creation policy (`admin` | `member` | `anyone`). The
|
|
101
|
+
* caller becomes the owner and is granted a system `leader` role holding
|
|
102
|
+
* every team permission. New teams default to the app's default membership
|
|
103
|
+
* policy unless `input.membershipPolicy` overrides it.
|
|
104
|
+
*
|
|
105
|
+
* @param input - {@link CreateTeamInput}: the owning `appId`, the team `name`
|
|
106
|
+
* (max 128 chars, unique per app + type), and optional `description` and
|
|
107
|
+
* `membershipPolicy` (`open` | `request` | `invite` | `admin`).
|
|
108
|
+
* @returns The newly created team as a {@link Group}.
|
|
109
|
+
* @throws {CrowdyGraphQLError} `BAD_USER_INPUT` (e.g. name too long or a
|
|
110
|
+
* duplicate name), `FORBIDDEN` if the team policy disallows creation, or
|
|
111
|
+
* `UNAUTHENTICATED`.
|
|
112
|
+
*/
|
|
20
113
|
create(input: CreateTeamMutationVariables['input']): Promise<CreateTeamMutation['createTeam']>;
|
|
114
|
+
/**
|
|
115
|
+
* Update a team's name, description, and/or membership policy. Only the
|
|
116
|
+
* fields present on `input` change; omitted fields are left as-is. Requires
|
|
117
|
+
* the `manage_group` team permission (app admins bypass).
|
|
118
|
+
*
|
|
119
|
+
* @param input - {@link UpdateTeamInput}: the `groupId` plus the fields to
|
|
120
|
+
* change — `name` (max 128 chars), `description`, and/or `membershipPolicy`
|
|
121
|
+
* (`open` | `request` | `invite` | `admin`).
|
|
122
|
+
* @returns The updated team as a {@link Group}.
|
|
123
|
+
* @throws {CrowdyGraphQLError} `FORBIDDEN` / `SCOPE_MISSING` if the caller
|
|
124
|
+
* lacks `manage_group`, `BAD_USER_INPUT` on a validation failure, or
|
|
125
|
+
* `UNAUTHENTICATED`.
|
|
126
|
+
*/
|
|
21
127
|
update(input: UpdateTeamMutationVariables['input']): Promise<UpdateTeamMutation['updateTeam']>;
|
|
128
|
+
/**
|
|
129
|
+
* Delete a team. Requires the `manage_group` team permission (app admins
|
|
130
|
+
* bypass). **Destructive**: cascades to the team's members and roles, drops
|
|
131
|
+
* any grid grants the team conferred, and recomputes the effective grid ACL
|
|
132
|
+
* for affected grids.
|
|
133
|
+
*
|
|
134
|
+
* Pass an `idempotencyKey` to make retries safe: replaying with the same key
|
|
135
|
+
* and identical arguments returns the first result instead of re-applying,
|
|
136
|
+
* while the same key with a **different** `groupId` throws
|
|
137
|
+
* {@link CrowdyGraphQLError} with `code === 'IDEMPOTENCY_CONFLICT'`. Keys
|
|
138
|
+
* expire server-side after 24h. Requires game-api ≥ v0.10.3.
|
|
139
|
+
*
|
|
140
|
+
* @param groupId - The team to delete, as a decimal `BigInt` string.
|
|
141
|
+
* @param idempotencyKey - Optional client-supplied key for safe retries.
|
|
142
|
+
* @returns `true` on success.
|
|
143
|
+
* @throws {CrowdyGraphQLError} `IDEMPOTENCY_CONFLICT` (key reused with
|
|
144
|
+
* different arguments), `FORBIDDEN` / `SCOPE_MISSING` if the caller lacks
|
|
145
|
+
* `manage_group`, or `UNAUTHENTICATED`.
|
|
146
|
+
*/
|
|
22
147
|
remove(groupId: DeleteTeamMutationVariables['groupId'], idempotencyKey?: DeleteTeamMutationVariables['idempotencyKey']): Promise<boolean>;
|
|
148
|
+
/**
|
|
149
|
+
* Set who may create teams in an app and the default membership policy for
|
|
150
|
+
* new teams. Requires app-admin (`manage_apps`). Affects future team
|
|
151
|
+
* creation only — existing teams are unchanged.
|
|
152
|
+
*
|
|
153
|
+
* @param input - {@link SetTeamPolicyInput}: the `appId`, the `creationPolicy`
|
|
154
|
+
* (`admin` | `member` | `anyone`), the `defaultMembershipPolicy` (`open` |
|
|
155
|
+
* `request` | `invite` | `admin`), and optional `maxMembers` /
|
|
156
|
+
* `maxGroupsPerUser` caps (`null` = unlimited).
|
|
157
|
+
* @returns The updated {@link AppGroupPolicy}.
|
|
158
|
+
* @throws {CrowdyGraphQLError} `FORBIDDEN` / `SCOPE_MISSING` if the caller
|
|
159
|
+
* isn't app-admin, `BAD_USER_INPUT` on an invalid policy value, or
|
|
160
|
+
* `UNAUTHENTICATED`.
|
|
161
|
+
*/
|
|
23
162
|
setPolicy(input: SetTeamPolicyMutationVariables['input']): Promise<SetTeamPolicyMutation['setTeamPolicy']>;
|
|
163
|
+
/**
|
|
164
|
+
* Join a team as the caller. Honors the team's membership policy: `open` →
|
|
165
|
+
* active immediately; `request` → pending until a manager approves; `invite`
|
|
166
|
+
* / `admin` → rejected. Banned users are rejected. No special permission is
|
|
167
|
+
* required.
|
|
168
|
+
*
|
|
169
|
+
* @param groupId - The team to join, as a decimal `BigInt` string.
|
|
170
|
+
* @returns The caller's {@link GroupMember} record; its `status` reflects
|
|
171
|
+
* `active` vs. `pending`.
|
|
172
|
+
* @throws {CrowdyGraphQLError} `FORBIDDEN` if the membership policy or a ban
|
|
173
|
+
* rejects the join, or `UNAUTHENTICATED`.
|
|
174
|
+
*/
|
|
24
175
|
join(groupId: JoinTeamMutationVariables['groupId']): Promise<JoinTeamMutation['joinTeam']>;
|
|
176
|
+
/**
|
|
177
|
+
* Request to join a request-only team, creating a pending membership a
|
|
178
|
+
* manager can later approve via {@link addMember}. Behaves identically to
|
|
179
|
+
* {@link join}; it exists as a clearer name for request-policy UIs.
|
|
180
|
+
*
|
|
181
|
+
* @param groupId - The request-only team to request to join, as a decimal
|
|
182
|
+
* `BigInt` string.
|
|
183
|
+
* @returns The caller's pending {@link GroupMember} record.
|
|
184
|
+
* @throws {CrowdyGraphQLError} `FORBIDDEN` if the membership policy rejects
|
|
185
|
+
* the request, or `UNAUTHENTICATED`.
|
|
186
|
+
*/
|
|
25
187
|
requestToJoin(groupId: RequestToJoinTeamMutationVariables['groupId']): Promise<RequestToJoinTeamMutation['requestToJoinTeam']>;
|
|
188
|
+
/**
|
|
189
|
+
* Leave a team (removes the caller's own membership).
|
|
190
|
+
*
|
|
191
|
+
* Pass an `idempotencyKey` to make retries safe: replaying with the same key
|
|
192
|
+
* and identical arguments returns the first result instead of re-applying,
|
|
193
|
+
* while the same key with a **different** `groupId` throws
|
|
194
|
+
* {@link CrowdyGraphQLError} with `code === 'IDEMPOTENCY_CONFLICT'`. Keys
|
|
195
|
+
* expire server-side after 24h. Requires game-api ≥ v0.10.3.
|
|
196
|
+
*
|
|
197
|
+
* @param groupId - The team to leave, as a decimal `BigInt` string.
|
|
198
|
+
* @param idempotencyKey - Optional client-supplied key for safe retries.
|
|
199
|
+
* @returns `true` if a membership was removed (`false` if the caller wasn't
|
|
200
|
+
* a member).
|
|
201
|
+
* @throws {CrowdyGraphQLError} `IDEMPOTENCY_CONFLICT` (key reused with
|
|
202
|
+
* different arguments), or `UNAUTHENTICATED`.
|
|
203
|
+
*/
|
|
26
204
|
leave(groupId: LeaveTeamMutationVariables['groupId'], idempotencyKey?: LeaveTeamMutationVariables['idempotencyKey']): Promise<boolean>;
|
|
205
|
+
/**
|
|
206
|
+
* Add a user to a team, or approve their pending join request (upserts the
|
|
207
|
+
* membership to `active`). Requires the `manage_members` team permission (app
|
|
208
|
+
* admins bypass). Auto-assigns the team's default role if configured.
|
|
209
|
+
*
|
|
210
|
+
* @param groupId - The team to add the user to, as a decimal `BigInt`
|
|
211
|
+
* string.
|
|
212
|
+
* @param userId - The user to add or approve, as a decimal `BigInt` string.
|
|
213
|
+
* @returns The added/approved {@link GroupMember} record.
|
|
214
|
+
* @throws {CrowdyGraphQLError} `FORBIDDEN` / `SCOPE_MISSING` if the caller
|
|
215
|
+
* lacks `manage_members`, or `UNAUTHENTICATED`.
|
|
216
|
+
*/
|
|
27
217
|
addMember(groupId: AddTeamMemberMutationVariables['groupId'], userId: AddTeamMemberMutationVariables['userId']): Promise<AddTeamMemberMutation['addTeamMember']>;
|
|
218
|
+
/**
|
|
219
|
+
* Remove a member from a team. Requires the `manage_members` team permission,
|
|
220
|
+
* except that any member may remove themselves (pass their own `userId`).
|
|
221
|
+
* **Destructive**: drops the membership and its roles.
|
|
222
|
+
*
|
|
223
|
+
* @param groupId - The team to remove the user from, as a decimal `BigInt`
|
|
224
|
+
* string.
|
|
225
|
+
* @param userId - The user to remove; may be the caller's own id to
|
|
226
|
+
* self-remove. Decimal `BigInt` string.
|
|
227
|
+
* @returns `true` if a membership was removed.
|
|
228
|
+
* @throws {CrowdyGraphQLError} `FORBIDDEN` / `SCOPE_MISSING` when removing
|
|
229
|
+
* another member without `manage_members`, or `UNAUTHENTICATED`.
|
|
230
|
+
*/
|
|
28
231
|
removeMember(groupId: RemoveTeamMemberMutationVariables['groupId'], userId: RemoveTeamMemberMutationVariables['userId']): Promise<boolean>;
|
|
232
|
+
/**
|
|
233
|
+
* Replace a member's team roles with the given set. This is **not additive**
|
|
234
|
+
* — roles not listed are removed. Requires the `manage_roles` team permission
|
|
235
|
+
* (app admins bypass).
|
|
236
|
+
*
|
|
237
|
+
* @param input - {@link SetMemberRolesInput}: the `groupId`, the target
|
|
238
|
+
* `userId`, and `roleIds` — the complete set of team role ids the member
|
|
239
|
+
* should have (ids that are unknown or belong to another group are
|
|
240
|
+
* ignored).
|
|
241
|
+
* @returns The updated {@link GroupMember} record with its new roles.
|
|
242
|
+
* @throws {CrowdyGraphQLError} `FORBIDDEN` / `SCOPE_MISSING` if the caller
|
|
243
|
+
* lacks `manage_roles`, or `UNAUTHENTICATED`.
|
|
244
|
+
*/
|
|
29
245
|
setMemberRoles(input: SetTeamMemberRolesMutationVariables['input']): Promise<SetTeamMemberRolesMutation['setTeamMemberRoles']>;
|
|
246
|
+
/**
|
|
247
|
+
* Create a custom (non-system) team role granting the given team permission
|
|
248
|
+
* keys. Requires the `manage_roles` team permission (app admins bypass). Keys
|
|
249
|
+
* must be valid team permission keys (`group_permission_defs`).
|
|
250
|
+
*
|
|
251
|
+
* @param input - {@link CreateGroupRoleInput}: the `groupId`, the `roleName`
|
|
252
|
+
* (max 128 chars, unique within the team), the `permissions` keys to grant
|
|
253
|
+
* (e.g. `manage_members`, `manage_roles`, `manage_group`; each max 64
|
|
254
|
+
* chars, defaults to none), and an optional `rank` (higher = more senior;
|
|
255
|
+
* defaults to 0).
|
|
256
|
+
* @returns The created {@link GroupRole}.
|
|
257
|
+
* @throws {CrowdyGraphQLError} `BAD_USER_INPUT` on an invalid/duplicate name
|
|
258
|
+
* or unknown permission key, `FORBIDDEN` / `SCOPE_MISSING` if the caller
|
|
259
|
+
* lacks `manage_roles`, or `UNAUTHENTICATED`.
|
|
260
|
+
*/
|
|
30
261
|
createRole(input: CreateTeamRoleMutationVariables['input']): Promise<CreateTeamRoleMutation['createTeamRole']>;
|
|
262
|
+
/**
|
|
263
|
+
* Update a team role's name, rank, and/or permission keys (system roles
|
|
264
|
+
* cannot be renamed or re-ranked). When `input.permissions` is supplied it
|
|
265
|
+
* **replaces** the role's existing keys. Requires the `manage_roles` team
|
|
266
|
+
* permission (app admins bypass).
|
|
267
|
+
*
|
|
268
|
+
* @param input - {@link UpdateGroupRoleInput}: the `groupRoleId` plus the
|
|
269
|
+
* fields to change (`roleName`, `permissions`, `rank`); omitted fields are
|
|
270
|
+
* left unchanged.
|
|
271
|
+
* @returns The updated {@link GroupRole}.
|
|
272
|
+
* @throws {CrowdyGraphQLError} `BAD_USER_INPUT` on a validation failure,
|
|
273
|
+
* `FORBIDDEN` / `SCOPE_MISSING` if the caller lacks `manage_roles`, or
|
|
274
|
+
* `UNAUTHENTICATED`.
|
|
275
|
+
*/
|
|
31
276
|
updateRole(input: UpdateTeamRoleMutationVariables['input']): Promise<UpdateTeamRoleMutation['updateTeamRole']>;
|
|
277
|
+
/**
|
|
278
|
+
* Delete a non-system team role. Requires the `manage_roles` team permission
|
|
279
|
+
* (app admins bypass). The system `leader` role cannot be deleted.
|
|
280
|
+
* **Destructive**: removes the role from any members that held it and
|
|
281
|
+
* recomputes any grid ACLs the role granted on.
|
|
282
|
+
*
|
|
283
|
+
* @param groupRoleId - The team role to delete (must be a non-system role),
|
|
284
|
+
* as a decimal `BigInt` string.
|
|
285
|
+
* @returns `true` if a role was deleted.
|
|
286
|
+
* @throws {CrowdyGraphQLError} `FORBIDDEN` / `SCOPE_MISSING` if the caller
|
|
287
|
+
* lacks `manage_roles`, `BAD_USER_INPUT` if targeting a system role, or
|
|
288
|
+
* `UNAUTHENTICATED`.
|
|
289
|
+
*/
|
|
32
290
|
deleteRole(groupRoleId: DeleteTeamRoleMutationVariables['groupRoleId']): Promise<boolean>;
|
|
33
291
|
}
|
|
34
292
|
//# sourceMappingURL=teams.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"teams.d.ts","sourceRoot":"","sources":["../../src/domains/teams.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAE1B,KAAK,UAAU,EACf,KAAK,mBAAmB,EAExB,KAAK,SAAS,EACd,KAAK,kBAAkB,EAEvB,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAE9B,KAAK,cAAc,EACnB,KAAK,uBAAuB,EAE5B,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAE7B,KAAK,qBAAqB,EAC1B,KAAK,8BAA8B,EAEnC,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAEhC,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAEhC,KAAK,2BAA2B,EAEhC,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAE9B,KAAK,yBAAyB,EAC9B,KAAK,kCAAkC,EAEvC,KAAK,0BAA0B,EAE/B,KAAK,qBAAqB,EAC1B,KAAK,8BAA8B,EAEnC,KAAK,iCAAiC,EAEtC,KAAK,0BAA0B,EAC/B,KAAK,mCAAmC,EAExC,KAAK,sBAAsB,EAC3B,KAAK,+BAA+B,EAEpC,KAAK,sBAAsB,EAC3B,KAAK,+BAA+B,EAEpC,KAAK,+BAA+B,EACrC,MAAM,yBAAyB,CAAC;AAEjC
|
|
1
|
+
{"version":3,"file":"teams.d.ts","sourceRoot":"","sources":["../../src/domains/teams.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAEL,KA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