@ledgerhq/signer-utils 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/index.js.map +2 -2
- package/lib/cjs/package.json +2 -2
- package/lib/cjs/utils/SendCommandInChunksTask.js +2 -0
- package/lib/cjs/utils/SendCommandInChunksTask.js.map +7 -0
- package/lib/cjs/utils/SendCommandInChunksTask.test.js +2 -0
- package/lib/cjs/utils/SendCommandInChunksTask.test.js.map +7 -0
- package/lib/esm/index.js +1 -1
- package/lib/esm/index.js.map +2 -2
- package/lib/esm/package.json +2 -2
- package/lib/esm/utils/SendCommandInChunksTask.js +2 -0
- package/lib/esm/utils/SendCommandInChunksTask.js.map +7 -0
- package/lib/esm/utils/SendCommandInChunksTask.test.js +2 -0
- package/lib/esm/utils/SendCommandInChunksTask.test.js.map +7 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
- package/lib/types/utils/SendCommandInChunksTask.d.ts +18 -0
- package/lib/types/utils/SendCommandInChunksTask.d.ts.map +1 -0
- package/lib/types/utils/SendCommandInChunksTask.test.d.ts +2 -0
- package/lib/types/utils/SendCommandInChunksTask.test.d.ts.map +1 -0
- package/package.json +4 -4
package/lib/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var t=(f,e,p,x)=>{if(e&&typeof e=="object"||typeof e=="function")for(let m of c(e))!d.call(f,m)&&m!==p&&a(f,m,{get:()=>e[m],enumerable:!(x=b(e,m))||x.enumerable});return f},r=(f,e,p)=>(t(f,e,"default"),p&&t(p,e,"default"));var g=f=>t(a({},"__esModule",{value:!0}),f);var o={};module.exports=g(o);r(o,require("./utils/CommandErrorHelper"),module.exports);r(o,require("./utils/DerivationPathUtils"),module.exports);r(o,require("./utils/SignatureIdUtils"),module.exports);0&&(module.exports={...require("./utils/CommandErrorHelper"),...require("./utils/DerivationPathUtils"),...require("./utils/SignatureIdUtils")});
|
|
1
|
+
"use strict";var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var t=(f,e,p,x)=>{if(e&&typeof e=="object"||typeof e=="function")for(let m of c(e))!d.call(f,m)&&m!==p&&a(f,m,{get:()=>e[m],enumerable:!(x=b(e,m))||x.enumerable});return f},r=(f,e,p)=>(t(f,e,"default"),p&&t(p,e,"default"));var g=f=>t(a({},"__esModule",{value:!0}),f);var o={};module.exports=g(o);r(o,require("./utils/CommandErrorHelper"),module.exports);r(o,require("./utils/DerivationPathUtils"),module.exports);r(o,require("./utils/SendCommandInChunksTask"),module.exports);r(o,require("./utils/SignatureIdUtils"),module.exports);0&&(module.exports={...require("./utils/CommandErrorHelper"),...require("./utils/DerivationPathUtils"),...require("./utils/SendCommandInChunksTask"),...require("./utils/SignatureIdUtils")});
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["export * from \"./utils/CommandErrorHelper\";\nexport * from \"./utils/DerivationPathUtils\";\nexport * from \"./utils/SignatureIdUtils\";\n"],
|
|
5
|
-
"mappings": "iaAAA,IAAAA,EAAA,kBAAAC,EAAAD,GAAAE,EAAAF,EAAc,sCAAd,gBACAE,EAAAF,EAAc,uCADd,gBAEAE,EAAAF,EAAc,
|
|
4
|
+
"sourcesContent": ["export * from \"./utils/CommandErrorHelper\";\nexport * from \"./utils/DerivationPathUtils\";\nexport * from \"./utils/SendCommandInChunksTask\";\nexport * from \"./utils/SignatureIdUtils\";\n"],
|
|
5
|
+
"mappings": "iaAAA,IAAAA,EAAA,kBAAAC,EAAAD,GAAAE,EAAAF,EAAc,sCAAd,gBACAE,EAAAF,EAAc,uCADd,gBAEAE,EAAAF,EAAc,2CAFd,gBAGAE,EAAAF,EAAc,oCAHd",
|
|
6
6
|
"names": ["index_exports", "__toCommonJS", "__reExport"]
|
|
7
7
|
}
|
package/lib/cjs/package.json
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"license": "Apache-2.0",
|
|
31
31
|
"name": "@ledgerhq/signer-utils",
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@ledgerhq/device-management-kit": "^1.
|
|
33
|
+
"@ledgerhq/device-management-kit": "^1.7.1"
|
|
34
34
|
},
|
|
35
35
|
"private": false,
|
|
36
36
|
"repository": {
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"watch:builds": "pnpm ldmk-tool watch --entryPoints src/index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
|
|
54
54
|
"watch:types": "concurrently \"tsc --watch -p tsconfig.prod.json\" \"tsc-alias --watch -p tsconfig.prod.json\""
|
|
55
55
|
},
|
|
56
|
-
"version": "1.
|
|
56
|
+
"version": "1.3.0"
|
|
57
57
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var d=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var i=(n,r)=>{for(var t in r)d(n,t,{get:r[t],enumerable:!0})},c=(n,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of l(r))!u.call(n,a)&&a!==t&&d(n,a,{get:()=>r[a],enumerable:!(o=C(r,a))||o.enumerable});return n};var p=n=>c(d({},"__esModule",{value:!0}),n);var h={};i(h,{SendCommandInChunksTask:()=>y});module.exports=p(h);var e=require("@ledgerhq/device-management-kit");class y{constructor(r,t){this.api=r;this.args=t}async run(){const{data:r,commandFactory:t}=this.args,o=new e.ByteArrayBuilder(r.length).addBufferToData(r).build();for(let a=0;a<o.length;a+=e.APDU_MAX_PAYLOAD){const m=a+e.APDU_MAX_PAYLOAD>=o.length,s=await this.api.sendCommand(t({more:!m,extend:a>0,chunkedData:o.slice(a,a+e.APDU_MAX_PAYLOAD)}));if(!(0,e.isSuccessCommandResult)(s))return s;if(m)return(0,e.CommandResultFactory)({data:s.data})}throw new e.InvalidStatusWordError("No result after processing all chunks")}}0&&(module.exports={SendCommandInChunksTask});
|
|
2
|
+
//# sourceMappingURL=SendCommandInChunksTask.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/utils/SendCommandInChunksTask.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n APDU_MAX_PAYLOAD,\n ByteArrayBuilder,\n type Command,\n type CommandResult,\n CommandResultFactory,\n type InternalApi,\n InvalidStatusWordError,\n isSuccessCommandResult,\n} from \"@ledgerhq/device-management-kit\";\n\nexport type SendCommandInChunksTaskArgs<T, ErrorCodes extends string> = {\n data: Uint8Array;\n commandFactory: CommandFactory<T, ErrorCodes>;\n};\n\nexport type CommandFactory<T, ErrorCodes extends string> = <\n V extends ChunkableCommandArgs,\n>(\n args: ChunkableCommandArgs,\n) => Command<T, V, ErrorCodes>;\n\nexport type ChunkableCommandArgs = {\n chunkedData: Uint8Array;\n more: boolean;\n extend: boolean;\n};\n\nexport class SendCommandInChunksTask<T, ErrorCodes extends string> {\n constructor(\n private api: InternalApi,\n private readonly args: SendCommandInChunksTaskArgs<T, ErrorCodes>,\n ) {}\n\n async run(): Promise<CommandResult<T, ErrorCodes>> {\n const { data: fullPayload, commandFactory } = this.args;\n\n const dataBuffer = new ByteArrayBuilder(fullPayload.length)\n .addBufferToData(fullPayload)\n .build();\n\n for (\n let offset = 0;\n offset < dataBuffer.length;\n offset += APDU_MAX_PAYLOAD\n ) {\n const isLastChunk = offset + APDU_MAX_PAYLOAD >= dataBuffer.length;\n const result = await this.api.sendCommand(\n commandFactory({\n more: !isLastChunk,\n extend: offset > 0,\n chunkedData: dataBuffer.slice(offset, offset + APDU_MAX_PAYLOAD),\n }),\n );\n\n if (!isSuccessCommandResult(result)) {\n return result;\n }\n\n if (isLastChunk) {\n return CommandResultFactory({\n data: result.data,\n });\n }\n }\n\n throw new InvalidStatusWordError(\"No result after processing all chunks\");\n }\n}\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,6BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EASO,2CAmBA,MAAMF,CAAsD,CACjE,YACUG,EACSC,EACjB,CAFQ,SAAAD,EACS,UAAAC,CAChB,CAEH,MAAM,KAA6C,CACjD,KAAM,CAAE,KAAMC,EAAa,eAAAC,CAAe,EAAI,KAAK,KAE7CC,EAAa,IAAI,mBAAiBF,EAAY,MAAM,EACvD,gBAAgBA,CAAW,EAC3B,MAAM,EAET,QACMG,EAAS,EACbA,EAASD,EAAW,OACpBC,GAAU,mBACV,CACA,MAAMC,EAAcD,EAAS,oBAAoBD,EAAW,OACtDG,EAAS,MAAM,KAAK,IAAI,YAC5BJ,EAAe,CACb,KAAM,CAACG,EACP,OAAQD,EAAS,EACjB,YAAaD,EAAW,MAAMC,EAAQA,EAAS,kBAAgB,CACjE,CAAC,CACH,EAEA,GAAI,IAAC,0BAAuBE,CAAM,EAChC,OAAOA,EAGT,GAAID,EACF,SAAO,wBAAqB,CAC1B,KAAMC,EAAO,IACf,CAAC,CAEL,CAEA,MAAM,IAAI,yBAAuB,uCAAuC,CAC1E,CACF",
|
|
6
|
+
"names": ["SendCommandInChunksTask_exports", "__export", "SendCommandInChunksTask", "__toCommonJS", "import_device_management_kit", "api", "args", "fullPayload", "commandFactory", "dataBuffer", "offset", "isLastChunk", "result"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("@ledgerhq/device-management-kit"),m=require("./SendCommandInChunksTask");class c{constructor(o){this.args=o}name="dummy";getApdu(){throw new Error("not used in tests")}parseResponse(){throw new Error("not used in tests")}}const l=()=>({sendCommand:vi.fn()});describe("SendCommandInChunksTask",()=>{beforeEach(()=>{vi.resetAllMocks()}),it("sends a payload smaller than APDU_MAX_PAYLOAD in a single chunk with more=false, extend=false",async()=>{const a=l(),o=new Uint8Array([1,2,3]);a.sendCommand.mockResolvedValueOnce((0,e.CommandResultFactory)({data:{value:"ok"}}));const n=await new m.SendCommandInChunksTask(a,{data:o,commandFactory:t=>new c(t)}).run();expect(a.sendCommand).toHaveBeenCalledTimes(1);const s=a.sendCommand.mock.calls[0]?.[0];expect(s.args).toEqual({chunkedData:o,more:!1,extend:!1}),expect((0,e.isSuccessCommandResult)(n)).toBe(!0)}),it("splits a payload larger than APDU_MAX_PAYLOAD into ordered chunks with proper flags",async()=>{const a=l(),o=e.APDU_MAX_PAYLOAD*2+10,n=new Uint8Array(o).map((u,p)=>p&255);a.sendCommand.mockResolvedValueOnce((0,e.CommandResultFactory)({data:{value:"chunk1"}})).mockResolvedValueOnce((0,e.CommandResultFactory)({data:{value:"chunk2"}})).mockResolvedValueOnce((0,e.CommandResultFactory)({data:{value:"final"}}));const s=await new m.SendCommandInChunksTask(a,{data:n,commandFactory:u=>new c(u)}).run();expect(a.sendCommand).toHaveBeenCalledTimes(3);const t=a.sendCommand.mock.calls[0]?.[0];expect(t.args.chunkedData).toEqual(n.slice(0,e.APDU_MAX_PAYLOAD)),expect(t.args.more).toBe(!0),expect(t.args.extend).toBe(!1);const r=a.sendCommand.mock.calls[1]?.[0];expect(r.args.chunkedData).toEqual(n.slice(e.APDU_MAX_PAYLOAD,e.APDU_MAX_PAYLOAD*2)),expect(r.args.more).toBe(!0),expect(r.args.extend).toBe(!0);const d=a.sendCommand.mock.calls[2]?.[0];expect(d.args.chunkedData).toEqual(n.slice(e.APDU_MAX_PAYLOAD*2)),expect(d.args.more).toBe(!1),expect(d.args.extend).toBe(!0),expect((0,e.isSuccessCommandResult)(s)).toBe(!0),(0,e.isSuccessCommandResult)(s)&&expect(s.data).toEqual({value:"final"})}),it("stops sending and returns the error result when a chunk fails",async()=>{const a=l(),o=new Uint8Array(e.APDU_MAX_PAYLOAD*3),n=new e.InvalidStatusWordError("chunk failed");a.sendCommand.mockResolvedValueOnce((0,e.CommandResultFactory)({data:{value:"chunk1"}})).mockResolvedValueOnce((0,e.CommandResultFactory)({error:n}));const s=await new m.SendCommandInChunksTask(a,{data:o,commandFactory:t=>new c(t)}).run();expect(a.sendCommand).toHaveBeenCalledTimes(2),expect(s).toMatchObject({error:n})})});
|
|
2
|
+
//# sourceMappingURL=SendCommandInChunksTask.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/utils/SendCommandInChunksTask.test.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n APDU_MAX_PAYLOAD,\n CommandResultFactory,\n type InternalApi,\n InvalidStatusWordError,\n isSuccessCommandResult,\n} from \"@ledgerhq/device-management-kit\";\n\nimport {\n type ChunkableCommandArgs,\n SendCommandInChunksTask,\n} from \"./SendCommandInChunksTask\";\n\ntype DummyResponse = { value: string };\ntype DummyErrorCodes = \"4224\";\n\nclass DummyCommand {\n readonly name = \"dummy\";\n constructor(readonly args: ChunkableCommandArgs) {}\n getApdu() {\n throw new Error(\"not used in tests\");\n }\n parseResponse() {\n throw new Error(\"not used in tests\");\n }\n}\n\nconst makeApiMock = () =>\n ({\n sendCommand: vi.fn(),\n }) as unknown as InternalApi & {\n sendCommand: ReturnType<typeof vi.fn>;\n };\n\ndescribe(\"SendCommandInChunksTask\", () => {\n beforeEach(() => {\n vi.resetAllMocks();\n });\n\n it(\"sends a payload smaller than APDU_MAX_PAYLOAD in a single chunk with more=false, extend=false\", async () => {\n const api = makeApiMock();\n const payload = new Uint8Array([0x01, 0x02, 0x03]);\n api.sendCommand.mockResolvedValueOnce(\n CommandResultFactory<DummyResponse, DummyErrorCodes>({\n data: { value: \"ok\" },\n }),\n );\n\n const result = await new SendCommandInChunksTask<\n DummyResponse,\n DummyErrorCodes\n >(api, {\n data: payload,\n commandFactory: (args) => new DummyCommand(args) as never,\n }).run();\n\n expect(api.sendCommand).toHaveBeenCalledTimes(1);\n const sent = api.sendCommand.mock.calls[0]?.[0] as DummyCommand;\n expect(sent.args).toEqual({\n chunkedData: payload,\n more: false,\n extend: false,\n });\n expect(isSuccessCommandResult(result)).toBe(true);\n });\n\n it(\"splits a payload larger than APDU_MAX_PAYLOAD into ordered chunks with proper flags\", async () => {\n const api = makeApiMock();\n const totalLength = APDU_MAX_PAYLOAD * 2 + 10;\n const payload = new Uint8Array(totalLength).map((_, i) => i & 0xff);\n\n api.sendCommand\n .mockResolvedValueOnce(\n CommandResultFactory<DummyResponse, DummyErrorCodes>({\n data: { value: \"chunk1\" },\n }),\n )\n .mockResolvedValueOnce(\n CommandResultFactory<DummyResponse, DummyErrorCodes>({\n data: { value: \"chunk2\" },\n }),\n )\n .mockResolvedValueOnce(\n CommandResultFactory<DummyResponse, DummyErrorCodes>({\n data: { value: \"final\" },\n }),\n );\n\n const result = await new SendCommandInChunksTask<\n DummyResponse,\n DummyErrorCodes\n >(api, {\n data: payload,\n commandFactory: (args) => new DummyCommand(args) as never,\n }).run();\n\n expect(api.sendCommand).toHaveBeenCalledTimes(3);\n\n const call1 = api.sendCommand.mock.calls[0]?.[0] as DummyCommand;\n expect(call1.args.chunkedData).toEqual(payload.slice(0, APDU_MAX_PAYLOAD));\n expect(call1.args.more).toBe(true);\n expect(call1.args.extend).toBe(false);\n\n const call2 = api.sendCommand.mock.calls[1]?.[0] as DummyCommand;\n expect(call2.args.chunkedData).toEqual(\n payload.slice(APDU_MAX_PAYLOAD, APDU_MAX_PAYLOAD * 2),\n );\n expect(call2.args.more).toBe(true);\n expect(call2.args.extend).toBe(true);\n\n const call3 = api.sendCommand.mock.calls[2]?.[0] as DummyCommand;\n expect(call3.args.chunkedData).toEqual(payload.slice(APDU_MAX_PAYLOAD * 2));\n expect(call3.args.more).toBe(false);\n expect(call3.args.extend).toBe(true);\n\n expect(isSuccessCommandResult(result)).toBe(true);\n if (isSuccessCommandResult(result)) {\n expect(result.data).toEqual({ value: \"final\" });\n }\n });\n\n it(\"stops sending and returns the error result when a chunk fails\", async () => {\n const api = makeApiMock();\n const payload = new Uint8Array(APDU_MAX_PAYLOAD * 3);\n const error = new InvalidStatusWordError(\"chunk failed\");\n\n api.sendCommand\n .mockResolvedValueOnce(\n CommandResultFactory<DummyResponse, DummyErrorCodes>({\n data: { value: \"chunk1\" },\n }),\n )\n .mockResolvedValueOnce(\n CommandResultFactory<DummyResponse, DummyErrorCodes>({ error }),\n );\n\n const result = await new SendCommandInChunksTask<\n DummyResponse,\n DummyErrorCodes\n >(api, {\n data: payload,\n commandFactory: (args) => new DummyCommand(args) as never,\n }).run();\n\n expect(api.sendCommand).toHaveBeenCalledTimes(2);\n expect(result).toMatchObject({ error });\n });\n});\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["import_device_management_kit", "import_SendCommandInChunksTask", "DummyCommand", "args", "makeApiMock", "api", "payload", "result", "sent", "totalLength", "_", "i", "call1", "call2", "call3", "error"]
|
|
7
|
+
}
|
package/lib/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export*from"./utils/CommandErrorHelper";export*from"./utils/DerivationPathUtils";export*from"./utils/SignatureIdUtils";
|
|
1
|
+
export*from"./utils/CommandErrorHelper";export*from"./utils/DerivationPathUtils";export*from"./utils/SendCommandInChunksTask";export*from"./utils/SignatureIdUtils";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/lib/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["export * from \"./utils/CommandErrorHelper\";\nexport * from \"./utils/DerivationPathUtils\";\nexport * from \"./utils/SignatureIdUtils\";\n"],
|
|
5
|
-
"mappings": "AAAA,WAAc,6BACd,WAAc,8BACd,WAAc",
|
|
4
|
+
"sourcesContent": ["export * from \"./utils/CommandErrorHelper\";\nexport * from \"./utils/DerivationPathUtils\";\nexport * from \"./utils/SendCommandInChunksTask\";\nexport * from \"./utils/SignatureIdUtils\";\n"],
|
|
5
|
+
"mappings": "AAAA,WAAc,6BACd,WAAc,8BACd,WAAc,kCACd,WAAc",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/lib/esm/package.json
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"license": "Apache-2.0",
|
|
31
31
|
"name": "@ledgerhq/signer-utils",
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@ledgerhq/device-management-kit": "^1.
|
|
33
|
+
"@ledgerhq/device-management-kit": "^1.7.1"
|
|
34
34
|
},
|
|
35
35
|
"private": false,
|
|
36
36
|
"repository": {
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"watch:builds": "pnpm ldmk-tool watch --entryPoints src/index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
|
|
54
54
|
"watch:types": "concurrently \"tsc --watch -p tsconfig.prod.json\" \"tsc-alias --watch -p tsconfig.prod.json\""
|
|
55
55
|
},
|
|
56
|
-
"version": "1.
|
|
56
|
+
"version": "1.3.0"
|
|
57
57
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{APDU_MAX_PAYLOAD as t,ByteArrayBuilder as d,CommandResultFactory as m,InvalidStatusWordError as C,isSuccessCommandResult as l}from"@ledgerhq/device-management-kit";class c{constructor(a,o){this.api=a;this.args=o}async run(){const{data:a,commandFactory:o}=this.args,e=new d(a.length).addBufferToData(a).build();for(let r=0;r<e.length;r+=t){const s=r+t>=e.length,n=await this.api.sendCommand(o({more:!s,extend:r>0,chunkedData:e.slice(r,r+t)}));if(!l(n))return n;if(s)return m({data:n.data})}throw new C("No result after processing all chunks")}}export{c as SendCommandInChunksTask};
|
|
2
|
+
//# sourceMappingURL=SendCommandInChunksTask.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/utils/SendCommandInChunksTask.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n APDU_MAX_PAYLOAD,\n ByteArrayBuilder,\n type Command,\n type CommandResult,\n CommandResultFactory,\n type InternalApi,\n InvalidStatusWordError,\n isSuccessCommandResult,\n} from \"@ledgerhq/device-management-kit\";\n\nexport type SendCommandInChunksTaskArgs<T, ErrorCodes extends string> = {\n data: Uint8Array;\n commandFactory: CommandFactory<T, ErrorCodes>;\n};\n\nexport type CommandFactory<T, ErrorCodes extends string> = <\n V extends ChunkableCommandArgs,\n>(\n args: ChunkableCommandArgs,\n) => Command<T, V, ErrorCodes>;\n\nexport type ChunkableCommandArgs = {\n chunkedData: Uint8Array;\n more: boolean;\n extend: boolean;\n};\n\nexport class SendCommandInChunksTask<T, ErrorCodes extends string> {\n constructor(\n private api: InternalApi,\n private readonly args: SendCommandInChunksTaskArgs<T, ErrorCodes>,\n ) {}\n\n async run(): Promise<CommandResult<T, ErrorCodes>> {\n const { data: fullPayload, commandFactory } = this.args;\n\n const dataBuffer = new ByteArrayBuilder(fullPayload.length)\n .addBufferToData(fullPayload)\n .build();\n\n for (\n let offset = 0;\n offset < dataBuffer.length;\n offset += APDU_MAX_PAYLOAD\n ) {\n const isLastChunk = offset + APDU_MAX_PAYLOAD >= dataBuffer.length;\n const result = await this.api.sendCommand(\n commandFactory({\n more: !isLastChunk,\n extend: offset > 0,\n chunkedData: dataBuffer.slice(offset, offset + APDU_MAX_PAYLOAD),\n }),\n );\n\n if (!isSuccessCommandResult(result)) {\n return result;\n }\n\n if (isLastChunk) {\n return CommandResultFactory({\n data: result.data,\n });\n }\n }\n\n throw new InvalidStatusWordError(\"No result after processing all chunks\");\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OACE,oBAAAA,EACA,oBAAAC,EAGA,wBAAAC,EAEA,0BAAAC,EACA,0BAAAC,MACK,kCAmBA,MAAMC,CAAsD,CACjE,YACUC,EACSC,EACjB,CAFQ,SAAAD,EACS,UAAAC,CAChB,CAEH,MAAM,KAA6C,CACjD,KAAM,CAAE,KAAMC,EAAa,eAAAC,CAAe,EAAI,KAAK,KAE7CC,EAAa,IAAIT,EAAiBO,EAAY,MAAM,EACvD,gBAAgBA,CAAW,EAC3B,MAAM,EAET,QACMG,EAAS,EACbA,EAASD,EAAW,OACpBC,GAAUX,EACV,CACA,MAAMY,EAAcD,EAASX,GAAoBU,EAAW,OACtDG,EAAS,MAAM,KAAK,IAAI,YAC5BJ,EAAe,CACb,KAAM,CAACG,EACP,OAAQD,EAAS,EACjB,YAAaD,EAAW,MAAMC,EAAQA,EAASX,CAAgB,CACjE,CAAC,CACH,EAEA,GAAI,CAACI,EAAuBS,CAAM,EAChC,OAAOA,EAGT,GAAID,EACF,OAAOV,EAAqB,CAC1B,KAAMW,EAAO,IACf,CAAC,CAEL,CAEA,MAAM,IAAIV,EAAuB,uCAAuC,CAC1E,CACF",
|
|
6
|
+
"names": ["APDU_MAX_PAYLOAD", "ByteArrayBuilder", "CommandResultFactory", "InvalidStatusWordError", "isSuccessCommandResult", "SendCommandInChunksTask", "api", "args", "fullPayload", "commandFactory", "dataBuffer", "offset", "isLastChunk", "result"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{APDU_MAX_PAYLOAD as t,CommandResultFactory as m,InvalidStatusWordError as C,isSuccessCommandResult as c}from"@ledgerhq/device-management-kit";import{SendCommandInChunksTask as l}from"./SendCommandInChunksTask";class u{constructor(n){this.args=n}name="dummy";getApdu(){throw new Error("not used in tests")}parseResponse(){throw new Error("not used in tests")}}const p=()=>({sendCommand:vi.fn()});describe("SendCommandInChunksTask",()=>{beforeEach(()=>{vi.resetAllMocks()}),it("sends a payload smaller than APDU_MAX_PAYLOAD in a single chunk with more=false, extend=false",async()=>{const e=p(),n=new Uint8Array([1,2,3]);e.sendCommand.mockResolvedValueOnce(m({data:{value:"ok"}}));const a=await new l(e,{data:n,commandFactory:s=>new u(s)}).run();expect(e.sendCommand).toHaveBeenCalledTimes(1);const o=e.sendCommand.mock.calls[0]?.[0];expect(o.args).toEqual({chunkedData:n,more:!1,extend:!1}),expect(c(a)).toBe(!0)}),it("splits a payload larger than APDU_MAX_PAYLOAD into ordered chunks with proper flags",async()=>{const e=p(),n=t*2+10,a=new Uint8Array(n).map((y,i)=>i&255);e.sendCommand.mockResolvedValueOnce(m({data:{value:"chunk1"}})).mockResolvedValueOnce(m({data:{value:"chunk2"}})).mockResolvedValueOnce(m({data:{value:"final"}}));const o=await new l(e,{data:a,commandFactory:y=>new u(y)}).run();expect(e.sendCommand).toHaveBeenCalledTimes(3);const s=e.sendCommand.mock.calls[0]?.[0];expect(s.args.chunkedData).toEqual(a.slice(0,t)),expect(s.args.more).toBe(!0),expect(s.args.extend).toBe(!1);const r=e.sendCommand.mock.calls[1]?.[0];expect(r.args.chunkedData).toEqual(a.slice(t,t*2)),expect(r.args.more).toBe(!0),expect(r.args.extend).toBe(!0);const d=e.sendCommand.mock.calls[2]?.[0];expect(d.args.chunkedData).toEqual(a.slice(t*2)),expect(d.args.more).toBe(!1),expect(d.args.extend).toBe(!0),expect(c(o)).toBe(!0),c(o)&&expect(o.data).toEqual({value:"final"})}),it("stops sending and returns the error result when a chunk fails",async()=>{const e=p(),n=new Uint8Array(t*3),a=new C("chunk failed");e.sendCommand.mockResolvedValueOnce(m({data:{value:"chunk1"}})).mockResolvedValueOnce(m({error:a}));const o=await new l(e,{data:n,commandFactory:s=>new u(s)}).run();expect(e.sendCommand).toHaveBeenCalledTimes(2),expect(o).toMatchObject({error:a})})});
|
|
2
|
+
//# sourceMappingURL=SendCommandInChunksTask.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/utils/SendCommandInChunksTask.test.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n APDU_MAX_PAYLOAD,\n CommandResultFactory,\n type InternalApi,\n InvalidStatusWordError,\n isSuccessCommandResult,\n} from \"@ledgerhq/device-management-kit\";\n\nimport {\n type ChunkableCommandArgs,\n SendCommandInChunksTask,\n} from \"./SendCommandInChunksTask\";\n\ntype DummyResponse = { value: string };\ntype DummyErrorCodes = \"4224\";\n\nclass DummyCommand {\n readonly name = \"dummy\";\n constructor(readonly args: ChunkableCommandArgs) {}\n getApdu() {\n throw new Error(\"not used in tests\");\n }\n parseResponse() {\n throw new Error(\"not used in tests\");\n }\n}\n\nconst makeApiMock = () =>\n ({\n sendCommand: vi.fn(),\n }) as unknown as InternalApi & {\n sendCommand: ReturnType<typeof vi.fn>;\n };\n\ndescribe(\"SendCommandInChunksTask\", () => {\n beforeEach(() => {\n vi.resetAllMocks();\n });\n\n it(\"sends a payload smaller than APDU_MAX_PAYLOAD in a single chunk with more=false, extend=false\", async () => {\n const api = makeApiMock();\n const payload = new Uint8Array([0x01, 0x02, 0x03]);\n api.sendCommand.mockResolvedValueOnce(\n CommandResultFactory<DummyResponse, DummyErrorCodes>({\n data: { value: \"ok\" },\n }),\n );\n\n const result = await new SendCommandInChunksTask<\n DummyResponse,\n DummyErrorCodes\n >(api, {\n data: payload,\n commandFactory: (args) => new DummyCommand(args) as never,\n }).run();\n\n expect(api.sendCommand).toHaveBeenCalledTimes(1);\n const sent = api.sendCommand.mock.calls[0]?.[0] as DummyCommand;\n expect(sent.args).toEqual({\n chunkedData: payload,\n more: false,\n extend: false,\n });\n expect(isSuccessCommandResult(result)).toBe(true);\n });\n\n it(\"splits a payload larger than APDU_MAX_PAYLOAD into ordered chunks with proper flags\", async () => {\n const api = makeApiMock();\n const totalLength = APDU_MAX_PAYLOAD * 2 + 10;\n const payload = new Uint8Array(totalLength).map((_, i) => i & 0xff);\n\n api.sendCommand\n .mockResolvedValueOnce(\n CommandResultFactory<DummyResponse, DummyErrorCodes>({\n data: { value: \"chunk1\" },\n }),\n )\n .mockResolvedValueOnce(\n CommandResultFactory<DummyResponse, DummyErrorCodes>({\n data: { value: \"chunk2\" },\n }),\n )\n .mockResolvedValueOnce(\n CommandResultFactory<DummyResponse, DummyErrorCodes>({\n data: { value: \"final\" },\n }),\n );\n\n const result = await new SendCommandInChunksTask<\n DummyResponse,\n DummyErrorCodes\n >(api, {\n data: payload,\n commandFactory: (args) => new DummyCommand(args) as never,\n }).run();\n\n expect(api.sendCommand).toHaveBeenCalledTimes(3);\n\n const call1 = api.sendCommand.mock.calls[0]?.[0] as DummyCommand;\n expect(call1.args.chunkedData).toEqual(payload.slice(0, APDU_MAX_PAYLOAD));\n expect(call1.args.more).toBe(true);\n expect(call1.args.extend).toBe(false);\n\n const call2 = api.sendCommand.mock.calls[1]?.[0] as DummyCommand;\n expect(call2.args.chunkedData).toEqual(\n payload.slice(APDU_MAX_PAYLOAD, APDU_MAX_PAYLOAD * 2),\n );\n expect(call2.args.more).toBe(true);\n expect(call2.args.extend).toBe(true);\n\n const call3 = api.sendCommand.mock.calls[2]?.[0] as DummyCommand;\n expect(call3.args.chunkedData).toEqual(payload.slice(APDU_MAX_PAYLOAD * 2));\n expect(call3.args.more).toBe(false);\n expect(call3.args.extend).toBe(true);\n\n expect(isSuccessCommandResult(result)).toBe(true);\n if (isSuccessCommandResult(result)) {\n expect(result.data).toEqual({ value: \"final\" });\n }\n });\n\n it(\"stops sending and returns the error result when a chunk fails\", async () => {\n const api = makeApiMock();\n const payload = new Uint8Array(APDU_MAX_PAYLOAD * 3);\n const error = new InvalidStatusWordError(\"chunk failed\");\n\n api.sendCommand\n .mockResolvedValueOnce(\n CommandResultFactory<DummyResponse, DummyErrorCodes>({\n data: { value: \"chunk1\" },\n }),\n )\n .mockResolvedValueOnce(\n CommandResultFactory<DummyResponse, DummyErrorCodes>({ error }),\n );\n\n const result = await new SendCommandInChunksTask<\n DummyResponse,\n DummyErrorCodes\n >(api, {\n data: payload,\n commandFactory: (args) => new DummyCommand(args) as never,\n }).run();\n\n expect(api.sendCommand).toHaveBeenCalledTimes(2);\n expect(result).toMatchObject({ error });\n });\n});\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["APDU_MAX_PAYLOAD", "CommandResultFactory", "InvalidStatusWordError", "isSuccessCommandResult", "SendCommandInChunksTask", "DummyCommand", "args", "makeApiMock", "api", "payload", "result", "sent", "totalLength", "_", "call1", "call2", "call3", "error"]
|
|
7
|
+
}
|
package/lib/types/index.d.ts
CHANGED
package/lib/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC"}
|