@tinyburg/bitcity-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.
- package/LICENSE +674 -0
- package/README.md +8 -2
- package/dist/BitCity.d.ts +83 -0
- package/dist/BitCity.d.ts.map +1 -0
- package/dist/BitCity.js +172 -0
- package/dist/BitCity.js.map +1 -0
- package/dist/Endpoints.d.ts +177 -0
- package/dist/Endpoints.d.ts.map +1 -0
- package/dist/Endpoints.js +259 -0
- package/dist/Endpoints.js.map +1 -0
- package/dist/Scopes.d.ts +70 -0
- package/dist/Scopes.d.ts.map +1 -0
- package/dist/Scopes.js +79 -0
- package/dist/Scopes.js.map +1 -0
- package/dist/index.d.ts +56 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +56 -0
- package/dist/index.js.map +1 -0
- package/package.json +48 -3
- package/src/BitCity.ts +186 -0
- package/src/Endpoints.ts +287 -0
- package/src/Scopes.ts +88 -0
- package/src/index.ts +58 -0
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bit City (game code `bc`) 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
|
+
* `bc/<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
|
+
* - Minimal NBSync endpoint set (Bit City is a lightweight city builder).
|
|
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/bc/: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/bc/: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/bc/: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/bc/: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/bc/: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/bc/: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/bc/: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/bc/: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
|
+
* `bc/<playerId>/<friendId>/<salt><playerAuthKey>`.
|
|
202
|
+
*
|
|
203
|
+
* @internal
|
|
204
|
+
*/
|
|
205
|
+
export const SocialPullFriendGameEndpoint = /*#__PURE__*/HttpApiEndpoint.get("SocialPullFriendGame", "/friend/pull_game/bc/: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 `bc/<playerId>/<salt><friendId><playerAuthKey>`.
|
|
228
|
+
*
|
|
229
|
+
* @internal
|
|
230
|
+
*/
|
|
231
|
+
export const SocialPullFriendMetaEndpoint = /*#__PURE__*/HttpApiEndpoint.post("SocialPullFriendMeta", "/friend/pull_meta/bc/: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
|
+
/** @internal */
|
|
247
|
+
export const DeviceManagementGroup = /*#__PURE__*/HttpApiGroup.make("DeviceManagementGroup").add(DeviceNewPlayerEndpoint).add(DevicePlayerDetailsEndpoint).add(DeviceVerifyDeviceEndpoint);
|
|
248
|
+
/** @internal */
|
|
249
|
+
export const SyncManagementGroup = /*#__PURE__*/HttpApiGroup.make("SyncManagementGroup").add(SyncPullSaveEndpoint).add(SyncCheckForNewerSaveEndpoint);
|
|
250
|
+
/** @internal */
|
|
251
|
+
export const SocialGroup = /*#__PURE__*/HttpApiGroup.make("SocialGroup").add(SocialGetItemsEndpoint).add(SocialSendItemEndpoint).add(SocialPullFriendGameEndpoint).add(SocialPullFriendMetaEndpoint);
|
|
252
|
+
/**
|
|
253
|
+
* The Bit City NBSync api.
|
|
254
|
+
*
|
|
255
|
+
* @since 1.0.0
|
|
256
|
+
* @category Api
|
|
257
|
+
*/
|
|
258
|
+
export const Api = /*#__PURE__*/HttpApi.make("BitCityApi").add(DeviceManagementGroup).add(SyncManagementGroup).add(SocialGroup);
|
|
259
|
+
//# 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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C,IAAI,CAAC,aAAa,CAAC,CACtD,GAAG,CAAC,sBAAsB,CAAC,CAC3B,GAAG,CAAC,sBAAsB,CAAC,CAC3B,GAAG,CAAC,4BAA4B,CAAC,CACjC,GAAG,CAAC,4BAA4B,CAAC;AAEtC;;;;;;AAMA,OAAO,MAAM,GAAG,gBAAG,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC","ignoreList":[]}
|
package/dist/Scopes.d.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The scopes the Bit City 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 BitCity: 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 pull_friend_game: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Leaf;
|
|
29
|
+
readonly pull_friend_meta: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Leaf;
|
|
30
|
+
};
|
|
31
|
+
readonly write: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Branch & {
|
|
32
|
+
readonly send_item: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Leaf;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* The game's areas, by name, for annotating endpoints.
|
|
39
|
+
*
|
|
40
|
+
* @since 1.0.0
|
|
41
|
+
* @category Areas
|
|
42
|
+
*/
|
|
43
|
+
export declare const Device: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Area & {
|
|
44
|
+
readonly read: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Branch & {
|
|
45
|
+
readonly player_details: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Leaf;
|
|
46
|
+
};
|
|
47
|
+
readonly write: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Branch & {
|
|
48
|
+
readonly verify_device: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Leaf;
|
|
49
|
+
};
|
|
50
|
+
}, Social: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Area & {
|
|
51
|
+
readonly read: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Branch & {
|
|
52
|
+
readonly get_items: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Leaf;
|
|
53
|
+
readonly pull_friend_game: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Leaf;
|
|
54
|
+
readonly pull_friend_meta: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Leaf;
|
|
55
|
+
};
|
|
56
|
+
readonly write: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Branch & {
|
|
57
|
+
readonly send_item: import("@tinyburg/nimblebit-sdk/NimblebitScopes").Leaf;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* @since 1.0.0
|
|
62
|
+
* @category Tree
|
|
63
|
+
*/
|
|
64
|
+
export declare const Games: ReadonlyArray<Game>;
|
|
65
|
+
/**
|
|
66
|
+
* @since 1.0.0
|
|
67
|
+
* @category Tree
|
|
68
|
+
*/
|
|
69
|
+
export declare const all: () => ReadonlyArray<ScopeDescription>;
|
|
70
|
+
//# 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,OAAO;;;;;;;;;;;;;;;;;;;;;CAuClB,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAgB,MAAM;;;;;;;GAAU,MAAM;;;;;;;;;CAAkB,CAAC;AAEhE;;;GAGG;AACH,eAAO,MAAM,KAAK,EAAE,aAAa,CAAC,IAAI,CAAa,CAAC;AAEpD;;;GAGG;AACH,eAAO,MAAM,GAAG,QAAO,aAAa,CAAC,gBAAgB,CAY/C,CAAC"}
|
package/dist/Scopes.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The scopes the Bit City 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 BitCity = /*#__PURE__*/defineGame({
|
|
16
|
+
name: "bitcity",
|
|
17
|
+
description: "Bit City",
|
|
18
|
+
read: {
|
|
19
|
+
description: "Everything in Bit City that only looks"
|
|
20
|
+
},
|
|
21
|
+
write: {
|
|
22
|
+
description: "Everything in Bit City 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
|
+
pull_friend_game: "Download a friend's game data",
|
|
47
|
+
pull_friend_meta: "Fetch metadata about a player's friends"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
write: {
|
|
51
|
+
description: "Send and accept gifts and items",
|
|
52
|
+
leaves: {
|
|
53
|
+
send_item: "Send items to another player"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
/**
|
|
60
|
+
* The game's areas, by name, for annotating endpoints.
|
|
61
|
+
*
|
|
62
|
+
* @since 1.0.0
|
|
63
|
+
* @category Areas
|
|
64
|
+
*/
|
|
65
|
+
export const {
|
|
66
|
+
device: Device,
|
|
67
|
+
social: Social
|
|
68
|
+
} = BitCity.areas;
|
|
69
|
+
/**
|
|
70
|
+
* @since 1.0.0
|
|
71
|
+
* @category Tree
|
|
72
|
+
*/
|
|
73
|
+
export const Games = [BitCity];
|
|
74
|
+
/**
|
|
75
|
+
* @since 1.0.0
|
|
76
|
+
* @category Tree
|
|
77
|
+
*/
|
|
78
|
+
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])]);
|
|
79
|
+
//# 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,OAAO,gBAAG,UAAU,CAAC;EAC9B,IAAI,EAAE,SAAS;EACf,WAAW,EAAE,UAAU;EACvB,IAAI,EAAE;IAAE,WAAW,EAAE;EAAwC,CAAE;EAC/D,KAAK,EAAE;IAAE,WAAW,EAAE;EAAqD,CAAE;EAC7E,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,gBAAgB,EAAE,+BAA+B;UACjD,gBAAgB,EAAE;;OAEzB;MACD,KAAK,EAAE;QACH,WAAW,EAAE,iCAAiC;QAC9C,MAAM,EAAE;UACJ,SAAS,EAAE;;;;;CAK9B,CAAC;AAEF;;;;;;AAMA,OAAO,MAAM;EAAE,MAAM,EAAE,MAAM;EAAE,MAAM,EAAE;AAAM,CAAE,GAAG,OAAO,CAAC,KAAK;AAE/D;;;;AAIA,OAAO,MAAM,KAAK,GAAwB,CAAC,OAAO,CAAC;AAEnD;;;;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":[]}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Bit City 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 `bc` 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 BitCity from "./BitCity.ts";
|
|
21
|
+
/**
|
|
22
|
+
* Bit City (game code `bc`) 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
|
+
* `bc/<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
|
+
* - Minimal NBSync endpoint set (Bit City is a lightweight city builder).
|
|
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 Bit City 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,OAAO,MAAM,cAAc,CAAA;AAEvC;;;;;;;;;;;;;;;;;;;;;;;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
|
+
* Bit City 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 `bc` 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 BitCity from "./BitCity.js";
|
|
21
|
+
/**
|
|
22
|
+
* Bit City (game code `bc`) 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
|
+
* `bc/<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
|
+
* - Minimal NBSync endpoint set (Bit City is a lightweight city builder).
|
|
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 Bit City 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,OAAO,MAAM,cAAc;AAEvC;;;;;;;;;;;;;;;;;;;;;;;;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/bitcity-sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "api for the mobile game Bit City by Nimblebit",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"bitcity-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/bitcity-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
|
}
|