@crowdedkingdoms/crowdyjs 15.3.0-test.1 → 15.4.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 +85 -0
- package/dist/default-origin.d.ts +6 -6
- package/dist/default-origin.js +6 -6
- package/dist/domains/compute.d.ts +9 -3
- package/dist/domains/compute.d.ts.map +1 -1
- package/dist/domains/compute.js +9 -3
- package/dist/domains/gameModel.d.ts +14 -0
- package/dist/domains/gameModel.d.ts.map +1 -1
- package/dist/domains/gameModel.js +14 -0
- package/dist/domains/sharedEnvironment.d.ts +43 -1
- package/dist/domains/sharedEnvironment.d.ts.map +1 -1
- package/dist/domains/sharedEnvironment.js +45 -1
- package/dist/generated/graphql.d.ts +89 -15
- package/dist/generated/graphql.d.ts.map +1 -1
- package/dist/generated/graphql.js +9 -8
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/kit/blueprints/combat.d.ts +7 -1
- package/dist/kit/blueprints/combat.d.ts.map +1 -1
- package/dist/kit/blueprints/combat.js +7 -1
- package/dist/kit/blueprints/worldsim.d.ts +10 -3
- package/dist/kit/blueprints/worldsim.d.ts.map +1 -1
- package/dist/kit/blueprints/worldsim.js +10 -3
- package/dist/kit/npcs.d.ts.map +1 -1
- package/dist/kit/social.d.ts.map +1 -1
- package/package.json +1 -1
package/MIGRATION.md
CHANGED
|
@@ -1,3 +1,88 @@
|
|
|
1
|
+
# CrowdyJS v15.4 — nothing runs for an app with no player in it
|
|
2
|
+
|
|
3
|
+
**One removal, one addition, and a change in what the platform does that no SDK
|
|
4
|
+
version can shield you from.** Read the third part even if you change no code.
|
|
5
|
+
|
|
6
|
+
## `alwaysOn` is gone
|
|
7
|
+
|
|
8
|
+
`compute.upsertModule({ alwaysOn: true })` is now **refused** by the platform with
|
|
9
|
+
`BAD_REQUEST`. The field is deprecated server-side, always reads `false`, and has
|
|
10
|
+
been dropped from the module fragment this SDK selects, so `modules()` and
|
|
11
|
+
`upsertModule()` no longer return it.
|
|
12
|
+
|
|
13
|
+
If you passed it, delete the argument. If you read it, delete the read — it told
|
|
14
|
+
you nothing after 2026-09-01 and told you something false before you upgraded.
|
|
15
|
+
|
|
16
|
+
## Modules and scheduled work now require a player
|
|
17
|
+
|
|
18
|
+
This is the part that is not about the SDK. A compute module ticks **only while
|
|
19
|
+
its app has at least one player connected**, anywhere in the fleet, and stops
|
|
20
|
+
when the last one leaves. Scheduled automations (`schedule` triggers, cron and
|
|
21
|
+
interval alike) and `gm_timers` behave the same way:
|
|
22
|
+
|
|
23
|
+
- **Automations** that come due while the app is empty are **skipped silently**
|
|
24
|
+
and rescheduled from the moment a player returns. Missed runs are never made
|
|
25
|
+
up.
|
|
26
|
+
- **Timers** whose deadline passes while the app is empty **wait** and fire on
|
|
27
|
+
return. They are late, not lost.
|
|
28
|
+
- **`event` and `manual` triggers are unaffected** — something already asked.
|
|
29
|
+
- **Synchronous `compute.invoke` is unaffected** — it is a request, not a tick.
|
|
30
|
+
|
|
31
|
+
**What to change in your game.** Make scheduled work idempotent in *elapsed
|
|
32
|
+
time* rather than assuming a cadence:
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
// Fragile: stalls while nobody is playing, and resumes as if no time passed.
|
|
36
|
+
crop.growth += 1;
|
|
37
|
+
|
|
38
|
+
// Correct: right whenever anybody next looks at it.
|
|
39
|
+
const elapsedMs = now - crop.lastTick;
|
|
40
|
+
crop.growth += elapsedMs / MS_PER_GROWTH_STEP;
|
|
41
|
+
crop.lastTick = now;
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Store expiries as **timestamps**, not as remaining-tick counters, so a status
|
|
45
|
+
effect that should have lapsed while the world was empty is treated as lapsed
|
|
46
|
+
instead of resuming with time left on it. The `worldsim` and `combat` blueprints'
|
|
47
|
+
docs previously said their automations "run with no client online"; that was true
|
|
48
|
+
and is not, and both have been corrected.
|
|
49
|
+
|
|
50
|
+
A world that genuinely must advance while empty should compute the elapsed time
|
|
51
|
+
on its first tick after a player returns. That is cheaper than ticking an empty
|
|
52
|
+
world and gives the same answer.
|
|
53
|
+
|
|
54
|
+
## Reservations split, and mean something different
|
|
55
|
+
|
|
56
|
+
`sharedEnvironment.setReservedThroughput()` is **new** — the mutation existed all
|
|
57
|
+
along and this SDK never wrapped it.
|
|
58
|
+
|
|
59
|
+
`App.reservedEgressBytesPerSec` is deprecated in favour of
|
|
60
|
+
`app.reservedUdpBytesPerSec`, joined by a second dimension,
|
|
61
|
+
`app.reservedGraphqlOpsPerSec`. Reserving one does not reserve the other. Both
|
|
62
|
+
are now selected by the `App` query.
|
|
63
|
+
|
|
64
|
+
Three things a reservation is **not**, all of which it either was or appeared to
|
|
65
|
+
be before:
|
|
66
|
+
|
|
67
|
+
1. **Not a ceiling.** It obliges the platform to keep that much capacity
|
|
68
|
+
provisioned for you and does not cap what you may send. Traffic above the
|
|
69
|
+
reserved rate is metered, not refused.
|
|
70
|
+
2. **Not a data allowance.** The monthly fee buys capacity, not volume, and is
|
|
71
|
+
charged *in addition to* metered usage. Reserving 5 MB/s does not make the
|
|
72
|
+
first 5 MB/s free.
|
|
73
|
+
3. **Not the way to lift the free-tier cap.** Unfunded free apps are shaped at
|
|
74
|
+
roughly 1 MB/s. Funding the org wallet or enabling auto-billing lifts that;
|
|
75
|
+
reserving does not. Until 2026-09-01 a reservation did double duty as a
|
|
76
|
+
rate-limit bypass, which is why the old schema descriptions said so.
|
|
77
|
+
|
|
78
|
+
## Also
|
|
79
|
+
|
|
80
|
+
The schema is resynced against the platform, which corrects a stale worked
|
|
81
|
+
example in the rate-card field docs: the illustrative price now reads 19c per
|
|
82
|
+
GiB, matching the shipped card rather than the pre-reprice figure.
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
1
86
|
# CrowdyJS v15.1 — password management (additive)
|
|
2
87
|
|
|
3
88
|
**Nothing breaks.** Four mutations the API has served all along are now wrapped,
|
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 prod` 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 'prod'
|
|
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 = "prod";
|
|
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.prod.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.prod.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.prod.crowdedkingdoms.com";
|
|
23
23
|
//# sourceMappingURL=default-origin.d.ts.map
|
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 prod` 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 'prod'
|
|
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 = 'prod';
|
|
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.prod.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.prod.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.prod.crowdedkingdoms.com';
|
|
@@ -45,13 +45,19 @@ export declare class ComputeAPI {
|
|
|
45
45
|
constructor(gql: GraphQLClient);
|
|
46
46
|
/**
|
|
47
47
|
* Create or update a module's metadata (upsert key `(appId, name)`). New
|
|
48
|
-
* modules start disabled; enable after a successful compile.
|
|
49
|
-
*
|
|
50
|
-
*
|
|
48
|
+
* modules start disabled; enable after a successful compile.
|
|
49
|
+
*
|
|
50
|
+
* **Nothing runs for an app with no player in it.** A module ticks only while
|
|
51
|
+
* its app has at least one player connected, anywhere in the fleet, and stops
|
|
52
|
+
* when the last one leaves. `alwaysOn` is retired (2026-09-01) and passing
|
|
53
|
+
* `true` is refused — a world that must advance while empty should compute the
|
|
54
|
+
* elapsed time on its first tick after a player returns, which is cheaper than
|
|
55
|
+
* ticking an empty world and gives the same result.
|
|
51
56
|
*
|
|
52
57
|
* Requires the org **`manage_compute`** permission.
|
|
53
58
|
*
|
|
54
59
|
* @throws {CrowdyGraphQLError} `FORBIDDEN` without the permission.
|
|
60
|
+
* @throws {CrowdyGraphQLError} `BAD_REQUEST` if `alwaysOn: true` is passed.
|
|
55
61
|
*/
|
|
56
62
|
upsertModule(input: ComputeUpsertModuleMutationVariables['input']): Promise<ComputeUpsertModuleMutation['computeUpsertModule']>;
|
|
57
63
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compute.d.ts","sourceRoot":"","sources":["../../src/domains/compute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAEL,KAAK,2BAA2B,EAChC,KAAK,oCAAoC,EAEzC,KAAK,4BAA4B,EAEjC,KAAK,+BAA+B,EACpC,KAAK,wCAAwC,EAE7C,KAAK,2BAA2B,EAChC,KAAK,oCAAoC,EAEzC,KAAK,2BAA2B,EAChC,KAAK,oCAAoC,EAEzC,KAAK,4BAA4B,EACjC,KAAK,qCAAqC,EAE1C,KAAK,4BAA4B,EACjC,KAAK,qCAAqC,EAE1C,KAAK,wBAAwB,EAC7B,KAAK,iCAAiC,EAEtC,KAAK,qBAAqB,EAC1B,KAAK,8BAA8B,EAEnC,KAAK,mBAAmB,EACxB,KAAK,4BAA4B,EAEjC,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAEhC,KAAK,0BAA0B,EAC/B,KAAK,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OAGG;IACG,UAAU,CACd,SAAS,EAAE,+BAA+B,GACzC,OAAO,CAAC,sBAAsB,CAAC,mBAAmB,CAAC,CAAC;IAKvD;;;;OAIG;IACG,cAAc,CAClB,SAAS,EAAE,mCAAmC,GAC7C,OAAO,CAAC,0BAA0B,CAAC,uBAAuB,CAAC,CAAC;CAIhE"}
|
package/dist/domains/compute.js
CHANGED
|
@@ -24,13 +24,19 @@ export class ComputeAPI {
|
|
|
24
24
|
// -- Authoring (manage_compute) ---------------------------------------------
|
|
25
25
|
/**
|
|
26
26
|
* Create or update a module's metadata (upsert key `(appId, name)`). New
|
|
27
|
-
* modules start disabled; enable after a successful compile.
|
|
28
|
-
*
|
|
29
|
-
*
|
|
27
|
+
* modules start disabled; enable after a successful compile.
|
|
28
|
+
*
|
|
29
|
+
* **Nothing runs for an app with no player in it.** A module ticks only while
|
|
30
|
+
* its app has at least one player connected, anywhere in the fleet, and stops
|
|
31
|
+
* when the last one leaves. `alwaysOn` is retired (2026-09-01) and passing
|
|
32
|
+
* `true` is refused — a world that must advance while empty should compute the
|
|
33
|
+
* elapsed time on its first tick after a player returns, which is cheaper than
|
|
34
|
+
* ticking an empty world and gives the same result.
|
|
30
35
|
*
|
|
31
36
|
* Requires the org **`manage_compute`** permission.
|
|
32
37
|
*
|
|
33
38
|
* @throws {CrowdyGraphQLError} `FORBIDDEN` without the permission.
|
|
39
|
+
* @throws {CrowdyGraphQLError} `BAD_REQUEST` if `alwaysOn: true` is passed.
|
|
34
40
|
*/
|
|
35
41
|
async upsertModule(input) {
|
|
36
42
|
const data = await this.gql.request(ComputeUpsertModuleDocument, { input });
|
|
@@ -731,6 +731,14 @@ export declare class GameModelAPI {
|
|
|
731
731
|
* Idempotent on `(appId, name)`. The game-api dispatcher runs it headlessly;
|
|
732
732
|
* a tick is just "invoke a function on behalf of the server".
|
|
733
733
|
*
|
|
734
|
+
* **Only while the app has a player in it** (2026-09-01). A scheduled
|
|
735
|
+
* automation that comes due while the app is empty is skipped silently and
|
|
736
|
+
* rescheduled from the moment a player returns; the missed runs are never made
|
|
737
|
+
* up. Write the entry point so it is idempotent in ELAPSED TIME -- advance the
|
|
738
|
+
* world by `now - lastRun` rather than by one step per tick -- or it will
|
|
739
|
+
* silently fall behind whenever nobody is playing. `event` and `manual`
|
|
740
|
+
* triggers are unaffected: something already asked for those.
|
|
741
|
+
*
|
|
734
742
|
* Requires the app-admin **`manage_apps`** permission.
|
|
735
743
|
*
|
|
736
744
|
* @param input - {@link UpsertAutomationInput}: `appId`; `name` (upsert key);
|
|
@@ -893,6 +901,12 @@ export declare class GameModelAPI {
|
|
|
893
901
|
* permission, because a timer fires headlessly with system authority rather
|
|
894
902
|
* than a player's.
|
|
895
903
|
*
|
|
904
|
+
* A timer whose deadline passes while the app has no players **waits** rather
|
|
905
|
+
* than firing into an empty world: the sweep only claims timers for apps with a
|
|
906
|
+
* player present, so it is still armed and fires when somebody returns. It is
|
|
907
|
+
* therefore late, not lost -- read the current time in the handler rather than
|
|
908
|
+
* assuming the delay you asked for is the delay that elapsed.
|
|
909
|
+
*
|
|
896
910
|
* For player-driven delays, declare a `timers` effect on the function instead
|
|
897
911
|
* (see {@link GameModelAPI.upsertFunction}) so the delay is part of your game
|
|
898
912
|
* logic and is armed atomically with that invocation's mutations.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gameModel.d.ts","sourceRoot":"","sources":["../../src/domains/gameModel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAIlD,OAAO,EAGL,KAAK,8BAA8B,EACnC,KAAK,uCAAuC,EAE5C,KAAK,4BAA4B,EACjC,KAAK,qCAAqC,EAE1C,KAAK,+BAA+B,EACpC,KAAK,wCAAwC,EAE7C,KAAK,gCAAgC,EACrC,KAAK,yCAAyC,EAE9C,KAAK,gCAAgC,EACrC,KAAK,yCAAyC,EAE9C,KAAK,4BAA4B,EACjC,KAAK,qCAAqC,EAE1C,KAAK,w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D,OAAO,CAAC,8BAA8B,CAAC,2BAA2B,CAAC,CAAC;IAKvE;;;;;;;OAOG;IACG,cAAc,CAClB,SAAS,EAAE,qCAAqC,GAC/C,OAAO,CAAC,4BAA4B,CAAC,yBAAyB,CAAC,CAAC;IAKnE;;;;;;;;OAQG;IACG,eAAe,CACnB,SAAS,EAAE,sCAAsC,GAChD,OAAO,CAAC,6BAA6B,CAAC,0BAA0B,CAAC,CAAC;IAKrE;;;;;;;;OAQG;IACG,cAAc,CAClB,SAAS,EAAE,qCAAqC,GAC/C,OAAO,CAAC,4BAA4B,CAAC,yBAAyB,CAAC,CAAC;IAKnE;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACG,cAAc,CAClB,KAAK,EAAE,wCAAwC,CAAC,OAAO,CAAC,GACvD,OAAO,CAAC,+BAA+B,CAAC,yBAAyB,CAAC,CAAC;IAKtE;;;;;;;;OAQG;IACG,WAAW,CACf,SAAS,EAAE,qCAAqC,GAC/C,OAAO,CAAC,4BAA4B,CAAC,sBAAsB,CAAC,CAAC;IAKhE;;;;;;;;;;OAUG;IACG,MAAM,CACV,SAAS,EAAE,6BAA6B,GACvC,OAAO,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;CAIpD"}
|
|
@@ -805,6 +805,14 @@ export class GameModelAPI {
|
|
|
805
805
|
* Idempotent on `(appId, name)`. The game-api dispatcher runs it headlessly;
|
|
806
806
|
* a tick is just "invoke a function on behalf of the server".
|
|
807
807
|
*
|
|
808
|
+
* **Only while the app has a player in it** (2026-09-01). A scheduled
|
|
809
|
+
* automation that comes due while the app is empty is skipped silently and
|
|
810
|
+
* rescheduled from the moment a player returns; the missed runs are never made
|
|
811
|
+
* up. Write the entry point so it is idempotent in ELAPSED TIME -- advance the
|
|
812
|
+
* world by `now - lastRun` rather than by one step per tick -- or it will
|
|
813
|
+
* silently fall behind whenever nobody is playing. `event` and `manual`
|
|
814
|
+
* triggers are unaffected: something already asked for those.
|
|
815
|
+
*
|
|
808
816
|
* Requires the app-admin **`manage_apps`** permission.
|
|
809
817
|
*
|
|
810
818
|
* @param input - {@link UpsertAutomationInput}: `appId`; `name` (upsert key);
|
|
@@ -1009,6 +1017,12 @@ export class GameModelAPI {
|
|
|
1009
1017
|
* permission, because a timer fires headlessly with system authority rather
|
|
1010
1018
|
* than a player's.
|
|
1011
1019
|
*
|
|
1020
|
+
* A timer whose deadline passes while the app has no players **waits** rather
|
|
1021
|
+
* than firing into an empty world: the sweep only claims timers for apps with a
|
|
1022
|
+
* player present, so it is still armed and fires when somebody returns. It is
|
|
1023
|
+
* therefore late, not lost -- read the current time in the handler rather than
|
|
1024
|
+
* assuming the delay you asked for is the delay that elapsed.
|
|
1025
|
+
*
|
|
1012
1026
|
* For player-driven delays, declare a `timers` effect on the function instead
|
|
1013
1027
|
* (see {@link GameModelAPI.upsertFunction}) so the delay is part of your game
|
|
1014
1028
|
* logic and is armed atomically with that invocation's mutations.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { GraphQLClient } from '../client.js';
|
|
2
|
-
import { type SharedEnvPlansQuery, type OrgFreeAppQuotaQuery, type AppSharedSubscriptionQuery, type AppRuntimeStateQuery, type OrgAutoBillingQuery, type OrgPaymentMethodsQuery, type PublishAppToSharedMutation, type CancelSharedSubscriptionMutation, type SetAppSpendCapsMutation, type SetAutoBillingMutation, type SetupSharedPaymentMethodMutation, type RemoveSharedPaymentMethodMutation, type PaymentProvider } from '../generated/graphql.js';
|
|
2
|
+
import { type SharedEnvPlansQuery, type OrgFreeAppQuotaQuery, type AppSharedSubscriptionQuery, type AppRuntimeStateQuery, type OrgAutoBillingQuery, type OrgPaymentMethodsQuery, type PublishAppToSharedMutation, type CancelSharedSubscriptionMutation, type SetAppSpendCapsMutation, type SetAppReservedThroughputMutation, type SetAutoBillingMutation, type SetupSharedPaymentMethodMutation, type RemoveSharedPaymentMethodMutation, type PaymentProvider } from '../generated/graphql.js';
|
|
3
3
|
/**
|
|
4
4
|
* Shared-environment app publishing, runtime gating, spend caps, and
|
|
5
5
|
* auto-billing — exposed as `client.sharedEnvironment` (and grouped under
|
|
@@ -95,6 +95,48 @@ export declare class SharedEnvironmentAPI {
|
|
|
95
95
|
hourlyLimitCents?: string | null;
|
|
96
96
|
dailyLimitCents?: string | null;
|
|
97
97
|
}): Promise<SetAppSpendCapsMutation['setAppSpendCaps']>;
|
|
98
|
+
/**
|
|
99
|
+
* Reserve realtime (UDP) capacity for a shared app. Requires `manage_billing`
|
|
100
|
+
* on the app's org.
|
|
101
|
+
*
|
|
102
|
+
* **A reservation is a FLOOR, not a ceiling.** It obliges the platform to keep
|
|
103
|
+
* that much capacity provisioned and in service for you — it raises the
|
|
104
|
+
* autoscaling minimum for the fleet your app runs on. It does **not** cap what
|
|
105
|
+
* you may send: traffic above the reserved rate is metered like any other
|
|
106
|
+
* traffic rather than refused.
|
|
107
|
+
*
|
|
108
|
+
* **It buys capacity, not volume.** The monthly reservation fee is charged in
|
|
109
|
+
* addition to metered usage and includes no data allowance of its own. Every
|
|
110
|
+
* byte is metered from the first one whether or not you hold a reservation:
|
|
111
|
+
* reserving 5 MB/s does not make the first 5 MB/s free.
|
|
112
|
+
*
|
|
113
|
+
* **It is not how you lift the free-tier cap.** Unfunded free apps are shaped
|
|
114
|
+
* at roughly 1 MB/s. That shaping is lifted by funding the org wallet or
|
|
115
|
+
* enabling auto-billing ({@link setAutoBilling}), not by reserving — before
|
|
116
|
+
* 2026-09-01 a reservation did double duty as a rate-limit bypass and no longer
|
|
117
|
+
* does.
|
|
118
|
+
*
|
|
119
|
+
* Billed monthly whether or not the capacity is used; upgrades are prorated for
|
|
120
|
+
* the current month, and lowering or clearing a reservation charges nothing.
|
|
121
|
+
*
|
|
122
|
+
* Reservations are sold in two independent dimensions, because a game may need
|
|
123
|
+
* a great deal of one and little of the other: realtime throughput (this
|
|
124
|
+
* method) and GraphQL operations per second. Reserving one does not reserve the
|
|
125
|
+
* other. Read both back from `app.reservedUdpBytesPerSec` and
|
|
126
|
+
* `app.reservedGraphqlOpsPerSec`.
|
|
127
|
+
*
|
|
128
|
+
* @param input - `orgId`, `appId`, and `reservedBytesPerSec` (decimal MB/s:
|
|
129
|
+
* 1_000_000 = 1 MB/s; 0 clears the reservation).
|
|
130
|
+
* @param idempotencyKey - Recommended for retries; replaying the same key with
|
|
131
|
+
* identical arguments returns the first result instead of charging again.
|
|
132
|
+
* @returns The updated app and the cents debited from the org wallet.
|
|
133
|
+
* @throws {CrowdyGraphQLError} `FORBIDDEN` without `manage_billing`.
|
|
134
|
+
*/
|
|
135
|
+
setReservedThroughput(input: {
|
|
136
|
+
orgId: string;
|
|
137
|
+
appId: string;
|
|
138
|
+
reservedBytesPerSec: string;
|
|
139
|
+
}, idempotencyKey?: string): Promise<SetAppReservedThroughputMutation['setAppReservedThroughput']>;
|
|
98
140
|
/**
|
|
99
141
|
* Enable/disable and configure off-session auto-billing for an org. Requires
|
|
100
142
|
* `manage_billing`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharedEnvironment.d.ts","sourceRoot":"","sources":["../../src/domains/sharedEnvironment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,
|
|
1
|
+
{"version":3,"file":"sharedEnvironment.d.ts","sourceRoot":"","sources":["../../src/domains/sharedEnvironment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAcL,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAC/B,KAAK,gCAAgC,EACrC,KAAK,uBAAuB,EAC5B,KAAK,gCAAgC,EACrC,KAAK,sBAAsB,EAC3B,KAAK,gCAAgC,EACrC,KAAK,iCAAiC,EACtC,KAAK,eAAe,EACrB,MAAM,y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ument, OrgPaymentMethodsDocument, PublishAppToSharedDocument, CancelSharedSubscriptionDocument, SetAppSpendCapsDocument, SetAutoBillingDocument, SetupSharedPaymentMethodDocument, RemoveSharedPaymentMethodDocument, } from '../generated/graphql.js';
|
|
1
|
+
import { SharedEnvPlansDocument, OrgFreeAppQuotaDocument, AppSharedSubscriptionDocument, AppRuntimeStateDocument, OrgAutoBillingDocument, OrgPaymentMethodsDocument, PublishAppToSharedDocument, CancelSharedSubscriptionDocument, SetAppSpendCapsDocument, SetAppReservedThroughputDocument, SetAutoBillingDocument, SetupSharedPaymentMethodDocument, RemoveSharedPaymentMethodDocument, } from '../generated/graphql.js';
|
|
2
2
|
/**
|
|
3
3
|
* Shared-environment app publishing, runtime gating, spend caps, and
|
|
4
4
|
* auto-billing — exposed as `client.sharedEnvironment` (and grouped under
|
|
@@ -132,6 +132,50 @@ export class SharedEnvironmentAPI {
|
|
|
132
132
|
});
|
|
133
133
|
return data.setAppSpendCaps;
|
|
134
134
|
}
|
|
135
|
+
/**
|
|
136
|
+
* Reserve realtime (UDP) capacity for a shared app. Requires `manage_billing`
|
|
137
|
+
* on the app's org.
|
|
138
|
+
*
|
|
139
|
+
* **A reservation is a FLOOR, not a ceiling.** It obliges the platform to keep
|
|
140
|
+
* that much capacity provisioned and in service for you — it raises the
|
|
141
|
+
* autoscaling minimum for the fleet your app runs on. It does **not** cap what
|
|
142
|
+
* you may send: traffic above the reserved rate is metered like any other
|
|
143
|
+
* traffic rather than refused.
|
|
144
|
+
*
|
|
145
|
+
* **It buys capacity, not volume.** The monthly reservation fee is charged in
|
|
146
|
+
* addition to metered usage and includes no data allowance of its own. Every
|
|
147
|
+
* byte is metered from the first one whether or not you hold a reservation:
|
|
148
|
+
* reserving 5 MB/s does not make the first 5 MB/s free.
|
|
149
|
+
*
|
|
150
|
+
* **It is not how you lift the free-tier cap.** Unfunded free apps are shaped
|
|
151
|
+
* at roughly 1 MB/s. That shaping is lifted by funding the org wallet or
|
|
152
|
+
* enabling auto-billing ({@link setAutoBilling}), not by reserving — before
|
|
153
|
+
* 2026-09-01 a reservation did double duty as a rate-limit bypass and no longer
|
|
154
|
+
* does.
|
|
155
|
+
*
|
|
156
|
+
* Billed monthly whether or not the capacity is used; upgrades are prorated for
|
|
157
|
+
* the current month, and lowering or clearing a reservation charges nothing.
|
|
158
|
+
*
|
|
159
|
+
* Reservations are sold in two independent dimensions, because a game may need
|
|
160
|
+
* a great deal of one and little of the other: realtime throughput (this
|
|
161
|
+
* method) and GraphQL operations per second. Reserving one does not reserve the
|
|
162
|
+
* other. Read both back from `app.reservedUdpBytesPerSec` and
|
|
163
|
+
* `app.reservedGraphqlOpsPerSec`.
|
|
164
|
+
*
|
|
165
|
+
* @param input - `orgId`, `appId`, and `reservedBytesPerSec` (decimal MB/s:
|
|
166
|
+
* 1_000_000 = 1 MB/s; 0 clears the reservation).
|
|
167
|
+
* @param idempotencyKey - Recommended for retries; replaying the same key with
|
|
168
|
+
* identical arguments returns the first result instead of charging again.
|
|
169
|
+
* @returns The updated app and the cents debited from the org wallet.
|
|
170
|
+
* @throws {CrowdyGraphQLError} `FORBIDDEN` without `manage_billing`.
|
|
171
|
+
*/
|
|
172
|
+
async setReservedThroughput(input, idempotencyKey) {
|
|
173
|
+
const data = await this.api.request(SetAppReservedThroughputDocument, {
|
|
174
|
+
input,
|
|
175
|
+
idempotencyKey,
|
|
176
|
+
});
|
|
177
|
+
return data.setAppReservedThroughput;
|
|
178
|
+
}
|
|
135
179
|
/**
|
|
136
180
|
* Enable/disable and configure off-session auto-billing for an org. Requires
|
|
137
181
|
* `manage_billing`.
|