node-ts-screeps-api 0.0.10 → 0.0.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-ts-screeps-api",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "description": "node-ts-screeps-api",
5
5
  "main": "dist/index.js",
6
6
  "typings": "./dist/src/index.d.ts",
package/src/rawApi.ts CHANGED
@@ -160,4 +160,8 @@ export class RawApi<T extends AuthType> {
160
160
  }): Promise<{ ok: number; terrain: [{ _id: string; room: string; terrain: string; type: string }] }> {
161
161
  return this.req("GET", "/api/game/room-terrain", { ...args, encoded: 1 });
162
162
  }
163
+
164
+ public async getWorldSize(args: { shard: string }): Promise<{ ok: number; width: number; height: number }> {
165
+ return this.req("GET", "/api/game/world-size", args);
166
+ }
163
167
  }
@@ -72,6 +72,13 @@ describe("api", () => {
72
72
  // assert.strictEqual(data.data, testStr);
73
73
  // });
74
74
 
75
+ it("get world size", async () => {
76
+ const data = await rawApi.getWorldSize({ shard: "shard3" });
77
+ console.log(data);
78
+ // const name = "test-E34S21";
79
+ // writeFileSync(`test/data/roomObjects/${name}.json`, JSON.stringify(data, null, 4));
80
+ });
81
+
75
82
  it("get roomObjects", async () => {
76
83
  const data = await rawApi.getRoomObjects({ shard: "shard3", room: "E4N1" });
77
84
  console.log(data.objects?.[0]?._id);