@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.
Files changed (84) hide show
  1. package/MIGRATION.md +44 -0
  2. package/README.md +68 -33
  3. package/dist/binary-relay.d.ts +1 -1
  4. package/dist/binary-relay.js +1 -1
  5. package/dist/client.d.ts +27 -0
  6. package/dist/client.d.ts.map +1 -1
  7. package/dist/client.js +61 -2
  8. package/dist/crowdy-client.d.ts +29 -34
  9. package/dist/crowdy-client.d.ts.map +1 -1
  10. package/dist/crowdy-client.js +67 -40
  11. package/dist/datacenter-redirect.d.ts +49 -0
  12. package/dist/datacenter-redirect.d.ts.map +1 -0
  13. package/dist/datacenter-redirect.js +62 -0
  14. package/dist/domains/appAccess.d.ts +3 -3
  15. package/dist/domains/appAccess.d.ts.map +1 -1
  16. package/dist/domains/appAccess.js +16 -16
  17. package/dist/domains/apps.d.ts +4 -8
  18. package/dist/domains/apps.d.ts.map +1 -1
  19. package/dist/domains/apps.js +19 -23
  20. package/dist/domains/auth.d.ts +1 -1
  21. package/dist/domains/billing.d.ts +3 -3
  22. package/dist/domains/billing.d.ts.map +1 -1
  23. package/dist/domains/billing.js +9 -9
  24. package/dist/domains/controlPlane.d.ts +2 -2
  25. package/dist/domains/controlPlane.d.ts.map +1 -1
  26. package/dist/domains/controlPlane.js +4 -4
  27. package/dist/domains/discovery.d.ts +50 -0
  28. package/dist/domains/discovery.d.ts.map +1 -0
  29. package/dist/domains/discovery.js +35 -0
  30. package/dist/domains/marketplace.d.ts +4 -5
  31. package/dist/domains/marketplace.d.ts.map +1 -1
  32. package/dist/domains/marketplace.js +25 -26
  33. package/dist/domains/organizations.d.ts +3 -3
  34. package/dist/domains/organizations.d.ts.map +1 -1
  35. package/dist/domains/organizations.js +22 -22
  36. package/dist/domains/payments.d.ts +3 -3
  37. package/dist/domains/payments.d.ts.map +1 -1
  38. package/dist/domains/payments.js +11 -11
  39. package/dist/domains/platform.d.ts +5 -6
  40. package/dist/domains/platform.d.ts.map +1 -1
  41. package/dist/domains/platform.js +6 -7
  42. package/dist/domains/portal.d.ts +19 -2
  43. package/dist/domains/portal.d.ts.map +1 -1
  44. package/dist/domains/portal.js +12 -12
  45. package/dist/domains/quotas.d.ts +3 -3
  46. package/dist/domains/quotas.d.ts.map +1 -1
  47. package/dist/domains/quotas.js +8 -8
  48. package/dist/domains/serverStatus.d.ts +1 -2
  49. package/dist/domains/serverStatus.d.ts.map +1 -1
  50. package/dist/domains/serverStatus.js +1 -2
  51. package/dist/domains/sharedEnvironment.d.ts +3 -3
  52. package/dist/domains/sharedEnvironment.d.ts.map +1 -1
  53. package/dist/domains/sharedEnvironment.js +15 -15
  54. package/dist/domains/udp.d.ts +1 -1
  55. package/dist/domains/udp.js +1 -1
  56. package/dist/domains/usage.d.ts +2 -2
  57. package/dist/domains/usage.d.ts.map +1 -1
  58. package/dist/domains/usage.js +5 -5
  59. package/dist/domains/users.d.ts +1 -1
  60. package/dist/domains/users.js +1 -1
  61. package/dist/errors.d.ts +56 -0
  62. package/dist/errors.d.ts.map +1 -1
  63. package/dist/errors.js +64 -0
  64. package/dist/generated/graphql.d.ts +65 -16
  65. package/dist/generated/graphql.d.ts.map +1 -1
  66. package/dist/generated/graphql.js +1 -0
  67. package/dist/index.d.ts +13 -14
  68. package/dist/index.d.ts.map +1 -1
  69. package/dist/index.js +14 -17
  70. package/dist/kit/decks.d.ts +1 -1
  71. package/dist/kit/npcs.d.ts +2 -2
  72. package/dist/kit/npcs.d.ts.map +1 -1
  73. package/dist/kit/social.d.ts.map +1 -1
  74. package/dist/kit/worldsim.d.ts +1 -1
  75. package/dist/realtime.d.ts +26 -0
  76. package/dist/realtime.d.ts.map +1 -1
  77. package/dist/realtime.js +83 -0
  78. package/dist/rediscover.d.ts +7 -3
  79. package/dist/rediscover.d.ts.map +1 -1
  80. package/dist/rediscover.js +7 -3
  81. package/dist/session.d.ts +21 -0
  82. package/dist/session.d.ts.map +1 -1
  83. package/dist/session.js +23 -0
  84. package/package.json +1 -1
