@indiegems/gem-web-sdk 18.1.0 → 19.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/CHANGELOG.md +18 -0
- package/dist/function.d.ts +16 -2
- package/dist/game.d.ts +16 -2
- package/dist/gem-web-sdk.conformance.js +3 -3
- package/dist/gem-web-sdk.esm.js +1 -1
- package/dist/gem-web-sdk.function.js +3 -3
- package/dist/gem-web-sdk.game.js +3 -3
- package/dist/gem-web-sdk.min.js +3 -3
- package/dist/gem-web-sdk.sdk.js +3 -3
- package/dist/gem-web-sdk.server.js +1 -1
- package/dist/sdk.d.ts +16 -2
- package/docs/api/api-reference-function.md +247 -2
- package/docs/api/api-reference-game.md +249 -3
- package/docs/api/api-reference-server.md +1 -1
- package/docs/api/reference.json +660 -4
- package/docs/arcade-and-store.md +149 -6
- package/docs/changelog.md +18 -0
- package/docs/getting-started.md +1 -1
- package/docs/manifest.json +8 -8
- package/docs/server-bundles.md +8 -2
- package/package.json +1 -1
package/docs/api/reference.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"schema_version": 2,
|
|
3
3
|
"source": {
|
|
4
4
|
"repo": "IndieGems/gem-web-sdk",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "19.0.0"
|
|
6
6
|
},
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -3537,6 +3537,165 @@
|
|
|
3537
3537
|
"defaultValue": null,
|
|
3538
3538
|
"guides": []
|
|
3539
3539
|
},
|
|
3540
|
+
{
|
|
3541
|
+
"id": "PlayerScope",
|
|
3542
|
+
"name": "PlayerScope",
|
|
3543
|
+
"anchor": "playerscope",
|
|
3544
|
+
"group": "saves",
|
|
3545
|
+
"signature": "interface PlayerScope",
|
|
3546
|
+
"documented": true,
|
|
3547
|
+
"summary": "What the signed-in player has in your game: everything a character has, and\nthe store passes they hold. Reached as `gem.me`.",
|
|
3548
|
+
"deprecated": null,
|
|
3549
|
+
"params": [],
|
|
3550
|
+
"returns": null,
|
|
3551
|
+
"throws": null,
|
|
3552
|
+
"example": null,
|
|
3553
|
+
"defaultValue": null,
|
|
3554
|
+
"guides": [
|
|
3555
|
+
{
|
|
3556
|
+
"slug": "saving-player-progress",
|
|
3557
|
+
"anchor": null
|
|
3558
|
+
}
|
|
3559
|
+
]
|
|
3560
|
+
},
|
|
3561
|
+
{
|
|
3562
|
+
"id": "PlayerScope.settings",
|
|
3563
|
+
"name": "settings",
|
|
3564
|
+
"anchor": "playerscope-settings",
|
|
3565
|
+
"group": "saves",
|
|
3566
|
+
"signature": "readonly settings: SettingsApi",
|
|
3567
|
+
"documented": true,
|
|
3568
|
+
"summary": "Small named values your game chooses to persist — a difficulty, a control\nscheme, a last-used loadout.\n\nPer key, so two settings written from two places do not overwrite each\nother. For a whole document of progress, use [EntityScope.saves](api-reference-game.md#entityscope-saves).",
|
|
3569
|
+
"deprecated": null,
|
|
3570
|
+
"params": [],
|
|
3571
|
+
"returns": null,
|
|
3572
|
+
"throws": null,
|
|
3573
|
+
"example": null,
|
|
3574
|
+
"defaultValue": null,
|
|
3575
|
+
"guides": []
|
|
3576
|
+
},
|
|
3577
|
+
{
|
|
3578
|
+
"id": "PlayerScope.inventory",
|
|
3579
|
+
"name": "inventory",
|
|
3580
|
+
"anchor": "playerscope-inventory",
|
|
3581
|
+
"group": "saves",
|
|
3582
|
+
"signature": "readonly inventory: InventoryApi",
|
|
3583
|
+
"documented": true,
|
|
3584
|
+
"summary": "What this player owns — items, and the progressions they are working\nthrough. Reads are cached; writes go through\n[EntityScope.mutations](api-reference-game.md#entityscope-mutations).",
|
|
3585
|
+
"deprecated": null,
|
|
3586
|
+
"params": [],
|
|
3587
|
+
"returns": null,
|
|
3588
|
+
"throws": null,
|
|
3589
|
+
"example": null,
|
|
3590
|
+
"defaultValue": null,
|
|
3591
|
+
"guides": []
|
|
3592
|
+
},
|
|
3593
|
+
{
|
|
3594
|
+
"id": "PlayerScope.currencies",
|
|
3595
|
+
"name": "currencies",
|
|
3596
|
+
"anchor": "playerscope-currencies",
|
|
3597
|
+
"group": "saves",
|
|
3598
|
+
"signature": "readonly currencies: CurrenciesApi",
|
|
3599
|
+
"documented": true,
|
|
3600
|
+
"summary": "Currency balances.\n\nA currency the player holds none of is simply absent rather than present as\nzero, so read it as a lookup with a default rather than a list to iterate.",
|
|
3601
|
+
"deprecated": null,
|
|
3602
|
+
"params": [],
|
|
3603
|
+
"returns": null,
|
|
3604
|
+
"throws": null,
|
|
3605
|
+
"example": null,
|
|
3606
|
+
"defaultValue": null,
|
|
3607
|
+
"guides": []
|
|
3608
|
+
},
|
|
3609
|
+
{
|
|
3610
|
+
"id": "PlayerScope.mutations",
|
|
3611
|
+
"name": "mutations",
|
|
3612
|
+
"anchor": "playerscope-mutations",
|
|
3613
|
+
"group": "saves",
|
|
3614
|
+
"signature": "readonly mutations: MutationsApi",
|
|
3615
|
+
"documented": true,
|
|
3616
|
+
"summary": "Changing what this player has — spending currency, granting items, running\na crafting recipe, advancing a progression.\n\nSeparate from [EntityScope.inventory](api-reference-game.md#entityscope-inventory) on purpose: reads are cached and\nsafe to repeat, writes are neither, and one object holding both makes that\ndistinction invisible where you call it.",
|
|
3617
|
+
"deprecated": null,
|
|
3618
|
+
"params": [],
|
|
3619
|
+
"returns": null,
|
|
3620
|
+
"throws": null,
|
|
3621
|
+
"example": null,
|
|
3622
|
+
"defaultValue": null,
|
|
3623
|
+
"guides": []
|
|
3624
|
+
},
|
|
3625
|
+
{
|
|
3626
|
+
"id": "PlayerScope.saves",
|
|
3627
|
+
"name": "saves",
|
|
3628
|
+
"anchor": "playerscope-saves",
|
|
3629
|
+
"group": "saves",
|
|
3630
|
+
"signature": "readonly saves: SavesApi",
|
|
3631
|
+
"documented": true,
|
|
3632
|
+
"summary": "Saved progress — a world, a campaign, a replay. One document per key.\n\nThe line against [EntityScope.settings](api-reference-game.md#entityscope-settings) is what the value is, not how\nbig it is: a setting is a value your game names, a save is an opaque\ndocument the platform stores and hands back. A chosen difficulty is a\nsetting; the campaign it applies to is a save.\n\n**Every save key must be declared in your game config first.** Writing to an\nundeclared key fails with a message naming it.",
|
|
3633
|
+
"deprecated": null,
|
|
3634
|
+
"params": [],
|
|
3635
|
+
"returns": null,
|
|
3636
|
+
"throws": null,
|
|
3637
|
+
"example": null,
|
|
3638
|
+
"defaultValue": null,
|
|
3639
|
+
"guides": [
|
|
3640
|
+
{
|
|
3641
|
+
"slug": "saving-player-progress",
|
|
3642
|
+
"anchor": null
|
|
3643
|
+
}
|
|
3644
|
+
]
|
|
3645
|
+
},
|
|
3646
|
+
{
|
|
3647
|
+
"id": "PlayerScope.orders",
|
|
3648
|
+
"name": "orders",
|
|
3649
|
+
"anchor": "playerscope-orders",
|
|
3650
|
+
"group": "saves",
|
|
3651
|
+
"signature": "readonly orders: OrdersApi",
|
|
3652
|
+
"documented": true,
|
|
3653
|
+
"summary": "This entity's order history — a read-only record of changes that happened.\n\nCreating an order is [EntityScope.mutations](api-reference-game.md#entityscope-mutations); this answers \"what\nhappened\" and \"did my write land\" (`orders.get(orderId)`).",
|
|
3654
|
+
"deprecated": null,
|
|
3655
|
+
"params": [],
|
|
3656
|
+
"returns": null,
|
|
3657
|
+
"throws": null,
|
|
3658
|
+
"example": null,
|
|
3659
|
+
"defaultValue": null,
|
|
3660
|
+
"guides": []
|
|
3661
|
+
},
|
|
3662
|
+
{
|
|
3663
|
+
"id": "PlayerScope.progressions",
|
|
3664
|
+
"name": "progressions",
|
|
3665
|
+
"anchor": "playerscope-progressions",
|
|
3666
|
+
"group": "saves",
|
|
3667
|
+
"signature": "readonly progressions: ProgressionsApi",
|
|
3668
|
+
"documented": true,
|
|
3669
|
+
"summary": "Progressions this entity is working through — a projection over the same\ncached snapshot [EntityScope.inventory](api-reference-game.md#entityscope-inventory) serves.",
|
|
3670
|
+
"deprecated": null,
|
|
3671
|
+
"params": [],
|
|
3672
|
+
"returns": null,
|
|
3673
|
+
"throws": null,
|
|
3674
|
+
"example": null,
|
|
3675
|
+
"defaultValue": null,
|
|
3676
|
+
"guides": []
|
|
3677
|
+
},
|
|
3678
|
+
{
|
|
3679
|
+
"id": "PlayerScope.passes",
|
|
3680
|
+
"name": "passes",
|
|
3681
|
+
"anchor": "playerscope-passes",
|
|
3682
|
+
"group": "saves",
|
|
3683
|
+
"signature": "readonly passes: PassesApi",
|
|
3684
|
+
"documented": true,
|
|
3685
|
+
"summary": "Which store passes the player holds, of those the platform lets games see.\nFor drawing a door; your function or server decides what a pass unlocks.",
|
|
3686
|
+
"deprecated": null,
|
|
3687
|
+
"params": [],
|
|
3688
|
+
"returns": null,
|
|
3689
|
+
"throws": null,
|
|
3690
|
+
"example": null,
|
|
3691
|
+
"defaultValue": null,
|
|
3692
|
+
"guides": [
|
|
3693
|
+
{
|
|
3694
|
+
"slug": "arcade-and-store",
|
|
3695
|
+
"anchor": null
|
|
3696
|
+
}
|
|
3697
|
+
]
|
|
3698
|
+
},
|
|
3540
3699
|
{
|
|
3541
3700
|
"id": "Setting",
|
|
3542
3701
|
"name": "Setting",
|
|
@@ -8192,6 +8351,175 @@
|
|
|
8192
8351
|
"defaultValue": null,
|
|
8193
8352
|
"guides": []
|
|
8194
8353
|
},
|
|
8354
|
+
{
|
|
8355
|
+
"id": "GamePass",
|
|
8356
|
+
"name": "GamePass",
|
|
8357
|
+
"anchor": "gamepass",
|
|
8358
|
+
"group": "saves",
|
|
8359
|
+
"signature": "interface GamePass",
|
|
8360
|
+
"documented": true,
|
|
8361
|
+
"summary": "One pass games may see, and whether this player holds it. Listed whether they\nhold it or not, and this is everything a game learns about it.",
|
|
8362
|
+
"deprecated": null,
|
|
8363
|
+
"params": [],
|
|
8364
|
+
"returns": null,
|
|
8365
|
+
"throws": null,
|
|
8366
|
+
"example": null,
|
|
8367
|
+
"defaultValue": null,
|
|
8368
|
+
"guides": []
|
|
8369
|
+
},
|
|
8370
|
+
{
|
|
8371
|
+
"id": "GamePass.pass",
|
|
8372
|
+
"name": "pass",
|
|
8373
|
+
"anchor": "gamepass-pass",
|
|
8374
|
+
"group": "saves",
|
|
8375
|
+
"signature": "readonly pass: string",
|
|
8376
|
+
"documented": true,
|
|
8377
|
+
"summary": "The pass's offering slug, such as `vip`. Stable and not localized: key on this.",
|
|
8378
|
+
"deprecated": null,
|
|
8379
|
+
"params": [],
|
|
8380
|
+
"returns": null,
|
|
8381
|
+
"throws": null,
|
|
8382
|
+
"example": null,
|
|
8383
|
+
"defaultValue": null,
|
|
8384
|
+
"guides": []
|
|
8385
|
+
},
|
|
8386
|
+
{
|
|
8387
|
+
"id": "GamePass.held",
|
|
8388
|
+
"name": "held",
|
|
8389
|
+
"anchor": "gamepass-held",
|
|
8390
|
+
"group": "saves",
|
|
8391
|
+
"signature": "readonly held: boolean",
|
|
8392
|
+
"documented": true,
|
|
8393
|
+
"summary": "Whether the player holds it right now.",
|
|
8394
|
+
"deprecated": null,
|
|
8395
|
+
"params": [],
|
|
8396
|
+
"returns": null,
|
|
8397
|
+
"throws": null,
|
|
8398
|
+
"example": null,
|
|
8399
|
+
"defaultValue": null,
|
|
8400
|
+
"guides": []
|
|
8401
|
+
},
|
|
8402
|
+
{
|
|
8403
|
+
"id": "GamePass.endsAt",
|
|
8404
|
+
"name": "endsAt",
|
|
8405
|
+
"anchor": "gamepass-endsat",
|
|
8406
|
+
"group": "saves",
|
|
8407
|
+
"signature": "readonly endsAt: string | null",
|
|
8408
|
+
"documented": true,
|
|
8409
|
+
"summary": "When the player stops holding it, RFC 3339 in UTC, grace and any queued\nperiod included. `null` when it is not held, and when it is held with no\nend, so read [GamePass.held](api-reference-game.md#gamepass-held) first: `null` alone never means ended.",
|
|
8410
|
+
"deprecated": null,
|
|
8411
|
+
"params": [],
|
|
8412
|
+
"returns": null,
|
|
8413
|
+
"throws": null,
|
|
8414
|
+
"example": null,
|
|
8415
|
+
"defaultValue": null,
|
|
8416
|
+
"guides": []
|
|
8417
|
+
},
|
|
8418
|
+
{
|
|
8419
|
+
"id": "PassesEvent",
|
|
8420
|
+
"name": "PassesEvent",
|
|
8421
|
+
"anchor": "passesevent",
|
|
8422
|
+
"group": "saves",
|
|
8423
|
+
"signature": "type PassesEvent = \"changed\"",
|
|
8424
|
+
"documented": true,
|
|
8425
|
+
"summary": "The events [PassesApi.on](api-reference-game.md#passesapi-on) emits.",
|
|
8426
|
+
"deprecated": null,
|
|
8427
|
+
"params": [],
|
|
8428
|
+
"returns": null,
|
|
8429
|
+
"throws": null,
|
|
8430
|
+
"example": null,
|
|
8431
|
+
"defaultValue": null,
|
|
8432
|
+
"guides": []
|
|
8433
|
+
},
|
|
8434
|
+
{
|
|
8435
|
+
"id": "PassesApi",
|
|
8436
|
+
"name": "PassesApi",
|
|
8437
|
+
"anchor": "passesapi",
|
|
8438
|
+
"group": "saves",
|
|
8439
|
+
"signature": "interface PassesApi",
|
|
8440
|
+
"documented": true,
|
|
8441
|
+
"summary": "Which store passes the player holds, for the passes the platform lets games\nsee. Reached as `gem.me.passes`. VIP is the pass `vip`.\n\nUse it to DRAW a door open or shut, never to decide: it runs in the player's\nbrowser. What a pass unlocks is decided by your function or server.\n\nReads reject with a `GemApiError`, as every `gem.me` read does. That is\nunknown, not \"not held\", so keep what you drew. A guest reads as not holding.",
|
|
8442
|
+
"deprecated": null,
|
|
8443
|
+
"params": [],
|
|
8444
|
+
"returns": null,
|
|
8445
|
+
"throws": null,
|
|
8446
|
+
"example": null,
|
|
8447
|
+
"defaultValue": null,
|
|
8448
|
+
"guides": [
|
|
8449
|
+
{
|
|
8450
|
+
"slug": "arcade-and-store",
|
|
8451
|
+
"anchor": null
|
|
8452
|
+
}
|
|
8453
|
+
]
|
|
8454
|
+
},
|
|
8455
|
+
{
|
|
8456
|
+
"id": "PassesApi.list",
|
|
8457
|
+
"name": "list",
|
|
8458
|
+
"anchor": "passesapi-list",
|
|
8459
|
+
"group": "saves",
|
|
8460
|
+
"signature": "list(): Promise<readonly GamePass[]>",
|
|
8461
|
+
"documented": true,
|
|
8462
|
+
"summary": "Every pass games may see, held or not, ordered by slug. Empty when the\nplatform marks none. Always a fresh read; callers at the same moment share\none request.",
|
|
8463
|
+
"deprecated": null,
|
|
8464
|
+
"params": [],
|
|
8465
|
+
"returns": null,
|
|
8466
|
+
"throws": null,
|
|
8467
|
+
"example": null,
|
|
8468
|
+
"defaultValue": null,
|
|
8469
|
+
"guides": []
|
|
8470
|
+
},
|
|
8471
|
+
{
|
|
8472
|
+
"id": "PassesApi.get",
|
|
8473
|
+
"name": "get",
|
|
8474
|
+
"anchor": "passesapi-get",
|
|
8475
|
+
"group": "saves",
|
|
8476
|
+
"signature": "get(pass: string): Promise<GamePass>",
|
|
8477
|
+
"documented": true,
|
|
8478
|
+
"summary": "One pass by its slug. A pass the platform does not list reads as not held,\nso a door for a pass that is not on sale yet simply stays shut.",
|
|
8479
|
+
"deprecated": null,
|
|
8480
|
+
"params": [
|
|
8481
|
+
{
|
|
8482
|
+
"name": "pass",
|
|
8483
|
+
"type": "string",
|
|
8484
|
+
"optional": false,
|
|
8485
|
+
"summary": null
|
|
8486
|
+
}
|
|
8487
|
+
],
|
|
8488
|
+
"returns": null,
|
|
8489
|
+
"throws": null,
|
|
8490
|
+
"example": null,
|
|
8491
|
+
"defaultValue": null,
|
|
8492
|
+
"guides": []
|
|
8493
|
+
},
|
|
8494
|
+
{
|
|
8495
|
+
"id": "PassesApi.on",
|
|
8496
|
+
"name": "on",
|
|
8497
|
+
"anchor": "passesapi-on",
|
|
8498
|
+
"group": "saves",
|
|
8499
|
+
"signature": "on(event: \"changed\", listener: (passes: readonly GamePass[]) => void): () => void",
|
|
8500
|
+
"documented": true,
|
|
8501
|
+
"summary": "Hear the list change, with the new list, so a door opens right after a\npurchase and locks again when the pass ends. Returns a function that stops\nlistening.\n\nWhile something listens, the SDK reads again after a `gem.store` purchase\nanswers, when one settles, on resume (so a purchase in the Arcade's own\nstore is heard), after a sign-in and when a held pass ends. It says\nsomething only if the answer differs. Never fires in a function.",
|
|
8502
|
+
"deprecated": null,
|
|
8503
|
+
"params": [
|
|
8504
|
+
{
|
|
8505
|
+
"name": "event",
|
|
8506
|
+
"type": "\"changed\"",
|
|
8507
|
+
"optional": false,
|
|
8508
|
+
"summary": null
|
|
8509
|
+
},
|
|
8510
|
+
{
|
|
8511
|
+
"name": "listener",
|
|
8512
|
+
"type": "(passes: readonly GamePass[]) => void",
|
|
8513
|
+
"optional": false,
|
|
8514
|
+
"summary": null
|
|
8515
|
+
}
|
|
8516
|
+
],
|
|
8517
|
+
"returns": null,
|
|
8518
|
+
"throws": null,
|
|
8519
|
+
"example": null,
|
|
8520
|
+
"defaultValue": null,
|
|
8521
|
+
"guides": []
|
|
8522
|
+
},
|
|
8195
8523
|
{
|
|
8196
8524
|
"id": "RewardCue",
|
|
8197
8525
|
"name": "RewardCue",
|
|
@@ -12692,7 +13020,7 @@
|
|
|
12692
13020
|
"name": "me",
|
|
12693
13021
|
"anchor": "gem-me",
|
|
12694
13022
|
"group": "start",
|
|
12695
|
-
"signature": "readonly me:
|
|
13023
|
+
"signature": "readonly me: PlayerScope",
|
|
12696
13024
|
"documented": true,
|
|
12697
13025
|
"summary": "This player's data in your game — settings, inventory, currencies and\nsaved progress.\n\nAlways usable; there is no null to check. Three things are easy to confuse\nand the SDK keeps them apart:\n\n| | what it is |\n|---|---|\n| [Gem.identity](api-reference-game.md#gem-identity) | who the platform says the player is |\n| [Gem.player](api-reference-game.md#gem-player) | the name and avatar you display |\n| `me` | what the player has in your game |",
|
|
12698
13026
|
"deprecated": null,
|
|
@@ -12900,7 +13228,7 @@
|
|
|
12900
13228
|
"group": "start",
|
|
12901
13229
|
"signature": "readonly store: StoreApi",
|
|
12902
13230
|
"documented": true,
|
|
12903
|
-
"summary": "**Real money.** The Arcade Store's own Gem packs, Boosts, passes and\nbundles, sold for the player's money through the arcade's own purchase\nsheet. To spend Gems or Coins on your game's own items, use\n[Gem.purchases](api-reference-game.md#gem-purchases).\n\nList what the store sells here with `offers()`, show each `priceDisplay`\nexactly as given, and call `purchase(skuId)` from the player's press. For a\npass, a bundle or anything else whose pitch you would have to hardcode, call\n`showOffer(skuId)` instead, and the arcade draws the offer. After `ok`,\nre-read balances through [Gem.me](api-reference-game.md#gem-me).
|
|
13231
|
+
"summary": "**Real money.** The Arcade Store's own Gem packs, Boosts, passes and\nbundles, sold for the player's money through the arcade's own purchase\nsheet. To spend Gems or Coins on your game's own items, use\n[Gem.purchases](api-reference-game.md#gem-purchases).\n\nList what the store sells here with `offers()`, show each `priceDisplay`\nexactly as given, and call `purchase(skuId)` from the player's press. For a\npass, a bundle or anything else whose pitch you would have to hardcode, call\n`showOffer(skuId)` instead, and the arcade draws the offer. After `ok`,\nre-read balances through [Gem.me](api-reference-game.md#gem-me), and `gem.me.passes` for a pass.\nNothing rejects.",
|
|
12904
13232
|
"deprecated": null,
|
|
12905
13233
|
"params": [],
|
|
12906
13234
|
"returns": null,
|
|
@@ -33274,6 +33602,175 @@
|
|
|
33274
33602
|
"defaultValue": null,
|
|
33275
33603
|
"guides": []
|
|
33276
33604
|
},
|
|
33605
|
+
{
|
|
33606
|
+
"id": "GamePass",
|
|
33607
|
+
"name": "GamePass",
|
|
33608
|
+
"anchor": "gamepass",
|
|
33609
|
+
"group": "player",
|
|
33610
|
+
"signature": "interface GamePass",
|
|
33611
|
+
"documented": true,
|
|
33612
|
+
"summary": "One pass games may see, and whether this player holds it. Listed whether they\nhold it or not, and this is everything a game learns about it.",
|
|
33613
|
+
"deprecated": null,
|
|
33614
|
+
"params": [],
|
|
33615
|
+
"returns": null,
|
|
33616
|
+
"throws": null,
|
|
33617
|
+
"example": null,
|
|
33618
|
+
"defaultValue": null,
|
|
33619
|
+
"guides": []
|
|
33620
|
+
},
|
|
33621
|
+
{
|
|
33622
|
+
"id": "GamePass.pass",
|
|
33623
|
+
"name": "pass",
|
|
33624
|
+
"anchor": "gamepass-pass",
|
|
33625
|
+
"group": "player",
|
|
33626
|
+
"signature": "readonly pass: string",
|
|
33627
|
+
"documented": true,
|
|
33628
|
+
"summary": "The pass's offering slug, such as `vip`. Stable and not localized: key on this.",
|
|
33629
|
+
"deprecated": null,
|
|
33630
|
+
"params": [],
|
|
33631
|
+
"returns": null,
|
|
33632
|
+
"throws": null,
|
|
33633
|
+
"example": null,
|
|
33634
|
+
"defaultValue": null,
|
|
33635
|
+
"guides": []
|
|
33636
|
+
},
|
|
33637
|
+
{
|
|
33638
|
+
"id": "GamePass.held",
|
|
33639
|
+
"name": "held",
|
|
33640
|
+
"anchor": "gamepass-held",
|
|
33641
|
+
"group": "player",
|
|
33642
|
+
"signature": "readonly held: boolean",
|
|
33643
|
+
"documented": true,
|
|
33644
|
+
"summary": "Whether the player holds it right now.",
|
|
33645
|
+
"deprecated": null,
|
|
33646
|
+
"params": [],
|
|
33647
|
+
"returns": null,
|
|
33648
|
+
"throws": null,
|
|
33649
|
+
"example": null,
|
|
33650
|
+
"defaultValue": null,
|
|
33651
|
+
"guides": []
|
|
33652
|
+
},
|
|
33653
|
+
{
|
|
33654
|
+
"id": "GamePass.endsAt",
|
|
33655
|
+
"name": "endsAt",
|
|
33656
|
+
"anchor": "gamepass-endsat",
|
|
33657
|
+
"group": "player",
|
|
33658
|
+
"signature": "readonly endsAt: string | null",
|
|
33659
|
+
"documented": true,
|
|
33660
|
+
"summary": "When the player stops holding it, RFC 3339 in UTC, grace and any queued\nperiod included. `null` when it is not held, and when it is held with no\nend, so read [GamePass.held](api-reference-function.md#gamepass-held) first: `null` alone never means ended.",
|
|
33661
|
+
"deprecated": null,
|
|
33662
|
+
"params": [],
|
|
33663
|
+
"returns": null,
|
|
33664
|
+
"throws": null,
|
|
33665
|
+
"example": null,
|
|
33666
|
+
"defaultValue": null,
|
|
33667
|
+
"guides": []
|
|
33668
|
+
},
|
|
33669
|
+
{
|
|
33670
|
+
"id": "PassesEvent",
|
|
33671
|
+
"name": "PassesEvent",
|
|
33672
|
+
"anchor": "passesevent",
|
|
33673
|
+
"group": "player",
|
|
33674
|
+
"signature": "type PassesEvent = \"changed\"",
|
|
33675
|
+
"documented": true,
|
|
33676
|
+
"summary": "The events [PassesApi.on](api-reference-function.md#passesapi-on) emits.",
|
|
33677
|
+
"deprecated": null,
|
|
33678
|
+
"params": [],
|
|
33679
|
+
"returns": null,
|
|
33680
|
+
"throws": null,
|
|
33681
|
+
"example": null,
|
|
33682
|
+
"defaultValue": null,
|
|
33683
|
+
"guides": []
|
|
33684
|
+
},
|
|
33685
|
+
{
|
|
33686
|
+
"id": "PassesApi",
|
|
33687
|
+
"name": "PassesApi",
|
|
33688
|
+
"anchor": "passesapi",
|
|
33689
|
+
"group": "player",
|
|
33690
|
+
"signature": "interface PassesApi",
|
|
33691
|
+
"documented": true,
|
|
33692
|
+
"summary": "Which store passes the player holds, for the passes the platform lets games\nsee. Reached as `gem.me.passes`. VIP is the pass `vip`.\n\nUse it to DRAW a door open or shut, never to decide: it runs in the player's\nbrowser. What a pass unlocks is decided by your function or server.\n\nReads reject with a `GemApiError`, as every `gem.me` read does. That is\nunknown, not \"not held\", so keep what you drew. A guest reads as not holding.",
|
|
33693
|
+
"deprecated": null,
|
|
33694
|
+
"params": [],
|
|
33695
|
+
"returns": null,
|
|
33696
|
+
"throws": null,
|
|
33697
|
+
"example": null,
|
|
33698
|
+
"defaultValue": null,
|
|
33699
|
+
"guides": [
|
|
33700
|
+
{
|
|
33701
|
+
"slug": "arcade-and-store",
|
|
33702
|
+
"anchor": null
|
|
33703
|
+
}
|
|
33704
|
+
]
|
|
33705
|
+
},
|
|
33706
|
+
{
|
|
33707
|
+
"id": "PassesApi.list",
|
|
33708
|
+
"name": "list",
|
|
33709
|
+
"anchor": "passesapi-list",
|
|
33710
|
+
"group": "player",
|
|
33711
|
+
"signature": "list(): Promise<readonly GamePass[]>",
|
|
33712
|
+
"documented": true,
|
|
33713
|
+
"summary": "Every pass games may see, held or not, ordered by slug. Empty when the\nplatform marks none. Always a fresh read; callers at the same moment share\none request.",
|
|
33714
|
+
"deprecated": null,
|
|
33715
|
+
"params": [],
|
|
33716
|
+
"returns": null,
|
|
33717
|
+
"throws": null,
|
|
33718
|
+
"example": null,
|
|
33719
|
+
"defaultValue": null,
|
|
33720
|
+
"guides": []
|
|
33721
|
+
},
|
|
33722
|
+
{
|
|
33723
|
+
"id": "PassesApi.get",
|
|
33724
|
+
"name": "get",
|
|
33725
|
+
"anchor": "passesapi-get",
|
|
33726
|
+
"group": "player",
|
|
33727
|
+
"signature": "get(pass: string): Promise<GamePass>",
|
|
33728
|
+
"documented": true,
|
|
33729
|
+
"summary": "One pass by its slug. A pass the platform does not list reads as not held,\nso a door for a pass that is not on sale yet simply stays shut.",
|
|
33730
|
+
"deprecated": null,
|
|
33731
|
+
"params": [
|
|
33732
|
+
{
|
|
33733
|
+
"name": "pass",
|
|
33734
|
+
"type": "string",
|
|
33735
|
+
"optional": false,
|
|
33736
|
+
"summary": null
|
|
33737
|
+
}
|
|
33738
|
+
],
|
|
33739
|
+
"returns": null,
|
|
33740
|
+
"throws": null,
|
|
33741
|
+
"example": null,
|
|
33742
|
+
"defaultValue": null,
|
|
33743
|
+
"guides": []
|
|
33744
|
+
},
|
|
33745
|
+
{
|
|
33746
|
+
"id": "PassesApi.on",
|
|
33747
|
+
"name": "on",
|
|
33748
|
+
"anchor": "passesapi-on",
|
|
33749
|
+
"group": "player",
|
|
33750
|
+
"signature": "on(event: \"changed\", listener: (passes: readonly GamePass[]) => void): () => void",
|
|
33751
|
+
"documented": true,
|
|
33752
|
+
"summary": "Hear the list change, with the new list, so a door opens right after a\npurchase and locks again when the pass ends. Returns a function that stops\nlistening.\n\nWhile something listens, the SDK reads again after a `gem.store` purchase\nanswers, when one settles, on resume (so a purchase in the Arcade's own\nstore is heard), after a sign-in and when a held pass ends. It says\nsomething only if the answer differs. Never fires in a function.",
|
|
33753
|
+
"deprecated": null,
|
|
33754
|
+
"params": [
|
|
33755
|
+
{
|
|
33756
|
+
"name": "event",
|
|
33757
|
+
"type": "\"changed\"",
|
|
33758
|
+
"optional": false,
|
|
33759
|
+
"summary": null
|
|
33760
|
+
},
|
|
33761
|
+
{
|
|
33762
|
+
"name": "listener",
|
|
33763
|
+
"type": "(passes: readonly GamePass[]) => void",
|
|
33764
|
+
"optional": false,
|
|
33765
|
+
"summary": null
|
|
33766
|
+
}
|
|
33767
|
+
],
|
|
33768
|
+
"returns": null,
|
|
33769
|
+
"throws": null,
|
|
33770
|
+
"example": null,
|
|
33771
|
+
"defaultValue": null,
|
|
33772
|
+
"guides": []
|
|
33773
|
+
},
|
|
33277
33774
|
{
|
|
33278
33775
|
"id": "SaveRecord",
|
|
33279
33776
|
"name": "SaveRecord",
|
|
@@ -34062,6 +34559,165 @@
|
|
|
34062
34559
|
"defaultValue": null,
|
|
34063
34560
|
"guides": []
|
|
34064
34561
|
},
|
|
34562
|
+
{
|
|
34563
|
+
"id": "PlayerScope",
|
|
34564
|
+
"name": "PlayerScope",
|
|
34565
|
+
"anchor": "playerscope",
|
|
34566
|
+
"group": "player",
|
|
34567
|
+
"signature": "interface PlayerScope",
|
|
34568
|
+
"documented": true,
|
|
34569
|
+
"summary": "What the signed-in player has in your game: everything a character has, and\nthe store passes they hold. Reached as `gem.me`.",
|
|
34570
|
+
"deprecated": null,
|
|
34571
|
+
"params": [],
|
|
34572
|
+
"returns": null,
|
|
34573
|
+
"throws": null,
|
|
34574
|
+
"example": null,
|
|
34575
|
+
"defaultValue": null,
|
|
34576
|
+
"guides": [
|
|
34577
|
+
{
|
|
34578
|
+
"slug": "saving-player-progress",
|
|
34579
|
+
"anchor": null
|
|
34580
|
+
}
|
|
34581
|
+
]
|
|
34582
|
+
},
|
|
34583
|
+
{
|
|
34584
|
+
"id": "PlayerScope.settings",
|
|
34585
|
+
"name": "settings",
|
|
34586
|
+
"anchor": "playerscope-settings",
|
|
34587
|
+
"group": "player",
|
|
34588
|
+
"signature": "readonly settings: SettingsApi",
|
|
34589
|
+
"documented": true,
|
|
34590
|
+
"summary": "Small named values your game chooses to persist — a difficulty, a control\nscheme, a last-used loadout.\n\nPer key, so two settings written from two places do not overwrite each\nother. For a whole document of progress, use [EntityScope.saves](api-reference-function.md#entityscope-saves).",
|
|
34591
|
+
"deprecated": null,
|
|
34592
|
+
"params": [],
|
|
34593
|
+
"returns": null,
|
|
34594
|
+
"throws": null,
|
|
34595
|
+
"example": null,
|
|
34596
|
+
"defaultValue": null,
|
|
34597
|
+
"guides": []
|
|
34598
|
+
},
|
|
34599
|
+
{
|
|
34600
|
+
"id": "PlayerScope.inventory",
|
|
34601
|
+
"name": "inventory",
|
|
34602
|
+
"anchor": "playerscope-inventory",
|
|
34603
|
+
"group": "player",
|
|
34604
|
+
"signature": "readonly inventory: InventoryApi",
|
|
34605
|
+
"documented": true,
|
|
34606
|
+
"summary": "What this player owns — items, and the progressions they are working\nthrough. Reads are cached; writes go through\n[EntityScope.mutations](api-reference-function.md#entityscope-mutations).",
|
|
34607
|
+
"deprecated": null,
|
|
34608
|
+
"params": [],
|
|
34609
|
+
"returns": null,
|
|
34610
|
+
"throws": null,
|
|
34611
|
+
"example": null,
|
|
34612
|
+
"defaultValue": null,
|
|
34613
|
+
"guides": []
|
|
34614
|
+
},
|
|
34615
|
+
{
|
|
34616
|
+
"id": "PlayerScope.currencies",
|
|
34617
|
+
"name": "currencies",
|
|
34618
|
+
"anchor": "playerscope-currencies",
|
|
34619
|
+
"group": "player",
|
|
34620
|
+
"signature": "readonly currencies: CurrenciesApi",
|
|
34621
|
+
"documented": true,
|
|
34622
|
+
"summary": "Currency balances.\n\nA currency the player holds none of is simply absent rather than present as\nzero, so read it as a lookup with a default rather than a list to iterate.",
|
|
34623
|
+
"deprecated": null,
|
|
34624
|
+
"params": [],
|
|
34625
|
+
"returns": null,
|
|
34626
|
+
"throws": null,
|
|
34627
|
+
"example": null,
|
|
34628
|
+
"defaultValue": null,
|
|
34629
|
+
"guides": []
|
|
34630
|
+
},
|
|
34631
|
+
{
|
|
34632
|
+
"id": "PlayerScope.mutations",
|
|
34633
|
+
"name": "mutations",
|
|
34634
|
+
"anchor": "playerscope-mutations",
|
|
34635
|
+
"group": "player",
|
|
34636
|
+
"signature": "readonly mutations: MutationsApi",
|
|
34637
|
+
"documented": true,
|
|
34638
|
+
"summary": "Changing what this player has — spending currency, granting items, running\na crafting recipe, advancing a progression.\n\nSeparate from [EntityScope.inventory](api-reference-function.md#entityscope-inventory) on purpose: reads are cached and\nsafe to repeat, writes are neither, and one object holding both makes that\ndistinction invisible where you call it.",
|
|
34639
|
+
"deprecated": null,
|
|
34640
|
+
"params": [],
|
|
34641
|
+
"returns": null,
|
|
34642
|
+
"throws": null,
|
|
34643
|
+
"example": null,
|
|
34644
|
+
"defaultValue": null,
|
|
34645
|
+
"guides": []
|
|
34646
|
+
},
|
|
34647
|
+
{
|
|
34648
|
+
"id": "PlayerScope.saves",
|
|
34649
|
+
"name": "saves",
|
|
34650
|
+
"anchor": "playerscope-saves",
|
|
34651
|
+
"group": "player",
|
|
34652
|
+
"signature": "readonly saves: SavesApi",
|
|
34653
|
+
"documented": true,
|
|
34654
|
+
"summary": "Saved progress — a world, a campaign, a replay. One document per key.\n\nThe line against [EntityScope.settings](api-reference-function.md#entityscope-settings) is what the value is, not how\nbig it is: a setting is a value your game names, a save is an opaque\ndocument the platform stores and hands back. A chosen difficulty is a\nsetting; the campaign it applies to is a save.\n\n**Every save key must be declared in your game config first.** Writing to an\nundeclared key fails with a message naming it.",
|
|
34655
|
+
"deprecated": null,
|
|
34656
|
+
"params": [],
|
|
34657
|
+
"returns": null,
|
|
34658
|
+
"throws": null,
|
|
34659
|
+
"example": null,
|
|
34660
|
+
"defaultValue": null,
|
|
34661
|
+
"guides": [
|
|
34662
|
+
{
|
|
34663
|
+
"slug": "saving-player-progress",
|
|
34664
|
+
"anchor": null
|
|
34665
|
+
}
|
|
34666
|
+
]
|
|
34667
|
+
},
|
|
34668
|
+
{
|
|
34669
|
+
"id": "PlayerScope.orders",
|
|
34670
|
+
"name": "orders",
|
|
34671
|
+
"anchor": "playerscope-orders",
|
|
34672
|
+
"group": "player",
|
|
34673
|
+
"signature": "readonly orders: OrdersApi",
|
|
34674
|
+
"documented": true,
|
|
34675
|
+
"summary": "This entity's order history — a read-only record of changes that happened.\n\nCreating an order is [EntityScope.mutations](api-reference-function.md#entityscope-mutations); this answers \"what\nhappened\" and \"did my write land\" (`orders.get(orderId)`).",
|
|
34676
|
+
"deprecated": null,
|
|
34677
|
+
"params": [],
|
|
34678
|
+
"returns": null,
|
|
34679
|
+
"throws": null,
|
|
34680
|
+
"example": null,
|
|
34681
|
+
"defaultValue": null,
|
|
34682
|
+
"guides": []
|
|
34683
|
+
},
|
|
34684
|
+
{
|
|
34685
|
+
"id": "PlayerScope.progressions",
|
|
34686
|
+
"name": "progressions",
|
|
34687
|
+
"anchor": "playerscope-progressions",
|
|
34688
|
+
"group": "player",
|
|
34689
|
+
"signature": "readonly progressions: ProgressionsApi",
|
|
34690
|
+
"documented": true,
|
|
34691
|
+
"summary": "Progressions this entity is working through — a projection over the same\ncached snapshot [EntityScope.inventory](api-reference-function.md#entityscope-inventory) serves.",
|
|
34692
|
+
"deprecated": null,
|
|
34693
|
+
"params": [],
|
|
34694
|
+
"returns": null,
|
|
34695
|
+
"throws": null,
|
|
34696
|
+
"example": null,
|
|
34697
|
+
"defaultValue": null,
|
|
34698
|
+
"guides": []
|
|
34699
|
+
},
|
|
34700
|
+
{
|
|
34701
|
+
"id": "PlayerScope.passes",
|
|
34702
|
+
"name": "passes",
|
|
34703
|
+
"anchor": "playerscope-passes",
|
|
34704
|
+
"group": "player",
|
|
34705
|
+
"signature": "readonly passes: PassesApi",
|
|
34706
|
+
"documented": true,
|
|
34707
|
+
"summary": "Which store passes the player holds, of those the platform lets games see.\nFor drawing a door; your function or server decides what a pass unlocks.",
|
|
34708
|
+
"deprecated": null,
|
|
34709
|
+
"params": [],
|
|
34710
|
+
"returns": null,
|
|
34711
|
+
"throws": null,
|
|
34712
|
+
"example": null,
|
|
34713
|
+
"defaultValue": null,
|
|
34714
|
+
"guides": [
|
|
34715
|
+
{
|
|
34716
|
+
"slug": "arcade-and-store",
|
|
34717
|
+
"anchor": null
|
|
34718
|
+
}
|
|
34719
|
+
]
|
|
34720
|
+
},
|
|
34065
34721
|
{
|
|
34066
34722
|
"id": "Setting",
|
|
34067
34723
|
"name": "Setting",
|
|
@@ -38994,7 +39650,7 @@
|
|
|
38994
39650
|
"name": "me",
|
|
38995
39651
|
"anchor": "gemfunction-me",
|
|
38996
39652
|
"group": "start",
|
|
38997
|
-
"signature": "readonly me:
|
|
39653
|
+
"signature": "readonly me: PlayerScope",
|
|
38998
39654
|
"documented": true,
|
|
38999
39655
|
"summary": "The invoking player's data in your game — settings, inventory, currencies,\nsaves. Throws on a game-server invocation, which has no player.",
|
|
39000
39656
|
"deprecated": null,
|