@crowdedkingdoms/crowdyjs 18.38.0-test.1 → 18.39.0-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 +13 -0
- package/README.md +26 -25
- package/dist/bootstrap-rediscover.js +3 -3
- package/dist/client.js +1 -1
- package/dist/crowdy-client.js +3 -3
- package/dist/datacenter-redirect.d.ts +5 -1
- package/dist/datacenter-redirect.d.ts.map +1 -1
- package/dist/datacenter-redirect.js +8 -4
- package/dist/default-origin.d.ts +6 -6
- package/dist/default-origin.d.ts.map +1 -1
- package/dist/default-origin.js +6 -6
- package/dist/domains/apps.d.ts +15 -13
- package/dist/domains/apps.d.ts.map +1 -1
- package/dist/domains/apps.js +12 -8
- package/dist/domains/billing.d.ts +4 -2
- package/dist/domains/billing.d.ts.map +1 -1
- package/dist/domains/billing.js +4 -2
- package/dist/domains/discovery.d.ts +5 -1
- package/dist/domains/discovery.d.ts.map +1 -1
- package/dist/domains/discovery.js +5 -3
- package/dist/domains/platform.d.ts +6 -2
- package/dist/domains/platform.d.ts.map +1 -1
- package/dist/domains/platform.js +4 -2
- package/dist/domains/portal.d.ts +6 -2
- package/dist/domains/portal.d.ts.map +1 -1
- package/dist/domains/portal.js +1 -1
- package/dist/generated/graphql-schema.d.ts +117 -58
- package/dist/generated/graphql-schema.d.ts.map +1 -1
- package/dist/generated/graphql-schema.js +4 -4
- package/dist/generated/graphql.d.ts +23 -9
- package/dist/generated/graphql.d.ts.map +1 -1
- package/dist/generated/graphql.js +10 -10
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/realtime.js +2 -2
- package/dist/rediscover.d.ts +1 -1
- package/dist/rediscover.d.ts.map +1 -1
- package/dist/rediscover.js +5 -1
- package/package.json +1 -1
package/MIGRATION.md
CHANGED
|
@@ -120,6 +120,19 @@ super-admin's session). There is no SDK replacement.
|
|
|
120
120
|
`dev`'s SDL after #417 merged (`npm run schema:sync:paths -- --schema <that schema.gql>`, then
|
|
121
121
|
`npm run codegen`).
|
|
122
122
|
|
|
123
|
+
## 18.39.0: the Game API is now the Application API
|
|
124
|
+
|
|
125
|
+
Rename as you go; nothing breaks before January 1, 2027. Every result that named the Game API's URLs now carries
|
|
126
|
+
the Application API names beside the old ones:
|
|
127
|
+
|
|
128
|
+
| Was (deprecated) | Now |
|
|
129
|
+
|---|---|
|
|
130
|
+
| `gameApiUrl`, `gameApiWsUrl` (mint results, discovery, `AppRoute`, datacenter moves) | `applicationApiUrl`, `applicationApiWsUrl` |
|
|
131
|
+
| `sharedGameApiUrl`, `sharedGameApiWsUrl` (`client.platform.config()`) | `sharedApplicationApiUrl`, `sharedApplicationApiWsUrl` |
|
|
132
|
+
|
|
133
|
+
The old properties hold the same values and are removed on January 1, 2027, when the Application API removes the
|
|
134
|
+
old GraphQL fields. This release needs Application API v2.85.0 or later.
|
|
135
|
+
|
|
123
136
|
## 18.38.0: choose the speakers each player receives
|
|
124
137
|
|
|
125
138
|
Nothing changes until you call it. With Buddy v0.49.0, `game.udp.setSpeakers({ voice, video })` tells the server
|
package/README.md
CHANGED
|
@@ -29,11 +29,12 @@ This README is the `dev` branch's: it documents the release on the `dev` dist-ta
|
|
|
29
29
|
(`npm view @crowdedkingdoms/crowdyjs dist-tags`), and its links go to the dev docs site. A
|
|
30
30
|
plain `npm install` resolves `latest`, the production release, which has no `client.exec`.
|
|
31
31
|
|
|
32
|
-
**Server compatibility.** A release selects fields the
|
|
33
|
-
so it needs that
|
|
32
|
+
**Server compatibility.** A release selects fields the Application API it was built against has,
|
|
33
|
+
so it needs that Application API or newer; promote the Application API before the SDK on each tier.
|
|
34
34
|
|
|
35
|
-
| CrowdyJS | Needs the
|
|
35
|
+
| CrowdyJS | Needs the Application API (ck-api) |
|
|
36
36
|
| --- | --- |
|
|
37
|
+
| 18.39.0 | v2.85.0 or later (selects `applicationApiUrl`, `applicationApiWsUrl` and `platformConfig`'s `sharedApplicationApi*`; the `gameApi*` names stay as deprecated aliases until January 1, 2027) |
|
|
37
38
|
| 18.33.0 | v2.73.0 or later (exec's mod builds, mods and CLIENT halves select `studioProjectId` and `studioRevision`; `exec.modClientStarter`, `crowdyStudio.links`) |
|
|
38
39
|
| 18.32.0 | v2.70.0 or later (`chunks.get` and `chunks.byDistance` select `Chunk.voxelsUpdatedAt`) |
|
|
39
40
|
| 18.31.1 | as 18.31.0 |
|
|
@@ -210,8 +211,8 @@ await identity.auth.login({ email, password }); // or register / magic link / so
|
|
|
210
211
|
|
|
211
212
|
const t = await identity.portal.mintAppToken(appId);
|
|
212
213
|
const game = createCrowdyClient({
|
|
213
|
-
httpUrl: t.
|
|
214
|
-
wsUrl: t.
|
|
214
|
+
httpUrl: t.applicationApiUrl!,
|
|
215
|
+
wsUrl: t.applicationApiWsUrl!,
|
|
215
216
|
tokenStore: new BrowserLocalStorageTokenStore('crowdyjs:app:' + appId),
|
|
216
217
|
});
|
|
217
218
|
game.setToken(t.token);
|
|
@@ -222,8 +223,8 @@ Game-to-game routes through Studio's hosted page for a fresh per-game token.
|
|
|
222
223
|
|
|
223
224
|
Notes:
|
|
224
225
|
|
|
225
|
-
- `portal.mintAppToken(appId)` returns the token plus `
|
|
226
|
-
`
|
|
226
|
+
- `portal.mintAppToken(appId)` returns the token plus `applicationApiUrl` /
|
|
227
|
+
`applicationApiWsUrl` / `expiresAt`; it does **not** store the token on the identity
|
|
227
228
|
client — set it on the per-game client.
|
|
228
229
|
- Each client's `AuthState` is observed by both its HTTP client and its
|
|
229
230
|
realtime socket, so HTTP and WebSocket auth never drift within a client.
|
|
@@ -266,7 +267,7 @@ const res = await fetch('https://ck.dev.crowdedkingdoms.com/graphql', {
|
|
|
266
267
|
headers: { 'content-type': 'application/json', authorization: `Bearer ${process.env.CK_ORG_TOKEN}` },
|
|
267
268
|
body: JSON.stringify({
|
|
268
269
|
query: `mutation($i: MintManagedPlayerTokenInput!) { mintManagedPlayerToken(input: $i) {
|
|
269
|
-
token gameTokenId appId expiresAt
|
|
270
|
+
token gameTokenId appId expiresAt applicationApiUrl applicationApiWsUrl discoveryUrl launchUrl } }`,
|
|
270
271
|
variables: {
|
|
271
272
|
i: {
|
|
272
273
|
appId,
|
|
@@ -286,7 +287,7 @@ const { data } = await res.json();
|
|
|
286
287
|
```ts
|
|
287
288
|
// the player's device
|
|
288
289
|
const access = await fetch('/api/crowded-kingdoms/token').then((r) => r.json());
|
|
289
|
-
const game = createCrowdyClient({ httpUrl: access.
|
|
290
|
+
const game = createCrowdyClient({ httpUrl: access.applicationApiUrl, wsUrl: access.applicationApiWsUrl });
|
|
290
291
|
game.portal.adoptAppToken(access); // refuses an org token by mistake
|
|
291
292
|
game.world(appId).subscribe({ actorUpdate: (n) => { /* ... */ } });
|
|
292
293
|
```
|
|
@@ -345,7 +346,7 @@ surface the error and retry `game.udp.connect()` instead of rotating again.
|
|
|
345
346
|
`game.portal.refresh()` remains available for clients with no active UDP
|
|
346
347
|
lifecycle to preserve. A **native (direct-UDP) client** should pass the server it
|
|
347
348
|
is connected to — `game.portal.refresh({ ip4, clientPort })`, the pair
|
|
348
|
-
`serverWithLeastClients` handed it — so the
|
|
349
|
+
`serverWithLeastClients` handed it — so the Application API (v1.83.7+) authorizes the
|
|
349
350
|
new token on that same Buddy and answers `authorizedServer`: when it is set,
|
|
350
351
|
keep the socket and sign with the new token; when it is null, place again with
|
|
351
352
|
`serverWithLeastClients`. A Buddy silently drops datagrams for a token it was
|
|
@@ -506,7 +507,7 @@ not from an untrusted browser.
|
|
|
506
507
|
|
|
507
508
|
## Per-app routing
|
|
508
509
|
|
|
509
|
-
`mintAppToken` returns `
|
|
510
|
+
`mintAppToken` returns `applicationApiUrl` / `applicationApiWsUrl`, so you rarely need a
|
|
510
511
|
separate routing query. When you do (e.g. pre-flight discovery), query the
|
|
511
512
|
app's routing fields:
|
|
512
513
|
|
|
@@ -516,22 +517,22 @@ query AppForRouting($appId: BigInt!) {
|
|
|
516
517
|
appId
|
|
517
518
|
splitMode
|
|
518
519
|
deploymentTarget
|
|
519
|
-
|
|
520
|
+
applicationApiUrl
|
|
520
521
|
}
|
|
521
522
|
}
|
|
522
523
|
```
|
|
523
524
|
|
|
524
|
-
`
|
|
525
|
+
`applicationApiUrl` is populated for both dedicated (`splitMode`) and shared
|
|
525
526
|
(`deploymentTarget: "shared"`) apps. When it's set, build a second
|
|
526
|
-
`CrowdyClient` with `httpUrl:
|
|
527
|
+
`CrowdyClient` with `httpUrl: applicationApiUrl` (and the matching `wsUrl`) holding
|
|
527
528
|
that app's app-scoped token, then drive gameplay through that client. Apps
|
|
528
|
-
with no `
|
|
529
|
-
configured. See [Loading an app's
|
|
529
|
+
with no `applicationApiUrl` keep working against the default `httpUrl` you
|
|
530
|
+
configured. See [Loading an app's Application API](https://docs.dev.crowdedkingdoms.com/crowdyjs/shared-environment-routing).
|
|
530
531
|
|
|
531
532
|
## Realtime notifications
|
|
532
533
|
|
|
533
534
|
`subscribe` takes the handlers **and a required `appId`** (second argument).
|
|
534
|
-
The
|
|
535
|
+
The Application API scopes the realtime session to that app and rejects an
|
|
535
536
|
app-agnostic subscription with a `RealtimeConnectionEvent`
|
|
536
537
|
(`code: 'APP_ID_REQUIRED'`); a missing or invalid gameplay token is rejected
|
|
537
538
|
with `AUTH_REQUIRED`. Run one client per app (each holding that app's
|
|
@@ -654,8 +655,8 @@ retries run out and then sits there, connected to nothing.
|
|
|
654
655
|
const bootstrap = await client.udp.gameClientBootstrap(appId);
|
|
655
656
|
|
|
656
657
|
const client = createCrowdyClient({
|
|
657
|
-
httpUrl: bootstrap.
|
|
658
|
-
wsUrl: bootstrap.
|
|
658
|
+
httpUrl: bootstrap.applicationApiUrl,
|
|
659
|
+
wsUrl: bootstrap.applicationApiWsUrl,
|
|
659
660
|
realtime: {
|
|
660
661
|
// The LOAD BALANCER, not the instance above. A discovery URL that dies with
|
|
661
662
|
// the instance it exists to replace is worse than none.
|
|
@@ -1077,12 +1078,12 @@ const stop = await exec.subscribe('arena', 'm1', 'hp', (push) => {
|
|
|
1077
1078
|
exec.onReconnect((host) => console.log('moved to', host));
|
|
1078
1079
|
```
|
|
1079
1080
|
|
|
1080
|
-
- `connect` asks the
|
|
1081
|
+
- `connect` asks the Application API for a host (`execConnect`) and opens a WebSocket to its gateway.
|
|
1081
1082
|
With `nodeType` and `key`, the player lands on the host that runs that instance. On runtimes
|
|
1082
1083
|
without a global `WebSocket` (Node before 22), pass one: `{ WebSocket }` from the `ws` package.
|
|
1083
1084
|
- The connect token rides in the gateway URL, so `connect` dials only a gateway
|
|
1084
|
-
`execGatewayRefusal(
|
|
1085
|
-
the
|
|
1085
|
+
`execGatewayRefusal(applicationApiUrl, gatewayUrl)` passes: `wss:` when the Application API is `https:`, and on
|
|
1086
|
+
the Application API's estate or the platform's (a loopback Application API may name a loopback gateway, as
|
|
1086
1087
|
ck-exec's local cluster does). Any other is refused `Unavailable` without being dialed (18.1.0).
|
|
1087
1088
|
- A gateway that refuses the connect token answers the upgrade `HTTP 401` with its reason. Under
|
|
1088
1089
|
Node's `ws` package `connect` throws `Denied` with that reason; a browser cannot read a refused
|
|
@@ -1494,8 +1495,8 @@ CROWDY_TEST_APP_ID='78221653114368' \
|
|
|
1494
1495
|
**`CROWDY_HTTP_URL` is the ENTRY origin, not the gameplay origin.** Point it at
|
|
1495
1496
|
the shared multivalue name (`ck.<tier>…`), the same one a cold client resolves.
|
|
1496
1497
|
The harness then does what the SDK is built to do: sign in and mint against the
|
|
1497
|
-
entry origin, and build every gameplay client on the `
|
|
1498
|
-
`
|
|
1498
|
+
entry origin, and build every gameplay client on the `applicationApiUrl` /
|
|
1499
|
+
`applicationApiWsUrl` the mint returns, threading `discoveryUrl` into `realtime` so
|
|
1499
1500
|
instance loss is recoverable.
|
|
1500
1501
|
|
|
1501
1502
|
Do not point it at a single datacenter to "make the tests pass". That was the
|
|
@@ -1578,7 +1579,7 @@ refresh them from an explicitly supplied source:
|
|
|
1578
1579
|
`npm run authoring-index:drift -- --source <exporter-json> [--write]`, then
|
|
1579
1580
|
`npm run authoring-index:generate`.
|
|
1580
1581
|
- The agent tool-descriptor fixture:
|
|
1581
|
-
`npm run agent-descriptors:drift -- --source <
|
|
1582
|
+
`npm run agent-descriptors:drift -- --source <application-api-fixture>`; every
|
|
1582
1583
|
build re-checks the digests.
|
|
1583
1584
|
|
|
1584
1585
|
## Migration
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* fresh `gameApiUrl`/`gameApiWsUrl`.
|
|
13
13
|
*/
|
|
14
14
|
const BOOTSTRAP_QUERY = `query CrowdyJsRediscover($appId: BigInt!) {
|
|
15
|
-
gameClientBootstrap(appId: $appId) {
|
|
15
|
+
gameClientBootstrap(appId: $appId) { applicationApiUrl applicationApiWsUrl discoveryUrl }
|
|
16
16
|
}`;
|
|
17
17
|
function graphqlEndpoint(origin) {
|
|
18
18
|
const trimmed = stripTrailingSlashes(origin);
|
|
@@ -57,14 +57,14 @@ export function createBootstrapRediscover(options) {
|
|
|
57
57
|
}
|
|
58
58
|
const body = (await res.json());
|
|
59
59
|
const found = body?.data?.gameClientBootstrap;
|
|
60
|
-
if (!found?.
|
|
60
|
+
if (!found?.applicationApiUrl && !found?.applicationApiWsUrl) {
|
|
61
61
|
// An older server that does not publish these fields yet. Say so once
|
|
62
62
|
// rather than looping on an endpoint that can never answer.
|
|
63
63
|
options.logger?.warn?.('Re-discovery returned no endpoint; this server may predate ' +
|
|
64
64
|
'gameClientBootstrap.discoveryUrl (ck-api v1.20.0).');
|
|
65
65
|
return null;
|
|
66
66
|
}
|
|
67
|
-
return { httpUrl: found.
|
|
67
|
+
return { httpUrl: found.applicationApiUrl, wsUrl: found.applicationApiWsUrl };
|
|
68
68
|
}
|
|
69
69
|
catch (error) {
|
|
70
70
|
// Never fatal: returning null leaves the client on its current endpoint
|
package/dist/client.js
CHANGED
|
@@ -174,7 +174,7 @@ export class GraphQLClient {
|
|
|
174
174
|
if (!moved)
|
|
175
175
|
throw error;
|
|
176
176
|
this.logger.info?.(`moved to ${move.appDatacenter ?? 'the app\u2019s datacenter'} at ` +
|
|
177
|
-
`${move.
|
|
177
|
+
`${move.applicationApiUrl} and retrying`);
|
|
178
178
|
return await this.attempt(query, variables, options);
|
|
179
179
|
}
|
|
180
180
|
}
|
package/dist/crowdy-client.js
CHANGED
|
@@ -172,7 +172,7 @@ export class CrowdyClient {
|
|
|
172
172
|
// instance-level version of that split, because the datacenter left behind
|
|
173
173
|
// holds none of the app's shards and would refuse the subscription too.
|
|
174
174
|
this.graphql.setWrongDatacenterHandler((move) => {
|
|
175
|
-
const endpoint = toGraphqlEndpoint(move.
|
|
175
|
+
const endpoint = toGraphqlEndpoint(move.applicationApiUrl, 'graphql') ?? move.applicationApiUrl;
|
|
176
176
|
if (endpoint === this.graphql.getEndpoint()) {
|
|
177
177
|
// Already there. Returning false stops the transport retrying, because a
|
|
178
178
|
// retry to the same instance is refused identically and a handler that
|
|
@@ -181,8 +181,8 @@ export class CrowdyClient {
|
|
|
181
181
|
}
|
|
182
182
|
this.graphql.setEndpoint(endpoint);
|
|
183
183
|
this.realtime.moveToDatacenter({
|
|
184
|
-
httpUrl: move.
|
|
185
|
-
wsUrl: toGraphqlEndpoint(move.
|
|
184
|
+
httpUrl: move.applicationApiUrl,
|
|
185
|
+
wsUrl: toGraphqlEndpoint(move.applicationApiWsUrl, 'graphql') ?? null,
|
|
186
186
|
datacenter: move.appDatacenter,
|
|
187
187
|
});
|
|
188
188
|
return true;
|
|
@@ -19,8 +19,12 @@
|
|
|
19
19
|
/** Where the server says this client should go instead. */
|
|
20
20
|
export interface DatacenterMove {
|
|
21
21
|
/** Absolute HTTP origin or GraphQL URL of the app's own datacenter. */
|
|
22
|
-
|
|
22
|
+
applicationApiUrl: string;
|
|
23
23
|
/** Matching websocket URL, when the server named one. */
|
|
24
|
+
applicationApiWsUrl?: string;
|
|
25
|
+
/** @deprecated Use applicationApiUrl: the Game API is now the Application API. Removed on January 1, 2027. */
|
|
26
|
+
gameApiUrl: string;
|
|
27
|
+
/** @deprecated Use applicationApiWsUrl: the Game API is now the Application API. Removed on January 1, 2027. */
|
|
24
28
|
gameApiWsUrl?: string;
|
|
25
29
|
/** The app the move is about, for logging. */
|
|
26
30
|
appId?: string;
|
|
@@ -1 +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,
|
|
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,iBAAiB,EAAE,MAAM,CAAC;IAC1B,yDAAyD;IACzD,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,8GAA8G;IAC9G,UAAU,EAAE,MAAM,CAAC;IACnB,gHAAgH;IAChH,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,CAuBvB;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"}
|
|
@@ -31,15 +31,19 @@ export function moveFromError(error) {
|
|
|
31
31
|
return null;
|
|
32
32
|
if (extensions.code !== WRONG_DATACENTER_CODE)
|
|
33
33
|
return null;
|
|
34
|
-
|
|
34
|
+
// An Application API older than v2.85.0 names only the gameApi* keys.
|
|
35
|
+
const applicationApiUrl = asString(extensions.applicationApiUrl) ?? asString(extensions.gameApiUrl);
|
|
35
36
|
// No endpoint means no move. See the note at the top: this is a contract
|
|
36
37
|
// violation rather than an ordinary case, and guessing would send the client
|
|
37
38
|
// somewhere it was not told to go.
|
|
38
|
-
if (!
|
|
39
|
+
if (!applicationApiUrl)
|
|
39
40
|
return null;
|
|
41
|
+
const applicationApiWsUrl = asString(extensions.applicationApiWsUrl) ?? asString(extensions.gameApiWsUrl);
|
|
40
42
|
return {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
applicationApiUrl,
|
|
44
|
+
applicationApiWsUrl,
|
|
45
|
+
gameApiUrl: applicationApiUrl,
|
|
46
|
+
gameApiWsUrl: applicationApiWsUrl,
|
|
43
47
|
appId: asString(extensions.appId),
|
|
44
48
|
appDatacenter: asString(extensions.appDatacenter),
|
|
45
49
|
};
|
package/dist/default-origin.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* GENERATED — do not edit. The operator tooling's
|
|
3
|
-
* `sync-client-origins.mjs --write --tier
|
|
3
|
+
* `sync-client-origins.mjs --write --tier dev` writes this file, and
|
|
4
4
|
* `check-sdk-default-origin.mjs` refuses it when it names the wrong tier or a
|
|
5
5
|
* host that declaration does not carry. Regenerate; never hand-edit.
|
|
6
6
|
*
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
* than no default at all. Every fallback this SDK ever removed named a host that
|
|
11
11
|
* was already dead. A generated file plus a gate is what makes this one different.
|
|
12
12
|
*
|
|
13
|
-
* Source: the operator's per-tier public CK API origin declaration, tier '
|
|
13
|
+
* Source: the operator's per-tier public CK API origin declaration, tier 'dev'
|
|
14
14
|
*/
|
|
15
15
|
/** The tier this build of the SDK is published for. */
|
|
16
|
-
export declare const CROWDY_DEFAULT_TIER = "
|
|
16
|
+
export declare const CROWDY_DEFAULT_TIER = "dev";
|
|
17
17
|
/** The public CK API origin for that tier. */
|
|
18
|
-
export declare const CROWDY_DEFAULT_HTTP_ORIGIN = "https://ck.
|
|
18
|
+
export declare const CROWDY_DEFAULT_HTTP_ORIGIN = "https://ck.dev.crowdedkingdoms.com";
|
|
19
19
|
/** The same host over WebSocket. A scheme is composed; a hostname is looked up. */
|
|
20
|
-
export declare const CROWDY_DEFAULT_WS_ORIGIN = "wss://ck.
|
|
20
|
+
export declare const CROWDY_DEFAULT_WS_ORIGIN = "wss://ck.dev.crowdedkingdoms.com";
|
|
21
21
|
/** The bare hostname, for callers that need to compare rather than dial. */
|
|
22
|
-
export declare const CROWDY_DEFAULT_HOST = "ck.
|
|
22
|
+
export declare const CROWDY_DEFAULT_HOST = "ck.dev.crowdedkingdoms.com";
|
|
23
23
|
//# sourceMappingURL=default-origin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-origin.d.ts","sourceRoot":"","sources":["../src/default-origin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,uDAAuD;AACvD,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"default-origin.d.ts","sourceRoot":"","sources":["../src/default-origin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,uDAAuD;AACvD,eAAO,MAAM,mBAAmB,QAAQ,CAAC;AAEzC,8CAA8C;AAC9C,eAAO,MAAM,0BAA0B,uCAAuC,CAAC;AAE/E,mFAAmF;AACnF,eAAO,MAAM,wBAAwB,qCAAqC,CAAC;AAE3E,4EAA4E;AAC5E,eAAO,MAAM,mBAAmB,+BAA+B,CAAC"}
|
package/dist/default-origin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* GENERATED — do not edit. The operator tooling's
|
|
3
|
-
* `sync-client-origins.mjs --write --tier
|
|
3
|
+
* `sync-client-origins.mjs --write --tier dev` writes this file, and
|
|
4
4
|
* `check-sdk-default-origin.mjs` refuses it when it names the wrong tier or a
|
|
5
5
|
* host that declaration does not carry. Regenerate; never hand-edit.
|
|
6
6
|
*
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
* than no default at all. Every fallback this SDK ever removed named a host that
|
|
11
11
|
* was already dead. A generated file plus a gate is what makes this one different.
|
|
12
12
|
*
|
|
13
|
-
* Source: the operator's per-tier public CK API origin declaration, tier '
|
|
13
|
+
* Source: the operator's per-tier public CK API origin declaration, tier 'dev'
|
|
14
14
|
*/
|
|
15
15
|
/** The tier this build of the SDK is published for. */
|
|
16
|
-
export const CROWDY_DEFAULT_TIER = '
|
|
16
|
+
export const CROWDY_DEFAULT_TIER = 'dev';
|
|
17
17
|
/** The public CK API origin for that tier. */
|
|
18
|
-
export const CROWDY_DEFAULT_HTTP_ORIGIN = 'https://ck.
|
|
18
|
+
export const CROWDY_DEFAULT_HTTP_ORIGIN = 'https://ck.dev.crowdedkingdoms.com';
|
|
19
19
|
/** The same host over WebSocket. A scheme is composed; a hostname is looked up. */
|
|
20
|
-
export const CROWDY_DEFAULT_WS_ORIGIN = 'wss://ck.
|
|
20
|
+
export const CROWDY_DEFAULT_WS_ORIGIN = 'wss://ck.dev.crowdedkingdoms.com';
|
|
21
21
|
/** The bare hostname, for callers that need to compare rather than dial. */
|
|
22
|
-
export const CROWDY_DEFAULT_HOST = 'ck.
|
|
22
|
+
export const CROWDY_DEFAULT_HOST = 'ck.dev.crowdedkingdoms.com';
|
package/dist/domains/apps.d.ts
CHANGED
|
@@ -9,22 +9,24 @@ export interface AppRoute {
|
|
|
9
9
|
/** Numeric id of the app (`BigInt` as a decimal string). */
|
|
10
10
|
appId: string;
|
|
11
11
|
/**
|
|
12
|
-
* `true` when the app's runtime data lives in a dedicated per-tenant
|
|
13
|
-
* database rather than the shared
|
|
12
|
+
* `true` when the app's runtime data lives in a dedicated per-tenant Application API
|
|
13
|
+
* database rather than the shared one. Used together with `applicationApiUrl` to
|
|
14
14
|
* route gameplay calls.
|
|
15
15
|
*/
|
|
16
16
|
splitMode: boolean;
|
|
17
17
|
/**
|
|
18
18
|
* Where the app runs: `'none'` (draft / not deployed), `'shared'` (the shared
|
|
19
|
-
*
|
|
19
|
+
* Application API), or `'dedicated'` (a provisioned per-tenant environment). `null`
|
|
20
20
|
* until the schema/codegen expose it.
|
|
21
21
|
*/
|
|
22
22
|
deploymentTarget: string | null;
|
|
23
23
|
/**
|
|
24
|
-
* The
|
|
25
|
-
* (split-mode) and shared-environment apps. When non-null, build a
|
|
26
|
-
*
|
|
24
|
+
* The Application API base URL to route gameplay to. Set for BOTH dedicated
|
|
25
|
+
* (split-mode) and shared-environment apps. When non-null, build a client
|
|
26
|
+
* against it; when `null`, fall back to the constructor `httpUrl`.
|
|
27
27
|
*/
|
|
28
|
+
applicationApiUrl: string | null;
|
|
29
|
+
/** @deprecated Use applicationApiUrl: the Game API is now the Application API. Removed on January 1, 2027. */
|
|
28
30
|
gameApiUrl: string | null;
|
|
29
31
|
}
|
|
30
32
|
/**
|
|
@@ -55,11 +57,11 @@ export type AppRecordingState = NonNullable<AppRecordingQuery['app']>['recording
|
|
|
55
57
|
* await base.auth.login({ email, password });
|
|
56
58
|
*
|
|
57
59
|
* const route = await base.apps.routeFor(appId);
|
|
58
|
-
* if (route.
|
|
60
|
+
* if (route.applicationApiUrl) {
|
|
59
61
|
* // route gameplay to the app's resolved game-api endpoint
|
|
60
62
|
* const perAppClient = createCrowdyClient({
|
|
61
|
-
* httpUrl: route.
|
|
62
|
-
* wsUrl: route.
|
|
63
|
+
* httpUrl: route.applicationApiUrl,
|
|
64
|
+
* wsUrl: route.applicationApiUrl.replace(/^http/, 'ws'),
|
|
63
65
|
* tokenStore: base.session.tokenStore,
|
|
64
66
|
* });
|
|
65
67
|
* }
|
|
@@ -155,14 +157,14 @@ export declare class AppsAPI {
|
|
|
155
157
|
myApps(): Promise<MyAppsQuery['myApps']>;
|
|
156
158
|
/**
|
|
157
159
|
* Convenience wrapper over {@link app} that returns just the {@link AppRoute}
|
|
158
|
-
* routing tuple for an app — i.e. which
|
|
159
|
-
* the app row is missing or the API does not expose the split-mode fields yet,
|
|
160
|
+
* routing tuple for an app — i.e. which Application API endpoint should serve it.
|
|
161
|
+
* If the app row is missing or the API does not expose the split-mode fields yet,
|
|
160
162
|
* returns a safe default (`{ appId, splitMode: false, deploymentTarget: null,
|
|
161
|
-
*
|
|
163
|
+
* applicationApiUrl: null }`) so the caller keeps using the legacy single-endpoint
|
|
162
164
|
* deployment.
|
|
163
165
|
*
|
|
164
166
|
* @param appId - Numeric id of the app (`BigInt` as a decimal string).
|
|
165
|
-
* @returns The {@link AppRoute}; route gameplay to `
|
|
167
|
+
* @returns The {@link AppRoute}; route gameplay to `applicationApiUrl` when non-null,
|
|
166
168
|
* otherwise fall back to the constructor `httpUrl`.
|
|
167
169
|
* @throws {CrowdyGraphQLError} `UNAUTHENTICATED` (it calls {@link app} under
|
|
168
170
|
* the hood).
|
|
@@ -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,EAkBL,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,+BAA+B,EACpC,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,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,EAC3B,KAAK,+BAA+B,EACpC,KAAK,oBAAoB,E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C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCG;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;CAI7C"}
|
package/dist/domains/apps.js
CHANGED
|
@@ -5,11 +5,14 @@ function appRouteFromAppRow(row) {
|
|
|
5
5
|
const r = row;
|
|
6
6
|
if (typeof r.appId !== 'string')
|
|
7
7
|
return null;
|
|
8
|
+
const selected = r.applicationApiUrl ?? r.gameApiUrl;
|
|
9
|
+
const url = typeof selected === 'string' && selected ? selected : null;
|
|
8
10
|
return {
|
|
9
11
|
appId: r.appId,
|
|
10
12
|
splitMode: typeof r.splitMode === 'boolean' ? r.splitMode : false,
|
|
11
13
|
deploymentTarget: typeof r.deploymentTarget === 'string' ? r.deploymentTarget : null,
|
|
12
|
-
|
|
14
|
+
applicationApiUrl: url,
|
|
15
|
+
gameApiUrl: url,
|
|
13
16
|
};
|
|
14
17
|
}
|
|
15
18
|
/**
|
|
@@ -34,11 +37,11 @@ function appRouteFromAppRow(row) {
|
|
|
34
37
|
* await base.auth.login({ email, password });
|
|
35
38
|
*
|
|
36
39
|
* const route = await base.apps.routeFor(appId);
|
|
37
|
-
* if (route.
|
|
40
|
+
* if (route.applicationApiUrl) {
|
|
38
41
|
* // route gameplay to the app's resolved game-api endpoint
|
|
39
42
|
* const perAppClient = createCrowdyClient({
|
|
40
|
-
* httpUrl: route.
|
|
41
|
-
* wsUrl: route.
|
|
43
|
+
* httpUrl: route.applicationApiUrl,
|
|
44
|
+
* wsUrl: route.applicationApiUrl.replace(/^http/, 'ws'),
|
|
42
45
|
* tokenStore: base.session.tokenStore,
|
|
43
46
|
* });
|
|
44
47
|
* }
|
|
@@ -177,14 +180,14 @@ export class AppsAPI {
|
|
|
177
180
|
}
|
|
178
181
|
/**
|
|
179
182
|
* Convenience wrapper over {@link app} that returns just the {@link AppRoute}
|
|
180
|
-
* routing tuple for an app — i.e. which
|
|
181
|
-
* the app row is missing or the API does not expose the split-mode fields yet,
|
|
183
|
+
* routing tuple for an app — i.e. which Application API endpoint should serve it.
|
|
184
|
+
* If the app row is missing or the API does not expose the split-mode fields yet,
|
|
182
185
|
* returns a safe default (`{ appId, splitMode: false, deploymentTarget: null,
|
|
183
|
-
*
|
|
186
|
+
* applicationApiUrl: null }`) so the caller keeps using the legacy single-endpoint
|
|
184
187
|
* deployment.
|
|
185
188
|
*
|
|
186
189
|
* @param appId - Numeric id of the app (`BigInt` as a decimal string).
|
|
187
|
-
* @returns The {@link AppRoute}; route gameplay to `
|
|
190
|
+
* @returns The {@link AppRoute}; route gameplay to `applicationApiUrl` when non-null,
|
|
188
191
|
* otherwise fall back to the constructor `httpUrl`.
|
|
189
192
|
* @throws {CrowdyGraphQLError} `UNAUTHENTICATED` (it calls {@link app} under
|
|
190
193
|
* the hood).
|
|
@@ -195,6 +198,7 @@ export class AppsAPI {
|
|
|
195
198
|
appId,
|
|
196
199
|
splitMode: false,
|
|
197
200
|
deploymentTarget: null,
|
|
201
|
+
applicationApiUrl: null,
|
|
198
202
|
gameApiUrl: null,
|
|
199
203
|
});
|
|
200
204
|
}
|
|
@@ -59,13 +59,15 @@ export declare class BillingAPI {
|
|
|
59
59
|
*/
|
|
60
60
|
appBudgets(orgId: string): Promise<AppBudgetsQuery['appBudgets']>;
|
|
61
61
|
/**
|
|
62
|
-
* Set (or clear) an app's monthly spend cap.
|
|
62
|
+
* Set (or clear) an app's monthly spend cap. Once the app's spend this calendar
|
|
63
|
+
* month (UTC) reaches it, the platform pauses the app (`spend_cap`) until the month
|
|
64
|
+
* ends or the cap is raised (Application API v2.84.0). Requires the `manage_billing`
|
|
63
65
|
* app permission.
|
|
64
66
|
*
|
|
65
67
|
* @param orgId - Numeric org id.
|
|
66
68
|
* @param appId - Numeric app id.
|
|
67
69
|
* @param monthlyLimitCents - Monthly cap in minor currency units (decimal
|
|
68
|
-
* string); `"0"`
|
|
70
|
+
* string); `"0"` removes the cap.
|
|
69
71
|
* @returns The updated app budget.
|
|
70
72
|
*/
|
|
71
73
|
setAppBudget(orgId: string, appId: string, monthlyLimitCents: string): Promise<SetAppBudgetMutation['setAppBudget']>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing.d.ts","sourceRoot":"","sources":["../../src/domains/billing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAOL,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,iCAAiC,EACtC,KAAK,0CAA0C,EAC/C,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAC1B,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,UAAU;IACT,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,aAAa;IAE/C;;;;;;;;OAQG;IACG,aAAa,CACjB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC;IAK/C;;;;;;;OAOG;IACG,kBAAkB,CACtB,KAAK,EAAE,MAAM,EACb,IAAI,GAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAO,GAC7C,OAAO,CAAC,uBAAuB,CAAC,oBAAoB,CAAC,CAAC;IASzD;;;;;;;OAOG;IACG,SAAS,CACb,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;IAQvC;;;;;;OAMG;IACG,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,C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8B,CAAC,CAClE;CAWF"}
|
package/dist/domains/billing.js
CHANGED
|
@@ -75,13 +75,15 @@ export class BillingAPI {
|
|
|
75
75
|
return data.appBudgets;
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
78
|
-
* Set (or clear) an app's monthly spend cap.
|
|
78
|
+
* Set (or clear) an app's monthly spend cap. Once the app's spend this calendar
|
|
79
|
+
* month (UTC) reaches it, the platform pauses the app (`spend_cap`) until the month
|
|
80
|
+
* ends or the cap is raised (Application API v2.84.0). Requires the `manage_billing`
|
|
79
81
|
* app permission.
|
|
80
82
|
*
|
|
81
83
|
* @param orgId - Numeric org id.
|
|
82
84
|
* @param appId - Numeric app id.
|
|
83
85
|
* @param monthlyLimitCents - Monthly cap in minor currency units (decimal
|
|
84
|
-
* string); `"0"`
|
|
86
|
+
* string); `"0"` removes the cap.
|
|
85
87
|
* @returns The updated app budget.
|
|
86
88
|
*/
|
|
87
89
|
async setAppBudget(orgId, appId, monthlyLimitCents) {
|
|
@@ -25,8 +25,12 @@ export interface AppEndpoint {
|
|
|
25
25
|
/** Datacenter code, e.g. `or` / `va`. Null when the app has no placement. */
|
|
26
26
|
datacenterCode: string | null;
|
|
27
27
|
/** HTTPS GraphQL origin for the app's own datacenter, or null if unplaced. */
|
|
28
|
+
applicationApiUrl: string | null;
|
|
29
|
+
/** The wss:// form of applicationApiUrl. */
|
|
30
|
+
applicationApiWsUrl: string | null;
|
|
31
|
+
/** @deprecated Use applicationApiUrl: the Game API is now the Application API. Removed on January 1, 2027. */
|
|
28
32
|
gameApiUrl: string | null;
|
|
29
|
-
/**
|
|
33
|
+
/** @deprecated Use applicationApiWsUrl: the Game API is now the Application API. Removed on January 1, 2027. */
|
|
30
34
|
gameApiWsUrl: string | null;
|
|
31
35
|
}
|
|
32
36
|
export declare class DiscoveryDomain {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/domains/discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAGlD,MAAM,WAAW,WAAW;IAC1B,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,8EAA8E;IAC9E,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/domains/discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAGlD,MAAM,WAAW,WAAW;IAC1B,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,8EAA8E;IAC9E,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,4CAA4C;IAC5C,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,8GAA8G;IAC9G,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,gHAAgH;IAChH,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,aAAa;IAE/C;;;;;OAKG;IACG,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAc3E;;;;;OAKG;IACG,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;CAKxE"}
|
|
@@ -16,8 +16,10 @@ export class DiscoveryDomain {
|
|
|
16
16
|
return data.appDiscovery.map((entry) => ({
|
|
17
17
|
appId: String(entry.appId),
|
|
18
18
|
datacenterCode: entry.datacenterCode ?? null,
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
applicationApiUrl: entry.applicationApiUrl ?? null,
|
|
20
|
+
applicationApiWsUrl: entry.applicationApiWsUrl ?? null,
|
|
21
|
+
gameApiUrl: entry.applicationApiUrl ?? null,
|
|
22
|
+
gameApiWsUrl: entry.applicationApiWsUrl ?? null,
|
|
21
23
|
}));
|
|
22
24
|
}
|
|
23
25
|
/**
|
|
@@ -28,7 +30,7 @@ export class DiscoveryDomain {
|
|
|
28
30
|
*/
|
|
29
31
|
async app(appId) {
|
|
30
32
|
const [entry] = await this.apps([appId]);
|
|
31
|
-
if (!entry || !entry.
|
|
33
|
+
if (!entry || !entry.applicationApiUrl)
|
|
32
34
|
return null;
|
|
33
35
|
return entry;
|
|
34
36
|
}
|
|
@@ -8,9 +8,13 @@ export type TerritoryPolicyRecord = TerritoryPoliciesQuery['territoryPolicies'][
|
|
|
8
8
|
* environment. All fields are public (no auth required to read them).
|
|
9
9
|
*/
|
|
10
10
|
export interface PlatformConfig {
|
|
11
|
-
/** Shared
|
|
11
|
+
/** Shared Application API HTTP/GraphQL root for shared-environment apps; `null` if unset. */
|
|
12
|
+
sharedApplicationApiUrl: string | null;
|
|
13
|
+
/** Shared Application API WebSocket root (subscriptions / UDP proxy); `null` if unset. */
|
|
14
|
+
sharedApplicationApiWsUrl: string | null;
|
|
15
|
+
/** @deprecated Use sharedApplicationApiUrl: the Game API is now the Application API. Removed on January 1, 2027. */
|
|
12
16
|
sharedGameApiUrl: string | null;
|
|
13
|
-
/**
|
|
17
|
+
/** @deprecated Use sharedApplicationApiWsUrl: the Game API is now the Application API. Removed on January 1, 2027. */
|
|
14
18
|
sharedGameApiWsUrl: string | null;
|
|
15
19
|
/** Free shared app slots an org gets before a paid subscription is required. */
|
|
16
20
|
freeAppsPerOrg: number;
|
|
@@ -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;AAClD,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,yBAAyB,CAAC;AAEjC,kFAAkF;AAClF,MAAM,MAAM,qBAAqB,GAAG,sBAAsB,CAAC,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAExF;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/domains/platform.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,yBAAyB,CAAC;AAEjC,kFAAkF;AAClF,MAAM,MAAM,qBAAqB,GAAG,sBAAsB,CAAC,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAExF;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,6FAA6F;IAC7F,uBAAuB,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,0FAA0F;IAC1F,yBAAyB,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,oHAAoH;IACpH,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,sHAAsH;IACtH,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,gFAAgF;IAChF,cAAc,EAAE,MAAM,CAAC;CACxB;AAmBD;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,WAAW;IACV,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,aAAa;IAE/C;;;;;;;;OAQG;IACG,MAAM,IAAI,OAAO,CAAC,cAAc,CAAC;IAKvC;;;;;;;;;;;OAWG;IACG,iBAAiB,IAAI,OAAO,CAAC,qBAAqB,EAAE,CAAC;CAI5D"}
|
package/dist/domains/platform.js
CHANGED
|
@@ -5,8 +5,10 @@ import { TerritoryPoliciesDocument, } from '../generated/graphql.js';
|
|
|
5
5
|
const PlatformConfigDocument = parse(/* GraphQL */ `
|
|
6
6
|
query PlatformConfig {
|
|
7
7
|
platformConfig {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
sharedApplicationApiUrl
|
|
9
|
+
sharedApplicationApiWsUrl
|
|
10
|
+
sharedGameApiUrl: sharedApplicationApiUrl
|
|
11
|
+
sharedGameApiWsUrl: sharedApplicationApiWsUrl
|
|
10
12
|
freeAppsPerOrg
|
|
11
13
|
}
|
|
12
14
|
}
|
package/dist/domains/portal.d.ts
CHANGED
|
@@ -63,9 +63,13 @@ export interface AppTokenResponse {
|
|
|
63
63
|
appId: string;
|
|
64
64
|
/** ISO-8601 UTC expiry. Refresh (same app) or re-portal before this. */
|
|
65
65
|
expiresAt: string;
|
|
66
|
-
/** Base HTTPS URL of the
|
|
66
|
+
/** Base HTTPS URL of the Application API serving this app (null if unrouted). */
|
|
67
|
+
applicationApiUrl: string | null;
|
|
68
|
+
/** WebSocket URL of the Application API serving this app. */
|
|
69
|
+
applicationApiWsUrl: string | null;
|
|
70
|
+
/** @deprecated Use applicationApiUrl: the Game API is now the Application API. Removed on January 1, 2027. */
|
|
67
71
|
gameApiUrl: string | null;
|
|
68
|
-
/**
|
|
72
|
+
/** @deprecated Use applicationApiWsUrl: the Game API is now the Application API. Removed on January 1, 2027. */
|
|
69
73
|
gameApiWsUrl: string | null;
|
|
70
74
|
/**
|
|
71
75
|
* Stable entry origin that reaches SOME healthy instance, whatever has failed.
|