@crowdedkingdoms/crowdyjs 18.23.1-test.1 → 18.24.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MIGRATION.md +62 -0
- package/README.md +135 -14
- package/dist/crowdy-client.d.ts +10 -1
- package/dist/crowdy-client.d.ts.map +1 -1
- package/dist/crowdy-client.js +5 -0
- package/dist/default-origin.d.ts +6 -6
- package/dist/default-origin.d.ts.map +1 -1
- package/dist/default-origin.js +6 -6
- package/dist/domains/admin.d.ts +4 -0
- package/dist/domains/admin.d.ts.map +1 -1
- package/dist/domains/admin.js +1 -0
- package/dist/domains/apps.d.ts +43 -3
- package/dist/domains/apps.d.ts.map +1 -1
- package/dist/domains/apps.js +46 -3
- package/dist/domains/auth.d.ts +140 -16
- package/dist/domains/auth.d.ts.map +1 -1
- package/dist/domains/auth.js +153 -16
- package/dist/domains/inputLog.d.ts +4 -1
- package/dist/domains/inputLog.d.ts.map +1 -1
- package/dist/domains/inputLog.js +4 -1
- package/dist/domains/managedPlayers.d.ts +56 -3
- package/dist/domains/managedPlayers.d.ts.map +1 -1
- package/dist/domains/managedPlayers.js +16 -3
- package/dist/domains/moderation.d.ts +53 -0
- package/dist/domains/moderation.d.ts.map +1 -0
- package/dist/domains/moderation.js +68 -0
- package/dist/domains/platform.d.ts +13 -0
- package/dist/domains/platform.d.ts.map +1 -1
- package/dist/domains/platform.js +14 -0
- package/dist/domains/portal.d.ts +86 -8
- package/dist/domains/portal.d.ts.map +1 -1
- package/dist/domains/portal.js +78 -8
- package/dist/domains/safety.d.ts +163 -0
- package/dist/domains/safety.d.ts.map +1 -0
- package/dist/domains/safety.js +167 -0
- package/dist/domains/users.d.ts +9 -1
- package/dist/domains/users.d.ts.map +1 -1
- package/dist/domains/users.js +9 -1
- package/dist/errors.d.ts +135 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +163 -0
- package/dist/generated/graphql-schema.d.ts +522 -14
- package/dist/generated/graphql-schema.d.ts.map +1 -1
- package/dist/generated/graphql-schema.js +64 -0
- package/dist/generated/graphql.d.ts +375 -0
- package/dist/generated/graphql.d.ts.map +1 -1
- package/dist/generated/graphql.js +24 -3
- package/dist/index.d.ts +12 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -4
- package/dist/live-coding/assets/browser-authoring-index.json +1 -1
- package/dist/live-coding/assets/manifest.json +1 -1
- package/dist/live-coding/browser-authoring-index.generated.d.ts.map +1 -1
- package/dist/live-coding/browser-authoring-index.generated.js +265 -6
- package/package.json +1 -1
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import type { GraphQLClient } from '../client.js';
|
|
2
|
+
import { type MyCommSettingsQuery, type RequestParentalConsentMutation, type MyContactsQuery, type ContactRequestsQuery, type MyBlocksQuery, type FileSafetyReportMutation } from '../generated/graphql.js';
|
|
3
|
+
/**
|
|
4
|
+
* Who a medium reaches (send) or is heard from (receive): `OFF` nobody, `CONTACTS` only the
|
|
5
|
+
* player's accepted contacts in the app, `EVERYONE` anyone the app's own rules allow.
|
|
6
|
+
*/
|
|
7
|
+
export type CommScopeValue = 'OFF' | 'CONTACTS' | 'EVERYONE';
|
|
8
|
+
/** What a parent consents to for a player under 18: voice (with channel audio) or webcam video. */
|
|
9
|
+
export type ParentalConsentFeatureValue = 'VOICE' | 'VIDEO';
|
|
10
|
+
/** Why a player is reported. `CHILD_SAFETY` reports come first in the moderation queue. */
|
|
11
|
+
export type SafetyReportReasonValue = 'CHILD_SAFETY' | 'HARASSMENT' | 'SEXUAL_CONTENT' | 'HATE' | 'SELF_HARM' | 'CHEATING' | 'OTHER';
|
|
12
|
+
/** The player's choices for {@link SafetyAPI.setCommSettings}; a field left out keeps its choice. */
|
|
13
|
+
export interface CommChoicesInput {
|
|
14
|
+
/** Whom the player's voice may reach. */
|
|
15
|
+
voiceSend?: CommScopeValue;
|
|
16
|
+
/** Whose voice the player may hear. */
|
|
17
|
+
voiceReceive?: CommScopeValue;
|
|
18
|
+
/** Whom the player's video may reach. */
|
|
19
|
+
videoSend?: CommScopeValue;
|
|
20
|
+
/** Whose video the player may see. */
|
|
21
|
+
videoReceive?: CommScopeValue;
|
|
22
|
+
}
|
|
23
|
+
/** A report for {@link SafetyAPI.fileReport}. */
|
|
24
|
+
export interface SafetyReportFiling {
|
|
25
|
+
/** The app both players are in. */
|
|
26
|
+
appId: string;
|
|
27
|
+
/** The player reported (`BigInt` as a decimal string). */
|
|
28
|
+
reportedUserId: string;
|
|
29
|
+
/**
|
|
30
|
+
* The reported player's actor, when the client knows it: the 32 hex digits the realtime
|
|
31
|
+
* wire uses (as `generateCrowdyUuid` makes them). Leave it out otherwise; any other form is
|
|
32
|
+
* refused with `BAD_USER_INPUT`.
|
|
33
|
+
*/
|
|
34
|
+
reportedActorUuid?: string;
|
|
35
|
+
reason: SafetyReportReasonValue;
|
|
36
|
+
/** What happened, in the reporter's words: at most 1,000 characters. */
|
|
37
|
+
details?: string;
|
|
38
|
+
/**
|
|
39
|
+
* When it happened, within the past year (an ISO-8601 string or a `Date`). The report
|
|
40
|
+
* covers both players' recorded sessions from 15 minutes before it to the filing.
|
|
41
|
+
*/
|
|
42
|
+
occurredAt: string | Date;
|
|
43
|
+
}
|
|
44
|
+
/** {@link SafetyAPI.commSettings}: the effective scopes, the player's choices and the caps. */
|
|
45
|
+
export type PlayerCommSettings = MyCommSettingsQuery['myCommSettings'];
|
|
46
|
+
/** One accepted contact ({@link SafetyAPI.contacts}) or a request's answer. */
|
|
47
|
+
export type PlayerContactRecord = MyContactsQuery['myContacts'][number];
|
|
48
|
+
/** A contact request waiting for an answer ({@link SafetyAPI.contactRequests}). */
|
|
49
|
+
export type ContactRequestRecord = ContactRequestsQuery['contactRequests'][number];
|
|
50
|
+
/** A player the caller blocked ({@link SafetyAPI.blocks}). */
|
|
51
|
+
export type PlayerBlockRecord = MyBlocksQuery['myBlocks'][number];
|
|
52
|
+
/** {@link SafetyAPI.requestParentalConsent}'s answer. */
|
|
53
|
+
export type ParentalConsentRequestResult = RequestParentalConsentMutation['requestParentalConsent'];
|
|
54
|
+
/** {@link SafetyAPI.fileReport}'s receipt. */
|
|
55
|
+
export type SafetyReportReceiptRecord = FileSafetyReportMutation['fileSafetyReport'];
|
|
56
|
+
/**
|
|
57
|
+
* A player's own safety and communication controls in one app — exposed as `client.safety`
|
|
58
|
+
* (ck-api v2.60.0, the teen safety program).
|
|
59
|
+
*
|
|
60
|
+
* **Game plane.** Every call takes the app-scoped token for `appId` on the client built for
|
|
61
|
+
* the app (`portal.signIn`, `portal.mintAppToken`, or a managed player's token), as gameplay
|
|
62
|
+
* does; an identity session token is refused.
|
|
63
|
+
*
|
|
64
|
+
* What it controls, all enforced by the platform rather than by your client:
|
|
65
|
+
*
|
|
66
|
+
* - **Voice and video scopes** ({@link commSettings}, {@link setCommSettings}): for each of
|
|
67
|
+
* voice and video, whom the player sends to and hears from: `OFF`, `CONTACTS` or
|
|
68
|
+
* `EVERYONE`. The realtime servers enforce the EFFECTIVE scopes on both sides. A player
|
|
69
|
+
* can only ever lower them below what policy allows: an adult may choose anything
|
|
70
|
+
* (`EVERYONE` by default); a player under 18 has each medium `OFF` until a parent consents
|
|
71
|
+
* ({@link requestParentalConsent}) and then at most `CONTACTS`.
|
|
72
|
+
* - **Contacts** ({@link contacts}, {@link contactRequests}, {@link requestContact},
|
|
73
|
+
* {@link acceptContact}, {@link removeContact}): a mutual list per app. It is what a
|
|
74
|
+
* `CONTACTS` scope admits.
|
|
75
|
+
* - **Blocks** ({@link blocks}, {@link block}, {@link unblock}): nothing of any kind (voice,
|
|
76
|
+
* video, text, direct messages) passes between two players while either has blocked the
|
|
77
|
+
* other, both ways, and the blocked player is not told.
|
|
78
|
+
* - **Reports** ({@link fileReport}): the app's moderators read them (`client.moderation`).
|
|
79
|
+
*
|
|
80
|
+
* Every change that affects what reaches the player (scopes, contacts, blocks, a parent's
|
|
81
|
+
* consent) reaches its live sessions within a second. Ids are `BigInt` decimal strings.
|
|
82
|
+
* `SOCIAL_LIMIT_REACHED` ({@link socialLimitReachedOf}) refuses a request past the limits
|
|
83
|
+
* (100 waiting requests, 1,000 contacts and 1,000 blocks per app); `NOT_FOUND` names a player
|
|
84
|
+
* the app does not know.
|
|
85
|
+
*
|
|
86
|
+
* Show the player the notice and the recording indicator the app's safety log needs
|
|
87
|
+
* (`apps.recording(appId)`): what a player says and sends may be recorded for moderators.
|
|
88
|
+
*/
|
|
89
|
+
export declare class SafetyAPI {
|
|
90
|
+
private readonly api;
|
|
91
|
+
constructor(api: GraphQLClient);
|
|
92
|
+
/**
|
|
93
|
+
* The player's voice and video settings in the app: the effective scopes (`voiceSend`,
|
|
94
|
+
* `voiceReceive`, `videoSend`, `videoReceive`), what the player picked (`choices`, null
|
|
95
|
+
* where it kept the default), what policy allows now (`voiceAllowed`, `videoAllowed`),
|
|
96
|
+
* whether a parent consented (`voiceConsent`, `videoConsent`) and `isMinor`.
|
|
97
|
+
*/
|
|
98
|
+
commSettings(appId: string): Promise<PlayerCommSettings>;
|
|
99
|
+
/**
|
|
100
|
+
* Change the player's choices; fields left out keep theirs. A choice above what policy
|
|
101
|
+
* allows is kept and applies only up to the cap, so the effective scope can only go down.
|
|
102
|
+
* Returns the settings after the change.
|
|
103
|
+
*/
|
|
104
|
+
setCommSettings(appId: string, choices: CommChoicesInput): Promise<PlayerCommSettings>;
|
|
105
|
+
/**
|
|
106
|
+
* For a player under 18: ask a parent, through the platform's consent service, to allow
|
|
107
|
+
* one medium in this app. The service emails `parentEmail`; once the parent consents the
|
|
108
|
+
* medium opens, up to `CONTACTS`. Crowded Kingdoms does not store the address.
|
|
109
|
+
*
|
|
110
|
+
* `status` is `REQUESTED` (the email went out), `ALREADY_GRANTED` or `NOT_REQUIRED` (the
|
|
111
|
+
* player is 18 or over; nothing was sent). Refused with `PARENTAL_CONSENT_UNAVAILABLE`
|
|
112
|
+
* ({@link parentalConsentUnavailableOf}) while the service is not configured on the
|
|
113
|
+
* deployment, and `RATE_LIMITED` after three requests in an hour.
|
|
114
|
+
*/
|
|
115
|
+
requestParentalConsent(appId: string, feature: ParentalConsentFeatureValue, parentEmail: string): Promise<ParentalConsentRequestResult>;
|
|
116
|
+
/** The player's accepted contacts in the app, most recent first (at most 1,000). */
|
|
117
|
+
contacts(appId: string): Promise<PlayerContactRecord[]>;
|
|
118
|
+
/**
|
|
119
|
+
* Contact requests waiting in the app: `INCOMING` ones other players sent (answer with
|
|
120
|
+
* {@link acceptContact} or {@link removeContact}), then `OUTGOING` ones the player sent
|
|
121
|
+
* ({@link removeContact} cancels one), newest first.
|
|
122
|
+
*/
|
|
123
|
+
contactRequests(appId: string): Promise<ContactRequestRecord[]>;
|
|
124
|
+
/**
|
|
125
|
+
* Ask another player of the app to be a contact. `state` is `PENDING`, or `ACCEPTED` when
|
|
126
|
+
* they had already asked the player; asking again changes nothing. Refused while the player
|
|
127
|
+
* has blocked them ({@link unblock} first).
|
|
128
|
+
*/
|
|
129
|
+
requestContact(appId: string, userId: string): Promise<PlayerContactRecord>;
|
|
130
|
+
/** Accept another player's request: both become each other's contacts. `NOT_FOUND` when they have not asked. */
|
|
131
|
+
acceptContact(appId: string, userId: string): Promise<PlayerContactRecord>;
|
|
132
|
+
/**
|
|
133
|
+
* Remove a contact, decline the other player's request, or cancel the player's own:
|
|
134
|
+
* everything between the two in the app goes, both ways. False when there was nothing.
|
|
135
|
+
*/
|
|
136
|
+
removeContact(appId: string, userId: string): Promise<boolean>;
|
|
137
|
+
/** The players the player blocked in the app, most recent first (at most 1,000). */
|
|
138
|
+
blocks(appId: string): Promise<PlayerBlockRecord[]>;
|
|
139
|
+
/**
|
|
140
|
+
* Block another player of the app: nothing passes between the two, either way, on every
|
|
141
|
+
* session of both within a second, and the app's hubs can ask (`players.blocked`). Any
|
|
142
|
+
* contact or request between them goes too. The blocked player is not told, and its contact
|
|
143
|
+
* requests to the player are dropped. Blocking again changes nothing.
|
|
144
|
+
*/
|
|
145
|
+
block(appId: string, userId: string): Promise<PlayerBlockRecord>;
|
|
146
|
+
/**
|
|
147
|
+
* Lift a block the player set. A contact the block removed does not come back. False when
|
|
148
|
+
* there was no such block.
|
|
149
|
+
*/
|
|
150
|
+
unblock(appId: string, userId: string): Promise<boolean>;
|
|
151
|
+
/**
|
|
152
|
+
* Report another player of the app to its moderators. The report covers both players'
|
|
153
|
+
* recorded sessions (the app's safety log) from 15 minutes before `occurredAt` to now, and
|
|
154
|
+
* the platform preserves them with both identities for the moderators. The reported player
|
|
155
|
+
* is not told.
|
|
156
|
+
*
|
|
157
|
+
* Refused with `NOT_FOUND` for a player the app does not know, `BAD_USER_INPUT` for the
|
|
158
|
+
* player itself, `details` over 1,000 characters, an `occurredAt` outside the past year or
|
|
159
|
+
* an actor id that is not 32 hex digits, and `RATE_LIMITED` after 20 reports in an hour.
|
|
160
|
+
*/
|
|
161
|
+
fileReport(report: SafetyReportFiling): Promise<SafetyReportReceiptRecord>;
|
|
162
|
+
}
|
|
163
|
+
//# sourceMappingURL=safety.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safety.d.ts","sourceRoot":"","sources":["../../src/domains/safety.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAgBL,KAAK,mBAAmB,EACxB,KAAK,8BAA8B,EACnC,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC9B,MAAM,yBAAyB,CAAC;AAEjC;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,UAAU,GAAG,UAAU,CAAC;AAE7D,mGAAmG;AACnG,MAAM,MAAM,2BAA2B,GAAG,OAAO,GAAG,OAAO,CAAC;AAE5D,2FAA2F;AAC3F,MAAM,MAAM,uBAAuB,GAC/B,cAAc,GACd,YAAY,GACZ,gBAAgB,GAChB,MAAM,GACN,WAAW,GACX,UAAU,GACV,OAAO,CAAC;AAEZ,q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AAC,yBAAyB,CAAC;CAiBjF"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { MyCommSettingsDocument, SetMyCommSettingsDocument, RequestParentalConsentDocument, MyContactsDocument, ContactRequestsDocument, RequestContactDocument, AcceptContactDocument, RemoveContactDocument, MyBlocksDocument, BlockPlayerDocument, UnblockPlayerDocument, FileSafetyReportDocument, } from '../generated/graphql.js';
|
|
2
|
+
/**
|
|
3
|
+
* A player's own safety and communication controls in one app — exposed as `client.safety`
|
|
4
|
+
* (ck-api v2.60.0, the teen safety program).
|
|
5
|
+
*
|
|
6
|
+
* **Game plane.** Every call takes the app-scoped token for `appId` on the client built for
|
|
7
|
+
* the app (`portal.signIn`, `portal.mintAppToken`, or a managed player's token), as gameplay
|
|
8
|
+
* does; an identity session token is refused.
|
|
9
|
+
*
|
|
10
|
+
* What it controls, all enforced by the platform rather than by your client:
|
|
11
|
+
*
|
|
12
|
+
* - **Voice and video scopes** ({@link commSettings}, {@link setCommSettings}): for each of
|
|
13
|
+
* voice and video, whom the player sends to and hears from: `OFF`, `CONTACTS` or
|
|
14
|
+
* `EVERYONE`. The realtime servers enforce the EFFECTIVE scopes on both sides. A player
|
|
15
|
+
* can only ever lower them below what policy allows: an adult may choose anything
|
|
16
|
+
* (`EVERYONE` by default); a player under 18 has each medium `OFF` until a parent consents
|
|
17
|
+
* ({@link requestParentalConsent}) and then at most `CONTACTS`.
|
|
18
|
+
* - **Contacts** ({@link contacts}, {@link contactRequests}, {@link requestContact},
|
|
19
|
+
* {@link acceptContact}, {@link removeContact}): a mutual list per app. It is what a
|
|
20
|
+
* `CONTACTS` scope admits.
|
|
21
|
+
* - **Blocks** ({@link blocks}, {@link block}, {@link unblock}): nothing of any kind (voice,
|
|
22
|
+
* video, text, direct messages) passes between two players while either has blocked the
|
|
23
|
+
* other, both ways, and the blocked player is not told.
|
|
24
|
+
* - **Reports** ({@link fileReport}): the app's moderators read them (`client.moderation`).
|
|
25
|
+
*
|
|
26
|
+
* Every change that affects what reaches the player (scopes, contacts, blocks, a parent's
|
|
27
|
+
* consent) reaches its live sessions within a second. Ids are `BigInt` decimal strings.
|
|
28
|
+
* `SOCIAL_LIMIT_REACHED` ({@link socialLimitReachedOf}) refuses a request past the limits
|
|
29
|
+
* (100 waiting requests, 1,000 contacts and 1,000 blocks per app); `NOT_FOUND` names a player
|
|
30
|
+
* the app does not know.
|
|
31
|
+
*
|
|
32
|
+
* Show the player the notice and the recording indicator the app's safety log needs
|
|
33
|
+
* (`apps.recording(appId)`): what a player says and sends may be recorded for moderators.
|
|
34
|
+
*/
|
|
35
|
+
export class SafetyAPI {
|
|
36
|
+
constructor(api) {
|
|
37
|
+
this.api = api;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The player's voice and video settings in the app: the effective scopes (`voiceSend`,
|
|
41
|
+
* `voiceReceive`, `videoSend`, `videoReceive`), what the player picked (`choices`, null
|
|
42
|
+
* where it kept the default), what policy allows now (`voiceAllowed`, `videoAllowed`),
|
|
43
|
+
* whether a parent consented (`voiceConsent`, `videoConsent`) and `isMinor`.
|
|
44
|
+
*/
|
|
45
|
+
async commSettings(appId) {
|
|
46
|
+
const data = await this.api.request(MyCommSettingsDocument, { appId });
|
|
47
|
+
return data.myCommSettings;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Change the player's choices; fields left out keep theirs. A choice above what policy
|
|
51
|
+
* allows is kept and applies only up to the cap, so the effective scope can only go down.
|
|
52
|
+
* Returns the settings after the change.
|
|
53
|
+
*/
|
|
54
|
+
async setCommSettings(appId, choices) {
|
|
55
|
+
const input = {};
|
|
56
|
+
for (const key of ['voiceSend', 'voiceReceive', 'videoSend', 'videoReceive']) {
|
|
57
|
+
const value = choices[key];
|
|
58
|
+
if (value !== undefined)
|
|
59
|
+
input[key] = value;
|
|
60
|
+
}
|
|
61
|
+
const data = await this.api.request(SetMyCommSettingsDocument, { appId, input });
|
|
62
|
+
return data.setMyCommSettings;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* For a player under 18: ask a parent, through the platform's consent service, to allow
|
|
66
|
+
* one medium in this app. The service emails `parentEmail`; once the parent consents the
|
|
67
|
+
* medium opens, up to `CONTACTS`. Crowded Kingdoms does not store the address.
|
|
68
|
+
*
|
|
69
|
+
* `status` is `REQUESTED` (the email went out), `ALREADY_GRANTED` or `NOT_REQUIRED` (the
|
|
70
|
+
* player is 18 or over; nothing was sent). Refused with `PARENTAL_CONSENT_UNAVAILABLE`
|
|
71
|
+
* ({@link parentalConsentUnavailableOf}) while the service is not configured on the
|
|
72
|
+
* deployment, and `RATE_LIMITED` after three requests in an hour.
|
|
73
|
+
*/
|
|
74
|
+
async requestParentalConsent(appId, feature, parentEmail) {
|
|
75
|
+
const data = await this.api.request(RequestParentalConsentDocument, {
|
|
76
|
+
appId,
|
|
77
|
+
feature: feature,
|
|
78
|
+
parentEmail,
|
|
79
|
+
});
|
|
80
|
+
return data.requestParentalConsent;
|
|
81
|
+
}
|
|
82
|
+
/** The player's accepted contacts in the app, most recent first (at most 1,000). */
|
|
83
|
+
async contacts(appId) {
|
|
84
|
+
const data = await this.api.request(MyContactsDocument, { appId });
|
|
85
|
+
return data.myContacts;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Contact requests waiting in the app: `INCOMING` ones other players sent (answer with
|
|
89
|
+
* {@link acceptContact} or {@link removeContact}), then `OUTGOING` ones the player sent
|
|
90
|
+
* ({@link removeContact} cancels one), newest first.
|
|
91
|
+
*/
|
|
92
|
+
async contactRequests(appId) {
|
|
93
|
+
const data = await this.api.request(ContactRequestsDocument, { appId });
|
|
94
|
+
return data.contactRequests;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Ask another player of the app to be a contact. `state` is `PENDING`, or `ACCEPTED` when
|
|
98
|
+
* they had already asked the player; asking again changes nothing. Refused while the player
|
|
99
|
+
* has blocked them ({@link unblock} first).
|
|
100
|
+
*/
|
|
101
|
+
async requestContact(appId, userId) {
|
|
102
|
+
const data = await this.api.request(RequestContactDocument, { appId, userId });
|
|
103
|
+
return data.requestContact;
|
|
104
|
+
}
|
|
105
|
+
/** Accept another player's request: both become each other's contacts. `NOT_FOUND` when they have not asked. */
|
|
106
|
+
async acceptContact(appId, userId) {
|
|
107
|
+
const data = await this.api.request(AcceptContactDocument, { appId, userId });
|
|
108
|
+
return data.acceptContact;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Remove a contact, decline the other player's request, or cancel the player's own:
|
|
112
|
+
* everything between the two in the app goes, both ways. False when there was nothing.
|
|
113
|
+
*/
|
|
114
|
+
async removeContact(appId, userId) {
|
|
115
|
+
const data = await this.api.request(RemoveContactDocument, { appId, userId });
|
|
116
|
+
return data.removeContact;
|
|
117
|
+
}
|
|
118
|
+
/** The players the player blocked in the app, most recent first (at most 1,000). */
|
|
119
|
+
async blocks(appId) {
|
|
120
|
+
const data = await this.api.request(MyBlocksDocument, { appId });
|
|
121
|
+
return data.myBlocks;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Block another player of the app: nothing passes between the two, either way, on every
|
|
125
|
+
* session of both within a second, and the app's hubs can ask (`players.blocked`). Any
|
|
126
|
+
* contact or request between them goes too. The blocked player is not told, and its contact
|
|
127
|
+
* requests to the player are dropped. Blocking again changes nothing.
|
|
128
|
+
*/
|
|
129
|
+
async block(appId, userId) {
|
|
130
|
+
const data = await this.api.request(BlockPlayerDocument, { appId, userId });
|
|
131
|
+
return data.blockPlayer;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Lift a block the player set. A contact the block removed does not come back. False when
|
|
135
|
+
* there was no such block.
|
|
136
|
+
*/
|
|
137
|
+
async unblock(appId, userId) {
|
|
138
|
+
const data = await this.api.request(UnblockPlayerDocument, { appId, userId });
|
|
139
|
+
return data.unblockPlayer;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Report another player of the app to its moderators. The report covers both players'
|
|
143
|
+
* recorded sessions (the app's safety log) from 15 minutes before `occurredAt` to now, and
|
|
144
|
+
* the platform preserves them with both identities for the moderators. The reported player
|
|
145
|
+
* is not told.
|
|
146
|
+
*
|
|
147
|
+
* Refused with `NOT_FOUND` for a player the app does not know, `BAD_USER_INPUT` for the
|
|
148
|
+
* player itself, `details` over 1,000 characters, an `occurredAt` outside the past year or
|
|
149
|
+
* an actor id that is not 32 hex digits, and `RATE_LIMITED` after 20 reports in an hour.
|
|
150
|
+
*/
|
|
151
|
+
async fileReport(report) {
|
|
152
|
+
const occurredAt = report.occurredAt instanceof Date ? report.occurredAt.toISOString() : report.occurredAt;
|
|
153
|
+
const data = await this.api.request(FileSafetyReportDocument, {
|
|
154
|
+
input: {
|
|
155
|
+
appId: report.appId,
|
|
156
|
+
reportedUserId: report.reportedUserId,
|
|
157
|
+
reason: report.reason,
|
|
158
|
+
occurredAt,
|
|
159
|
+
...(report.reportedActorUuid !== undefined
|
|
160
|
+
? { reportedActorUuid: report.reportedActorUuid }
|
|
161
|
+
: {}),
|
|
162
|
+
...(report.details !== undefined ? { details: report.details } : {}),
|
|
163
|
+
},
|
|
164
|
+
});
|
|
165
|
+
return data.fileSafetyReport;
|
|
166
|
+
}
|
|
167
|
+
}
|
package/dist/domains/users.d.ts
CHANGED
|
@@ -25,6 +25,12 @@ export declare class UsersAPI {
|
|
|
25
25
|
* Validate the current bearer token and return the authenticated user record.
|
|
26
26
|
* Handy for restoring a session on SDK init.
|
|
27
27
|
*
|
|
28
|
+
* `ageBracket` is `unknown` until the player gives an age (`auth.recordPlayerAge`; a
|
|
29
|
+
* managed player's comes from its organization), then `under_13`, `13_15`, `16_17` or
|
|
30
|
+
* `18_plus`; `country` is the declared or asserted country (ck-api v2.60.0, which this
|
|
31
|
+
* selection needs). Use them for your logic, never as text: no screen shows a player an
|
|
32
|
+
* age.
|
|
33
|
+
*
|
|
28
34
|
* @returns The {@link User}, or `null` if the token is missing, expired, or
|
|
29
35
|
* revoked (an invalid token resolves to `null` rather than throwing).
|
|
30
36
|
* @throws {CrowdyGraphQLError} on transport/validation failures.
|
|
@@ -49,7 +55,9 @@ export declare class UsersAPI {
|
|
|
49
55
|
* **Destructive, self-service** soft-delete of the caller's **own** account:
|
|
50
56
|
* anonymizes PII and revokes all sessions. Wallet, voxel, and donation history
|
|
51
57
|
* stay intact via foreign keys. Acts only on the caller (no target argument).
|
|
52
|
-
* Requires a valid session.
|
|
58
|
+
* Requires a valid session. Since ck-api v2.60.0 an open or escalated safety
|
|
59
|
+
* report about the account puts it under a legal hold first: the account still
|
|
60
|
+
* closes, but its content and identity are kept until the report is resolved.
|
|
53
61
|
*
|
|
54
62
|
* @returns `true` on success.
|
|
55
63
|
* @throws {CrowdyGraphQLError} `UNAUTHENTICATED` without a session, or
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../src/domains/users.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EASL,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,OAAO,EACZ,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,SAAS,EACd,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACzB,MAAM,yBAAyB,CAAC;AAEjC,kEAAkE;AAClE,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,QAAQ;IACP,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,aAAa;IAEnD
|
|
1
|
+
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../src/domains/users.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EASL,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,OAAO,EACZ,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,SAAS,EACd,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACzB,MAAM,yBAAyB,CAAC;AAEjC,kEAAkE;AAClE,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,QAAQ;IACP,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,aAAa;IAEnD;;;;;;;;;;;;;OAaG;IACG,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAKlC;;;;;;;;;;;;;OAaG;IACG,cAAc,CAClB,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,sBAAsB,CAAC,gBAAgB,CAAC,CAAC;IAKpD;;;;;;;;;;;OAWG;IACG,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC;IAKzC;;;;;OAKG;IACG,cAAc,IAAI,OAAO,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;IAK1E;;;;;;;;OAQG;IACG,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAKjD;;;;;;OAMG;IACG,aAAa,CACjB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC;IAK/C;;;;;;OAMG;IACG,cAAc,CAClB,OAAO,EAAE,MAAM,EAAE,GAChB,OAAO,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IAWjD;;;;;;OAMG;IACG,WAAW,CACf,KAAK,EAAE,oBAAoB,GAC1B,OAAO,CAAC,uBAAuB,CAAC,iBAAiB,CAAC,CAAC;CAIvD"}
|
package/dist/domains/users.js
CHANGED
|
@@ -25,6 +25,12 @@ export class UsersAPI {
|
|
|
25
25
|
* Validate the current bearer token and return the authenticated user record.
|
|
26
26
|
* Handy for restoring a session on SDK init.
|
|
27
27
|
*
|
|
28
|
+
* `ageBracket` is `unknown` until the player gives an age (`auth.recordPlayerAge`; a
|
|
29
|
+
* managed player's comes from its organization), then `under_13`, `13_15`, `16_17` or
|
|
30
|
+
* `18_plus`; `country` is the declared or asserted country (ck-api v2.60.0, which this
|
|
31
|
+
* selection needs). Use them for your logic, never as text: no screen shows a player an
|
|
32
|
+
* age.
|
|
33
|
+
*
|
|
28
34
|
* @returns The {@link User}, or `null` if the token is missing, expired, or
|
|
29
35
|
* revoked (an invalid token resolves to `null` rather than throwing).
|
|
30
36
|
* @throws {CrowdyGraphQLError} on transport/validation failures.
|
|
@@ -55,7 +61,9 @@ export class UsersAPI {
|
|
|
55
61
|
* **Destructive, self-service** soft-delete of the caller's **own** account:
|
|
56
62
|
* anonymizes PII and revokes all sessions. Wallet, voxel, and donation history
|
|
57
63
|
* stay intact via foreign keys. Acts only on the caller (no target argument).
|
|
58
|
-
* Requires a valid session.
|
|
64
|
+
* Requires a valid session. Since ck-api v2.60.0 an open or escalated safety
|
|
65
|
+
* report about the account puts it under a legal hold first: the account still
|
|
66
|
+
* closes, but its content and identity are kept until the report is resolved.
|
|
59
67
|
*
|
|
60
68
|
* @returns `true` on success.
|
|
61
69
|
* @throws {CrowdyGraphQLError} `UNAUTHENTICATED` without a session, or
|
package/dist/errors.d.ts
CHANGED
|
@@ -284,6 +284,66 @@ export declare const ASSERTION_REJECTED_CODE = "ASSERTION_REJECTED";
|
|
|
284
284
|
* provisioning; see {@link orgLegalAcceptanceRequiredOf}.
|
|
285
285
|
*/
|
|
286
286
|
export declare const ORG_LEGAL_ACCEPTANCE_REQUIRED_CODE = "ORG_LEGAL_ACCEPTANCE_REQUIRED";
|
|
287
|
+
/**
|
|
288
|
+
* `extensions.code` for "the player has not accepted the current required documents" (HTTP
|
|
289
|
+
* 403): the platform's player documents or the app's own, listed in
|
|
290
|
+
* `extensions.missingDocuments`; see {@link legalAcceptanceRequiredOf}.
|
|
291
|
+
*/
|
|
292
|
+
export declare const LEGAL_ACCEPTANCE_REQUIRED_CODE = "LEGAL_ACCEPTANCE_REQUIRED";
|
|
293
|
+
/**
|
|
294
|
+
* `extensions.code` for "the player's age is not known" (HTTP 403), at a token's mint or
|
|
295
|
+
* refresh, or the developer documents for an account with no age; see {@link ageRequiredOf}.
|
|
296
|
+
*/
|
|
297
|
+
export declare const AGE_REQUIRED_CODE = "AGE_REQUIRED";
|
|
298
|
+
/**
|
|
299
|
+
* `extensions.code` for "the player may not play this" by age (HTTP 403); see
|
|
300
|
+
* {@link ageRequirementNotMetOf}.
|
|
301
|
+
*/
|
|
302
|
+
export declare const AGE_REQUIREMENT_NOT_MET_CODE = "AGE_REQUIREMENT_NOT_MET";
|
|
303
|
+
/**
|
|
304
|
+
* `extensions.code` for "Crowded Kingdoms does not serve the player's country" (HTTP 403); see
|
|
305
|
+
* {@link territoryNotSupportedOf}.
|
|
306
|
+
*/
|
|
307
|
+
export declare const TERRITORY_NOT_SUPPORTED_CODE = "TERRITORY_NOT_SUPPORTED";
|
|
308
|
+
/**
|
|
309
|
+
* `extensions.code` for "the app does not keep the safety log where it must" (HTTP 403); see
|
|
310
|
+
* {@link safetyLogRequiredOf}.
|
|
311
|
+
*/
|
|
312
|
+
export declare const SAFETY_LOG_REQUIRED_CODE = "SAFETY_LOG_REQUIRED";
|
|
313
|
+
/**
|
|
314
|
+
* `extensions.code` for "parental consent cannot be requested on this deployment" (HTTP 503);
|
|
315
|
+
* see {@link parentalConsentUnavailableOf}.
|
|
316
|
+
*/
|
|
317
|
+
export declare const PARENTAL_CONSENT_UNAVAILABLE_CODE = "PARENTAL_CONSENT_UNAVAILABLE";
|
|
318
|
+
/**
|
|
319
|
+
* `extensions.code` for "the player has as many contacts, waiting requests or blocks in the app
|
|
320
|
+
* as the platform allows" (HTTP 409); see {@link socialLimitReachedOf}.
|
|
321
|
+
*/
|
|
322
|
+
export declare const SOCIAL_LIMIT_REACHED_CODE = "SOCIAL_LIMIT_REACHED";
|
|
323
|
+
/**
|
|
324
|
+
* `extensions.code` for "the Minecraft account could not be confirmed" (HTTP 401), with the
|
|
325
|
+
* failed check in `extensions.reason`; see {@link minecraftVerificationFailedOf}.
|
|
326
|
+
*/
|
|
327
|
+
export declare const MINECRAFT_VERIFICATION_FAILED_CODE = "MINECRAFT_VERIFICATION_FAILED";
|
|
328
|
+
/**
|
|
329
|
+
* `extensions.code` for "Mojang's session service did not answer" (HTTP 503, retryable); see
|
|
330
|
+
* {@link minecraftVerificationUnavailableOf}.
|
|
331
|
+
*/
|
|
332
|
+
export declare const MINECRAFT_VERIFICATION_UNAVAILABLE_CODE = "MINECRAFT_VERIFICATION_UNAVAILABLE";
|
|
333
|
+
/**
|
|
334
|
+
* Why a Minecraft sign-in was not confirmed, as `extensions.reason` carries it. Open union:
|
|
335
|
+
* the server may add one.
|
|
336
|
+
*/
|
|
337
|
+
export type MinecraftVerificationFailure = 'malformed' | 'forged' | 'expired' | 'not_joined' | 'replayed' | (string & {});
|
|
338
|
+
/** One document a refused player still has to accept, from `extensions.missingDocuments`. */
|
|
339
|
+
export interface MissingLegalDocument {
|
|
340
|
+
/** The document's stable id, such as `player-terms` or an app's own `rules`. */
|
|
341
|
+
documentId: string;
|
|
342
|
+
/** The version the player has to accept. */
|
|
343
|
+
version: string;
|
|
344
|
+
/** The app whose own document it is; null for a platform document. */
|
|
345
|
+
appId: string | null;
|
|
346
|
+
}
|
|
287
347
|
/**
|
|
288
348
|
* Why an app is paused, as `extensions.reason` on `APP_PAUSED` and
|
|
289
349
|
* `AppRuntimeGate.reason` carry it. Open union: the server may add one.
|
|
@@ -347,6 +407,81 @@ export declare function assertionRejectedOf(value: unknown): {
|
|
|
347
407
|
* player never gets.
|
|
348
408
|
*/
|
|
349
409
|
export declare function orgLegalAcceptanceRequiredOf(value: unknown): boolean;
|
|
410
|
+
/**
|
|
411
|
+
* A `LEGAL_ACCEPTANCE_REQUIRED` refusal (HTTP 403), or `null`. `missingDocuments` is what the
|
|
412
|
+
* player still has to accept: the platform's player documents (`appId` null) and the app's own
|
|
413
|
+
* (`appId` set). Show those documents, then record the player's agreement
|
|
414
|
+
* (`auth.recordPlayerConsents`, with the app's `appId` for its own); a browser game sends the
|
|
415
|
+
* player back through `portal.signIn`, where Studio asks. Empty when the server did not list
|
|
416
|
+
* them (an older API, or a refused `register` or `recordPlayerConsents`). Not fixed by retrying.
|
|
417
|
+
* Distinct from the organization's `ORG_LEGAL_ACCEPTANCE_REQUIRED`
|
|
418
|
+
* ({@link orgLegalAcceptanceRequiredOf}).
|
|
419
|
+
*/
|
|
420
|
+
export declare function legalAcceptanceRequiredOf(value: unknown): {
|
|
421
|
+
missingDocuments: MissingLegalDocument[];
|
|
422
|
+
} | null;
|
|
423
|
+
/**
|
|
424
|
+
* Whether an error is an `AGE_REQUIRED` refusal (HTTP 403): the player's age is not known.
|
|
425
|
+
* For an account, ask the player's birth date and country on your own neutral screen and call
|
|
426
|
+
* `auth.recordPlayerAge`, then mint again; a browser game sends the player back through
|
|
427
|
+
* `portal.signIn`, where Studio asks. For an org-managed player, the organization sends
|
|
428
|
+
* `ageYears` and `country` when it signs the player in. Not fixed by retrying as is.
|
|
429
|
+
*/
|
|
430
|
+
export declare function ageRequiredOf(value: unknown): boolean;
|
|
431
|
+
/**
|
|
432
|
+
* Whether an error is an `AGE_REQUIREMENT_NOT_MET` refusal (HTTP 403): by age, the player may
|
|
433
|
+
* not play this app, or create or administer an organization. Not retryable, and asking for
|
|
434
|
+
* the age again changes nothing: an account keeps the answer it gave.
|
|
435
|
+
*
|
|
436
|
+
* Deliberately a boolean. No refusal names an age (the platform's neutral age screen): tell the
|
|
437
|
+
* player they cannot play this, without naming an age or a minimum, and do not offer to enter
|
|
438
|
+
* the date again. Older APIs put `minimumAge` and `ageBracket` in the extensions; this reader
|
|
439
|
+
* does not surface them, and a game must not show them.
|
|
440
|
+
*/
|
|
441
|
+
export declare function ageRequirementNotMetOf(value: unknown): boolean;
|
|
442
|
+
/**
|
|
443
|
+
* A `TERRITORY_NOT_SUPPORTED` refusal (HTTP 403), or `null`: Crowded Kingdoms does not serve
|
|
444
|
+
* the player's country (the one they connect from, the one they declared, or the one their
|
|
445
|
+
* organization asserted). `country` is `extensions.country` (ISO 3166-1 alpha-2), null when the
|
|
446
|
+
* server did not say. Not retryable; tell the player it is not available where they are.
|
|
447
|
+
*/
|
|
448
|
+
export declare function territoryNotSupportedOf(value: unknown): {
|
|
449
|
+
country: string | null;
|
|
450
|
+
} | null;
|
|
451
|
+
/**
|
|
452
|
+
* Whether an error is a `SAFETY_LOG_REQUIRED` refusal (HTTP 403): the app does not keep the
|
|
453
|
+
* safety log (replay logging) where it must. A player under 18 gets it at the mint of an app
|
|
454
|
+
* without one, and an app admitting players under 18 cannot turn its log off. The player
|
|
455
|
+
* cannot fix it: the app's admins turn the log on (`apps.update`) or raise its minimum age.
|
|
456
|
+
*/
|
|
457
|
+
export declare function safetyLogRequiredOf(value: unknown): boolean;
|
|
458
|
+
/**
|
|
459
|
+
* Whether an error is a `PARENTAL_CONSENT_UNAVAILABLE` refusal (HTTP 503) from
|
|
460
|
+
* `safety.requestParentalConsent`: the deployment's consent service is not configured. Not
|
|
461
|
+
* fixed by retrying soon; voice and video stay off for the player meanwhile.
|
|
462
|
+
*/
|
|
463
|
+
export declare function parentalConsentUnavailableOf(value: unknown): boolean;
|
|
464
|
+
/**
|
|
465
|
+
* Whether an error is a `SOCIAL_LIMIT_REACHED` refusal (HTTP 409): the player already has as
|
|
466
|
+
* many contacts, waiting contact requests or blocks in the app as the platform allows (the
|
|
467
|
+
* message says which). Remove some first; not fixed by retrying.
|
|
468
|
+
*/
|
|
469
|
+
export declare function socialLimitReachedOf(value: unknown): boolean;
|
|
470
|
+
/**
|
|
471
|
+
* A `MINECRAFT_VERIFICATION_FAILED` refusal (HTTP 401) from `portal.signInWithMinecraft`, or
|
|
472
|
+
* `null`. `reason` is `extensions.reason`: `malformed`, `forged`, `expired`, `not_joined` or
|
|
473
|
+
* `replayed`. Never resend the same server id: ask for a new challenge
|
|
474
|
+
* (`portal.minecraftChallenge`) and join it again.
|
|
475
|
+
*/
|
|
476
|
+
export declare function minecraftVerificationFailedOf(value: unknown): {
|
|
477
|
+
reason: MinecraftVerificationFailure | null;
|
|
478
|
+
} | null;
|
|
479
|
+
/**
|
|
480
|
+
* Whether an error is a `MINECRAFT_VERIFICATION_UNAVAILABLE` refusal (HTTP 503): Mojang's
|
|
481
|
+
* session service did not answer, so the account was not confirmed. Retryable shortly, with a
|
|
482
|
+
* new challenge.
|
|
483
|
+
*/
|
|
484
|
+
export declare function minecraftVerificationUnavailableOf(value: unknown): boolean;
|
|
350
485
|
/**
|
|
351
486
|
* An `APP_PAUSED` refusal (HTTP 403: the app's runtime gate is not ACTIVE), or
|
|
352
487
|
* `null`. `reason` is `extensions.reason`. Show the player that the world is
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,iFAAiF;AACjF,MAAM,WAAW,yBAAyB;IACxC,mFAAmF;IACnF,OAAO,EAAE,MAAM,CAAC;IAChB,gFAAgF;IAChF,SAAS,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAC/B,2EAA2E;IAC3E,IAAI,CAAC,EAAE,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IACpC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED,oEAAoE;AACpE,MAAM,WAAW,kBAAkB;IACjC,4CAA4C;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,uEAAuE;IACvE,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;GAIG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACpC,yDAAyD;IACzD,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAA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