@crowdedkingdoms/crowdyjs 18.0.0-dev.1 → 18.0.1-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 CHANGED
@@ -7,6 +7,11 @@ code moves to ck-exec (`client.exec`): an app's server code as hubs and spokes,
7
7
  code as mods, and a mod's browser code as its CLIENT half. Nothing is migrated for you; port the
8
8
  code, then upgrade.
9
9
 
10
+ **Which 18.** 18.0.0 was published only on the `dev` channel (`18.0.0-dev.1`). **18.0.1 is the
11
+ first 18.x a client on the production channel will see**, and it carries everything on this page:
12
+ the legacy engines' removal (18.0.0) and the platform-administration removal
13
+ ([below](#platform-administration-is-not-in-the-sdk), 18.0.1).
14
+
10
15
  **What it needs.** 18.0.0 calls nothing the legacy engines served, so it runs against any API
11
16
  with ck-exec CLIENT halves (ck-api `v2.24.0`, as 17.14.0 did). **Crowdy Studio's CLIENT
12
17
  projects need ck-api `v2.25.1` or later:** `v2.24.0` and `v2.25.0` refuse to save a
@@ -79,6 +84,38 @@ as a GraphQL validation error.
79
84
  - `ENGINE_SWITCHED_OFF` left `CrowdyFaultCode`: nothing raises it now.
80
85
  - The kit's type-98 parser is `parseZoneChangeEvent` beside the other wire parsers.
81
86
 
87
+ ## Platform administration is not in the SDK
88
+
89
+ The SDK is for normal clients and designed for production: it carries what players,
90
+ developers and org-admins call, and nothing only a super-admin or a platform operator can
91
+ call. **18.0.1** removes the wrappers that were left (18.0.0 still had them). The API still has every one of these
92
+ fields; **use the API directly from your own tooling** (a GraphQL request with an operator's or
93
+ super-admin's session). There is no SDK replacement.
94
+
95
+ | Removed | Root field |
96
+ | --- | --- |
97
+ | `client.users.paginated`, `client.users.listConnection` | `usersPaginated`, `usersConnection` |
98
+ | `client.users.setSuperAdmin` | `setSuperAdmin` |
99
+ | `client.users.setOperator` | `setOperator` |
100
+ | `client.users.setEarlyAccessOverride` | `setEarlyAccessOverride` |
101
+ | `client.users.updateType` | `updateUserType` |
102
+ | `client.users.forceLogout` | `forceLogoutUser` |
103
+ | `client.payments.all`, `allConnection` (also `client.admin.payments`) | `checkouts`, `checkoutsConnection` |
104
+ | `client.payments.events`, `eventsConnection` | `paymentEvents`, `paymentEventsConnection` |
105
+ | `client.organizations.setStatus` | `setOrgStatus` |
106
+ | `client.apps.setVisibility` | `setAppVisibility` |
107
+ | `client.hosting.all` | `allHostedGames` |
108
+ | `client.hosting.setListing` | `setHostedGameListing` |
109
+ | `client.hosting.takeDown` | `takeDownHostedGame` |
110
+
111
+ - `client.quotas.set` takes a `ScopedSetQuotaInput`: an `appId` or an `orgId` (and optionally a
112
+ `tierId`) is required, and it refuses a platform-global rule before any request.
113
+ `client.quotas.remove` is unchanged; it removes a rule on an org or app the caller manages.
114
+ - `client.users.get` and `client.users.updateState` stay: any session can call them
115
+ (`updateState` writes only the caller); their docs had said super-admin only.
116
+ - The generated types and documents for those operations are gone from
117
+ `@crowdedkingdoms/crowdyjs/generated` as well.
118
+
82
119
  `schema.gql` and the generated types follow the game API: the release carries cks-game-api
83
120
  `dev`'s SDL after #417 merged (`npm run schema:sync:paths -- --schema <that schema.gql>`, then
84
121
  `npm run codegen`).
package/README.md CHANGED
@@ -221,7 +221,7 @@ never told about, so a native refresh without it is a re-placement.
221
221
  | `client.users` | `me`, `updateGamertag`, profile reads. |
222
222
  | `client.session` | Token store, `restore()`, `getToken()`, manual `setToken()`. |
223
223
  | `client.portal` | App-scoped token minting (`mintAppToken`) and the cross-origin PKCE entry flow (`beginEntry` / `handleAuthorizeRequest` / `completeEntry` / `refresh`). |
224
- | `client.hosting` | Third-party hosting on Crowdy Games (17.2.0): `claim` a slug for an app, `beginPublish` / `completePublish` / `abandonPublish` a built bundle, `setEnabled`; public `game(slug)` / `listed()`; operator `all` / `setListing` / `takeDown`. Mutations need an identity session with `manage_apps`. `@crowdedkingdoms/crowdyjs/hosting` exports `publishDirectory(client, { dir, slug })`, the Node helper that does the whole publish for a `dist/`. |
224
+ | `client.hosting` | Third-party hosting on Crowdy Games (17.2.0): `claim` a slug for an app, `beginPublish` / `completePublish` / `abandonPublish` a built bundle, `setEnabled`; public `game(slug)` / `listed()`. Mutations need an identity session with `manage_apps`. `@crowdedkingdoms/crowdyjs/hosting` exports `publishDirectory(client, { dir, slug })`, the Node helper that does the whole publish for a `dist/`. |
225
225
  | `client.platform` | Public platform configuration (`config()`). |
226
226
  | `client.serverStatus` | `gameClientBootstrap(appId)` — per-app version info, UDP status, spatial limits. |
227
227
  | `client.chunks`, `client.voxels`, `client.actors`, `client.avatars`, `client.state` | World data reads + writes: terrain/LODs, voxel edit + history/rollback, durable actors, avatars, per-user app state blobs. |
@@ -255,9 +255,11 @@ grouped under `client.admin` and mirrored at the top level):
255
255
  | `client.sharedEnvironment` | Publish to shared, runtime gating, spend caps, auto-billing. |
256
256
  | `client.gameApps` | App grids (`createGrid` / `deleteGrid`), first-class grid ownership (`ownership` / `assignOwnership` / `transferOwnership`), and grid runtime-permission administration. |
257
257
 
258
- There is no operator surface: `client.operator` held only the legacy compute ceilings and
259
- went with them in 18.0.0 (ck-exec code is bounded by its manifest limits within the
260
- platform's), and infrastructure operations live in the separate infra-control-plane service.
258
+ **The SDK is for normal clients, and designed for production.** It carries what players,
259
+ developers and org-admins call, and nothing only a super-admin or a platform operator can
260
+ call: those fields are in the API, and platform tooling calls them directly (18.0.1 removed
261
+ the last wrappers; see [MIGRATION.md](MIGRATION.md)). There is no `client.operator`, and
262
+ infrastructure operations live in the separate infra-control-plane service.
261
263
 
262
264
  Auth, user reads and the studio-admin surface use the **identity session token**; the
263
265
  world/UDP surfaces require an **app-scoped token** for that app. Both go to the same
@@ -747,7 +749,7 @@ uploads with the exact signed headers, and `completeGamePublish` verifies every
747
749
  object, promotes it and invalidates the CDN. The slug is a DNS label, global on the
748
750
  tier, and first-party names are reserved (`HOSTED_SLUG_UNAVAILABLE`); a tier without
749
751
  a content CDN answers `CONTENT_HOSTING_DISABLED`. Being *listed* in the lobby is an
750
- operator decision (`setListing`); publishing is self-serve. `the-construct`'s
752
+ operator decision, made outside the SDK; publishing is self-serve. `the-construct`'s
751
753
  `npm run publish` is this section as a command.
752
754
 
753
755
  ## Crowdy Studio
@@ -1,5 +1,5 @@
1
1
  import type { GraphQLClient } from '../client.js';
2
- import { type AppQuery, type AppBySlugQuery, type MyAppsQuery, type AppsForOrgQuery, type MarketplaceAppsQuery, type MarketplaceAppsQueryVariables, type AppsConnectionQuery, type AppsConnectionQueryVariables, type CreateAppMutation, type UpdateAppMutation, type ArchiveAppMutation, type SetAppVisibilityMutation, type AppCodeAdmissionModeQuery, type AppCodeAdmissionsQuery, type SetAppCodeAdmissionModeMutation, type AdmitAppCodeMutation, type RevokeAppCodeAdmissionMutation, type PlaceableDatacentersQuery, type CreateAppInput, type UpdateAppInput, type AdmitAppCodeInput, type AppVisibility, type CodeAdmissionMode } from '../generated/graphql.js';
2
+ import { type AppQuery, type AppBySlugQuery, type MyAppsQuery, type AppsForOrgQuery, type MarketplaceAppsQuery, type MarketplaceAppsQueryVariables, type AppsConnectionQuery, type AppsConnectionQueryVariables, type CreateAppMutation, type UpdateAppMutation, type ArchiveAppMutation, type AppCodeAdmissionModeQuery, type AppCodeAdmissionsQuery, type SetAppCodeAdmissionModeMutation, type AdmitAppCodeMutation, type RevokeAppCodeAdmissionMutation, type PlaceableDatacentersQuery, type CreateAppInput, type UpdateAppInput, type AdmitAppCodeInput, type CodeAdmissionMode } from '../generated/graphql.js';
3
3
  /**
4
4
  * The minimal routing tuple the SDK derives from an `App` row: just enough to
5
5
  * decide which game-api endpoint should serve a given app. Returned by
@@ -230,14 +230,5 @@ export declare class AppsAPI {
230
230
  * `manage_apps`.
231
231
  */
232
232
  archive(appId: string): Promise<ArchiveAppMutation['archiveApp']>;
233
- /**
234
- * Override an app's marketplace visibility. **Super-admin only.**
235
- *
236
- * @param appId - Numeric app id.
237
- * @param visibility - The new {@link AppVisibility}.
238
- * @returns The app's updated visibility.
239
- * @throws {CrowdyGraphQLError} `FORBIDDEN` for non-super-admins.
240
- */
241
- setVisibility(appId: string, visibility: AppVisibility): Promise<SetAppVisibilityMutation['setAppVisibility']>;
242
233
  }
243
234
  //# sourceMappingURL=apps.d.ts.map
@@ -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,EAiBL,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,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,EAC3B,KAAK,+BAA+B,EACpC,KAAK,oBAAoB,EACzB,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAE9B,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACvB,MAAM,yBAAyB,CAAC;AAEjC;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACvB,4DAA4D;IAC5D,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC;;;;OAIG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAgBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,qBAAa,OAAO;IACN,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,aAAa;IAE/C;;;OAGG;IACG,iBAAiB,CACrB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,yBAA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CAAC,CAAC;CAI7C"}
@@ -1,4 +1,4 @@
1
- import { AppDocument, AppBySlugDocument, MyAppsDocument, AppsForOrgDocument, MarketplaceAppsDocument, AppsConnectionDocument, CreateAppDocument, UpdateAppDocument, ArchiveAppDocument, SetAppVisibilityDocument, AppCodeAdmissionModeDocument, AppCodeAdmissionsDocument, SetAppCodeAdmissionModeDocument, AdmitAppCodeDocument, RevokeAppCodeAdmissionDocument, PlaceableDatacentersDocument, } from '../generated/graphql.js';
1
+ import { AppDocument, AppBySlugDocument, MyAppsDocument, AppsForOrgDocument, MarketplaceAppsDocument, AppsConnectionDocument, CreateAppDocument, UpdateAppDocument, ArchiveAppDocument, AppCodeAdmissionModeDocument, AppCodeAdmissionsDocument, SetAppCodeAdmissionModeDocument, AdmitAppCodeDocument, RevokeAppCodeAdmissionDocument, PlaceableDatacentersDocument, } from '../generated/graphql.js';
2
2
  function appRouteFromAppRow(row) {
3
3
  if (!row || typeof row !== 'object')
4
4
  return null;
@@ -277,19 +277,4 @@ export class AppsAPI {
277
277
  const data = await this.api.request(ArchiveAppDocument, { appId });
278
278
  return data.archiveApp;
279
279
  }
280
- /**
281
- * Override an app's marketplace visibility. **Super-admin only.**
282
- *
283
- * @param appId - Numeric app id.
284
- * @param visibility - The new {@link AppVisibility}.
285
- * @returns The app's updated visibility.
286
- * @throws {CrowdyGraphQLError} `FORBIDDEN` for non-super-admins.
287
- */
288
- async setVisibility(appId, visibility) {
289
- const data = await this.api.request(SetAppVisibilityDocument, {
290
- appId,
291
- visibility,
292
- });
293
- return data.setAppVisibility;
294
- }
295
280
  }
@@ -31,8 +31,6 @@ export declare class HostingAPI {
31
31
  game(slug: string): Promise<HostedGame | null>;
32
32
  /** Public: the LIVE, LISTED hosted games -- the lobby's list. */
33
33
  listed(): Promise<HostedGame[]>;
34
- /** Operator: every hosted game on the tier. */
35
- all(): Promise<HostedGame[]>;
36
34
  /** The hosted games the caller can manage. Session token. */
37
35
  mine(): Promise<HostedGame[]>;
38
36
  /** Publish history for a game, newest first. Session token + manage_apps. */
@@ -57,10 +55,6 @@ export declare class HostingAPI {
57
55
  abandonPublish(slug: string, publishId: string): Promise<HostedGamePublish>;
58
56
  /** Developer switch: off (DISABLED) or on (LIVE). */
59
57
  setEnabled(slug: string, enabled: boolean): Promise<HostedGame>;
60
- /** Operator: list or unlist in the lobby and the management UI. */
61
- setListing(slug: string, listed: boolean): Promise<HostedGame>;
62
- /** Operator: take down (or restore with `false`). */
63
- takeDown(slug: string, takenDown?: boolean): Promise<HostedGame>;
64
58
  }
65
59
  /**
66
60
  * Upload every file of a publish to its presigned URL, with bounded concurrency and
@@ -1 +1 @@
1
- {"version":3,"file":"hosting.d.ts","sourceRoot":"","sources":["../../src/domains/hosting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAaL,KAAK,wBAAwB,EAC7B,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAC7B,KAAK,+BAA+B,EACpC,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,UAAU,GAAG,wBAAwB,CAAC;AAClD,MAAM,MAAM,iBAAiB,GAAG,+BAA+B,CAAC;AAChE,MAAM,MAAM,sBAAsB,GAAG,wBAAwB,CAAC,kBAAkB,CAAC,CAAC;AAClF,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AACzE,MAAM,MAAM,yBAAyB,GAAG,2BAA2B,CAAC,qBAAqB,CAAC,CAAC;AAC3F,YAAY,EAAE,gBAAgB,EAAE,CAAC;AAEjC;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,UAAU;IACT,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,aAAa;IAE/C,oEAAoE;IAC9D,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;I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ocument, HostedGameDocument, HostedGamePublishesDocument, HostedGamesDocument, MyHostedGamesDocument, SetHostedGameEnabledDocument, SetHostedGameListingDocument, TakeDownHostedGameDocument, } from '../generated/graphql.js';
1
+ import { AbandonGamePublishDocument, BeginGamePublishDocument, ClaimGameHostingDocument, CompleteGamePublishDocument, HostedGameDocument, HostedGamePublishesDocument, HostedGamesDocument, MyHostedGamesDocument, SetHostedGameEnabledDocument, } from '../generated/graphql.js';
2
2
  /**
3
3
  * Third-party game hosting on Crowdy Games (ck-api v2.1, 2026-09-13).
4
4
  *
@@ -31,11 +31,6 @@ export class HostingAPI {
31
31
  const data = await this.api.request(HostedGamesDocument, {});
32
32
  return data.hostedGames;
33
33
  }
34
- /** Operator: every hosted game on the tier. */
35
- async all() {
36
- const data = await this.api.request(AllHostedGamesDocument, {});
37
- return data.allHostedGames;
38
- }
39
34
  /** The hosted games the caller can manage. Session token. */
40
35
  async mine() {
41
36
  const data = await this.api.request(MyHostedGamesDocument, {});
@@ -77,16 +72,6 @@ export class HostingAPI {
77
72
  const data = await this.api.request(SetHostedGameEnabledDocument, { input: { slug, enabled } });
78
73
  return data.setHostedGameEnabled;
79
74
  }
80
- /** Operator: list or unlist in the lobby and the management UI. */
81
- async setListing(slug, listed) {
82
- const data = await this.api.request(SetHostedGameListingDocument, { input: { slug, listed } });
83
- return data.setHostedGameListing;
84
- }
85
- /** Operator: take down (or restore with `false`). */
86
- async takeDown(slug, takenDown = true) {
87
- const data = await this.api.request(TakeDownHostedGameDocument, { slug, takenDown });
88
- return data.takeDownHostedGame;
89
- }
90
75
  }
91
76
  /**
92
77
  * Upload every file of a publish to its presigned URL, with bounded concurrency and
@@ -1,5 +1,5 @@
1
1
  import type { GraphQLClient } from '../client.js';
2
- import { type OrganizationQuery, type OrganizationBySlugQuery, type MyOrganizationsQuery, type OrgMembersQuery, type OrgRolesQuery, type MemberRolesQuery, type OrgPermissionsQuery, type OrgTokensQuery, type CreateOrganizationMutation, type SetOrgStatusMutation, type CreateOrgTokenMutation, type UpdateOrgTokenMutation, type RevokeOrgTokenMutation, type InviteOrgMemberMutation, type RemoveOrgMemberMutation, type UpdateOrgMemberRolesMutation, type CreateOrgRoleMutation, type UpdateOrgRoleMutation, type DeleteOrgRoleMutation, type CreateOrganizationInput, type CreateOrgTokenInput, type UpdateOrgTokenInput, type InviteOrgMemberInput, type CreateOrgRoleInput, type UpdateOrgRoleInput } from '../generated/graphql.js';
2
+ import { type OrganizationQuery, type OrganizationBySlugQuery, type MyOrganizationsQuery, type OrgMembersQuery, type OrgRolesQuery, type MemberRolesQuery, type OrgPermissionsQuery, type OrgTokensQuery, type CreateOrganizationMutation, type CreateOrgTokenMutation, type UpdateOrgTokenMutation, type RevokeOrgTokenMutation, type InviteOrgMemberMutation, type RemoveOrgMemberMutation, type UpdateOrgMemberRolesMutation, type CreateOrgRoleMutation, type UpdateOrgRoleMutation, type DeleteOrgRoleMutation, type CreateOrganizationInput, type CreateOrgTokenInput, type UpdateOrgTokenInput, type InviteOrgMemberInput, type CreateOrgRoleInput, type UpdateOrgRoleInput } from '../generated/graphql.js';
3
3
  /**
4
4
  * Organizations, members, roles (RBAC), and org API tokens — exposed as
5
5
  * `client.organizations` (and grouped under `client.admin`).
@@ -89,14 +89,6 @@ export declare class OrganizationsAPI {
89
89
  * @returns The created {@link Organization}.
90
90
  */
91
91
  create(input: CreateOrganizationInput): Promise<CreateOrganizationMutation['createOrganization']>;
92
- /**
93
- * Set an organization's lifecycle status. **Super-admin only.**
94
- *
95
- * @param orgId - Numeric org id.
96
- * @param status - The new status (e.g. `"active"`, `"suspended"`).
97
- * @returns The updated {@link Organization}.
98
- */
99
- setStatus(orgId: string, status: string): Promise<SetOrgStatusMutation['setOrgStatus']>;
100
92
  /**
101
93
  * Mint a new org API token (for server-side studio backends). Requires the
102
94
  * `manage_tokens` org permission. The plaintext secret is returned **once**.
@@ -1 +1 @@
1
- {"version":3,"file":"organizations.d.ts","sourceRoot":"","sources":["../../src/domains/organizations.ts"],"names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GAC1B,OAAO,CAAC,uBAAuB,CAAC,iBAAiB,CAAC,CAAC;IAOtD;;;;;;;OAOG;IACG,YAAY,CAChB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,uBAAuB,CAAC,iBAAiB,CAAC,CAAC;IAQtD;;;;;;;;OAQG;IACG,cAAc,CAClB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EAAE,GAChB,OAAO,CAAC,4BAA4B,CAAC,sBAAsB,CAAC,CAAC;IAShE;;;;;;;OAOG;IACG,UAAU,CACd,KAAK,EAAE,kBAAkB,GACxB,OAAO,CAAC,qBAAqB,CAAC,eAAe,CAAC,CAAC;IAOlD;;;;;;;OAOG;IACG,UAAU,CACd,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,kBAAkB,GACxB,OAAO,CAAC,qBAAqB,CAAC,eAAe,CAAC,CAAC;IAQlD;;;;;;OAMG;IACG,UAAU,CACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,qBAAqB,CAAC,eAAe,CAAC,CAAC;CAMnD"}
@@ -1,4 +1,4 @@
1
- import { OrganizationDocument, OrganizationBySlugDocument, MyOrganizationsDocument, OrgMembersDocument, OrgRolesDocument, MemberRolesDocument, OrgPermissionsDocument, OrgTokensDocument, CreateOrganizationDocument, SetOrgStatusDocument, CreateOrgTokenDocument, UpdateOrgTokenDocument, RevokeOrgTokenDocument, InviteOrgMemberDocument, RemoveOrgMemberDocument, UpdateOrgMemberRolesDocument, CreateOrgRoleDocument, UpdateOrgRoleDocument, DeleteOrgRoleDocument, } from '../generated/graphql.js';
1
+ import { OrganizationDocument, OrganizationBySlugDocument, MyOrganizationsDocument, OrgMembersDocument, OrgRolesDocument, MemberRolesDocument, OrgPermissionsDocument, OrgTokensDocument, CreateOrganizationDocument, CreateOrgTokenDocument, UpdateOrgTokenDocument, RevokeOrgTokenDocument, InviteOrgMemberDocument, RemoveOrgMemberDocument, UpdateOrgMemberRolesDocument, CreateOrgRoleDocument, UpdateOrgRoleDocument, DeleteOrgRoleDocument, } from '../generated/graphql.js';
2
2
  /**
3
3
  * Organizations, members, roles (RBAC), and org API tokens — exposed as
4
4
  * `client.organizations` (and grouped under `client.admin`).
@@ -124,20 +124,6 @@ export class OrganizationsAPI {
124
124
  });
125
125
  return data.createOrganization;
126
126
  }
127
- /**
128
- * Set an organization's lifecycle status. **Super-admin only.**
129
- *
130
- * @param orgId - Numeric org id.
131
- * @param status - The new status (e.g. `"active"`, `"suspended"`).
132
- * @returns The updated {@link Organization}.
133
- */
134
- async setStatus(orgId, status) {
135
- const data = await this.api.request(SetOrgStatusDocument, {
136
- orgId,
137
- status,
138
- });
139
- return data.setOrgStatus;
140
- }
141
127
  /**
142
128
  * Mint a new org API token (for server-side studio backends). Requires the
143
129
  * `manage_tokens` org permission. The plaintext secret is returned **once**.
@@ -1,19 +1,18 @@
1
1
  import type { GraphQLClient } from '../client.js';
2
- import { type MyCheckoutsQuery, type MyCheckoutsConnectionQuery, type MyCheckoutsConnectionQueryVariables, type CheckoutsQuery, type CheckoutsConnectionQuery, type CheckoutsConnectionQueryVariables, type CreateCheckoutMutation, type CreateCheckoutInput, type CheckoutFilterInput, type CapturePaypalCheckoutMutation, type PaymentEventsQuery, type PaymentEventsQueryVariables, type PaymentEventsConnectionQuery, type PaymentEventsConnectionQueryVariables } from '../generated/graphql.js';
2
+ import { type MyCheckoutsQuery, type MyCheckoutsConnectionQuery, type MyCheckoutsConnectionQueryVariables, type CreateCheckoutMutation, type CreateCheckoutInput, type CapturePaypalCheckoutMutation } from '../generated/graphql.js';
3
3
  /**
4
4
  * Payment checkouts (wallet top-ups, plan purchases) — exposed as
5
5
  * `client.payments` (and grouped under `client.admin`).
6
6
  *
7
- * Part of the management surface. {@link create} and {@link mine} require an
8
- * authenticated caller and act on their own checkouts; {@link all} is
9
- * super-admin only. Amounts are minor currency units (`*Cents`).
7
+ * Part of the management surface. Every method requires an authenticated
8
+ * caller and acts on the caller's own checkouts. Amounts are minor currency
9
+ * units (`*Cents`).
10
10
  *
11
11
  * Note: {@link create} starts a real payment-provider checkout (Stripe /
12
12
  * PayPal). In tests use sandbox provider keys only — never trigger real
13
13
  * charges.
14
14
  *
15
- * @throws {CrowdyGraphQLError} `UNAUTHENTICATED` / `FORBIDDEN` per the notes
16
- * above.
15
+ * @throws {CrowdyGraphQLError} `UNAUTHENTICATED` without a session.
17
16
  */
18
17
  export declare class PaymentsAPI {
19
18
  private readonly api;
@@ -36,19 +35,6 @@ export declare class PaymentsAPI {
36
35
  limit?: number;
37
36
  offset?: number;
38
37
  }): Promise<MyCheckoutsQuery['myCheckouts']>;
39
- /**
40
- * List checkouts across all users with an optional filter. **Super-admin
41
- * only.**
42
- *
43
- * @param opts - Optional {@link CheckoutFilterInput} `filter` and `limit` /
44
- * `offset`.
45
- * @returns The matching checkouts.
46
- */
47
- all(opts?: {
48
- filter?: CheckoutFilterInput;
49
- limit?: number;
50
- offset?: number;
51
- }): Promise<CheckoutsQuery['checkouts']>;
52
38
  /**
53
39
  * Capture an approved PayPal order, finalizing the checkout it belongs to.
54
40
  * Call this after the buyer approves the PayPal order returned by
@@ -71,34 +57,5 @@ export declare class PaymentsAPI {
71
57
  * @returns A checkouts connection.
72
58
  */
73
59
  mineConnection(args?: MyCheckoutsConnectionQueryVariables): Promise<MyCheckoutsConnectionQuery['myCheckoutsConnection']>;
74
- /**
75
- * Relay-style cursor pagination over all checkouts (with optional filter) —
76
- * the preferred alternative to {@link all}. **Super-admin only.**
77
- *
78
- * @param args - Optional `first`, `after`, and {@link CheckoutFilterInput}.
79
- * @returns A checkouts connection.
80
- */
81
- allConnection(args?: CheckoutsConnectionQueryVariables): Promise<CheckoutsConnectionQuery['checkoutsConnection']>;
82
- /**
83
- * List provider webhook events (offset pagination). **Super-admin only** — an
84
- * audit view of received Stripe/PayPal/SES events.
85
- *
86
- * @param opts - Optional `limit` / `offset`.
87
- * @returns A page of {@link PaymentEventRecord}s.
88
- * @remarks Prefer {@link eventsConnection} (Relay cursor pagination); the
89
- * offset args here are deprecated server-side.
90
- */
91
- events(opts?: {
92
- limit?: PaymentEventsQueryVariables['limit'];
93
- offset?: PaymentEventsQueryVariables['offset'];
94
- }): Promise<PaymentEventsQuery['paymentEvents']>;
95
- /**
96
- * Relay-style cursor pagination over provider webhook events. **Super-admin
97
- * only.** See https://docs.crowdedkingdoms.com/overview/pagination.
98
- *
99
- * @param args - Optional `first` and `after`.
100
- * @returns A payment-events connection.
101
- */
102
- eventsConnection(args?: PaymentEventsConnectionQueryVariables): Promise<PaymentEventsConnectionQuery['paymentEventsConnection']>;
103
60
  }
104
61
  //# sourceMappingURL=payments.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"payments.d.ts","sourceRoot":"","sources":["../../src/domains/payments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EASL,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAC/B,KAAK,mCAAmC,EACxC,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC7B,KAAK,iCAAiC,EACtC,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,6BAA6B,EAClC,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,KAAK,qCAAqC,EAC3C,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;;;;GAcG;AACH,qBAAa,WAAW;IACV,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,aAAa;IAE/C;;;;;;OAMG;IACG,MAAM,CACV,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,sBAAsB,CAAC,gBAAgB,CAAC,CAAC;IAOpD;;;;;OAKG;IACG,IAAI,CACR,IAAI,GAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,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xB,KAAK,6BAA6B,EACnC,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;;;GAaG;AACH,qBAAa,WAAW;IACV,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,aAAa;IAE/C;;;;;;OAMG;IACG,MAAM,CACV,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,sBAAsB,CAAC,gBAAgB,CAAC,CAAC;IAOpD;;;;;OAKG;IACG,IAAI,CACR,IAAI,GAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAO,GAC7C,OAAO,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;IAQ3C;;;;;;;;;;;OAWG;IACG,aAAa,CACjB,OAAO,EAAE,MAAM,EACf,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,6BAA6B,CAAC,uBAAuB,CAAC,CAAC;IAQlE;;;;;;;OAOG;IACG,cAAc,CAClB,IAAI,GAAE,mCAAwC,GAC7C,OAAO,CAAC,0BAA0B,CAAC,uBAAuB,CAAC,CAAC;CAOhE"}
@@ -1,18 +1,17 @@
1
- import { MyCheckoutsDocument, MyCheckoutsConnectionDocument, CheckoutsDocument, CheckoutsConnectionDocument, CreateCheckoutDocument, CapturePaypalCheckoutDocument, PaymentEventsDocument, PaymentEventsConnectionDocument, } from '../generated/graphql.js';
1
+ import { MyCheckoutsDocument, MyCheckoutsConnectionDocument, CreateCheckoutDocument, CapturePaypalCheckoutDocument, } from '../generated/graphql.js';
2
2
  /**
3
3
  * Payment checkouts (wallet top-ups, plan purchases) — exposed as
4
4
  * `client.payments` (and grouped under `client.admin`).
5
5
  *
6
- * Part of the management surface. {@link create} and {@link mine} require an
7
- * authenticated caller and act on their own checkouts; {@link all} is
8
- * super-admin only. Amounts are minor currency units (`*Cents`).
6
+ * Part of the management surface. Every method requires an authenticated
7
+ * caller and acts on the caller's own checkouts. Amounts are minor currency
8
+ * units (`*Cents`).
9
9
  *
10
10
  * Note: {@link create} starts a real payment-provider checkout (Stripe /
11
11
  * PayPal). In tests use sandbox provider keys only — never trigger real
12
12
  * charges.
13
13
  *
14
- * @throws {CrowdyGraphQLError} `UNAUTHENTICATED` / `FORBIDDEN` per the notes
15
- * above.
14
+ * @throws {CrowdyGraphQLError} `UNAUTHENTICATED` without a session.
16
15
  */
17
16
  export class PaymentsAPI {
18
17
  constructor(api) {
@@ -44,22 +43,6 @@ export class PaymentsAPI {
44
43
  });
45
44
  return data.myCheckouts;
46
45
  }
47
- /**
48
- * List checkouts across all users with an optional filter. **Super-admin
49
- * only.**
50
- *
51
- * @param opts - Optional {@link CheckoutFilterInput} `filter` and `limit` /
52
- * `offset`.
53
- * @returns The matching checkouts.
54
- */
55
- async all(opts = {}) {
56
- const data = await this.api.request(CheckoutsDocument, {
57
- filter: opts.filter,
58
- limit: opts.limit,
59
- offset: opts.offset,
60
- });
61
- return data.checkouts;
62
- }
63
46
  /**
64
47
  * Capture an approved PayPal order, finalizing the checkout it belongs to.
65
48
  * Call this after the buyer approves the PayPal order returned by
@@ -91,39 +74,4 @@ export class PaymentsAPI {
91
74
  const data = await this.api.request(MyCheckoutsConnectionDocument, args);
92
75
  return data.myCheckoutsConnection;
93
76
  }
94
- /**
95
- * Relay-style cursor pagination over all checkouts (with optional filter) —
96
- * the preferred alternative to {@link all}. **Super-admin only.**
97
- *
98
- * @param args - Optional `first`, `after`, and {@link CheckoutFilterInput}.
99
- * @returns A checkouts connection.
100
- */
101
- async allConnection(args = {}) {
102
- const data = await this.api.request(CheckoutsConnectionDocument, args);
103
- return data.checkoutsConnection;
104
- }
105
- /**
106
- * List provider webhook events (offset pagination). **Super-admin only** — an
107
- * audit view of received Stripe/PayPal/SES events.
108
- *
109
- * @param opts - Optional `limit` / `offset`.
110
- * @returns A page of {@link PaymentEventRecord}s.
111
- * @remarks Prefer {@link eventsConnection} (Relay cursor pagination); the
112
- * offset args here are deprecated server-side.
113
- */
114
- async events(opts = {}) {
115
- const data = await this.api.request(PaymentEventsDocument, opts);
116
- return data.paymentEvents;
117
- }
118
- /**
119
- * Relay-style cursor pagination over provider webhook events. **Super-admin
120
- * only.** See https://docs.crowdedkingdoms.com/overview/pagination.
121
- *
122
- * @param args - Optional `first` and `after`.
123
- * @returns A payment-events connection.
124
- */
125
- async eventsConnection(args = {}) {
126
- const data = await this.api.request(PaymentEventsConnectionDocument, args);
127
- return data.paymentEventsConnection;
128
- }
129
77
  }
