@crowdedkingdoms/crowdyjs 18.23.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.
Files changed (55) hide show
  1. package/MIGRATION.md +62 -0
  2. package/README.md +153 -28
  3. package/dist/crowdy-client.d.ts +10 -1
  4. package/dist/crowdy-client.d.ts.map +1 -1
  5. package/dist/crowdy-client.js +5 -0
  6. package/dist/default-origin.d.ts +6 -6
  7. package/dist/default-origin.d.ts.map +1 -1
  8. package/dist/default-origin.js +6 -6
  9. package/dist/domains/admin.d.ts +4 -0
  10. package/dist/domains/admin.d.ts.map +1 -1
  11. package/dist/domains/admin.js +1 -0
  12. package/dist/domains/apps.d.ts +43 -3
  13. package/dist/domains/apps.d.ts.map +1 -1
  14. package/dist/domains/apps.js +46 -3
  15. package/dist/domains/auth.d.ts +140 -16
  16. package/dist/domains/auth.d.ts.map +1 -1
  17. package/dist/domains/auth.js +153 -16
  18. package/dist/domains/inputLog.d.ts +4 -1
  19. package/dist/domains/inputLog.d.ts.map +1 -1
  20. package/dist/domains/inputLog.js +4 -1
  21. package/dist/domains/managedPlayers.d.ts +56 -3
  22. package/dist/domains/managedPlayers.d.ts.map +1 -1
  23. package/dist/domains/managedPlayers.js +16 -3
  24. package/dist/domains/moderation.d.ts +53 -0
  25. package/dist/domains/moderation.d.ts.map +1 -0
  26. package/dist/domains/moderation.js +68 -0
  27. package/dist/domains/platform.d.ts +13 -0
  28. package/dist/domains/platform.d.ts.map +1 -1
  29. package/dist/domains/platform.js +14 -0
  30. package/dist/domains/portal.d.ts +86 -8
  31. package/dist/domains/portal.d.ts.map +1 -1
  32. package/dist/domains/portal.js +78 -8
  33. package/dist/domains/safety.d.ts +163 -0
  34. package/dist/domains/safety.d.ts.map +1 -0
  35. package/dist/domains/safety.js +167 -0
  36. package/dist/domains/users.d.ts +9 -1
  37. package/dist/domains/users.d.ts.map +1 -1
  38. package/dist/domains/users.js +9 -1
  39. package/dist/errors.d.ts +135 -0
  40. package/dist/errors.d.ts.map +1 -1
  41. package/dist/errors.js +163 -0
  42. package/dist/generated/graphql-schema.d.ts +522 -14
  43. package/dist/generated/graphql-schema.d.ts.map +1 -1
  44. package/dist/generated/graphql-schema.js +64 -0
  45. package/dist/generated/graphql.d.ts +375 -0
  46. package/dist/generated/graphql.d.ts.map +1 -1
  47. package/dist/generated/graphql.js +24 -3
  48. package/dist/index.d.ts +12 -9
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/index.js +6 -4
  51. package/dist/live-coding/assets/browser-authoring-index.json +1 -1
  52. package/dist/live-coding/assets/manifest.json +1 -1
  53. package/dist/live-coding/browser-authoring-index.generated.d.ts.map +1 -1
  54. package/dist/live-coding/browser-authoring-index.generated.js +265 -6
  55. package/package.json +1 -1
@@ -12,7 +12,7 @@
12
12
  },
13
13
  {
14
14
  "name": "browser-authoring-index.json",
15
- "bytes": 238329,
15
+ "bytes": 246611,
16
16
  "provenance": "cks-game-api generated browser authoring index"
17
17
  }