@@ -3,22 +3,22 @@
3
3
  * access everything via the typed sub-clients (`client.auth`, `client.udp`,
4
4
  * `client.chunks`, ...).
5
5
  *
6
- * The management/game-api split means CrowdyJS now talks to **two** GraphQL
7
- * endpoints behind the scenes:
6
+ * All sub-clients share ONE GraphQL endpoint: `httpUrl` / `graphqlEndpoint`, with
7
+ * `wsUrl` / `wsEndpoint` for subscriptions. Identity (`auth`, `users`, `portal`) and
8
+ * world/replication (`chunks`, `voxels`, `actors`, `udp`, ...) are surfaces of the
9
+ * same API, not separate services.
8
10
  *
9
- * - `managementUrl` / `managementGraphqlEndpoint` -> `cks-management-api`
10
- * used by `auth` (login, register, logout, password / email flows) and
11
- * `users` (me, updateGamertag, deleteMyAccount). This is also where
12
- * `game_tokens` are minted.
11
+ * BREAKING in v14: `managementUrl` and `managementGraphqlEndpoint` were removed,
12
+ * along with the `client.management` escape hatch, when `cks-management-api` was
13
+ * retired and its surface absorbed into the unified API. Set `httpUrl` and use
14
+ * `client.graphql`.
13
15
  *
14
- * - `httpUrl` / `graphqlEndpoint` -> `cks-game-api`
15
- * used by every game / world / replication sub-client
16
- * (`chunks`, `voxels`, `actors`, `teleport`, `state`, `serverStatus`,
17
- * `udp`). WebSocket subscriptions (`wsUrl`) also target this endpoint.
18
- *
19
- * A single `AuthState` is shared across both clients, so once
20
- * `client.auth.login()` returns, every subsequent SDK call (against either
21
- * endpoint) carries the Bearer token automatically.
16
+ * One `AuthState` backs the whole client, so once `client.auth` has a token every
17
+ * subsequent call carries it. Note that this is per-client by design: drive identity
18
+ * from a client holding the session token and gameplay from a per-app client holding
19
+ * that app's app-scoped token, because a session token is rejected for gameplay.
20
+ * Those two clients may point at different origins — an app lives in one datacenter,
21
+ * and `mintAppToken` returns its `gameApiUrl` / `gameApiWsUrl`.
22
22
  */
23
23
  import { AuthState } from './auth-state.js';
24
24
  import { GraphQLClient } from './client.js';
@@ -63,9 +63,21 @@ import { CrowdyAgentGraphQLTransport } from './crowdy-agent/graphql-transport.js
63
63
  import { PlayerWalletAPI } from './domains/playerWallet.js';
64
64
  import { MarketplaceAPI } from './domains/marketplace.js';
65
65
  import { PlayerModelAPI } from './domains/playerModel.js';