@@ -1,13 +1,23 @@
1
1
  import type { GraphQLClient } from '../client.js';
2
2
  import { type QuotasForOrgQuery, type QuotasForAppQuery, type EffectiveQuotaQuery, type SetQuotaMutation, type DeleteQuotaMutation, type SetQuotaInput } from '../generated/graphql.js';
3
+ /**
4
+ * A quota rule for {@link QuotasAPI.set}: {@link SetQuotaInput} scoped to an app
5
+ * or an organization (`tierId` may narrow either). The SDK does not set
6
+ * platform-global rules.
7
+ */
8
+ export type ScopedSetQuotaInput = SetQuotaInput & ({
9
+ appId: string;
10
+ } | {
11
+ orgId: string;
12
+ });
3
13
  /**
4
14
  * Usage quotas at the org and app scope — exposed as `client.quotas` (and
5
15
  * grouped under `client.admin`).
6
16
  *
7
17
  * Part of the management surface. Reads require the `view_usage` org/app
8
- * permission; {@link set} / {@link remove} require `manage_quotas` (global
9
- * quotas are super-admin only). A quota is keyed by a `metric` string; the
10
- * effective value resolves app → org → platform default.
18
+ * permission; {@link set} / {@link remove} require `manage_quotas` on the
19
+ * rule's org or app. A quota is keyed by a `metric` string; the effective
20
+ * value resolves app → org → platform default.
11
21
  *
12
22
  * @throws {CrowdyGraphQLError} `UNAUTHENTICATED` / `FORBIDDEN` / `SCOPE_MISSING`
13
23
  * per the permission notes above.
@@ -45,14 +55,17 @@ export declare class QuotasAPI {
45
55
  }): Promise<EffectiveQuotaQuery['effectiveQuota']>;
46
56
  /**
47
57
  * Create or update a quota at an org or app scope. Requires `manage_quotas`
48
- * (super-admin for platform-global quotas).
58
+ * on that org or app.
49
59
  *
50
- * @param input - {@link SetQuotaInput}: scope ids, `metric`, and `limitValue`.
60
+ * @param input - {@link ScopedSetQuotaInput}: `appId` or `orgId` (and
61
+ * optionally `tierId`), `metric`, and `limitValue`.
51
62
  * @returns The created/updated quota.
63
+ * @throws {CrowdyError} before any request when the input names neither an
64
+ * app nor an organization.
52
65
  */
