@crowdedkingdoms/crowdyjs 18.0.0-dev.1 → 18.0.1-dev.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 +37 -0
- package/README.md +7 -5
- package/dist/domains/apps.d.ts +1 -10
- package/dist/domains/apps.d.ts.map +1 -1
- package/dist/domains/apps.js +1 -16
- package/dist/domains/hosting.d.ts +0 -6
- package/dist/domains/hosting.d.ts.map +1 -1
- package/dist/domains/hosting.js +1 -16
- package/dist/domains/organizations.d.ts +1 -9
- package/dist/domains/organizations.d.ts.map +1 -1
- package/dist/domains/organizations.js +1 -15
- package/dist/domains/payments.d.ts +5 -48
- package/dist/domains/payments.d.ts.map +1 -1
- package/dist/domains/payments.js +5 -57
- package/dist/domains/quotas.d.ts +20 -7
- package/dist/domains/quotas.d.ts.map +1 -1
- package/dist/domains/quotas.js +15 -6
- package/dist/domains/users.d.ts +7 -74
- package/dist/domains/users.d.ts.map +1 -1
- package/dist/domains/users.js +7 -105
- package/dist/generated/graphql.d.ts +0 -375
- package/dist/generated/graphql.d.ts.map +1 -1
- package/dist/generated/graphql.js +0 -16
- package/dist/grid-scope.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/kit/social.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/domains/users.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { GraphQLClient } from '../client.js';
|
|
2
|
-
import { type MeQuery, type UpdateGamertagInput, type UpdateGamertagMutation, type UserQuery, type
|
|
2
|
+
import { type MeQuery, type UpdateGamertagInput, type UpdateGamertagMutation, type UserQuery, type UpdateUserStateMutation, type UpdateUserStateInput, type FreePlayWindowQuery } from '../generated/graphql.js';
|
|
3
3
|
/**
|
|
4
4
|
* User identity & account management — exposed as `client.users`.
|
|
5
5
|
*
|
|
@@ -8,8 +8,8 @@ import { type MeQuery, type UpdateGamertagInput, type UpdateGamertagMutation, ty
|
|
|
8
8
|
* exposes these identity mutations — calling them against a game-api endpoint
|
|
9
9
|
* throws {@link CrowdyGraphQLError} with `FORBIDDEN`, directing you to the
|
|
10
10
|
* management API. Only the read/identity surface a game client realistically
|
|
11
|
-
* needs lives here; super-admin
|
|
12
|
-
*
|
|
11
|
+
* needs lives here; platform administration (super-admin and operator fields)
|
|
12
|
+
* is not in the SDK: call the API directly from your own tooling.
|
|
13
13
|
*
|
|
14
14
|
* Every method needs a valid session (a bearer token set by
|
|
15
15
|
* `client.auth.login()` / `register()` or `client.setToken()`); without one the
|
|
@@ -62,84 +62,17 @@ export declare class UsersAPI {
|
|
|
62
62
|
*/
|
|
63
63
|
freePlayWindow(): Promise<FreePlayWindowQuery['freePlayWindowInfo']>;
|
|
64
64
|
/**
|
|
65
|
-
* Look up
|
|
66
|
-
* their own profile via {@link me}).
|
|
65
|
+
* Look up a user by id. Requires a valid session.
|
|
67
66
|
*
|
|
68
67
|
* @param id - Numeric user id (`BigInt` as a decimal string).
|
|
69
68
|
* @returns The {@link User}, or `null` if no such user.
|
|
70
69
|
*/
|
|
71
70
|
get(id: string): Promise<UserQuery['user']>;
|
|
72
71
|
/**
|
|
73
|
-
*
|
|
72
|
+
* Replace the caller's own top-level state blob (base64; `null` clears it).
|
|
73
|
+
* Only ever writes the caller. Requires a valid session.
|
|
74
74
|
*
|
|
75
|
-
* @param
|
|
76
|
-
* `limit` / `offset`.
|
|
77
|
-
* @returns A page of users.
|
|
78
|
-
* @remarks Prefer {@link listConnection} (Relay cursor pagination) for large
|
|
79
|
-
* result sets; the offset args here are deprecated server-side.
|
|
80
|
-
*/
|
|
81
|
-
paginated(opts?: {
|
|
82
|
-
query?: UsersPaginatedQueryVariables['query'];
|
|
83
|
-
limit?: UsersPaginatedQueryVariables['limit'];
|
|
84
|
-
offset?: UsersPaginatedQueryVariables['offset'];
|
|
85
|
-
}): Promise<UsersPaginatedQuery['usersPaginated']>;
|
|
86
|
-
/**
|
|
87
|
-
* Relay-style cursor pagination over users — the preferred alternative to
|
|
88
|
-
* {@link paginated}. **Super-admin only.** Page with `first` plus the previous
|
|
89
|
-
* page's `pageInfo.endCursor` as `after`. See
|
|
90
|
-
* https://docs.crowdedkingdoms.com/overview/pagination.
|
|
91
|
-
*
|
|
92
|
-
* @param args - Optional `first`, `after`, and `query`.
|
|
93
|
-
* @returns A {@link UsersConnection}.
|
|
94
|
-
*/
|
|
95
|
-
listConnection(args?: UsersConnectionQueryVariables): Promise<UsersConnectionQuery['usersConnection']>;
|
|
96
|
-
/**
|
|
97
|
-
* Grant or revoke the platform `is_super_admin` flag on a user. **Super-admin
|
|
98
|
-
* only.**
|
|
99
|
-
*
|
|
100
|
-
* @param userId - Target user id.
|
|
101
|
-
* @param value - `true` to grant, `false` to revoke.
|
|
102
|
-
* @returns The updated user's `userId` + `isSuperAdmin`.
|
|
103
|
-
*/
|
|
104
|
-
setSuperAdmin(userId: string, value: boolean): Promise<SetSuperAdminMutation['setSuperAdmin']>;
|
|
105
|
-
/**
|
|
106
|
-
* Grant or revoke the platform `is_operator` flag (control-plane access) on a
|
|
107
|
-
* user. **Super-admin only.**
|
|
108
|
-
*
|
|
109
|
-
* @param userId - Target user id.
|
|
110
|
-
* @param value - `true` to grant, `false` to revoke.
|
|
111
|
-
* @returns The updated user's `userId` + `isOperator`.
|
|
112
|
-
*/
|
|
113
|
-
setOperator(userId: string, value: boolean): Promise<SetOperatorMutation['setOperator']>;
|
|
114
|
-
/**
|
|
115
|
-
* Force an early-access override on a user (bypasses the early-access gate).
|
|
116
|
-
* **Super-admin only.**
|
|
117
|
-
*
|
|
118
|
-
* @param userId - Target user id.
|
|
119
|
-
* @param value - `true` to grant the override, `false` to clear it.
|
|
120
|
-
* @returns The updated user's `userId` + `grantEarlyAccessOverride`.
|
|
121
|
-
*/
|
|
122
|
-
setEarlyAccessOverride(userId: string, value: boolean): Promise<SetEarlyAccessOverrideMutation['setEarlyAccessOverride']>;
|
|
123
|
-
/**
|
|
124
|
-
* Set a user's `user_type`. **Super-admin only.**
|
|
125
|
-
*
|
|
126
|
-
* @param userId - Target user id.
|
|
127
|
-
* @param value - The new user type string.
|
|
128
|
-
* @returns The updated user's `userId` + `userType`.
|
|
129
|
-
*/
|
|
130
|
-
updateType(userId: string, value: string): Promise<UpdateUserTypeMutation['updateUserType']>;
|
|
131
|
-
/**
|
|
132
|
-
* Revoke all of a user's sessions (force logout everywhere). **Super-admin
|
|
133
|
-
* only.**
|
|
134
|
-
*
|
|
135
|
-
* @param userId - Target user id.
|
|
136
|
-
* @returns `true` on success.
|
|
137
|
-
*/
|
|
138
|
-
forceLogout(userId: string): Promise<ForceLogoutUserMutation['forceLogoutUser']>;
|
|
139
|
-
/**
|
|
140
|
-
* Replace a user's top-level state blob. **Super-admin only.**
|
|
141
|
-
*
|
|
142
|
-
* @param input - {@link UpdateUserStateInput} (`userId` + base64 `state`).
|
|
75
|
+
* @param input - {@link UpdateUserStateInput}: the base64 `state`.
|
|
143
76
|
* @returns The updated user's `userId` + `state`.
|
|
144
77
|
*/
|
|
145
78
|
updateState(input: UpdateUserStateInput): Promise<UpdateUserStateMutation['updateUserState']>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../src/domains/users.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,
|
|
1
|
+
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../src/domains/users.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAOL,KAAK,OAAO,EACZ,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,SAAS,EACd,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACzB,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,QAAQ;IACP,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,aAAa;IAEnD;;;;;;;OAOG;IACG,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAKlC;;;;;;;;;;;;;OAaG;IACG,cAAc,CAClB,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,sBAAsB,CAAC,gBAAgB,CAAC,CAAC;IAKpD;;;;;;;;;OASG;IACG,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC;IAKzC;;;;;OAKG;IACG,cAAc,IAAI,OAAO,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;IAK1E;;;;;OAKG;IACG,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAKjD;;;;;;OAMG;IACG,WAAW,CACf,KAAK,EAAE,oBAAoB,GAC1B,OAAO,CAAC,uBAAuB,CAAC,iBAAiB,CAAC,CAAC;CAIvD"}
|
package/dist/domains/users.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MeDocument, UpdateGamertagDocument, DeleteMyAccountDocument, UserDocument,
|
|
1
|
+
import { MeDocument, UpdateGamertagDocument, DeleteMyAccountDocument, UserDocument, UpdateUserStateDocument, FreePlayWindowDocument, } from '../generated/graphql.js';
|
|
2
2
|
/**
|
|
3
3
|
* User identity & account management — exposed as `client.users`.
|
|
4
4
|
*
|
|
@@ -7,8 +7,8 @@ import { MeDocument, UpdateGamertagDocument, DeleteMyAccountDocument, UserDocume
|
|
|
7
7
|
* exposes these identity mutations — calling them against a game-api endpoint
|
|
8
8
|
* throws {@link CrowdyGraphQLError} with `FORBIDDEN`, directing you to the
|
|
9
9
|
* management API. Only the read/identity surface a game client realistically
|
|
10
|
-
* needs lives here; super-admin
|
|
11
|
-
*
|
|
10
|
+
* needs lives here; platform administration (super-admin and operator fields)
|
|
11
|
+
* is not in the SDK: call the API directly from your own tooling.
|
|
12
12
|
*
|
|
13
13
|
* Every method needs a valid session (a bearer token set by
|
|
14
14
|
* `client.auth.login()` / `register()` or `client.setToken()`); without one the
|
|
@@ -74,8 +74,7 @@ export class UsersAPI {
|
|
|
74
74
|
return data.freePlayWindowInfo;
|
|
75
75
|
}
|
|
76
76
|
/**
|
|
77
|
-
* Look up
|
|
78
|
-
* their own profile via {@link me}).
|
|
77
|
+
* Look up a user by id. Requires a valid session.
|
|
79
78
|
*
|
|
80
79
|
* @param id - Numeric user id (`BigInt` as a decimal string).
|
|
81
80
|
* @returns The {@link User}, or `null` if no such user.
|
|
@@ -85,107 +84,10 @@ export class UsersAPI {
|
|
|
85
84
|
return data.user;
|
|
86
85
|
}
|
|
87
86
|
/**
|
|
88
|
-
*
|
|
87
|
+
* Replace the caller's own top-level state blob (base64; `null` clears it).
|
|
88
|
+
* Only ever writes the caller. Requires a valid session.
|
|
89
89
|
*
|
|
90
|
-
* @param
|
|
91
|
-
* `limit` / `offset`.
|
|
92
|
-
* @returns A page of users.
|
|
93
|
-
* @remarks Prefer {@link listConnection} (Relay cursor pagination) for large
|
|
94
|
-
* result sets; the offset args here are deprecated server-side.
|
|
95
|
-
*/
|
|
96
|
-
async paginated(opts = {}) {
|
|
97
|
-
const data = await this.graphql.request(UsersPaginatedDocument, opts);
|
|
98
|
-
return data.usersPaginated;
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Relay-style cursor pagination over users — the preferred alternative to
|
|
102
|
-
* {@link paginated}. **Super-admin only.** Page with `first` plus the previous
|
|
103
|
-
* page's `pageInfo.endCursor` as `after`. See
|
|
104
|
-
* https://docs.crowdedkingdoms.com/overview/pagination.
|
|
105
|
-
*
|
|
106
|
-
* @param args - Optional `first`, `after`, and `query`.
|
|
107
|
-
* @returns A {@link UsersConnection}.
|
|
108
|
-
*/
|
|
109
|
-
async listConnection(args = {}) {
|
|
110
|
-
const data = await this.graphql.request(UsersConnectionDocument, args);
|
|
111
|
-
return data.usersConnection;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Grant or revoke the platform `is_super_admin` flag on a user. **Super-admin
|
|
115
|
-
* only.**
|
|
116
|
-
*
|
|
117
|
-
* @param userId - Target user id.
|
|
118
|
-
* @param value - `true` to grant, `false` to revoke.
|
|
119
|
-
* @returns The updated user's `userId` + `isSuperAdmin`.
|
|
120
|
-
*/
|
|
121
|
-
async setSuperAdmin(userId, value) {
|
|
122
|
-
const data = await this.graphql.request(SetSuperAdminDocument, {
|
|
123
|
-
userId,
|
|
124
|
-
value,
|
|
125
|
-
});
|
|
126
|
-
return data.setSuperAdmin;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Grant or revoke the platform `is_operator` flag (control-plane access) on a
|
|
130
|
-
* user. **Super-admin only.**
|
|
131
|
-
*
|
|
132
|
-
* @param userId - Target user id.
|
|
133
|
-
* @param value - `true` to grant, `false` to revoke.
|
|
134
|
-
* @returns The updated user's `userId` + `isOperator`.
|
|
135
|
-
*/
|
|
136
|
-
async setOperator(userId, value) {
|
|
137
|
-
const data = await this.graphql.request(SetOperatorDocument, {
|
|
138
|
-
userId,
|
|
139
|
-
value,
|
|
140
|
-
});
|
|
141
|
-
return data.setOperator;
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Force an early-access override on a user (bypasses the early-access gate).
|
|
145
|
-
* **Super-admin only.**
|
|
146
|
-
*
|
|
147
|
-
* @param userId - Target user id.
|
|
148
|
-
* @param value - `true` to grant the override, `false` to clear it.
|
|
149
|
-
* @returns The updated user's `userId` + `grantEarlyAccessOverride`.
|
|
150
|
-
*/
|
|
151
|
-
async setEarlyAccessOverride(userId, value) {
|
|
152
|
-
const data = await this.graphql.request(SetEarlyAccessOverrideDocument, {
|
|
153
|
-
userId,
|
|
154
|
-
value,
|
|
155
|
-
});
|
|
156
|
-
return data.setEarlyAccessOverride;
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Set a user's `user_type`. **Super-admin only.**
|
|
160
|
-
*
|
|
161
|
-
* @param userId - Target user id.
|
|
162
|
-
* @param value - The new user type string.
|
|
163
|
-
* @returns The updated user's `userId` + `userType`.
|
|
164
|
-
*/
|
|
165
|
-
async updateType(userId, value) {
|
|
166
|
-
const data = await this.graphql.request(UpdateUserTypeDocument, {
|
|
167
|
-
userId,
|
|
168
|
-
value,
|
|
169
|
-
});
|
|
170
|
-
return data.updateUserType;
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Revoke all of a user's sessions (force logout everywhere). **Super-admin
|
|
174
|
-
* only.**
|
|
175
|
-
*
|
|
176
|
-
* @param userId - Target user id.
|
|
177
|
-
* @returns `true` on success.
|
|
178
|
-
*/
|
|
179
|
-
async forceLogout(userId) {
|
|
180
|
-
const data = await this.graphql.request(ForceLogoutUserDocument, {
|
|
181
|
-
userId,
|
|
182
|
-
});
|
|
183
|
-
return data.forceLogoutUser;
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Replace a user's top-level state blob. **Super-admin only.**
|
|
187
|
-
*
|
|
188
|
-
* @param input - {@link UpdateUserStateInput} (`userId` + base64 `state`).
|
|
90
|
+
* @param input - {@link UpdateUserStateInput}: the base64 `state`.
|
|
189
91
|
* @returns The updated user's `userId` + `state`.
|
|
190
92
|
*/
|
|
191
93
|
async updateState(input) {
|