@crowdedkingdoms/crowdyjs 13.9.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.js +1 -1
- 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
package/dist/domains/portal.js
CHANGED
|
@@ -43,7 +43,7 @@ export class BrowserSessionPkceStore {
|
|
|
43
43
|
this.ss()?.removeItem(this.prefix + state);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
const APP_TOKEN_FIELDS = 'token gameTokenId appId expiresAt gameApiUrl gameApiWsUrl launchUrl';
|
|
46
|
+
const APP_TOKEN_FIELDS = 'token gameTokenId appId expiresAt gameApiUrl gameApiWsUrl discoveryUrl launchUrl';
|
|
47
47
|
const MintAppTokenDocument = parse(`mutation MintAppToken($input: MintAppTokenInput!) { mintAppToken(input: $input) { ${APP_TOKEN_FIELDS} } }`);
|
|
48
48
|
const CreatePortalAuthorizationCodeDocument = parse(`mutation CreatePortalAuthorizationCode($input: CreatePortalAuthorizationCodeInput!) { createPortalAuthorizationCode(input: $input) { code redirectUri expiresAt } }`);
|
|
49
49
|
const ExchangePortalCodeDocument = parse(`mutation ExchangePortalCode($input: ExchangePortalCodeInput!) { exchangePortalCode(input: $input) { ${APP_TOKEN_FIELDS} } }`);
|
|
@@ -63,8 +63,8 @@ const RevokeAppAuthorizationDocument = parse(`mutation RevokeAppAuthorization($a
|
|
|
63
63
|
const MyAuthorizedAppsDocument = parse(`query MyAuthorizedApps { myAuthorizedApps { grantId appId appName scopes status grantedAt revokedAt } }`);
|
|
64
64
|
const SetAppClientSettingsDocument = parse(`mutation SetAppClientSettings($input: SetAppClientSettingsInput!) { setAppClientSettings(input: $input) { appId appName trusted consentRequired } }`);
|
|
65
65
|
export class PortalAPI {
|
|
66
|
-
constructor(
|
|
67
|
-
this.
|
|
66
|
+
constructor(api, session, pkceStore = new BrowserSessionPkceStore()) {
|
|
67
|
+
this.api = api;
|
|
68
68
|
this.session = session;
|
|
69
69
|
this.pkceStore = pkceStore;
|
|
70
70
|
}
|
|
@@ -75,7 +75,7 @@ export class PortalAPI {
|
|
|
75
75
|
* paid apps require an existing entitlement.
|
|
76
76
|
*/
|
|
77
77
|
async mintAppToken(appId) {
|
|
78
|
-
const data = await this.
|
|
78
|
+
const data = await this.api.request(MintAppTokenDocument, {
|
|
79
79
|
input: { appId },
|
|
80
80
|
});
|
|
81
81
|
return data.mintAppToken;
|
|
@@ -86,7 +86,7 @@ export class PortalAPI {
|
|
|
86
86
|
* Requires the identity session token.
|
|
87
87
|
*/
|
|
88
88
|
async createAuthorizationCode(params) {
|
|
89
|
-
const data = await this.
|
|
89
|
+
const data = await this.api.request(CreatePortalAuthorizationCodeDocument, { input: params });
|
|
90
90
|
return data.createPortalAuthorizationCode;
|
|
91
91
|
}
|
|
92
92
|
/**
|
|
@@ -95,7 +95,7 @@ export class PortalAPI {
|
|
|
95
95
|
* authenticated. Public — no session token required.
|
|
96
96
|
*/
|
|
97
97
|
async exchangeCode(code, codeVerifier) {
|
|
98
|
-
const data = await this.
|
|
98
|
+
const data = await this.api.request(ExchangePortalCodeDocument, {
|
|
99
99
|
input: { code, codeVerifier },
|
|
100
100
|
});
|
|
101
101
|
this.session.setToken(data.exchangePortalCode.token);
|
|
@@ -107,38 +107,38 @@ export class PortalAPI {
|
|
|
107
107
|
* through the Overworld. Requires the current app token on this session.
|
|
108
108
|
*/
|
|
109
109
|
async refresh() {
|
|
110
|
-
const data = await this.
|
|
110
|
+
const data = await this.api.request(RefreshAppTokenDocument, {});
|
|
111
111
|
this.session.setToken(data.refreshAppToken.token);
|
|
112
112
|
return data.refreshAppToken;
|
|
113
113
|
}
|
|
114
114
|
// ----- Consent + connected apps ------------------------------------------
|
|
115
115
|
/** Whether portaling into an app needs a consent prompt (Overworld side). */
|
|
116
116
|
async getConsent(appId) {
|
|
117
|
-
const data = await this.
|
|
117
|
+
const data = await this.api.request(PortalConsentDocument, { appId });
|
|
118
118
|
return data.portalConsent;
|
|
119
119
|
}
|
|
120
120
|
/** Record the user's consent for an app (call from the consent screen). */
|
|
121
121
|
async authorizeApp(appId, scopes) {
|
|
122
|
-
const data = await this.
|
|
122
|
+
const data = await this.api.request(AuthorizeAppDocument, {
|
|
123
123
|
input: { appId, scopes },
|
|
124
124
|
});
|
|
125
125
|
return data.authorizeApp;
|
|
126
126
|
}
|
|
127
127
|
/** Revoke a prior authorization; also revokes the user's live tokens for it. */
|
|
128
128
|
async revokeAppAuthorization(appId) {
|
|
129
|
-
const data = await this.
|
|
129
|
+
const data = await this.api.request(RevokeAppAuthorizationDocument, {
|
|
130
130
|
appId,
|
|
131
131
|
});
|
|
132
132
|
return data.revokeAppAuthorization;
|
|
133
133
|
}
|
|
134
134
|
/** The user's active app authorizations ("connected apps"). */
|
|
135
135
|
async myAuthorizedApps() {
|
|
136
|
-
const data = await this.
|
|
136
|
+
const data = await this.api.request(MyAuthorizedAppsDocument);
|
|
137
137
|
return data.myAuthorizedApps;
|
|
138
138
|
}
|
|
139
139
|
/** Register/update an app's portal client settings (requires manage_apps). */
|
|
140
140
|
async setAppClientSettings(input) {
|
|
141
|
-
const data = await this.
|
|
141
|
+
const data = await this.api.request(SetAppClientSettingsDocument, {
|
|
142
142
|
input,
|
|
143
143
|
});
|
|
144
144
|
return data.setAppClientSettings;
|
package/dist/domains/quotas.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { type QuotasForOrgQuery, type QuotasForAppQuery, type EffectiveQuotaQuer
|
|
|
4
4
|
* Usage quotas at the org and app scope — exposed as `client.quotas` (and
|
|
5
5
|
* grouped under `client.admin`).
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* Part of the management surface. Reads require the `view_usage` org/app
|
|
8
8
|
* permission; {@link set} / {@link remove} require `manage_quotas` (global
|
|
9
9
|
* quotas are super-admin only). A quota is keyed by a `metric` string; the
|
|
10
10
|
* effective value resolves app → org → platform default.
|
|
@@ -13,8 +13,8 @@ import { type QuotasForOrgQuery, type QuotasForAppQuery, type EffectiveQuotaQuer
|
|
|
13
13
|
* per the permission notes above.
|
|
14
14
|
*/
|
|
15
15
|
export declare class QuotasAPI {
|
|
16
|
-
private readonly
|
|
17
|
-
constructor(
|
|
16
|
+
private readonly api;
|
|
17
|
+
constructor(api: GraphQLClient);
|
|
18
18
|
/**
|
|
19
19
|
* List the quotas configured directly on an organization. Requires the
|
|
20
20
|
* `view_usage` org permission.
|
|
@@ -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,
|
|
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"}
|
package/dist/domains/quotas.js
CHANGED
|
@@ -3,7 +3,7 @@ import { QuotasForOrgDocument, QuotasForAppDocument, EffectiveQuotaDocument, Set
|
|
|
3
3
|
* Usage quotas at the org and app scope — exposed as `client.quotas` (and
|
|
4
4
|
* grouped under `client.admin`).
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* Part of the management surface. Reads require the `view_usage` org/app
|
|
7
7
|
* permission; {@link set} / {@link remove} require `manage_quotas` (global
|
|
8
8
|
* quotas are super-admin only). A quota is keyed by a `metric` string; the
|
|
9
9
|
* effective value resolves app → org → platform default.
|
|
@@ -12,8 +12,8 @@ import { QuotasForOrgDocument, QuotasForAppDocument, EffectiveQuotaDocument, Set
|
|
|
12
12
|
* per the permission notes above.
|
|
13
13
|
*/
|
|
14
14
|
export class QuotasAPI {
|
|
15
|
-
constructor(
|
|
16
|
-
this.
|
|
15
|
+
constructor(api) {
|
|
16
|
+
this.api = api;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* List the quotas configured directly on an organization. Requires the
|
|
@@ -23,7 +23,7 @@ export class QuotasAPI {
|
|
|
23
23
|
* @returns The org's quotas.
|
|
24
24
|
*/
|
|
25
25
|
async forOrg(orgId) {
|
|
26
|
-
const data = await this.
|
|
26
|
+
const data = await this.api.request(QuotasForOrgDocument, { orgId });
|
|
27
27
|
return data.quotasForOrg;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
@@ -34,7 +34,7 @@ export class QuotasAPI {
|
|
|
34
34
|
* @returns The app's quotas.
|
|
35
35
|
*/
|
|
36
36
|
async forApp(appId) {
|
|
37
|
-
const data = await this.
|
|
37
|
+
const data = await this.api.request(QuotasForAppDocument, { appId });
|
|
38
38
|
return data.quotasForApp;
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
@@ -46,7 +46,7 @@ export class QuotasAPI {
|
|
|
46
46
|
* @returns The effective quota for the metric.
|
|
47
47
|
*/
|
|
48
48
|
async effective(metric, scope = {}) {
|
|
49
|
-
const data = await this.
|
|
49
|
+
const data = await this.api.request(EffectiveQuotaDocument, {
|
|
50
50
|
metric,
|
|
51
51
|
orgId: scope.orgId,
|
|
52
52
|
appId: scope.appId,
|
|
@@ -61,7 +61,7 @@ export class QuotasAPI {
|
|
|
61
61
|
* @returns The created/updated quota.
|
|
62
62
|
*/
|
|
63
63
|
async set(input) {
|
|
64
|
-
const data = await this.
|
|
64
|
+
const data = await this.api.request(SetQuotaDocument, { input });
|
|
65
65
|
return data.setQuota;
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
@@ -71,7 +71,7 @@ export class QuotasAPI {
|
|
|
71
71
|
* @returns `true` on success.
|
|
72
72
|
*/
|
|
73
73
|
async remove(quotaId) {
|
|
74
|
-
const data = await this.
|
|
74
|
+
const data = await this.api.request(DeleteQuotaDocument, {
|
|
75
75
|
quotaId,
|
|
76
76
|
});
|
|
77
77
|
return data.deleteQuota;
|
|
@@ -41,8 +41,7 @@ export declare class ServerStatusAPI {
|
|
|
41
41
|
*/
|
|
42
42
|
serverWithLeastClients(): Promise<ServerWithLeastClientsQuery['serverWithLeastClients']>;
|
|
43
43
|
/**
|
|
44
|
-
* List every registered GraphQL API server
|
|
45
|
-
* `game-api` kinds), regardless of health/state — for service discovery. To
|
|
44
|
+
* List every registered GraphQL API server, regardless of health/state — for service discovery. To
|
|
46
45
|
* route clients, prefer {@link ServerStatusAPI.listActiveGraphqlServers}
|
|
47
46
|
* (healthy only). No authentication required.
|
|
48
47
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serverStatus.d.ts","sourceRoot":"","sources":["../../src/domains/serverStatus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAEL,KAAK,2BAA2B,EAEhC,KAAK,mBAAmB,EAExB,KAAK,yBAAyB,EAE9B,KAAK,gBAAgB,EAErB,KAAK,wBAAwB,EAC7B,KAAK,iCAAiC,EACvC,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,eAAe;IACd,OAAO,CAAC,GAAG;gBAAH,GAAG,EAAE,aAAa;IAEtC;;;;;;;;;;;;OAYG;IACG,sBAAsB,IAAI,OAAO,CAAC,2BAA2B,CAAC,wBAAwB,CAAC,CAAC;IAK9F
|
|
1
|
+
{"version":3,"file":"serverStatus.d.ts","sourceRoot":"","sources":["../../src/domains/serverStatus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAEL,KAAK,2BAA2B,EAEhC,KAAK,mBAAmB,EAExB,KAAK,yBAAyB,EAE9B,KAAK,gBAAgB,EAErB,KAAK,wBAAwB,EAC7B,KAAK,iCAAiC,EACvC,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,eAAe;IACd,OAAO,CAAC,GAAG;gBAAH,GAAG,EAAE,aAAa;IAEtC;;;;;;;;;;;;OAYG;IACG,sBAAsB,IAAI,OAAO,CAAC,2BAA2B,CAAC,wBAAwB,CAAC,CAAC;IAK9F;;;;;;OAMG;IACG,OAAO,IAAI,OAAO,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IAK/D;;;;;OAKG;IACG,wBAAwB,IAAI,OAAO,CAAC,yBAAyB,CAAC,sBAAsB,CAAC,CAAC;IAK5F;;;;;;;;OAQG;IACG,WAAW,IAAI,OAAO,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;IAK7D;;;;;;;;;;;;;;;;;;OAkBG;IACG,mBAAmB,CACvB,KAAK,EAAE,iCAAiC,CAAC,OAAO,CAAC,GAChD,OAAO,CAAC,wBAAwB,CAAC,qBAAqB,CAAC,CAAC;CAI5D"}
|
|
@@ -44,8 +44,7 @@ export class ServerStatusAPI {
|
|
|
44
44
|
return data.serverWithLeastClients;
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
|
-
* List every registered GraphQL API server
|
|
48
|
-
* `game-api` kinds), regardless of health/state — for service discovery. To
|
|
47
|
+
* List every registered GraphQL API server, regardless of health/state — for service discovery. To
|
|
49
48
|
* route clients, prefer {@link ServerStatusAPI.listActiveGraphqlServers}
|
|
50
49
|
* (healthy only). No authentication required.
|
|
51
50
|
*
|
|
@@ -5,7 +5,7 @@ import { type SharedEnvPlansQuery, type OrgFreeAppQuotaQuery, type AppSharedSubs
|
|
|
5
5
|
* auto-billing — exposed as `client.sharedEnvironment` (and grouped under
|
|
6
6
|
* `client.admin`).
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* Part of the management surface. {@link plans} is public; the read operations
|
|
9
9
|
* require org membership; spend-cap / auto-billing / subscription mutations
|
|
10
10
|
* require the `manage_billing` org permission; {@link publishApp} currently
|
|
11
11
|
* requires super-admin (preview). Monetary values are `*Cents` (minor units).
|
|
@@ -15,8 +15,8 @@ import { type SharedEnvPlansQuery, type OrgFreeAppQuotaQuery, type AppSharedSubs
|
|
|
15
15
|
* different args.
|
|
16
16
|
*/
|
|
17
17
|
export declare class SharedEnvironmentAPI {
|
|
18
|
-
private readonly
|
|
19
|
-
constructor(
|
|
18
|
+
private readonly api;
|
|
19
|
+
constructor(api: GraphQLClient);
|
|
20
20
|
/**
|
|
21
21
|
* Public catalog of paid shared-environment app-slot plans.
|
|
22
22
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharedEnvironment.d.ts","sourceRoot":"","sources":["../../src/domains/sharedEnvironment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAaL,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAC/B,KAAK,gCAAgC,EACrC,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,gCAAgC,EACrC,KAAK,iCAAiC,EACtC,KAAK,eAAe,EACrB,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;;;GAaG;AACH,qBAAa,oBAAoB;IACnB,OAAO,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AAE,MAAM,GACtB,OAAO,CAAC,iCAAiC,CAAC,2BAA2B,CAAC,CAAC;CAO3E"}
|
|
@@ -4,7 +4,7 @@ import { SharedEnvPlansDocument, OrgFreeAppQuotaDocument, AppSharedSubscriptionD
|
|
|
4
4
|
* auto-billing — exposed as `client.sharedEnvironment` (and grouped under
|
|
5
5
|
* `client.admin`).
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* Part of the management surface. {@link plans} is public; the read operations
|
|
8
8
|
* require org membership; spend-cap / auto-billing / subscription mutations
|
|
9
9
|
* require the `manage_billing` org permission; {@link publishApp} currently
|
|
10
10
|
* requires super-admin (preview). Monetary values are `*Cents` (minor units).
|
|
@@ -14,8 +14,8 @@ import { SharedEnvPlansDocument, OrgFreeAppQuotaDocument, AppSharedSubscriptionD
|
|
|
14
14
|
* different args.
|
|
15
15
|
*/
|
|
16
16
|
export class SharedEnvironmentAPI {
|
|
17
|
-
constructor(
|
|
18
|
-
this.
|
|
17
|
+
constructor(api) {
|
|
18
|
+
this.api = api;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* Public catalog of paid shared-environment app-slot plans.
|
|
@@ -23,7 +23,7 @@ export class SharedEnvironmentAPI {
|
|
|
23
23
|
* @returns The available plans.
|
|
24
24
|
*/
|
|
25
25
|
async plans() {
|
|
26
|
-
const data = await this.
|
|
26
|
+
const data = await this.api.request(SharedEnvPlansDocument, {});
|
|
27
27
|
return data.sharedEnvPlans;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
@@ -33,7 +33,7 @@ export class SharedEnvironmentAPI {
|
|
|
33
33
|
* @returns The {@link FreeAppQuota}.
|
|
34
34
|
*/
|
|
35
35
|
async freeAppQuota(orgId) {
|
|
36
|
-
const data = await this.
|
|
36
|
+
const data = await this.api.request(OrgFreeAppQuotaDocument, {
|
|
37
37
|
orgId,
|
|
38
38
|
});
|
|
39
39
|
return data.orgFreeAppQuota;
|
|
@@ -45,7 +45,7 @@ export class SharedEnvironmentAPI {
|
|
|
45
45
|
* @returns The {@link AppSharedSubscription} or `null`.
|
|
46
46
|
*/
|
|
47
47
|
async appSubscription(appId) {
|
|
48
|
-
const data = await this.
|
|
48
|
+
const data = await this.api.request(AppSharedSubscriptionDocument, { appId });
|
|
49
49
|
return data.appSharedSubscription;
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
@@ -55,7 +55,7 @@ export class SharedEnvironmentAPI {
|
|
|
55
55
|
* @returns The {@link AppRuntimeState}.
|
|
56
56
|
*/
|
|
57
57
|
async appRuntimeState(appId) {
|
|
58
|
-
const data = await this.
|
|
58
|
+
const data = await this.api.request(AppRuntimeStateDocument, {
|
|
59
59
|
appId,
|
|
60
60
|
});
|
|
61
61
|
return data.appRuntimeState;
|
|
@@ -67,7 +67,7 @@ export class SharedEnvironmentAPI {
|
|
|
67
67
|
* @returns The {@link OrgAutoBilling} config.
|
|
68
68
|
*/
|
|
69
69
|
async autoBilling(orgId) {
|
|
70
|
-
const data = await this.
|
|
70
|
+
const data = await this.api.request(OrgAutoBillingDocument, {
|
|
71
71
|
orgId,
|
|
72
72
|
});
|
|
73
73
|
return data.orgAutoBilling;
|
|
@@ -79,7 +79,7 @@ export class SharedEnvironmentAPI {
|
|
|
79
79
|
* @returns The saved payment methods.
|
|
80
80
|
*/
|
|
81
81
|
async paymentMethods(orgId) {
|
|
82
|
-
const data = await this.
|
|
82
|
+
const data = await this.api.request(OrgPaymentMethodsDocument, {
|
|
83
83
|
orgId,
|
|
84
84
|
});
|
|
85
85
|
return data.orgPaymentMethods;
|
|
@@ -95,7 +95,7 @@ export class SharedEnvironmentAPI {
|
|
|
95
95
|
* @returns The {@link PublishAppResult} (free flag + optional checkout).
|
|
96
96
|
*/
|
|
97
97
|
async publishApp(appId, opts = {}) {
|
|
98
|
-
const data = await this.
|
|
98
|
+
const data = await this.api.request(PublishAppToSharedDocument, {
|
|
99
99
|
appId,
|
|
100
100
|
planId: opts.planId,
|
|
101
101
|
provider: opts.provider,
|
|
@@ -113,7 +113,7 @@ export class SharedEnvironmentAPI {
|
|
|
113
113
|
* @returns The updated {@link AppSharedSubscription}.
|
|
114
114
|
*/
|
|
115
115
|
async cancelSubscription(appId, idempotencyKey) {
|
|
116
|
-
const data = await this.
|
|
116
|
+
const data = await this.api.request(CancelSharedSubscriptionDocument, { appId, idempotencyKey });
|
|
117
117
|
return data.cancelSharedSubscription;
|
|
118
118
|
}
|
|
119
119
|
/**
|
|
@@ -125,7 +125,7 @@ export class SharedEnvironmentAPI {
|
|
|
125
125
|
* @returns The updated {@link AppRuntimeState}.
|
|
126
126
|
*/
|
|
127
127
|
async setSpendCaps(appId, caps = {}) {
|
|
128
|
-
const data = await this.
|
|
128
|
+
const data = await this.api.request(SetAppSpendCapsDocument, {
|
|
129
129
|
appId,
|
|
130
130
|
hourlyLimitCents: caps.hourlyLimitCents,
|
|
131
131
|
dailyLimitCents: caps.dailyLimitCents,
|
|
@@ -142,7 +142,7 @@ export class SharedEnvironmentAPI {
|
|
|
142
142
|
* @returns The updated {@link OrgAutoBilling} config.
|
|
143
143
|
*/
|
|
144
144
|
async setAutoBilling(orgId, config) {
|
|
145
|
-
const data = await this.
|
|
145
|
+
const data = await this.api.request(SetAutoBillingDocument, {
|
|
146
146
|
orgId,
|
|
147
147
|
enabled: config.enabled,
|
|
148
148
|
limitCents: config.limitCents,
|
|
@@ -161,7 +161,7 @@ export class SharedEnvironmentAPI {
|
|
|
161
161
|
* @returns The {@link PaymentMethodSetup} handle.
|
|
162
162
|
*/
|
|
163
163
|
async setupPaymentMethod(orgId, idempotencyKey) {
|
|
164
|
-
const data = await this.
|
|
164
|
+
const data = await this.api.request(SetupSharedPaymentMethodDocument, { orgId, idempotencyKey });
|
|
165
165
|
return data.setupSharedPaymentMethod;
|
|
166
166
|
}
|
|
167
167
|
/**
|
|
@@ -173,7 +173,7 @@ export class SharedEnvironmentAPI {
|
|
|
173
173
|
* @returns `true` on success.
|
|
174
174
|
*/
|
|
175
175
|
async removePaymentMethod(orgId, paymentMethodId, idempotencyKey) {
|
|
176
|
-
const data = await this.
|
|
176
|
+
const data = await this.api.request(RemoveSharedPaymentMethodDocument, { orgId, paymentMethodId, idempotencyKey });
|
|
177
177
|
return data.removeSharedPaymentMethod;
|
|
178
178
|
}
|
|
179
179
|
}
|
package/dist/domains/udp.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ import type { SpatialNotification } from '../realtime.js';
|
|
|
15
15
|
* WebSocket (same game-api endpoint) managed by `SubscriptionManager` — the
|
|
16
16
|
* first subscriber opens it and the last to unsubscribe closes it. Every call
|
|
17
17
|
* requires an authenticated session carrying a **bearer game token** (minted
|
|
18
|
-
* by the
|
|
18
|
+
* by the API, set via `client.auth.login()` or `client.setToken()`);
|
|
19
19
|
* a UDP proxy session is opened lazily on the first send or subscribe if you
|
|
20
20
|
* didn't call {@link connect} first.
|
|
21
21
|
*
|
package/dist/domains/udp.js
CHANGED
|
@@ -14,7 +14,7 @@ import { serializeActorUpdate, serializeAudioPacket, serializeChannelMessage, se
|
|
|
14
14
|
* WebSocket (same game-api endpoint) managed by `SubscriptionManager` — the
|
|
15
15
|
* first subscriber opens it and the last to unsubscribe closes it. Every call
|
|
16
16
|
* requires an authenticated session carrying a **bearer game token** (minted
|
|
17
|
-
* by the
|
|
17
|
+
* by the API, set via `client.auth.login()` or `client.setToken()`);
|
|
18
18
|
* a UDP proxy session is opened lazily on the first send or subscribe if you
|
|
19
19
|
* didn't call {@link connect} first.
|
|
20
20
|
*
|
package/dist/domains/usage.d.ts
CHANGED
|
@@ -17,8 +17,8 @@ import { type AppGraphqlOperationsQuery, type AppUsageSummaryQuery, type PlayerP
|
|
|
17
17
|
* per the permission notes above.
|
|
18
18
|
*/
|
|
19
19
|
export declare class UsageAPI {
|
|
20
|
-
private readonly
|
|
21
|
-
constructor(
|
|
20
|
+
private readonly api;
|
|
21
|
+
constructor(api: GraphQLClient);
|
|
22
22
|
/**
|
|
23
23
|
* Top GraphQL operations for an app ranked by bytes.
|
|
24
24
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../src/domains/usage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAIL,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,QAAQ;IACP,OAAO,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../src/domains/usage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAIL,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,QAAQ;IACP,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,aAAa;IAE/C;;;;;;;;OAQG;IACG,oBAAoB,CACxB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,yBAAyB,CAAC,sBAAsB,CAAC,CAAC;IAU7D;;;;;;;;OAQG;IACG,UAAU,CACd,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;IAUnD;;;;;;;;OAQG;IACG,WAAW,CACf,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;CAI5C"}
|
package/dist/domains/usage.js
CHANGED
|
@@ -16,8 +16,8 @@ import { AppGraphqlOperationsDocument, AppUsageSummaryDocument, PlayerPulseDocum
|
|
|
16
16
|
* per the permission notes above.
|
|
17
17
|
*/
|
|
18
18
|
export class UsageAPI {
|
|
19
|
-
constructor(
|
|
20
|
-
this.
|
|
19
|
+
constructor(api) {
|
|
20
|
+
this.api = api;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Top GraphQL operations for an app ranked by bytes.
|
|
@@ -29,7 +29,7 @@ export class UsageAPI {
|
|
|
29
29
|
* @returns The top operations by usage.
|
|
30
30
|
*/
|
|
31
31
|
async appGraphqlOperations(orgId, appId, since, limit) {
|
|
32
|
-
const data = await this.
|
|
32
|
+
const data = await this.api.request(AppGraphqlOperationsDocument, {
|
|
33
33
|
orgId,
|
|
34
34
|
appId,
|
|
35
35
|
since,
|
|
@@ -47,7 +47,7 @@ export class UsageAPI {
|
|
|
47
47
|
* @returns The {@link AppUsageSummary}.
|
|
48
48
|
*/
|
|
49
49
|
async appSummary(orgId, appId, since, operationLimit) {
|
|
50
|
-
const data = await this.
|
|
50
|
+
const data = await this.api.request(AppUsageSummaryDocument, {
|
|
51
51
|
orgId,
|
|
52
52
|
appId,
|
|
53
53
|
since,
|
|
@@ -65,7 +65,7 @@ export class UsageAPI {
|
|
|
65
65
|
* @returns The {@link PlayerPulse} snapshot.
|
|
66
66
|
*/
|
|
67
67
|
async playerPulse(orgId) {
|
|
68
|
-
const data = await this.
|
|
68
|
+
const data = await this.api.request(PlayerPulseDocument, { orgId });
|
|
69
69
|
return data.playerPulse;
|
|
70
70
|
}
|
|
71
71
|
}
|
package/dist/domains/users.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { type MeQuery, type UpdateGamertagInput, type UpdateGamertagMutation, ty
|
|
|
3
3
|
/**
|
|
4
4
|
* User identity & account management — exposed as `client.users`.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* Part of the management surface. After
|
|
7
7
|
* the database split the users table is management-owned, so game-api no longer
|
|
8
8
|
* exposes these identity mutations — calling them against a game-api endpoint
|
|
9
9
|
* throws {@link CrowdyGraphQLError} with `FORBIDDEN`, directing you to the
|
package/dist/domains/users.js
CHANGED
|
@@ -2,7 +2,7 @@ import { MeDocument, UpdateGamertagDocument, DeleteMyAccountDocument, UserDocume
|
|
|
2
2
|
/**
|
|
3
3
|
* User identity & account management — exposed as `client.users`.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
5
|
+
* Part of the management surface. After
|
|
6
6
|
* the database split the users table is management-owned, so game-api no longer
|
|
7
7
|
* exposes these identity mutations — calling them against a game-api endpoint
|
|
8
8
|
* throws {@link CrowdyGraphQLError} with `FORBIDDEN`, directing you to the
|