18
18
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"browser-authoring-index.generated.d.ts","sourceRoot":"","sources":["../../src/live-coding/browser-authoring-index.generated.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,iCAAiC,EAAE,OAitR/C,CAAC"}
1
+ {"version":3,"file":"browser-authoring-index.generated.d.ts","sourceRoot":"","sources":["../../src/live-coding/browser-authoring-index.generated.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,iCAAiC,EAAE,OAo9R/C,CAAC"}
@@ -4,7 +4,7 @@ export const GENERATED_BROWSER_AUTHORING_INDEX = {
4
4
  "rustVersion": "1.97.1",
5
5
  "sdkVersion": "0.1.0",
6
6
  "abiVersion": 0,
7
- "contentHash": "ee2ede452d216671472b089bc9d6e43b5afcc9debe4d8e9ea2be4f041a282485",
7
+ "contentHash": "a9f43b0474361a326b6620437ba3613e16745722f44930c901db9de68a10e867",
8
8
  "crates": [
9
9
  {
10
10
  "name": "alloc",
@@ -13,8 +13,8 @@ export const GENERATED_BROWSER_AUTHORING_INDEX = {
13
13
  },
14
14
  {
15
15
  "name": "ckx-sdk",
16
- "version": "0.12.1",
17
- "sourceHash": "d286cb4b12326cbaf7c78c10a593f393d28cbdaa248a3507a179c5c4843ce5aa"
16
+ "version": "0.13.0",
17
+ "sourceHash": "b7137dee863c90ec7ffc232b8c13d2ace102de796efff1188835868310941963"
18
18
  },
19
19
  {
20
20
  "name": "core",
@@ -336,6 +336,13 @@ export const GENERATED_BROWSER_AUTHORING_INDEX = {
336
336
  "signature": "pub fn publish(&self, topic: &str, payload: &[u8])",
337
337
  "docs": "Pushes `payload` to every subscriber of `topic` on this instance."
338
338
  },
339
+ {
340
+ "module": "ckx_sdk",
341
+ "name": "Ctx::safety",
342
+ "kind": "method",
343
+ "signature": "pub fn safety(&self) -> node::Safety<'_>",
344
+ "docs": "Safety reports a player files through this hub (scope `safety.write`)."
345
+ },
339
346
  {
340
347
  "module": "ckx_sdk",
341
348
  "name": "Ctx::send",
@@ -441,6 +448,13 @@ export const GENERATED_BROWSER_AUTHORING_INDEX = {
441
448
  "signature": "pub fn new(msg: impl Into<String>) -> Self",
442
449
  "docs": ""
443
450
  },
451
+ {
452
+ "module": "ckx_sdk",
453
+ "name": "Error::not_implemented",
454
+ "kind": "method",
455
+ "signature": "pub fn not_implemented(hook: &str) -> Self",
456
+ "docs": "What a hook the hub does not implement answers ([`Hub::on_player_erased`], [`Hub::on_player_export`]). The platform tells it from a failure: it records it and goes on."
457
+ },
444
458
  {
445
459
  "module": "ckx_sdk",
446
460
  "name": "Error::unknown_method",
@@ -476,6 +490,20 @@ export const GENERATED_BROWSER_AUTHORING_INDEX = {
476
490
  "signature": "fn load(ctx: &Ctx, snapshot: &[u8], from_version: u64) -> Result<Self>;",
477
491
  "docs": "An instance restored from its last snapshot, written by code version `from_version`."
478
492
  },
493
+ {
494
+ "module": "ckx_sdk",
495
+ "name": "Hub::on_player_erased",
496
+ "kind": "method",
497
+ "signature": "fn on_player_erased(&mut self, _ctx: &Ctx, _player: u64) -> Result<()>",
498
+ "docs": "`player`'s account is being erased: delete or anonymize everything this hub holds about them. Every hub of the app that holds state hears it, a stopped one started for it, the player's own included (one keyed by their id, which the platform then deletes with its snapshot). The platform counts the hub done once a snapshot taken after this returns is stored; an error is recorded, and the erasure asks again later. Left out, the hub answers \"not implemented\", which is recorded and does not hold the erasure up."
499
+ },
500
+ {
501
+ "module": "ckx_sdk",
502
+ "name": "Hub::on_player_export",
503
+ "kind": "method",
504
+ "signature": "fn on_player_export(&mut self, _ctx: &Ctx, _player: u64) -> Result<serde_json::Value>",
505
+ "docs": "What this hub holds about `player`, for their data export: JSON, at most [`limits::MAX_EXPORT_BYTES`] of it, or `Value::Null` when it holds nothing. Every hub of the app that holds state is asked, a stopped one started for it. Left out, the hub answers \"not implemented\", which the export records."
506
+ },
479
507
  {
480
508
  "module": "ckx_sdk",
481
509
  "name": "Hub::on_presence",
@@ -959,6 +987,13 @@ export const GENERATED_BROWSER_AUTHORING_INDEX = {
959
987
  "signature": "pub mod prelude",
960
988
  "docs": ""
961
989
  },
990
+ {
991
+ "module": "ckx_sdk",
992
+ "name": "serde_json",
993
+ "kind": "reexport",
994
+ "signature": "pub use serde_json;",
995
+ "docs": "What [`Hub::on_player_export`] answers in, for a crate that does not depend on it itself."
996
+ },
962
997
  {
963
998
  "module": "ckx_sdk::cron",
964
999
  "name": "Cron",
@@ -7042,6 +7077,13 @@ export const GENERATED_BROWSER_AUTHORING_INDEX = {
7042
7077
  "signature": "pub const MAX_EMIT_BYTES: usize = 70 + crate::emit::MAX_PAYLOAD;",
7043
7078
  "docs": "The largest realtime inject a node may emit: a spatial event's header and its payload."
7044
7079
  },
7080
+ {
7081
+ "module": "ckx_sdk::limits",
7082
+ "name": "MAX_EXPORT_BYTES",
7083
+ "kind": "const",
7084
+ "signature": "pub const MAX_EXPORT_BYTES: usize = 1 << 20;",
7085
+ "docs": "The most JSON a hub's [`crate::Hub::on_player_export`] may answer. A larger answer is an error, and the export records the hub as failed."
7086
+ },
7045
7087
  {
7046
7088
  "module": "ckx_sdk::limits",
7047
7089
  "name": "MAX_LOG_BYTES",
@@ -7742,6 +7784,69 @@ export const GENERATED_BROWSER_AUTHORING_INDEX = {
7742
7784
  "signature": "pub uuid: String",
7743
7785
  "docs": "The 32-character actor id."
7744
7786
  },
7787
+ {
7788
+ "module": "ckx_sdk::node",
7789
+ "name": "AgeBracket",
7790
+ "kind": "enum",
7791
+ "signature": "pub enum AgeBracket { /// No age is known: the platform refuses such a player a token, so a hub rarely sees one. Unknown, Under13, From13To15, From16To17, Adult, }",
7792
+ "docs": "How old a player is, as a bracket: never their age itself."
7793
+ },
7794
+ {
7795
+ "module": "ckx_sdk::node",
7796
+ "name": "AgeBracket::Adult",
7797
+ "kind": "variant",
7798
+ "signature": "Adult",
7799
+ "docs": ""
7800
+ },
7801
+ {
7802
+ "module": "ckx_sdk::node",
7803
+ "name": "AgeBracket::From13To15",
7804
+ "kind": "variant",
7805
+ "signature": "From13To15",
7806
+ "docs": ""
7807
+ },
7808
+ {
7809
+ "module": "ckx_sdk::node",
7810
+ "name": "AgeBracket::From16To17",
7811
+ "kind": "variant",
7812
+ "signature": "From16To17",
7813
+ "docs": ""
7814
+ },
7815
+ {
7816
+ "module": "ckx_sdk::node",
7817
+ "name": "AgeBracket::Under13",
7818
+ "kind": "variant",
7819
+ "signature": "Under13",
7820
+ "docs": ""
7821
+ },
7822
+ {
7823
+ "module": "ckx_sdk::node",
7824
+ "name": "AgeBracket::Unknown",
7825
+ "kind": "variant",
7826
+ "signature": "Unknown",
7827
+ "docs": "No age is known: the platform refuses such a player a token, so a hub rarely sees one."
7828
+ },
7829
+ {
7830
+ "module": "ckx_sdk::node",
7831
+ "name": "AgeBracket::as_str",
7832
+ "kind": "method",
7833
+ "signature": "pub fn as_str(self) -> &'static str",
7834
+ "docs": "As the platform writes it: `unknown`, `under_13`, `13_15`, `16_17` or `18_plus`."
7835
+ },
7836
+ {
7837
+ "module": "ckx_sdk::node",
7838
+ "name": "AgeBracket::deserialize",
7839
+ "kind": "method",
7840
+ "signature": "fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>",
7841
+ "docs": ""
7842
+ },
7843
+ {
7844
+ "module": "ckx_sdk::node",
7845
+ "name": "AgeBracket::is_minor",
7846
+ "kind": "method",
7847
+ "signature": "pub fn is_minor(self) -> bool",
7848
+ "docs": "13 to 17: the platform holds the player to minors' defaults."
7849
+ },
7745
7850
  {
7746
7851
  "module": "ckx_sdk::node",
7747
7852
  "name": "Chunk",
@@ -7819,6 +7924,20 @@ export const GENERATED_BROWSER_AUTHORING_INDEX = {
7819
7924
  "signature": "pub z: i64",
7820
7925
  "docs": ""
7821
7926
  },
7927
+ {
7928
+ "module": "ckx_sdk::node",
7929
+ "name": "FiledReport",
7930
+ "kind": "struct",
7931
+ "signature": "pub struct FiledReport { /// What moderators know it by. #[serde(deserialize_with = \"de_u64\", alias = \"reportId\")] pub report_id: u64, }",
7932
+ "docs": "A report the platform recorded."
7933
+ },
7934
+ {
7935
+ "module": "ckx_sdk::node",
7936
+ "name": "FiledReport::report_id",
7937
+ "kind": "field",
7938
+ "signature": "pub report_id: u64",
7939
+ "docs": "What moderators know it by."
7940
+ },
7822
7941
  {
7823
7942
  "module": "ckx_sdk::node",
7824
7943
  "name": "Grid",
@@ -8015,6 +8134,13 @@ export const GENERATED_BROWSER_AUTHORING_INDEX = {
8015
8134
  "signature": "pub const MAX_CHUNK_STATE: usize = 65_536;",
8016
8135
  "docs": "A chunk's state bytes ([`World::set_chunk_state`])."
8017
8136
  },
8137
+ {
8138
+ "module": "ckx_sdk::node",
8139
+ "name": "MAX_REPORT_DETAILS",
8140
+ "kind": "const",
8141
+ "signature": "pub const MAX_REPORT_DETAILS: usize = 1_000;",
8142
+ "docs": "A safety report's details, in characters as the game API counts them (UTF-16 units)."
8143
+ },
8018
8144
  {
8019
8145
  "module": "ckx_sdk::node",
8020
8146
  "name": "MAX_VOXEL_STATE",
@@ -8054,9 +8180,16 @@ export const GENERATED_BROWSER_AUTHORING_INDEX = {
8054
8180
  "module": "ckx_sdk::node",
8055
8181
  "name": "Player",
8056
8182
  "kind": "struct",
8057
- "signature": "pub struct Player { #[serde(deserialize_with = \"de_u64\")] pub player: u64, pub gamertag: String, /// What tells players with the same gamertag apart; most players have none. #[serde(default)] pub disambiguation: Option<String>, }",
8183
+ "signature": "pub struct Player { #[serde(deserialize_with = \"de_u64\")] pub player: u64, pub gamertag: String, /// What tells players with the same gamertag apart; most players have none. #[serde(default)] pub disambiguation: Option<String>, /// The player's age bracket; `None` from a platform that does not say. #[serde(default, alias = \"ageBracket\")] pub age_bracket: Option<AgeBracket>, }",
8058
8184
  "docs": "A player's public identity."
8059
8185
  },
8186
+ {
8187
+ "module": "ckx_sdk::node",
8188
+ "name": "Player::age_bracket",
8189
+ "kind": "field",
8190
+ "signature": "pub age_bracket: Option<AgeBracket>",
8191
+ "docs": "The player's age bracket; `None` from a platform that does not say."
8192
+ },
8060
8193
  {
8061
8194
  "module": "ckx_sdk::node",
8062
8195
  "name": "Player::disambiguation",
@@ -8127,6 +8260,13 @@ export const GENERATED_BROWSER_AUTHORING_INDEX = {
8127
8260
  "signature": "pub fn avatar_state(&self, avatar: u64) -> Result<Option<Vec<u8>>, CallError>",
8128
8261
  "docs": "An avatar's state blob for this app. Scope `players.read`."
8129
8262
  },
8263
+ {
8264
+ "module": "ckx_sdk::node",
8265
+ "name": "Players::blocked",
8266
+ "kind": "method",
8267
+ "signature": "pub fn blocked(&self, player: u64, other: u64) -> Result<bool, CallError>",
8268
+ "docs": "Whether either player has blocked the other in this app: check it before mail, friend requests, trades, duels or invites pass between them, and before the hub's own events carry one's words to the other (the realtime servers pass what a hub emits, blocks or not). Scope `players.read`."
8269
+ },
8130
8270
  {
8131
8271
  "module": "ckx_sdk::node",
8132
8272
  "name": "Players::check_permission",
@@ -8162,6 +8302,125 @@ export const GENERATED_BROWSER_AUTHORING_INDEX = {
8162
8302
  "signature": "pub fn state(&self, player: u64) -> Result<Option<Vec<u8>>, CallError>",
8163
8303
  "docs": "The player's state blob for this app, which game clients read too. Scope `players.read`."
8164
8304
  },
8305
+ {
8306
+ "module": "ckx_sdk::node",
8307
+ "name": "ReportReason",
8308
+ "kind": "enum",
8309
+ "signature": "pub enum ReportReason { ChildSafety, Harassment, SexualContent, Hate, SelfHarm, Cheating, Other, }",
8310
+ "docs": "Why a player is reported ([`SafetyReport::reason`])."
8311
+ },
8312
+ {
8313
+ "module": "ckx_sdk::node",
8314
+ "name": "ReportReason::Cheating",
8315
+ "kind": "variant",
8316
+ "signature": "Cheating",
8317
+ "docs": ""
8318
+ },
8319
+ {
8320
+ "module": "ckx_sdk::node",
8321
+ "name": "ReportReason::ChildSafety",
8322
+ "kind": "variant",
8323
+ "signature": "ChildSafety",
8324
+ "docs": ""
8325
+ },
8326
+ {
8327
+ "module": "ckx_sdk::node",
8328
+ "name": "ReportReason::Harassment",
8329
+ "kind": "variant",
8330
+ "signature": "Harassment",
8331
+ "docs": ""
8332
+ },
8333
+ {
8334
+ "module": "ckx_sdk::node",
8335
+ "name": "ReportReason::Hate",
8336
+ "kind": "variant",
8337
+ "signature": "Hate",
8338
+ "docs": ""
8339
+ },
8340
+ {
8341
+ "module": "ckx_sdk::node",
8342
+ "name": "ReportReason::Other",
8343
+ "kind": "variant",
8344
+ "signature": "Other",
8345
+ "docs": ""
8346
+ },
8347
+ {
8348
+ "module": "ckx_sdk::node",
8349
+ "name": "ReportReason::SelfHarm",
8350
+ "kind": "variant",
8351
+ "signature": "SelfHarm",
8352
+ "docs": ""
8353
+ },
8354
+ {
8355
+ "module": "ckx_sdk::node",
8356
+ "name": "ReportReason::SexualContent",
8357
+ "kind": "variant",
8358
+ "signature": "SexualContent",
8359
+ "docs": ""
8360
+ },
8361
+ {
8362
+ "module": "ckx_sdk::node",
8363
+ "name": "Safety",
8364
+ "kind": "struct",
8365
+ "signature": "pub struct Safety<'a>(pub(crate) &'a Ctx);",
8366
+ "docs": "Safety reports: [`Ctx::safety`]."
8367
+ },
8368
+ {
8369
+ "module": "ckx_sdk::node",
8370
+ "name": "Safety::report",
8371
+ "kind": "method",
8372
+ "signature": "pub fn report(&self, report: &SafetyReport) -> Result<FiledReport, CallError>",
8373
+ "docs": "Files `report` as its reporter would from the game, both players being the app's: moderators review it with what the app's safety log recorded of both around when it happened. Scope `safety.write`."
8374
+ },
8375
+ {
8376
+ "module": "ckx_sdk::node",
8377
+ "name": "SafetyReport",
8378
+ "kind": "struct",
8379
+ "signature": "pub struct SafetyReport { /// The player reporting. pub reporter: u64, /// The player reported. pub reported: u64, /// The reported player's actor (its 32-character id), when the report is about what it /// did in the world. pub reported_actor: Option<String>, pub reason: ReportReason, /// What happened, in the reporter's words: at most [`MAX_REPORT_DETAILS`] characters. pub details: String, /// When it happened, in Unix milliseconds. pub occurred_at_ms: u64, }",
8380
+ "docs": "A safety report a hub files for one player about another ([`Safety::report`])."
8381
+ },
8382
+ {
8383
+ "module": "ckx_sdk::node",
8384
+ "name": "SafetyReport::details",
8385
+ "kind": "field",
8386
+ "signature": "pub details: String",
8387
+ "docs": "What happened, in the reporter's words: at most [`MAX_REPORT_DETAILS`] characters."
8388
+ },
8389
+ {
8390
+ "module": "ckx_sdk::node",
8391
+ "name": "SafetyReport::occurred_at_ms",
8392
+ "kind": "field",
8393
+ "signature": "pub occurred_at_ms: u64",
8394
+ "docs": "When it happened, in Unix milliseconds."
8395
+ },
8396
+ {
8397
+ "module": "ckx_sdk::node",
8398
+ "name": "SafetyReport::reason",
8399
+ "kind": "field",
8400
+ "signature": "pub reason: ReportReason",
8401
+ "docs": ""
8402
+ },
8403
+ {
8404
+ "module": "ckx_sdk::node",
8405
+ "name": "SafetyReport::reported",
8406
+ "kind": "field",
8407
+ "signature": "pub reported: u64",
8408
+ "docs": "The player reported."
8409
+ },
8410
+ {
8411
+ "module": "ckx_sdk::node",
8412
+ "name": "SafetyReport::reported_actor",
8413
+ "kind": "field",
8414
+ "signature": "pub reported_actor: Option<String>",
8415
+ "docs": "The reported player's actor (its 32-character id), when the report is about what it did in the world."
8416
+ },
8417
+ {
8418
+ "module": "ckx_sdk::node",
8419
+ "name": "SafetyReport::reporter",
8420
+ "kind": "field",
8421
+ "signature": "pub reporter: u64",
8422
+ "docs": "The player reporting."
8423
+ },
8165
8424
  {
8166
8425
  "module": "ckx_sdk::node",
8167
8426
  "name": "Voxel",
@@ -8332,9 +8591,9 @@ export const GENERATED_BROWSER_AUTHORING_INDEX = {
8332
8591
  },
8333
8592
  {
8334
8593
  "module": "ckx_sdk::prelude",
8335
- "name": "crate::node::{ChunkPos, GridPick, VoxelWrite}",
8594
+ "name": "crate::node::{AgeBracket, ChunkPos, GridPick, ReportReason, SafetyReport, VoxelWrite}",
8336
8595
  "kind": "reexport",
8337
- "signature": "pub use crate::node::{ChunkPos, GridPick, VoxelWrite};",
8596
+ "signature": "pub use crate::node::{AgeBracket, ChunkPos, GridPick, ReportReason, SafetyReport, VoxelWrite};",
8338
8597
  "docs": ""
8339
8598
  },
8340
8599
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowdedkingdoms/crowdyjs",
3
- "version": "18.23.1",
3
+ "version": "18.24.0-dev.1",
4
4
  "description": "Browser-first Crowded Kingdoms SDK with GraphQL, realtime, and local Rust authoring support",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",