@crowdedkingdoms/crowdyjs 12.1.0 → 13.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 +29 -0
- package/README.md +26 -5
- package/dist/crowdy-client.d.ts +1 -4
- package/dist/crowdy-client.d.ts.map +1 -1
- package/dist/crowdy-client.js +0 -3
- package/dist/domains/admin.d.ts +0 -4
- package/dist/domains/admin.d.ts.map +1 -1
- package/dist/domains/admin.js +0 -1
- package/dist/domains/billing.d.ts +1 -21
- package/dist/domains/billing.d.ts.map +1 -1
- package/dist/domains/billing.js +1 -30
- package/dist/domains/controlPlane.d.ts +14 -170
- package/dist/domains/controlPlane.d.ts.map +1 -1
- package/dist/domains/controlPlane.js +14 -249
- package/dist/domains/gameModel.d.ts +68 -1
- package/dist/domains/gameModel.d.ts.map +1 -1
- package/dist/domains/gameModel.js +88 -1
- package/dist/domains/usage.d.ts +9 -32
- package/dist/domains/usage.d.ts.map +1 -1
- package/dist/domains/usage.js +9 -48
- package/dist/generated/graphql.d.ts +186 -2094
- package/dist/generated/graphql.d.ts.map +1 -1
- package/dist/generated/graphql.js +21 -59
- package/dist/index.d.ts +5 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -5
- package/dist/kit/npcs.d.ts.map +1 -1
- package/dist/kit/social.d.ts.map +1 -1
- package/dist/lb-cookie-store.d.ts +4 -0
- package/dist/lb-cookie-store.d.ts.map +1 -1
- package/dist/lb-cookie-store.js +17 -0
- package/dist/realtime.d.ts.map +1 -1
- package/dist/realtime.js +38 -5
- package/package.json +1 -1
- package/dist/domains/environments.d.ts +0 -167
- package/dist/domains/environments.d.ts.map +0 -1
- package/dist/domains/environments.js +0 -238
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CpComputePlatformCeilingsDocument, CpSetComputePlatformCeilingsDocument, } from '../generated/graphql.js';
|
|
2
2
|
/**
|
|
3
|
-
* Operator (
|
|
3
|
+
* Operator (platform-policy) surface — exposed as `client.operator`.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
5
|
+
* As of the unified galaxy API this surface is reduced to the platform-wide
|
|
6
|
+
* compute ceilings: dedicated customer environments were retired, and the
|
|
7
|
+
* infrastructure control plane (environments, change orders, secrets, release
|
|
8
|
+
* management, audit) moved to the separate infra-control-plane service with
|
|
9
|
+
* its own auth and operator console. EVERY operation here still requires
|
|
10
|
+
* `users.is_operator` (super-admins implicitly have it).
|
|
10
11
|
*
|
|
11
12
|
* @throws {CrowdyGraphQLError} `UNAUTHENTICATED` without a session, `FORBIDDEN`
|
|
12
13
|
* when the caller is not an operator.
|
|
@@ -16,107 +17,10 @@ export class ControlPlaneAPI {
|
|
|
16
17
|
this.management = management;
|
|
17
18
|
}
|
|
18
19
|
/**
|
|
19
|
-
*
|
|
20
|
+
* The platform-wide compute ceilings (max modules, tick rates, fuel,
|
|
21
|
+
* memory, run time, db-op and egress budgets).
|
|
20
22
|
*
|
|
21
|
-
* @
|
|
22
|
-
* @returns A page of operator environment rows.
|
|
23
|
-
*/
|
|
24
|
-
async environments(opts = {}) {
|
|
25
|
-
const data = await this.management.request(CpEnvironmentsDocument, {
|
|
26
|
-
page: opts.page,
|
|
27
|
-
pageSize: opts.pageSize,
|
|
28
|
-
});
|
|
29
|
-
return data.cpEnvironments;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Operator view of one environment by slug (across any org).
|
|
33
|
-
*
|
|
34
|
-
* @param slug - Environment slug.
|
|
35
|
-
* @returns The environment row, or `null` if not found.
|
|
36
|
-
*/
|
|
37
|
-
async environment(slug) {
|
|
38
|
-
const data = await this.management.request(CpEnvironmentDocument, { slug });
|
|
39
|
-
return data.cpEnvironment;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Paginated change orders, optionally filtered by environment.
|
|
43
|
-
*
|
|
44
|
-
* @param opts - Optional `environmentId` filter, `page`, `pageSize`.
|
|
45
|
-
* @returns A page of change-order rows.
|
|
46
|
-
*/
|
|
47
|
-
async changeOrders(opts = {}) {
|
|
48
|
-
const data = await this.management.request(CpChangeOrdersDocument, {
|
|
49
|
-
environmentId: opts.environmentId,
|
|
50
|
-
page: opts.page,
|
|
51
|
-
pageSize: opts.pageSize,
|
|
52
|
-
});
|
|
53
|
-
return data.cpChangeOrders;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* One change order with its tasks and steps.
|
|
57
|
-
*
|
|
58
|
-
* @param id - Change order UUID.
|
|
59
|
-
* @returns The change-order detail, or `null` if not found.
|
|
60
|
-
*/
|
|
61
|
-
async changeOrder(id) {
|
|
62
|
-
const data = await this.management.request(CpChangeOrderDocument, { id });
|
|
63
|
-
return data.cpChangeOrder;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Most recent operator audit entries (newest first), optionally filtered.
|
|
67
|
-
*
|
|
68
|
-
* @param opts - Optional `environmentId` filter and `limit` (default 200).
|
|
69
|
-
* @returns The audit entries.
|
|
70
|
-
*/
|
|
71
|
-
async audit(opts = {}) {
|
|
72
|
-
const data = await this.management.request(CpAuditDocument, {
|
|
73
|
-
environmentId: opts.environmentId,
|
|
74
|
-
limit: opts.limit,
|
|
75
|
-
});
|
|
76
|
-
return data.cpAudit;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Control-plane secret metadata (names/kinds only, never plaintext).
|
|
80
|
-
*
|
|
81
|
-
* @param environmentId - Optional environment UUID filter.
|
|
82
|
-
* @returns The secret metadata rows.
|
|
83
|
-
*/
|
|
84
|
-
async secrets(environmentId) {
|
|
85
|
-
const data = await this.management.request(CpSecretsDocument, {
|
|
86
|
-
environmentId,
|
|
87
|
-
});
|
|
88
|
-
return data.cpSecrets;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Environment-delivered secret metadata (names/kinds only, never plaintext).
|
|
92
|
-
*
|
|
93
|
-
* @param environmentId - Optional environment UUID filter.
|
|
94
|
-
* @returns The env-secret metadata rows.
|
|
95
|
-
*/
|
|
96
|
-
async envSecrets(environmentId) {
|
|
97
|
-
const data = await this.management.request(CpEnvSecretsDocument, {
|
|
98
|
-
environmentId,
|
|
99
|
-
});
|
|
100
|
-
return data.cpEnvSecrets;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* OVH flavor catalog with provider vs. customer pricing.
|
|
104
|
-
*
|
|
105
|
-
* @param region - Optional region code filter (e.g. `'GRA11'`).
|
|
106
|
-
* @returns The catalog rows.
|
|
107
|
-
*/
|
|
108
|
-
async ovhCatalogSummary(region) {
|
|
109
|
-
const data = await this.management.request(CpOvhCatalogSummaryDocument, {
|
|
110
|
-
region,
|
|
111
|
-
});
|
|
112
|
-
return data.cpOvhCatalogSummary;
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Platform-wide compute ceilings (the maxima `computeSetPolicy` clamps to).
|
|
116
|
-
* Every knob is nullable: `null` means no operator override, so the
|
|
117
|
-
* env-var/bootstrap default applies on the game-api side.
|
|
118
|
-
*
|
|
119
|
-
* @returns The stored ceiling overrides plus updatedAt/updatedByUserId.
|
|
23
|
+
* @returns The stored ceilings row.
|
|
120
24
|
*/
|
|
121
25
|
async computePlatformCeilings() {
|
|
122
26
|
const data = await this.management.request(CpComputePlatformCeilingsDocument);
|
|
@@ -125,10 +29,9 @@ export class ControlPlaneAPI {
|
|
|
125
29
|
/**
|
|
126
30
|
* Patch the platform compute ceilings. Patch semantics per knob: omit =
|
|
127
31
|
* unchanged, explicit `null` = clear the override (fall back to the
|
|
128
|
-
* game-api bootstrap default), positive value = set.
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
* `compute.platform_ceilings_set` audit entry.
|
|
32
|
+
* game-api bootstrap default), positive value = set. Takes effect on the
|
|
33
|
+
* next `computeSetPolicy` call (no restart), within a 30s cache bound.
|
|
34
|
+
* Writes a `compute.platform_ceilings_set` audit entry.
|
|
132
35
|
*
|
|
133
36
|
* @param input - The per-knob patch.
|
|
134
37
|
* @returns The stored ceilings after the patch.
|
|
@@ -137,142 +40,4 @@ export class ControlPlaneAPI {
|
|
|
137
40
|
const data = await this.management.request(CpSetComputePlatformCeilingsDocument, { input });
|
|
138
41
|
return data.cpSetComputePlatformCeilings;
|
|
139
42
|
}
|
|
140
|
-
/**
|
|
141
|
-
* Operator per-minute usage summary for any environment (not org-scoped).
|
|
142
|
-
*
|
|
143
|
-
* @param environmentSlug - Environment slug.
|
|
144
|
-
* @param since - Start of the window (ISO-8601 DateTime) up to now.
|
|
145
|
-
* @returns The usage summary.
|
|
146
|
-
*/
|
|
147
|
-
async usageSummary(environmentSlug, since) {
|
|
148
|
-
const data = await this.management.request(CpUsageSummaryDocument, {
|
|
149
|
-
environmentSlug,
|
|
150
|
-
since,
|
|
151
|
-
});
|
|
152
|
-
return data.cpUsageSummary;
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* cks-game-api git tags not yet pinned by any environment release.
|
|
156
|
-
*
|
|
157
|
-
* @returns The unreleased tags with proposed versions.
|
|
158
|
-
*/
|
|
159
|
-
async unreleasedGameApiTags() {
|
|
160
|
-
const data = await this.management.request(CpUnreleasedGameApiTagsDocument, {});
|
|
161
|
-
return data.cpUnreleasedGameApiTags;
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* Environment release manifests merged from git + DB.
|
|
165
|
-
*
|
|
166
|
-
* @returns The version rows with latest-available and git-source flags.
|
|
167
|
-
*/
|
|
168
|
-
async environmentVersions() {
|
|
169
|
-
const data = await this.management.request(CpEnvironmentVersionsDocument, {});
|
|
170
|
-
return data.cpEnvironmentVersions;
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* List users with operator and/or super-admin privileges.
|
|
174
|
-
*
|
|
175
|
-
* @returns The privileged users.
|
|
176
|
-
*/
|
|
177
|
-
async operatorUsers() {
|
|
178
|
-
const data = await this.management.request(OperatorUsersDocument, {});
|
|
179
|
-
return data.operatorUsers;
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* Toggle deletion protection on an environment (blocks purge when enabled).
|
|
183
|
-
* Writes an audit entry.
|
|
184
|
-
*
|
|
185
|
-
* @param environmentId - Environment UUID.
|
|
186
|
-
* @param enabled - `true` to protect, `false` to unprotect.
|
|
187
|
-
* @returns `true` on success.
|
|
188
|
-
*/
|
|
189
|
-
async setDeletionProtection(environmentId, enabled) {
|
|
190
|
-
const data = await this.management.request(SetEnvironmentDeletionProtectionDocument, { environmentId, enabled });
|
|
191
|
-
return data.setEnvironmentDeletionProtection;
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* Create/overwrite a control-plane secret (plaintext is write-only). Writes an
|
|
195
|
-
* audit entry.
|
|
196
|
-
*
|
|
197
|
-
* @param environmentId - Environment UUID.
|
|
198
|
-
* @param name - Secret name/key.
|
|
199
|
-
* @param plaintext - Secret value to encrypt and store.
|
|
200
|
-
* @param kind - Optional classification tag.
|
|
201
|
-
* @returns The secret metadata row.
|
|
202
|
-
*/
|
|
203
|
-
async putSecret(environmentId, name, plaintext, kind) {
|
|
204
|
-
const data = await this.management.request(PutCpSecretDocument, {
|
|
205
|
-
environmentId,
|
|
206
|
-
name,
|
|
207
|
-
plaintext,
|
|
208
|
-
kind,
|
|
209
|
-
});
|
|
210
|
-
return data.putCpSecret;
|
|
211
|
-
}
|
|
212
|
-
/**
|
|
213
|
-
* Delete a control-plane secret by environment + name. Writes an audit entry.
|
|
214
|
-
*
|
|
215
|
-
* @param environmentId - Environment UUID.
|
|
216
|
-
* @param name - Secret name/key to delete.
|
|
217
|
-
* @returns `true` when a secret was removed.
|
|
218
|
-
*/
|
|
219
|
-
async deleteSecret(environmentId, name) {
|
|
220
|
-
const data = await this.management.request(DeleteCpSecretDocument, {
|
|
221
|
-
environmentId,
|
|
222
|
-
name,
|
|
223
|
-
});
|
|
224
|
-
return data.deleteCpSecret;
|
|
225
|
-
}
|
|
226
|
-
/**
|
|
227
|
-
* Create/overwrite an environment-delivered secret (injected into the tenant
|
|
228
|
-
* runtime; plaintext is write-only). Writes an audit entry.
|
|
229
|
-
*
|
|
230
|
-
* @param environmentId - Environment UUID.
|
|
231
|
-
* @param name - Secret name/key.
|
|
232
|
-
* @param plaintext - Secret value to encrypt and store.
|
|
233
|
-
* @param kind - Optional classification tag.
|
|
234
|
-
* @returns The env-secret metadata row.
|
|
235
|
-
*/
|
|
236
|
-
async putEnvSecret(environmentId, name, plaintext, kind) {
|
|
237
|
-
const data = await this.management.request(PutCpEnvSecretDocument, {
|
|
238
|
-
environmentId,
|
|
239
|
-
name,
|
|
240
|
-
plaintext,
|
|
241
|
-
kind,
|
|
242
|
-
});
|
|
243
|
-
return data.putCpEnvSecret;
|
|
244
|
-
}
|
|
245
|
-
/**
|
|
246
|
-
* Ingest a release manifest into the deployable catalog. Writes an audit
|
|
247
|
-
* entry.
|
|
248
|
-
*
|
|
249
|
-
* @param input - {@link IngestEnvironmentVersionInput} (version, force).
|
|
250
|
-
* @returns The ingested version row.
|
|
251
|
-
*/
|
|
252
|
-
async ingestEnvironmentVersion(input) {
|
|
253
|
-
const data = await this.management.request(IngestEnvironmentVersionDocument, { input });
|
|
254
|
-
return data.ingestEnvironmentVersion;
|
|
255
|
-
}
|
|
256
|
-
/**
|
|
257
|
-
* Cut a new environment release from a cks-game-api git tag (ingests + commits
|
|
258
|
-
* the manifest to git). SIDE EFFECT: retargets redeploy and writes to GitHub.
|
|
259
|
-
*
|
|
260
|
-
* @param input - {@link PublishEnvironmentReleaseFromGameApiTagInput}.
|
|
261
|
-
* @returns The publish result.
|
|
262
|
-
*/
|
|
263
|
-
async publishReleaseFromGameApiTag(input) {
|
|
264
|
-
const data = await this.management.request(PublishEnvironmentReleaseFromGameApiTagDocument, { input });
|
|
265
|
-
return data.publishEnvironmentReleaseFromGameApiTag;
|
|
266
|
-
}
|
|
267
|
-
/**
|
|
268
|
-
* Yank (withdraw) an environment version so it can no longer be deployed.
|
|
269
|
-
* Existing environments are unaffected. Writes an audit entry.
|
|
270
|
-
*
|
|
271
|
-
* @param version - Environment version to yank (e.g. `'v0.1.4'`).
|
|
272
|
-
* @returns `true` on success.
|
|
273
|
-
*/
|
|
274
|
-
async yankEnvironmentVersion(version) {
|
|
275
|
-
const data = await this.management.request(YankEnvironmentVersionDocument, { version });
|
|
276
|
-
return data.yankEnvironmentVersion;
|
|
277
|
-
}
|
|
278
43
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { GraphQLClient } from '../client.js';
|
|
2
|
-
import { type GameModelCreateSessionMutation, type GameModelCreateSessionMutationVariables, type GameModelJoinSessionMutation, type GameModelJoinSessionMutationVariables, type GameModelSetSessionTurnMutation, type GameModelSetSessionTurnMutationVariables, type GameModelCreateContainerMutation, type GameModelCreateContainerMutationVariables, type GameModelDeleteContainerMutation, type GameModelDeleteContainerMutationVariables, type GameModelSetPropertyMutation, type GameModelSetPropertyMutationVariables, type GameModelAddEdgeMutation, type GameModelAddEdgeMutationVariables, type GameModelDeleteEdgeMutation, type GameModelDeleteEdgeMutationVariables, type GameModelInvokeMutation, type GameModelInvokeMutationVariables, type GameModelContainerQuery, type GameModelContainerQueryVariables, GameModelContainerChangedSubscription, GameModelContainerChangedSubscriptionVariables, type GameModelContainersQuery, type GameModelContainersQueryVariables, type GameModelContainerStateQuery, type GameModelContainerStateQueryVariables, type GameModelTraverseQuery, type GameModelTraverseQueryVariables, type GameModelSessionQuery, type GameModelSessionQueryVariables, type GameModelSessionsQuery, type GameModelSessionsQueryVariables, type GameModelEventsQuery, type GameModelEventsQueryVariables, type GameModelFlowQuery, type GameModelFlowQueryVariables, type GameModelSeedMutation, type GameModelSeedMutationVariables, type GameModelUpsertContainerTypeMutation, type GameModelUpsertContainerTypeMutationVariables, type GameModelUpsertPropertyDefMutation, type GameModelUpsertPropertyDefMutationVariables, type GameModelDeletePropertyDefMutation, type GameModelDeletePropertyDefMutationVariables, type GameModelDeleteContainerTypeMutation, type GameModelDeleteContainerTypeMutationVariables, type GameModelUpsertFunctionMutation, type GameModelUpsertFunctionMutationVariables, type GameModelDeleteFunctionMutation, type GameModelDeleteFunctionMutationVariables, type GameModelDefineFeatureMutation, type GameModelDefineFeatureMutationVariables, type GameModelGrantTierFeatureMutation, type GameModelGrantTierFeatureMutationVariables, type GameModelSetPolicyMutation, type GameModelSetPolicyMutationVariables, type GameModelTypeSchemaQuery, type GameModelTypeSchemaQueryVariables, type GameModelContainerTypesQuery, type GameModelContainerTypesQueryVariables, type GameModelPropertyDefsQuery, type GameModelPropertyDefsQueryVariables, type GameModelFunctionQuery, type GameModelFunctionQueryVariables, type GameModelFunctionsQuery, type GameModelFunctionsQueryVariables, type GameModelFeaturesQuery, type GameModelFeaturesQueryVariables, type GameModelTierFeaturesQuery, type GameModelTierFeaturesQueryVariables, type GameModelPolicyQuery, type GameModelPolicyQueryVariables, type GameModelRevokeTierFeatureMutation, type GameModelRevokeTierFeatureMutationVariables, type GameModelEventsConnectionQuery, type GameModelEventsConnectionQueryVariables, type GameModelUpsertAutomationMutation, type GameModelUpsertAutomationMutationVariables, type GameModelDeleteAutomationMutation, type GameModelDeleteAutomationMutationVariables, type GameModelSetAutomationEnabledMutation, type GameModelSetAutomationEnabledMutationVariables, type GameModelUpsertAutomationTriggerMutation, type GameModelUpsertAutomationTriggerMutationVariables, type GameModelDeleteAutomationTriggerMutation, type GameModelDeleteAutomationTriggerMutationVariables, type GameModelSetAutomationPolicyMutation, type GameModelSetAutomationPolicyMutationVariables, type GameModelRunAutomationMutation, type GameModelRunAutomationMutationVariables, type GameModelAutomationsQuery, type GameModelAutomationsQueryVariables, type GameModelAutomationQuery, type GameModelAutomationQueryVariables, type GameModelAutomationTriggersQuery, type GameModelAutomationTriggersQueryVariables, type GameModelAutomationPolicyQuery, type GameModelAutomationPolicyQueryVariables, type GameModelAutomationRunsQuery, type GameModelAutomationRunsQueryVariables, type GameModelAutomationStatsQuery, type GameModelAutomationStatsQueryVariables, type GameModelAppDiagnosticsQuery, type GameModelAppDiagnosticsQueryVariables } from '../generated/graphql.js';
|
|
2
|
+
import { type GameModelCreateSessionMutation, type GameModelCreateSessionMutationVariables, type GameModelJoinSessionMutation, type GameModelJoinSessionMutationVariables, type GameModelSetSessionTurnMutation, type GameModelSetSessionTurnMutationVariables, type GameModelCreateContainerMutation, type GameModelCreateContainerMutationVariables, type GameModelDeleteContainerMutation, type GameModelDeleteContainerMutationVariables, type GameModelSetPropertyMutation, type GameModelSetPropertyMutationVariables, type GameModelAddEdgeMutation, type GameModelAddEdgeMutationVariables, type GameModelDeleteEdgeMutation, type GameModelDeleteEdgeMutationVariables, type GameModelInvokeMutation, type GameModelInvokeMutationVariables, type GameModelContainerQuery, type GameModelContainerQueryVariables, GameModelContainerChangedSubscription, GameModelContainerChangedSubscriptionVariables, type GameModelActivePlayerCountQuery, type GameModelActivePlayerCountQueryVariables, type GameModelActivePlayerCountChangedSubscription, type GameModelActivePlayerCountChangedSubscriptionVariables, type GameModelContainersQuery, type GameModelContainersQueryVariables, type GameModelContainerStateQuery, type GameModelContainerStateQueryVariables, type GameModelTraverseQuery, type GameModelTraverseQueryVariables, type GameModelSessionQuery, type GameModelSessionQueryVariables, type GameModelSessionsQuery, type GameModelSessionsQueryVariables, type GameModelEventsQuery, type GameModelEventsQueryVariables, type GameModelFlowQuery, type GameModelFlowQueryVariables, type GameModelSeedMutation, type GameModelSeedMutationVariables, type GameModelUpsertContainerTypeMutation, type GameModelUpsertContainerTypeMutationVariables, type GameModelUpsertPropertyDefMutation, type GameModelUpsertPropertyDefMutationVariables, type GameModelDeletePropertyDefMutation, type GameModelDeletePropertyDefMutationVariables, type GameModelDeleteContainerTypeMutation, type GameModelDeleteContainerTypeMutationVariables, type GameModelUpsertFunctionMutation, type GameModelUpsertFunctionMutationVariables, type GameModelDeleteFunctionMutation, type GameModelDeleteFunctionMutationVariables, type GameModelDefineFeatureMutation, type GameModelDefineFeatureMutationVariables, type GameModelGrantTierFeatureMutation, type GameModelGrantTierFeatureMutationVariables, type GameModelSetPolicyMutation, type GameModelSetPolicyMutationVariables, type GameModelTypeSchemaQuery, type GameModelTypeSchemaQueryVariables, type GameModelContainerTypesQuery, type GameModelContainerTypesQueryVariables, type GameModelPropertyDefsQuery, type GameModelPropertyDefsQueryVariables, type GameModelFunctionQuery, type GameModelFunctionQueryVariables, type GameModelFunctionsQuery, type GameModelFunctionsQueryVariables, type GameModelFeaturesQuery, type GameModelFeaturesQueryVariables, type GameModelTierFeaturesQuery, type GameModelTierFeaturesQueryVariables, type GameModelPolicyQuery, type GameModelPolicyQueryVariables, type GameModelRevokeTierFeatureMutation, type GameModelRevokeTierFeatureMutationVariables, type GameModelEventsConnectionQuery, type GameModelEventsConnectionQueryVariables, type GameModelUpsertAutomationMutation, type GameModelUpsertAutomationMutationVariables, type GameModelDeleteAutomationMutation, type GameModelDeleteAutomationMutationVariables, type GameModelSetAutomationEnabledMutation, type GameModelSetAutomationEnabledMutationVariables, type GameModelUpsertAutomationTriggerMutation, type GameModelUpsertAutomationTriggerMutationVariables, type GameModelDeleteAutomationTriggerMutation, type GameModelDeleteAutomationTriggerMutationVariables, type GameModelSetAutomationPolicyMutation, type GameModelSetAutomationPolicyMutationVariables, type GameModelRunAutomationMutation, type GameModelRunAutomationMutationVariables, type GameModelAutomationsQuery, type GameModelAutomationsQueryVariables, type GameModelAutomationQuery, type GameModelAutomationQueryVariables, type GameModelAutomationTriggersQuery, type GameModelAutomationTriggersQueryVariables, type GameModelAutomationPolicyQuery, type GameModelAutomationPolicyQueryVariables, type GameModelAutomationRunsQuery, type GameModelAutomationRunsQueryVariables, type GameModelAutomationStatsQuery, type GameModelAutomationStatsQueryVariables, type GameModelAppDiagnosticsQuery, type GameModelAppDiagnosticsQueryVariables } from '../generated/graphql.js';
|
|
3
3
|
/**
|
|
4
4
|
* Abstract **game-model** sub-client on the **game-api** — a schema-driven,
|
|
5
5
|
* server-authoritative layer for modelling game/world logic on top of the
|
|
@@ -92,6 +92,24 @@ export interface ContainerChangedHandlers {
|
|
|
92
92
|
*/
|
|
93
93
|
webSocketImpl?: unknown;
|
|
94
94
|
}
|
|
95
|
+
/** A snapshot returned by {@link GameModelAPI.activePlayerCount}. */
|
|
96
|
+
export type GmActivePlayerCountSnapshot = GameModelActivePlayerCountQuery['gameModelActivePlayerCount'];
|
|
97
|
+
/** One count transition from {@link GameModelAPI.activePlayerCountChanged}. */
|
|
98
|
+
export type GmActivePlayerCountChangeEvent = GameModelActivePlayerCountChangedSubscription['gameModelActivePlayerCountChanged'];
|
|
99
|
+
/** Handlers for {@link GameModelAPI.activePlayerCountChanged}. */
|
|
100
|
+
export interface ActivePlayerCountChangedHandlers {
|
|
101
|
+
/** A complete app-scoped active-session count transition. */
|
|
102
|
+
next: (change: GmActivePlayerCountChangeEvent) => void;
|
|
103
|
+
/** Transport/GraphQL errors (the subscription retries on socket drops). */
|
|
104
|
+
error?: (error: unknown) => void;
|
|
105
|
+
/** The server ended the stream. */
|
|
106
|
+
complete?: () => void;
|
|
107
|
+
/**
|
|
108
|
+
* WebSocket constructor for runtimes without a global `WebSocket` (Node
|
|
109
|
+
* ≤ 21): pass `(await import('ws')).default`.
|
|
110
|
+
*/
|
|
111
|
+
webSocketImpl?: unknown;
|
|
112
|
+
}
|
|
95
113
|
export declare class GameModelAPI {
|
|
96
114
|
private gql;
|
|
97
115
|
private readonly ws?;
|
|
@@ -99,6 +117,55 @@ export declare class GameModelAPI {
|
|
|
99
117
|
wsUrl?: string;
|
|
100
118
|
getToken: () => string | null;
|
|
101
119
|
} | undefined);
|
|
120
|
+
/**
|
|
121
|
+
* **Player count** — read the best-known number of active gameplay sessions
|
|
122
|
+
* for one app. Requires a bearer token scoped to exactly `appId`.
|
|
123
|
+
*
|
|
124
|
+
* This is a **session count**, not a distinct-user or actor count: one user
|
|
125
|
+
* with multiple active sessions contributes more than once. A session that
|
|
126
|
+
* disappears without a clean disconnect can remain counted for approximately
|
|
127
|
+
* 120 seconds while its inactivity is recognized.
|
|
128
|
+
*
|
|
129
|
+
* Treat the result as authoritative only when `status === 'FRESH'`.
|
|
130
|
+
* `PARTIAL` is an incomplete best-known count and `UNAVAILABLE` means no fresh
|
|
131
|
+
* observation exists; neither status is an authoritative zero. `appId` and
|
|
132
|
+
* the monotonic `revision` are generated `BigInt` scalars represented as
|
|
133
|
+
* decimal strings.
|
|
134
|
+
*
|
|
135
|
+
* @param appId - App to count, as a decimal-string `BigInt`; it must match
|
|
136
|
+
* the app scope of the bearer token.
|
|
137
|
+
* @returns The generated snapshot payload: `appId`, `activePlayerCount`,
|
|
138
|
+
* `status`, nullable `observedAt`, and `revision`.
|
|
139
|
+
* @throws {CrowdyGraphQLError} `UNAUTHENTICATED` / `SCOPE_MISSING` when the
|
|
140
|
+
* token is missing or is not scoped to `appId`.
|
|
141
|
+
*/
|
|
142
|
+
activePlayerCount(appId: GameModelActivePlayerCountQueryVariables['appId']): Promise<GmActivePlayerCountSnapshot>;
|
|
143
|
+
/**
|
|
144
|
+
* **Player-count subscription** — stream complete active-session count
|
|
145
|
+
* transitions for one app. Requires a bearer token scoped to exactly
|
|
146
|
+
* `variables.appId` and a game-api `wsUrl` in the client config.
|
|
147
|
+
*
|
|
148
|
+
* This stream counts gameplay **sessions**, not distinct users or actors;
|
|
149
|
+
* abandoned sessions can remain counted for approximately 120 seconds while
|
|
150
|
+
* inactivity is recognized. It emits no initial/bootstrap event, so establish
|
|
151
|
+
* the stream and then call {@link activePlayerCount} for the current snapshot.
|
|
152
|
+
* `PARTIAL` and `UNAVAILABLE` observations neither emit transitions nor
|
|
153
|
+
* represent an authoritative zero.
|
|
154
|
+
*
|
|
155
|
+
* Delivery is best-effort and may miss or repeat events across reconnects.
|
|
156
|
+
* Deduplicate by the decimal-string `revision`. Requery
|
|
157
|
+
* {@link activePlayerCount} after every reconnect or whenever revisions have
|
|
158
|
+
* a gap; the query is the source of truth.
|
|
159
|
+
*
|
|
160
|
+
* @param variables - Exact call shape `{ appId }`, where `appId` is the
|
|
161
|
+
* decimal-string `BigInt` matching the app-scoped bearer token.
|
|
162
|
+
* @param handlers - `next` per transition; optional `error`, `complete`, and
|
|
163
|
+
* `webSocketImpl` for runtimes without a global `WebSocket`.
|
|
164
|
+
* @returns An unsubscribe function that disposes this subscription and its
|
|
165
|
+
* graphql-transport-ws client.
|
|
166
|
+
* @throws {Error} Synchronously when the client config has no `wsUrl`.
|
|
167
|
+
*/
|
|
168
|
+
activePlayerCountChanged(variables: GameModelActivePlayerCountChangedSubscriptionVariables, handlers: ActivePlayerCountChangedHandlers): () => void;
|
|
102
169
|
/**
|
|
103
170
|
* **Subscriptions** — stream container-change notifications for an app
|
|
104
171
|
* (`gameModelContainerChanged`): an invoke mutated a container, a direct
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gameModel.d.ts","sourceRoot":"","sources":["../../src/domains/gameModel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAIlD,OAAO,EAGL,KAAK,8BAA8B,EACnC,KAAK,uCAAuC,EAE5C,KAAK,4BAA4B,EACjC,KAAK,qCAAqC,EAE1C,KAAK,+BAA+B,EACpC,KAAK,wCAAwC,EAE7C,KAAK,gCAAgC,EACrC,KAAK,yCAAyC,EAE9C,KAAK,gCAAgC,EACrC,KAAK,yCAAyC,EAE9C,KAAK,4BAA4B,EACjC,KAAK,qCAAqC,EAE1C,KAAK,wBAAwB,EAC7B,KAAK,iCAAiC,EAEtC,KAAK,2BAA2B,EAChC,KAAK,oCAAoC,EAEzC,KAAK,uBAAuB,EAC5B,KAAK,gCAAgC,EAErC,KAAK,uBAAuB,EAC5B,KAAK,gCAAgC,EAErC,qCAAqC,EACrC,8CAA8C,EAE9C,KAAK,wBAAwB,EAC7B,KAAK,iCAAiC,EAEtC,KAAK,4BAA4B,EACjC,KAAK,qCAAqC,EAE1C,KAAK,sBAAsB,EAC3B,KAAK,+BAA+B,EAEpC,K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C,wBAAwB,CAAC,qBAAqB,CAAC,CAAC;IAK3D;;;;;;OAMG;IACG,kBAAkB,CACtB,SAAS,EAAE,yCAAyC,GACnD,OAAO,CAAC,gCAAgC,CAAC,6BAA6B,CAAC,CAAC;IAK3E;;;;;;OAMG;IACG,gBAAgB,CACpB,SAAS,EAAE,uCAAuC,GACjD,OAAO,CAAC,8BAA8B,CAAC,2BAA2B,CAAC,CAAC;IAKvE;;;;;;;OAOG;IACG,cAAc,CAClB,SAAS,EAAE,qCAAqC,GAC/C,OAAO,CAAC,4BAA4B,CAAC,yBAAyB,CAAC,CAAC;IAKnE;;;;;;;;OAQG;IACG,eAAe,CACnB,SAAS,EAAE,sCAAsC,GAChD,OAAO,CAAC,6BAA6B,CAAC,0BAA0B,CAAC,CAAC;IAKrE;;;;;;;;OAQG;IACG,cAAc,CAClB,SAAS,EAAE,qCAAqC,GAC/C,OAAO,CAAC,4BAA4B,CAAC,yBAAyB,CAAC,CAAC;CAIpE"}
|
|
@@ -2,7 +2,7 @@ import { createClient as createWsClient } from 'graphql-ws';
|
|
|
2
2
|
import { print } from 'graphql';
|
|
3
3
|
import {
|
|
4
4
|
// Runtime (player) ops
|
|
5
|
-
GameModelCreateSessionDocument, GameModelJoinSessionDocument, GameModelSetSessionTurnDocument, GameModelCreateContainerDocument, GameModelDeleteContainerDocument, GameModelSetPropertyDocument, GameModelAddEdgeDocument, GameModelDeleteEdgeDocument, GameModelInvokeDocument, GameModelContainerDocument, GameModelContainerChangedDocument, GameModelContainersDocument, GameModelContainerStateDocument, GameModelTraverseDocument, GameModelSessionDocument, GameModelSessionsDocument, GameModelEventsDocument, GameModelFlowDocument,
|
|
5
|
+
GameModelCreateSessionDocument, GameModelJoinSessionDocument, GameModelSetSessionTurnDocument, GameModelCreateContainerDocument, GameModelDeleteContainerDocument, GameModelSetPropertyDocument, GameModelAddEdgeDocument, GameModelDeleteEdgeDocument, GameModelInvokeDocument, GameModelContainerDocument, GameModelContainerChangedDocument, GameModelActivePlayerCountDocument, GameModelActivePlayerCountChangedDocument, GameModelContainersDocument, GameModelContainerStateDocument, GameModelTraverseDocument, GameModelSessionDocument, GameModelSessionsDocument, GameModelEventsDocument, GameModelFlowDocument,
|
|
6
6
|
// Studio authoring ops
|
|
7
7
|
GameModelSeedDocument, GameModelUpsertContainerTypeDocument, GameModelUpsertPropertyDefDocument, GameModelDeletePropertyDefDocument, GameModelDeleteContainerTypeDocument, GameModelUpsertFunctionDocument, GameModelDeleteFunctionDocument, GameModelDefineFeatureDocument, GameModelGrantTierFeatureDocument, GameModelSetPolicyDocument, GameModelTypeSchemaDocument, GameModelContainerTypesDocument, GameModelPropertyDefsDocument, GameModelFunctionDocument, GameModelFunctionsDocument, GameModelFeaturesDocument, GameModelTierFeaturesDocument, GameModelPolicyDocument, GameModelRevokeTierFeatureDocument, GameModelEventsConnectionDocument,
|
|
8
8
|
// Automations (autonomous processes / NPCs)
|
|
@@ -12,6 +12,93 @@ export class GameModelAPI {
|
|
|
12
12
|
this.gql = gql;
|
|
13
13
|
this.ws = ws;
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* **Player count** — read the best-known number of active gameplay sessions
|
|
17
|
+
* for one app. Requires a bearer token scoped to exactly `appId`.
|
|
18
|
+
*
|
|
19
|
+
* This is a **session count**, not a distinct-user or actor count: one user
|
|
20
|
+
* with multiple active sessions contributes more than once. A session that
|
|
21
|
+
* disappears without a clean disconnect can remain counted for approximately
|
|
22
|
+
* 120 seconds while its inactivity is recognized.
|
|
23
|
+
*
|
|
24
|
+
* Treat the result as authoritative only when `status === 'FRESH'`.
|
|
25
|
+
* `PARTIAL` is an incomplete best-known count and `UNAVAILABLE` means no fresh
|
|
26
|
+
* observation exists; neither status is an authoritative zero. `appId` and
|
|
27
|
+
* the monotonic `revision` are generated `BigInt` scalars represented as
|
|
28
|
+
* decimal strings.
|
|
29
|
+
*
|
|
30
|
+
* @param appId - App to count, as a decimal-string `BigInt`; it must match
|
|
31
|
+
* the app scope of the bearer token.
|
|
32
|
+
* @returns The generated snapshot payload: `appId`, `activePlayerCount`,
|
|
33
|
+
* `status`, nullable `observedAt`, and `revision`.
|
|
34
|
+
* @throws {CrowdyGraphQLError} `UNAUTHENTICATED` / `SCOPE_MISSING` when the
|
|
35
|
+
* token is missing or is not scoped to `appId`.
|
|
36
|
+
*/
|
|
37
|
+
async activePlayerCount(appId) {
|
|
38
|
+
const data = await this.gql.request(GameModelActivePlayerCountDocument, {
|
|
39
|
+
appId,
|
|
40
|
+
});
|
|
41
|
+
return data.gameModelActivePlayerCount;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* **Player-count subscription** — stream complete active-session count
|
|
45
|
+
* transitions for one app. Requires a bearer token scoped to exactly
|
|
46
|
+
* `variables.appId` and a game-api `wsUrl` in the client config.
|
|
47
|
+
*
|
|
48
|
+
* This stream counts gameplay **sessions**, not distinct users or actors;
|
|
49
|
+
* abandoned sessions can remain counted for approximately 120 seconds while
|
|
50
|
+
* inactivity is recognized. It emits no initial/bootstrap event, so establish
|
|
51
|
+
* the stream and then call {@link activePlayerCount} for the current snapshot.
|
|
52
|
+
* `PARTIAL` and `UNAVAILABLE` observations neither emit transitions nor
|
|
53
|
+
* represent an authoritative zero.
|
|
54
|
+
*
|
|
55
|
+
* Delivery is best-effort and may miss or repeat events across reconnects.
|
|
56
|
+
* Deduplicate by the decimal-string `revision`. Requery
|
|
57
|
+
* {@link activePlayerCount} after every reconnect or whenever revisions have
|
|
58
|
+
* a gap; the query is the source of truth.
|
|
59
|
+
*
|
|
60
|
+
* @param variables - Exact call shape `{ appId }`, where `appId` is the
|
|
61
|
+
* decimal-string `BigInt` matching the app-scoped bearer token.
|
|
62
|
+
* @param handlers - `next` per transition; optional `error`, `complete`, and
|
|
63
|
+
* `webSocketImpl` for runtimes without a global `WebSocket`.
|
|
64
|
+
* @returns An unsubscribe function that disposes this subscription and its
|
|
65
|
+
* graphql-transport-ws client.
|
|
66
|
+
* @throws {Error} Synchronously when the client config has no `wsUrl`.
|
|
67
|
+
*/
|
|
68
|
+
activePlayerCountChanged(variables, handlers) {
|
|
69
|
+
if (!this.ws?.wsUrl) {
|
|
70
|
+
throw new Error('activePlayerCountChanged requires a wsUrl in the client config (graphql-transport-ws endpoint)');
|
|
71
|
+
}
|
|
72
|
+
const client = createWsClient({
|
|
73
|
+
url: this.ws.wsUrl,
|
|
74
|
+
lazy: false,
|
|
75
|
+
retryAttempts: 8,
|
|
76
|
+
...(handlers.webSocketImpl
|
|
77
|
+
? { webSocketImpl: handlers.webSocketImpl }
|
|
78
|
+
: {}),
|
|
79
|
+
connectionParams: () => {
|
|
80
|
+
const token = this.ws?.getToken();
|
|
81
|
+
return token ? { Authorization: `Bearer ${token}` } : {};
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
const dispose = client.subscribe({ query: print(GameModelActivePlayerCountChangedDocument), variables }, {
|
|
85
|
+
next: (msg) => {
|
|
86
|
+
const data = msg.data;
|
|
87
|
+
if (data?.gameModelActivePlayerCountChanged) {
|
|
88
|
+
handlers.next(data.gameModelActivePlayerCountChanged);
|
|
89
|
+
}
|
|
90
|
+
else if (msg.errors) {
|
|
91
|
+
handlers.error?.(msg.errors);
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
error: (err) => handlers.error?.(err),
|
|
95
|
+
complete: () => handlers.complete?.(),
|
|
96
|
+
});
|
|
97
|
+
return () => {
|
|
98
|
+
dispose();
|
|
99
|
+
void client.dispose();
|
|
100
|
+
};
|
|
101
|
+
}
|
|
15
102
|
/**
|
|
16
103
|
* **Subscriptions** — stream container-change notifications for an app
|
|
17
104
|
* (`gameModelContainerChanged`): an invoke mutated a container, a direct
|
package/dist/domains/usage.d.ts
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import type { GraphQLClient } from '../client.js';
|
|
2
|
-
import { type
|
|
2
|
+
import { type AppGraphqlOperationsQuery, type AppUsageSummaryQuery, type PlayerPulseQuery } from '../generated/graphql.js';
|
|
3
3
|
/**
|
|
4
4
|
* Replication + GraphQL usage reporting — exposed as `client.usage` (and
|
|
5
5
|
* grouped under `client.admin`).
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* All operations are read-only observability and require the `view_usage` org
|
|
8
|
+
* permission. `since` args are ISO-8601 `DateTime` strings; byte/message
|
|
9
|
+
* counters are returned as string counters because they can exceed the 32-bit
|
|
10
|
+
* Int range. `BigInt` ids are decimal strings.
|
|
11
|
+
*
|
|
12
|
+
* As of the unified galaxy API the per-environment rollups
|
|
13
|
+
* (environmentSummary/orgByEnvironment/environmentByApp) were retired with
|
|
14
|
+
* dedicated customer environments — usage is org/app-scoped.
|
|
11
15
|
*
|
|
12
16
|
* @throws {CrowdyGraphQLError} `UNAUTHENTICATED` / `FORBIDDEN` / `SCOPE_MISSING`
|
|
13
17
|
* per the permission notes above.
|
|
@@ -15,33 +19,6 @@ import { type EnvironmentUsageSummaryQuery, type OrgUsageByEnvironmentQuery, typ
|
|
|
15
19
|
export declare class UsageAPI {
|
|
16
20
|
private readonly management;
|
|
17
21
|
constructor(management: GraphQLClient);
|
|
18
|
-
/**
|
|
19
|
-
* Per-minute replication + GraphQL usage time series for one environment,
|
|
20
|
-
* with rate peaks and live Buddy rates.
|
|
21
|
-
*
|
|
22
|
-
* @param orgId - Numeric org id.
|
|
23
|
-
* @param environmentSlug - Environment slug to report on.
|
|
24
|
-
* @param since - Start of the window (ISO-8601 DateTime) up to now.
|
|
25
|
-
* @returns The {@link EnvironmentUsageSummary}.
|
|
26
|
-
*/
|
|
27
|
-
environmentSummary(orgId: string, environmentSlug: string, since: string): Promise<EnvironmentUsageSummaryQuery['environmentUsageSummary']>;
|
|
28
|
-
/**
|
|
29
|
-
* Aggregate byte totals per environment across an org for a window.
|
|
30
|
-
*
|
|
31
|
-
* @param orgId - Numeric org id.
|
|
32
|
-
* @param since - Start of the window (ISO-8601 DateTime) up to now.
|
|
33
|
-
* @returns One rollup row per environment.
|
|
34
|
-
*/
|
|
35
|
-
orgByEnvironment(orgId: string, since: string): Promise<OrgUsageByEnvironmentQuery['orgUsageByEnvironment']>;
|
|
36
|
-
/**
|
|
37
|
-
* Aggregate byte totals per app for the apps linked to an environment.
|
|
38
|
-
*
|
|
39
|
-
* @param orgId - Numeric org id.
|
|
40
|
-
* @param environmentSlug - Environment slug whose apps to roll up.
|
|
41
|
-
* @param since - Start of the window (ISO-8601 DateTime) up to now.
|
|
42
|
-
* @returns One rollup row per app.
|
|
43
|
-
*/
|
|
44
|
-
environmentByApp(orgId: string, environmentSlug: string, since: string): Promise<EnvironmentUsageByAppQuery['environmentUsageByApp']>;
|
|
45
22
|
/**
|
|
46
23
|
* Top GraphQL operations for an app ranked by bytes.
|
|
47
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,
|
|
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,UAAU;gBAAV,UAAU,EAAE,aAAa;IAEtD;;;;;;;;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"}
|