@tinyburg/lego-tower-sdk 0.0.0-stage → 0.1.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/src/index.ts ADDED
@@ -0,0 +1,59 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
4
+
5
+ /**
6
+ * LEGO Tower (game code `lt`) NBSync api endpoints.
7
+ *
8
+ * Signing: a random `salt` (signed int32) goes in the path, and `hash` is
9
+ * `md5(<preimage> + <game secret salt>)` with the preimage
10
+ * `lt/<playerId>/<salt><playerAuthKey>` (variants noted per endpoint). The
11
+ * secret salt is the value extracted from `NBSync._ss`.
12
+ *
13
+ * Verification (live server + Frida DTO inspection of the game, 2026-08-26):
14
+ * - Signing is MD5, server-validated (same scheme as Tiny Tower / Pocket
15
+ * Planes; the game computes SHA-256 only for the unauthenticated `register`).
16
+ * - Response envelopes VERIFIED by reading the game's DTO classes at runtime:
17
+ * register, player_details, sync/pull (NBSyncGameSaveResponse), current_version,
18
+ * verify_device, friend/pull_game, friend/pull_meta (meta is a flat
19
+ * Dictionary<String,Object> on pt), send_item (NBSyncItemsSendResponse),
20
+ * get_items (NBSyncItemsGetResponse: success/gifts, NO `total` unlike pp).
21
+ * `get_items` was also exercised live with a burnbot.
22
+ * - Rich endpoint set: adds snapshots, trades, mailbox, AG, and LL-friends.
23
+ * - LEGO Tower issues player ids longer than 5 chars (relaxed PlayerId schema).
24
+ *
25
+ * Game-specific save/meta schemas are left as `Schema.Unknown` placeholders.
26
+ *
27
+ * @since 1.0.0
28
+ * @category Endpoints
29
+ */
30
+ export * as Endpoints from "./Endpoints.ts"
31
+
32
+ /**
33
+ * LEGO Tower SDK: signed calls against Nimblebit's NBSync service.
34
+ *
35
+ * Signing reuses `@tinyburg/nimblebit-sdk` (`NimblebitAuth`): the game secret
36
+ * salt (from `NBSync._ss`) is provided as the auth key, and each request is
37
+ * `md5(<preimage> + <secret salt>)` with a random uint32 `salt` in the path.
38
+ * All method preimages below are the Tiny Tower formula with the `lt` game code.
39
+ *
40
+ * The methods that were exercised live against sync.nimblebit.com are marked
41
+ * VERIFIED; save-bearing / write paths follow the same pattern but were not
42
+ * exercised. Save bytes are returned raw (base64-decoded); inflating (pako) and
43
+ * parsing into a save schema is left to the caller.
44
+ *
45
+ * @since 1.0.0
46
+ * @category SDK
47
+ */
48
+ export * as LegoTower from "./LegoTower.ts"
49
+
50
+ /**
51
+ * The scopes the LEGO Tower api is guarded by, as a game-rooted tree, built with
52
+ * `@tinyburg/nimblebit-sdk`'s `defineGame`. Only the endpoints this sdk defines
53
+ * are covered; areas without both a read and a write side are left out until
54
+ * their endpoints exist.
55
+ *
56
+ * @since 1.0.0
57
+ * @category Scopes
58
+ */
59
+ export * as Scopes from "./Scopes.ts"