@ledgerhq/device-mockserver-client 0.0.0-develop-20261104000847 → 0.0.0-develop-20261107000805

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
@@ -3,7 +3,7 @@
3
3
  "purify-ts": "2.1.0"
4
4
  },
5
5
  "devDependencies": {
6
- "@ledgerhq/device-management-kit": "0.0.0-develop-20261104000847",
6
+ "@ledgerhq/device-management-kit": "0.0.0-develop-20261107000805",
7
7
  "@ledgerhq/eslint-config-dsdk": "0.0.2",
8
8
  "@ledgerhq/ldmk-tool": "0.0.1",
9
9
  "@ledgerhq/prettier-config-dsdk": "0.0.2",
@@ -29,7 +29,7 @@
29
29
  "main": "lib/index.js",
30
30
  "name": "@ledgerhq/device-mockserver-client",
31
31
  "peerDependencies": {
32
- "@ledgerhq/device-management-kit": "0.0.0-develop-20261104000847"
32
+ "@ledgerhq/device-management-kit": "0.0.0-develop-20261107000805"
33
33
  },
34
34
  "private": false,
35
35
  "repository": {
@@ -37,7 +37,7 @@
37
37
  "url": "https://github.com/LedgerHQ/device-sdk-ts.git"
38
38
  },
39
39
  "types": "lib/index.d.ts",
40
- "version": "0.0.0-develop-20261104000847",
40
+ "version": "0.0.0-develop-20261107000805",
41
41
  "scripts": {
42
42
  "build": "pnpm ldmk-tool build --entryPoints index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
43
43
  "dev": "concurrently \"pnpm watch:builds\" \"pnpm watch:types\"",
@@ -1,2 +0,0 @@
1
- "use strict";var n=require("./DmkNetworkClient.stub"),s=require("./MockClient");const i=(e={})=>({id:"dev-1",name:"Ledger Nano X",device_type:"nanoX",connectivity_type:"USB",...e});describe("MockClient",()=>{describe("authentication",()=>{it("lazily creates a session via /auth when no token is provided",async()=>{const e=(0,n.httpClientStubBuilder)().mockResponse({method:"post",endpoint:"auth",response:{token:"tok-123",expires_at:42}}).mockResponse({method:"get",endpoint:"devices",response:[]}),t=new s.MockClient("http://localhost:8080",{httpClient:e}),o=await t.listDevices();expect(t.getToken()).toBe("tok-123"),expect(e.calls).toContainEqual({method:"post",endpoint:"auth",body:{}}),expect(o).toEqual([])}),it("does not call /auth when a token is injected",async()=>{const e=(0,n.httpClientStubBuilder)().mockResponse({method:"get",endpoint:"devices",response:[]}),t=new s.MockClient("http://localhost:8080",{token:"injected",httpClient:e});await t.listDevices(),expect(t.getToken()).toBe("injected"),expect(e.calls.find(o=>o.endpoint==="auth")).toBeUndefined()}),it("returns the token from an explicit authenticate() call",async()=>{const e=(0,n.httpClientStubBuilder)().mockResponse({method:"post",endpoint:"auth",response:{token:"tok-abc",expires_at:99}}),t=new s.MockClient("http://localhost:8080",{httpClient:e}),o=await t.authenticate();expect(o).toBe("tok-abc"),expect(t.getToken()).toBe("tok-abc")}),it("reuses a single in-flight /auth call for concurrent requests",async()=>{const e=(0,n.httpClientStubBuilder)().mockResponse({method:"post",endpoint:"auth",response:{token:"tok-shared",expires_at:1}}).mockResponse({method:"get",endpoint:"devices",response:[]}),t=new s.MockClient("http://localhost:8080",{httpClient:e});await Promise.all([t.listDevices(),t.listDevices()]);const o=e.calls.filter(c=>c.endpoint==="auth");expect(o).toHaveLength(1)}),it("returns undefined token before any session is established",()=>{const e=new s.MockClient("http://localhost:8080",{httpClient:(0,n.httpClientStubBuilder)()});expect(e.getToken()).toBeUndefined()})}),describe("constructor",()=>{it("normalizes a base url without a trailing slash",()=>{const e=new s.MockClient("http://localhost:8080/"),t=new s.MockClient("http://localhost:8080");expect(e.getToken()).toBeUndefined(),expect(t.getToken()).toBeUndefined()})}),describe("health",()=>{it("checks the server health without creating a session",async()=>{const e=(0,n.httpClientStubBuilder)().mockResponse({method:"get",endpoint:"health",response:{status:"ok",sessions:3}}),o=await new s.MockClient("http://localhost:8080",{httpClient:e}).getHealth();expect(o).toEqual({status:"ok",sessions:3}),expect(e.calls).toEqual([{method:"get",endpoint:"health"}]),expect(e.configs[0]?.config?.headers).toBeUndefined()})}),describe("timeout",()=>{it("applies the timeout to every request, the implicit /auth included",async()=>{const e=(0,n.httpClientStubBuilder)().mockResponse({method:"post",endpoint:"auth",response:{token:"tok",expires_at:1}}).mockResponse({method:"get",endpoint:"devices",response:[]});await new s.MockClient("http://localhost:8080",{httpClient:e,timeoutMs:4e3}).listDevices(),expect(e.configs.map(({config:o})=>o?.timeoutMs)).toEqual([4e3,4e3])}),it("sets no timeout by default",async()=>{const e=(0,n.httpClientStubBuilder)().mockResponse({method:"get",endpoint:"devices",response:[]});await new s.MockClient("http://localhost:8080",{token:"tok",httpClient:e}).listDevices(),expect(e.configs[0]?.config?.timeoutMs).toBeUndefined()})}),describe("devices",()=>{it("lists devices",async()=>{const e=(0,n.httpClientStubBuilder)().mockResponse({method:"get",endpoint:"devices",response:[i()]}),o=await new s.MockClient("http://localhost:8080",{token:"tok",httpClient:e}).listDevices();expect(o).toEqual([expect.objectContaining({id:"dev-1"})])}),it("adds a device with a default empty config",async()=>{const e=(0,n.httpClientStubBuilder)().mockResponse({method:"post",endpoint:"devices",response:i()}),o=await new s.MockClient("http://localhost:8080",{token:"tok",httpClient:e}).addDevice();expect(o.id).toBe("dev-1"),expect(e.calls).toContainEqual({method:"post",endpoint:"devices",body:{}})}),it("gets a single device",async()=>{const e=(0,n.httpClientStubBuilder)().mockResponse({method:"get",endpoint:"devices/dev-1",response:i()}),o=await new s.MockClient("http://localhost:8080",{token:"tok",httpClient:e}).getDevice("dev-1");expect(o.id).toBe("dev-1")}),it("edits a device",async()=>{const e=(0,n.httpClientStubBuilder)().mockResponse({method:"patch",endpoint:"devices/dev-1",response:i({name:"Renamed"})}),o=await new s.MockClient("http://localhost:8080",{token:"tok",httpClient:e}).editDevice("dev-1",{name:"Renamed"});expect(o.name).toBe("Renamed"),expect(e.calls).toContainEqual({method:"patch",endpoint:"devices/dev-1",body:{name:"Renamed"}})}),it("deletes a device",async()=>{const e=(0,n.httpClientStubBuilder)().mockResponse({method:"delete",endpoint:"devices/dev-1",response:{}}),t=new s.MockClient("http://localhost:8080",{token:"tok",httpClient:e});await expect(t.deleteDevice("dev-1")).resolves.toBe(!0),expect(e.calls).toContainEqual({method:"delete",endpoint:"devices/dev-1"})})}),describe("connection state",()=>{it("connects a device",async()=>{const e=(0,n.httpClientStubBuilder)().mockResponse({method:"post",endpoint:"devices/dev-1/connect",response:{device:i(),connected:!0}}),o=await new s.MockClient("http://localhost:8080",{token:"tok",httpClient:e}).connect("dev-1");expect(o.connected).toBe(!0),expect(o.device.id).toBe("dev-1")}),it("disconnects a device",async()=>{const e=(0,n.httpClientStubBuilder)().mockResponse({method:"post",endpoint:"devices/dev-1/disconnect",response:{}}),t=new s.MockClient("http://localhost:8080",{token:"tok",httpClient:e});await expect(t.disconnect("dev-1")).resolves.toBe(!0)}),it("disconnects every connected device",async()=>{const e=(0,n.httpClientStubBuilder)().mockResponse({method:"get",endpoint:"devices",response:[i({id:"dev-1",connected:!0}),i({id:"dev-2",connected:!1}),i({id:"dev-3",connected:!0})]}).mockResponse({method:"post",endpoint:"devices/dev-1/disconnect",response:{}}).mockResponse({method:"post",endpoint:"devices/dev-3/disconnect",response:{}}),t=new s.MockClient("http://localhost:8080",{token:"tok",httpClient:e});await expect(t.disconnectAll()).resolves.toBe(!0);const o=e.calls.filter(c=>c.endpoint.endsWith("/disconnect"));expect(o.map(c=>c.endpoint)).toEqual(["devices/dev-1/disconnect","devices/dev-3/disconnect"])})}),describe("mocks",()=>{it("lists device-scoped mocks",async()=>{const e=(0,n.httpClientStubBuilder)().mockResponse({method:"get",endpoint:"devices/dev-1/mocks",response:[{id:"m1",prefix:"e0010000",responses:["9000"]}]}),o=await new s.MockClient("http://localhost:8080",{token:"tok",httpClient:e}).listMocks("dev-1");expect(o).toEqual([expect.objectContaining({id:"m1"})])}),it("creates a device-scoped mock",async()=>{const e=(0,n.httpClientStubBuilder)().mockResponse({method:"post",endpoint:"devices/dev-1/mocks",response:{id:"m1",prefix:"e0010000",responses:["9000"]}}),o=await new s.MockClient("http://localhost:8080",{token:"tok",httpClient:e}).addMock("dev-1",{prefix:"e0010000",response:"9000"});expect(o.id).toBe("m1"),expect(e.calls).toContainEqual({method:"post",endpoint:"devices/dev-1/mocks",body:{prefix:"e0010000",response:"9000"}})}),it("edits a mock",async()=>{const e=(0,n.httpClientStubBuilder)().mockResponse({method:"patch",endpoint:"devices/dev-1/mocks/m1",response:{id:"m1",prefix:"e0010000",responses:["6985"]}}),o=await new s.MockClient("http://localhost:8080",{token:"tok",httpClient:e}).editMock("dev-1","m1",{prefix:"e0010000",response:"6985"});expect(o.responses).toEqual(["6985"]),expect(e.calls).toContainEqual({method:"patch",endpoint:"devices/dev-1/mocks/m1",body:{prefix:"e0010000",response:"6985"}})}),it("deletes a single mock",async()=>{const e=(0,n.httpClientStubBuilder)().mockResponse({method:"delete",endpoint:"devices/dev-1/mocks/m1",response:{}}),t=new s.MockClient("http://localhost:8080",{token:"tok",httpClient:e});await expect(t.deleteMock("dev-1","m1")).resolves.toBe(!0),expect(e.calls).toContainEqual({method:"delete",endpoint:"devices/dev-1/mocks/m1"})}),it("clears all mocks of a device",async()=>{const e=(0,n.httpClientStubBuilder)().mockResponse({method:"delete",endpoint:"devices/dev-1/mocks",response:{}}),t=new s.MockClient("http://localhost:8080",{token:"tok",httpClient:e});await expect(t.clearMocks("dev-1")).resolves.toBe(!0),expect(e.calls).toContainEqual({method:"delete",endpoint:"devices/dev-1/mocks"})})}),describe("speculos",()=>{it("resolves the live speculos instance backing a device",async()=>{const e=(0,n.httpClientStubBuilder)().mockResponse({method:"get",endpoint:"devices/dev-1/speculos",response:{run_id:"run-1",speculos_url:"https://speculos:5000",model:"stax"}}),o=await new s.MockClient("http://localhost:8080",{token:"tok",httpClient:e}).getSpeculos("dev-1");expect(o).toEqual({run_id:"run-1",speculos_url:"https://speculos:5000",model:"stax"})}),it("requests the screenshot as a blob",async()=>{const e=new Blob([new Uint8Array([137,80])],{type:"image/png"}),t=(0,n.httpClientStubBuilder)().mockResponse({method:"get",endpoint:"devices/dev-1/speculos/screenshot",response:e}),c=await new s.MockClient("http://localhost:8080",{token:"tok",httpClient:t}).getScreenshot("dev-1");expect(c).toBe(e);const p=t.configs.find(({endpoint:d})=>d==="devices/dev-1/speculos/screenshot");expect(p?.config?.responseType).toBe("blob")}),it("presses a button",async()=>{const e=(0,n.httpClientStubBuilder)();await new s.MockClient("http://localhost:8080",{token:"tok",httpClient:e}).pressButton("dev-1","both"),expect(e.calls).toContainEqual({method:"post",endpoint:"devices/dev-1/speculos/button/both",body:{action:"press-and-release"}})}),it("forwards an explicit button action",async()=>{const e=(0,n.httpClientStubBuilder)();await new s.MockClient("http://localhost:8080",{token:"tok",httpClient:e}).pressButton("dev-1","left","press"),expect(e.calls).toContainEqual({method:"post",endpoint:"devices/dev-1/speculos/button/left",body:{action:"press"}})}),it("taps the screen at device coordinates",async()=>{const e=(0,n.httpClientStubBuilder)();await new s.MockClient("http://localhost:8080",{token:"tok",httpClient:e}).touchScreen("dev-1",200,537),expect(e.calls).toContainEqual({method:"post",endpoint:"devices/dev-1/speculos/finger",body:{action:"press-and-release",x:200,y:537}})})}),describe("session",()=>{it("fetches the current session",async()=>{const e=(0,n.httpClientStubBuilder)().mockResponse({method:"get",endpoint:"sessions/current",response:{id:"sess-1",created_at:1,expires_at:2,devices:[i()]}}),o=await new s.MockClient("http://localhost:8080",{token:"tok",httpClient:e}).getSession();expect(o.id).toBe("sess-1"),expect(o.devices).toHaveLength(1)}),it("sets the session seed with the bearer token",async()=>{const e=(0,n.httpClientStubBuilder)();await new s.MockClient("http://localhost:8080",{token:"tok",httpClient:e}).setSeed("abandon abandon about"),expect(e.calls).toEqual([{method:"put",endpoint:"sessions/current/seed",body:{seed:"abandon abandon about"}}]),expect(e.configs[0]?.config?.headers).toEqual({Authorization:"Bearer tok"})}),it("disposes the session and clears the stored token",async()=>{const e=(0,n.httpClientStubBuilder)().mockResponse({method:"delete",endpoint:"sessions/current",response:{}}),t=new s.MockClient("http://localhost:8080",{token:"tok",httpClient:e});await expect(t.disposeSession()).resolves.toBe(!0),expect(t.getToken()).toBeUndefined()})}),describe("response validation",()=>{it("throws a descriptive error when the server response is malformed",async()=>{const e=(0,n.httpClientStubBuilder)().mockResponse({method:"get",endpoint:"devices/dev-1",response:{id:123}}),t=new s.MockClient("http://localhost:8080",{token:"tok",httpClient:e});await expect(t.getDevice("dev-1")).rejects.toThrow(/MockClient: invalid server response/)})}),describe("import/export",()=>{it("exports the session snapshot",async()=>{const e={devices:[{name:"Ledger Stax",device_type:"stax",mocks:[{prefix:"ff",responses:["9000"]}]}]},t=(0,n.httpClientStubBuilder)().mockResponse({method:"get",endpoint:"export",response:e}),c=await new s.MockClient("http://localhost:8080",{token:"tok",httpClient:t}).exportSession();expect(c).toEqual(e)}),it("posts a snapshot to the import endpoint",async()=>{const e={devices:[{name:"Ledger Flex",device_type:"flex",mocks:[{prefix:"e0010000",responses:["aa9000","5515"]}]}]},t=(0,n.httpClientStubBuilder)().mockResponse({method:"post",endpoint:"import",response:e}),c=await new s.MockClient("http://localhost:8080",{token:"tok",httpClient:t}).importSession(e);expect(c).toEqual(e),expect(t.calls).toContainEqual({method:"post",endpoint:"import",body:e})})}),describe("apdu",()=>{it("sends a binary APDU as hex to the device apdu endpoint",async()=>{const e=(0,n.httpClientStubBuilder)().mockResponse({method:"post",endpoint:"devices/dev-1/apdu",response:{response:"9000"}}),o=await new s.MockClient("http://localhost:8080",{token:"tok",httpClient:e}).sendApdu("dev-1",Uint8Array.from([224,1,0,0]));expect(o.response).toBe("9000"),expect(e.calls).toContainEqual({method:"post",endpoint:"devices/dev-1/apdu",body:{apdu:"e0010000"}})})})});
2
- //# sourceMappingURL=MockClient.test.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/MockClient.test.ts"],
4
- "sourcesContent": ["import { httpClientStubBuilder } from \"./DmkNetworkClient.stub\";\nimport { MockClient } from \"./MockClient\";\n\nconst aDevice = (overrides: Record<string, unknown> = {}) => ({\n id: \"dev-1\",\n name: \"Ledger Nano X\",\n device_type: \"nanoX\",\n connectivity_type: \"USB\",\n ...overrides,\n});\n\ndescribe(\"MockClient\", () => {\n describe(\"authentication\", () => {\n it(\"lazily creates a session via /auth when no token is provided\", async () => {\n const http = httpClientStubBuilder()\n .mockResponse({\n method: \"post\",\n endpoint: \"auth\",\n response: { token: \"tok-123\", expires_at: 42 },\n })\n .mockResponse({\n method: \"get\",\n endpoint: \"devices\",\n response: [],\n });\n const client = new MockClient(\"http://localhost:8080\", {\n httpClient: http,\n });\n\n const devices = await client.listDevices();\n\n expect(client.getToken()).toBe(\"tok-123\");\n expect(http.calls).toContainEqual({\n method: \"post\",\n endpoint: \"auth\",\n body: {},\n });\n expect(devices).toEqual([]);\n });\n\n it(\"does not call /auth when a token is injected\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"get\",\n endpoint: \"devices\",\n response: [],\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"injected\",\n httpClient: http,\n });\n\n await client.listDevices();\n\n expect(client.getToken()).toBe(\"injected\");\n expect(\n http.calls.find((call) => call.endpoint === \"auth\"),\n ).toBeUndefined();\n });\n\n it(\"returns the token from an explicit authenticate() call\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"post\",\n endpoint: \"auth\",\n response: { token: \"tok-abc\", expires_at: 99 },\n });\n const client = new MockClient(\"http://localhost:8080\", {\n httpClient: http,\n });\n\n const token = await client.authenticate();\n\n expect(token).toBe(\"tok-abc\");\n expect(client.getToken()).toBe(\"tok-abc\");\n });\n\n it(\"reuses a single in-flight /auth call for concurrent requests\", async () => {\n const http = httpClientStubBuilder()\n .mockResponse({\n method: \"post\",\n endpoint: \"auth\",\n response: { token: \"tok-shared\", expires_at: 1 },\n })\n .mockResponse({ method: \"get\", endpoint: \"devices\", response: [] });\n const client = new MockClient(\"http://localhost:8080\", {\n httpClient: http,\n });\n\n await Promise.all([client.listDevices(), client.listDevices()]);\n\n const authCalls = http.calls.filter((call) => call.endpoint === \"auth\");\n expect(authCalls).toHaveLength(1);\n });\n\n it(\"returns undefined token before any session is established\", () => {\n const client = new MockClient(\"http://localhost:8080\", {\n httpClient: httpClientStubBuilder(),\n });\n\n expect(client.getToken()).toBeUndefined();\n });\n });\n\n describe(\"constructor\", () => {\n it(\"normalizes a base url without a trailing slash\", () => {\n const withSlash = new MockClient(\"http://localhost:8080/\");\n const withoutSlash = new MockClient(\"http://localhost:8080\");\n\n expect(withSlash.getToken()).toBeUndefined();\n expect(withoutSlash.getToken()).toBeUndefined();\n });\n });\n\n describe(\"health\", () => {\n it(\"checks the server health without creating a session\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"get\",\n endpoint: \"health\",\n response: { status: \"ok\", sessions: 3 },\n });\n const client = new MockClient(\"http://localhost:8080\", {\n httpClient: http,\n });\n\n const health = await client.getHealth();\n\n expect(health).toEqual({ status: \"ok\", sessions: 3 });\n expect(http.calls).toEqual([{ method: \"get\", endpoint: \"health\" }]);\n expect(http.configs[0]?.config?.headers).toBeUndefined();\n });\n });\n\n describe(\"timeout\", () => {\n it(\"applies the timeout to every request, the implicit /auth included\", async () => {\n const http = httpClientStubBuilder()\n .mockResponse({\n method: \"post\",\n endpoint: \"auth\",\n response: { token: \"tok\", expires_at: 1 },\n })\n .mockResponse({ method: \"get\", endpoint: \"devices\", response: [] });\n const client = new MockClient(\"http://localhost:8080\", {\n httpClient: http,\n timeoutMs: 4000,\n });\n\n await client.listDevices();\n\n expect(http.configs.map(({ config }) => config?.timeoutMs)).toEqual([\n 4000, 4000,\n ]);\n });\n\n it(\"sets no timeout by default\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"get\",\n endpoint: \"devices\",\n response: [],\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n await client.listDevices();\n\n expect(http.configs[0]?.config?.timeoutMs).toBeUndefined();\n });\n });\n\n describe(\"devices\", () => {\n it(\"lists devices\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"get\",\n endpoint: \"devices\",\n response: [aDevice()],\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n const devices = await client.listDevices();\n\n expect(devices).toEqual([expect.objectContaining({ id: \"dev-1\" })]);\n });\n\n it(\"adds a device with a default empty config\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"post\",\n endpoint: \"devices\",\n response: aDevice(),\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n const device = await client.addDevice();\n\n expect(device.id).toBe(\"dev-1\");\n expect(http.calls).toContainEqual({\n method: \"post\",\n endpoint: \"devices\",\n body: {},\n });\n });\n\n it(\"gets a single device\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"get\",\n endpoint: \"devices/dev-1\",\n response: aDevice(),\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n const device = await client.getDevice(\"dev-1\");\n\n expect(device.id).toBe(\"dev-1\");\n });\n\n it(\"edits a device\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"patch\",\n endpoint: \"devices/dev-1\",\n response: aDevice({ name: \"Renamed\" }),\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n const device = await client.editDevice(\"dev-1\", { name: \"Renamed\" });\n\n expect(device.name).toBe(\"Renamed\");\n expect(http.calls).toContainEqual({\n method: \"patch\",\n endpoint: \"devices/dev-1\",\n body: { name: \"Renamed\" },\n });\n });\n\n it(\"deletes a device\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"delete\",\n endpoint: \"devices/dev-1\",\n response: {},\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n await expect(client.deleteDevice(\"dev-1\")).resolves.toBe(true);\n expect(http.calls).toContainEqual({\n method: \"delete\",\n endpoint: \"devices/dev-1\",\n });\n });\n });\n\n describe(\"connection state\", () => {\n it(\"connects a device\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"post\",\n endpoint: \"devices/dev-1/connect\",\n response: { device: aDevice(), connected: true },\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n const state = await client.connect(\"dev-1\");\n\n expect(state.connected).toBe(true);\n expect(state.device.id).toBe(\"dev-1\");\n });\n\n it(\"disconnects a device\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"post\",\n endpoint: \"devices/dev-1/disconnect\",\n response: {},\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n await expect(client.disconnect(\"dev-1\")).resolves.toBe(true);\n });\n\n it(\"disconnects every connected device\", async () => {\n const http = httpClientStubBuilder()\n .mockResponse({\n method: \"get\",\n endpoint: \"devices\",\n response: [\n aDevice({ id: \"dev-1\", connected: true }),\n aDevice({ id: \"dev-2\", connected: false }),\n aDevice({ id: \"dev-3\", connected: true }),\n ],\n })\n .mockResponse({\n method: \"post\",\n endpoint: \"devices/dev-1/disconnect\",\n response: {},\n })\n .mockResponse({\n method: \"post\",\n endpoint: \"devices/dev-3/disconnect\",\n response: {},\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n await expect(client.disconnectAll()).resolves.toBe(true);\n\n const disconnectCalls = http.calls.filter((call) =>\n call.endpoint.endsWith(\"/disconnect\"),\n );\n expect(disconnectCalls.map((call) => call.endpoint)).toEqual([\n \"devices/dev-1/disconnect\",\n \"devices/dev-3/disconnect\",\n ]);\n });\n });\n\n describe(\"mocks\", () => {\n it(\"lists device-scoped mocks\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"get\",\n endpoint: \"devices/dev-1/mocks\",\n response: [{ id: \"m1\", prefix: \"e0010000\", responses: [\"9000\"] }],\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n const mocks = await client.listMocks(\"dev-1\");\n\n expect(mocks).toEqual([expect.objectContaining({ id: \"m1\" })]);\n });\n\n it(\"creates a device-scoped mock\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"post\",\n endpoint: \"devices/dev-1/mocks\",\n response: { id: \"m1\", prefix: \"e0010000\", responses: [\"9000\"] },\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n const mock = await client.addMock(\"dev-1\", {\n prefix: \"e0010000\",\n response: \"9000\",\n });\n\n expect(mock.id).toBe(\"m1\");\n expect(http.calls).toContainEqual({\n method: \"post\",\n endpoint: \"devices/dev-1/mocks\",\n body: { prefix: \"e0010000\", response: \"9000\" },\n });\n });\n\n it(\"edits a mock\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"patch\",\n endpoint: \"devices/dev-1/mocks/m1\",\n response: { id: \"m1\", prefix: \"e0010000\", responses: [\"6985\"] },\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n const mock = await client.editMock(\"dev-1\", \"m1\", {\n prefix: \"e0010000\",\n response: \"6985\",\n });\n\n expect(mock.responses).toEqual([\"6985\"]);\n expect(http.calls).toContainEqual({\n method: \"patch\",\n endpoint: \"devices/dev-1/mocks/m1\",\n body: { prefix: \"e0010000\", response: \"6985\" },\n });\n });\n\n it(\"deletes a single mock\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"delete\",\n endpoint: \"devices/dev-1/mocks/m1\",\n response: {},\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n await expect(client.deleteMock(\"dev-1\", \"m1\")).resolves.toBe(true);\n expect(http.calls).toContainEqual({\n method: \"delete\",\n endpoint: \"devices/dev-1/mocks/m1\",\n });\n });\n\n it(\"clears all mocks of a device\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"delete\",\n endpoint: \"devices/dev-1/mocks\",\n response: {},\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n await expect(client.clearMocks(\"dev-1\")).resolves.toBe(true);\n expect(http.calls).toContainEqual({\n method: \"delete\",\n endpoint: \"devices/dev-1/mocks\",\n });\n });\n });\n\n describe(\"speculos\", () => {\n it(\"resolves the live speculos instance backing a device\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"get\",\n endpoint: \"devices/dev-1/speculos\",\n response: {\n run_id: \"run-1\",\n speculos_url: \"https://speculos:5000\",\n model: \"stax\",\n },\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n const instance = await client.getSpeculos(\"dev-1\");\n\n expect(instance).toEqual({\n run_id: \"run-1\",\n speculos_url: \"https://speculos:5000\",\n model: \"stax\",\n });\n });\n\n it(\"requests the screenshot as a blob\", async () => {\n const png = new Blob([new Uint8Array([0x89, 0x50])], {\n type: \"image/png\",\n });\n const http = httpClientStubBuilder().mockResponse({\n method: \"get\",\n endpoint: \"devices/dev-1/speculos/screenshot\",\n response: png,\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n const screenshot = await client.getScreenshot(\"dev-1\");\n\n expect(screenshot).toBe(png);\n // Anything but \"blob\" would decode the PNG as text and corrupt it.\n const request = http.configs.find(\n ({ endpoint }) => endpoint === \"devices/dev-1/speculos/screenshot\",\n );\n expect(request?.config?.responseType).toBe(\"blob\");\n });\n\n it(\"presses a button\", async () => {\n const http = httpClientStubBuilder();\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n await client.pressButton(\"dev-1\", \"both\");\n\n expect(http.calls).toContainEqual({\n method: \"post\",\n endpoint: \"devices/dev-1/speculos/button/both\",\n body: { action: \"press-and-release\" },\n });\n });\n\n it(\"forwards an explicit button action\", async () => {\n const http = httpClientStubBuilder();\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n await client.pressButton(\"dev-1\", \"left\", \"press\");\n\n expect(http.calls).toContainEqual({\n method: \"post\",\n endpoint: \"devices/dev-1/speculos/button/left\",\n body: { action: \"press\" },\n });\n });\n\n it(\"taps the screen at device coordinates\", async () => {\n const http = httpClientStubBuilder();\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n await client.touchScreen(\"dev-1\", 200, 537);\n\n expect(http.calls).toContainEqual({\n method: \"post\",\n endpoint: \"devices/dev-1/speculos/finger\",\n body: { action: \"press-and-release\", x: 200, y: 537 },\n });\n });\n });\n\n describe(\"session\", () => {\n it(\"fetches the current session\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"get\",\n endpoint: \"sessions/current\",\n response: {\n id: \"sess-1\",\n created_at: 1,\n expires_at: 2,\n devices: [aDevice()],\n },\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n const session = await client.getSession();\n\n expect(session.id).toBe(\"sess-1\");\n expect(session.devices).toHaveLength(1);\n });\n\n it(\"sets the session seed with the bearer token\", async () => {\n const http = httpClientStubBuilder();\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n await client.setSeed(\"abandon abandon about\");\n\n expect(http.calls).toEqual([\n {\n method: \"put\",\n endpoint: \"sessions/current/seed\",\n body: { seed: \"abandon abandon about\" },\n },\n ]);\n expect(http.configs[0]?.config?.headers).toEqual({\n Authorization: \"Bearer tok\",\n });\n });\n\n it(\"disposes the session and clears the stored token\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"delete\",\n endpoint: \"sessions/current\",\n response: {},\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n await expect(client.disposeSession()).resolves.toBe(true);\n expect(client.getToken()).toBeUndefined();\n });\n });\n\n describe(\"response validation\", () => {\n it(\"throws a descriptive error when the server response is malformed\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"get\",\n endpoint: \"devices/dev-1\",\n response: { id: 123 } as unknown as object,\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n await expect(client.getDevice(\"dev-1\")).rejects.toThrow(\n /MockClient: invalid server response/,\n );\n });\n });\n\n describe(\"import/export\", () => {\n it(\"exports the session snapshot\", async () => {\n const snapshot = {\n devices: [\n {\n name: \"Ledger Stax\",\n device_type: \"stax\",\n mocks: [{ prefix: \"ff\", responses: [\"9000\"] }],\n },\n ],\n };\n const http = httpClientStubBuilder().mockResponse({\n method: \"get\",\n endpoint: \"export\",\n response: snapshot,\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n const result = await client.exportSession();\n\n expect(result).toEqual(snapshot);\n });\n\n it(\"posts a snapshot to the import endpoint\", async () => {\n const snapshot = {\n devices: [\n {\n name: \"Ledger Flex\",\n device_type: \"flex\",\n mocks: [{ prefix: \"e0010000\", responses: [\"aa9000\", \"5515\"] }],\n },\n ],\n };\n const http = httpClientStubBuilder().mockResponse({\n method: \"post\",\n endpoint: \"import\",\n response: snapshot,\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n const result = await client.importSession(snapshot);\n\n expect(result).toEqual(snapshot);\n expect(http.calls).toContainEqual({\n method: \"post\",\n endpoint: \"import\",\n body: snapshot,\n });\n });\n });\n\n describe(\"apdu\", () => {\n it(\"sends a binary APDU as hex to the device apdu endpoint\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"post\",\n endpoint: \"devices/dev-1/apdu\",\n response: { response: \"9000\" },\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n const result = await client.sendApdu(\n \"dev-1\",\n Uint8Array.from([0xe0, 0x01, 0x00, 0x00]),\n );\n\n expect(result.response).toBe(\"9000\");\n expect(http.calls).toContainEqual({\n method: \"post\",\n endpoint: \"devices/dev-1/ap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MAAM,CAAE,CAAC,CAC/D,CACF,CACF,EACMrB,KAAO,yBAAsB,EAAE,aAAa,CAChD,OAAQ,OACR,SAAU,SACV,SAAUqB,CACZ,CAAC,EAMKC,EAAS,MALA,IAAI,aAAW,wBAAyB,CACrD,MAAO,MACP,WAAYtB,CACd,CAAC,EAE2B,cAAcqB,CAAQ,EAElD,OAAOC,CAAM,EAAE,QAAQD,CAAQ,EAC/B,OAAOrB,EAAK,KAAK,EAAE,eAAe,CAChC,OAAQ,OACR,SAAU,SACV,KAAMqB,CACR,CAAC,CACH,CAAC,CACH,CAAC,EAED,SAAS,OAAQ,IAAM,CACrB,GAAG,yDAA0D,SAAY,CACvE,MAAMrB,KAAO,yBAAsB,EAAE,aAAa,CAChD,OAAQ,OACR,SAAU,qBACV,SAAU,CAAE,SAAU,MAAO,CAC/B,CAAC,EAMKsB,EAAS,MALA,IAAI,aAAW,wBAAyB,CACrD,MAAO,MACP,WAAYtB,CACd,CAAC,EAE2B,SAC1B,QACA,WAAW,KAAK,CAAC,IAAM,EAAM,EAAM,CAAI,CAAC,CAC1C,EAEA,OAAOsB,EAAO,QAAQ,EAAE,KAAK,MAAM,EACnC,OAAOtB,EAAK,KAAK,EAAE,eAAe,CAChC,OAAQ,OACR,SAAU,qBACV,KAAM,CAAE,KAAM,UAAW,CAC3B,CAAC,CACH,CAAC,CACH,CAAC,CACH,CAAC",
6
- "names": ["import_DmkNetworkClient", "import_MockClient", "aDevice", "overrides", "http", "client", "devices", "call", "token", "authCalls", "withSlash", "withoutSlash", "health", "config", "device", "state", "disconnectCalls", "mocks", "mock", "instance", "png", "screenshot", "request", "endpoint", "session", "snapshot", "result"]
7
- }
@@ -1,2 +0,0 @@
1
- import{httpClientStubBuilder as n}from"./DmkNetworkClient.stub";import{MockClient as s}from"./MockClient";const i=(e={})=>({id:"dev-1",name:"Ledger Nano X",device_type:"nanoX",connectivity_type:"USB",...e});describe("MockClient",()=>{describe("authentication",()=>{it("lazily creates a session via /auth when no token is provided",async()=>{const e=n().mockResponse({method:"post",endpoint:"auth",response:{token:"tok-123",expires_at:42}}).mockResponse({method:"get",endpoint:"devices",response:[]}),t=new s("http://localhost:8080",{httpClient:e}),o=await t.listDevices();expect(t.getToken()).toBe("tok-123"),expect(e.calls).toContainEqual({method:"post",endpoint:"auth",body:{}}),expect(o).toEqual([])}),it("does not call /auth when a token is injected",async()=>{const e=n().mockResponse({method:"get",endpoint:"devices",response:[]}),t=new s("http://localhost:8080",{token:"injected",httpClient:e});await t.listDevices(),expect(t.getToken()).toBe("injected"),expect(e.calls.find(o=>o.endpoint==="auth")).toBeUndefined()}),it("returns the token from an explicit authenticate() call",async()=>{const e=n().mockResponse({method:"post",endpoint:"auth",response:{token:"tok-abc",expires_at:99}}),t=new s("http://localhost:8080",{httpClient:e}),o=await t.authenticate();expect(o).toBe("tok-abc"),expect(t.getToken()).toBe("tok-abc")}),it("reuses a single in-flight /auth call for concurrent requests",async()=>{const e=n().mockResponse({method:"post",endpoint:"auth",response:{token:"tok-shared",expires_at:1}}).mockResponse({method:"get",endpoint:"devices",response:[]}),t=new s("http://localhost:8080",{httpClient:e});await Promise.all([t.listDevices(),t.listDevices()]);const o=e.calls.filter(c=>c.endpoint==="auth");expect(o).toHaveLength(1)}),it("returns undefined token before any session is established",()=>{const e=new s("http://localhost:8080",{httpClient:n()});expect(e.getToken()).toBeUndefined()})}),describe("constructor",()=>{it("normalizes a base url without a trailing slash",()=>{const e=new s("http://localhost:8080/"),t=new s("http://localhost:8080");expect(e.getToken()).toBeUndefined(),expect(t.getToken()).toBeUndefined()})}),describe("health",()=>{it("checks the server health without creating a session",async()=>{const e=n().mockResponse({method:"get",endpoint:"health",response:{status:"ok",sessions:3}}),o=await new s("http://localhost:8080",{httpClient:e}).getHealth();expect(o).toEqual({status:"ok",sessions:3}),expect(e.calls).toEqual([{method:"get",endpoint:"health"}]),expect(e.configs[0]?.config?.headers).toBeUndefined()})}),describe("timeout",()=>{it("applies the timeout to every request, the implicit /auth included",async()=>{const e=n().mockResponse({method:"post",endpoint:"auth",response:{token:"tok",expires_at:1}}).mockResponse({method:"get",endpoint:"devices",response:[]});await new s("http://localhost:8080",{httpClient:e,timeoutMs:4e3}).listDevices(),expect(e.configs.map(({config:o})=>o?.timeoutMs)).toEqual([4e3,4e3])}),it("sets no timeout by default",async()=>{const e=n().mockResponse({method:"get",endpoint:"devices",response:[]});await new s("http://localhost:8080",{token:"tok",httpClient:e}).listDevices(),expect(e.configs[0]?.config?.timeoutMs).toBeUndefined()})}),describe("devices",()=>{it("lists devices",async()=>{const e=n().mockResponse({method:"get",endpoint:"devices",response:[i()]}),o=await new s("http://localhost:8080",{token:"tok",httpClient:e}).listDevices();expect(o).toEqual([expect.objectContaining({id:"dev-1"})])}),it("adds a device with a default empty config",async()=>{const e=n().mockResponse({method:"post",endpoint:"devices",response:i()}),o=await new s("http://localhost:8080",{token:"tok",httpClient:e}).addDevice();expect(o.id).toBe("dev-1"),expect(e.calls).toContainEqual({method:"post",endpoint:"devices",body:{}})}),it("gets a single device",async()=>{const e=n().mockResponse({method:"get",endpoint:"devices/dev-1",response:i()}),o=await new s("http://localhost:8080",{token:"tok",httpClient:e}).getDevice("dev-1");expect(o.id).toBe("dev-1")}),it("edits a device",async()=>{const e=n().mockResponse({method:"patch",endpoint:"devices/dev-1",response:i({name:"Renamed"})}),o=await new s("http://localhost:8080",{token:"tok",httpClient:e}).editDevice("dev-1",{name:"Renamed"});expect(o.name).toBe("Renamed"),expect(e.calls).toContainEqual({method:"patch",endpoint:"devices/dev-1",body:{name:"Renamed"}})}),it("deletes a device",async()=>{const e=n().mockResponse({method:"delete",endpoint:"devices/dev-1",response:{}}),t=new s("http://localhost:8080",{token:"tok",httpClient:e});await expect(t.deleteDevice("dev-1")).resolves.toBe(!0),expect(e.calls).toContainEqual({method:"delete",endpoint:"devices/dev-1"})})}),describe("connection state",()=>{it("connects a device",async()=>{const e=n().mockResponse({method:"post",endpoint:"devices/dev-1/connect",response:{device:i(),connected:!0}}),o=await new s("http://localhost:8080",{token:"tok",httpClient:e}).connect("dev-1");expect(o.connected).toBe(!0),expect(o.device.id).toBe("dev-1")}),it("disconnects a device",async()=>{const e=n().mockResponse({method:"post",endpoint:"devices/dev-1/disconnect",response:{}}),t=new s("http://localhost:8080",{token:"tok",httpClient:e});await expect(t.disconnect("dev-1")).resolves.toBe(!0)}),it("disconnects every connected device",async()=>{const e=n().mockResponse({method:"get",endpoint:"devices",response:[i({id:"dev-1",connected:!0}),i({id:"dev-2",connected:!1}),i({id:"dev-3",connected:!0})]}).mockResponse({method:"post",endpoint:"devices/dev-1/disconnect",response:{}}).mockResponse({method:"post",endpoint:"devices/dev-3/disconnect",response:{}}),t=new s("http://localhost:8080",{token:"tok",httpClient:e});await expect(t.disconnectAll()).resolves.toBe(!0);const o=e.calls.filter(c=>c.endpoint.endsWith("/disconnect"));expect(o.map(c=>c.endpoint)).toEqual(["devices/dev-1/disconnect","devices/dev-3/disconnect"])})}),describe("mocks",()=>{it("lists device-scoped mocks",async()=>{const e=n().mockResponse({method:"get",endpoint:"devices/dev-1/mocks",response:[{id:"m1",prefix:"e0010000",responses:["9000"]}]}),o=await new s("http://localhost:8080",{token:"tok",httpClient:e}).listMocks("dev-1");expect(o).toEqual([expect.objectContaining({id:"m1"})])}),it("creates a device-scoped mock",async()=>{const e=n().mockResponse({method:"post",endpoint:"devices/dev-1/mocks",response:{id:"m1",prefix:"e0010000",responses:["9000"]}}),o=await new s("http://localhost:8080",{token:"tok",httpClient:e}).addMock("dev-1",{prefix:"e0010000",response:"9000"});expect(o.id).toBe("m1"),expect(e.calls).toContainEqual({method:"post",endpoint:"devices/dev-1/mocks",body:{prefix:"e0010000",response:"9000"}})}),it("edits a mock",async()=>{const e=n().mockResponse({method:"patch",endpoint:"devices/dev-1/mocks/m1",response:{id:"m1",prefix:"e0010000",responses:["6985"]}}),o=await new s("http://localhost:8080",{token:"tok",httpClient:e}).editMock("dev-1","m1",{prefix:"e0010000",response:"6985"});expect(o.responses).toEqual(["6985"]),expect(e.calls).toContainEqual({method:"patch",endpoint:"devices/dev-1/mocks/m1",body:{prefix:"e0010000",response:"6985"}})}),it("deletes a single mock",async()=>{const e=n().mockResponse({method:"delete",endpoint:"devices/dev-1/mocks/m1",response:{}}),t=new s("http://localhost:8080",{token:"tok",httpClient:e});await expect(t.deleteMock("dev-1","m1")).resolves.toBe(!0),expect(e.calls).toContainEqual({method:"delete",endpoint:"devices/dev-1/mocks/m1"})}),it("clears all mocks of a device",async()=>{const e=n().mockResponse({method:"delete",endpoint:"devices/dev-1/mocks",response:{}}),t=new s("http://localhost:8080",{token:"tok",httpClient:e});await expect(t.clearMocks("dev-1")).resolves.toBe(!0),expect(e.calls).toContainEqual({method:"delete",endpoint:"devices/dev-1/mocks"})})}),describe("speculos",()=>{it("resolves the live speculos instance backing a device",async()=>{const e=n().mockResponse({method:"get",endpoint:"devices/dev-1/speculos",response:{run_id:"run-1",speculos_url:"https://speculos:5000",model:"stax"}}),o=await new s("http://localhost:8080",{token:"tok",httpClient:e}).getSpeculos("dev-1");expect(o).toEqual({run_id:"run-1",speculos_url:"https://speculos:5000",model:"stax"})}),it("requests the screenshot as a blob",async()=>{const e=new Blob([new Uint8Array([137,80])],{type:"image/png"}),t=n().mockResponse({method:"get",endpoint:"devices/dev-1/speculos/screenshot",response:e}),c=await new s("http://localhost:8080",{token:"tok",httpClient:t}).getScreenshot("dev-1");expect(c).toBe(e);const p=t.configs.find(({endpoint:d})=>d==="devices/dev-1/speculos/screenshot");expect(p?.config?.responseType).toBe("blob")}),it("presses a button",async()=>{const e=n();await new s("http://localhost:8080",{token:"tok",httpClient:e}).pressButton("dev-1","both"),expect(e.calls).toContainEqual({method:"post",endpoint:"devices/dev-1/speculos/button/both",body:{action:"press-and-release"}})}),it("forwards an explicit button action",async()=>{const e=n();await new s("http://localhost:8080",{token:"tok",httpClient:e}).pressButton("dev-1","left","press"),expect(e.calls).toContainEqual({method:"post",endpoint:"devices/dev-1/speculos/button/left",body:{action:"press"}})}),it("taps the screen at device coordinates",async()=>{const e=n();await new s("http://localhost:8080",{token:"tok",httpClient:e}).touchScreen("dev-1",200,537),expect(e.calls).toContainEqual({method:"post",endpoint:"devices/dev-1/speculos/finger",body:{action:"press-and-release",x:200,y:537}})})}),describe("session",()=>{it("fetches the current session",async()=>{const e=n().mockResponse({method:"get",endpoint:"sessions/current",response:{id:"sess-1",created_at:1,expires_at:2,devices:[i()]}}),o=await new s("http://localhost:8080",{token:"tok",httpClient:e}).getSession();expect(o.id).toBe("sess-1"),expect(o.devices).toHaveLength(1)}),it("sets the session seed with the bearer token",async()=>{const e=n();await new s("http://localhost:8080",{token:"tok",httpClient:e}).setSeed("abandon abandon about"),expect(e.calls).toEqual([{method:"put",endpoint:"sessions/current/seed",body:{seed:"abandon abandon about"}}]),expect(e.configs[0]?.config?.headers).toEqual({Authorization:"Bearer tok"})}),it("disposes the session and clears the stored token",async()=>{const e=n().mockResponse({method:"delete",endpoint:"sessions/current",response:{}}),t=new s("http://localhost:8080",{token:"tok",httpClient:e});await expect(t.disposeSession()).resolves.toBe(!0),expect(t.getToken()).toBeUndefined()})}),describe("response validation",()=>{it("throws a descriptive error when the server response is malformed",async()=>{const e=n().mockResponse({method:"get",endpoint:"devices/dev-1",response:{id:123}}),t=new s("http://localhost:8080",{token:"tok",httpClient:e});await expect(t.getDevice("dev-1")).rejects.toThrow(/MockClient: invalid server response/)})}),describe("import/export",()=>{it("exports the session snapshot",async()=>{const e={devices:[{name:"Ledger Stax",device_type:"stax",mocks:[{prefix:"ff",responses:["9000"]}]}]},t=n().mockResponse({method:"get",endpoint:"export",response:e}),c=await new s("http://localhost:8080",{token:"tok",httpClient:t}).exportSession();expect(c).toEqual(e)}),it("posts a snapshot to the import endpoint",async()=>{const e={devices:[{name:"Ledger Flex",device_type:"flex",mocks:[{prefix:"e0010000",responses:["aa9000","5515"]}]}]},t=n().mockResponse({method:"post",endpoint:"import",response:e}),c=await new s("http://localhost:8080",{token:"tok",httpClient:t}).importSession(e);expect(c).toEqual(e),expect(t.calls).toContainEqual({method:"post",endpoint:"import",body:e})})}),describe("apdu",()=>{it("sends a binary APDU as hex to the device apdu endpoint",async()=>{const e=n().mockResponse({method:"post",endpoint:"devices/dev-1/apdu",response:{response:"9000"}}),o=await new s("http://localhost:8080",{token:"tok",httpClient:e}).sendApdu("dev-1",Uint8Array.from([224,1,0,0]));expect(o.response).toBe("9000"),expect(e.calls).toContainEqual({method:"post",endpoint:"devices/dev-1/apdu",body:{apdu:"e0010000"}})})})});
2
- //# sourceMappingURL=MockClient.test.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/MockClient.test.ts"],
4
- "sourcesContent": ["import { httpClientStubBuilder } from \"./DmkNetworkClient.stub\";\nimport { MockClient } from \"./MockClient\";\n\nconst aDevice = (overrides: Record<string, unknown> = {}) => ({\n id: \"dev-1\",\n name: \"Ledger Nano X\",\n device_type: \"nanoX\",\n connectivity_type: \"USB\",\n ...overrides,\n});\n\ndescribe(\"MockClient\", () => {\n describe(\"authentication\", () => {\n it(\"lazily creates a session via /auth when no token is provided\", async () => {\n const http = httpClientStubBuilder()\n .mockResponse({\n method: \"post\",\n endpoint: \"auth\",\n response: { token: \"tok-123\", expires_at: 42 },\n })\n .mockResponse({\n method: \"get\",\n endpoint: \"devices\",\n response: [],\n });\n const client = new MockClient(\"http://localhost:8080\", {\n httpClient: http,\n });\n\n const devices = await client.listDevices();\n\n expect(client.getToken()).toBe(\"tok-123\");\n expect(http.calls).toContainEqual({\n method: \"post\",\n endpoint: \"auth\",\n body: {},\n });\n expect(devices).toEqual([]);\n });\n\n it(\"does not call /auth when a token is injected\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"get\",\n endpoint: \"devices\",\n response: [],\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"injected\",\n httpClient: http,\n });\n\n await client.listDevices();\n\n expect(client.getToken()).toBe(\"injected\");\n expect(\n http.calls.find((call) => call.endpoint === \"auth\"),\n ).toBeUndefined();\n });\n\n it(\"returns the token from an explicit authenticate() call\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"post\",\n endpoint: \"auth\",\n response: { token: \"tok-abc\", expires_at: 99 },\n });\n const client = new MockClient(\"http://localhost:8080\", {\n httpClient: http,\n });\n\n const token = await client.authenticate();\n\n expect(token).toBe(\"tok-abc\");\n expect(client.getToken()).toBe(\"tok-abc\");\n });\n\n it(\"reuses a single in-flight /auth call for concurrent requests\", async () => {\n const http = httpClientStubBuilder()\n .mockResponse({\n method: \"post\",\n endpoint: \"auth\",\n response: { token: \"tok-shared\", expires_at: 1 },\n })\n .mockResponse({ method: \"get\", endpoint: \"devices\", response: [] });\n const client = new MockClient(\"http://localhost:8080\", {\n httpClient: http,\n });\n\n await Promise.all([client.listDevices(), client.listDevices()]);\n\n const authCalls = http.calls.filter((call) => call.endpoint === \"auth\");\n expect(authCalls).toHaveLength(1);\n });\n\n it(\"returns undefined token before any session is established\", () => {\n const client = new MockClient(\"http://localhost:8080\", {\n httpClient: httpClientStubBuilder(),\n });\n\n expect(client.getToken()).toBeUndefined();\n });\n });\n\n describe(\"constructor\", () => {\n it(\"normalizes a base url without a trailing slash\", () => {\n const withSlash = new MockClient(\"http://localhost:8080/\");\n const withoutSlash = new MockClient(\"http://localhost:8080\");\n\n expect(withSlash.getToken()).toBeUndefined();\n expect(withoutSlash.getToken()).toBeUndefined();\n });\n });\n\n describe(\"health\", () => {\n it(\"checks the server health without creating a session\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"get\",\n endpoint: \"health\",\n response: { status: \"ok\", sessions: 3 },\n });\n const client = new MockClient(\"http://localhost:8080\", {\n httpClient: http,\n });\n\n const health = await client.getHealth();\n\n expect(health).toEqual({ status: \"ok\", sessions: 3 });\n expect(http.calls).toEqual([{ method: \"get\", endpoint: \"health\" }]);\n expect(http.configs[0]?.config?.headers).toBeUndefined();\n });\n });\n\n describe(\"timeout\", () => {\n it(\"applies the timeout to every request, the implicit /auth included\", async () => {\n const http = httpClientStubBuilder()\n .mockResponse({\n method: \"post\",\n endpoint: \"auth\",\n response: { token: \"tok\", expires_at: 1 },\n })\n .mockResponse({ method: \"get\", endpoint: \"devices\", response: [] });\n const client = new MockClient(\"http://localhost:8080\", {\n httpClient: http,\n timeoutMs: 4000,\n });\n\n await client.listDevices();\n\n expect(http.configs.map(({ config }) => config?.timeoutMs)).toEqual([\n 4000, 4000,\n ]);\n });\n\n it(\"sets no timeout by default\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"get\",\n endpoint: \"devices\",\n response: [],\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n await client.listDevices();\n\n expect(http.configs[0]?.config?.timeoutMs).toBeUndefined();\n });\n });\n\n describe(\"devices\", () => {\n it(\"lists devices\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"get\",\n endpoint: \"devices\",\n response: [aDevice()],\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n const devices = await client.listDevices();\n\n expect(devices).toEqual([expect.objectContaining({ id: \"dev-1\" })]);\n });\n\n it(\"adds a device with a default empty config\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"post\",\n endpoint: \"devices\",\n response: aDevice(),\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n const device = await client.addDevice();\n\n expect(device.id).toBe(\"dev-1\");\n expect(http.calls).toContainEqual({\n method: \"post\",\n endpoint: \"devices\",\n body: {},\n });\n });\n\n it(\"gets a single device\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"get\",\n endpoint: \"devices/dev-1\",\n response: aDevice(),\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n const device = await client.getDevice(\"dev-1\");\n\n expect(device.id).toBe(\"dev-1\");\n });\n\n it(\"edits a device\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"patch\",\n endpoint: \"devices/dev-1\",\n response: aDevice({ name: \"Renamed\" }),\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n const device = await client.editDevice(\"dev-1\", { name: \"Renamed\" });\n\n expect(device.name).toBe(\"Renamed\");\n expect(http.calls).toContainEqual({\n method: \"patch\",\n endpoint: \"devices/dev-1\",\n body: { name: \"Renamed\" },\n });\n });\n\n it(\"deletes a device\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"delete\",\n endpoint: \"devices/dev-1\",\n response: {},\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n await expect(client.deleteDevice(\"dev-1\")).resolves.toBe(true);\n expect(http.calls).toContainEqual({\n method: \"delete\",\n endpoint: \"devices/dev-1\",\n });\n });\n });\n\n describe(\"connection state\", () => {\n it(\"connects a device\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"post\",\n endpoint: \"devices/dev-1/connect\",\n response: { device: aDevice(), connected: true },\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n const state = await client.connect(\"dev-1\");\n\n expect(state.connected).toBe(true);\n expect(state.device.id).toBe(\"dev-1\");\n });\n\n it(\"disconnects a device\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"post\",\n endpoint: \"devices/dev-1/disconnect\",\n response: {},\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n await expect(client.disconnect(\"dev-1\")).resolves.toBe(true);\n });\n\n it(\"disconnects every connected device\", async () => {\n const http = httpClientStubBuilder()\n .mockResponse({\n method: \"get\",\n endpoint: \"devices\",\n response: [\n aDevice({ id: \"dev-1\", connected: true }),\n aDevice({ id: \"dev-2\", connected: false }),\n aDevice({ id: \"dev-3\", connected: true }),\n ],\n })\n .mockResponse({\n method: \"post\",\n endpoint: \"devices/dev-1/disconnect\",\n response: {},\n })\n .mockResponse({\n method: \"post\",\n endpoint: \"devices/dev-3/disconnect\",\n response: {},\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n await expect(client.disconnectAll()).resolves.toBe(true);\n\n const disconnectCalls = http.calls.filter((call) =>\n call.endpoint.endsWith(\"/disconnect\"),\n );\n expect(disconnectCalls.map((call) => call.endpoint)).toEqual([\n \"devices/dev-1/disconnect\",\n \"devices/dev-3/disconnect\",\n ]);\n });\n });\n\n describe(\"mocks\", () => {\n it(\"lists device-scoped mocks\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"get\",\n endpoint: \"devices/dev-1/mocks\",\n response: [{ id: \"m1\", prefix: \"e0010000\", responses: [\"9000\"] }],\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n const mocks = await client.listMocks(\"dev-1\");\n\n expect(mocks).toEqual([expect.objectContaining({ id: \"m1\" })]);\n });\n\n it(\"creates a device-scoped mock\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"post\",\n endpoint: \"devices/dev-1/mocks\",\n response: { id: \"m1\", prefix: \"e0010000\", responses: [\"9000\"] },\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n const mock = await client.addMock(\"dev-1\", {\n prefix: \"e0010000\",\n response: \"9000\",\n });\n\n expect(mock.id).toBe(\"m1\");\n expect(http.calls).toContainEqual({\n method: \"post\",\n endpoint: \"devices/dev-1/mocks\",\n body: { prefix: \"e0010000\", response: \"9000\" },\n });\n });\n\n it(\"edits a mock\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"patch\",\n endpoint: \"devices/dev-1/mocks/m1\",\n response: { id: \"m1\", prefix: \"e0010000\", responses: [\"6985\"] },\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n const mock = await client.editMock(\"dev-1\", \"m1\", {\n prefix: \"e0010000\",\n response: \"6985\",\n });\n\n expect(mock.responses).toEqual([\"6985\"]);\n expect(http.calls).toContainEqual({\n method: \"patch\",\n endpoint: \"devices/dev-1/mocks/m1\",\n body: { prefix: \"e0010000\", response: \"6985\" },\n });\n });\n\n it(\"deletes a single mock\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"delete\",\n endpoint: \"devices/dev-1/mocks/m1\",\n response: {},\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n await expect(client.deleteMock(\"dev-1\", \"m1\")).resolves.toBe(true);\n expect(http.calls).toContainEqual({\n method: \"delete\",\n endpoint: \"devices/dev-1/mocks/m1\",\n });\n });\n\n it(\"clears all mocks of a device\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"delete\",\n endpoint: \"devices/dev-1/mocks\",\n response: {},\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n await expect(client.clearMocks(\"dev-1\")).resolves.toBe(true);\n expect(http.calls).toContainEqual({\n method: \"delete\",\n endpoint: \"devices/dev-1/mocks\",\n });\n });\n });\n\n describe(\"speculos\", () => {\n it(\"resolves the live speculos instance backing a device\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"get\",\n endpoint: \"devices/dev-1/speculos\",\n response: {\n run_id: \"run-1\",\n speculos_url: \"https://speculos:5000\",\n model: \"stax\",\n },\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n const instance = await client.getSpeculos(\"dev-1\");\n\n expect(instance).toEqual({\n run_id: \"run-1\",\n speculos_url: \"https://speculos:5000\",\n model: \"stax\",\n });\n });\n\n it(\"requests the screenshot as a blob\", async () => {\n const png = new Blob([new Uint8Array([0x89, 0x50])], {\n type: \"image/png\",\n });\n const http = httpClientStubBuilder().mockResponse({\n method: \"get\",\n endpoint: \"devices/dev-1/speculos/screenshot\",\n response: png,\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n const screenshot = await client.getScreenshot(\"dev-1\");\n\n expect(screenshot).toBe(png);\n // Anything but \"blob\" would decode the PNG as text and corrupt it.\n const request = http.configs.find(\n ({ endpoint }) => endpoint === \"devices/dev-1/speculos/screenshot\",\n );\n expect(request?.config?.responseType).toBe(\"blob\");\n });\n\n it(\"presses a button\", async () => {\n const http = httpClientStubBuilder();\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n await client.pressButton(\"dev-1\", \"both\");\n\n expect(http.calls).toContainEqual({\n method: \"post\",\n endpoint: \"devices/dev-1/speculos/button/both\",\n body: { action: \"press-and-release\" },\n });\n });\n\n it(\"forwards an explicit button action\", async () => {\n const http = httpClientStubBuilder();\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n await client.pressButton(\"dev-1\", \"left\", \"press\");\n\n expect(http.calls).toContainEqual({\n method: \"post\",\n endpoint: \"devices/dev-1/speculos/button/left\",\n body: { action: \"press\" },\n });\n });\n\n it(\"taps the screen at device coordinates\", async () => {\n const http = httpClientStubBuilder();\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n await client.touchScreen(\"dev-1\", 200, 537);\n\n expect(http.calls).toContainEqual({\n method: \"post\",\n endpoint: \"devices/dev-1/speculos/finger\",\n body: { action: \"press-and-release\", x: 200, y: 537 },\n });\n });\n });\n\n describe(\"session\", () => {\n it(\"fetches the current session\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"get\",\n endpoint: \"sessions/current\",\n response: {\n id: \"sess-1\",\n created_at: 1,\n expires_at: 2,\n devices: [aDevice()],\n },\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n const session = await client.getSession();\n\n expect(session.id).toBe(\"sess-1\");\n expect(session.devices).toHaveLength(1);\n });\n\n it(\"sets the session seed with the bearer token\", async () => {\n const http = httpClientStubBuilder();\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n await client.setSeed(\"abandon abandon about\");\n\n expect(http.calls).toEqual([\n {\n method: \"put\",\n endpoint: \"sessions/current/seed\",\n body: { seed: \"abandon abandon about\" },\n },\n ]);\n expect(http.configs[0]?.config?.headers).toEqual({\n Authorization: \"Bearer tok\",\n });\n });\n\n it(\"disposes the session and clears the stored token\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"delete\",\n endpoint: \"sessions/current\",\n response: {},\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n await expect(client.disposeSession()).resolves.toBe(true);\n expect(client.getToken()).toBeUndefined();\n });\n });\n\n describe(\"response validation\", () => {\n it(\"throws a descriptive error when the server response is malformed\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"get\",\n endpoint: \"devices/dev-1\",\n response: { id: 123 } as unknown as object,\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n await expect(client.getDevice(\"dev-1\")).rejects.toThrow(\n /MockClient: invalid server response/,\n );\n });\n });\n\n describe(\"import/export\", () => {\n it(\"exports the session snapshot\", async () => {\n const snapshot = {\n devices: [\n {\n name: \"Ledger Stax\",\n device_type: \"stax\",\n mocks: [{ prefix: \"ff\", responses: [\"9000\"] }],\n },\n ],\n };\n const http = httpClientStubBuilder().mockResponse({\n method: \"get\",\n endpoint: \"export\",\n response: snapshot,\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n const result = await client.exportSession();\n\n expect(result).toEqual(snapshot);\n });\n\n it(\"posts a snapshot to the import endpoint\", async () => {\n const snapshot = {\n devices: [\n {\n name: \"Ledger Flex\",\n device_type: \"flex\",\n mocks: [{ prefix: \"e0010000\", responses: [\"aa9000\", \"5515\"] }],\n },\n ],\n };\n const http = httpClientStubBuilder().mockResponse({\n method: \"post\",\n endpoint: \"import\",\n response: snapshot,\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n const result = await client.importSession(snapshot);\n\n expect(result).toEqual(snapshot);\n expect(http.calls).toContainEqual({\n method: \"post\",\n endpoint: \"import\",\n body: snapshot,\n });\n });\n });\n\n describe(\"apdu\", () => {\n it(\"sends a binary APDU as hex to the device apdu endpoint\", async () => {\n const http = httpClientStubBuilder().mockResponse({\n method: \"post\",\n endpoint: \"devices/dev-1/apdu\",\n response: { response: \"9000\" },\n });\n const client = new MockClient(\"http://localhost:8080\", {\n token: \"tok\",\n httpClient: http,\n });\n\n const result = await client.sendApdu(\n \"dev-1\",\n Uint8Array.from([0xe0, 0x01, 0x00, 0x00]),\n );\n\n expect(result.response).toBe(\"9000\");\n expect(http.calls).toContainEqual({\n method: \"post\",\n endpoint: \"devices/dev-1/apdu\",\n body: { apdu: \"e0010000\" },\n });\n });\n });\n});\n"],
5
- "mappings": "AAAA,OAAS,yBAAAA,MAA6B,0BACtC,OAAS,cAAAC,MAAkB,eAE3B,MAAMC,EAAU,CAACC,EAAqC,CAAC,KAAO,CAC5D,GAAI,QACJ,KAAM,gBACN,YAAa,QACb,kBAAmB,MACnB,GAAGA,CACL,GAEA,SAAS,aAAc,IAAM,CAC3B,SAAS,iBAAkB,IAAM,CAC/B,GAAG,+DAAgE,SAAY,CAC7E,MAAMC,EAAOJ,EAAsB,EAChC,aAAa,CACZ,OAAQ,OACR,SAAU,OACV,SAAU,CAAE,MAAO,UAAW,WAAY,EAAG,CAC/C,CAAC,EACA,aAAa,CACZ,OAAQ,MACR,SAAU,UACV,SAAU,CAAC,CACb,CAAC,EACGK,EAAS,IAAIJ,EAAW,wBAAyB,CACrD,WAAYG,CACd,CAAC,EAEKE,EAAU,MAAMD,EAAO,YAAY,EAEzC,OAAOA,EAAO,SAAS,CAAC,EAAE,KAAK,SAAS,EACxC,OAAOD,EAAK,KAAK,EAAE,eAAe,CAChC,OAAQ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AyB,CACrD,MAAO,MACP,WAAYG,CACd,CAAC,EAE2B,SAC1B,QACA,WAAW,KAAK,CAAC,IAAM,EAAM,EAAM,CAAI,CAAC,CAC1C,EAEA,OAAOsB,EAAO,QAAQ,EAAE,KAAK,MAAM,EACnC,OAAOtB,EAAK,KAAK,EAAE,eAAe,CAChC,OAAQ,OACR,SAAU,qBACV,KAAM,CAAE,KAAM,UAAW,CAC3B,CAAC,CACH,CAAC,CACH,CAAC,CACH,CAAC",
6
- "names": ["httpClientStubBuilder", "MockClient", "aDevice", "overrides", "http", "client", "devices", "call", "token", "authCalls", "withSlash", "withoutSlash", "health", "config", "device", "state", "disconnectCalls", "mocks", "mock", "instance", "png", "screenshot", "request", "endpoint", "session", "snapshot", "result"]
7
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=MockClient.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MockClient.test.d.ts","sourceRoot":"","sources":["../../../src/MockClient.test.ts"],"names":[],"mappings":""}