@crowdedkingdoms/crowdyjs 18.0.0-dev.1 → 18.0.2-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 (54) hide show
  1. package/MIGRATION.md +69 -0
  2. package/README.md +18 -5
  3. package/dist/crowdy-dsh/bridge.d.ts +6 -4
  4. package/dist/crowdy-dsh/bridge.d.ts.map +1 -1
  5. package/dist/crowdy-dsh/bridge.js +14 -10
  6. package/dist/crowdy-dsh/pane.d.ts +5 -4
  7. package/dist/crowdy-dsh/pane.d.ts.map +1 -1
  8. package/dist/crowdy-dsh/pane.js +12 -8
  9. package/dist/crowdy-studio/controller.d.ts.map +1 -1
  10. package/dist/crowdy-studio/controller.js +8 -1
  11. package/dist/domains/apps.d.ts +1 -10
  12. package/dist/domains/apps.d.ts.map +1 -1
  13. package/dist/domains/apps.js +1 -16
  14. package/dist/domains/exec.d.ts +2 -0
  15. package/dist/domains/exec.d.ts.map +1 -1
  16. package/dist/domains/exec.js +5 -1
  17. package/dist/domains/hosting.d.ts +0 -6
  18. package/dist/domains/hosting.d.ts.map +1 -1
  19. package/dist/domains/hosting.js +1 -16
  20. package/dist/domains/organizations.d.ts +1 -9
  21. package/dist/domains/organizations.d.ts.map +1 -1
  22. package/dist/domains/organizations.js +1 -15
  23. package/dist/domains/payments.d.ts +5 -48
  24. package/dist/domains/payments.d.ts.map +1 -1
  25. package/dist/domains/payments.js +5 -57
  26. package/dist/domains/quotas.d.ts +20 -7
  27. package/dist/domains/quotas.d.ts.map +1 -1
  28. package/dist/domains/quotas.js +15 -6
  29. package/dist/domains/users.d.ts +7 -74
  30. package/dist/domains/users.d.ts.map +1 -1
  31. package/dist/domains/users.js +7 -105
  32. package/dist/generated/graphql.d.ts +0 -375
  33. package/dist/generated/graphql.d.ts.map +1 -1
  34. package/dist/generated/graphql.js +0 -16
  35. package/dist/grid-mods/exec-client-halves.d.ts +1 -1
  36. package/dist/grid-mods/exec-client-halves.d.ts.map +1 -1
  37. package/dist/grid-mods/exec-client-halves.js +2 -1
  38. package/dist/grid-mods/grid-host-calls.d.ts +19 -3
  39. package/dist/grid-mods/grid-host-calls.d.ts.map +1 -1
  40. package/dist/grid-mods/grid-host-calls.js +40 -10
  41. package/dist/grid-mods/index.d.ts +1 -1
  42. package/dist/grid-mods/index.d.ts.map +1 -1
  43. package/dist/grid-mods/index.js +1 -1
  44. package/dist/grid-scope.d.ts.map +1 -1
  45. package/dist/index.d.ts +3 -3
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +2 -2
  48. package/dist/kit/social.d.ts.map +1 -1
  49. package/dist/player-runtime/glue-runtime.d.ts +9 -0
  50. package/dist/player-runtime/glue-runtime.d.ts.map +1 -1
  51. package/dist/player-runtime/glue-runtime.js +21 -2
  52. package/dist/player-runtime/player-code-broker.d.ts.map +1 -1
  53. package/dist/player-runtime/player-code-broker.js +18 -1
  54. package/package.json +1 -1
