@crowdedkingdoms/crowdyjs 13.9.0 → 14.1.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/MIGRATION.md +44 -0
- package/README.md +68 -33
- package/dist/binary-relay.d.ts +1 -1
- package/dist/binary-relay.js +1 -1
- package/dist/client.d.ts +27 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +61 -2
- package/dist/crowdy-client.d.ts +29 -34
- package/dist/crowdy-client.d.ts.map +1 -1
- package/dist/crowdy-client.js +67 -40
- package/dist/datacenter-redirect.d.ts +49 -0
- package/dist/datacenter-redirect.d.ts.map +1 -0
- package/dist/datacenter-redirect.js +62 -0
- package/dist/domains/appAccess.d.ts +3 -3
- package/dist/domains/appAccess.d.ts.map +1 -1
- package/dist/domains/appAccess.js +16 -16
- package/dist/domains/apps.d.ts +4 -8
- package/dist/domains/apps.d.ts.map +1 -1
- package/dist/domains/apps.js +19 -23
- package/dist/domains/auth.d.ts +1 -1
- package/dist/domains/billing.d.ts +3 -3
- package/dist/domains/billing.d.ts.map +1 -1
- package/dist/domains/billing.js +9 -9
- package/dist/domains/controlPlane.d.ts +2 -2
- package/dist/domains/controlPlane.d.ts.map +1 -1
- package/dist/domains/controlPlane.js +4 -4
- package/dist/domains/discovery.d.ts +50 -0
- package/dist/domains/discovery.d.ts.map +1 -0
- package/dist/domains/discovery.js +35 -0
- package/dist/domains/marketplace.d.ts +4 -5
- package/dist/domains/marketplace.d.ts.map +1 -1
- package/dist/domains/marketplace.js +25 -26
- package/dist/domains/organizations.d.ts +3 -3
- package/dist/domains/organizations.d.ts.map +1 -1
- package/dist/domains/organizations.js +22 -22
- package/dist/domains/payments.d.ts +3 -3
- package/dist/domains/payments.d.ts.map +1 -1
- package/dist/domains/payments.js +11 -11
- package/dist/domains/platform.d.ts +5 -6
- package/dist/domains/platform.d.ts.map +1 -1
- package/dist/domains/platform.js +6 -7
- package/dist/domains/portal.d.ts +19 -2
- package/dist/domains/portal.d.ts.map +1 -1
- package/dist/domains/portal.js +12 -12
- package/dist/domains/quotas.d.ts +3 -3
- package/dist/domains/quotas.d.ts.map +1 -1
- package/dist/domains/quotas.js +8 -8
- package/dist/domains/serverStatus.d.ts +1 -2
- package/dist/domains/serverStatus.d.ts.map +1 -1
- package/dist/domains/serverStatus.js +1 -2
- package/dist/domains/sharedEnvironment.d.ts +3 -3
- package/dist/domains/sharedEnvironment.d.ts.map +1 -1
- package/dist/domains/sharedEnvironment.js +15 -15
- package/dist/domains/udp.d.ts +1 -1
- package/dist/domains/udp.js +1 -1
- package/dist/domains/usage.d.ts +2 -2
- package/dist/domains/usage.d.ts.map +1 -1
- package/dist/domains/usage.js +5 -5
- package/dist/domains/users.d.ts +1 -1
- package/dist/domains/users.js +1 -1
- package/dist/errors.d.ts +56 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +64 -0
- package/dist/generated/graphql.d.ts +65 -16
- package/dist/generated/graphql.d.ts.map +1 -1
- package/dist/generated/graphql.js +1 -0
- package/dist/index.d.ts +13 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -17
- package/dist/kit/decks.d.ts +1 -1
- package/dist/kit/npcs.d.ts +2 -2
- package/dist/kit/npcs.d.ts.map +1 -1
- package/dist/kit/social.d.ts.map +1 -1
- package/dist/kit/worldsim.d.ts +1 -1
- package/dist/realtime.d.ts +26 -0
- package/dist/realtime.d.ts.map +1 -1
- package/dist/realtime.js +83 -0
- package/dist/rediscover.d.ts +7 -3
- package/dist/rediscover.d.ts.map +1 -1
- package/dist/rediscover.js +7 -3
- package/dist/session.d.ts +21 -0
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +23 -0
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { OrganizationDocument, OrganizationBySlugDocument, MyOrganizationsDocume
|
|
|
3
3
|
* Organizations, members, roles (RBAC), and org API tokens — exposed as
|
|
4
4
|
* `client.organizations` (and grouped under `client.admin`).
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* Part of the management surface. This is the studio-admin surface: an
|
|
7
7
|
* organization owns apps, billing, quotas, and environments, and its RBAC
|
|
8
8
|
* grants (`manage_members`, `manage_tokens`, ...) gate the rest of the admin
|
|
9
9
|
* APIs. Most operations require an authenticated caller who is an active member
|
|
@@ -17,8 +17,8 @@ import { OrganizationDocument, OrganizationBySlugDocument, MyOrganizationsDocume
|
|
|
17
17
|
* / `SCOPE_MISSING` when the caller lacks the required org permission.
|
|
18
18
|
*/
|
|
19
19
|
export class OrganizationsAPI {
|
|
20
|
-
constructor(
|
|
21
|
-
this.
|
|
20
|
+
constructor(api) {
|
|
21
|
+
this.api = api;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* Fetch a single organization by numeric id. Requires authentication.
|
|
@@ -27,7 +27,7 @@ export class OrganizationsAPI {
|
|
|
27
27
|
* @returns The {@link Organization}, or `null` if it does not exist.
|
|
28
28
|
*/
|
|
29
29
|
async get(orgId) {
|
|
30
|
-
const data = await this.
|
|
30
|
+
const data = await this.api.request(OrganizationDocument, {
|
|
31
31
|
id: orgId,
|
|
32
32
|
});
|
|
33
33
|
return data.organization;
|
|
@@ -39,7 +39,7 @@ export class OrganizationsAPI {
|
|
|
39
39
|
* @returns The {@link Organization}, or `null` if no match.
|
|
40
40
|
*/
|
|
41
41
|
async bySlug(slug) {
|
|
42
|
-
const data = await this.
|
|
42
|
+
const data = await this.api.request(OrganizationBySlugDocument, {
|
|
43
43
|
slug,
|
|
44
44
|
});
|
|
45
45
|
return data.organizationBySlug;
|
|
@@ -52,7 +52,7 @@ export class OrganizationsAPI {
|
|
|
52
52
|
* no orgs).
|
|
53
53
|
*/
|
|
54
54
|
async mine() {
|
|
55
|
-
const data = await this.
|
|
55
|
+
const data = await this.api.request(MyOrganizationsDocument, {});
|
|
56
56
|
return data.myOrganizations;
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
@@ -63,7 +63,7 @@ export class OrganizationsAPI {
|
|
|
63
63
|
* @returns The org's members with their roles.
|
|
64
64
|
*/
|
|
65
65
|
async members(orgId) {
|
|
66
|
-
const data = await this.
|
|
66
|
+
const data = await this.api.request(OrgMembersDocument, { orgId });
|
|
67
67
|
return data.orgMembers;
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
@@ -74,7 +74,7 @@ export class OrganizationsAPI {
|
|
|
74
74
|
* @returns The org's roles.
|
|
75
75
|
*/
|
|
76
76
|
async roles(orgId) {
|
|
77
|
-
const data = await this.
|
|
77
|
+
const data = await this.api.request(OrgRolesDocument, { orgId });
|
|
78
78
|
return data.orgRoles;
|
|
79
79
|
}
|
|
80
80
|
/**
|
|
@@ -85,7 +85,7 @@ export class OrganizationsAPI {
|
|
|
85
85
|
* @returns The member's roles.
|
|
86
86
|
*/
|
|
87
87
|
async memberRoles(orgMemberId) {
|
|
88
|
-
const data = await this.
|
|
88
|
+
const data = await this.api.request(MemberRolesDocument, {
|
|
89
89
|
orgMemberId,
|
|
90
90
|
});
|
|
91
91
|
return data.memberRoles;
|
|
@@ -97,7 +97,7 @@ export class OrganizationsAPI {
|
|
|
97
97
|
* @returns The catalog of org permissions.
|
|
98
98
|
*/
|
|
99
99
|
async permissions() {
|
|
100
|
-
const data = await this.
|
|
100
|
+
const data = await this.api.request(OrgPermissionsDocument, {});
|
|
101
101
|
return data.orgPermissions;
|
|
102
102
|
}
|
|
103
103
|
/**
|
|
@@ -108,7 +108,7 @@ export class OrganizationsAPI {
|
|
|
108
108
|
* @returns The org's API tokens.
|
|
109
109
|
*/
|
|
110
110
|
async tokens(orgId) {
|
|
111
|
-
const data = await this.
|
|
111
|
+
const data = await this.api.request(OrgTokensDocument, { orgId });
|
|
112
112
|
return data.orgTokens;
|
|
113
113
|
}
|
|
114
114
|
/**
|
|
@@ -119,7 +119,7 @@ export class OrganizationsAPI {
|
|
|
119
119
|
* @returns The created {@link Organization}.
|
|
120
120
|
*/
|
|
121
121
|
async create(input) {
|
|
122
|
-
const data = await this.
|
|
122
|
+
const data = await this.api.request(CreateOrganizationDocument, {
|
|
123
123
|
input,
|
|
124
124
|
});
|
|
125
125
|
return data.createOrganization;
|
|
@@ -132,7 +132,7 @@ export class OrganizationsAPI {
|
|
|
132
132
|
* @returns The updated {@link Organization}.
|
|
133
133
|
*/
|
|
134
134
|
async setStatus(orgId, status) {
|
|
135
|
-
const data = await this.
|
|
135
|
+
const data = await this.api.request(SetOrgStatusDocument, {
|
|
136
136
|
orgId,
|
|
137
137
|
status,
|
|
138
138
|
});
|
|
@@ -147,7 +147,7 @@ export class OrganizationsAPI {
|
|
|
147
147
|
* @returns The created token including its one-time plaintext secret.
|
|
148
148
|
*/
|
|
149
149
|
async createToken(input) {
|
|
150
|
-
const data = await this.
|
|
150
|
+
const data = await this.api.request(CreateOrgTokenDocument, {
|
|
151
151
|
input,
|
|
152
152
|
});
|
|
153
153
|
return data.createOrgToken;
|
|
@@ -161,7 +161,7 @@ export class OrganizationsAPI {
|
|
|
161
161
|
* @returns The updated token metadata.
|
|
162
162
|
*/
|
|
163
163
|
async updateToken(orgTokenId, input) {
|
|
164
|
-
const data = await this.
|
|
164
|
+
const data = await this.api.request(UpdateOrgTokenDocument, {
|
|
165
165
|
orgTokenId,
|
|
166
166
|
input,
|
|
167
167
|
});
|
|
@@ -174,7 +174,7 @@ export class OrganizationsAPI {
|
|
|
174
174
|
* @returns `true` on success.
|
|
175
175
|
*/
|
|
176
176
|
async revokeToken(orgTokenId) {
|
|
177
|
-
const data = await this.
|
|
177
|
+
const data = await this.api.request(RevokeOrgTokenDocument, {
|
|
178
178
|
orgTokenId,
|
|
179
179
|
});
|
|
180
180
|
return data.revokeOrgToken;
|
|
@@ -187,7 +187,7 @@ export class OrganizationsAPI {
|
|
|
187
187
|
* @returns The created membership.
|
|
188
188
|
*/
|
|
189
189
|
async inviteMember(input) {
|
|
190
|
-
const data = await this.
|
|
190
|
+
const data = await this.api.request(InviteOrgMemberDocument, {
|
|
191
191
|
input,
|
|
192
192
|
});
|
|
193
193
|
return data.inviteOrgMember;
|
|
@@ -201,7 +201,7 @@ export class OrganizationsAPI {
|
|
|
201
201
|
* @returns `true` on success.
|
|
202
202
|
*/
|
|
203
203
|
async removeMember(orgId, userId) {
|
|
204
|
-
const data = await this.
|
|
204
|
+
const data = await this.api.request(RemoveOrgMemberDocument, {
|
|
205
205
|
orgId,
|
|
206
206
|
userId,
|
|
207
207
|
});
|
|
@@ -217,7 +217,7 @@ export class OrganizationsAPI {
|
|
|
217
217
|
* @returns The updated membership.
|
|
218
218
|
*/
|
|
219
219
|
async setMemberRoles(orgId, userId, roleIds) {
|
|
220
|
-
const data = await this.
|
|
220
|
+
const data = await this.api.request(UpdateOrgMemberRolesDocument, {
|
|
221
221
|
orgId,
|
|
222
222
|
userId,
|
|
223
223
|
roleIds,
|
|
@@ -233,7 +233,7 @@ export class OrganizationsAPI {
|
|
|
233
233
|
* @returns The created {@link OrgRole}.
|
|
234
234
|
*/
|
|
235
235
|
async createRole(input) {
|
|
236
|
-
const data = await this.
|
|
236
|
+
const data = await this.api.request(CreateOrgRoleDocument, {
|
|
237
237
|
input,
|
|
238
238
|
});
|
|
239
239
|
return data.createOrgRole;
|
|
@@ -247,7 +247,7 @@ export class OrganizationsAPI {
|
|
|
247
247
|
* @returns The updated {@link OrgRole}.
|
|
248
248
|
*/
|
|
249
249
|
async updateRole(orgRoleId, input) {
|
|
250
|
-
const data = await this.
|
|
250
|
+
const data = await this.api.request(UpdateOrgRoleDocument, {
|
|
251
251
|
orgRoleId,
|
|
252
252
|
input,
|
|
253
253
|
});
|
|
@@ -261,7 +261,7 @@ export class OrganizationsAPI {
|
|
|
261
261
|
* @returns `true` on success.
|
|
262
262
|
*/
|
|
263
263
|
async deleteRole(orgRoleId) {
|
|
264
|
-
const data = await this.
|
|
264
|
+
const data = await this.api.request(DeleteOrgRoleDocument, {
|
|
265
265
|
orgRoleId,
|
|
266
266
|
});
|
|
267
267
|
return data.deleteOrgRole;
|
|
@@ -4,7 +4,7 @@ import { type MyCheckoutsQuery, type MyCheckoutsConnectionQuery, type MyCheckout
|
|
|
4
4
|
* Payment checkouts (wallet top-ups, plan purchases) — exposed as
|
|
5
5
|
* `client.payments` (and grouped under `client.admin`).
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* Part of the management surface. {@link create} and {@link mine} require an
|
|
8
8
|
* authenticated caller and act on their own checkouts; {@link all} is
|
|
9
9
|
* super-admin only. Amounts are minor currency units (`*Cents`).
|
|
10
10
|
*
|
|
@@ -16,8 +16,8 @@ import { type MyCheckoutsQuery, type MyCheckoutsConnectionQuery, type MyCheckout
|
|
|
16
16
|
* above.
|
|
17
17
|
*/
|
|
18
18
|
export declare class PaymentsAPI {
|
|
19
|
-
private readonly
|
|
20
|
-
constructor(
|
|
19
|
+
private readonly api;
|
|
20
|
+
constructor(api: GraphQLClient);
|
|
21
21
|
/**
|
|
22
22
|
* Start a checkout (e.g. an `ORG_WALLET_TOPUP`). Requires authentication.
|
|
23
23
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payments.d.ts","sourceRoot":"","sources":["../../src/domains/payments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EASL,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAC/B,KAAK,mCAAmC,EACxC,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC7B,KAAK,iCAAiC,EACtC,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,6BAA6B,EAClC,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,KAAK,qCAAqC,EAC3C,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;;;;GAcG;AACH,qBAAa,WAAW;IACV,OAAO,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"payments.d.ts","sourceRoot":"","sources":["../../src/domains/payments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AAC,uBAAuB,CAAC,CAAC;IAQ/D;;;;;;OAMG;IACG,aAAa,CACjB,IAAI,GAAE,iCAAsC,GAC3C,OAAO,CAAC,wBAAwB,CAAC,qBAAqB,CAAC,CAAC;IAQ3D;;;;;;;;OAQG;IACG,MAAM,CACV,IAAI,GAAE;QACJ,KAAK,CAAC,EAAE,2BAA2B,CAAC,OAAO,CAAC,CAAC;QAC7C,MAAM,CAAC,EAAE,2BAA2B,CAAC,QAAQ,CAAC,CAAC;KAC3C,GACL,OAAO,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC;IAK/C;;;;;;OAMG;IACG,gBAAgB,CACpB,IAAI,GAAE,qCAA0C,GAC/C,OAAO,CAAC,4BAA4B,CAAC,yBAAyB,CAAC,CAAC;CAOpE"}
|
package/dist/domains/payments.js
CHANGED
|
@@ -3,7 +3,7 @@ import { MyCheckoutsDocument, MyCheckoutsConnectionDocument, CheckoutsDocument,
|
|
|
3
3
|
* Payment checkouts (wallet top-ups, plan purchases) — exposed as
|
|
4
4
|
* `client.payments` (and grouped under `client.admin`).
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* Part of the management surface. {@link create} and {@link mine} require an
|
|
7
7
|
* authenticated caller and act on their own checkouts; {@link all} is
|
|
8
8
|
* super-admin only. Amounts are minor currency units (`*Cents`).
|
|
9
9
|
*
|
|
@@ -15,8 +15,8 @@ import { MyCheckoutsDocument, MyCheckoutsConnectionDocument, CheckoutsDocument,
|
|
|
15
15
|
* above.
|
|
16
16
|
*/
|
|
17
17
|
export class PaymentsAPI {
|
|
18
|
-
constructor(
|
|
19
|
-
this.
|
|
18
|
+
constructor(api) {
|
|
19
|
+
this.api = api;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Start a checkout (e.g. an `ORG_WALLET_TOPUP`). Requires authentication.
|
|
@@ -26,7 +26,7 @@ export class PaymentsAPI {
|
|
|
26
26
|
* @returns The created checkout including the provider redirect/approval URL.
|
|
27
27
|
*/
|
|
28
28
|
async create(input) {
|
|
29
|
-
const data = await this.
|
|
29
|
+
const data = await this.api.request(CreateCheckoutDocument, {
|
|
30
30
|
input,
|
|
31
31
|
});
|
|
32
32
|
return data.createCheckout;
|
|
@@ -38,7 +38,7 @@ export class PaymentsAPI {
|
|
|
38
38
|
* @returns The caller's checkouts.
|
|
39
39
|
*/
|
|
40
40
|
async mine(opts = {}) {
|
|
41
|
-
const data = await this.
|
|
41
|
+
const data = await this.api.request(MyCheckoutsDocument, {
|
|
42
42
|
limit: opts.limit,
|
|
43
43
|
offset: opts.offset,
|
|
44
44
|
});
|
|
@@ -53,7 +53,7 @@ export class PaymentsAPI {
|
|
|
53
53
|
* @returns The matching checkouts.
|
|
54
54
|
*/
|
|
55
55
|
async all(opts = {}) {
|
|
56
|
-
const data = await this.
|
|
56
|
+
const data = await this.api.request(CheckoutsDocument, {
|
|
57
57
|
filter: opts.filter,
|
|
58
58
|
limit: opts.limit,
|
|
59
59
|
offset: opts.offset,
|
|
@@ -73,7 +73,7 @@ export class PaymentsAPI {
|
|
|
73
73
|
* @returns The finalized {@link Checkout}.
|
|
74
74
|
*/
|
|
75
75
|
async capturePaypal(orderId, idempotencyKey) {
|
|
76
|
-
const data = await this.
|
|
76
|
+
const data = await this.api.request(CapturePaypalCheckoutDocument, {
|
|
77
77
|
orderId,
|
|
78
78
|
idempotencyKey,
|
|
79
79
|
});
|
|
@@ -88,7 +88,7 @@ export class PaymentsAPI {
|
|
|
88
88
|
* @returns A checkouts connection.
|
|
89
89
|
*/
|
|
90
90
|
async mineConnection(args = {}) {
|
|
91
|
-
const data = await this.
|
|
91
|
+
const data = await this.api.request(MyCheckoutsConnectionDocument, args);
|
|
92
92
|
return data.myCheckoutsConnection;
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
@@ -99,7 +99,7 @@ export class PaymentsAPI {
|
|
|
99
99
|
* @returns A checkouts connection.
|
|
100
100
|
*/
|
|
101
101
|
async allConnection(args = {}) {
|
|
102
|
-
const data = await this.
|
|
102
|
+
const data = await this.api.request(CheckoutsConnectionDocument, args);
|
|
103
103
|
return data.checkoutsConnection;
|
|
104
104
|
}
|
|
105
105
|
/**
|
|
@@ -112,7 +112,7 @@ export class PaymentsAPI {
|
|
|
112
112
|
* offset args here are deprecated server-side.
|
|
113
113
|
*/
|
|
114
114
|
async events(opts = {}) {
|
|
115
|
-
const data = await this.
|
|
115
|
+
const data = await this.api.request(PaymentEventsDocument, opts);
|
|
116
116
|
return data.paymentEvents;
|
|
117
117
|
}
|
|
118
118
|
/**
|
|
@@ -123,7 +123,7 @@ export class PaymentsAPI {
|
|
|
123
123
|
* @returns A payment-events connection.
|
|
124
124
|
*/
|
|
125
125
|
async eventsConnection(args = {}) {
|
|
126
|
-
const data = await this.
|
|
126
|
+
const data = await this.api.request(PaymentEventsConnectionDocument, args);
|
|
127
127
|
return data.paymentEventsConnection;
|
|
128
128
|
}
|
|
129
129
|
}
|
|
@@ -15,17 +15,16 @@ export interface PlatformConfig {
|
|
|
15
15
|
/**
|
|
16
16
|
* Public platform discovery — exposed as `client.platform`.
|
|
17
17
|
*
|
|
18
|
-
*
|
|
18
|
+
* Part of the management surface.
|
|
19
19
|
* **Public**: no authentication required. Lets a client discover the shared
|
|
20
20
|
* game-api URL (for apps published to the shared environment) *before* it has a
|
|
21
|
-
* per-app endpoint, then build a
|
|
21
|
+
* per-app endpoint, then build a per-app `CrowdyClient` against it.
|
|
22
22
|
*
|
|
23
23
|
* @example
|
|
24
24
|
* ```ts
|
|
25
|
-
* const base = createCrowdyClient({
|
|
25
|
+
* const base = createCrowdyClient({ httpUrl: 'https://api.example.com/graphql' });
|
|
26
26
|
* const cfg = await base.platform.config();
|
|
27
27
|
* const gameClient = createCrowdyClient({
|
|
28
|
-
* managementUrl: 'https://api.example.com',
|
|
29
28
|
* httpUrl: cfg.sharedGameApiUrl ?? undefined,
|
|
30
29
|
* wsUrl: cfg.sharedGameApiWsUrl ?? undefined,
|
|
31
30
|
* tokenStore: base.session.tokenStore,
|
|
@@ -33,8 +32,8 @@ export interface PlatformConfig {
|
|
|
33
32
|
* ```
|
|
34
33
|
*/
|
|
35
34
|
export declare class PlatformAPI {
|
|
36
|
-
private readonly
|
|
37
|
-
constructor(
|
|
35
|
+
private readonly api;
|
|
36
|
+
constructor(api: GraphQLClient);
|
|
38
37
|
/**
|
|
39
38
|
* Fetch public platform discovery: the shared game-api URL clients use for
|
|
40
39
|
* shared-environment apps, plus the free shared-app quota. **Public** — no
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/domains/platform.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,sFAAsF;IACtF,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,mFAAmF;IACnF,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,gFAAgF;IAChF,cAAc,EAAE,MAAM,CAAC;CACxB;AAiBD
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/domains/platform.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,sFAAsF;IACtF,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,mFAAmF;IACnF,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,gFAAgF;IAChF,cAAc,EAAE,MAAM,CAAC;CACxB;AAiBD;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,WAAW;IACV,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,aAAa;IAE/C;;;;;;;;OAQG;IACG,MAAM,IAAI,OAAO,CAAC,cAAc,CAAC;CAIxC"}
|
package/dist/domains/platform.js
CHANGED
|
@@ -13,17 +13,16 @@ const PlatformConfigDocument = parse(/* GraphQL */ `
|
|
|
13
13
|
/**
|
|
14
14
|
* Public platform discovery — exposed as `client.platform`.
|
|
15
15
|
*
|
|
16
|
-
*
|
|
16
|
+
* Part of the management surface.
|
|
17
17
|
* **Public**: no authentication required. Lets a client discover the shared
|
|
18
18
|
* game-api URL (for apps published to the shared environment) *before* it has a
|
|
19
|
-
* per-app endpoint, then build a
|
|
19
|
+
* per-app endpoint, then build a per-app `CrowdyClient` against it.
|
|
20
20
|
*
|
|
21
21
|
* @example
|
|
22
22
|
* ```ts
|
|
23
|
-
* const base = createCrowdyClient({
|
|
23
|
+
* const base = createCrowdyClient({ httpUrl: 'https://api.example.com/graphql' });
|
|
24
24
|
* const cfg = await base.platform.config();
|
|
25
25
|
* const gameClient = createCrowdyClient({
|
|
26
|
-
* managementUrl: 'https://api.example.com',
|
|
27
26
|
* httpUrl: cfg.sharedGameApiUrl ?? undefined,
|
|
28
27
|
* wsUrl: cfg.sharedGameApiWsUrl ?? undefined,
|
|
29
28
|
* tokenStore: base.session.tokenStore,
|
|
@@ -31,8 +30,8 @@ const PlatformConfigDocument = parse(/* GraphQL */ `
|
|
|
31
30
|
* ```
|
|
32
31
|
*/
|
|
33
32
|
export class PlatformAPI {
|
|
34
|
-
constructor(
|
|
35
|
-
this.
|
|
33
|
+
constructor(api) {
|
|
34
|
+
this.api = api;
|
|
36
35
|
}
|
|
37
36
|
/**
|
|
38
37
|
* Fetch public platform discovery: the shared game-api URL clients use for
|
|
@@ -44,7 +43,7 @@ export class PlatformAPI {
|
|
|
44
43
|
* @throws {CrowdyGraphQLError} on transport/validation failures.
|
|
45
44
|
*/
|
|
46
45
|
async config() {
|
|
47
|
-
const data = await this.
|
|
46
|
+
const data = await this.api.request(PlatformConfigDocument, {});
|
|
48
47
|
return data.platformConfig;
|
|
49
48
|
}
|
|
50
49
|
}
|
package/dist/domains/portal.d.ts
CHANGED
|
@@ -37,6 +37,23 @@ export interface AppTokenResponse {
|
|
|
37
37
|
gameApiUrl: string | null;
|
|
38
38
|
/** WebSocket URL of the Game API serving this app. */
|
|
39
39
|
gameApiWsUrl: string | null;
|
|
40
|
+
/**
|
|
41
|
+
* Stable entry origin that reaches SOME healthy instance, whatever has failed.
|
|
42
|
+
*
|
|
43
|
+
* WHY THIS IS NOT `gameApiUrl`. The published origin resolves to EVERY datacenter's
|
|
44
|
+
* load balancer, while `gameApiUrl` is the ONE datacenter holding this app's shards.
|
|
45
|
+
* So `gameApiUrl` is where the gameplay goes and this is the way back: it is the only
|
|
46
|
+
* address that survives losing a datacenter.
|
|
47
|
+
*
|
|
48
|
+
* It matters most for a client holding only an app token, which is the normal state
|
|
49
|
+
* after a portal entry. Such a client CANNOT re-mint — minting needs the identity
|
|
50
|
+
* session it does not have — so without this it has nothing left to ask when its
|
|
51
|
+
* endpoint stops answering. Pass it as `realtime.discoveryUrl` and the SDK builds
|
|
52
|
+
* re-discovery from it.
|
|
53
|
+
*
|
|
54
|
+
* Null against a Game API older than the datacenter rebuild, which did not return it.
|
|
55
|
+
*/
|
|
56
|
+
discoveryUrl: string | null;
|
|
40
57
|
/** Browser launch URL for this app, if configured. */
|
|
41
58
|
launchUrl: string | null;
|
|
42
59
|
}
|
|
@@ -95,10 +112,10 @@ export interface BeginEntryParams {
|
|
|
95
112
|
state?: string;
|
|
96
113
|
}
|
|
97
114
|
export declare class PortalAPI {
|
|
98
|
-
private readonly
|
|
115
|
+
private readonly api;
|
|
99
116
|
private readonly session;
|
|
100
117
|
private readonly pkceStore;
|
|
101
|
-
constructor(
|
|
118
|
+
constructor(api: GraphQLClient, session: SessionStore, pkceStore?: PkceStore);
|
|
102
119
|
/**
|
|
103
120
|
* Native/direct mint: exchange the caller's identity session token for an
|
|
104
121
|
* app-scoped gameplay token. Returns the token; it is NOT stored on this
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../src/domains/portal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;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G;IACG,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;CAUvE"}
|
package/dist/domains/portal.js
CHANGED
|
@@ -43,7 +43,7 @@ export class BrowserSessionPkceStore {
|
|
|
43
43
|
this.ss()?.removeItem(this.prefix + state);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
const APP_TOKEN_FIELDS = 'token gameTokenId appId expiresAt gameApiUrl gameApiWsUrl launchUrl';
|
|
46
|
+
const APP_TOKEN_FIELDS = 'token gameTokenId appId expiresAt gameApiUrl gameApiWsUrl discoveryUrl launchUrl';
|
|
47
47
|
const MintAppTokenDocument = parse(`mutation MintAppToken($input: MintAppTokenInput!) { mintAppToken(input: $input) { ${APP_TOKEN_FIELDS} } }`);
|
|
48
48
|
const CreatePortalAuthorizationCodeDocument = parse(`mutation CreatePortalAuthorizationCode($input: CreatePortalAuthorizationCodeInput!) { createPortalAuthorizationCode(input: $input) { code redirectUri expiresAt } }`);
|
|
49
49
|
const ExchangePortalCodeDocument = parse(`mutation ExchangePortalCode($input: ExchangePortalCodeInput!) { exchangePortalCode(input: $input) { ${APP_TOKEN_FIELDS} } }`);
|
|
@@ -63,8 +63,8 @@ const RevokeAppAuthorizationDocument = parse(`mutation RevokeAppAuthorization($a
|
|
|
63
63
|
const MyAuthorizedAppsDocument = parse(`query MyAuthorizedApps { myAuthorizedApps { grantId appId appName scopes status grantedAt revokedAt } }`);
|
|
64
64
|
const SetAppClientSettingsDocument = parse(`mutation SetAppClientSettings($input: SetAppClientSettingsInput!) { setAppClientSettings(input: $input) { appId appName trusted consentRequired } }`);
|
|
65
65
|
export class PortalAPI {
|
|
66
|
-
constructor(
|
|
67
|
-
this.
|
|
66
|
+
constructor(api, session, pkceStore = new BrowserSessionPkceStore()) {
|
|
67
|
+
this.api = api;
|
|
68
68
|
this.session = session;
|
|
69
69
|
this.pkceStore = pkceStore;
|
|
70
70
|
}
|
|
@@ -75,7 +75,7 @@ export class PortalAPI {
|
|
|
75
75
|
* paid apps require an existing entitlement.
|
|
76
76
|
*/
|
|
77
77
|
async mintAppToken(appId) {
|
|
78
|
-
const data = await this.
|
|
78
|
+
const data = await this.api.request(MintAppTokenDocument, {
|
|
79
79
|
input: { appId },
|
|
80
80
|
});
|
|
81
81
|
return data.mintAppToken;
|
|
@@ -86,7 +86,7 @@ export class PortalAPI {
|
|
|
86
86
|
* Requires the identity session token.
|
|
87
87
|
*/
|
|
88
88
|
async createAuthorizationCode(params) {
|
|
89
|
-
const data = await this.
|
|
89
|
+
const data = await this.api.request(CreatePortalAuthorizationCodeDocument, { input: params });
|
|
90
90
|
return data.createPortalAuthorizationCode;
|
|
91
91
|
}
|
|
92
92
|
/**
|
|
@@ -95,7 +95,7 @@ export class PortalAPI {
|
|
|
95
95
|
* authenticated. Public — no session token required.
|
|
96
96
|
*/
|
|
97
97
|
async exchangeCode(code, codeVerifier) {
|
|
98
|
-
const data = await this.
|
|
98
|
+
const data = await this.api.request(ExchangePortalCodeDocument, {
|
|
99
99
|
input: { code, codeVerifier },
|
|
100
100
|
});
|
|
101
101
|
this.session.setToken(data.exchangePortalCode.token);
|
|
@@ -107,38 +107,38 @@ export class PortalAPI {
|
|
|
107
107
|
* through the Overworld. Requires the current app token on this session.
|
|
108
108
|
*/
|
|
109
109
|
async refresh() {
|
|
110
|
-
const data = await this.
|
|
110
|
+
const data = await this.api.request(RefreshAppTokenDocument, {});
|
|
111
111
|
this.session.setToken(data.refreshAppToken.token);
|
|
112
112
|
return data.refreshAppToken;
|
|
113
113
|
}
|
|
114
114
|
// ----- Consent + connected apps ------------------------------------------
|
|
115
115
|
/** Whether portaling into an app needs a consent prompt (Overworld side). */
|
|
116
116
|
async getConsent(appId) {
|
|
117
|
-
const data = await this.
|
|
117
|
+
const data = await this.api.request(PortalConsentDocument, { appId });
|
|
118
118
|
return data.portalConsent;
|
|
119
119
|
}
|
|
120
120
|
/** Record the user's consent for an app (call from the consent screen). */
|
|
121
121
|
async authorizeApp(appId, scopes) {
|
|
122
|
-
const data = await this.
|
|
122
|
+
const data = await this.api.request(AuthorizeAppDocument, {
|
|
123
123
|
input: { appId, scopes },
|
|
124
124
|
});
|
|
125
125
|
return data.authorizeApp;
|
|
126
126
|
}
|
|
127
127
|
/** Revoke a prior authorization; also revokes the user's live tokens for it. */
|
|
128
128
|
async revokeAppAuthorization(appId) {
|
|
129
|
-
const data = await this.
|
|
129
|
+
const data = await this.api.request(RevokeAppAuthorizationDocument, {
|
|
130
130
|
appId,
|
|
131
131
|
});
|
|
132
132
|
return data.revokeAppAuthorization;
|
|
133
133
|
}
|
|
134
134
|
/** The user's active app authorizations ("connected apps"). */
|
|
135
135
|
async myAuthorizedApps() {
|
|
136
|
-
const data = await this.
|
|
136
|
+
const data = await this.api.request(MyAuthorizedAppsDocument);
|
|
137
137
|
return data.myAuthorizedApps;
|
|
138
138
|
}
|
|
139
139
|
/** Register/update an app's portal client settings (requires manage_apps). */
|
|
140
140
|
async setAppClientSettings(input) {
|
|
141
|
-
const data = await this.
|
|
141
|
+
const data = await this.api.request(SetAppClientSettingsDocument, {
|
|
142
142
|
input,
|
|
143
143
|
});
|
|
144
144
|
return data.setAppClientSettings;
|
package/dist/domains/quotas.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { type QuotasForOrgQuery, type QuotasForAppQuery, type EffectiveQuotaQuer
|
|
|
4
4
|
* Usage quotas at the org and app scope — exposed as `client.quotas` (and
|
|
5
5
|
* grouped under `client.admin`).
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* Part of the management surface. Reads require the `view_usage` org/app
|
|
8
8
|
* permission; {@link set} / {@link remove} require `manage_quotas` (global
|
|
9
9
|
* quotas are super-admin only). A quota is keyed by a `metric` string; the
|
|
10
10
|
* effective value resolves app → org → platform default.
|
|
@@ -13,8 +13,8 @@ import { type QuotasForOrgQuery, type QuotasForAppQuery, type EffectiveQuotaQuer
|
|
|
13
13
|
* per the permission notes above.
|
|
14
14
|
*/
|
|
15
15
|
export declare class QuotasAPI {
|
|
16
|
-
private readonly
|
|
17
|
-
constructor(
|
|
16
|
+
private readonly api;
|
|
17
|
+
constructor(api: GraphQLClient);
|
|
18
18
|
/**
|
|
19
19
|
* List the quotas configured directly on an organization. Requires the
|
|
20
20
|
* `view_usage` org permission.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quotas.d.ts","sourceRoot":"","sources":["../../src/domains/quotas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAML,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,aAAa,EACnB,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;GAWG;AACH,qBAAa,SAAS;IACR,OAAO,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"quotas.d.ts","sourceRoot":"","sources":["../../src/domains/quotas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAML,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,aAAa,EACnB,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;GAWG;AACH,qBAAa,SAAS;IACR,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,aAAa;IAE/C;;;;;;OAMG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC;IAKvE;;;;;;OAMG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC;IAKvE;;;;;;;OAOG;IACG,SAAS,CACb,MAAM,EAAE,MAAM,EACd,KAAK,GAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAO,GAC7C,OAAO,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IASjD;;;;;;OAMG;IACG,GAAG,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;IAKtE;;;;;OAKG;IACG,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAC;CAM3E"}
|
package/dist/domains/quotas.js
CHANGED
|
@@ -3,7 +3,7 @@ import { QuotasForOrgDocument, QuotasForAppDocument, EffectiveQuotaDocument, Set
|
|
|
3
3
|
* Usage quotas at the org and app scope — exposed as `client.quotas` (and
|
|
4
4
|
* grouped under `client.admin`).
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* Part of the management surface. Reads require the `view_usage` org/app
|
|
7
7
|
* permission; {@link set} / {@link remove} require `manage_quotas` (global
|
|
8
8
|
* quotas are super-admin only). A quota is keyed by a `metric` string; the
|
|
9
9
|
* effective value resolves app → org → platform default.
|
|
@@ -12,8 +12,8 @@ import { QuotasForOrgDocument, QuotasForAppDocument, EffectiveQuotaDocument, Set
|
|
|
12
12
|
* per the permission notes above.
|
|
13
13
|
*/
|
|
14
14
|
export class QuotasAPI {
|
|
15
|
-
constructor(
|
|
16
|
-
this.
|
|
15
|
+
constructor(api) {
|
|
16
|
+
this.api = api;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* List the quotas configured directly on an organization. Requires the
|
|
@@ -23,7 +23,7 @@ export class QuotasAPI {
|
|
|
23
23
|
* @returns The org's quotas.
|
|
24
24
|
*/
|
|
25
25
|
async forOrg(orgId) {
|
|
26
|
-
const data = await this.
|
|
26
|
+
const data = await this.api.request(QuotasForOrgDocument, { orgId });
|
|
27
27
|
return data.quotasForOrg;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
@@ -34,7 +34,7 @@ export class QuotasAPI {
|
|
|
34
34
|
* @returns The app's quotas.
|
|
35
35
|
*/
|
|
36
36
|
async forApp(appId) {
|
|
37
|
-
const data = await this.
|
|
37
|
+
const data = await this.api.request(QuotasForAppDocument, { appId });
|
|
38
38
|
return data.quotasForApp;
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
@@ -46,7 +46,7 @@ export class QuotasAPI {
|
|
|
46
46
|
* @returns The effective quota for the metric.
|
|
47
47
|
*/
|
|
48
48
|
async effective(metric, scope = {}) {
|
|
49
|
-
const data = await this.
|
|
49
|
+
const data = await this.api.request(EffectiveQuotaDocument, {
|
|
50
50
|
metric,
|
|
51
51
|
orgId: scope.orgId,
|
|
52
52
|
appId: scope.appId,
|
|
@@ -61,7 +61,7 @@ export class QuotasAPI {
|
|
|
61
61
|
* @returns The created/updated quota.
|
|
62
62
|
*/
|
|
63
63
|
async set(input) {
|
|
64
|
-
const data = await this.
|
|
64
|
+
const data = await this.api.request(SetQuotaDocument, { input });
|
|
65
65
|
return data.setQuota;
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
@@ -71,7 +71,7 @@ export class QuotasAPI {
|
|
|
71
71
|
* @returns `true` on success.
|
|
72
72
|
*/
|
|
73
73
|
async remove(quotaId) {
|
|
74
|
-
const data = await this.
|
|
74
|
+
const data = await this.api.request(DeleteQuotaDocument, {
|
|
75
75
|
quotaId,
|
|
76
76
|
});
|
|
77
77
|
return data.deleteQuota;
|
|
@@ -41,8 +41,7 @@ export declare class ServerStatusAPI {
|
|
|
41
41
|
*/
|
|
42
42
|
serverWithLeastClients(): Promise<ServerWithLeastClientsQuery['serverWithLeastClients']>;
|
|
43
43
|
/**
|
|
44
|
-
* List every registered GraphQL API server
|
|
45
|
-
* `game-api` kinds), regardless of health/state — for service discovery. To
|
|
44
|
+
* List every registered GraphQL API server, regardless of health/state — for service discovery. To
|
|
46
45
|
* route clients, prefer {@link ServerStatusAPI.listActiveGraphqlServers}
|
|
47
46
|
* (healthy only). No authentication required.
|
|
48
47
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serverStatus.d.ts","sourceRoot":"","sources":["../../src/domains/serverStatus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAEL,KAAK,2BAA2B,EAEhC,KAAK,mBAAmB,EAExB,KAAK,yBAAyB,EAE9B,KAAK,gBAAgB,EAErB,KAAK,wBAAwB,EAC7B,KAAK,iCAAiC,EACvC,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,eAAe;IACd,OAAO,CAAC,GAAG;gBAAH,GAAG,EAAE,aAAa;IAEtC;;;;;;;;;;;;OAYG;IACG,sBAAsB,IAAI,OAAO,CAAC,2BAA2B,CAAC,wBAAwB,CAAC,CAAC;IAK9F
|
|
1
|
+
{"version":3,"file":"serverStatus.d.ts","sourceRoot":"","sources":["../../src/domains/serverStatus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAEL,KAAK,2BAA2B,EAEhC,KAAK,mBAAmB,EAExB,KAAK,yBAAyB,EAE9B,KAAK,gBAAgB,EAErB,KAAK,wBAAwB,EAC7B,KAAK,iCAAiC,EACvC,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,eAAe;IACd,OAAO,CAAC,GAAG;gBAAH,GAAG,EAAE,aAAa;IAEtC;;;;;;;;;;;;OAYG;IACG,sBAAsB,IAAI,OAAO,CAAC,2BAA2B,CAAC,wBAAwB,CAAC,CAAC;IAK9F;;;;;;OAMG;IACG,OAAO,IAAI,OAAO,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IAK/D;;;;;OAKG;IACG,wBAAwB,IAAI,OAAO,CAAC,yBAAyB,CAAC,sBAAsB,CAAC,CAAC;IAK5F;;;;;;;;OAQG;IACG,WAAW,IAAI,OAAO,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;IAK7D;;;;;;;;;;;;;;;;;;OAkBG;IACG,mBAAmB,CACvB,KAAK,EAAE,iCAAiC,CAAC,OAAO,CAAC,GAChD,OAAO,CAAC,wBAAwB,CAAC,qBAAqB,CAAC,CAAC;CAI5D"}
|
|
@@ -44,8 +44,7 @@ export class ServerStatusAPI {
|
|
|
44
44
|
return data.serverWithLeastClients;
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
|
-
* List every registered GraphQL API server
|
|
48
|
-
* `game-api` kinds), regardless of health/state — for service discovery. To
|
|
47
|
+
* List every registered GraphQL API server, regardless of health/state — for service discovery. To
|
|
49
48
|
* route clients, prefer {@link ServerStatusAPI.listActiveGraphqlServers}
|
|
50
49
|
* (healthy only). No authentication required.
|
|
51
50
|
*
|