66
+ import { DiscoveryDomain } from './domains/discovery.js';
66
67
  export class CrowdyClient {
67
68
  constructor(config = {}) {
68
69
  this.gameplayTokenRefresh = null;
70
+ // TypeScript rejects these, JavaScript would not: a caller still passing
71
+ // managementUrl would have its identity calls silently sent to httpUrl, or
72
+ // nowhere at all if managementUrl was the only URL it set. Say so instead.
73
+ for (const removed of ['managementUrl', 'managementGraphqlEndpoint']) {
74
+ if (config[removed] !== undefined) {
75
+ throw new TypeError(`\`${removed}\` was removed in CrowdyJS v14: the management and game ` +
76
+ `surfaces are one API at one endpoint. Pass \`httpUrl\` (and \`wsUrl\`) ` +
77
+ `instead, and use \`client.graphql\` where you used \`client.management\`. ` +
78
+ `Per-app gameplay endpoints come from mintAppToken's gameApiUrl/gameApiWsUrl.`);
79
+ }
80
+ }
69
81
  this.session = new AuthState(config.tokenStore);
70
82
  const lbCookieStore = config.lbCookieStore ?? new LbCookieStore();
71
83
  this.graphql = new GraphQLClient({
@@ -118,30 +130,45 @@ export class CrowdyClient {
118
130
  }
119
131
  : {}),
120
132
  }, this.session, this.metrics);
121
- const managementGraphqlEndpoint = config.managementGraphqlEndpoint ??
122
- toGraphqlEndpoint(config.managementUrl, 'graphql') ??
123
- config.graphqlEndpoint;
124
- // Management-api client. Falls back to game-api endpoint if the caller
125
- // hasn't configured `managementUrl` yet (single-endpoint legacy mode).
126
- this.management = new GraphQLClient({
127
- httpUrl: config.managementUrl ?? config.httpUrl,
128
- graphqlEndpoint: managementGraphqlEndpoint,
129
- timeout: config.timeout,
130
- logger: config.logger,
131
- }, this.session);
132
- this.auth = new AuthAPI(this.management, this.session);
133
- this.users = new UsersAPI(this.management);
134
- this.apps = new AppsAPI(this.management);
135
- this.portal = new PortalAPI(this.management, this.session, config.pkceStore);
136
- this.platform = new PlatformAPI(this.management);
137
- this.organizations = new OrganizationsAPI(this.management);
138
- this.appAccess = new AppAccessAPI(this.management);
139
- this.billing = new BillingAPI(this.management);
140
- this.payments = new PaymentsAPI(this.management);
141
- this.quotas = new QuotasAPI(this.management);
142
- this.usage = new UsageAPI(this.management);
143
- this.sharedEnvironment = new SharedEnvironmentAPI(this.management);
144
- this.operator = new ControlPlaneAPI(this.management);
133
+ // The redirect handler is installed here rather than passed into the
134
+ // transport's constructor because it has to move the REALTIME client too, and
135
+ // that does not exist yet at the point the transport is built.
136
+ //
137
+ // Both sides in one step, for the reason spelled out on `onEndpointMove`
138
+ // above: a client with its HTTP in one datacenter and its subscription in
139
+ // another looks connected and receives nothing, and here it is worse than the
140
+ // instance-level version of that split, because the datacenter left behind
141
+ // holds none of the app's shards and would refuse the subscription too.
142
+ this.graphql.setWrongDatacenterHandler((move) => {
143
+ const endpoint = toGraphqlEndpoint(move.gameApiUrl, 'graphql') ?? move.gameApiUrl;
144
+ if (endpoint === this.graphql.getEndpoint()) {
145
+ // Already there. Returning false stops the transport retrying, because a
146
+ // retry to the same instance is refused identically and a handler that
147
+ // reported success here would loop.
148
+ return false;
149
+ }
150
+ this.graphql.setEndpoint(endpoint);
151
+ this.realtime.moveToDatacenter({
152
+ httpUrl: move.gameApiUrl,
153
+ wsUrl: toGraphqlEndpoint(move.gameApiWsUrl, 'graphql') ?? null,
154
+ datacenter: move.appDatacenter,
155
+ });
156
+ return true;
157
+ });
158
+ this.auth = new AuthAPI(this.graphql, this.session);
159
+ this.users = new UsersAPI(this.graphql);
160
+ this.apps = new AppsAPI(this.graphql);
161
+ this.portal = new PortalAPI(this.graphql, this.session, config.pkceStore);
162
+ this.discovery = new DiscoveryDomain(this.graphql);
163
+ this.platform = new PlatformAPI(this.graphql);
164
+ this.organizations = new OrganizationsAPI(this.graphql);
165
+ this.appAccess = new AppAccessAPI(this.graphql);
166
+ this.billing = new BillingAPI(this.graphql);
167
+ this.payments = new PaymentsAPI(this.graphql);
168
+ this.quotas = new QuotasAPI(this.graphql);
169
+ this.usage = new UsageAPI(this.graphql);
170
+ this.sharedEnvironment = new SharedEnvironmentAPI(this.graphql);
171
+ this.operator = new ControlPlaneAPI(this.graphql);
145
172
  this.chunks = new ChunksAPI(this.graphql);
146
173
  this.voxels = new VoxelsAPI(this.graphql);
147
174
  this.actors = new ActorsAPI(this.graphql);
@@ -162,8 +189,8 @@ export class CrowdyClient {
162
189
  wsUrl: config.wsEndpoint ?? toGraphqlEndpoint(config.wsUrl, 'graphql'),
163
190
  getToken: () => this.session.getToken(),
164
191
  });
165
- this.playerWallet = new PlayerWalletAPI(this.management);
166
- this.marketplace = new MarketplaceAPI(this.graphql, this.management);
192
+ this.playerWallet = new PlayerWalletAPI(this.graphql);
193
+ this.marketplace = new MarketplaceAPI(this.graphql);
167
194
  this.playerModel = new PlayerModelAPI(this.graphql);
168
195
  this.avatars = new AvatarsAPI(this.graphql);