@@ -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":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAoBL,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,4BAA4B,EACjC,KAAK,qBAAqB,EAC1B,KAAK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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
@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3C;;;;;;;;;;;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,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IASjD;;;;;;OAMG;IACG,GAAG,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;IAKtE;;;;;OAKG;IACG,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAC;CAM3E"}
1
+ {"version":3,"file":"quotas.d.ts","sourceRoot":"","sources":["../../src/domains/quotas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAML,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,aAAa,EACnB,MAAM,yBAAyB,CAAC;AAEjC;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAC7C,CAAC;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAE1C;;;;;;;;;;;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,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IASjD;;;;;;;;;OASG;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.
@@ -1,5 +1,5 @@
1
1
  import type { GraphQLClient } from '../client.js';
2
- import { type MeQuery, type UpdateGamertagInput, type UpdateGamertagMutation, type UserQuery, type UsersPaginatedQuery, type UsersPaginatedQueryVariables, type UsersConnectionQuery, type UsersConnectionQueryVariables, type SetSuperAdminMutation, type SetOperatorMutation, type SetEarlyAccessOverrideMutation, type UpdateUserTypeMutation, type ForceLogoutUserMutation, type UpdateUserStateMutation, type UpdateUserStateInput, type FreePlayWindowQuery } from '../generated/graphql.js';
2
+ import { type MeQuery, type UpdateGamertagInput, type UpdateGamertagMutation, type UserQuery, type UpdateUserStateMutation, type UpdateUserStateInput, type FreePlayWindowQuery } from '../generated/graphql.js';
3
3
  /**
4
4
  * User identity & account management — exposed as `client.users`.
5
5
  *
@@ -8,8 +8,8 @@ import { type MeQuery, type UpdateGamertagInput, type UpdateGamertagMutation, ty
8
8
  * exposes these identity mutations — calling them against a game-api endpoint
9
9
  * throws {@link CrowdyGraphQLError} with `FORBIDDEN`, directing you to the
10
10
  * management API. Only the read/identity surface a game client realistically
11
- * needs lives here; super-admin / operator screens use the management UI
12
- * directly rather than the SDK.
11
+ * needs lives here; platform administration (super-admin and operator fields)
12
+ * is not in the SDK: call the API directly from your own tooling.
13
13
  *
14
14
  * Every method needs a valid session (a bearer token set by
15
15
  * `client.auth.login()` / `register()` or `client.setToken()`); without one the
@@ -62,84 +62,17 @@ export declare class UsersAPI {
62
62
  */
63
63
  freePlayWindow(): Promise<FreePlayWindowQuery['freePlayWindowInfo']>;
64
64
  /**
65
- * Look up any user by id. **Super-admin only** (regular callers can only read
66
- * their own profile via {@link me}).
65
+ * Look up a user by id. Requires a valid session.
67
66
  *
68
67
  * @param id - Numeric user id (`BigInt` as a decimal string).
69
68
  * @returns The {@link User}, or `null` if no such user.
70
69
  */
71
70
  get(id: string): Promise<UserQuery['user']>;
72
71
  /**
73
- * Search/list users with offset pagination. **Super-admin only.**
72
+ * Replace the caller's own top-level state blob (base64; `null` clears it).
73
+ * Only ever writes the caller. Requires a valid session.
74
74
  *
75
- * @param opts - Optional `query` (prefix match over email/gamertag/id) and
76
- * `limit` / `offset`.
77
- * @returns A page of users.
78
- * @remarks Prefer {@link listConnection} (Relay cursor pagination) for large
79
- * result sets; the offset args here are deprecated server-side.
80
- */
81
- paginated(opts?: {
82
- query?: UsersPaginatedQueryVariables['query'];
83
- limit?: UsersPaginatedQueryVariables['limit'];
84
- offset?: UsersPaginatedQueryVariables['offset'];
85
- }): Promise<UsersPaginatedQuery['usersPaginated']>;
86
- /**
87
- * Relay-style cursor pagination over users — the preferred alternative to
88
- * {@link paginated}. **Super-admin only.** Page with `first` plus the previous
89
- * page's `pageInfo.endCursor` as `after`. See
90
- * https://docs.crowdedkingdoms.com/overview/pagination.
91
- *
92
- * @param args - Optional `first`, `after`, and `query`.
93
- * @returns A {@link UsersConnection}.
94
- */
95
- listConnection(args?: UsersConnectionQueryVariables): Promise<UsersConnectionQuery['usersConnection']>;
96
- /**
97
- * Grant or revoke the platform `is_super_admin` flag on a user. **Super-admin
98
- * only.**
99
- *
100
- * @param userId - Target user id.
101
- * @param value - `true` to grant, `false` to revoke.
102
- * @returns The updated user's `userId` + `isSuperAdmin`.
103
- */
104
- setSuperAdmin(userId: string, value: boolean): Promise<SetSuperAdminMutation['setSuperAdmin']>;
105
- /**
106
- * Grant or revoke the platform `is_operator` flag (control-plane access) on a
107
- * user. **Super-admin only.**
108
- *
109
- * @param userId - Target user id.
110
- * @param value - `true` to grant, `false` to revoke.
111
- * @returns The updated user's `userId` + `isOperator`.
112
- */
113
- setOperator(userId: string, value: boolean): Promise<SetOperatorMutation['setOperator']>;
114
- /**
115
- * Force an early-access override on a user (bypasses the early-access gate).
116
- * **Super-admin only.**
117
- *
118
- * @param userId - Target user id.
119
- * @param value - `true` to grant the override, `false` to clear it.
120
- * @returns The updated user's `userId` + `grantEarlyAccessOverride`.
121
- */
122
- setEarlyAccessOverride(userId: string, value: boolean): Promise<SetEarlyAccessOverrideMutation['setEarlyAccessOverride']>;
123
- /**
124
- * Set a user's `user_type`. **Super-admin only.**
125
- *
126
- * @param userId - Target user id.
127
- * @param value - The new user type string.
128
- * @returns The updated user's `userId` + `userType`.
129
- */
130
- updateType(userId: string, value: string): Promise<UpdateUserTypeMutation['updateUserType']>;
131
- /**
132
- * Revoke all of a user's sessions (force logout everywhere). **Super-admin
133
- * only.**
134
- *
135
- * @param userId - Target user id.
136
- * @returns `true` on success.
137
- */
138
- forceLogout(userId: string): Promise<ForceLogoutUserMutation['forceLogoutUser']>;
139
- /**
140
- * Replace a user's top-level state blob. **Super-admin only.**
141
- *
142
- * @param input - {@link UpdateUserStateInput} (`userId` + base64 `state`).
75
+ * @param input - {@link UpdateUserStateInput}: the base64 `state`.
143
76
  * @returns The updated user's `userId` + `state`.
144
77
  */
145
78
  updateState(input: UpdateUserStateInput): Promise<UpdateUserStateMutation['updateUserState']>;
@@ -1 +1 @@
1
- {"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../src/domains/users.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAcL,KAAK,OAAO,EACZ,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,SAAS,EACd,KAAK,mBAAmB,EACxB,KAAK,4BAA4B,EACjC,KAAK,oBAAoB,EACzB,KAAK,6BAA6B,EAClC,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,8BAA8B,EACnC,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACzB,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,QAAQ;IACP,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,aAAa;IAEnD;;;;;;;OAOG;IACG,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAKlC;;;;;;;;;;;;;OAaG;IACG,cAAc,CAClB,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,sBAAsB,CAAC,gBAAgB,CAAC,CAAC;IAKpD;;;;;;;;;OASG;IACG,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC;IAKzC;;;;;OAKG;IACG,cAAc,IAAI,OAAO,CAAC,mBAAmB,CAA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AiB,CAAC,CAAC;CAIvD"}
1
+ {"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../src/domains/users.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAOL,KAAK,OAAO,EACZ,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,SAAS,EACd,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACzB,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,QAAQ;IACP,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,aAAa;IAEnD;;;;;;;OAOG;IACG,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAKlC;;;;;;;;;;;;;OAaG;IACG,cAAc,CAClB,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,sBAAsB,CAAC,gBAAgB,CAAC,CAAC;IAKpD;;;;;;;;;OASG;IACG,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC;IAKzC;;;;;OAKG;IACG,cAAc,IAAI,OAAO,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;IAK1E;;;;;OAKG;IACG,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAKjD;;;;;;OAMG;IACG,WAAW,CACf,KAAK,EAAE,oBAAoB,GAC1B,OAAO,CAAC,uBAAuB,CAAC,iBAAiB,CAAC,CAAC;CAIvD"}
@@ -1,4 +1,4 @@
1
- import { MeDocument, UpdateGamertagDocument, DeleteMyAccountDocument, UserDocument, UsersPaginatedDocument, UsersConnectionDocument, SetSuperAdminDocument, SetOperatorDocument, SetEarlyAccessOverrideDocument, UpdateUserTypeDocument, ForceLogoutUserDocument, UpdateUserStateDocument, FreePlayWindowDocument, } from '../generated/graphql.js';
1
+ import { MeDocument, UpdateGamertagDocument, DeleteMyAccountDocument, UserDocument, UpdateUserStateDocument, FreePlayWindowDocument, } from '../generated/graphql.js';
2
2
  /**
3
3
  * User identity & account management — exposed as `client.users`.
4
4
  *
@@ -7,8 +7,8 @@ import { MeDocument, UpdateGamertagDocument, DeleteMyAccountDocument, UserDocume
7
7
  * exposes these identity mutations — calling them against a game-api endpoint
8
8
  * throws {@link CrowdyGraphQLError} with `FORBIDDEN`, directing you to the
9
9
  * management API. Only the read/identity surface a game client realistically
10
- * needs lives here; super-admin / operator screens use the management UI
11
- * directly rather than the SDK.
10
+ * needs lives here; platform administration (super-admin and operator fields)
11
+ * is not in the SDK: call the API directly from your own tooling.
12
12
  *
13
13
  * Every method needs a valid session (a bearer token set by
14
14
  * `client.auth.login()` / `register()` or `client.setToken()`); without one the
@@ -74,8 +74,7 @@ export class UsersAPI {
74
74
  return data.freePlayWindowInfo;
75
75
  }
76
76
  /**
77
- * Look up any user by id. **Super-admin only** (regular callers can only read
78
- * their own profile via {@link me}).
77
+ * Look up a user by id. Requires a valid session.
79
78
  *
80
79
  * @param id - Numeric user id (`BigInt` as a decimal string).
81
80
  * @returns The {@link User}, or `null` if no such user.
@@ -85,107 +84,10 @@ export class UsersAPI {
85
84
  return data.user;
86
85
  }
87
86
  /**
88
- * Search/list users with offset pagination. **Super-admin only.**
87
+ * Replace the caller's own top-level state blob (base64; `null` clears it).
88
+ * Only ever writes the caller. Requires a valid session.
89
89
  *
90
- * @param opts - Optional `query` (prefix match over email/gamertag/id) and
91
- * `limit` / `offset`.
92
- * @returns A page of users.
93
- * @remarks Prefer {@link listConnection} (Relay cursor pagination) for large
94
- * result sets; the offset args here are deprecated server-side.
95
- */
96
- async paginated(opts = {}) {
97
- const data = await this.graphql.request(UsersPaginatedDocument, opts);
98
- return data.usersPaginated;
99
- }
100
- /**
101
- * Relay-style cursor pagination over users — the preferred alternative to
102
- * {@link paginated}. **Super-admin only.** Page with `first` plus the previous
103
- * page's `pageInfo.endCursor` as `after`. See
104
- * https://docs.crowdedkingdoms.com/overview/pagination.
105
- *
106
- * @param args - Optional `first`, `after`, and `query`.
107
- * @returns A {@link UsersConnection}.
108
- */
109
- async listConnection(args = {}) {
110
- const data = await this.graphql.request(UsersConnectionDocument, args);
111
- return data.usersConnection;
112
- }
113
- /**
114
- * Grant or revoke the platform `is_super_admin` flag on a user. **Super-admin
115
- * only.**
116
- *
117
- * @param userId - Target user id.
118
- * @param value - `true` to grant, `false` to revoke.
119
- * @returns The updated user's `userId` + `isSuperAdmin`.
120
- */
121
- async setSuperAdmin(userId, value) {
122
- const data = await this.graphql.request(SetSuperAdminDocument, {
123
- userId,
124
- value,
125
- });
126
- return data.setSuperAdmin;
127
- }
128
- /**
129
- * Grant or revoke the platform `is_operator` flag (control-plane access) on a
130
- * user. **Super-admin only.**
131
- *
132
- * @param userId - Target user id.
133
- * @param value - `true` to grant, `false` to revoke.
134
- * @returns The updated user's `userId` + `isOperator`.
135
- */
136
- async setOperator(userId, value) {
137
- const data = await this.graphql.request(SetOperatorDocument, {
138
- userId,
139
- value,
140
- });
141
- return data.setOperator;
142
- }
143
- /**
144
- * Force an early-access override on a user (bypasses the early-access gate).
145
- * **Super-admin only.**
146
- *
147
- * @param userId - Target user id.
148
- * @param value - `true` to grant the override, `false` to clear it.
149
- * @returns The updated user's `userId` + `grantEarlyAccessOverride`.
150
- */
151
- async setEarlyAccessOverride(userId, value) {
152
- const data = await this.graphql.request(SetEarlyAccessOverrideDocument, {
153
- userId,
154
- value,
155
- });
156
- return data.setEarlyAccessOverride;
157
- }
158
- /**
159
- * Set a user's `user_type`. **Super-admin only.**
160
- *
161
- * @param userId - Target user id.
162
- * @param value - The new user type string.
163
- * @returns The updated user's `userId` + `userType`.
164
- */
165
- async updateType(userId, value) {
166
- const data = await this.graphql.request(UpdateUserTypeDocument, {
167
- userId,
168
- value,
169
- });
170
- return data.updateUserType;
171
- }
172
- /**
173
- * Revoke all of a user's sessions (force logout everywhere). **Super-admin
174
- * only.**
175
- *
176
- * @param userId - Target user id.
177
- * @returns `true` on success.
178
- */
179
- async forceLogout(userId) {
180
- const data = await this.graphql.request(ForceLogoutUserDocument, {
181
- userId,
182
- });
183
- return data.forceLogoutUser;
184
- }
185
- /**
186
- * Replace a user's top-level state blob. **Super-admin only.**
187
- *
188
- * @param input - {@link UpdateUserStateInput} (`userId` + base64 `state`).
90
+ * @param input - {@link UpdateUserStateInput}: the base64 `state`.
189
91
  * @returns The updated user's `userId` + `state`.
190
92
  */
191
93
  async updateState(input) {