53
- set(input: SetQuotaInput): Promise<SetQuotaMutation['setQuota']>;
66
+ set(input: ScopedSetQuotaInput): Promise<SetQuotaMutation['setQuota']>;
54
67
  /**
55
- * Delete a quota by id. Requires `manage_quotas` on the owning scope.
68
+ * Delete a quota by id. Requires `manage_quotas` on the quota's org or app.
56
69
  *
57
70
  * @param quotaId - Numeric quota id.
58
71
  * @returns `true` on success.
@@ -1 +1 @@
1
- {"version":3,"file":"quotas.d.ts","sourceRoot":"","sources":["../../src/domains/quotas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAML,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,aAAa,EACnB,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;GAWG;AACH,qBAAa,SAAS;IACR,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,aAAa;IAE/C;;;;;;OAMG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC;IAKvE;;;;;;OAMG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC;IAKvE;;;;;;;OAOG;IACG,SAAS,CACb,MAAM,EAAE,MAAM,EACd,KAAK,GAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAO,GAC7C,OAAO,CAAC,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;IACG,GAAG,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;IAU5E;;;;;OAKG;IACG,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAC;CAM3E"}
@@ -1,12 +1,13 @@
1
+ import { CrowdyError } from '../errors.js';
1
2
  import { QuotasForOrgDocument, QuotasForAppDocument, EffectiveQuotaDocument, SetQuotaDocument, DeleteQuotaDocument, } from '../generated/graphql.js';
2
3
  /**
3
4
  * Usage quotas at the org and app scope — exposed as `client.quotas` (and
4
5
  * grouped under `client.admin`).
5
6
  *
6
7
  * Part of the management surface. Reads require the `view_usage` org/app
7
- * permission; {@link set} / {@link remove} require `manage_quotas` (global
8
- * quotas are super-admin only). A quota is keyed by a `metric` string; the
9
- * effective value resolves app → org → platform default.
8
+ * permission; {@link set} / {@link remove} require `manage_quotas` on the
9
+ * rule's org or app. A quota is keyed by a `metric` string; the effective
10
+ * value resolves app → org → platform default.
10
11
  *
11
12
  * @throws {CrowdyGraphQLError} `UNAUTHENTICATED` / `FORBIDDEN` / `SCOPE_MISSING`
12
13
  * per the permission notes above.
@@ -55,17 +56,25 @@ export class QuotasAPI {
55
56
  }
56
57
  /**
57
58
  * Create or update a quota at an org or app scope. Requires `manage_quotas`
58
- * (super-admin for platform-global quotas).
59
+ * on that org or app.
59
60
  *
60
- * @param input - {@link SetQuotaInput}: scope ids, `metric`, and `limitValue`.
61
+ * @param input - {@link ScopedSetQuotaInput}: `appId` or `orgId` (and
62
+ * optionally `tierId`), `metric`, and `limitValue`.
61
63
  * @returns The created/updated quota.
64
+ * @throws {CrowdyError} before any request when the input names neither an
65
+ * app nor an organization.
62
66
  */
63
67
  async set(input) {
68
+ if (!input.appId && !input.orgId) {
69
+ throw new CrowdyError({
70
+ message: 'quotas.set needs an appId or an orgId: the SDK sets app and org quotas only',
71
+ });
72
+ }
64
73
  const data = await this.api.request(SetQuotaDocument, { input });
65
74
  return data.setQuota;
66
75
  }
67
76
  /**
68
- * Delete a quota by id. Requires `manage_quotas` on the owning scope.
77
+ * Delete a quota by id. Requires `manage_quotas` on the quota's org or app.
69
78
  *
70
79
  * @param quotaId - Numeric quota id.
71
80
  * @returns `true` on success.