@crowdedkingdoms/crowdyjs 18.39.1 → 18.40.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.
Files changed (51) hide show
  1. package/MIGRATION.md +62 -0
  2. package/README.md +420 -17
  3. package/dist/binary-wire.d.ts +94 -1
  4. package/dist/binary-wire.d.ts.map +1 -1
  5. package/dist/binary-wire.js +122 -20
  6. package/dist/crowdy-client.d.ts +7 -0
  7. package/dist/crowdy-client.d.ts.map +1 -1
  8. package/dist/crowdy-client.js +3 -0
  9. package/dist/default-origin.d.ts +6 -6
  10. package/dist/default-origin.d.ts.map +1 -1
  11. package/dist/default-origin.js +6 -6
  12. package/dist/domains/admin.d.ts +7 -0
  13. package/dist/domains/admin.d.ts.map +1 -1
  14. package/dist/domains/admin.js +1 -0
  15. package/dist/domains/exec.d.ts +91 -3
  16. package/dist/domains/exec.d.ts.map +1 -1
  17. package/dist/domains/exec.js +132 -5
  18. package/dist/domains/fleetSessions.d.ts +87 -0
  19. package/dist/domains/fleetSessions.d.ts.map +1 -0
  20. package/dist/domains/fleetSessions.js +87 -0
  21. package/dist/dropped-read.d.ts +2 -1
  22. package/dist/dropped-read.d.ts.map +1 -1
  23. package/dist/dropped-read.js +2 -6
  24. package/dist/errors.d.ts +59 -0
  25. package/dist/errors.d.ts.map +1 -1
  26. package/dist/errors.js +70 -0
  27. package/dist/fleet/index.d.ts +4 -0
  28. package/dist/fleet/index.d.ts.map +1 -0
  29. package/dist/fleet/index.js +21 -0
  30. package/dist/fleet/session.d.ts +730 -0
  31. package/dist/fleet/session.d.ts.map +1 -0
  32. package/dist/fleet/session.js +1376 -0
  33. package/dist/fleet/socket.d.ts +59 -0
  34. package/dist/fleet/socket.d.ts.map +1 -0
  35. package/dist/fleet/socket.js +111 -0
  36. package/dist/fleet-wire.d.ts +272 -0
  37. package/dist/fleet-wire.d.ts.map +1 -0
  38. package/dist/fleet-wire.js +472 -0
  39. package/dist/generated/graphql-schema.d.ts +176 -13
  40. package/dist/generated/graphql-schema.d.ts.map +1 -1
  41. package/dist/generated/graphql-schema.js +15 -3
  42. package/dist/generated/graphql.d.ts +79 -0
  43. package/dist/generated/graphql.d.ts.map +1 -1
  44. package/dist/generated/graphql.js +5 -0
  45. package/dist/index.d.ts +6 -3
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +7 -3
  48. package/dist/server-only.d.ts +54 -0
  49. package/dist/server-only.d.ts.map +1 -0
  50. package/dist/server-only.js +55 -0
  51. package/package.json +5 -1
@@ -64,6 +64,21 @@ export type ExecClientFrame = {
64
64
  } | {
65
65
  kind: 'ping';
66
66
  nonce: number;
67
+ }
68
+ /**
69
+ * A call an organization's game server makes for one of its players (client frame `0x05`,
70
+ * ck-exec 0.25.0): `rid:u32 player:u64 type:str8 key:str16 method:str8 payload:rest`. A
71
+ * gateway takes it only on a server connection. `player` is the player's user id, a 64-bit
72
+ * number: pass a `bigint` or a decimal string for one above 2^53.
73
+ */
74
+ | {
75
+ kind: 'callAs';
76
+ rid: number;
77
+ player: bigint | number | string;
78
+ nodeType: string;
79
+ key: string;
80
+ method: string;
81
+ payload: Uint8Array;
67
82
  };
68
83
  /** A message from a gateway to a client. */
