@tinyburg/disco-zoo-sdk 0.0.0-stage → 0.1.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.
@@ -0,0 +1,297 @@
1
+ /**
2
+ * Disco Zoo (game code `dz`) NBSync api endpoints.
3
+ *
4
+ * Signing: a random `salt` (signed int32) goes in the path, and `hash` is
5
+ * `md5(<preimage> + <game secret salt>)` with the preimage
6
+ * `dz/<playerId>/<salt><playerAuthKey>` (variants noted per endpoint). The
7
+ * secret salt is the value extracted from `NBSync._ss`.
8
+ *
9
+ * Verification (live server + Frida DTO inspection of the game, 2026-08-26):
10
+ * - Signing is MD5, server-validated (same scheme as Tiny Tower / Pocket
11
+ * Planes; the game computes SHA-256 only for the unauthenticated `register`).
12
+ * - Response envelopes VERIFIED by reading the game's DTO classes at runtime:
13
+ * register, player_details, sync/pull (NBSyncGameSaveResponse), current_version,
14
+ * verify_device, friend/pull_game, friend/pull_meta (meta is a flat
15
+ * Dictionary<String,Object> on pt), send_item (NBSyncItemsSendResponse),
16
+ * get_items (NBSyncItemsGetResponse: success/gifts, NO `total` unlike pp).
17
+ * `get_items` was also exercised live with a burnbot.
18
+ * - Standard NBSync endpoint set plus get_visits and receive_item.
19
+ *
20
+ * Game-specific save/meta schemas are left as `Schema.Unknown` placeholders.
21
+ *
22
+ * @since 1.0.0
23
+ * @category Endpoints
24
+ */
25
+ import { HttpApi, HttpApiEndpoint, HttpApiError, HttpApiGroup } from "effect/http-api";
26
+ import * as Schema from "effect/Schema";
27
+ import * as NimblebitConfig from "@tinyburg/nimblebit-sdk/NimblebitConfig";
28
+ import * as OAuthScope from "@yielded/auth/OAuthScope";
29
+ import * as Scopes from "./Scopes.js";
30
+ /** @internal */
31
+ export const U32 = /*#__PURE__*/Schema.Int.check(/*#__PURE__*/Schema.isUint32());
32
+ /** @internal */
33
+ export const ApiErrors = [HttpApiError.Forbidden, HttpApiError.BadRequest, HttpApiError.Unauthorized, HttpApiError.InternalServerError];
34
+ /** @internal */
35
+ export const ErrorResponse = /*#__PURE__*/Schema.Struct({
36
+ error: Schema.String
37
+ });
38
+ /** @internal */
39
+ export const NotFoundResponse = /*#__PURE__*/Schema.Struct({
40
+ success: /*#__PURE__*/Schema.Literal("NotFound")
41
+ });
42
+ /** @internal */
43
+ export const SentResponse = /*#__PURE__*/Schema.Struct({
44
+ success: /*#__PURE__*/Schema.Literal("Sent")
45
+ });
46
+ /** @internal */
47
+ export const NotSentResponse = /*#__PURE__*/Schema.Struct({
48
+ success: /*#__PURE__*/Schema.Literal("NotSent")
49
+ });
50
+ /**
51
+ * A gift/item in the general item channel (get_items / send_item). Verified DTO
52
+ * NBSyncItemsGift on pt: `{gift_id, gift_to, gift_from, gift_type, item_type,
53
+ * gift_str, h}` (no `c`, unlike pp). Left open for the data-schema work.
54
+ *
55
+ * @since 1.0.0
56
+ * @category Schemas
57
+ */
58
+ export const Gift = Schema.Unknown;
59
+ /** @internal */
60
+ export const DeviceNewPlayerEndpoint = /*#__PURE__*/HttpApiEndpoint.get("DeviceNewPlayer", "/register/dz/:salt1/:salt2/:hash", {
61
+ params: {
62
+ salt1: U32,
63
+ salt2: U32,
64
+ hash: Schema.String
65
+ },
66
+ error: ApiErrors,
67
+ success: [ErrorResponse, /*#__PURE__*/Schema.Struct({
68
+ playerId: NimblebitConfig.PlayerIdSchema,
69
+ playerSs: NimblebitConfig.PlayerAuthKeySchema
70
+ }).pipe(/*#__PURE__*/Schema.encodeKeys({
71
+ playerId: "player_id",
72
+ playerSs: "player_ss"
73
+ }))]
74
+ });
75
+ /** @internal */
76
+ export const DevicePlayerDetailsEndpoint = /*#__PURE__*/HttpApiEndpoint.get("DevicePlayerDetails", "/player_details/dz/:playerId/:salt/:hash", {
77
+ params: {
78
+ playerId: NimblebitConfig.PlayerIdSchema,
79
+ salt: U32,
80
+ hash: Schema.String
81
+ },
82
+ error: ApiErrors,
83
+ success: [ErrorResponse, Schema.Struct({
84
+ success: Schema.Literal("Found"),
85
+ player: Schema.Struct({
86
+ playerId: NimblebitConfig.PlayerIdSchema,
87
+ playerEmail: NimblebitConfig.PlayerEmailSchema,
88
+ registered: Schema.NumberFromString.pipe(Schema.decodeTo(Schema.BooleanFromBit)),
89
+ blacklisted: Schema.NumberFromString.pipe(Schema.decodeTo(Schema.BooleanFromBit)),
90
+ saveVersion: Schema.NumberFromString.pipe(Schema.decodeTo(Schema.Int)),
91
+ checksum: Schema.String
92
+ }).pipe(Schema.encodeKeys({
93
+ playerId: "player_id",
94
+ playerEmail: "email",
95
+ checksum: "h"
96
+ }))
97
+ })]
98
+ }).annotate(OAuthScope.Required, Scopes.Device.read.player_details.required);
99
+ /** @internal */
100
+ export const DeviceVerifyDeviceEndpoint = /*#__PURE__*/HttpApiEndpoint.get("DeviceVerifyDevice", "/verify_device/dz/:playerId/:verificationCode", {
101
+ params: {
102
+ playerId: NimblebitConfig.PlayerIdSchema,
103
+ verificationCode: Schema.String
104
+ },
105
+ error: ApiErrors,
106
+ success: [ErrorResponse, Schema.Struct({
107
+ success: Schema.Literal("NewDevice"),
108
+ playerId: NimblebitConfig.PlayerIdSchema,
109
+ playerAuthKey: NimblebitConfig.PlayerAuthKeySchema,
110
+ playerEmail: NimblebitConfig.PlayerEmailSchema
111
+ }).pipe(Schema.encodeKeys({
112
+ playerId: "player_id",
113
+ playerAuthKey: "player_ss",
114
+ playerEmail: "player_email"
115
+ }))]
116
+ }).annotate(OAuthScope.Required, Scopes.Device.write.verify_device.required);
117
+ /**
118
+ * Pull the player's cloud save. VERIFIED envelope (NBSyncGameSaveResponse). No-save
119
+ * case returns `{ error: "SaveNotFound" }`. `data` is base64 pako-deflated bytes.
120
+ *
121
+ * @internal
122
+ */
123
+ export const SyncPullSaveEndpoint = /*#__PURE__*/HttpApiEndpoint.get("SyncPullSave", "/sync/pull/dz/:playerId/:salt/:hash", {
124
+ params: {
125
+ playerId: NimblebitConfig.PlayerIdSchema,
126
+ salt: U32,
127
+ hash: Schema.String
128
+ },
129
+ error: ApiErrors,
130
+ success: [ErrorResponse, NotFoundResponse, /*#__PURE__*/Schema.Struct({
131
+ success: Schema.Literal("Found"),
132
+ data: Schema.Uint8ArrayFromBase64,
133
+ checksum: Schema.String,
134
+ saveId: Schema.NumberFromString
135
+ }).pipe(/*#__PURE__*/Schema.encodeKeys({
136
+ checksum: "h",
137
+ saveId: "id"
138
+ }))]
139
+ });
140
+ /**
141
+ * VERIFIED envelope (NBSyncCurrentCheckResponse); no-save returns `{ error: "NoSave" }`.
142
+ *
143
+ * @internal
144
+ */
145
+ export const SyncCheckForNewerSaveEndpoint = /*#__PURE__*/HttpApiEndpoint.get("SyncCheckForNewerSave", "/sync/current_version/dz/:playerId/:salt/:hash", {
146
+ params: {
147
+ playerId: NimblebitConfig.PlayerIdSchema,
148
+ salt: U32,
149
+ hash: Schema.String
150
+ },
151
+ error: ApiErrors,
152
+ success: [ErrorResponse, NotFoundResponse, /*#__PURE__*/Schema.Struct({
153
+ success: Schema.Literal("Found"),
154
+ checksum: Schema.String,
155
+ saveId: Schema.NumberFromString
156
+ }).pipe(/*#__PURE__*/Schema.encodeKeys({
157
+ checksum: "h",
158
+ saveId: "id"
159
+ }))]
160
+ });
161
+ /**
162
+ * VERIFIED live: `/get_items/dz/:playerId/:salt/:hash` -> `{ success:"Found",
163
+ * gifts:[...] }` (NBSyncItemsGetResponse; no `total` on pt).
164
+ *
165
+ * @internal
166
+ */
167
+ export const SocialGetItemsEndpoint = /*#__PURE__*/HttpApiEndpoint.get("SocialGetItems", "/get_items/dz/:playerId/:salt/:hash", {
168
+ params: {
169
+ playerId: NimblebitConfig.PlayerIdSchema,
170
+ salt: U32,
171
+ hash: Schema.String
172
+ },
173
+ error: ApiErrors,
174
+ success: [ErrorResponse, NotFoundResponse, Schema.Struct({
175
+ success: Schema.Literal("Found"),
176
+ gifts: Schema.Array(Gift)
177
+ })]
178
+ }).annotate(OAuthScope.Required, Scopes.Social.read.get_items.required);
179
+ /**
180
+ * DERIVED from Tiny Tower. Sends an item to a friend. Response VERIFIED
181
+ * (NBSyncItemsSendResponse: success/error). pt also has a `/send_pt/` variant.
182
+ *
183
+ * @internal
184
+ */
185
+ export const SocialSendItemEndpoint = /*#__PURE__*/HttpApiEndpoint.post("SocialSendItem", "/send_item/dz/:itemType/:playerId/:friendId/:salt/:hash", {
186
+ params: {
187
+ itemType: Schema.String,
188
+ playerId: NimblebitConfig.PlayerIdSchema,
189
+ friendId: NimblebitConfig.PlayerIdSchema,
190
+ salt: U32,
191
+ hash: Schema.String
192
+ },
193
+ payload: Schema.Struct({
194
+ itemStr: Schema.String
195
+ }),
196
+ error: ApiErrors,
197
+ success: [ErrorResponse, SentResponse, NotSentResponse]
198
+ }).annotate(OAuthScope.Required, Scopes.Social.write.send_item.required);
199
+ /**
200
+ * VERIFIED envelope (NBSyncFriendGameSaveResponse); preimage
201
+ * `dz/<playerId>/<friendId>/<salt><playerAuthKey>`.
202
+ *
203
+ * @internal
204
+ */
205
+ export const SocialPullFriendGameEndpoint = /*#__PURE__*/HttpApiEndpoint.get("SocialPullFriendGame", "/friend/pull_game/dz/:playerId/:friendId/:salt/:hash", {
206
+ params: {
207
+ playerId: NimblebitConfig.PlayerIdSchema,
208
+ friendId: NimblebitConfig.PlayerIdSchema,
209
+ salt: U32,
210
+ hash: Schema.String
211
+ },
212
+ error: ApiErrors,
213
+ success: [ErrorResponse, NotFoundResponse, Schema.Struct({
214
+ success: Schema.Literal("Found"),
215
+ data: Schema.Uint8ArrayFromBase64,
216
+ checksum: Schema.String,
217
+ saveId: Schema.NumberFromString,
218
+ playerId: NimblebitConfig.PlayerIdSchema
219
+ }).pipe(Schema.encodeKeys({
220
+ checksum: "h",
221
+ saveId: "id",
222
+ playerId: "player_id"
223
+ }))]
224
+ }).annotate(OAuthScope.Required, Scopes.Social.read.pull_friend_game.required);
225
+ /**
226
+ * VERIFIED envelope (NBSyncFriendGameMetaResponse; `meta` is a flat
227
+ * Dictionary<String,Object> on pt). Preimage `dz/<playerId>/<salt><friendId><playerAuthKey>`.
228
+ *
229
+ * @internal
230
+ */
231
+ export const SocialPullFriendMetaEndpoint = /*#__PURE__*/HttpApiEndpoint.post("SocialPullFriendMeta", "/friend/pull_meta/dz/:playerId/:salt/:hash", {
232
+ params: {
233
+ playerId: NimblebitConfig.PlayerIdSchema,
234
+ salt: U32,
235
+ hash: Schema.String
236
+ },
237
+ payload: Schema.Struct({
238
+ friends: NimblebitConfig.PlayerIdSchema
239
+ }),
240
+ error: ApiErrors,
241
+ success: [ErrorResponse, NotFoundResponse, Schema.Struct({
242
+ success: Schema.Literal("Found"),
243
+ meta: Schema.Record(NimblebitConfig.PlayerIdSchema, Schema.Unknown)
244
+ })]
245
+ }).annotate(OAuthScope.Required, Scopes.Social.read.pull_friend_meta.required);
246
+ /**
247
+ * VERIFIED path: `/get_visits/dz/:playerId/:salt/:hash`. Same envelope as get_items.
248
+ *
249
+ * @internal
250
+ */
251
+ export const SocialGetVisitsEndpoint = /*#__PURE__*/HttpApiEndpoint.get("SocialGetVisits", "/get_visits/dz/:playerId/:salt/:hash", {
252
+ params: {
253
+ playerId: NimblebitConfig.PlayerIdSchema,
254
+ salt: U32,
255
+ hash: Schema.String
256
+ },
257
+ error: ApiErrors,
258
+ success: [ErrorResponse, NotFoundResponse, Schema.Struct({
259
+ success: Schema.Literal("Found"),
260
+ gifts: Schema.Array(Gift)
261
+ })]
262
+ }).annotate(OAuthScope.Required, Scopes.Social.read.get_visits.required);
263
+ /**
264
+ * Preimage `dz/<playerId>/<giftId>/<salt><playerAuthKey>`. Response DTO
265
+ * NBSyncItemsReceiveResponse (success/error/id).
266
+ *
267
+ * @internal
268
+ */
269
+ export const SocialReceiveItemEndpoint = /*#__PURE__*/HttpApiEndpoint.get("SocialReceiveItem", "/receive_item/dz/:playerId/:giftId/:salt/:hash", {
270
+ params: {
271
+ playerId: NimblebitConfig.PlayerIdSchema,
272
+ giftId: Schema.Int,
273
+ salt: U32,
274
+ hash: Schema.String
275
+ },
276
+ error: ApiErrors,
277
+ success: [ErrorResponse, Schema.Struct({
278
+ success: Schema.Literal("Received"),
279
+ id: Schema.optionalKey(Schema.String)
280
+ }), Schema.Struct({
281
+ success: Schema.Literal("NotReceived")
282
+ })]
283
+ }).annotate(OAuthScope.Required, Scopes.Social.write.receive_item.required);
284
+ /** @internal */
285
+ export const DeviceManagementGroup = /*#__PURE__*/HttpApiGroup.make("DeviceManagementGroup").add(DeviceNewPlayerEndpoint).add(DevicePlayerDetailsEndpoint).add(DeviceVerifyDeviceEndpoint);
286
+ /** @internal */
287
+ export const SyncManagementGroup = /*#__PURE__*/HttpApiGroup.make("SyncManagementGroup").add(SyncPullSaveEndpoint).add(SyncCheckForNewerSaveEndpoint);
288
+ /** @internal */
289
+ export const SocialGroup = /*#__PURE__*/HttpApiGroup.make("SocialGroup").add(SocialGetItemsEndpoint).add(SocialGetVisitsEndpoint).add(SocialReceiveItemEndpoint).add(SocialSendItemEndpoint).add(SocialPullFriendGameEndpoint).add(SocialPullFriendMetaEndpoint);
290
+ /**
291
+ * The Disco Zoo NBSync api.
292
+ *
293
+ * @since 1.0.0
294
+ * @category Api
295
+ */
296
+ export const Api = /*#__PURE__*/HttpApi.make("DiscoZooApi").add(DeviceManagementGroup).add(SyncManagementGroup).add(SocialGroup);
297
+ //# sourceMappingURL=Endpoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Endpoints.js","names":[],"sources":["../src/Endpoints.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,SAAS,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,QAAQ,iBAAiB;AACtF,OAAO,KAAK,MAAM,MAAM,eAAe;AAEvC,OAAO,KAAK,eAAe,MAAM,yCAAyC;AAC1E,OAAO,KAAK,UAAU,MAAM,0BAA0B;AAEtD,OAAO,KAAK,MAAM,MAAM,aAAa;AAErC;AACA,OAAO,MAAM,GAAG,gBAAG,MAAM,CAAC,GAAG,CAAC,K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AAC,CACjC,GAAG,CAAC,4BAA4B,CAAC;AAEtC;;;;;;AAMA,OAAO,MAAM,GAAG,gBAAG,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC","ignoreList":[]}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * The scopes the Disco Zoo api is guarded by, as a game-rooted tree, built with
3
+ * `@tinyburg/nimblebit-sdk`'s `defineGame`. Only the endpoints this sdk defines
4
+ * are covered; areas without both a read and a write side are left out until
5
+ * their endpoints exist.
6
+ *
7
+ * @since 1.0.0
8
+ * @category Scopes
9
+ */
10
+ import { type Game, type ScopeDescription } from "@tinyburg/nimblebit-sdk/NimblebitScopes";
11
+ /**
12
+ * @since 1.0.0
13
+ * @category Games
14
+ */
15
+ export declare const DiscoZoo: Game & {
16
+ readonly areas: {
17
+ readonly device: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Area & {
18
+ readonly read: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Branch & {
19
+ readonly player_details: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Leaf;
20
+ };
21
+ readonly write: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Branch & {
22
+ readonly verify_device: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Leaf;
23
+ };
24
+ };
25
+ readonly social: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Area & {
26
+ readonly read: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Branch & {
27
+ readonly get_items: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Leaf;
28
+ readonly get_visits: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Leaf;
29
+ readonly pull_friend_game: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Leaf;
30
+ readonly pull_friend_meta: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Leaf;
31
+ };
32
+ readonly write: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Branch & {
33
+ readonly receive_item: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Leaf;
34
+ readonly send_item: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Leaf;
35
+ };
36
+ };
37
+ };
38
+ };
39
+ /**
40
+ * The game's areas, by name, for annotating endpoints.
41
+ *
42
+ * @since 1.0.0
43
+ * @category Areas
44
+ */
45
+ export declare const Device: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Area & {
46
+ readonly read: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Branch & {
47
+ readonly player_details: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Leaf;
48
+ };
49
+ readonly write: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Branch & {
50
+ readonly verify_device: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Leaf;
51
+ };
52
+ }, Social: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Area & {
53
+ readonly read: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Branch & {
54
+ readonly get_items: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Leaf;
55
+ readonly get_visits: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Leaf;
56
+ readonly pull_friend_game: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Leaf;
57
+ readonly pull_friend_meta: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Leaf;
58
+ };
59
+ readonly write: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Branch & {
60
+ readonly receive_item: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Leaf;
61
+ readonly send_item: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Leaf;
62
+ };
63
+ };
64
+ /**
65
+ * @since 1.0.0
66
+ * @category Tree
67
+ */
68
+ export declare const Games: ReadonlyArray<Game>;
69
+ /**
70
+ * @since 1.0.0
71
+ * @category Tree
72
+ */
73
+ export declare const all: () => ReadonlyArray<ScopeDescription>;
74
+ //# sourceMappingURL=Scopes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Scopes.d.ts","sourceRoot":"","sources":["../src/Scopes.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,gBAAgB,EAAc,MAAM,yCAAyC,CAAC;AAEvG;;;GAGG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;CAyCnB,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAgB,MAAM;;;;;;;GAAU,MAAM;;;;;;;;;;;CAAmB,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,KAAK,EAAE,aAAa,CAAC,IAAI,CAAc,CAAC;AAErD;;;GAGG;AACH,eAAO,MAAM,GAAG,QAAO,aAAa,CAAC,gBAAgB,CAY/C,CAAC"}
package/dist/Scopes.js ADDED
@@ -0,0 +1,81 @@
1
+ /**
2
+ * The scopes the Disco Zoo api is guarded by, as a game-rooted tree, built with
3
+ * `@tinyburg/nimblebit-sdk`'s `defineGame`. Only the endpoints this sdk defines
4
+ * are covered; areas without both a read and a write side are left out until
5
+ * their endpoints exist.
6
+ *
7
+ * @since 1.0.0
8
+ * @category Scopes
9
+ */
10
+ import { defineGame } from "@tinyburg/nimblebit-sdk/NimblebitScopes";
11
+ /**
12
+ * @since 1.0.0
13
+ * @category Games
14
+ */
15
+ export const DiscoZoo = /*#__PURE__*/defineGame({
16
+ name: "discozoo",
17
+ description: "Disco Zoo",
18
+ read: {
19
+ description: "Everything in Disco Zoo that only looks"
20
+ },
21
+ write: {
22
+ description: "Everything in Disco Zoo that changes a player's game"
23
+ },
24
+ areas: {
25
+ device: {
26
+ description: "Player accounts and their devices",
27
+ read: {
28
+ description: "Look up player accounts",
29
+ leaves: {
30
+ player_details: "Look up a player's public profile details"
31
+ }
32
+ },
33
+ write: {
34
+ description: "Change a player's account or devices",
35
+ leaves: {
36
+ verify_device: "Complete a device verification code"
37
+ }
38
+ }
39
+ },
40
+ social: {
41
+ description: "Gifts, visits and friends",
42
+ read: {
43
+ description: "See gifts, visits and friends' games",
44
+ leaves: {
45
+ get_items: "See the items waiting for a player",
46
+ get_visits: "See who has visited a player",
47
+ pull_friend_game: "Download a friend's game data",
48
+ pull_friend_meta: "Fetch metadata about a player's friends"
49
+ }
50
+ },
51
+ write: {
52
+ description: "Send and accept gifts and items",
53
+ leaves: {
54
+ send_item: "Send items to another player",
55
+ receive_item: "Accept an item on a player's behalf"
56
+ }
57
+ }
58
+ }
59
+ }
60
+ });
61
+ /**
62
+ * The game's areas, by name, for annotating endpoints.
63
+ *
64
+ * @since 1.0.0
65
+ * @category Areas
66
+ */
67
+ export const {
68
+ device: Device,
69
+ social: Social
70
+ } = DiscoZoo.areas;
71
+ /**
72
+ * @since 1.0.0
73
+ * @category Tree
74
+ */
75
+ export const Games = [DiscoZoo];
76
+ /**
77
+ * @since 1.0.0
78
+ * @category Tree
79
+ */
80
+ export const all = () => Games.flatMap(game => [game, game.read, game.write, ...Object.values(game.areas).flatMap(area => [area, area.read, ...area.read.children, area.write, ...area.write.children])]);
81
+ //# sourceMappingURL=Scopes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Scopes.js","names":[],"sources":["../src/Scopes.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;AAUA,SAA2C,UAAU,QAAQ,yCAAyC;AAEtG;;;;AAIA,OAAO,MAAM,QAAQ,gBAAG,UAAU,CAAC;EAC/B,IAAI,EAAE,UAAU;EAChB,WAAW,EAAE,WAAW;EACxB,IAAI,EAAE;IAAE,WAAW,EAAE;EAAyC,CAAE;EAChE,KAAK,EAAE;IAAE,WAAW,EAAE;EAAsD,CAAE;EAC9E,KAAK,EAAE;IACH,MAAM,EAAE;MACJ,WAAW,EAAE,mCAAmC;MAChD,IAAI,EAAE;QACF,WAAW,EAAE,yBAAyB;QACtC,MAAM,EAAE;UACJ,cAAc,EAAE;;OAEvB;MACD,KAAK,EAAE;QACH,WAAW,EAAE,sCAAsC;QACnD,MAAM,EAAE;UACJ,aAAa,EAAE;;;KAG1B;IACD,MAAM,EAAE;MACJ,WAAW,EAAE,2BAA2B;MACxC,IAAI,EAAE;QACF,WAAW,EAAE,sCAAsC;QACnD,MAAM,EAAE;UACJ,SAAS,EAAE,oCAAoC;UAC/C,UAAU,EAAE,8BAA8B;UAC1C,gBAAgB,EAAE,+BAA+B;UACjD,gBAAgB,EAAE;;OAEzB;MACD,KAAK,EAAE;QACH,WAAW,EAAE,iCAAiC;QAC9C,MAAM,EAAE;UACJ,SAAS,EAAE,8BAA8B;UACzC,YAAY,EAAE;;;;;CAKjC,CAAC;AAEF;;;;;;AAMA,OAAO,MAAM;EAAE,MAAM,EAAE,MAAM;EAAE,MAAM,EAAE;AAAM,CAAE,GAAG,QAAQ,CAAC,KAAK;AAEhE;;;;AAIA,OAAO,MAAM,KAAK,GAAwB,CAAC,QAAQ,CAAC;AAEpD;;;;AAIA,OAAO,MAAM,GAAG,GAAG,MACf,KAAK,CAAC,OAAO,CAAE,IAAI,IAAK,CACpB,IAAI,EACJ,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,KAAK,EACV,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAE,IAAI,IAAK,CAC3C,IAAI,EACJ,IAAI,CAAC,IAAI,EACT,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EACrB,IAAI,CAAC,KAAK,EACV,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CACzB,CAAC,CACL,CAAC","ignoreList":[]}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
4
+ /**
5
+ * Disco Zoo SDK: signed calls against Nimblebit's NBSync service.
6
+ *
7
+ * Signing reuses `@tinyburg/nimblebit-sdk` (`NimblebitAuth`): the game secret
8
+ * salt (from `NBSync._ss`) is provided as the auth key, and each request is
9
+ * `md5(<preimage> + <secret salt>)` with a random uint32 `salt` in the path.
10
+ * All method preimages below are the Tiny Tower formula with the `dz` game code.
11
+ *
12
+ * The methods that were exercised live against sync.nimblebit.com are marked
13
+ * VERIFIED; save-bearing / write paths follow the same pattern but were not
14
+ * exercised. Save bytes are returned raw (base64-decoded); inflating (pako) and
15
+ * parsing into a save schema is left to the caller.
16
+ *
17
+ * @since 1.0.0
18
+ * @category SDK
19
+ */
20
+ export * as DiscoZoo from "./DiscoZoo.ts";
21
+ /**
22
+ * Disco Zoo (game code `dz`) NBSync api endpoints.
23
+ *
24
+ * Signing: a random `salt` (signed int32) goes in the path, and `hash` is
25
+ * `md5(<preimage> + <game secret salt>)` with the preimage
26
+ * `dz/<playerId>/<salt><playerAuthKey>` (variants noted per endpoint). The
27
+ * secret salt is the value extracted from `NBSync._ss`.
28
+ *
29
+ * Verification (live server + Frida DTO inspection of the game, 2026-08-26):
30
+ * - Signing is MD5, server-validated (same scheme as Tiny Tower / Pocket
31
+ * Planes; the game computes SHA-256 only for the unauthenticated `register`).
32
+ * - Response envelopes VERIFIED by reading the game's DTO classes at runtime:
33
+ * register, player_details, sync/pull (NBSyncGameSaveResponse), current_version,
34
+ * verify_device, friend/pull_game, friend/pull_meta (meta is a flat
35
+ * Dictionary<String,Object> on pt), send_item (NBSyncItemsSendResponse),
36
+ * get_items (NBSyncItemsGetResponse: success/gifts, NO `total` unlike pp).
37
+ * `get_items` was also exercised live with a burnbot.
38
+ * - Standard NBSync endpoint set plus get_visits and receive_item.
39
+ *
40
+ * Game-specific save/meta schemas are left as `Schema.Unknown` placeholders.
41
+ *
42
+ * @since 1.0.0
43
+ * @category Endpoints
44
+ */
45
+ export * as Endpoints from "./Endpoints.ts";
46
+ /**
47
+ * The scopes the Disco Zoo api is guarded by, as a game-rooted tree, built with
48
+ * `@tinyburg/nimblebit-sdk`'s `defineGame`. Only the endpoints this sdk defines
49
+ * are covered; areas without both a read and a write side are left out until
50
+ * their endpoints exist.
51
+ *
52
+ * @since 1.0.0
53
+ * @category Scopes
54
+ */
55
+ export * as Scopes from "./Scopes.ts";
56
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AAEzC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAE3C;;;;;;;;GAQG;AACH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,56 @@
1
+ /**
2
+ * @since 1.0.0
3
+ */
4
+ /**
5
+ * Disco Zoo SDK: signed calls against Nimblebit's NBSync service.
6
+ *
7
+ * Signing reuses `@tinyburg/nimblebit-sdk` (`NimblebitAuth`): the game secret
8
+ * salt (from `NBSync._ss`) is provided as the auth key, and each request is
9
+ * `md5(<preimage> + <secret salt>)` with a random uint32 `salt` in the path.
10
+ * All method preimages below are the Tiny Tower formula with the `dz` game code.
11
+ *
12
+ * The methods that were exercised live against sync.nimblebit.com are marked
13
+ * VERIFIED; save-bearing / write paths follow the same pattern but were not
14
+ * exercised. Save bytes are returned raw (base64-decoded); inflating (pako) and
15
+ * parsing into a save schema is left to the caller.
16
+ *
17
+ * @since 1.0.0
18
+ * @category SDK
19
+ */
20
+ export * as DiscoZoo from "./DiscoZoo.js";
21
+ /**
22
+ * Disco Zoo (game code `dz`) NBSync api endpoints.
23
+ *
24
+ * Signing: a random `salt` (signed int32) goes in the path, and `hash` is
25
+ * `md5(<preimage> + <game secret salt>)` with the preimage
26
+ * `dz/<playerId>/<salt><playerAuthKey>` (variants noted per endpoint). The
27
+ * secret salt is the value extracted from `NBSync._ss`.
28
+ *
29
+ * Verification (live server + Frida DTO inspection of the game, 2026-08-26):
30
+ * - Signing is MD5, server-validated (same scheme as Tiny Tower / Pocket
31
+ * Planes; the game computes SHA-256 only for the unauthenticated `register`).
32
+ * - Response envelopes VERIFIED by reading the game's DTO classes at runtime:
33
+ * register, player_details, sync/pull (NBSyncGameSaveResponse), current_version,
34
+ * verify_device, friend/pull_game, friend/pull_meta (meta is a flat
35
+ * Dictionary<String,Object> on pt), send_item (NBSyncItemsSendResponse),
36
+ * get_items (NBSyncItemsGetResponse: success/gifts, NO `total` unlike pp).
37
+ * `get_items` was also exercised live with a burnbot.
38
+ * - Standard NBSync endpoint set plus get_visits and receive_item.
39
+ *
40
+ * Game-specific save/meta schemas are left as `Schema.Unknown` placeholders.
41
+ *
42
+ * @since 1.0.0
43
+ * @category Endpoints
44
+ */
45
+ export * as Endpoints from "./Endpoints.js";
46
+ /**
47
+ * The scopes the Disco Zoo api is guarded by, as a game-rooted tree, built with
48
+ * `@tinyburg/nimblebit-sdk`'s `defineGame`. Only the endpoints this sdk defines
49
+ * are covered; areas without both a read and a write side are left out until
50
+ * their endpoints exist.
51
+ *
52
+ * @since 1.0.0
53
+ * @category Scopes
54
+ */
55
+ export * as Scopes from "./Scopes.js";
56
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAIA;;;;;;;;;;;;;;;;AAgBA,OAAO,KAAK,QAAQ,MAAM,eAAe;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,OAAO,KAAK,SAAS,MAAM,gBAAgB;AAE3C;;;;;;;;;AASA,OAAO,KAAK,MAAM,MAAM,aAAa","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,51 @@
1
1
  {
2
2
  "name": "@tinyburg/disco-zoo-sdk",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.1",
4
+ "description": "api for the mobile game Disco Zoo by Nimblebit",
5
+ "keywords": [
6
+ "disco-zoo-sdk",
7
+ "nimblebit"
8
+ ],
9
+ "homepage": "https://github.com/leonitousconforti/tinyburg",
10
+ "license": "GPL-3.0-only",
11
+ "author": "Leo Conforti <leo@leoconforti.us> (https://leoconforti.us)",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/leonitousconforti/tinyburg.git",
15
+ "directory": "packages/disco-zoo-sdk"
16
+ },
17
+ "files": [
18
+ "src/**/*.ts",
19
+ "dist/**/*.js",
20
+ "dist/**/*.js.map",
21
+ "dist/**/*.d.ts",
22
+ "dist/**/*.d.ts.map"
23
+ ],
24
+ "type": "module",
25
+ "sideEffects": false,
26
+ "exports": {
27
+ "./package.json": "./package.json",
28
+ ".": "./dist/index.js",
29
+ "./*": "./dist/*.js",
30
+ "./internal/*": null
31
+ },
32
+ "publishConfig": {
33
+ "access": "public"
34
+ },
35
+ "dependencies": {
36
+ "@tinyburg/nimblebit-sdk": "0.2.1"
37
+ },
38
+ "devDependencies": {
39
+ "@yielded/auth": "0.1.0-beta.47",
40
+ "effect": "4.1.1"
41
+ },
42
+ "peerDependencies": {
43
+ "@yielded/auth": "0.1.0-beta.47",
44
+ "effect": "4.1.1"
45
+ },
46
+ "scripts": {
47
+ "build": "tsc -b tsconfig.build.json && babel dist --plugins annotate-pure-calls --out-dir dist --source-maps",
48
+ "check": "tsc -b tsconfig.json",
49
+ "codegen": "build-utils prepare-v4"
50
+ }
6
51
  }