@crowdedkingdoms/crowdyjs 13.8.0 → 14.0.0
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 +44 -0
- package/README.md +68 -33
- package/dist/binary-relay.d.ts +1 -1
- package/dist/binary-relay.d.ts.map +1 -1
- package/dist/binary-relay.js +33 -3
- package/dist/crowdy-client.d.ts +29 -34
- package/dist/crowdy-client.d.ts.map +1 -1
- package/dist/crowdy-client.js +42 -40
- package/dist/domains/appAccess.d.ts +3 -3
- package/dist/domains/appAccess.d.ts.map +1 -1
- package/dist/domains/appAccess.js +16 -16
- package/dist/domains/apps.d.ts +4 -8
- package/dist/domains/apps.d.ts.map +1 -1
- package/dist/domains/apps.js +19 -23
- package/dist/domains/auth.d.ts +1 -1
- package/dist/domains/billing.d.ts +3 -3
- package/dist/domains/billing.d.ts.map +1 -1
- package/dist/domains/billing.js +9 -9
- package/dist/domains/controlPlane.d.ts +2 -2
- package/dist/domains/controlPlane.d.ts.map +1 -1
- package/dist/domains/controlPlane.js +4 -4
- package/dist/domains/discovery.d.ts +50 -0
- package/dist/domains/discovery.d.ts.map +1 -0
- package/dist/domains/discovery.js +35 -0
- package/dist/domains/marketplace.d.ts +4 -5
- package/dist/domains/marketplace.d.ts.map +1 -1
- package/dist/domains/marketplace.js +25 -26
- package/dist/domains/organizations.d.ts +3 -3
- package/dist/domains/organizations.d.ts.map +1 -1
- package/dist/domains/organizations.js +22 -22
- package/dist/domains/payments.d.ts +3 -3
- package/dist/domains/payments.d.ts.map +1 -1
- package/dist/domains/payments.js +11 -11
- package/dist/domains/platform.d.ts +5 -6
- package/dist/domains/platform.d.ts.map +1 -1
- package/dist/domains/platform.js +6 -7
- package/dist/domains/portal.d.ts +19 -2
- package/dist/domains/portal.d.ts.map +1 -1
- package/dist/domains/portal.js +12 -12
- package/dist/domains/quotas.d.ts +3 -3
- package/dist/domains/quotas.d.ts.map +1 -1
- package/dist/domains/quotas.js +8 -8
- package/dist/domains/serverStatus.d.ts +1 -2
- package/dist/domains/serverStatus.d.ts.map +1 -1
- package/dist/domains/serverStatus.js +1 -2
- package/dist/domains/sharedEnvironment.d.ts +3 -3
- package/dist/domains/sharedEnvironment.d.ts.map +1 -1
- package/dist/domains/sharedEnvironment.js +15 -15
- package/dist/domains/udp.d.ts +1 -1
- package/dist/domains/udp.js +1 -1
- package/dist/domains/usage.d.ts +2 -2
- package/dist/domains/usage.d.ts.map +1 -1
- package/dist/domains/usage.js +5 -5
- package/dist/domains/users.d.ts +1 -1
- package/dist/domains/users.js +1 -1
- package/dist/generated/graphql.d.ts +65 -16
- package/dist/generated/graphql.d.ts.map +1 -1
- package/dist/generated/graphql.js +1 -0
- package/dist/index.d.ts +10 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -16
- package/dist/kit/decks.d.ts +1 -1
- package/dist/kit/npcs.d.ts +2 -2
- package/dist/kit/npcs.d.ts.map +1 -1
- package/dist/kit/social.d.ts.map +1 -1
- package/dist/kit/worldsim.d.ts +1 -1
- package/dist/rediscover.d.ts +7 -3
- package/dist/rediscover.d.ts.map +1 -1
- package/dist/rediscover.js +7 -3
- package/dist/session.d.ts +21 -0
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +23 -0
- package/package.json +1 -1
|
@@ -2,9 +2,9 @@ import { MarketplaceListingsDocument, MarketplaceListingVersionsDocument, Market
|
|
|
2
2
|
/**
|
|
3
3
|
* The P4a player-code marketplace (free mode) — exposed as
|
|
4
4
|
* `client.marketplace`. Player-facing browse/publish/acquire/install/consent
|
|
5
|
-
* and the D4 grid claim flows
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* and the D4 grid claim flows, plus studio moderation (admission queue, catalog
|
|
6
|
+
* administration, ownership transfer, claim-policy config). Player and moderation
|
|
7
|
+
* operations differ by the permissions they require, not by endpoint.
|
|
8
8
|
*
|
|
9
9
|
* No money moves through any of these calls: every listing is free in P4a,
|
|
10
10
|
* an acquisition is an entitlement write, and the paid modes ship with P4b.
|
|
@@ -12,11 +12,10 @@ import { MarketplaceListingsDocument, MarketplaceListingVersionsDocument, Market
|
|
|
12
12
|
* never source; installs consent to the summary's hash.
|
|
13
13
|
*/
|
|
14
14
|
export class MarketplaceAPI {
|
|
15
|
-
constructor(game
|
|
15
|
+
constructor(game) {
|
|
16
16
|
this.game = game;
|
|
17
|
-
this.management = management;
|
|
18
17
|
}
|
|
19
|
-
// -- Store
|
|
18
|
+
// -- Store ---------------------------------------------------------
|
|
20
19
|
/** Browse the app's active listings with admission standing per listing. */
|
|
21
20
|
async listings(variables) {
|
|
22
21
|
const data = await this.game.request(MarketplaceListingsDocument, variables);
|
|
@@ -152,25 +151,25 @@ export class MarketplaceAPI {
|
|
|
152
151
|
const data = await this.game.request(MarketplaceIssueGridClaimInviteDocument, variables);
|
|
153
152
|
return data.issueGridClaimInvite;
|
|
154
153
|
}
|
|
155
|
-
// -- Studio moderation (
|
|
154
|
+
// -- Studio moderation (requires studio permissions) -----------------------------
|
|
156
155
|
/** The admission queue: listings joined with allow-list standing. */
|
|
157
156
|
async admissionQueue(variables) {
|
|
158
|
-
const data = await this.
|
|
157
|
+
const data = await this.game.request(MarketplaceAdmissionQueueDocument, variables);
|
|
159
158
|
return data.appCodeAdmissionQueue;
|
|
160
159
|
}
|
|
161
160
|
/** Studio catalog administration view (includes delisted/killed on request). */
|
|
162
161
|
async appListings(variables) {
|
|
163
|
-
const data = await this.
|
|
162
|
+
const data = await this.game.request(MarketplaceAppListingsDocument, variables);
|
|
164
163
|
return data.appPlayerCodeListings;
|
|
165
164
|
}
|
|
166
165
|
/** All acquisitions in the app (studio audit view). */
|
|
167
166
|
async appAcquisitions(variables) {
|
|
168
|
-
const data = await this.
|
|
167
|
+
const data = await this.game.request(MarketplaceAppAcquisitionsDocument, variables);
|
|
169
168
|
return data.appPlayerCodeAcquisitions;
|
|
170
169
|
}
|
|
171
170
|
/** Audited personal<->org listing transfer (DN-9). */
|
|
172
171
|
async transferListing(variables) {
|
|
173
|
-
const data = await this.
|
|
172
|
+
const data = await this.game.request(MarketplaceTransferListingDocument, variables);
|
|
174
173
|
return data.transferPlayerCodeListing;
|
|
175
174
|
}
|
|
176
175
|
/**
|
|
@@ -179,12 +178,12 @@ export class MarketplaceAPI {
|
|
|
179
178
|
* also disable running installs fleet-wide.
|
|
180
179
|
*/
|
|
181
180
|
async setListingStatus(variables) {
|
|
182
|
-
const data = await this.
|
|
181
|
+
const data = await this.game.request(MarketplaceSetListingStatusDocument, variables);
|
|
183
182
|
return data.setPlayerCodeListingStatus;
|
|
184
183
|
}
|
|
185
184
|
/** Configure the app's D4 grid claim policy (manage_apps). */
|
|
186
185
|
async setGridClaimPolicy(variables) {
|
|
187
|
-
const data = await this.
|
|
186
|
+
const data = await this.game.request(MarketplaceSetGridClaimPolicyDocument, variables);
|
|
188
187
|
return data.setAppGridClaimPolicy;
|
|
189
188
|
}
|
|
190
189
|
// -- P4b: paid modes + grid commerce (Game API) --------------------------------
|
|
@@ -213,15 +212,15 @@ export class MarketplaceAPI {
|
|
|
213
212
|
const data = await this.game.request(MarketplacePurchaseGridDocument, variables);
|
|
214
213
|
return data.purchaseGrid;
|
|
215
214
|
}
|
|
216
|
-
// -- P4b: pricing, seller payouts, grid catalog, risk
|
|
215
|
+
// -- P4b: pricing, seller payouts, grid catalog, risk ---------------------------
|
|
217
216
|
/** Author-only: set a listing's acquisition mode + price. */
|
|
218
217
|
async setListingPricing(variables) {
|
|
219
|
-
const data = await this.
|
|
218
|
+
const data = await this.game.request(MarketplaceSetListingPricingDocument, variables);
|
|
220
219
|
return data.setListingPricing;
|
|
221
220
|
}
|
|
222
221
|
/** Set the app's marketplace org revenue share (bps; manage_billing). */
|
|
223
222
|
async setOrgShare(variables) {
|
|
224
|
-
const data = await this.
|
|
223
|
+
const data = await this.game.request(MarketplaceSetOrgShareDocument, variables);
|
|
225
224
|
return data.setAppMarketplaceOrgShare;
|
|
226
225
|
}
|
|
227
226
|
/**
|
|
@@ -232,52 +231,52 @@ export class MarketplaceAPI {
|
|
|
232
231
|
* fetchClientSecret callback so Connect.js refreshes automatically.
|
|
233
232
|
*/
|
|
234
233
|
async createAccountSession(variables) {
|
|
235
|
-
const data = await this.
|
|
234
|
+
const data = await this.game.request(MarketplaceCreateAccountSessionDocument, variables);
|
|
236
235
|
return data.createSellerAccountSession;
|
|
237
236
|
}
|
|
238
237
|
/** Embedded-components Account Session for an ORG payout account (manage_billing). */
|
|
239
238
|
async createOrgAccountSession(variables) {
|
|
240
|
-
const data = await this.
|
|
239
|
+
const data = await this.game.request(MarketplaceCreateOrgAccountSessionDocument, variables);
|
|
241
240
|
return data.createOrgSellerAccountSession;
|
|
242
241
|
}
|
|
243
242
|
/** Begin Stripe Connect Express onboarding for the calling player-seller. */
|
|
244
243
|
async beginSellerOnboarding(variables) {
|
|
245
|
-
const data = await this.
|
|
244
|
+
const data = await this.game.request(MarketplaceBeginSellerOnboardingDocument, variables);
|
|
246
245
|
return data.beginSellerOnboarding;
|
|
247
246
|
}
|
|
248
247
|
/** Begin onboarding for an org payout account (manage_billing in the org). */
|
|
249
248
|
async beginOrgSellerOnboarding(variables) {
|
|
250
|
-
const data = await this.
|
|
249
|
+
const data = await this.game.request(MarketplaceBeginOrgSellerOnboardingDocument, variables);
|
|
251
250
|
return data.beginOrgSellerOnboarding;
|
|
252
251
|
}
|
|
253
252
|
/** The calling player's seller payout balance. */
|
|
254
253
|
async mySellerBalance() {
|
|
255
|
-
const data = await this.
|
|
254
|
+
const data = await this.game.request(MarketplaceMySellerBalanceDocument, {});
|
|
256
255
|
return data.mySellerPayoutBalance;
|
|
257
256
|
}
|
|
258
257
|
/** Pay out the calling player's payable balance to their Connect account. */
|
|
259
258
|
async requestPayout(variables = {}) {
|
|
260
|
-
const data = await this.
|
|
259
|
+
const data = await this.game.request(MarketplaceRequestPayoutDocument, variables);
|
|
261
260
|
return data.requestSellerPayout;
|
|
262
261
|
}
|
|
263
262
|
/** Earn-to-mod: convert payable balance into the player wallet. Returns cents. */
|
|
264
263
|
async spendPayoutToWallet(variables) {
|
|
265
|
-
const data = await this.
|
|
264
|
+
const data = await this.game.request(MarketplaceSpendPayoutToWalletDocument, variables);
|
|
266
265
|
return data.spendPayoutBalanceToWallet;
|
|
267
266
|
}
|
|
268
267
|
/** The app's open T11 commerce risk queue (manage_compute). */
|
|
269
268
|
async commerceRiskQueue(variables) {
|
|
270
|
-
const data = await this.
|
|
269
|
+
const data = await this.game.request(MarketplaceCommerceRiskQueueDocument, variables);
|
|
271
270
|
return data.commerceRiskQueue;
|
|
272
271
|
}
|
|
273
272
|
/** Release or confirm a T11 risk flag (manage_compute). */
|
|
274
273
|
async decideRiskFlag(variables) {
|
|
275
|
-
const data = await this.
|
|
274
|
+
const data = await this.game.request(MarketplaceDecideRiskFlagDocument, variables);
|
|
276
275
|
return data.decideCommerceRiskFlag;
|
|
277
276
|
}
|
|
278
277
|
/** Studio: create a grid listing (blueprint or concrete; manage_apps). */
|
|
279
278
|
async createGridListing(variables) {
|
|
280
|
-
const data = await this.
|
|
279
|
+
const data = await this.game.request(MarketplaceCreateGridListingDocument, variables);
|
|
281
280
|
return data.createGridListing;
|
|
282
281
|
}
|
|
283
282
|
}
|
|
@@ -4,7 +4,7 @@ import { type OrganizationQuery, type OrganizationBySlugQuery, type MyOrganizati
|
|
|
4
4
|
* Organizations, members, roles (RBAC), and org API tokens — exposed as
|
|
5
5
|
* `client.organizations` (and grouped under `client.admin`).
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* Part of the management surface. This is the studio-admin surface: an
|
|
8
8
|
* organization owns apps, billing, quotas, and environments, and its RBAC
|
|
9
9
|
* grants (`manage_members`, `manage_tokens`, ...) gate the rest of the admin
|
|
10
10
|
* APIs. Most operations require an authenticated caller who is an active member
|
|
@@ -18,8 +18,8 @@ import { type OrganizationQuery, type OrganizationBySlugQuery, type MyOrganizati
|
|
|
18
18
|
* / `SCOPE_MISSING` when the caller lacks the required org permission.
|
|
19
19
|
*/
|
|
20
20
|
export declare class OrganizationsAPI {
|
|
21
|
-
private readonly
|
|
22
|
-
constructor(
|
|
21
|
+
private readonly api;
|
|
22
|
+
constructor(api: GraphQLClient);
|
|
23
23
|
/**
|
|
24
24
|
* Fetch a single organization by numeric id. Requires authentication.
|
|
25
25
|
*
|
|
@@ -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,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,gBAAgB;IACf,OAAO,CAAC,QAAQ,CAAC,
|
|
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,EACp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G;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"}
|
|
@@ -3,7 +3,7 @@ import { OrganizationDocument, OrganizationBySlugDocument, MyOrganizationsDocume
|
|
|
3
3
|
* Organizations, members, roles (RBAC), and org API tokens — exposed as
|
|
4
4
|
* `client.organizations` (and grouped under `client.admin`).
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* Part of the management surface. This is the studio-admin surface: an
|
|
7
7
|
* organization owns apps, billing, quotas, and environments, and its RBAC
|
|
8
8
|
* grants (`manage_members`, `manage_tokens`, ...) gate the rest of the admin
|
|
9
9
|
* APIs. Most operations require an authenticated caller who is an active member
|
|
@@ -17,8 +17,8 @@ import { OrganizationDocument, OrganizationBySlugDocument, MyOrganizationsDocume
|
|
|
17
17
|
* / `SCOPE_MISSING` when the caller lacks the required org permission.
|
|
18
18
|
*/
|
|
19
19
|
export class OrganizationsAPI {
|
|
20
|
-
constructor(
|
|
21
|
-
this.
|
|
20
|
+
constructor(api) {
|
|
21
|
+
this.api = api;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* Fetch a single organization by numeric id. Requires authentication.
|
|
@@ -27,7 +27,7 @@ export class OrganizationsAPI {
|
|
|
27
27
|
* @returns The {@link Organization}, or `null` if it does not exist.
|
|
28
28
|
*/
|
|
29
29
|
async get(orgId) {
|
|
30
|
-
const data = await this.
|
|
30
|
+
const data = await this.api.request(OrganizationDocument, {
|
|
31
31
|
id: orgId,
|
|
32
32
|
});
|
|
33
33
|
return data.organization;
|
|
@@ -39,7 +39,7 @@ export class OrganizationsAPI {
|
|
|
39
39
|
* @returns The {@link Organization}, or `null` if no match.
|
|
40
40
|
*/
|
|
41
41
|
async bySlug(slug) {
|
|
42
|
-
const data = await this.
|
|
42
|
+
const data = await this.api.request(OrganizationBySlugDocument, {
|
|
43
43
|
slug,
|
|
44
44
|
});
|
|
45
45
|
return data.organizationBySlug;
|
|
@@ -52,7 +52,7 @@ export class OrganizationsAPI {
|
|
|
52
52
|
* no orgs).
|
|
53
53
|
*/
|
|
54
54
|
async mine() {
|
|
55
|
-
const data = await this.
|
|
55
|
+
const data = await this.api.request(MyOrganizationsDocument, {});
|
|
56
56
|
return data.myOrganizations;
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
@@ -63,7 +63,7 @@ export class OrganizationsAPI {
|
|
|
63
63
|
* @returns The org's members with their roles.
|
|
64
64
|
*/
|
|
65
65
|
async members(orgId) {
|
|
66
|
-
const data = await this.
|
|
66
|
+
const data = await this.api.request(OrgMembersDocument, { orgId });
|
|
67
67
|
return data.orgMembers;
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
@@ -74,7 +74,7 @@ export class OrganizationsAPI {
|
|
|
74
74
|
* @returns The org's roles.
|
|
75
75
|
*/
|
|
76
76
|
async roles(orgId) {
|
|
77
|
-
const data = await this.
|
|
77
|
+
const data = await this.api.request(OrgRolesDocument, { orgId });
|
|
78
78
|
return data.orgRoles;
|
|
79
79
|
}
|
|
80
80
|
/**
|
|
@@ -85,7 +85,7 @@ export class OrganizationsAPI {
|
|
|
85
85
|
* @returns The member's roles.
|
|
86
86
|
*/
|
|
87
87
|
async memberRoles(orgMemberId) {
|
|
88
|
-
const data = await this.
|
|
88
|
+
const data = await this.api.request(MemberRolesDocument, {
|
|
89
89
|
orgMemberId,
|
|
90
90
|
});
|
|
91
91
|
return data.memberRoles;
|
|
@@ -97,7 +97,7 @@ export class OrganizationsAPI {
|
|
|
97
97
|
* @returns The catalog of org permissions.
|
|
98
98
|
*/
|
|
99
99
|
async permissions() {
|
|
100
|
-
const data = await this.
|
|
100
|
+
const data = await this.api.request(OrgPermissionsDocument, {});
|
|
101
101
|
return data.orgPermissions;
|
|
102
102
|
}
|
|
103
103
|
/**
|
|
@@ -108,7 +108,7 @@ export class OrganizationsAPI {
|
|
|
108
108
|
* @returns The org's API tokens.
|
|
109
109
|
*/
|
|
110
110
|
async tokens(orgId) {
|
|
111
|
-
const data = await this.
|
|
111
|
+
const data = await this.api.request(OrgTokensDocument, { orgId });
|
|
112
112
|
return data.orgTokens;
|
|
113
113
|
}
|
|
114
114
|
/**
|
|
@@ -119,7 +119,7 @@ export class OrganizationsAPI {
|
|
|
119
119
|
* @returns The created {@link Organization}.
|
|
120
120
|
*/
|
|
121
121
|
async create(input) {
|
|
122
|
-
const data = await this.
|
|
122
|
+
const data = await this.api.request(CreateOrganizationDocument, {
|
|
123
123
|
input,
|
|
124
124
|
});
|
|
125
125
|
return data.createOrganization;
|
|
@@ -132,7 +132,7 @@ export class OrganizationsAPI {
|
|
|
132
132
|
* @returns The updated {@link Organization}.
|
|
133
133
|
*/
|
|
134
134
|
async setStatus(orgId, status) {
|
|
135
|
-
const data = await this.
|
|
135
|
+
const data = await this.api.request(SetOrgStatusDocument, {
|
|
136
136
|
orgId,
|
|
137
137
|
status,
|
|
138
138
|
});
|
|
@@ -147,7 +147,7 @@ export class OrganizationsAPI {
|
|
|
147
147
|
* @returns The created token including its one-time plaintext secret.
|
|
148
148
|
*/
|
|
149
149
|
async createToken(input) {
|
|
150
|
-
const data = await this.
|
|
150
|
+
const data = await this.api.request(CreateOrgTokenDocument, {
|
|
151
151
|
input,
|
|
152
152
|
});
|
|
153
153
|
return data.createOrgToken;
|
|
@@ -161,7 +161,7 @@ export class OrganizationsAPI {
|
|
|
161
161
|
* @returns The updated token metadata.
|
|
162
162
|
*/
|
|
163
163
|
async updateToken(orgTokenId, input) {
|
|
164
|
-
const data = await this.
|
|
164
|
+
const data = await this.api.request(UpdateOrgTokenDocument, {
|
|
165
165
|
orgTokenId,
|
|
166
166
|
input,
|
|
167
167
|
});
|
|
@@ -174,7 +174,7 @@ export class OrganizationsAPI {
|
|
|
174
174
|
* @returns `true` on success.
|
|
175
175
|
*/
|
|
176
176
|
async revokeToken(orgTokenId) {
|
|
177
|
-
const data = await this.
|
|
177
|
+
const data = await this.api.request(RevokeOrgTokenDocument, {
|
|
178
178
|
orgTokenId,
|
|
179
179
|
});
|
|
180
180
|
return data.revokeOrgToken;
|
|
@@ -187,7 +187,7 @@ export class OrganizationsAPI {
|
|
|
187
187
|
* @returns The created membership.
|
|
188
188
|
*/
|
|
189
189
|
async inviteMember(input) {
|
|
190
|
-
const data = await this.
|
|
190
|
+
const data = await this.api.request(InviteOrgMemberDocument, {
|
|
191
191
|
input,
|
|
192
192
|
});
|
|
193
193
|
return data.inviteOrgMember;
|
|
@@ -201,7 +201,7 @@ export class OrganizationsAPI {
|
|
|
201
201
|
* @returns `true` on success.
|
|
202
202
|
*/
|
|
203
203
|
async removeMember(orgId, userId) {
|
|
204
|
-
const data = await this.
|
|
204
|
+
const data = await this.api.request(RemoveOrgMemberDocument, {
|
|
205
205
|
orgId,
|
|
206
206
|
userId,
|
|
207
207
|
});
|
|
@@ -217,7 +217,7 @@ export class OrganizationsAPI {
|
|
|
217
217
|
* @returns The updated membership.
|
|
218
218
|
*/
|
|
219
219
|
async setMemberRoles(orgId, userId, roleIds) {
|
|
220
|
-
const data = await this.
|
|
220
|
+
const data = await this.api.request(UpdateOrgMemberRolesDocument, {
|
|
221
221
|
orgId,
|
|
222
222
|
userId,
|
|
223
223
|
roleIds,
|
|
@@ -233,7 +233,7 @@ export class OrganizationsAPI {
|
|
|
233
233
|
* @returns The created {@link OrgRole}.
|
|
234
234
|
*/
|
|
235
235
|
async createRole(input) {
|
|
236
|
-
const data = await this.
|
|
236
|
+
const data = await this.api.request(CreateOrgRoleDocument, {
|
|
237
237
|
input,
|
|
238
238
|
});
|
|
239
239
|
return data.createOrgRole;
|
|
@@ -247,7 +247,7 @@ export class OrganizationsAPI {
|
|
|
247
247
|
* @returns The updated {@link OrgRole}.
|
|
248
248
|
*/
|
|
249
249
|
async updateRole(orgRoleId, input) {
|
|
250
|
-
const data = await this.
|
|
250
|
+
const data = await this.api.request(UpdateOrgRoleDocument, {
|
|
251
251
|
orgRoleId,
|
|
252
252
|
input,
|
|
253
253
|
});
|
|
@@ -261,7 +261,7 @@ export class OrganizationsAPI {
|
|
|
261
261
|
* @returns `true` on success.
|
|
262
262
|
*/
|
|
263
263
|
async deleteRole(orgRoleId) {
|
|
264
|
-
const data = await this.
|
|
264
|
+
const data = await this.api.request(DeleteOrgRoleDocument, {
|
|
265
265
|
orgRoleId,
|
|
266
266
|
});
|
|
267
267
|
return data.deleteOrgRole;
|
|
@@ -4,7 +4,7 @@ import { type MyCheckoutsQuery, type MyCheckoutsConnectionQuery, type MyCheckout
|
|
|
4
4
|
* Payment checkouts (wallet top-ups, plan purchases) — exposed as
|
|
5
5
|
* `client.payments` (and grouped under `client.admin`).
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* Part of the management surface. {@link create} and {@link mine} require an
|
|
8
8
|
* authenticated caller and act on their own checkouts; {@link all} is
|
|
9
9
|
* super-admin only. Amounts are minor currency units (`*Cents`).
|
|
10
10
|
*
|
|
@@ -16,8 +16,8 @@ import { type MyCheckoutsQuery, type MyCheckoutsConnectionQuery, type MyCheckout
|
|
|
16
16
|
* above.
|
|
17
17
|
*/
|
|
18
18
|
export declare class PaymentsAPI {
|
|
19
|
-
private readonly
|
|
20
|
-
constructor(
|
|
19
|
+
private readonly api;
|
|
20
|
+
constructor(api: GraphQLClient);
|
|
21
21
|
/**
|
|
22
22
|
* Start a checkout (e.g. an `ORG_WALLET_TOPUP`). Requires authentication.
|
|
23
23
|
*
|
|
@@ -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,EAC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J,MAAM,CAAC,EAAE,mBAAmB,CAAC;QAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;KACZ,GACL,OAAO,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;IASvC;;;;;;;;;;;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;IAQ/D;;;;;;OAMG;IACG,aAAa,CACjB,IAAI,GAAE,iCAAsC,GAC3C,OAAO,CAAC,wBAAwB,CAAC,qBAAqB,CAAC,CAAC;IAQ3D;;;;;;;;OAQG;IACG,MAAM,CACV,IAAI,GAAE;QACJ,KAAK,CAAC,EAAE,2BAA2B,CAAC,OAAO,CAAC,CAAC;QAC7C,MAAM,CAAC,EAAE,2BAA2B,CAAC,QAAQ,CAAC,CAAC;KAC3C,GACL,OAAO,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC;IAK/C;;;;;;OAMG;IACG,gBAAgB,CACpB,IAAI,GAAE,qCAA0C,GAC/C,OAAO,CAAC,4BAA4B,CAAC,yBAAyB,CAAC,CAAC;CAOpE"}
|
package/dist/domains/payments.js
CHANGED
|
@@ -3,7 +3,7 @@ import { MyCheckoutsDocument, MyCheckoutsConnectionDocument, CheckoutsDocument,
|
|
|
3
3
|
* Payment checkouts (wallet top-ups, plan purchases) — exposed as
|
|
4
4
|
* `client.payments` (and grouped under `client.admin`).
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* Part of the management surface. {@link create} and {@link mine} require an
|
|
7
7
|
* authenticated caller and act on their own checkouts; {@link all} is
|
|
8
8
|
* super-admin only. Amounts are minor currency units (`*Cents`).
|
|
9
9
|
*
|
|
@@ -15,8 +15,8 @@ import { MyCheckoutsDocument, MyCheckoutsConnectionDocument, CheckoutsDocument,
|
|
|
15
15
|
* above.
|
|
16
16
|
*/
|
|
17
17
|
export class PaymentsAPI {
|
|
18
|
-
constructor(
|
|
19
|
-
this.
|
|
18
|
+
constructor(api) {
|
|
19
|
+
this.api = api;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Start a checkout (e.g. an `ORG_WALLET_TOPUP`). Requires authentication.
|
|
@@ -26,7 +26,7 @@ export class PaymentsAPI {
|
|
|
26
26
|
* @returns The created checkout including the provider redirect/approval URL.
|
|
27
27
|
*/
|
|
28
28
|
async create(input) {
|
|
29
|
-
const data = await this.
|
|
29
|
+
const data = await this.api.request(CreateCheckoutDocument, {
|
|
30
30
|
input,
|
|
31
31
|
});
|
|
32
32
|
return data.createCheckout;
|
|
@@ -38,7 +38,7 @@ export class PaymentsAPI {
|
|
|
38
38
|
* @returns The caller's checkouts.
|
|
39
39
|
*/
|
|
40
40
|
async mine(opts = {}) {
|
|
41
|
-
const data = await this.
|
|
41
|
+
const data = await this.api.request(MyCheckoutsDocument, {
|
|
42
42
|
limit: opts.limit,
|
|
43
43
|
offset: opts.offset,
|
|
44
44
|
});
|
|
@@ -53,7 +53,7 @@ export class PaymentsAPI {
|
|
|
53
53
|
* @returns The matching checkouts.
|
|
54
54
|
*/
|
|
55
55
|
async all(opts = {}) {
|
|
56
|
-
const data = await this.
|
|
56
|
+
const data = await this.api.request(CheckoutsDocument, {
|
|
57
57
|
filter: opts.filter,
|
|
58
58
|
limit: opts.limit,
|
|
59
59
|
offset: opts.offset,
|
|
@@ -73,7 +73,7 @@ export class PaymentsAPI {
|
|
|
73
73
|
* @returns The finalized {@link Checkout}.
|
|
74
74
|
*/
|
|
75
75
|
async capturePaypal(orderId, idempotencyKey) {
|
|
76
|
-
const data = await this.
|
|
76
|
+
const data = await this.api.request(CapturePaypalCheckoutDocument, {
|
|
77
77
|
orderId,
|
|
78
78
|
idempotencyKey,
|
|
79
79
|
});
|
|
@@ -88,7 +88,7 @@ export class PaymentsAPI {
|
|
|
88
88
|
* @returns A checkouts connection.
|
|
89
89
|
*/
|
|
90
90
|
async mineConnection(args = {}) {
|
|
91
|
-
const data = await this.
|
|
91
|
+
const data = await this.api.request(MyCheckoutsConnectionDocument, args);
|
|
92
92
|
return data.myCheckoutsConnection;
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
@@ -99,7 +99,7 @@ export class PaymentsAPI {
|
|
|
99
99
|
* @returns A checkouts connection.
|
|
100
100
|
*/
|
|
101
101
|
async allConnection(args = {}) {
|
|
102
|
-
const data = await this.
|
|
102
|
+
const data = await this.api.request(CheckoutsConnectionDocument, args);
|
|
103
103
|
return data.checkoutsConnection;
|
|
104
104
|
}
|
|
105
105
|
/**
|
|
@@ -112,7 +112,7 @@ export class PaymentsAPI {
|
|
|
112
112
|
* offset args here are deprecated server-side.
|
|
113
113
|
*/
|
|
114
114
|
async events(opts = {}) {
|
|
115
|
-
const data = await this.
|
|
115
|
+
const data = await this.api.request(PaymentEventsDocument, opts);
|
|
116
116
|
return data.paymentEvents;
|
|
117
117
|
}
|
|
118
118
|
/**
|
|
@@ -123,7 +123,7 @@ export class PaymentsAPI {
|
|
|
123
123
|
* @returns A payment-events connection.
|
|
124
124
|
*/
|
|
125
125
|
async eventsConnection(args = {}) {
|
|
126
|
-
const data = await this.
|
|
126
|
+
const data = await this.api.request(PaymentEventsConnectionDocument, args);
|
|
127
127
|
return data.paymentEventsConnection;
|
|
128
128
|
}
|
|
129
129
|
}
|
|
@@ -15,17 +15,16 @@ export interface PlatformConfig {
|
|
|
15
15
|
/**
|
|
16
16
|
* Public platform discovery — exposed as `client.platform`.
|
|
17
17
|
*
|
|
18
|
-
*
|
|
18
|
+
* Part of the management surface.
|
|
19
19
|
* **Public**: no authentication required. Lets a client discover the shared
|
|
20
20
|
* game-api URL (for apps published to the shared environment) *before* it has a
|
|
21
|
-
* per-app endpoint, then build a
|
|
21
|
+
* per-app endpoint, then build a per-app `CrowdyClient` against it.
|
|
22
22
|
*
|
|
23
23
|
* @example
|
|
24
24
|
* ```ts
|
|
25
|
-
* const base = createCrowdyClient({
|
|
25
|
+
* const base = createCrowdyClient({ httpUrl: 'https://api.example.com/graphql' });
|
|
26
26
|
* const cfg = await base.platform.config();
|
|
27
27
|
* const gameClient = createCrowdyClient({
|
|
28
|
-
* managementUrl: 'https://api.example.com',
|
|
29
28
|
* httpUrl: cfg.sharedGameApiUrl ?? undefined,
|
|
30
29
|
* wsUrl: cfg.sharedGameApiWsUrl ?? undefined,
|
|
31
30
|
* tokenStore: base.session.tokenStore,
|
|
@@ -33,8 +32,8 @@ export interface PlatformConfig {
|
|
|
33
32
|
* ```
|
|
34
33
|
*/
|
|
35
34
|
export declare class PlatformAPI {
|
|
36
|
-
private readonly
|
|
37
|
-
constructor(
|
|
35
|
+
private readonly api;
|
|
36
|
+
constructor(api: GraphQLClient);
|
|
38
37
|
/**
|
|
39
38
|
* Fetch public platform discovery: the shared game-api URL clients use for
|
|
40
39
|
* shared-environment apps, plus the free shared-app quota. **Public** — no
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/domains/platform.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,sFAAsF;IACtF,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,mFAAmF;IACnF,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,gFAAgF;IAChF,cAAc,EAAE,MAAM,CAAC;CACxB;AAiBD
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/domains/platform.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,sFAAsF;IACtF,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,mFAAmF;IACnF,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,gFAAgF;IAChF,cAAc,EAAE,MAAM,CAAC;CACxB;AAiBD;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,WAAW;IACV,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,aAAa;IAE/C;;;;;;;;OAQG;IACG,MAAM,IAAI,OAAO,CAAC,cAAc,CAAC;CAIxC"}
|
package/dist/domains/platform.js
CHANGED
|
@@ -13,17 +13,16 @@ const PlatformConfigDocument = parse(/* GraphQL */ `
|
|
|
13
13
|
/**
|
|
14
14
|
* Public platform discovery — exposed as `client.platform`.
|
|
15
15
|
*
|
|
16
|
-
*
|
|
16
|
+
* Part of the management surface.
|
|
17
17
|
* **Public**: no authentication required. Lets a client discover the shared
|
|
18
18
|
* game-api URL (for apps published to the shared environment) *before* it has a
|
|
19
|
-
* per-app endpoint, then build a
|
|
19
|
+
* per-app endpoint, then build a per-app `CrowdyClient` against it.
|
|
20
20
|
*
|
|
21
21
|
* @example
|
|
22
22
|
* ```ts
|
|
23
|
-
* const base = createCrowdyClient({
|
|
23
|
+
* const base = createCrowdyClient({ httpUrl: 'https://api.example.com/graphql' });
|
|
24
24
|
* const cfg = await base.platform.config();
|
|
25
25
|
* const gameClient = createCrowdyClient({
|
|
26
|
-
* managementUrl: 'https://api.example.com',
|
|
27
26
|
* httpUrl: cfg.sharedGameApiUrl ?? undefined,
|
|
28
27
|
* wsUrl: cfg.sharedGameApiWsUrl ?? undefined,
|
|
29
28
|
* tokenStore: base.session.tokenStore,
|
|
@@ -31,8 +30,8 @@ const PlatformConfigDocument = parse(/* GraphQL */ `
|
|
|
31
30
|
* ```
|
|
32
31
|
*/
|
|
33
32
|
export class PlatformAPI {
|
|
34
|
-
constructor(
|
|
35
|
-
this.
|
|
33
|
+
constructor(api) {
|
|
34
|
+
this.api = api;
|
|
36
35
|
}
|
|
37
36
|
/**
|
|
38
37
|
* Fetch public platform discovery: the shared game-api URL clients use for
|
|
@@ -44,7 +43,7 @@ export class PlatformAPI {
|
|
|
44
43
|
* @throws {CrowdyGraphQLError} on transport/validation failures.
|
|
45
44
|
*/
|
|
46
45
|
async config() {
|
|
47
|
-
const data = await this.
|
|
46
|
+
const data = await this.api.request(PlatformConfigDocument, {});
|
|
48
47
|
return data.platformConfig;
|
|
49
48
|
}
|
|
50
49
|
}
|
package/dist/domains/portal.d.ts
CHANGED
|
@@ -37,6 +37,23 @@ export interface AppTokenResponse {
|
|
|
37
37
|
gameApiUrl: string | null;
|
|
38
38
|
/** WebSocket URL of the Game API serving this app. */
|
|
39
39
|
gameApiWsUrl: string | null;
|
|
40
|
+
/**
|
|
41
|
+
* Stable entry origin that reaches SOME healthy instance, whatever has failed.
|
|
42
|
+
*
|
|
43
|
+
* WHY THIS IS NOT `gameApiUrl`. The published origin resolves to EVERY datacenter's
|
|
44
|
+
* load balancer, while `gameApiUrl` is the ONE datacenter holding this app's shards.
|
|
45
|
+
* So `gameApiUrl` is where the gameplay goes and this is the way back: it is the only
|
|
46
|
+
* address that survives losing a datacenter.
|
|
47
|
+
*
|
|
48
|
+
* It matters most for a client holding only an app token, which is the normal state
|
|
49
|
+
* after a portal entry. Such a client CANNOT re-mint — minting needs the identity
|
|
50
|
+
* session it does not have — so without this it has nothing left to ask when its
|
|
51
|
+
* endpoint stops answering. Pass it as `realtime.discoveryUrl` and the SDK builds
|
|
52
|
+
* re-discovery from it.
|
|
53
|
+
*
|
|
54
|
+
* Null against a Game API older than the datacenter rebuild, which did not return it.
|
|
55
|
+
*/
|
|
56
|
+
discoveryUrl: string | null;
|
|
40
57
|
/** Browser launch URL for this app, if configured. */
|
|
41
58
|
launchUrl: string | null;
|
|
42
59
|
}
|
|
@@ -95,10 +112,10 @@ export interface BeginEntryParams {
|
|
|
95
112
|
state?: string;
|
|
96
113
|
}
|
|
97
114
|
export declare class PortalAPI {
|
|
98
|
-
private readonly
|
|
115
|
+
private readonly api;
|
|
99
116
|
private readonly session;
|
|
100
117
|
private readonly pkceStore;
|
|
101
|
-
constructor(
|
|
118
|
+
constructor(api: GraphQLClient, session: SessionStore, pkceStore?: PkceStore);
|
|
102
119
|
/**
|
|
103
120
|
* Native/direct mint: exchange the caller's identity session token for an
|
|
104
121
|
* app-scoped gameplay token. Returns the token; it is NOT stored on this
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../src/domains/portal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAGlD,MAAM,WAAW,gBAAgB;IAC/B,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,SAAS,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,sDAAsD;IACtD,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,sDAAsD;IACtD,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,8EAA8E;AAC9E,MAAM,WAAW,SAAS;IACxB,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC3D,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAA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