69
84
  export type ExecServerFrame = {
@@ -141,12 +156,14 @@ export declare function execGatewayRefusal(gameApiUrl: string, gatewayUrl: strin
141
156
  */
142
157
  export declare const EXEC_CLOSE_ACCESS_ENDED = 4403;
143
158
  /**
144
- * One player's connection to a ck-exec host. Calls go to any node of the app;
145
- * the host routes them. Subscriptions survive reconnects.
159
+ * One connection to a ck-exec host: a player's, a developer's, or an organization's game
160
+ * server's ({@link ExecAPI.connectAsServer}). Calls go to any node of the app; the host
161
+ * routes them. Subscriptions survive reconnects.
146
162
  */
147
163
  export declare class ExecConnection {
148
164
  private readonly dial;
149
165
  private readonly options;
166
+ private readonly server;
150
167
  private ws;
151
168
  private endpoint;
152
169
  private ready;
@@ -160,13 +177,28 @@ export declare class ExecConnection {
160
177
  private readonly WS;
161
178
  private readonly callTimeoutMs;
162
179
  /** @internal Use {@link ExecAPI.connect} or {@link ExecConnection.open}. */
163
- constructor(dial: () => Promise<ExecEndpoint>, options?: ExecConnectOptions);
180
+ constructor(dial: () => Promise<ExecEndpoint>, options?: ExecConnectOptions, server?: boolean);
164
181
  /**
165
182
  * Opens a connection to a known gateway with a connect token, without the game API
166
183
  * (tools and tests; a game uses {@link ExecAPI.connect}). It does not reconnect, and it
167
184
  * dials the URL it is given: {@link execGatewayRefusal} judges only what the game API names.
168
185
  */
169
186
  static open(gatewayUrl: string, token: string, options?: Omit<ExecConnectOptions, 'reconnect'>): Promise<ExecConnection>;
187
+ /**
188
+ * Opens a server connection (ck-exec 0.25.0) to a known gateway with a server connect
189
+ * token you already have, the one `execConnectAsServer` answered. Like {@link open} it does
190
+ * not reconnect (a connect token lasts about a minute and opens one socket) and it dials
191
+ * the URL it is given. A game server uses {@link ExecAPI.connectAsServer}, which reconnects.
192
+ *
193
+ * For a server the organization runs. The connect token comes from the organization's org
194
+ * token, which never goes into a browser page or a game client.
195
+ */
196
+ static openAsServer(gatewayUrl: string, token: string, options?: Omit<ExecConnectOptions, 'reconnect'>): Promise<ExecConnection>;
197
+ /**
198
+ * True for an organization's game server's connection ({@link ExecAPI.connectAsServer},
199
+ * {@link openAsServer}): the only kind that may call {@link callAs}.
200
+ */
201
+ get isServer(): boolean;
170
202
  /** The execution host this connection is on. */
171
203
  get host(): string;
172
204
  /** Called with the new host after every reconnect. */
@@ -203,6 +235,8 @@ export declare class ExecConnection {
203
235
  callRaw(nodeType: string, key: string, method: string, payload?: Uint8Array, options?: {
204
236
  timeoutMs?: number;
205
237
  }): Promise<Uint8Array>;
238
+ /** Sends a call or call-as frame with the one retry {@link callRaw} describes. */
239
+ private callFrame;
206
240
  /**
207
241
  * Calls a node's endpoint: `args` go as MessagePack, the reply comes back decoded.
208
242
  * @throws {CrowdyExecError} for any status but `Ok`; `AppError` carries the handler's message.
@@ -210,6 +244,28 @@ export declare class ExecConnection {
210
244
  call<T = unknown>(nodeType: string, key: string, method: string, args?: unknown, options?: {
211
245
  timeoutMs?: number;
212
246
  }): Promise<T>;
247
+ /**
248
+ * Calls a node's endpoint for one of the organization's players, with raw bytes, on a
249
+ * server connection (client frame `0x05`). The hub sees `Caller::Org { player }`. Crowded
250
+ * Kingdoms checks that the connection is the app's organization's; the player a call names
251
+ * is the organization's word, and a hub should treat it as that. `player` is the player's
252
+ * user id (`FleetCarryResult.userId`), as a `bigint`, a decimal string or a safe integer;
253
+ * 0 makes the call the server's own, as {@link callRaw} does. Replies, timeouts and the one
254
+ * retry after a lost connection or a `Moved` reply are those of {@link callRaw}.
255
+ * @throws {CrowdyExecError} `Denied`, with nothing sent, on a connection that is not a
256
+ * server's: a gateway closes such a connection when it is sent this frame.
257
+ */
258
+ callAsRaw(player: bigint | number | string, nodeType: string, key: string, method: string, payload?: Uint8Array, options?: {
259
+ timeoutMs?: number;
260
+ }): Promise<Uint8Array>;
261
+ /**
262
+ * {@link callAsRaw} with `args` as MessagePack and the reply decoded, as {@link call} does.
263
+ * @throws {CrowdyExecError} `Denied`, with nothing sent, on a connection that is not a
264
+ * server's; any status but `Ok` otherwise.
265
+ */
266
+ callAs<T = unknown>(player: bigint | number | string, nodeType: string, key: string, method: string, args?: unknown, options?: {
267
+ timeoutMs?: number;
268
+ }): Promise<T>;
213
269
  /**
214
270
  * Receives what a node publishes on `topic`. Returns a function that stops
215
271
  * this handler (and the subscription, when it was the last one).
@@ -480,6 +536,38 @@ export declare class ExecAPI {
480
536
  * developer token.
481
537
  */
482
538
  connectAsDeveloper(appId: string, options?: ExecConnectOptions): Promise<ExecConnection>;
539
+ /**
540
+ * A host and a server connect token for `appId` (`execConnectAsServer`, Application API
541
+ * v2.89.0), valid for about a minute and for opening one socket: what
542
+ * {@link ExecConnection.openAsServer} takes. With `nodeType` (and `key`) the connection
543
+ * lands on the host that runs that instance, placing it if needed.
544
+ *
545
+ * Takes the organization's org token (`cko_…`, scope `fleet:session`) as this client's
546
+ * bearer, on a server the organization runs; an org token never goes into a browser page or
547
+ * a game client. The checks of `fleetSessions.open` apply, and so do its refusals
548
+ * (`ORG_TOKEN_REQUIRED`, `FORBIDDEN`, `ORG_LEGAL_ACCEPTANCE_REQUIRED`, `PLATFORM_BUSY` with
549
+ * `retryAfterMs`).
550
+ */
551
+ serverEndpoint(appId: string, options?: {
552
+ nodeType?: string;
553
+ key?: string;
554
+ }): Promise<ExecEndpoint & {
555
+ expiresAt: string;
556
+ }>;
557
+ /**
558
+ * Connects the organization's game server to the app's hubs as itself (ck-exec 0.25.0):
559
+ * one connection for each game server. Its plain calls are the server's own
560
+ * (`Caller::Org { player: None }` in a hub) and {@link ExecConnection.callAs} makes a call
561
+ * for one of the organization's players. It may call and subscribe to any node type of the
562
+ * app, has its own budget of 2,000 calls a second, and a hub it places counts toward no
563
+ * player's limit. The same connection as {@link connect}: it dials only a gateway
564
+ * {@link execGatewayRefusal} passes, and reconnects with a fresh server connect token.
565
+ *
566
+ * Takes the organization's org token as this client's bearer, on a server the organization
567
+ * runs (see {@link serverEndpoint}). The host closes the connection for good when the org
568
+ * token is revoked or fleet sessions are switched off ({@link ExecConnection.onAccessEnded}).
569
+ */
570
+ connectAsServer(appId: string, options?: ExecConnectOptions): Promise<ExecConnection>;
483
571
  /** Guest log lines, newest first, kept for 24 hours. Requires `view_compute_diagnostics`. */
484
572
  logs(appId: string, options?: ExecLogsOptions): Promise<ExecLogLine[]>;
485
573
  /** What the manager has placed for the app. Requires `view_compute_diagnostics`. */
@@ -1 +1 @@
1
- {"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../../src/domains/exec.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAGlD,OAAO,EAAE,WAAW,EAAuB,MAAM,cAAc,CAAC;AAChE,OAAO,EAGL,KAAK,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AAO,CAAC;IAK5E;;;;;OAKG;IACG,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAK1F;;;;;;OAMG;IACG,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAMrF;;;;;;;;OAQG;IACG,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAsC/F;;;;OAIG;IACG,QAAQ,CACZ,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAO,GAChD,OAAO,CAAC,YAAY,GAAG;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAShD;;;;;;;OAOG;IACG,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,cAAc,CAAC;IASvF;;;;;;;OAOG;IACG,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CA0BvE"}
@@ -3,7 +3,8 @@ import { isSameEstate } from '../binary-relay.js';
3
3
  import { CROWDY_DEFAULT_HTTP_ORIGIN } from '../default-origin.js';
4
4
  import { isDroppedRead, retryAfterMsOf } from '../dropped-read.js';
5
5
  import { CrowdyError, CrowdyProtocolError } from '../errors.js';
6
- import { ExecActivateVersionDocument, ExecAppStatusDocument, ExecBuildDocument, ExecBuildStatusDocument, ExecConnectAsDeveloperDocument, ExecConnectDocument, ExecConsentClientModDocument, ExecDeployDocument, ExecEndpointStatsDocument, ExecGridClientModsDocument, ExecInstancesDocument, ExecLogsDocument, ExecAppModsDocument, ExecModBuildDocument, ExecModBuildStatusDocument, ExecModClientArtifactDocument, ExecModClientBuildDocument, ExecModClientDeleteDocument, ExecModClientDeployDocument, ExecModDeleteDocument, ExecModDeployDocument, ExecModInstallDocument, ExecModListingsDocument, ExecModLogsDocument, ExecModPublishDocument, ExecModScope, ExecModSetEnabledDocument, ExecModSetSwitchDocument, ExecModStarterDocument, ExecModClientStarterDocument, ExecModSwitchesDocument, ExecModUnpublishDocument, ExecModsDocument, ExecMyModsDocument, ExecRevokeAuthorTrustDocument, ExecRevokeClientModConsentDocument, ExecSetEnabledDocument, ExecRestartTypeDocument, ExecStartersDocument, ExecTrustAuthorDocument, ExecVersionsDocument, } from '../generated/graphql.js';
6
+ import { ExecActivateVersionDocument, ExecAppStatusDocument, ExecBuildDocument, ExecBuildStatusDocument, ExecConnectAsDeveloperDocument, ExecConnectAsServerDocument, ExecConnectDocument, ExecConsentClientModDocument, ExecDeployDocument, ExecEndpointStatsDocument, ExecGridClientModsDocument, ExecInstancesDocument, ExecLogsDocument, ExecAppModsDocument, ExecModBuildDocument, ExecModBuildStatusDocument, ExecModClientArtifactDocument, ExecModClientBuildDocument, ExecModClientDeleteDocument, ExecModClientDeployDocument, ExecModDeleteDocument, ExecModDeployDocument, ExecModInstallDocument, ExecModListingsDocument, ExecModLogsDocument, ExecModPublishDocument, ExecModScope, ExecModSetEnabledDocument, ExecModSetSwitchDocument, ExecModStarterDocument, ExecModClientStarterDocument, ExecModSwitchesDocument, ExecModUnpublishDocument, ExecModsDocument, ExecMyModsDocument, ExecRevokeAuthorTrustDocument, ExecRevokeClientModConsentDocument, ExecSetEnabledDocument, ExecRestartTypeDocument, ExecStartersDocument, ExecTrustAuthorDocument, ExecVersionsDocument, } from '../generated/graphql.js';
7
+ import { assertOrganizationServer } from '../server-only.js';
7
8
  export { ExecModScope };
8
9
  /**
9
10
  * ck-exec, the hub-and-spoke execution service.
@@ -91,6 +92,11 @@ class FrameWriter {
91
92
  u32(v) {
92
93
  return this.u8(v).u8(v >>> 8).u8(v >>> 16).u8(v >>> 24);
93
94
  }
95
+ u64(v) {
96
+ for (let i = 0n; i < 8n; i += 1n)
97
+ this.parts.push(Number((v >> (8n * i)) & 0xffn));
98
+ return this;
99
+ }
94
100
  str8(s, what) {
95
101
  const b = utf8.encode(s);
96
102
  if (b.length > 0xff)
@@ -140,7 +146,35 @@ export function encodeExecFrame(f) {
140
146
  .finish();
141
147
  case 'ping':
142
148
  return w.u8(0x04).u32(f.nonce).finish();
149
+ case 'callAs':
150
+ return w
151
+ .u8(0x05)
152
+ .u32(f.rid)
153
+ .u64(execPlayerId(f.player))
154
+ .str8(f.nodeType, 'node type')
155
+ .str16(f.key, 'key')
156
+ .str8(f.method, 'method')
157
+ .finish(f.payload);
158
+ }
159
+ }
160
+ const U64_MAX = (1n << 64n) - 1n;
161
+ /** A player's user id as the 64-bit number a call-as frame carries. */
162
+ function execPlayerId(player) {
163
+ let id;
164
+ try {
165
+ if (typeof player === 'number' && !Number.isSafeInteger(player))
166
+ throw new RangeError();
167
+ if (typeof player === 'string' && !/^\d+$/.test(player))
168
+ throw new RangeError();
169
+ id = BigInt(player);
170
+ }
171
+ catch {
172
+ throw new RangeError(`player must be a whole number from 0 to 2^64 - 1: ${String(player)}`);
173
+ }
174
+ if (id < 0n || id > U64_MAX) {
175
+ throw new RangeError(`player must be a whole number from 0 to 2^64 - 1: ${String(player)}`);
143
176
  }
177
+ return id;
144
178
  }
145
179
  /** Decodes a gateway frame, as `ckx_proto::client::ServerMsg::decode` does. */
146
180
  export function decodeExecFrame(bytes) {
@@ -311,14 +345,16 @@ function onUpgradeRefused(ws, refused) {
311
345
  });
312
346
  }
313
347
  /**
314
- * One player's connection to a ck-exec host. Calls go to any node of the app;
315
- * the host routes them. Subscriptions survive reconnects.
348
+ * One connection to a ck-exec host: a player's, a developer's, or an organization's game
349
+ * server's ({@link ExecAPI.connectAsServer}). Calls go to any node of the app; the host
350
+ * routes them. Subscriptions survive reconnects.
316
351
  */
317
352
  export class ExecConnection {
318
353
  /** @internal Use {@link ExecAPI.connect} or {@link ExecConnection.open}. */
319
- constructor(dial, options = {}) {
354
+ constructor(dial, options = {}, server = false) {
320
355
  this.dial = dial;
321
356
  this.options = options;
357
+ this.server = server;
322
358
  this.ws = null;
323
359
  this.endpoint = null;
324
360
  this.ready = null;
@@ -349,6 +385,27 @@ export class ExecConnection {
349
385
  await c.connect();
350
386
  return c;
351
387
  }
388
+ /**
389
+ * Opens a server connection (ck-exec 0.25.0) to a known gateway with a server connect
390
+ * token you already have, the one `execConnectAsServer` answered. Like {@link open} it does
391
+ * not reconnect (a connect token lasts about a minute and opens one socket) and it dials
392
+ * the URL it is given. A game server uses {@link ExecAPI.connectAsServer}, which reconnects.
393
+ *
394
+ * For a server the organization runs. The connect token comes from the organization's org
395
+ * token, which never goes into a browser page or a game client.
396
+ */
397
+ static async openAsServer(gatewayUrl, token, options = {}) {
398
+ const c = new ExecConnection(async () => ({ gatewayUrl, token, host: '' }), { ...options, reconnect: false }, true);
399
+ await c.connect();
400
+ return c;
401
+ }
402
+ /**
403
+ * True for an organization's game server's connection ({@link ExecAPI.connectAsServer},
404
+ * {@link openAsServer}): the only kind that may call {@link callAs}.
405
+ */
406
+ get isServer() {
407
+ return this.server;
408
+ }
352
409
  /** The execution host this connection is on. */
353
410
  get host() {
354
411
  return this.endpoint?.host ?? '';
@@ -580,7 +637,10 @@ export class ExecConnection {
580
637
  * @throws {CrowdyExecError} for any status but `Ok`.
581
638
  */
582
639
  async callRaw(nodeType, key, method, payload = new Uint8Array(), options = {}) {
583
- const frame = { kind: 'call', rid: 0, nodeType, key, method, payload };
640
+ return this.callFrame({ kind: 'call', rid: 0, nodeType, key, method, payload }, options);
641
+ }
642
+ /** Sends a call or call-as frame with the one retry {@link callRaw} describes. */
643
+ async callFrame(frame, options) {
584
644
  const recovers = this.options.reconnect !== false;
585
645
  let reply;
586
646
  try {
@@ -610,6 +670,33 @@ export class ExecConnection {
610
670
  const reply = await this.callRaw(nodeType, key, method, payload, options);
611
671
  return decode(reply, this.options.decode);
612
672
  }
673
+ /**
674
+ * Calls a node's endpoint for one of the organization's players, with raw bytes, on a
675
+ * server connection (client frame `0x05`). The hub sees `Caller::Org { player }`. Crowded
676
+ * Kingdoms checks that the connection is the app's organization's; the player a call names
677
+ * is the organization's word, and a hub should treat it as that. `player` is the player's
678
+ * user id (`FleetCarryResult.userId`), as a `bigint`, a decimal string or a safe integer;
679
+ * 0 makes the call the server's own, as {@link callRaw} does. Replies, timeouts and the one
680
+ * retry after a lost connection or a `Moved` reply are those of {@link callRaw}.
681
+ * @throws {CrowdyExecError} `Denied`, with nothing sent, on a connection that is not a
682
+ * server's: a gateway closes such a connection when it is sent this frame.
683
+ */
684
+ async callAsRaw(player, nodeType, key, method, payload = new Uint8Array(), options = {}) {
685
+ if (!this.server) {
686
+ throw new CrowdyExecError('Denied', "callAs is for an organization's game server: connect with exec.connectAsServer");
687
+ }
688
+ return this.callFrame({ kind: 'callAs', rid: 0, player: execPlayerId(player), nodeType, key, method, payload }, options);
689
+ }
690
+ /**
691
+ * {@link callAsRaw} with `args` as MessagePack and the reply decoded, as {@link call} does.
692
+ * @throws {CrowdyExecError} `Denied`, with nothing sent, on a connection that is not a
693
+ * server's; any status but `Ok` otherwise.
694
+ */
695
+ async callAs(player, nodeType, key, method, args, options = {}) {
696
+ const payload = encode(execWireIntegers(args ?? null), { useBigInt64: true });
697
+ const reply = await this.callAsRaw(player, nodeType, key, method, payload, options);
698
+ return decode(reply, this.options.decode);
699
+ }
613
700
  /**
614
701
  * Receives what a node publishes on `topic`. Returns a function that stops
615
702
  * this handler (and the subscription, when it was the last one).
@@ -807,6 +894,46 @@ export class ExecAPI {
807
894
  await c.connect();
808
895
  return c;
809
896
  }
897
+ /**
898
+ * A host and a server connect token for `appId` (`execConnectAsServer`, Application API
899
+ * v2.89.0), valid for about a minute and for opening one socket: what
900
+ * {@link ExecConnection.openAsServer} takes. With `nodeType` (and `key`) the connection
901
+ * lands on the host that runs that instance, placing it if needed.
902
+ *
903
+ * Takes the organization's org token (`cko_…`, scope `fleet:session`) as this client's
904
+ * bearer, on a server the organization runs; an org token never goes into a browser page or
905
+ * a game client. The checks of `fleetSessions.open` apply, and so do its refusals
906
+ * (`ORG_TOKEN_REQUIRED`, `FORBIDDEN`, `ORG_LEGAL_ACCEPTANCE_REQUIRED`, `PLATFORM_BUSY` with
907
+ * `retryAfterMs`).
908
+ */
909
+ async serverEndpoint(appId, options = {}) {
910
+ assertOrganizationServer('exec.serverEndpoint');
911
+ const data = await this.graphql.request(ExecConnectAsServerDocument, {
912
+ appId,
913
+ nodeType: options.nodeType,
914
+ key: options.key,
915
+ });
916
+ return data.execConnectAsServer;
917
+ }
918
+ /**
919
+ * Connects the organization's game server to the app's hubs as itself (ck-exec 0.25.0):
920
+ * one connection for each game server. Its plain calls are the server's own
921
+ * (`Caller::Org { player: None }` in a hub) and {@link ExecConnection.callAs} makes a call
922
+ * for one of the organization's players. It may call and subscribe to any node type of the
923
+ * app, has its own budget of 2,000 calls a second, and a hub it places counts toward no
924
+ * player's limit. The same connection as {@link connect}: it dials only a gateway
925
+ * {@link execGatewayRefusal} passes, and reconnects with a fresh server connect token.
926
+ *
927
+ * Takes the organization's org token as this client's bearer, on a server the organization
928
+ * runs (see {@link serverEndpoint}). The host closes the connection for good when the org
929
+ * token is revoked or fleet sessions are switched off ({@link ExecConnection.onAccessEnded}).
930
+ */
931
+ async connectAsServer(appId, options = {}) {
932
+ assertOrganizationServer('exec.connectAsServer');
933
+ const c = new ExecConnection(this.checked(() => this.serverEndpoint(appId, { nodeType: options.nodeType, key: options.key })), options, true);
934
+ await c.connect();
935
+ return c;
936
+ }
810
937
  /** Guest log lines, newest first, kept for 24 hours. Requires `view_compute_diagnostics`. */
811
938
  async logs(appId, options = {}) {
812
939
  const data = await this.graphql.request(ExecLogsDocument, { appId, ...options });
@@ -0,0 +1,87 @@
1
+ import type { GraphQLClient } from '../client.js';
2
+ import { type CloseFleetSessionInput, type FleetSessionFieldsFragment, type RefreshFleetSessionInput } from '../generated/graphql.js';
3
+ /**
4
+ * A fleet session as the Application API answers it (`openFleetSession` and
5
+ * `refreshFleetSession`): the session's `token` (64 characters, the key the game server signs
6
+ * the session's realtime messages with), its `gameTokenId`, the `appId`, `expiresAt` (24 hours
7
+ * after it was opened or last refreshed), `maxPlayers` (how many players it may carry at once)
8
+ * and the realtime `server` to connect to (`ip4`, `ip6`, `clientPort`).
9
+ *
10
+ * **Keep the token on the server.** It signs for every player the session carries. It never
11
+ * goes into a browser page or a game client, and the Application API does not accept it as a
12
+ * bearer.
13
+ */
14
+ export type FleetSessionAnswer = FleetSessionFieldsFragment;
15
+ /**
16
+ * Fleet sessions for an organization's own game servers, exposed as `client.fleetSessions`
17
+ * (and `client.admin.fleetSessions`). Application API v2.89.0.
18
+ *
19
+ * A fleet session is one realtime session a game server opens for itself, in which it
20
+ * carries the players who are on it. A player still signs in once, when they join the game
21
+ * (`mintManagedPlayerToken`). A player who moves to another of the organization's servers is
22
+ * carried by that server, with no call to the Application API. These three calls open a
23
+ * session, keep it and end it; `FleetSession` from `@crowdedkingdoms/crowdyjs/fleet` is the
24
+ * realtime session itself.
25
+ *
26
+ * **These calls take the organization's org token, on a server the organization runs.** Build
27
+ * a client for the server and give it the org token (`cko_…`, scope `fleet:session`) with
28
+ * `client.setToken(orgToken)`, without a `tokenStore`. An org token and a fleet token never go
29
+ * into a browser page or a game client: the API refuses a request that carries an `Origin`
30
+ * header, and these methods refuse before any request is made unless the runtime is a
31
+ * server's (Node, Bun, Deno, or a server-side worker; a page and a page's worker are refused).
32
+ *
33
+ * **The org token that opened a session is the one that keeps it and ends it.** Another org
34
+ * token of the same organization gets `NOT_FOUND` from {@link refresh} and `false` from
35
+ * {@link close}. Revoking an org token ends every fleet session and every hub connection it
36
+ * opened. A session that is neither refreshed nor closed ends at its `expiresAt`, 24 hours
37
+ * after it was opened or last refreshed.
38
+ *
39
+ * Refusals arrive as `CrowdyGraphQLError`; branch on `extensions.code` with the readers:
40
+ *
41
+ * | Code | Meaning | Reader |
42
+ * |---|---|---|
43
+ * | `ORG_TOKEN_REQUIRED` | The bearer is not an org token | `orgTokenRequiredOf` |
44
+ * | `ORG_TOKEN_NOT_ALLOWED` | The request came from a browser (it carried an `Origin` header) | `error.code` |
45
+ * | `FLEET_SESSION_LIMIT` | `open`: the organization holds as many sessions as it may (512 unless an operator set another) | `fleetSessionLimitOf` |
46
+ * | `NOT_FOUND` | `refresh`: the session expired, was closed, or was opened with another org token | `fleetSessionNotFoundOf` |
47
+ * | `PLATFORM_BUSY` | The platform could not start the call in time; wait `retryAfterMs`, then call again | `platformBusyOf` |
48
+ * | `ORG_LEGAL_ACCEPTANCE_REQUIRED` | An admin has not accepted the current Org-Managed Players Addendum | `orgLegalAcceptanceRequiredOf` |
49
+ * | `FORBIDDEN` | Fleet sessions are not switched on for the organization, or the org token lacks the `fleet:session` scope | `error.code` |
50
+ * | `SCOPE_MISSING` | The app is not in the org token's app list | `error.code` |
51
+ * | `FEATURE_DISABLED` | The tier does not serve org-managed players | `error.code` |
52
+ */
53
+ export declare class FleetSessionsAPI {
54
+ private readonly graphql;
55
+ constructor(graphql: GraphQLClient);
56
+ /**
57
+ * Open a fleet session in one of the organization's apps (`openFleetSession`), when the
58
+ * game server starts. Open one session for each game server. The answer carries the
59
+ * session's token, its `gameTokenId`, when it expires (24 hours away), how many players it
60
+ * may carry at once and the realtime server to connect to; give it to `FleetSession`.
61
+ */
62
+ open(appId: string): Promise<FleetSessionAnswer>;
63
+ /**
64
+ * Keep a fleet session (`refreshFleetSession`): the same token and `gameTokenId`, with
65
+ * `expiresAt` moved to 24 hours from now. Call it with the org token that opened the
66
+ * session, before `expiresAt`. `FleetSession.refreshDue()` says when, and
67
+ * `FleetSession.refreshInput()` builds this input.
68
+ *
69
+ * Name the realtime server the session is connected to (`currentServer`, the `ip4` and
70
+ * `clientPort` it was given) and the session stays there while that server still serves the
71
+ * app. Leave it out, or name one that no longer serves, and the answer's `server` is another
72
+ * one to connect to: do that after a realtime server told the session to move.
73
+ *
74
+ * @throws {CrowdyGraphQLError} `NOT_FOUND` for a session that expired, was closed, or was
75
+ * opened with another org token (`fleetSessionNotFoundOf`): open a new one.
76
+ */
77
+ refresh(input: RefreshFleetSessionInput): Promise<FleetSessionAnswer>;
78
+ /**
79
+ * End a fleet session now (`closeFleetSession`), when its game server stops. The players it
80
+ * carries are released (their actors leave, as when a player's own session ends) and it no
81
+ * longer counts toward the organization's sessions. Call it with the org token that opened
82
+ * the session. Resolves `true` when a session was ended, and `false` when there was none by
83
+ * that id for this org token: already closed, or opened with another org token.
84
+ */
85
+ close(input: CloseFleetSessionInput): Promise<boolean>;
86
+ }
87
+ //# sourceMappingURL=fleetSessions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fleetSessions.d.ts","sourceRoot":"","sources":["../../src/domains/fleetSessions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAIL,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC9B,MAAM,yBAAyB,CAAC;AAGjC;;;;;;;;;;GAUG;AACH,MAAM,MAAM,kBAAkB,GAAG,0BAA0B,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,qBAAa,gBAAgB;IACf,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,aAAa;IAEnD;;;;;OAKG;IACG,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAMtD;;;;;;;;;;;;;OAaG;IACG,OAAO,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAM3E;;;;;;OAMG;IACG,KAAK,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC;CAK7D"}
@@ -0,0 +1,87 @@
1
+ import { CloseFleetSessionDocument, OpenFleetSessionDocument, RefreshFleetSessionDocument, } from '../generated/graphql.js';
2
+ import { assertOrganizationServer } from '../server-only.js';
3
+ /**
4
+ * Fleet sessions for an organization's own game servers, exposed as `client.fleetSessions`
5
+ * (and `client.admin.fleetSessions`). Application API v2.89.0.
6
+ *
7
+ * A fleet session is one realtime session a game server opens for itself, in which it
8
+ * carries the players who are on it. A player still signs in once, when they join the game
9
+ * (`mintManagedPlayerToken`). A player who moves to another of the organization's servers is
10
+ * carried by that server, with no call to the Application API. These three calls open a
11
+ * session, keep it and end it; `FleetSession` from `@crowdedkingdoms/crowdyjs/fleet` is the
12
+ * realtime session itself.
13
+ *
14
+ * **These calls take the organization's org token, on a server the organization runs.** Build
15
+ * a client for the server and give it the org token (`cko_…`, scope `fleet:session`) with
16
+ * `client.setToken(orgToken)`, without a `tokenStore`. An org token and a fleet token never go
17
+ * into a browser page or a game client: the API refuses a request that carries an `Origin`
18
+ * header, and these methods refuse before any request is made unless the runtime is a
19
+ * server's (Node, Bun, Deno, or a server-side worker; a page and a page's worker are refused).
20
+ *
21
+ * **The org token that opened a session is the one that keeps it and ends it.** Another org
22
+ * token of the same organization gets `NOT_FOUND` from {@link refresh} and `false` from
23
+ * {@link close}. Revoking an org token ends every fleet session and every hub connection it
24
+ * opened. A session that is neither refreshed nor closed ends at its `expiresAt`, 24 hours
25
+ * after it was opened or last refreshed.
26
+ *
27
+ * Refusals arrive as `CrowdyGraphQLError`; branch on `extensions.code` with the readers:
28
+ *
29
+ * | Code | Meaning | Reader |
30
+ * |---|---|---|
31
+ * | `ORG_TOKEN_REQUIRED` | The bearer is not an org token | `orgTokenRequiredOf` |
32
+ * | `ORG_TOKEN_NOT_ALLOWED` | The request came from a browser (it carried an `Origin` header) | `error.code` |
33
+ * | `FLEET_SESSION_LIMIT` | `open`: the organization holds as many sessions as it may (512 unless an operator set another) | `fleetSessionLimitOf` |
34
+ * | `NOT_FOUND` | `refresh`: the session expired, was closed, or was opened with another org token | `fleetSessionNotFoundOf` |
35
+ * | `PLATFORM_BUSY` | The platform could not start the call in time; wait `retryAfterMs`, then call again | `platformBusyOf` |
36
+ * | `ORG_LEGAL_ACCEPTANCE_REQUIRED` | An admin has not accepted the current Org-Managed Players Addendum | `orgLegalAcceptanceRequiredOf` |
37
+ * | `FORBIDDEN` | Fleet sessions are not switched on for the organization, or the org token lacks the `fleet:session` scope | `error.code` |
38
+ * | `SCOPE_MISSING` | The app is not in the org token's app list | `error.code` |
39
+ * | `FEATURE_DISABLED` | The tier does not serve org-managed players | `error.code` |
40
+ */
41
+ export class FleetSessionsAPI {
42
+ constructor(graphql) {
43
+ this.graphql = graphql;
44
+ }
45
+ /**
46
+ * Open a fleet session in one of the organization's apps (`openFleetSession`), when the
47
+ * game server starts. Open one session for each game server. The answer carries the
48
+ * session's token, its `gameTokenId`, when it expires (24 hours away), how many players it
49
+ * may carry at once and the realtime server to connect to; give it to `FleetSession`.
50
+ */
51
+ async open(appId) {
52
+ assertOrganizationServer('fleetSessions.open');
53
+ const data = await this.graphql.request(OpenFleetSessionDocument, { input: { appId } });
54
+ return data.openFleetSession;
55
+ }
56
+ /**
57
+ * Keep a fleet session (`refreshFleetSession`): the same token and `gameTokenId`, with
58
+ * `expiresAt` moved to 24 hours from now. Call it with the org token that opened the
59
+ * session, before `expiresAt`. `FleetSession.refreshDue()` says when, and
60
+ * `FleetSession.refreshInput()` builds this input.
61
+ *
62
+ * Name the realtime server the session is connected to (`currentServer`, the `ip4` and
63
+ * `clientPort` it was given) and the session stays there while that server still serves the
64
+ * app. Leave it out, or name one that no longer serves, and the answer's `server` is another
65
+ * one to connect to: do that after a realtime server told the session to move.
66
+ *
67
+ * @throws {CrowdyGraphQLError} `NOT_FOUND` for a session that expired, was closed, or was
68
+ * opened with another org token (`fleetSessionNotFoundOf`): open a new one.
69
+ */
70
+ async refresh(input) {
71
+ assertOrganizationServer('fleetSessions.refresh');
72
+ const data = await this.graphql.request(RefreshFleetSessionDocument, { input });
73
+ return data.refreshFleetSession;
74
+ }
75
+ /**
76
+ * End a fleet session now (`closeFleetSession`), when its game server stops. The players it
77
+ * carries are released (their actors leave, as when a player's own session ends) and it no
78
+ * longer counts toward the organization's sessions. Call it with the org token that opened
79
+ * the session. Resolves `true` when a session was ended, and `false` when there was none by
80
+ * that id for this org token: already closed, or opened with another org token.
81
+ */
82
+ async close(input) {
83
+ assertOrganizationServer('fleetSessions.close');
84
+ const data = await this.graphql.request(CloseFleetSessionDocument, { input });
85
+ return data.closeFleetSession;
86
+ }
87
+ }
@@ -1,3 +1,4 @@
1
+ import { retryAfterMsOf } from './errors.js';
1
2
  /**
2
3
  * Whether a failed read is worth reading again: nothing came back (a network failure, a body
3
4
  * that does not parse, or a timeout), what came back is not the API's answer (an HTTP 5xx or
@@ -11,5 +12,5 @@
11
12
  */
12
13
  export declare function isDroppedRead(error: unknown): boolean;
13
14
  /** The wait the API asked for before the next read (`extensions.retryAfterMs`), or 0. */
14
- export declare function retryAfterMsOf(error: unknown): number;
15
+ export { retryAfterMsOf };
15
16
  //# sourceMappingURL=dropped-read.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dropped-read.d.ts","sourceRoot":"","sources":["../src/dropped-read.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAQrD;AAED,yFAAyF;AACzF,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAIrD"}
1
+ {"version":3,"file":"dropped-read.d.ts","sourceRoot":"","sources":["../src/dropped-read.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,cAAc,EAEf,MAAM,aAAa,CAAC;AAErB;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAQrD;AAED,yFAAyF;AACzF,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -1,4 +1,4 @@
1
- import { CrowdyHttpError, CrowdyNetworkError, CrowdyTimeoutError, playerFaultOf, } from './errors.js';
1
+ import { CrowdyHttpError, CrowdyNetworkError, CrowdyTimeoutError, playerFaultOf, retryAfterMsOf, } from './errors.js';
2
2
  /**
3
3
  * Whether a failed read is worth reading again: nothing came back (a network failure, a body
4
4
  * that does not parse, or a timeout), what came back is not the API's answer (an HTTP 5xx or
@@ -22,11 +22,7 @@ export function isDroppedRead(error) {
22
22
  return isBusy(error);
23
23
  }
24
24
  /** The wait the API asked for before the next read (`extensions.retryAfterMs`), or 0. */
25
- export function retryAfterMsOf(error) {
26
- const extensions = error?.extensions;
27
- const value = extensions?.retryAfterMs;
28
- return typeof value === 'number' && Number.isFinite(value) && value > 0 ? value : 0;
29
- }
25
+ export { retryAfterMsOf };
30
26
  function isBusy(value) {
31
27
  const fault = playerFaultOf(value);
32
28
  return fault !== null && fault.blame === 'PLATFORM' && fault.retryable;