169
196
  this.host = new HostAPI(this.graphql);
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Reading a datacenter move out of a GraphQL error, in one place.
3
+ *
4
+ * WHY THIS IS ITS OWN MODULE. The server can raise `WRONG_DATACENTER` on three
5
+ * different transports — an HTTP POST, a websocket mutation, and a subscription —
6
+ * and they surface as three different error types (`CrowdyGraphQLError` and two
7
+ * shapes of `CrowdyRealtimeError`). The decision "is this a move, and where to" is
8
+ * identical in all three, and it is exactly the kind of small predicate that grows
9
+ * a second, slightly different copy the first time somebody fixes a bug in one of
10
+ * them.
11
+ *
12
+ * WHAT THE SERVER GUARANTEES, and what this therefore checks. A `WRONG_DATACENTER`
13
+ * always names an endpoint; an `APP_UNAVAILABLE` never does, because there is
14
+ * nowhere to send the client. So a "move" here means BOTH the code and a usable
15
+ * URL. A `WRONG_DATACENTER` with no URL is a server that has changed its mind
16
+ * about the contract, and the safe reading is "do not move" rather than "move to
17
+ * undefined".
18
+ */
19
+ /** Where the server says this client should go instead. */
20
+ export interface DatacenterMove {
21
+ /** Absolute HTTP origin or GraphQL URL of the app's own datacenter. */
22
+ gameApiUrl: string;
23
+ /** Matching websocket URL, when the server named one. */
24
+ gameApiWsUrl?: string;
25
+ /** The app the move is about, for logging. */
26
+ appId?: string;
27
+ /** The datacenter being moved to, for logging. */
28
+ appDatacenter?: string;
29
+ }
30
+ interface ErrorLike {
31
+ extensions?: Record<string, unknown> | null;
32
+ }
33
+ /**
34
+ * The move a single GraphQL error asks for, or null if it is not asking for one.
35
+ *
36
+ * @param error An entry from a GraphQL `errors[]` array.
37
+ */
38
+ export declare function moveFromError(error: ErrorLike | null | undefined): DatacenterMove | null;
39
+ /**
40
+ * The first move asked for anywhere in a GraphQL `errors[]` array.
41
+ *
42
+ * Scans the whole array rather than reading `errors[0]`, because a query naming
43
+ * several apps is refused per app and the misrouted one need not be first — and
44
+ * a client that only inspected the first error would ignore a redirect that was
45
+ * sitting right there.
46
+ */
47
+ export declare function moveFromErrors(errors: readonly (ErrorLike | null | undefined)[] | null | undefined): DatacenterMove | null;
48
+ export {};
49
+ //# sourceMappingURL=datacenter-redirect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datacenter-redirect.d.ts","sourceRoot":"","sources":["../src/datacenter-redirect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH,2DAA2D;AAC3D,MAAM,WAAW,cAAc;IAC7B,uEAAuE;IACvE,UAAU,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kDAAkD;IAClD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,SAAS;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CAC7C;AAMD;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,GAClC,cAAc,GAAG,IAAI,CAiBvB;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,SAAS,CAAC,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,GAAG,IAAI,GAAG,SAAS,GACnE,cAAc,GAAG,IAAI,CAMvB"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Reading a datacenter move out of a GraphQL error, in one place.
3
+ *
4
+ * WHY THIS IS ITS OWN MODULE. The server can raise `WRONG_DATACENTER` on three
5
+ * different transports — an HTTP POST, a websocket mutation, and a subscription —
6
+ * and they surface as three different error types (`CrowdyGraphQLError` and two
7
+ * shapes of `CrowdyRealtimeError`). The decision "is this a move, and where to" is
8
+ * identical in all three, and it is exactly the kind of small predicate that grows
9
+ * a second, slightly different copy the first time somebody fixes a bug in one of
10
+ * them.
11
+ *
12
+ * WHAT THE SERVER GUARANTEES, and what this therefore checks. A `WRONG_DATACENTER`
13
+ * always names an endpoint; an `APP_UNAVAILABLE` never does, because there is
14
+ * nowhere to send the client. So a "move" here means BOTH the code and a usable
15
+ * URL. A `WRONG_DATACENTER` with no URL is a server that has changed its mind
16
+ * about the contract, and the safe reading is "do not move" rather than "move to
17
+ * undefined".
18
+ */
19
+ import { WRONG_DATACENTER_CODE } from './errors.js';
20
+ function asString(value) {
21
+ return typeof value === 'string' && value.trim() ? value.trim() : undefined;
22
+ }
23
+ /**
24
+ * The move a single GraphQL error asks for, or null if it is not asking for one.
25
+ *
26
+ * @param error An entry from a GraphQL `errors[]` array.
27
+ */
28
+ export function moveFromError(error) {
29
+ const extensions = error?.extensions;
30
+ if (!extensions)
31
+ return null;
32
+ if (extensions.code !== WRONG_DATACENTER_CODE)
33
+ return null;
34
+ const gameApiUrl = asString(extensions.gameApiUrl);
35
+ // No endpoint means no move. See the note at the top: this is a contract
36
+ // violation rather than an ordinary case, and guessing would send the client
37
+ // somewhere it was not told to go.
38
+ if (!gameApiUrl)
39
+ return null;
40
+ return {
41
+ gameApiUrl,
42
+ gameApiWsUrl: asString(extensions.gameApiWsUrl),
43
+ appId: asString(extensions.appId),
44
+ appDatacenter: asString(extensions.appDatacenter),
45
+ };
46
+ }
47
+ /**
48
+ * The first move asked for anywhere in a GraphQL `errors[]` array.
49
+ *
50
+ * Scans the whole array rather than reading `errors[0]`, because a query naming
51
+ * several apps is refused per app and the misrouted one need not be first — and
52
+ * a client that only inspected the first error would ignore a redirect that was
53
+ * sitting right there.
54
+ */
55
+ export function moveFromErrors(errors) {
56
+ for (const error of errors ?? []) {
57
+ const move = moveFromError(error);
58
+ if (move)
59
+ return move;
60
+ }
61
+ return null;
62
+ }
@@ -4,7 +4,7 @@ import { type AppAccessTiersQuery, type MyAppAccessQuery, type AppUserAccessByAp
4
4
  * App access tiers + per-user access grants — exposed as `client.appAccess`
5
5
  * (and grouped under `client.admin`).
6
6
  *
7
- * Targets the **management-api**. Tiers define the runtime-permission bundles
7
+ * Part of the management surface. Tiers define the runtime-permission bundles
8
8
  * (`access`, `teleport`, `update_voxel_data`, `use_voice_chat`, ...) a player
9
9
  * gets; grants attach a user to a tier. New apps auto-provision an open default
10
10
  * tier, so most players need no explicit grant.
@@ -17,8 +17,8 @@ import { type AppAccessTiersQuery, type MyAppAccessQuery, type AppUserAccessByAp
17
17
  * per the permission notes above.
18
18
  */
19
19
  export declare class AppAccessAPI {
20
- private readonly management;
21
- constructor(management: GraphQLClient);
20
+ private readonly api;
21
+ constructor(api: GraphQLClient);
22
22
  /**
23
23
  * List the access tiers defined for an app. **Public.**
24
24
  *
@@ -1 +1 @@
1
- {"version":3,"file":"appAccess.d.ts","sourceRoot":"","sources":["../../src/domains/appAccess.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAcL,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,4BAA4B,EACjC,KAAK,q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C,CAAC;IAOxD;;;;;;;OAOG;IACG,UAAU,CACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,qBAAqB,GAC3B,OAAO,CAAC,wBAAwB,CAAC,kBAAkB,CAAC,CAAC;IAQxD;;;;;;OAMG;IACG,WAAW,CACf,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,yBAAyB,CAAC,mBAAmB,CAAC,CAAC;IAO1D;;;;;;;OAOG;IACG,KAAK,CACT,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,sBAAsB,CAAC,gBAAgB,CAAC,CAAC;IAOpD;;;;;;;OAOG;IACG,MAAM,CACV,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,uBAAuB,CAAC,iBAAiB,CAAC,CAAC;CAOvD"}
@@ -3,7 +3,7 @@ import { AppAccessTiersDocument, MyAppAccessDocument, AppUserAccessByAppDocument
3
3
  * App access tiers + per-user access grants — exposed as `client.appAccess`
4
4
  * (and grouped under `client.admin`).
5
5
  *
6
- * Targets the **management-api**. Tiers define the runtime-permission bundles
6
+ * Part of the management surface. Tiers define the runtime-permission bundles
7
7
  * (`access`, `teleport`, `update_voxel_data`, `use_voice_chat`, ...) a player
8
8
  * gets; grants attach a user to a tier. New apps auto-provision an open default
9
9
  * tier, so most players need no explicit grant.
@@ -16,8 +16,8 @@ import { AppAccessTiersDocument, MyAppAccessDocument, AppUserAccessByAppDocument
16
16
  * per the permission notes above.
17
17
  */
18
18
  export class AppAccessAPI {
19
- constructor(management) {
20
- this.management = management;
19
+ constructor(api) {
20
+ this.api = api;
21
21
  }
22
22
  /**
23
23
  * List the access tiers defined for an app. **Public.**
@@ -26,7 +26,7 @@ export class AppAccessAPI {
26
26
  * @returns The app's tiers, ordered.
27
27
  */
28
28
  async tiers(appId) {
29
- const data = await this.management.request(AppAccessTiersDocument, {
29
+ const data = await this.api.request(AppAccessTiersDocument, {
30
30
  appId,
31
31
  });
32
32
  return data.appAccessTiers;
@@ -39,7 +39,7 @@ export class AppAccessAPI {
39
39
  * @returns The caller's {@link AppUserAccess}, or `null`.
40
40
  */
41
41
  async myAccess(appId) {
42
- const data = await this.management.request(MyAppAccessDocument, { appId });
42
+ const data = await this.api.request(MyAppAccessDocument, { appId });
43
43
  return data.myAppAccess;
44
44
  }
45
45
  /**
@@ -52,7 +52,7 @@ export class AppAccessAPI {
52
52
  * @returns The matching access records.
53
53
  */
54
54
  async usersByApp(appId, opts = {}) {
55
- const data = await this.management.request(AppUserAccessByAppDocument, {
55
+ const data = await this.api.request(AppUserAccessByAppDocument, {
56
56
  appId,
57
57
  status: opts.status,
58
58
  limit: opts.limit,
@@ -71,7 +71,7 @@ export class AppAccessAPI {
71
71
  * @returns An {@link AppUserAccessConnection}.
72
72
  */
73
73
  async usersByAppConnection(args) {
74
- const data = await this.management.request(AppUserAccessConnectionDocument, args);
74
+ const data = await this.api.request(AppUserAccessConnectionDocument, args);
75
75
  return data.appUserAccessConnection;
76
76
  }
77
77
  /**
@@ -82,7 +82,7 @@ export class AppAccessAPI {
82
82
  * @returns The runtime permission keys.
83
83
  */
84
84
  async runtimePermissions() {
85
- const data = await this.management.request(RuntimePermissionsDocument);
85
+ const data = await this.api.request(RuntimePermissionsDocument);
86
86
  return data.runtimePermissions;
87
87
  }
88
88
  /**
@@ -94,7 +94,7 @@ export class AppAccessAPI {
94
94
  * @returns The candidate users (id + email/gamertag where known).
95
95
  */
96
96
  async grantMemberCandidates(appId) {
97
- const data = await this.management.request(AppGrantMemberCandidatesDocument, { appId });
97
+ const data = await this.api.request(AppGrantMemberCandidatesDocument, { appId });
98
98
  return data.appGrantMemberCandidates;
99
99
  }
100
100
  /**
@@ -106,7 +106,7 @@ export class AppAccessAPI {
106
106
  * @returns The caller's new {@link AppUserAccess} record.
107
107
  */
108
108
  async claimFree(appId) {
109
- const data = await this.management.request(ClaimFreeAppAccessDocument, {
109
+ const data = await this.api.request(ClaimFreeAppAccessDocument, {
110
110
  appId,
111
111
  });
112
112
  return data.claimFreeAppAccess;
@@ -119,7 +119,7 @@ export class AppAccessAPI {
119
119
  * @returns The caller's new {@link AppUserAccess} record.
120
120
  */
121
121
  async grantMine(appId) {
122
- const data = await this.management.request(GrantMyAppAccessDocument, {
122
+ const data = await this.api.request(GrantMyAppAccessDocument, {
123
123
  appId,
124
124
  });
125
125
  return data.grantMyAppAccess;
@@ -133,7 +133,7 @@ export class AppAccessAPI {
133
133
  * @returns The created tier.
134
134
  */
135
135
  async createTier(input) {
136
- const data = await this.management.request(CreateAccessTierDocument, {
136
+ const data = await this.api.request(CreateAccessTierDocument, {
137
137
  input,
138
138
  });
139
139
  return data.createAccessTier;
@@ -147,7 +147,7 @@ export class AppAccessAPI {
147
147
  * @returns The updated tier.
148
148
  */
149
149
  async updateTier(tierId, input) {
150
- const data = await this.management.request(UpdateAccessTierDocument, {
150
+ const data = await this.api.request(UpdateAccessTierDocument, {
151
151
  tierId,
152
152
  input,
153
153
  });
@@ -161,7 +161,7 @@ export class AppAccessAPI {
161
161
  * @returns The archived tier's new status.
162
162
  */
163
163
  async archiveTier(tierId) {
164
- const data = await this.management.request(ArchiveAccessTierDocument, {
164
+ const data = await this.api.request(ArchiveAccessTierDocument, {
165
165
  tierId,
166
166
  });
167
167
  return data.archiveAccessTier;
@@ -175,7 +175,7 @@ export class AppAccessAPI {
175
175
  * @returns The created/updated access record.
176
176
  */
177
177
  async grant(input) {
178
- const data = await this.management.request(GrantAppAccessDocument, {
178
+ const data = await this.api.request(GrantAppAccessDocument, {
179
179
  input,
180
180
  });
181
181
  return data.grantAppAccess;
@@ -189,7 +189,7 @@ export class AppAccessAPI {
189
189
  * @returns `true` on success.
190
190
  */
191
191
  async revoke(appId, userId) {
192
- const data = await this.management.request(RevokeAppAccessDocument, {
192
+ const data = await this.api.request(RevokeAppAccessDocument, {
193
193
  appId,
194
194
  userId,
195
195
  });
@@ -30,7 +30,7 @@ export interface AppRoute {
30
30
  /**
31
31
  * App discovery & game-api routing — exposed as `client.apps`.
32
32
  *
33
- * Targets the **management-api** (every call routes to `managementUrl`), where
33
+ * Part of the management surface, where
34
34
  * the apps catalog lives. After the database split an app may be served by its
35
35
  * own per-tenant cks-game-api; the catalog returns each app's `gameApiUrl` so
36
36
  * you can build a per-app `CrowdyClient` against the correct endpoint (see
@@ -45,17 +45,13 @@ export interface AppRoute {
45
45
  *
46
46
  * @example
47
47
  * ```ts
48
- * const base = createCrowdyClient({
49
- * managementUrl: 'https://api.example.com',
50
- * httpUrl: 'https://legacy-game-api.example.com', // pre-split fallback
51
- * });
48
+ * const base = createCrowdyClient({ httpUrl: 'https://api.example.com/graphql' });
52
49
  * await base.auth.login({ email, password });
53
50
  *
54
51
  * const route = await base.apps.routeFor(appId);
55
52
  * if (route.gameApiUrl) {
56
53
  * // route gameplay to the app's resolved game-api endpoint
57
54
  * const perAppClient = createCrowdyClient({
58
- * managementUrl: 'https://api.example.com',
59
55
  * httpUrl: route.gameApiUrl,
60
56
  * wsUrl: route.gameApiUrl.replace(/^http/, 'ws'),
61
57
  * tokenStore: base.session.tokenStore,
@@ -64,8 +60,8 @@ export interface AppRoute {
64
60
  * ```
65
61
  */
66
62
  export declare class AppsAPI {
67
- private readonly management;
68
- constructor(management: GraphQLClient);
63
+ private readonly api;
64
+ constructor(api: GraphQLClient);
69
65
  /**
70
66
  * Read the app's player-code admission mode. Requires
71
67
  * `view_compute_diagnostics`.
@@ -1 +1 @@
1
- {"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../src/domains/apps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAgBL,KAAK,QAAQ,EAEb,KAAK,cAAc,EAEnB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,6BAA6B,EAClC,KAAK,mBAAmB,EACxB,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,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CAAC;KAC7C,GACL,OAAO,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAKxC;;;;;;;OAOG;IACG,qBAAqB,CACzB,IAAI,GAAE,4BAAiC,GACtC,OAAO,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IAKjD;;;;;;;;;OASG;IACG,MAAM,CACV,KAAK,EAAE,cAAc,GACpB,OAAO,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAK1C;;;;;;;;OAQG;IACG,MAAM,CACV,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,cAAc,GACpB,OAAO,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAQ1C;;;;;;;OAOG;IACG,OAAO,CACX,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;IAK5C;;;;;;;OAOG;IACG,aAAa,CACjB,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,aAAa,GACxB,OAAO,CAAC,wBAAwB,CAAC,kBAAkB,CAAC,CAAC;CAOzD"}
@@ -15,7 +15,7 @@ function appRouteFromAppRow(row) {
15
15
  /**
16
16
  * App discovery & game-api routing — exposed as `client.apps`.
17
17
  *
18
- * Targets the **management-api** (every call routes to `managementUrl`), where
18
+ * Part of the management surface, where
19
19
  * the apps catalog lives. After the database split an app may be served by its
20
20
  * own per-tenant cks-game-api; the catalog returns each app's `gameApiUrl` so
21
21
  * you can build a per-app `CrowdyClient` against the correct endpoint (see
@@ -30,17 +30,13 @@ function appRouteFromAppRow(row) {
30
30
  *
31
31
  * @example
32
32
  * ```ts
33
- * const base = createCrowdyClient({
34
- * managementUrl: 'https://api.example.com',
35
- * httpUrl: 'https://legacy-game-api.example.com', // pre-split fallback
36
- * });
33
+ * const base = createCrowdyClient({ httpUrl: 'https://api.example.com/graphql' });
37
34
  * await base.auth.login({ email, password });
38
35
  *
39
36
  * const route = await base.apps.routeFor(appId);
40
37
  * if (route.gameApiUrl) {
41
38
  * // route gameplay to the app's resolved game-api endpoint
42
39
  * const perAppClient = createCrowdyClient({
43
- * managementUrl: 'https://api.example.com',
44
40
  * httpUrl: route.gameApiUrl,
45
41
  * wsUrl: route.gameApiUrl.replace(/^http/, 'ws'),
46
42
  * tokenStore: base.session.tokenStore,
@@ -49,15 +45,15 @@ function appRouteFromAppRow(row) {
49
45
  * ```
50
46
  */
51
47
  export class AppsAPI {
52
- constructor(management) {
53
- this.management = management;
48
+ constructor(api) {
49
+ this.api = api;
54
50
  }
55
51
  /**
56
52
  * Read the app's player-code admission mode. Requires
57
53
  * `view_compute_diagnostics`.
58
54
  */
59
55
  async codeAdmissionMode(appId) {
60
- const data = await this.management.request(AppCodeAdmissionModeDocument, {
56
+ const data = await this.api.request(AppCodeAdmissionModeDocument, {
61
57
  appId,
62
58
  });
63
59
  return data.appCodeAdmissionMode;
@@ -72,7 +68,7 @@ export class AppsAPI {
72
68
  appId,
73
69
  includeRevoked,
74
70
  };
75
- const data = await this.management.request(AppCodeAdmissionsDocument, variables);
71
+ const data = await this.api.request(AppCodeAdmissionsDocument, variables);
76
72
  return data.appCodeAdmissions;
77
73
  }
78
74
  /**
@@ -81,7 +77,7 @@ export class AppsAPI {
81
77
  * `manage_compute`.
82
78
  */
83
79
  async setCodeAdmissionMode(appId, mode) {
84
- const data = await this.management.request(SetAppCodeAdmissionModeDocument, {
80
+ const data = await this.api.request(SetAppCodeAdmissionModeDocument, {
85
81
  appId,
86
82
  mode,
87
83
  });
@@ -92,7 +88,7 @@ export class AppsAPI {
92
88
  * controls execution only and never grants source visibility.
93
89
  */
94
90
  async admitCode(input) {
95
- const data = await this.management.request(AdmitAppCodeDocument, { input });
91
+ const data = await this.api.request(AdmitAppCodeDocument, { input });
96
92
  return data.admitAppCode;
97
93
  }
98
94
  /**
@@ -100,7 +96,7 @@ export class AppsAPI {
100
96
  * change, then drains affected server modules and blocks client artifacts.
101
97
  */
102
98
  async revokeCodeAdmission(appId, admissionId) {
103
- const data = await this.management.request(RevokeAppCodeAdmissionDocument, { appId, admissionId });
99
+ const data = await this.api.request(RevokeAppCodeAdmissionDocument, { appId, admissionId });
104
100
  return data.revokeAppCodeAdmission;
105
101
  }
106
102
  /**
@@ -114,7 +110,7 @@ export class AppsAPI {
114
110
  * @throws {CrowdyGraphQLError} `UNAUTHENTICATED` if the caller is not signed in.
115
111
  */
116
112
  async app(appId) {
117
- const data = await this.management.request(AppDocument, { appId });
113
+ const data = await this.api.request(AppDocument, { appId });
118
114
  return data.app;
119
115
  }
120
116
  /**
@@ -131,7 +127,7 @@ export class AppsAPI {
131
127
  * @throws {CrowdyGraphQLError} on transport/validation failures.
132
128
  */
133
129
  async appBySlug(orgSlug, appSlug) {
134
- const data = await this.management.request(AppBySlugDocument, { orgSlug, appSlug });
130
+ const data = await this.api.request(AppBySlugDocument, { orgSlug, appSlug });
135
131
  return data.appBySlug;
136
132
  }
137
133
  /**
@@ -144,7 +140,7 @@ export class AppsAPI {
144
140
  * @throws {CrowdyGraphQLError} `UNAUTHENTICATED` if the caller is not signed in.
145
141
  */
146
142
  async myApps() {
147
- const data = await this.management.request(MyAppsDocument, {});
143
+ const data = await this.api.request(MyAppsDocument, {});
148
144
  return data.myApps;
149
145
  }
150
146
  /**
@@ -179,7 +175,7 @@ export class AppsAPI {
179
175
  * @throws {CrowdyGraphQLError} `UNAUTHENTICATED` / `FORBIDDEN`.
180
176
  */
181
177
  async forOrg(orgSlug) {
182
- const data = await this.management.request(AppsForOrgDocument, { orgSlug });
178
+ const data = await this.api.request(AppsForOrgDocument, { orgSlug });
183
179
  return data.appsForOrg;
184
180
  }
185
181
  /**
@@ -193,7 +189,7 @@ export class AppsAPI {
193
189
  * large catalogs; the offset args here are deprecated server-side.
194
190
  */
195
191
  async marketplace(opts = {}) {
196
- const data = await this.management.request(MarketplaceAppsDocument, opts);
192
+ const data = await this.api.request(MarketplaceAppsDocument, opts);
197
193
  return data.apps;
198
194
  }
199
195
  /**
@@ -205,7 +201,7 @@ export class AppsAPI {
205
201
  * @returns An apps connection.
206
202
  */
207
203
  async marketplaceConnection(args = {}) {
208
- const data = await this.management.request(AppsConnectionDocument, args);
204
+ const data = await this.api.request(AppsConnectionDocument, args);
209
205
  return data.appsConnection;
210
206
  }
211
207
  /**
@@ -219,7 +215,7 @@ export class AppsAPI {
219
215
  * `manage_apps`, or `BAD_USER_INPUT` (e.g. duplicate slug).
220
216
  */
221
217
  async create(input) {
222
- const data = await this.management.request(CreateAppDocument, { input });
218
+ const data = await this.api.request(CreateAppDocument, { input });
223
219
  return data.createApp;
224
220
  }
225
221
  /**
@@ -232,7 +228,7 @@ export class AppsAPI {
232
228
  * `manage_apps`.
233
229
  */
234
230
  async update(appId, input) {
235
- const data = await this.management.request(UpdateAppDocument, {
231
+ const data = await this.api.request(UpdateAppDocument, {
236
232
  appId,
237
233
  input,
238
234
  });
@@ -247,7 +243,7 @@ export class AppsAPI {
247
243
  * `manage_apps`.
248
244
  */
249
245
  async archive(appId) {
250
- const data = await this.management.request(ArchiveAppDocument, { appId });
246
+ const data = await this.api.request(ArchiveAppDocument, { appId });
251
247
  return data.archiveApp;
252
248
  }
253
249
  /**
@@ -259,7 +255,7 @@ export class AppsAPI {
259
255
  * @throws {CrowdyGraphQLError} `FORBIDDEN` for non-super-admins.
260
256
  */
261
257
  async setVisibility(appId, visibility) {
262
- const data = await this.management.request(SetAppVisibilityDocument, {
258
+ const data = await this.api.request(SetAppVisibilityDocument, {
263
259
  appId,
264
260
  visibility,
265
261
  });
@@ -9,7 +9,7 @@ import type { AuthState } from '../auth-state.js';
9
9
  * SESSION token (management-plane), which is stored on the shared session state
10
10
  * automatically. Gameplay tokens are minted separately via `client.portal`.
11
11
  *
12
- * Targets the **management-api** (`managementUrl`).
12
+ * Part of the management surface.
13
13
  *
14
14
  * **Public (no session):** {@link requestLoginLink}, {@link completeLoginLink},
15
15
  * {@link socialLoginStart}, {@link socialLoginComplete}, {@link devLogin},