@ledgerhq/device-management-kit 0.0.0-rn-ble-pairing-removed-while-reconnecting-20250731133348 → 0.0.0-rn-ble-pairing-removed-while-reconnecting-20250807094338
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/src/api/apdu/utils/ByteArrayParser.js +1 -1
- package/lib/cjs/src/api/apdu/utils/ByteArrayParser.js.map +3 -3
- package/lib/cjs/src/api/command/os/__mocks__/GetOsVersionCommand.js +1 -1
- package/lib/cjs/src/api/command/os/__mocks__/GetOsVersionCommand.js.map +2 -2
- package/lib/cjs/src/api/device/DeviceModel.js +1 -1
- package/lib/cjs/src/api/device/DeviceModel.js.map +2 -2
- package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.js +1 -1
- package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.js.map +2 -2
- package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.test.js +1 -1
- package/lib/cjs/src/api/device-model/data/StaticDeviceModelDataSource.test.js.map +2 -2
- package/lib/cjs/src/api/device-model/model/DeviceModel.js +1 -1
- package/lib/cjs/src/api/device-model/model/DeviceModel.js.map +2 -2
- package/lib/cjs/src/api/transport/model/Errors.js +1 -1
- package/lib/cjs/src/api/transport/model/Errors.js.map +3 -3
- package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.js +1 -1
- package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.js.map +2 -2
- package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.test.js +1 -1
- package/lib/cjs/src/internal/device-session/service/DefaultApduSenderService.test.js.map +2 -2
- package/lib/esm/src/api/apdu/utils/ByteArrayParser.js +1 -1
- package/lib/esm/src/api/apdu/utils/ByteArrayParser.js.map +3 -3
- package/lib/esm/src/api/command/os/__mocks__/GetOsVersionCommand.js +1 -1
- package/lib/esm/src/api/command/os/__mocks__/GetOsVersionCommand.js.map +2 -2
- package/lib/esm/src/api/device/DeviceModel.js +1 -1
- package/lib/esm/src/api/device/DeviceModel.js.map +2 -2
- package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.js +1 -1
- package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.js.map +2 -2
- package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.test.js +1 -1
- package/lib/esm/src/api/device-model/data/StaticDeviceModelDataSource.test.js.map +2 -2
- package/lib/esm/src/api/device-model/model/DeviceModel.js +1 -1
- package/lib/esm/src/api/device-model/model/DeviceModel.js.map +2 -2
- package/lib/esm/src/api/transport/model/Errors.js +1 -1
- package/lib/esm/src/api/transport/model/Errors.js.map +3 -3
- package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.js +1 -1
- package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.js.map +2 -2
- package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.test.js +1 -1
- package/lib/esm/src/internal/device-session/service/DefaultApduSenderService.test.js.map +2 -2
- package/lib/types/src/api/apdu/utils/ByteArrayParser.d.ts +1 -0
- package/lib/types/src/api/apdu/utils/ByteArrayParser.d.ts.map +1 -1
- package/lib/types/src/api/command/os/__mocks__/GetOsVersionCommand.d.ts.map +1 -1
- package/lib/types/src/api/device/DeviceModel.d.ts +2 -1
- package/lib/types/src/api/device/DeviceModel.d.ts.map +1 -1
- package/lib/types/src/api/device-model/data/StaticDeviceModelDataSource.d.ts.map +1 -1
- package/lib/types/src/api/device-model/model/DeviceModel.d.ts.map +1 -1
- package/lib/types/src/api/transport/model/Errors.d.ts +5 -0
- package/lib/types/src/api/transport/model/Errors.d.ts.map +1 -1
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
- package/package.json +2 -2
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/internal/device-session/service/DefaultApduSenderService.ts"],
|
4
|
-
"sourcesContent": ["import { inject, injectable } from \"inversify\";\nimport { Either, Left, Maybe, Right } from \"purify-ts\";\nimport { v4 } from \"uuid\";\n\nimport {\n APDU_DATA_LENGTH_LENGTH,\n CHANNEL_LENGTH,\n HEAD_TAG,\n HEAD_TAG_LENGTH,\n INDEX_LENGTH,\n} from \"@api/device-session/data/FramerConst\";\nimport type {\n ApduSenderService,\n ApduSenderServiceConstructorArgs,\n} from \"@api/device-session/service/ApduSenderService\";\nimport { FramerUtils } from \"@api/device-session/utils/FramerUtils\";\nimport { LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport {\n FramerApduError,\n FramerOverflowError,\n} from \"@internal/device-session/model/Errors\";\nimport { Frame } from \"@internal/device-session/model/Frame\";\nimport { FrameHeader } from \"@internal/device-session/model/FrameHeader\";\nimport { loggerTypes } from \"@internal/logger-publisher/di/loggerTypes\";\nimport { DmkError } from \"@root/src/api/Error\";\n/**\n * Default implementation of ApduSenderService\n *\n * Split APDU in an array of frames readies to send to a TransportConnectedDevice\n */\n@injectable()\nexport class DefaultApduSenderService implements ApduSenderService {\n protected _frameSize: number;\n protected _channel: Maybe<Uint8Array>;\n protected _padding: boolean;\n private _logger: LoggerPublisherService;\n\n /**\n * Constructor\n *\n * @param frameSize\n * @param channel\n * @param padding\n * @param loggerServiceFactory\n */\n constructor(\n {\n frameSize,\n channel = Maybe.zero(),\n padding = false,\n }: ApduSenderServiceConstructorArgs,\n @inject(loggerTypes.LoggerPublisherServiceFactory)\n loggerServiceFactory: (tag: string) => LoggerPublisherService,\n ) {\n this._frameSize = frameSize;\n this._channel = channel;\n this._padding = padding;\n this._logger = loggerServiceFactory(\"DefaultApduSenderService\");\n }\n\n /**\n * Get frames from apdu\n *\n * @param apdu\n */\n public getFrames(apdu: Uint8Array): Frame[] {\n const frames: Frame[] = [];\n let count = 0;\n let frame = this.getFrameAtIndex(apdu, count);\n\n while (frame.isRight()) {\n frames.push(frame.extract());\n count += 1;\n frame = this.getFrameAtIndex(apdu, count).mapLeft((error) => {\n if (error instanceof FramerOverflowError) {\n this._logger.debug(\"Frames parsed\", { data: { count } });\n } else {\n this._logger.error(\"Error while parsing frame\", { data: { error } });\n }\n return error;\n });\n }\n return frames;\n }\n\n /**\n * Get apdu frame at index\n * Split every {{PACKET_SIZE - HEADER_SIZE}} bytes of apdu\n * @param apdu\n * @param frameIndex\n * @private\n */\n private getFrameAtIndex(\n apdu: Uint8Array,\n frameIndex: number,\n ): Either<DmkError, Frame> {\n const header = this.getFrameHeaderFrom(frameIndex, apdu.length);\n const frameOffset =\n frameIndex * this._frameSize - this.getHeaderSizeSumFrom(frameIndex);\n\n if (frameOffset
|
5
|
-
"mappings": "iOAAA,OAAS,UAAAA,EAAQ,cAAAC,MAAkB,YACnC,OAAiB,QAAAC,EAAM,SAAAC,EAAO,SAAAC,MAAa,YAC3C,OAAS,MAAAC,MAAU,OAEnB,OACE,2BAAAC,EACA,kBAAAC,EACA,YAAAC,EACA,mBAAAC,EACA,gBAAAC,MACK,uCAKP,OAAS,eAAAC,MAAmB,wCAE5B,OACE,mBAAAC,EACA,uBAAAC,MACK,wCACP,OAAS,SAAAC,MAAa,uCACtB,OAAS,eAAAC,MAAmB,6CAC5B,OAAS,eAAAC,MAAmB,4CAQrB,IAAMC,EAAN,KAA4D,CACvD,WACA,SACA,SACF,QAUR,YACE,CACE,UAAAC,EACA,QAAAC,EAAUC,EAAM,KAAK,EACrB,QAAAC,EAAU,EACZ,EAEAC,EACA,CACA,KAAK,WAAaJ,EAClB,KAAK,SAAWC,EAChB,KAAK,SAAWE,EAChB,KAAK,QAAUC,EAAqB,0BAA0B,CAChE,CAOO,UAAUC,EAA2B,CAC1C,MAAMC,EAAkB,CAAC,EACzB,IAAIC,EAAQ,EACRC,EAAQ,KAAK,gBAAgBH,EAAME,CAAK,EAE5C,KAAOC,EAAM,QAAQ,GACnBF,EAAO,KAAKE,EAAM,QAAQ,CAAC,EAC3BD,GAAS,EACTC,EAAQ,KAAK,gBAAgBH,EAAME,CAAK,EAAE,QAASE,IAC7CA,aAAiBC,EACnB,KAAK,QAAQ,MAAM,gBAAiB,CAAE,KAAM,CAAE,MAAAH,CAAM,CAAE,CAAC,EAEvD,KAAK,QAAQ,MAAM,4BAA6B,CAAE,KAAM,CAAE,MAAAE,CAAM,CAAE,CAAC,EAE9DA,EACR,EAEH,OAAOH,CACT,CASQ,gBACND,EACAM,EACyB,CACzB,MAAMC,EAAS,KAAK,mBAAmBD,EAAYN,EAAK,MAAM,EACxDQ,EACJF,EAAa,KAAK,WAAa,KAAK,qBAAqBA,CAAU,
|
4
|
+
"sourcesContent": ["import { inject, injectable } from \"inversify\";\nimport { Either, Left, Maybe, Right } from \"purify-ts\";\nimport { v4 } from \"uuid\";\n\nimport {\n APDU_DATA_LENGTH_LENGTH,\n CHANNEL_LENGTH,\n HEAD_TAG,\n HEAD_TAG_LENGTH,\n INDEX_LENGTH,\n} from \"@api/device-session/data/FramerConst\";\nimport type {\n ApduSenderService,\n ApduSenderServiceConstructorArgs,\n} from \"@api/device-session/service/ApduSenderService\";\nimport { FramerUtils } from \"@api/device-session/utils/FramerUtils\";\nimport { LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport {\n FramerApduError,\n FramerOverflowError,\n} from \"@internal/device-session/model/Errors\";\nimport { Frame } from \"@internal/device-session/model/Frame\";\nimport { FrameHeader } from \"@internal/device-session/model/FrameHeader\";\nimport { loggerTypes } from \"@internal/logger-publisher/di/loggerTypes\";\nimport { DmkError } from \"@root/src/api/Error\";\n/**\n * Default implementation of ApduSenderService\n *\n * Split APDU in an array of frames readies to send to a TransportConnectedDevice\n */\n@injectable()\nexport class DefaultApduSenderService implements ApduSenderService {\n protected _frameSize: number;\n protected _channel: Maybe<Uint8Array>;\n protected _padding: boolean;\n private _logger: LoggerPublisherService;\n\n /**\n * Constructor\n *\n * @param frameSize\n * @param channel\n * @param padding\n * @param loggerServiceFactory\n */\n constructor(\n {\n frameSize,\n channel = Maybe.zero(),\n padding = false,\n }: ApduSenderServiceConstructorArgs,\n @inject(loggerTypes.LoggerPublisherServiceFactory)\n loggerServiceFactory: (tag: string) => LoggerPublisherService,\n ) {\n this._frameSize = frameSize;\n this._channel = channel;\n this._padding = padding;\n this._logger = loggerServiceFactory(\"DefaultApduSenderService\");\n }\n\n /**\n * Get frames from apdu\n *\n * @param apdu\n */\n public getFrames(apdu: Uint8Array): Frame[] {\n const frames: Frame[] = [];\n let count = 0;\n let frame = this.getFrameAtIndex(apdu, count);\n\n while (frame.isRight()) {\n frames.push(frame.extract());\n count += 1;\n frame = this.getFrameAtIndex(apdu, count).mapLeft((error) => {\n if (error instanceof FramerOverflowError) {\n this._logger.debug(\"Frames parsed\", { data: { count } });\n } else {\n this._logger.error(\"Error while parsing frame\", { data: { error } });\n }\n return error;\n });\n }\n return frames;\n }\n\n /**\n * Get apdu frame at index\n * Split every {{PACKET_SIZE - HEADER_SIZE}} bytes of apdu\n * @param apdu\n * @param frameIndex\n * @private\n */\n private getFrameAtIndex(\n apdu: Uint8Array,\n frameIndex: number,\n ): Either<DmkError, Frame> {\n const header = this.getFrameHeaderFrom(frameIndex, apdu.length);\n const frameOffset =\n frameIndex === 0\n ? 0\n : frameIndex * this._frameSize - this.getHeaderSizeSumFrom(frameIndex);\n\n if (frameOffset >= apdu.length) {\n return Left(new FramerOverflowError());\n }\n if (header.getLength() > this._frameSize) {\n return Left(new FramerApduError());\n }\n const dataMaxSize = this._frameSize - header.getLength();\n const data = apdu.slice(\n frameOffset,\n frameOffset + this._frameSize - header.getLength(),\n );\n const frameData = this._padding\n ? new Uint8Array(dataMaxSize).fill(0)\n : new Uint8Array(data.length < dataMaxSize ? data.length : dataMaxSize);\n frameData.set(data, 0);\n const frame = new Frame({\n header,\n data: frameData,\n });\n return Right(frame);\n }\n\n /**\n * Get frame header\n * @param frameIndex\n * @param apduSize\n * @private\n */\n private getFrameHeaderFrom(\n frameIndex: number,\n apduSize: number,\n ): FrameHeader {\n const header = new FrameHeader({\n uuid: v4(),\n channel: this._channel.map((channel) =>\n FramerUtils.getLastBytesFrom(channel, CHANNEL_LENGTH),\n ),\n headTag: new Uint8Array([HEAD_TAG]),\n index: FramerUtils.numberToByteArray(frameIndex, INDEX_LENGTH),\n length: this.getFrameHeaderSizeFromIndex(frameIndex),\n dataSize: Maybe.zero(),\n });\n if (frameIndex === 0) {\n header.setDataSize(\n Maybe.of(\n FramerUtils.numberToByteArray(apduSize, APDU_DATA_LENGTH_LENGTH),\n ),\n );\n }\n return header;\n }\n\n /**\n * Get frame offset\n * First frame has more bytes of header\n * Padding append means a 0 bytes is added at the end of each frame\n * @private\n * @param frameIndex\n */\n private getHeaderSizeSumFrom(frameIndex: number): number {\n let sum = this.getFrameHeaderSizeFromIndex(0);\n let i = 1;\n while (i < frameIndex) {\n sum += this.getFrameHeaderSizeFromIndex(i);\n i += 1;\n }\n return sum;\n }\n\n /**\n * Get frame header size\n * @private\n * @param frameIndex\n */\n private getFrameHeaderSizeFromIndex(frameIndex: number): number {\n return (\n this._channel.caseOf({\n Just: () => CHANNEL_LENGTH,\n Nothing: () => 0,\n }) +\n INDEX_LENGTH +\n HEAD_TAG_LENGTH +\n (frameIndex === 0 ? APDU_DATA_LENGTH_LENGTH : 0)\n );\n }\n}\n"],
|
5
|
+
"mappings": "iOAAA,OAAS,UAAAA,EAAQ,cAAAC,MAAkB,YACnC,OAAiB,QAAAC,EAAM,SAAAC,EAAO,SAAAC,MAAa,YAC3C,OAAS,MAAAC,MAAU,OAEnB,OACE,2BAAAC,EACA,kBAAAC,EACA,YAAAC,EACA,mBAAAC,EACA,gBAAAC,MACK,uCAKP,OAAS,eAAAC,MAAmB,wCAE5B,OACE,mBAAAC,EACA,uBAAAC,MACK,wCACP,OAAS,SAAAC,MAAa,uCACtB,OAAS,eAAAC,MAAmB,6CAC5B,OAAS,eAAAC,MAAmB,4CAQrB,IAAMC,EAAN,KAA4D,CACvD,WACA,SACA,SACF,QAUR,YACE,CACE,UAAAC,EACA,QAAAC,EAAUC,EAAM,KAAK,EACrB,QAAAC,EAAU,EACZ,EAEAC,EACA,CACA,K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T,EAAS,IAAIU,EAAY,CAC7B,KAAMC,EAAG,EACT,QAAS,KAAK,SAAS,IAAKtB,GAC1BuB,EAAY,iBAAiBvB,EAASwB,CAAc,CACtD,EACA,QAAS,IAAI,WAAW,CAACC,CAAQ,CAAC,EAClC,MAAOF,EAAY,kBAAkBb,EAAYgB,CAAY,EAC7D,OAAQ,KAAK,4BAA4BhB,CAAU,EACnD,SAAUT,EAAM,KAAK,CACvB,CAAC,EACD,OAAIS,IAAe,GACjBC,EAAO,YACLV,EAAM,GACJsB,EAAY,kBAAkBH,EAAUO,CAAuB,CACjE,CACF,EAEKhB,CACT,CASQ,qBAAqBD,EAA4B,CACvD,IAAIkB,EAAM,KAAK,4BAA4B,CAAC,EACxCC,EAAI,EACR,KAAOA,EAAInB,GACTkB,GAAO,KAAK,4BAA4BC,CAAC,EACzCA,GAAK,EAEP,OAAOD,CACT,CAOQ,4BAA4BlB,EAA4B,CAC9D,OACE,KAAK,SAAS,OAAO,CACnB,KAAM,IAAMc,EACZ,QAAS,IAAM,CACjB,CAAC,EACDE,EACAI,GACCpB,IAAe,EAAIiB,EAA0B,EAElD,CACF,EA5Ja7B,EAANiC,EAAA,CADNC,EAAW,EAqBPC,EAAA,EAAAC,EAAOC,EAAY,6BAA6B,IApBxCrC",
|
6
6
|
"names": ["inject", "injectable", "Left", "Maybe", "Right", "v4", "APDU_DATA_LENGTH_LENGTH", "CHANNEL_LENGTH", "HEAD_TAG", "HEAD_TAG_LENGTH", "INDEX_LENGTH", "FramerUtils", "FramerApduError", "FramerOverflowError", "Frame", "FrameHeader", "loggerTypes", "DefaultApduSenderService", "frameSize", "channel", "Maybe", "padding", "loggerServiceFactory", "apdu", "frames", "count", "frame", "error", "FramerOverflowError", "frameIndex", "header", "frameOffset", "Left", "FramerApduError", "dataMaxSize", "data", "frameData", "Frame", "Right", "apduSize", "FrameHeader", "v4", "FramerUtils", "CHANNEL_LENGTH", "HEAD_TAG", "INDEX_LENGTH", "APDU_DATA_LENGTH_LENGTH", "sum", "i", "HEAD_TAG_LENGTH", "__decorateClass", "injectable", "__decorateParam", "inject", "loggerTypes"]
|
7
7
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{Maybe as x}from"purify-ts";import{Frame as t}from"../../device-session/model/Frame";import{FrameHeader as i}from"../../device-session/model/FrameHeader";import{DefaultLoggerPublisherService as w}from"../../logger-publisher/service/DefaultLoggerPublisherService";import{DefaultApduSenderService as d}from"./DefaultApduSenderService";vi.mock("uuid",()=>({v4:vi.fn().mockReturnValue("42")}));const o=new w([],"frame");describe("DefaultApduSenderService",()=>{describe("[USB] With padding and channel",()=>{it("should return 1 frame",()=>{const n=x.of(new Uint8Array([18,52])),a=new d({frameSize:64,padding:!0,channel:n},()=>o),e=new Uint8Array([224,1,0,0,0]),r=a.getFrames(e);expect(r).toEqual([new t({header:new i({uuid:"42",channel:x.of(new Uint8Array([18,52])),headTag:new Uint8Array([5]),dataSize:x.of(new Uint8Array([0,5])),index:new Uint8Array([0,0]),length:7}),data:new Uint8Array([224,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])})]),expect(r.map(c=>c.getRawData())).toEqual([new Uint8Array([18,52,5,0,0,0,5,224,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])])}),it("should return 2 frames",()=>{const n=x.of(new Uint8Array([18,52])),a=new d({frameSize:64,padding:!0,channel:n},()=>o),e=new Uint8Array([224,212,0,0,64,84,111,102,117,73,115,78,117,116,114,105,116,105,111,117,115,65,110,100,66,114,105,110,103,115,74,111,121,68,101,108,105,103,104,116,72,101,97,108,116,104,105,110,101,115,115,72,97,114,109,111,110,121,73,110,69,118,101,114,121,66,105,116,101]),r=a.getFrames(e);expect(r).toEqual([new t({header:new i({uuid:"42",channel:x.of(new Uint8Array([18,52])),headTag:new Uint8Array([5]),dataSize:x.of(new Uint8Array([0,69])),index:new Uint8Array([0,0]),length:7}),data:new Uint8Array([224,212,0,0,64,84,111,102,117,73,115,78,117,116,114,105,116,105,111,117,115,65,110,100,66,114,105,110,103,115,74,111,121,68,101,108,105,103,104,116,72,101,97,108,116,104,105,110,101,115,115,72,97,114,109,111,110])}),new t({header:new i({uuid:"42",channel:x.of(new Uint8Array([18,52])),headTag:new Uint8Array([5]),index:new Uint8Array([0,1]),length:5,dataSize:x.zero()}),data:new Uint8Array([121,73,110,69,118,101,114,121,66,105,116,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])})]),expect(r.map(c=>c.getRawData())).toEqual([new Uint8Array([18,52,5,0,0,0,69,224,212,0,0,64,84,111,102,117,73,115,78,117,116,114,105,116,105,111,117,115,65,110,100,66,114,105,110,103,115,74,111,121,68,101,108,105,103,104,116,72,101,97,108,116,104,105,110,101,115,115,72,97,114,109,111,110]),new Uint8Array([18,52,5,0,1,121,73,110,69,118,101,114,121,66,105,116,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])])})}),describe("[BLE] Without padding nor channel",()=>{it("should return 1 frame",()=>{const n=new d({frameSize:123},()=>o),a=new Uint8Array([224,1,0,0,0]),e=n.getFrames(a);expect(e).toEqual([new t({header:new i({uuid:"42",channel:x.zero(),headTag:new Uint8Array([5]),dataSize:x.of(new Uint8Array([0,5])),index:new Uint8Array([0,0]),length:5}),data:new Uint8Array([224,1,0,0,0])})]),expect(e.map(r=>r.getRawData())).toEqual([new Uint8Array([5,0,0,0,5,224,1,0,0,0])])}),it("should return 3 frames",()=>{const n=new d({frameSize:10},()=>o),a=new Uint8Array([1,5,79,76,79,83,0,7,46,50,46,52,45,50,0,144,0]),e=n.getFrames(a);expect(e).toEqual([new t({header:new i({uuid:"42",channel:x.zero(),headTag:new Uint8Array([5]),index:new Uint8Array([0,0]),dataSize:x.of(new Uint8Array([0,17])),length:5}),data:new Uint8Array([1,5,79,76,79])}),new t({header:new i({uuid:"42",channel:x.zero(),headTag:new Uint8Array([5]),dataSize:x.zero(),index:new Uint8Array([0,1]),length:3}),data:new Uint8Array([83,0,7,46,50,46,52])}),new t({header:new i({uuid:"42",channel:x.zero(),headTag:new Uint8Array([5]),dataSize:x.zero(),index:new Uint8Array([0,2]),length:3}),data:new Uint8Array([45,50,0,144,0])})]),expect(e.map(r=>r.getRawData())).toEqual([new Uint8Array([5,0,0,0,17,1,5,79,76,79]),new Uint8Array([5,0,1,83,0,7,46,50,46,52]),new Uint8Array([5,0,2,45,50,0,144,0])])})}),describe("Errors",()=>{it("should return a well formatted header with very big channel",()=>{const n=new d({frameSize:64,channel:x.of(new Uint8Array([1193012,214084,353364,30788,590916]))},()=>o),a=new Uint8Array([224,1,0,0,0]),e=n.getFrames(a);expect(e).toEqual([new t({header:new i({uuid:"42",channel:x.of(new Uint8Array([68,68])),headTag:new Uint8Array([5]),dataSize:x.of(new Uint8Array([0,5])),index:new Uint8Array([0,0]),length:7}),data:new Uint8Array([224,1,0,0,0])})]),expect(e.map(r=>r.getRawData())).toEqual([new Uint8Array([68,68,5,0,0,0,5,224,1,0,0,0])])}),it("should return empty if packet size smaller than header size",()=>{const n=new d({frameSize:Math.random()&4,channel:x.of(new Uint8Array([18,52]))},()=>o),a=new Uint8Array([224,1,0,0,0]),e=n.getFrames(a);expect(e.length).toEqual(0)}),it("should return empty if no apdu length",()=>{const n=new d({frameSize:Math.random()&255,padding:Math.random()>.5,channel:x.of(new Uint8Array([18,52]))},()=>o),a=new Uint8Array([]),e=n.getFrames(a);expect(e.length).toEqual(0)})})});
|
1
|
+
import{Maybe as x}from"purify-ts";import{Frame as t}from"../../device-session/model/Frame";import{FrameHeader as i}from"../../device-session/model/FrameHeader";import{DefaultLoggerPublisherService as w}from"../../logger-publisher/service/DefaultLoggerPublisherService";import{DefaultApduSenderService as d}from"./DefaultApduSenderService";vi.mock("uuid",()=>({v4:vi.fn().mockReturnValue("42")}));const o=new w([],"frame");describe("DefaultApduSenderService",()=>{describe("[USB] With padding and channel",()=>{it("should return 1 frame",()=>{const n=x.of(new Uint8Array([18,52])),a=new d({frameSize:64,padding:!0,channel:n},()=>o),e=new Uint8Array([224,1,0,0,0]),r=a.getFrames(e);expect(r).toEqual([new t({header:new i({uuid:"42",channel:x.of(new Uint8Array([18,52])),headTag:new Uint8Array([5]),dataSize:x.of(new Uint8Array([0,5])),index:new Uint8Array([0,0]),length:7}),data:new Uint8Array([224,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])})]),expect(r.map(c=>c.getRawData())).toEqual([new Uint8Array([18,52,5,0,0,0,5,224,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])])}),it("should return 2 frames",()=>{const n=x.of(new Uint8Array([18,52])),a=new d({frameSize:64,padding:!0,channel:n},()=>o),e=new Uint8Array([224,212,0,0,64,84,111,102,117,73,115,78,117,116,114,105,116,105,111,117,115,65,110,100,66,114,105,110,103,115,74,111,121,68,101,108,105,103,104,116,72,101,97,108,116,104,105,110,101,115,115,72,97,114,109,111,110,121,73,110,69,118,101,114,121,66,105,116,101]),r=a.getFrames(e);expect(r).toEqual([new t({header:new i({uuid:"42",channel:x.of(new Uint8Array([18,52])),headTag:new Uint8Array([5]),dataSize:x.of(new Uint8Array([0,69])),index:new Uint8Array([0,0]),length:7}),data:new Uint8Array([224,212,0,0,64,84,111,102,117,73,115,78,117,116,114,105,116,105,111,117,115,65,110,100,66,114,105,110,103,115,74,111,121,68,101,108,105,103,104,116,72,101,97,108,116,104,105,110,101,115,115,72,97,114,109,111,110])}),new t({header:new i({uuid:"42",channel:x.of(new Uint8Array([18,52])),headTag:new Uint8Array([5]),index:new Uint8Array([0,1]),length:5,dataSize:x.zero()}),data:new Uint8Array([121,73,110,69,118,101,114,121,66,105,116,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])})]),expect(r.map(c=>c.getRawData())).toEqual([new Uint8Array([18,52,5,0,0,0,69,224,212,0,0,64,84,111,102,117,73,115,78,117,116,114,105,116,105,111,117,115,65,110,100,66,114,105,110,103,115,74,111,121,68,101,108,105,103,104,116,72,101,97,108,116,104,105,110,101,115,115,72,97,114,109,111,110]),new Uint8Array([18,52,5,0,1,121,73,110,69,118,101,114,121,66,105,116,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])])}),it("should return exactly 0 frame",()=>{const n=x.of(new Uint8Array([18,52])),a=new d({frameSize:64,padding:!0,channel:n},()=>o),e=new Uint8Array([]),r=a.getFrames(e);expect(r).toEqual([])}),it("should return exactly 1 frame",()=>{const n=x.of(new Uint8Array([18,52])),a=new d({frameSize:64,padding:!0,channel:n},()=>o),e=new Uint8Array([224,6,0,19,52,71,50,73,103,115,81,104,104,88,83,105,77,113,56,107,85,80,121,78,110,70,99,99,49,69,105,65,103,119,53,78,120,109,45,104,105,111,121,86,103,106,57,119,72,86,101,77,4,9,146,192,254]),r=a.getFrames(e);expect(r).toEqual([new t({header:new i({uuid:"42",channel:x.of(new Uint8Array([18,52])),headTag:new Uint8Array([5]),dataSize:x.of(new Uint8Array([0,57])),index:new Uint8Array([0,0]),length:7}),data:new Uint8Array([224,6,0,19,52,71,50,73,103,115,81,104,104,88,83,105,77,113,56,107,85,80,121,78,110,70,99,99,49,69,105,65,103,119,53,78,120,109,45,104,105,111,121,86,103,106,57,119,72,86,101,77,4,9,146,192,254])})]),expect(r.map(c=>c.getRawData())).toEqual([new Uint8Array([18,52,5,0,0,0,57,224,6,0,19,52,71,50,73,103,115,81,104,104,88,83,105,77,113,56,107,85,80,121,78,110,70,99,99,49,69,105,65,103,119,53,78,120,109,45,104,105,111,121,86,103,106,57,119,72,86,101,77,4,9,146,192,254])])})}),describe("[BLE] Without padding nor channel",()=>{it("should return 1 frame",()=>{const n=new d({frameSize:123},()=>o),a=new Uint8Array([224,1,0,0,0]),e=n.getFrames(a);expect(e).toEqual([new t({header:new i({uuid:"42",channel:x.zero(),headTag:new Uint8Array([5]),dataSize:x.of(new Uint8Array([0,5])),index:new Uint8Array([0,0]),length:5}),data:new Uint8Array([224,1,0,0,0])})]),expect(e.map(r=>r.getRawData())).toEqual([new Uint8Array([5,0,0,0,5,224,1,0,0,0])])}),it("should return 3 frames",()=>{const n=new d({frameSize:10},()=>o),a=new Uint8Array([1,5,79,76,79,83,0,7,46,50,46,52,45,50,0,144,0]),e=n.getFrames(a);expect(e).toEqual([new t({header:new i({uuid:"42",channel:x.zero(),headTag:new Uint8Array([5]),index:new Uint8Array([0,0]),dataSize:x.of(new Uint8Array([0,17])),length:5}),data:new Uint8Array([1,5,79,76,79])}),new t({header:new i({uuid:"42",channel:x.zero(),headTag:new Uint8Array([5]),dataSize:x.zero(),index:new Uint8Array([0,1]),length:3}),data:new Uint8Array([83,0,7,46,50,46,52])}),new t({header:new i({uuid:"42",channel:x.zero(),headTag:new Uint8Array([5]),dataSize:x.zero(),index:new Uint8Array([0,2]),length:3}),data:new Uint8Array([45,50,0,144,0])})]),expect(e.map(r=>r.getRawData())).toEqual([new Uint8Array([5,0,0,0,17,1,5,79,76,79]),new Uint8Array([5,0,1,83,0,7,46,50,46,52]),new Uint8Array([5,0,2,45,50,0,144,0])])})}),describe("Errors",()=>{it("should return a well formatted header with very big channel",()=>{const n=new d({frameSize:64,channel:x.of(new Uint8Array([1193012,214084,353364,30788,590916]))},()=>o),a=new Uint8Array([224,1,0,0,0]),e=n.getFrames(a);expect(e).toEqual([new t({header:new i({uuid:"42",channel:x.of(new Uint8Array([68,68])),headTag:new Uint8Array([5]),dataSize:x.of(new Uint8Array([0,5])),index:new Uint8Array([0,0]),length:7}),data:new Uint8Array([224,1,0,0,0])})]),expect(e.map(r=>r.getRawData())).toEqual([new Uint8Array([68,68,5,0,0,0,5,224,1,0,0,0])])}),it("should return empty if packet size smaller than header size",()=>{const n=new d({frameSize:Math.random()&4,channel:x.of(new Uint8Array([18,52]))},()=>o),a=new Uint8Array([224,1,0,0,0]),e=n.getFrames(a);expect(e.length).toEqual(0)}),it("should return empty if no apdu length",()=>{const n=new d({frameSize:Math.random()&255,padding:Math.random()>.5,channel:x.of(new Uint8Array([18,52]))},()=>o),a=new Uint8Array([]),e=n.getFrames(a);expect(e.length).toEqual(0)})})});
|
2
2
|
//# sourceMappingURL=DefaultApduSenderService.test.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../src/internal/device-session/service/DefaultApduSenderService.test.ts"],
|
4
|
-
"sourcesContent": ["import { Maybe } from \"purify-ts\";\n\nimport { Frame } from \"@internal/device-session/model/Frame\";\nimport { FrameHeader } from \"@internal/device-session/model/FrameHeader\";\nimport { DefaultLoggerPublisherService } from \"@internal/logger-publisher/service/DefaultLoggerPublisherService\";\n\nimport { DefaultApduSenderService } from \"./DefaultApduSenderService\";\n\nvi.mock(\"uuid\", () => ({\n v4: vi.fn().mockReturnValue(\"42\"),\n}));\n\nconst loggerService = new DefaultLoggerPublisherService([], \"frame\");\n\ndescribe(\"DefaultApduSenderService\", () => {\n describe(\"[USB] With padding and channel\", () => {\n it(\"should return 1 frame\", () => {\n // given\n const channel = Maybe.of(new Uint8Array([0x12, 0x34]));\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 64,\n padding: true,\n channel,\n },\n () => loggerService,\n );\n // getVersion APDU\n const apdu = new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]);\n\n // when\n const frames = apduSenderService.getFrames(apdu);\n\n // then\n expect(frames).toEqual([\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.of(new Uint8Array([0x12, 0x34])),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.of(new Uint8Array([0, 0x05])),\n index: new Uint8Array([0, 0]),\n length: 7,\n }),\n data: new Uint8Array([\n 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00,\n ]),\n }),\n ]);\n expect(frames.map((fr) => fr.getRawData())).toEqual([\n new Uint8Array([\n 0x12, 0x34, 0x05, 0x00, 0x00, 0x00, 0x05, 0xe0, 0x01, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n ]),\n ]);\n });\n\n it(\"should return 2 frames\", () => {\n // given\n const channel = Maybe.of(new Uint8Array([0x12, 0x34]));\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 64,\n padding: true,\n channel,\n },\n () => loggerService,\n );\n const apdu = new Uint8Array([\n // editDeviceName APDU\n 0xe0, 0xd4, 0x00, 0x00, 0x40,\n // editDeviceNameData\n 0x54, 0x6f, 0x66, 0x75, 0x49, 0x73, 0x4e, 0x75, 0x74, 0x72, 0x69, 0x74,\n 0x69, 0x6f, 0x75, 0x73, 0x41, 0x6e, 0x64, 0x42, 0x72, 0x69, 0x6e, 0x67,\n 0x73, 0x4a, 0x6f, 0x79, 0x44, 0x65, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x48,\n 0x65, 0x61, 0x6c, 0x74, 0x68, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x48, 0x61,\n 0x72, 0x6d, 0x6f, 0x6e, 0x79, 0x49, 0x6e, 0x45, 0x76, 0x65, 0x72, 0x79,\n 0x42, 0x69, 0x74, 0x65,\n ]);\n\n // when\n const frames = apduSenderService.getFrames(apdu);\n\n // then\n expect(frames).toEqual([\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.of(new Uint8Array([0x12, 0x34])),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.of(new Uint8Array([0x00, 0x45])),\n index: new Uint8Array([0x00, 0x00]),\n length: 7,\n }),\n data: new Uint8Array([\n 0xe0, 0xd4, 0x00, 0x00, 0x40, 0x54, 0x6f, 0x66, 0x75, 0x49, 0x73,\n 0x4e, 0x75, 0x74, 0x72, 0x69, 0x74, 0x69, 0x6f, 0x75, 0x73, 0x41,\n 0x6e, 0x64, 0x42, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x4a, 0x6f, 0x79,\n 0x44, 0x65, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x48, 0x65, 0x61, 0x6c,\n 0x74, 0x68, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x48, 0x61, 0x72, 0x6d,\n 0x6f, 0x6e,\n ]),\n }),\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.of(new Uint8Array([0x12, 0x34])),\n headTag: new Uint8Array([0x05]),\n index: new Uint8Array([0x00, 0x01]),\n length: 5,\n dataSize: Maybe.zero(),\n }),\n data: new Uint8Array([\n 0x79, 0x49, 0x6e, 0x45, 0x76, 0x65, 0x72, 0x79, 0x42, 0x69, 0x74,\n 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n ]),\n }),\n ]);\n expect(frames.map((fr) => fr.getRawData())).toEqual([\n new Uint8Array([\n 0x12, 0x34, 0x05, 0x00, 0x00, 0x00, 0x45, 0xe0, 0xd4, 0x00, 0x00,\n 0x40, 0x54, 0x6f, 0x66, 0x75, 0x49, 0x73, 0x4e, 0x75, 0x74, 0x72,\n 0x69, 0x74, 0x69, 0x6f, 0x75, 0x73, 0x41, 0x6e, 0x64, 0x42, 0x72,\n 0x69, 0x6e, 0x67, 0x73, 0x4a, 0x6f, 0x79, 0x44, 0x65, 0x6c, 0x69,\n 0x67, 0x68, 0x74, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x69, 0x6e,\n 0x65, 0x73, 0x73, 0x48, 0x61, 0x72, 0x6d, 0x6f, 0x6e,\n ]),\n new Uint8Array([\n 0x12, 0x34, 0x05, 0x00, 0x01, 0x79, 0x49, 0x6e, 0x45, 0x76, 0x65,\n 0x72, 0x79, 0x42, 0x69, 0x74, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n ]),\n ]);\n });\n });\n\n describe(\"[BLE] Without padding nor channel\", () => {\n it(\"should return 1 frame\", () => {\n // given\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 123,\n },\n () => loggerService,\n );\n const command = new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]);\n\n // when\n const frames = apduSenderService.getFrames(command);\n\n // then\n expect(frames).toEqual([\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.zero(),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.of(new Uint8Array([0, 5])),\n index: new Uint8Array([0, 0]),\n length: 5,\n }),\n data: new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]),\n }),\n ]);\n expect(frames.map((fr) => fr.getRawData())).toEqual([\n new Uint8Array([\n 0x05, 0x00, 0x00, 0x00, 0x05, 0xe0, 0x01, 0x00, 0x00, 0x00,\n ]),\n ]);\n });\n\n it(\"should return 3 frames\", () => {\n // given\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 10,\n },\n () => loggerService,\n );\n const command = new Uint8Array([\n 0x01, 0x05, 0x4f, 0x4c, 0x4f, 0x53, 0x00, 0x07, 0x2e, 0x32, 0x2e, 0x34,\n 0x2d, 0x32, 0x00, 0x90, 0x00,\n ]);\n\n // when\n const frames = apduSenderService.getFrames(command);\n\n // then\n expect(frames).toEqual([\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.zero(),\n headTag: new Uint8Array([0x05]),\n index: new Uint8Array([0, 0]),\n dataSize: Maybe.of(new Uint8Array([0, 0x11])),\n length: 5,\n }),\n data: new Uint8Array([0x01, 0x05, 0x4f, 0x4c, 0x4f]),\n }),\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.zero(),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.zero(),\n index: new Uint8Array([0, 0x01]),\n length: 3,\n }),\n data: new Uint8Array([0x53, 0x00, 0x07, 0x2e, 0x32, 0x2e, 0x34]),\n }),\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.zero(),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.zero(),\n index: new Uint8Array([0, 0x02]),\n length: 3,\n }),\n data: new Uint8Array([0x2d, 0x32, 0x00, 0x90, 0x00]),\n }),\n ]);\n expect(frames.map((fr) => fr.getRawData())).toEqual([\n new Uint8Array([\n 0x05, 0x00, 0x00, 0x00, 0x11, 0x01, 0x05, 0x4f, 0x4c, 0x4f,\n ]),\n new Uint8Array([\n 0x05, 0x00, 0x01, 0x53, 0x00, 0x07, 0x2e, 0x32, 0x2e, 0x34,\n ]),\n new Uint8Array([0x05, 0x00, 0x02, 0x2d, 0x32, 0x00, 0x90, 0x00]),\n ]);\n });\n });\n\n describe(\"Errors\", () => {\n it(\"should return a well formatted header with very big channel\", () => {\n // given\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 64,\n channel: Maybe.of(\n new Uint8Array([0x123434, 0x34444, 0x56454, 0x7844, 0x90444]),\n ),\n },\n () => loggerService,\n );\n const command = new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]);\n\n // when\n const frames = apduSenderService.getFrames(command);\n\n // then\n expect(frames).toEqual([\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.of(new Uint8Array([0x44, 0x44])),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.of(new Uint8Array([0, 0x05])),\n index: new Uint8Array([0, 0]),\n length: 7,\n }),\n data: new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]),\n }),\n ]);\n expect(frames.map((fr) => fr.getRawData())).toEqual([\n new Uint8Array([\n 0x44, 0x44, 0x05, 0x00, 0x00, 0x00, 0x05, 0xe0, 0x01, 0x00, 0x00,\n 0x00,\n ]),\n ]);\n });\n it(\"should return empty if packet size smaller than header size\", () => {\n // given\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: Math.random() & 4,\n channel: Maybe.of(new Uint8Array([0x12, 0x34])),\n },\n () => loggerService,\n );\n const command = new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]);\n\n // when\n const frames = apduSenderService.getFrames(command);\n\n // then\n expect(frames.length).toEqual(0);\n });\n\n it(\"should return empty if no apdu length\", () => {\n // given\n const apduSenderService = new DefaultApduSenderService(\n {\n // random frameSize < 0xff\n frameSize: Math.random() & 0xff,\n // random padding boolean\n padding: Math.random() > 0.5,\n channel: Maybe.of(new Uint8Array([0x12, 0x34])),\n },\n () => loggerService,\n );\n const command = new Uint8Array([]);\n\n // when\n const frames = apduSenderService.getFrames(command);\n\n // then\n expect(frames.length).toEqual(0);\n });\n });\n});\n"],
|
5
|
-
"mappings": "AAAA,OAAS,SAAAA,MAAa,YAEtB,OAAS,SAAAC,MAAa,uCACtB,OAAS,eAAAC,MAAmB,6CAC5B,OAAS,iCAAAC,MAAqC,mEAE9C,OAAS,4BAAAC,MAAgC,6BAEzC,GAAG,KAAK,OAAQ,KAAO,CACrB,GAAI,GAAG,GAAG,EAAE,gBAAgB,IAAI,CAClC,EAAE,EAEF,MAAMC,EAAgB,IAAIF,EAA8B,CAAC,EAAG,OAAO,EAEnE,SAAS,2BAA4B,IAAM,CACzC,SAAS,iCAAkC,IAAM,CAC/C,GAAG,wBAAyB,IAAM,CAEhC,MAAMG,EAAUN,EAAM,GAAG,IAAI,WAAW,CAAC,GAAM,EAAI,CAAC,CAAC,EAC/CO,EAAoB,IAAIH,EAC5B,CACE,UAAW,GACX,QAAS,GACT,QAAAE,CACF,EACA,IAAMD,CACR,EAEMG,EAAO,IAAI,WAA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,IAAM,IAAM,IAAM,IAAM,IAAM,IAAM,IAAM,GAC5D,IAAM,IAAM,GAAM,IAAM,IAAM,IAAM,IAAM,IAAM,GAAM,IAAM,IAC5D,GAAM,IAAM,IAAM,IAAM,IAAM,IAAM,IAAM,GAAM,IAAM,GAAM,IAC5D,IAAM,IAAM,IAAM,IAAM,IAAM,IAAM,IAAM,GAAM,GAAM,IAAM,IAC5D,IAAM,GACR,CAAC,CACH,CAAC,EACD,IAAIC,EAAM,CACR,OAAQ,IAAIC,EAAY,CACtB,KAAM,KACN,QAASF,EAAM,GAAG,IAAI,WAAW,CAAC,GAAM,EAAI,CAAC,CAAC,EAC9C,QAAS,IAAI,WAAW,CAAC,CAAI,CAAC,EAC9B,MAAO,IAAI,WAAW,CAAC,EAAM,CAAI,CAAC,EAClC,OAAQ,EACR,SAAUA,EAAM,KAAK,CACvB,CAAC,EACD,KAAM,IAAI,WAAW,CACnB,IAAM,GAAM,IAAM,GAAM,IAAM,IAAM,IAAM,IAAM,GAAM,IAAM,IAC5D,IAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAC5D,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAC5D,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAC5D,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAC5D,EAAM,EAAM,EAAM,CACpB,CAAC,CACH,CAAC,CACH,CAAC,
|
4
|
+
"sourcesContent": ["import { Maybe } from \"purify-ts\";\n\nimport { Frame } from \"@internal/device-session/model/Frame\";\nimport { FrameHeader } from \"@internal/device-session/model/FrameHeader\";\nimport { DefaultLoggerPublisherService } from \"@internal/logger-publisher/service/DefaultLoggerPublisherService\";\n\nimport { DefaultApduSenderService } from \"./DefaultApduSenderService\";\n\nvi.mock(\"uuid\", () => ({\n v4: vi.fn().mockReturnValue(\"42\"),\n}));\n\nconst loggerService = new DefaultLoggerPublisherService([], \"frame\");\n\ndescribe(\"DefaultApduSenderService\", () => {\n describe(\"[USB] With padding and channel\", () => {\n it(\"should return 1 frame\", () => {\n // given\n const channel = Maybe.of(new Uint8Array([0x12, 0x34]));\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 64,\n padding: true,\n channel,\n },\n () => loggerService,\n );\n // getVersion APDU\n const apdu = new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]);\n\n // when\n const frames = apduSenderService.getFrames(apdu);\n\n // then\n expect(frames).toEqual([\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.of(new Uint8Array([0x12, 0x34])),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.of(new Uint8Array([0, 0x05])),\n index: new Uint8Array([0, 0]),\n length: 7,\n }),\n data: new Uint8Array([\n 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00,\n ]),\n }),\n ]);\n expect(frames.map((fr) => fr.getRawData())).toEqual([\n new Uint8Array([\n 0x12, 0x34, 0x05, 0x00, 0x00, 0x00, 0x05, 0xe0, 0x01, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n ]),\n ]);\n });\n\n it(\"should return 2 frames\", () => {\n // given\n const channel = Maybe.of(new Uint8Array([0x12, 0x34]));\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 64,\n padding: true,\n channel,\n },\n () => loggerService,\n );\n const apdu = new Uint8Array([\n // editDeviceName APDU\n 0xe0, 0xd4, 0x00, 0x00, 0x40,\n // editDeviceNameData\n 0x54, 0x6f, 0x66, 0x75, 0x49, 0x73, 0x4e, 0x75, 0x74, 0x72, 0x69, 0x74,\n 0x69, 0x6f, 0x75, 0x73, 0x41, 0x6e, 0x64, 0x42, 0x72, 0x69, 0x6e, 0x67,\n 0x73, 0x4a, 0x6f, 0x79, 0x44, 0x65, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x48,\n 0x65, 0x61, 0x6c, 0x74, 0x68, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x48, 0x61,\n 0x72, 0x6d, 0x6f, 0x6e, 0x79, 0x49, 0x6e, 0x45, 0x76, 0x65, 0x72, 0x79,\n 0x42, 0x69, 0x74, 0x65,\n ]);\n\n // when\n const frames = apduSenderService.getFrames(apdu);\n\n // then\n expect(frames).toEqual([\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.of(new Uint8Array([0x12, 0x34])),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.of(new Uint8Array([0x00, 0x45])),\n index: new Uint8Array([0x00, 0x00]),\n length: 7,\n }),\n data: new Uint8Array([\n 0xe0, 0xd4, 0x00, 0x00, 0x40, 0x54, 0x6f, 0x66, 0x75, 0x49, 0x73,\n 0x4e, 0x75, 0x74, 0x72, 0x69, 0x74, 0x69, 0x6f, 0x75, 0x73, 0x41,\n 0x6e, 0x64, 0x42, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x4a, 0x6f, 0x79,\n 0x44, 0x65, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x48, 0x65, 0x61, 0x6c,\n 0x74, 0x68, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x48, 0x61, 0x72, 0x6d,\n 0x6f, 0x6e,\n ]),\n }),\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.of(new Uint8Array([0x12, 0x34])),\n headTag: new Uint8Array([0x05]),\n index: new Uint8Array([0x00, 0x01]),\n length: 5,\n dataSize: Maybe.zero(),\n }),\n data: new Uint8Array([\n 0x79, 0x49, 0x6e, 0x45, 0x76, 0x65, 0x72, 0x79, 0x42, 0x69, 0x74,\n 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00,\n ]),\n }),\n ]);\n\n expect(frames.map((fr) => fr.getRawData())).toEqual([\n new Uint8Array([\n 0x12, 0x34, 0x05, 0x00, 0x00, 0x00, 0x45, 0xe0, 0xd4, 0x00, 0x00,\n 0x40, 0x54, 0x6f, 0x66, 0x75, 0x49, 0x73, 0x4e, 0x75, 0x74, 0x72,\n 0x69, 0x74, 0x69, 0x6f, 0x75, 0x73, 0x41, 0x6e, 0x64, 0x42, 0x72,\n 0x69, 0x6e, 0x67, 0x73, 0x4a, 0x6f, 0x79, 0x44, 0x65, 0x6c, 0x69,\n 0x67, 0x68, 0x74, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x69, 0x6e,\n 0x65, 0x73, 0x73, 0x48, 0x61, 0x72, 0x6d, 0x6f, 0x6e,\n ]),\n new Uint8Array([\n 0x12, 0x34, 0x05, 0x00, 0x01, 0x79, 0x49, 0x6e, 0x45, 0x76, 0x65,\n 0x72, 0x79, 0x42, 0x69, 0x74, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n ]),\n ]);\n });\n\n it(\"should return exactly 0 frame\", () => {\n // given\n const channel = Maybe.of(new Uint8Array([0x12, 0x34]));\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 64,\n padding: true,\n channel,\n },\n () => loggerService,\n );\n const apdu = new Uint8Array([]);\n\n // when\n const frames = apduSenderService.getFrames(apdu);\n expect(frames).toEqual([]);\n });\n\n it(\"should return exactly 1 frame\", () => {\n // given\n const channel = Maybe.of(new Uint8Array([0x12, 0x34]));\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 64,\n padding: true,\n channel,\n },\n () => loggerService,\n );\n const apdu = new Uint8Array([\n 0xe0, 0x06, 0x00, 0x13, 0x34, 0x47, 0x32, 0x49, 0x67, 0x73, 0x51, 0x68,\n 0x68, 0x58, 0x53, 0x69, 0x4d, 0x71, 0x38, 0x6b, 0x55, 0x50, 0x79, 0x4e,\n 0x6e, 0x46, 0x63, 0x63, 0x31, 0x45, 0x69, 0x41, 0x67, 0x77, 0x35, 0x4e,\n 0x78, 0x6d, 0x2d, 0x68, 0x69, 0x6f, 0x79, 0x56, 0x67, 0x6a, 0x39, 0x77,\n 0x48, 0x56, 0x65, 0x4d, 0x04, 0x09, 0x92, 0xc0, 0xfe,\n ]);\n\n // when\n const frames = apduSenderService.getFrames(apdu);\n\n // then\n expect(frames).toEqual([\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.of(new Uint8Array([0x12, 0x34])),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.of(new Uint8Array([0x00, 0x39])),\n index: new Uint8Array([0x00, 0x00]),\n length: 7,\n }),\n data: new Uint8Array([\n 0xe0, 0x06, 0x00, 0x13, 0x34, 0x47, 0x32, 0x49, 0x67, 0x73, 0x51,\n 0x68, 0x68, 0x58, 0x53, 0x69, 0x4d, 0x71, 0x38, 0x6b, 0x55, 0x50,\n 0x79, 0x4e, 0x6e, 0x46, 0x63, 0x63, 0x31, 0x45, 0x69, 0x41, 0x67,\n 0x77, 0x35, 0x4e, 0x78, 0x6d, 0x2d, 0x68, 0x69, 0x6f, 0x79, 0x56,\n 0x67, 0x6a, 0x39, 0x77, 0x48, 0x56, 0x65, 0x4d, 0x04, 0x09, 0x92,\n 0xc0, 0xfe,\n ]),\n }),\n ]);\n expect(frames.map((fr) => fr.getRawData())).toEqual([\n new Uint8Array([\n 0x12, 0x34, 0x05, 0x00, 0x00, 0x00, 0x39, 0xe0, 0x06, 0x00, 0x13,\n 0x34, 0x47, 0x32, 0x49, 0x67, 0x73, 0x51, 0x68, 0x68, 0x58, 0x53,\n 0x69, 0x4d, 0x71, 0x38, 0x6b, 0x55, 0x50, 0x79, 0x4e, 0x6e, 0x46,\n 0x63, 0x63, 0x31, 0x45, 0x69, 0x41, 0x67, 0x77, 0x35, 0x4e, 0x78,\n 0x6d, 0x2d, 0x68, 0x69, 0x6f, 0x79, 0x56, 0x67, 0x6a, 0x39, 0x77,\n 0x48, 0x56, 0x65, 0x4d, 0x04, 0x09, 0x92, 0xc0, 0xfe,\n ]),\n ]);\n });\n });\n\n describe(\"[BLE] Without padding nor channel\", () => {\n it(\"should return 1 frame\", () => {\n // given\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 123,\n },\n () => loggerService,\n );\n const command = new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]);\n\n // when\n const frames = apduSenderService.getFrames(command);\n\n // then\n expect(frames).toEqual([\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.zero(),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.of(new Uint8Array([0, 5])),\n index: new Uint8Array([0, 0]),\n length: 5,\n }),\n data: new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]),\n }),\n ]);\n expect(frames.map((fr) => fr.getRawData())).toEqual([\n new Uint8Array([\n 0x05, 0x00, 0x00, 0x00, 0x05, 0xe0, 0x01, 0x00, 0x00, 0x00,\n ]),\n ]);\n });\n\n it(\"should return 3 frames\", () => {\n // given\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 10,\n },\n () => loggerService,\n );\n const command = new Uint8Array([\n 0x01, 0x05, 0x4f, 0x4c, 0x4f, 0x53, 0x00, 0x07, 0x2e, 0x32, 0x2e, 0x34,\n 0x2d, 0x32, 0x00, 0x90, 0x00,\n ]);\n\n // when\n const frames = apduSenderService.getFrames(command);\n\n // then\n expect(frames).toEqual([\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.zero(),\n headTag: new Uint8Array([0x05]),\n index: new Uint8Array([0, 0]),\n dataSize: Maybe.of(new Uint8Array([0, 0x11])),\n length: 5,\n }),\n data: new Uint8Array([0x01, 0x05, 0x4f, 0x4c, 0x4f]),\n }),\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.zero(),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.zero(),\n index: new Uint8Array([0, 0x01]),\n length: 3,\n }),\n data: new Uint8Array([0x53, 0x00, 0x07, 0x2e, 0x32, 0x2e, 0x34]),\n }),\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.zero(),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.zero(),\n index: new Uint8Array([0, 0x02]),\n length: 3,\n }),\n data: new Uint8Array([0x2d, 0x32, 0x00, 0x90, 0x00]),\n }),\n ]);\n expect(frames.map((fr) => fr.getRawData())).toEqual([\n new Uint8Array([\n 0x05, 0x00, 0x00, 0x00, 0x11, 0x01, 0x05, 0x4f, 0x4c, 0x4f,\n ]),\n new Uint8Array([\n 0x05, 0x00, 0x01, 0x53, 0x00, 0x07, 0x2e, 0x32, 0x2e, 0x34,\n ]),\n new Uint8Array([0x05, 0x00, 0x02, 0x2d, 0x32, 0x00, 0x90, 0x00]),\n ]);\n });\n });\n\n describe(\"Errors\", () => {\n it(\"should return a well formatted header with very big channel\", () => {\n // given\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: 64,\n channel: Maybe.of(\n new Uint8Array([0x123434, 0x34444, 0x56454, 0x7844, 0x90444]),\n ),\n },\n () => loggerService,\n );\n const command = new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]);\n\n // when\n const frames = apduSenderService.getFrames(command);\n\n // then\n expect(frames).toEqual([\n new Frame({\n header: new FrameHeader({\n uuid: \"42\",\n channel: Maybe.of(new Uint8Array([0x44, 0x44])),\n headTag: new Uint8Array([0x05]),\n dataSize: Maybe.of(new Uint8Array([0, 0x05])),\n index: new Uint8Array([0, 0]),\n length: 7,\n }),\n data: new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]),\n }),\n ]);\n expect(frames.map((fr) => fr.getRawData())).toEqual([\n new Uint8Array([\n 0x44, 0x44, 0x05, 0x00, 0x00, 0x00, 0x05, 0xe0, 0x01, 0x00, 0x00,\n 0x00,\n ]),\n ]);\n });\n it(\"should return empty if packet size smaller than header size\", () => {\n // given\n const apduSenderService = new DefaultApduSenderService(\n {\n frameSize: Math.random() & 4,\n channel: Maybe.of(new Uint8Array([0x12, 0x34])),\n },\n () => loggerService,\n );\n const command = new Uint8Array([0xe0, 0x01, 0x00, 0x00, 0x00]);\n\n // when\n const frames = apduSenderService.getFrames(command);\n\n // then\n expect(frames.length).toEqual(0);\n });\n\n it(\"should return empty if no apdu length\", () => {\n // given\n const apduSenderService = new DefaultApduSenderService(\n {\n // random frameSize < 0xff\n frameSize: Math.random() & 0xff,\n // random padding boolean\n padding: Math.random() > 0.5,\n channel: Maybe.of(new Uint8Array([0x12, 0x34])),\n },\n () => loggerService,\n );\n const command = new Uint8Array([]);\n\n // when\n const frames = apduSenderService.getFrames(command);\n\n // then\n expect(frames.length).toEqual(0);\n });\n });\n});\n"],
|
5
|
+
"mappings": "AAAA,OAAS,SAAAA,MAAa,YAEtB,OAAS,SAAAC,MAAa,uCACtB,OAAS,eAAAC,MAAmB,6CAC5B,OAAS,iCAAAC,MAAqC,mEAE9C,OAAS,4BAAAC,MAAgC,6BAEzC,GAAG,KAAK,OAAQ,KAAO,CACrB,GAAI,GAAG,GAAG,EAAE,gBAAgB,IAAI,CAClC,EAAE,EAEF,MAAMC,EAAgB,IAAIF,EAA8B,CAAC,EAAG,OAAO,EAEnE,SAAS,2BAA4B,IAAM,CACzC,SAAS,iCAAkC,IAAM,CAC/C,GAAG,wBAAyB,IAAM,CAEhC,MAAMG,EAAUN,EAAM,GAAG,IAAI,WAAW,CAAC,GAAM,EAAI,CAAC,CAAC,EAC/CO,EAAoB,IAAIH,EAC5B,CACE,UAAW,GACX,QAAS,GACT,QAAAE,CACF,EACA,IAAMD,CACR,EAEMG,EAAO,IAAI,WAAW,CAAC,IAAM,EAAM,EAAM,EAAM,CAAI,CAAC,EAGpDC,EAASF,EAAkB,UAAUC,CAAI,EAG/C,OAAOC,CAAM,EAAE,QAAQ,CACrB,IAAIR,EAAM,CACR,OAAQ,IAAIC,EAAY,CACtB,KAAM,KACN,QAASF,EAAM,GAAG,IAAI,WAAW,CAAC,GAAM,EAAI,CAAC,CAAC,EAC9C,QAAS,IAAI,WAAW,CAAC,CAAI,CAAC,EAC9B,SAAUA,EAAM,GAAG,IAAI,WAAW,CAAC,EAAG,CAAI,CAAC,CAAC,EAC5C,MAAO,IAAI,WAAW,CAAC,EAAG,CAAC,CAAC,EAC5B,OAAQ,CACV,CAAC,EACD,KAAM,IAAI,WAAW,CACnB,IA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AAS,KAAK,OAAO,EAAI,GACzB,QAASJ,EAAM,GAAG,IAAI,WAAW,CAAC,GAAM,EAAI,CAAC,CAAC,CAChD,EACA,IAAMK,CACR,EACMM,EAAU,IAAI,WAAW,CAAC,CAAC,EAG3BF,EAASF,EAAkB,UAAUI,CAAO,EAGlD,OAAOF,EAAO,MAAM,EAAE,QAAQ,CAAC,CACjC,CAAC,CACH,CAAC,CACH,CAAC",
|
6
6
|
"names": ["Maybe", "Frame", "FrameHeader", "DefaultLoggerPublisherService", "DefaultApduSenderService", "loggerService", "channel", "apduSenderService", "apdu", "frames", "fr", "command"]
|
7
7
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ByteArrayParser.d.ts","sourceRoot":"","sources":["../../../../../../src/api/apdu/utils/ByteArrayParser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAE5E,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;
|
1
|
+
{"version":3,"file":"ByteArrayParser.d.ts","sourceRoot":"","sources":["../../../../../../src/api/apdu/utils/ByteArrayParser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAE5E,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC;CAC1B,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,qBAAa,eAAe;IAGd,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,OAAO,CAAC,KAAK,CAAa;gBAEG,MAAM,EAAE,UAAU;IAM/C;;;;OAIG;IACH,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAI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AAK,CAAC,EAAE,UAAU,GAAG,MAAM;IAe1C;;;OAGG;IACH,eAAe,IAAI,MAAM;IAIzB;;OAEG;IACH,UAAU;IAIV;;;OAGG;IACH,0BAA0B,IAAI,MAAM;IAQpC;;;;OAIG;IACH,OAAO,CAAC,UAAU;IAIlB;;;;;;OAMG;IACH,OAAO,CAAC,aAAa;CAiCtB"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"GetOsVersionCommand.d.ts","sourceRoot":"","sources":["../../../../../../../src/api/command/os/__mocks__/GetOsVersionCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,eAAO,MAAM,sCAAsC,GACjD,gBAAe,aAAqC,EACpD,QAAO,OAAO,CAAC,oBAAoB,CAAM,KACxC,
|
1
|
+
{"version":3,"file":"GetOsVersionCommand.d.ts","sourceRoot":"","sources":["../../../../../../../src/api/command/os/__mocks__/GetOsVersionCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,eAAO,MAAM,sCAAsC,GACjD,gBAAe,aAAqC,EACpD,QAAO,OAAO,CAAC,oBAAoB,CAAM,KACxC,oBAsJgB,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DeviceModel.d.ts","sourceRoot":"","sources":["../../../../../src/api/device/DeviceModel.ts"],"names":[],"mappings":"AAAA,oBAAY,aAAa;IACvB,MAAM,UAAU;IAChB,OAAO,WAAW;IAClB,MAAM,UAAU;IAChB,IAAI,SAAS;IACb,IAAI,SAAS;CACd;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,qBAAa,WAAW;IACtB,SAAgB,EAAE,EAAE,QAAQ,CAAC;IAC7B,SAAgB,KAAK,EAAE,aAAa,CAAC;IACrC,SAAgB,IAAI,EAAE,MAAM,CAAC;gBAEjB,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,eAAe;CAKjD;AAED,eAAO,MAAM,gBAAgB,QAAS,CAAC"}
|
1
|
+
{"version":3,"file":"DeviceModel.d.ts","sourceRoot":"","sources":["../../../../../src/api/device/DeviceModel.ts"],"names":[],"mappings":"AAAA,oBAAY,aAAa;IACvB,MAAM,UAAU;IAChB,OAAO,WAAW;IAClB,MAAM,UAAU;IAChB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,IAAI,SAAS;CACd;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,qBAAa,WAAW;IACtB,SAAgB,EAAE,EAAE,QAAQ,CAAC;IAC7B,SAAgB,KAAK,EAAE,aAAa,CAAC;IACrC,SAAgB,IAAI,EAAE,MAAM,CAAC;gBAEjB,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,eAAe;CAKjD;AAED,eAAO,MAAM,gBAAgB,QAAS,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"StaticDeviceModelDataSource.d.ts","sourceRoot":"","sources":["../../../../../../src/api/device-model/data/StaticDeviceModelDataSource.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAE3E;;GAEG;AACH,qBACa,2BAA4B,YAAW,qBAAqB;IACvE,OAAO,CAAC,MAAM,CAAC,gBAAgB,
|
1
|
+
{"version":3,"file":"StaticDeviceModelDataSource.d.ts","sourceRoot":"","sources":["../../../../../../src/api/device-model/data/StaticDeviceModelDataSource.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAE3E;;GAEG;AACH,qBACa,2BAA4B,YAAW,qBAAqB;IACvE,OAAO,CAAC,MAAM,CAAC,gBAAgB,CA+F7B;IAEF,kBAAkB,IAAI,oBAAoB,EAAE;IAI5C,cAAc,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,aAAa,CAAA;KAAE,GAAG,oBAAoB;IAInE;;OAEG;IACH,kBAAkB,CAChB,MAAM,EAAE,OAAO,CAAC,oBAAoB,CAAC,GACpC,oBAAoB,EAAE;IAQzB,yBAAyB,IAAI,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC;IA2B3D,oBAAoB,IAAI,MAAM,EAAE;CAQjC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DeviceModel.d.ts","sourceRoot":"","sources":["../../../../../../src/api/device-model/model/DeviceModel.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD;;GAEG;AACH,qBAAa,oBAAoB;IAC/B,EAAE,EAAE,aAAa,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,aAAa,CAAC,EAAE;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;KACpB,EAAE,CAAC;gBAEQ,KAAK,EAAE;QACjB,EAAE,EAAE,aAAa,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;QACrB,sBAAsB,EAAE,MAAM,CAAC;QAC/B,OAAO,EAAE,OAAO,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,MAAM,EAAE,CAAC;QAEhB,aAAa,CAAC,EAAE;YACd,WAAW,EAAE,MAAM,CAAC;YACpB,SAAS,EAAE,MAAM,CAAC;YAClB,YAAY,EAAE,MAAM,CAAC;YACrB,UAAU,EAAE,MAAM,CAAC;SACpB,EAAE,CAAC;KACL;IAYD,YAAY,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM;
|
1
|
+
{"version":3,"file":"DeviceModel.d.ts","sourceRoot":"","sources":["../../../../../../src/api/device-model/model/DeviceModel.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD;;GAEG;AACH,qBAAa,oBAAoB;IAC/B,EAAE,EAAE,aAAa,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,aAAa,CAAC,EAAE;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;KACpB,EAAE,CAAC;gBAEQ,KAAK,EAAE;QACjB,EAAE,EAAE,aAAa,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;QACrB,sBAAsB,EAAE,MAAM,CAAC;QAC/B,OAAO,EAAE,OAAO,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,MAAM,EAAE,CAAC;QAEhB,aAAa,CAAC,EAAE;YACd,WAAW,EAAE,MAAM,CAAC;YACpB,SAAS,EAAE,MAAM,CAAC;YAClB,YAAY,EAAE,MAAM,CAAC;YACrB,UAAU,EAAE,MAAM,CAAC;SACpB,EAAE,CAAC;KACL;IAYD,YAAY,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM;CAe9C"}
|
@@ -44,6 +44,11 @@ export declare class SendApduTimeoutError extends GeneralDmkError {
|
|
44
44
|
readonly _tag = "SendApduTimeoutError";
|
45
45
|
constructor(err?: unknown | undefined);
|
46
46
|
}
|
47
|
+
export declare class SendApduEmptyResponseError extends GeneralDmkError {
|
48
|
+
readonly err?: unknown | undefined;
|
49
|
+
readonly _tag = "SendApduEmptyResponseError";
|
50
|
+
constructor(err?: unknown | undefined);
|
51
|
+
}
|
47
52
|
export declare class DisconnectError extends GeneralDmkError {
|
48
53
|
readonly err?: unknown | undefined;
|
49
54
|
readonly _tag = "DisconnectError";
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Errors.d.ts","sourceRoot":"","sources":["../../../../../../src/api/transport/model/Errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,E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