@ledgerhq/device-management-kit 1.8.0 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/package.json +1 -1
- package/lib/cjs/src/api/DeviceManagementKitBuilder.test.js +1 -1
- package/lib/cjs/src/api/DeviceManagementKitBuilder.test.js.map +2 -2
- package/lib/cjs/src/api/command/os/GetOsVersionCommand.js +1 -1
- package/lib/cjs/src/api/command/os/GetOsVersionCommand.js.map +3 -3
- package/lib/cjs/src/api/command/os/GetOsVersionCommand.test.js +1 -1
- package/lib/cjs/src/api/command/os/GetOsVersionCommand.test.js.map +3 -3
- package/lib/cjs/src/api/command/os/SecureElementFlagsParser.js +1 -1
- package/lib/cjs/src/api/command/os/SecureElementFlagsParser.js.map +3 -3
- package/lib/cjs/src/api/command/os/SecureElementFlagsParser.test.js +1 -1
- package/lib/cjs/src/api/command/os/SecureElementFlagsParser.test.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 +3 -3
- package/lib/cjs/src/api/device/SecureElementFlags.js +1 -1
- package/lib/cjs/src/api/device/SecureElementFlags.js.map +3 -3
- package/lib/cjs/src/api/index.js +1 -1
- package/lib/cjs/src/api/index.js.map +3 -3
- package/lib/cjs/src/api/utils/ApplicationChecker.js +1 -1
- package/lib/cjs/src/api/utils/ApplicationChecker.js.map +3 -3
- package/lib/cjs/src/api/utils/ApplicationChecker.test.js +1 -1
- package/lib/cjs/src/api/utils/ApplicationChecker.test.js.map +2 -2
- package/lib/cjs/src/di.test.js +2 -0
- package/lib/cjs/src/di.test.js.map +7 -0
- package/lib/cjs/src/internal/manager-api/data/HttpManagerApiDataSource.js +1 -1
- package/lib/cjs/src/internal/manager-api/data/HttpManagerApiDataSource.js.map +3 -3
- package/lib/cjs/src/internal/manager-api/data/HttpManagerApiDataSource.test.js +1 -1
- package/lib/cjs/src/internal/manager-api/data/HttpManagerApiDataSource.test.js.map +3 -3
- package/lib/cjs/src/internal/manager-api/model/Const.js +1 -1
- package/lib/cjs/src/internal/manager-api/model/Const.js.map +2 -2
- package/lib/esm/package.json +1 -1
- package/lib/esm/src/api/DeviceManagementKitBuilder.test.js +1 -1
- package/lib/esm/src/api/DeviceManagementKitBuilder.test.js.map +2 -2
- package/lib/esm/src/api/command/os/GetOsVersionCommand.js +1 -1
- package/lib/esm/src/api/command/os/GetOsVersionCommand.js.map +3 -3
- package/lib/esm/src/api/command/os/GetOsVersionCommand.test.js +1 -1
- package/lib/esm/src/api/command/os/GetOsVersionCommand.test.js.map +3 -3
- package/lib/esm/src/api/command/os/SecureElementFlagsParser.js +1 -1
- package/lib/esm/src/api/command/os/SecureElementFlagsParser.js.map +3 -3
- package/lib/esm/src/api/command/os/SecureElementFlagsParser.test.js +1 -1
- package/lib/esm/src/api/command/os/SecureElementFlagsParser.test.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 +3 -3
- package/lib/esm/src/api/device/SecureElementFlags.js +1 -0
- package/lib/esm/src/api/device/SecureElementFlags.js.map +4 -4
- package/lib/esm/src/api/index.js +1 -1
- package/lib/esm/src/api/index.js.map +3 -3
- package/lib/esm/src/api/utils/ApplicationChecker.js +1 -1
- package/lib/esm/src/api/utils/ApplicationChecker.js.map +3 -3
- package/lib/esm/src/api/utils/ApplicationChecker.test.js +1 -1
- package/lib/esm/src/api/utils/ApplicationChecker.test.js.map +2 -2
- package/lib/esm/src/di.test.js +2 -0
- package/lib/esm/src/di.test.js.map +7 -0
- package/lib/esm/src/internal/manager-api/data/HttpManagerApiDataSource.js +1 -1
- package/lib/esm/src/internal/manager-api/data/HttpManagerApiDataSource.js.map +3 -3
- package/lib/esm/src/internal/manager-api/data/HttpManagerApiDataSource.test.js +1 -1
- package/lib/esm/src/internal/manager-api/data/HttpManagerApiDataSource.test.js.map +3 -3
- package/lib/esm/src/internal/manager-api/model/Const.js +1 -1
- package/lib/esm/src/internal/manager-api/model/Const.js.map +2 -2
- package/lib/types/src/api/command/os/GetOsVersionCommand.d.ts +2 -2
- package/lib/types/src/api/command/os/GetOsVersionCommand.d.ts.map +1 -1
- package/lib/types/src/api/command/os/SecureElementFlagsParser.d.ts +0 -3
- package/lib/types/src/api/command/os/SecureElementFlagsParser.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/SecureElementFlags.d.ts +78 -3
- package/lib/types/src/api/device/SecureElementFlags.d.ts.map +1 -1
- package/lib/types/src/api/index.d.ts +2 -1
- package/lib/types/src/api/index.d.ts.map +1 -1
- package/lib/types/src/api/utils/ApplicationChecker.d.ts +17 -0
- package/lib/types/src/api/utils/ApplicationChecker.d.ts.map +1 -1
- package/lib/types/src/di.test.d.ts +2 -0
- package/lib/types/src/di.test.d.ts.map +1 -0
- package/lib/types/src/internal/manager-api/data/HttpManagerApiDataSource.d.ts.map +1 -1
- package/lib/types/src/internal/manager-api/model/Const.d.ts +1 -1
- package/lib/types/src/internal/manager-api/model/Const.d.ts.map +1 -1
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/api/command/os/SecureElementFlagsParser.test.ts"],
|
|
4
|
-
"sourcesContent": ["import { describe, expect, it } from \"vitest\";\n\nimport {
|
|
5
|
-
"mappings": "AAAA,OAAS,YAAAA,EAAU,UAAAC,EAAQ,MAAAC,MAAU,
|
|
6
|
-
"names": ["describe", "expect", "it", "
|
|
4
|
+
"sourcesContent": ["import { describe, expect, it } from \"vitest\";\n\nimport {\n type DeviceGeneralState,\n OnboardingState,\n SeedWordCount,\n} from \"@api/device/SecureElementFlags\";\n\nimport { SecureElementFlagsParser } from \"./SecureElementFlagsParser\";\n\ndescribe(\"SecureElementFlagsParser\", () => {\n it(\"should default missing secure element flag bytes to zero\", () => {\n const parser = new SecureElementFlagsParser(new Uint8Array([0xe0]));\n\n expect(parser.generalDeviceState().isPinValidated).toBe(true);\n expect(parser.endorsementInformation()).toEqual({\n hasEndorsementCertificateInSlot1: false,\n hasEndorsementCertificateInSlot2: false,\n });\n expect(parser.wordsInformation()).toEqual({\n numberOfWords: SeedWordCount.TwentyFour,\n currentWordIndex: 0,\n });\n expect(parser.onboardingStatus()).toEqual({\n onboardingState: OnboardingState.WelcomeScreen1,\n });\n });\n\n it(\"should correctly parse the general device state\", () => {\n const seFlags = new Uint8Array([0b10101010, 0x00, 0x00, 0x00]);\n const parser = new SecureElementFlagsParser(seFlags);\n const expectedState: DeviceGeneralState = {\n isPinValidated: true,\n hasMcuSerialNumber: false,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: true,\n isOnboarded: false,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n };\n expect(parser.generalDeviceState()).toEqual(expectedState);\n });\n\n it.each([\n [0x00, false, false],\n [0x01, true, false],\n [0x02, false, true],\n [0x03, true, true],\n ])(\n \"should parse endorsement information value %#\",\n (value, hasSlot1, hasSlot2) => {\n const parser = new SecureElementFlagsParser(\n new Uint8Array([0x00, value, 0x00, 0x00]),\n );\n\n expect(parser.endorsementInformation()).toEqual({\n hasEndorsementCertificateInSlot1: hasSlot1,\n hasEndorsementCertificateInSlot2: hasSlot2,\n });\n },\n );\n\n it.each([\n [0b00000000, SeedWordCount.TwentyFour, 0],\n [0b00100101, SeedWordCount.Eighteen, 5],\n [0b01010001, SeedWordCount.Twelve, 17],\n [0b01111111, undefined, 31],\n ])(\n \"should parse words information value %#\",\n (value, numberOfWords, currentWordIndex) => {\n const parser = new SecureElementFlagsParser(\n new Uint8Array([0x00, 0x00, value, 0x00]),\n );\n\n expect(parser.wordsInformation()).toEqual({\n numberOfWords,\n currentWordIndex,\n });\n },\n );\n\n it(\"should ignore the reserved most-significant bit in words information\", () => {\n const parser = new SecureElementFlagsParser(\n new Uint8Array([0x00, 0x00, 0b10100101, 0x00]),\n );\n\n expect(parser.wordsInformation()).toEqual({\n numberOfWords: SeedWordCount.Eighteen,\n currentWordIndex: 5,\n });\n });\n\n it(\"should expose numeric seed word counts so they survive serialization\", () => {\n const parser = new SecureElementFlagsParser(\n new Uint8Array([0x00, 0x00, 0x00, 0x00]),\n );\n\n const words = parser.wordsInformation();\n\n expect(words.numberOfWords).toBe(SeedWordCount.TwentyFour);\n expect(JSON.parse(JSON.stringify(words))).toEqual({\n numberOfWords: SeedWordCount.TwentyFour,\n currentWordIndex: 0,\n });\n });\n\n it(\"should keep SeedWordCount as 12 | 18 | 24, not an open numeric enum\", () => {\n const valid: SeedWordCount = SeedWordCount.Twelve;\n expect(valid).toBe(12);\n\n // @ts-expect-error arbitrary numbers are not valid seed word counts\n const invalid: SeedWordCount = 15;\n expect(typeof invalid).toBe(\"number\");\n });\n\n describe(\"onboardingStatus\", () => {\n it.each([\n [0x00, OnboardingState.WelcomeScreen1],\n [0x01, OnboardingState.WelcomeScreen2],\n [0x02, OnboardingState.WelcomeScreen3],\n [0x03, OnboardingState.WelcomeScreen4],\n [0x04, OnboardingState.WelcomeScreenReminder],\n [0x05, OnboardingState.SetupChoice],\n [0x06, OnboardingState.Pin],\n [0x07, OnboardingState.NewDevice],\n [0x08, OnboardingState.ConfirmNewDevice],\n [0x09, OnboardingState.RestoreRecoveryPhrase],\n [0x0a, OnboardingState.SafetyWarning],\n [0x0b, OnboardingState.DeviceIsReady],\n [0x0c, OnboardingState.ChooseName],\n [0x0d, OnboardingState.RestoreRecoverBackup],\n [0x0e, OnboardingState.SetupRestoreChoice],\n [0x0f, OnboardingState.OnboardingStatusCheck],\n [0x10, OnboardingState.RestoreWithRk],\n [0x11, OnboardingState.Unknown],\n [0x43, OnboardingState.Unknown],\n [0xff, OnboardingState.Unknown],\n ] as const)(\"should parse byte 0x%s as %s\", (value, onboardingState) => {\n const parser = new SecureElementFlagsParser(\n new Uint8Array([0x00, 0x00, 0x00, value]),\n );\n\n expect(parser.onboardingStatus()).toEqual({ onboardingState });\n });\n\n it(\"should always expose a defined onboarding state so it survives serialization\", () => {\n const parser = new SecureElementFlagsParser(\n new Uint8Array([0x00, 0x00, 0x00, 0x11]),\n );\n\n const status = parser.onboardingStatus();\n\n expect(status.onboardingState).toBe(OnboardingState.Unknown);\n expect(JSON.parse(JSON.stringify(status))).toEqual({\n onboardingState: OnboardingState.Unknown,\n });\n });\n\n it(\"should map every documented GET VERSION byte to a distinct OnboardingState\", () => {\n const documentedBytes = Array.from({ length: 0x11 }, (_, index) => index);\n const parsedStates = documentedBytes.map(\n (value) =>\n new SecureElementFlagsParser(\n new Uint8Array([0x00, 0x00, 0x00, value]),\n ).onboardingStatus().onboardingState,\n );\n\n expect(parsedStates).toEqual(\n Object.values(OnboardingState).filter(\n (state) => state !== OnboardingState.Unknown,\n ),\n );\n });\n });\n\n it(\"should correctly check the nth bit in a byte\", () => {\n const seFlags = new Uint8Array([0x00, 0x00, 0x00, 0x00]);\n const parser = new SecureElementFlagsParser(seFlags);\n const byte = 0b10101010;\n expect(parser._checkNthBitInByte(byte, 1)).toBe(true);\n expect(parser._checkNthBitInByte(byte, 2)).toBe(false);\n expect(parser._checkNthBitInByte(byte, 3)).toBe(true);\n expect(parser._checkNthBitInByte(byte, 4)).toBe(false);\n expect(parser._checkNthBitInByte(byte, 5)).toBe(true);\n expect(parser._checkNthBitInByte(byte, 6)).toBe(false);\n expect(parser._checkNthBitInByte(byte, 7)).toBe(true);\n expect(parser._checkNthBitInByte(byte, 8)).toBe(false);\n });\n});\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,YAAAA,EAAU,UAAAC,EAAQ,MAAAC,MAAU,SAErC,OAEE,mBAAAC,EACA,iBAAAC,MACK,iCAEP,OAAS,4BAAAC,MAAgC,6BAEzCL,EAAS,2BA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AiB,EAAE,eACzB,EAEAR,EAAOiB,CAAY,EAAE,QACnB,OAAO,OAAOf,CAAe,EAAE,OAC5BkB,GAAUA,IAAUlB,EAAgB,OACvC,CACF,CACF,CAAC,CACH,CAAC,EAEDD,EAAG,+CAAgD,IAAM,CACvD,MAAMK,EAAU,IAAI,WAAW,CAAC,EAAM,EAAM,EAAM,CAAI,CAAC,EACjDD,EAAS,IAAID,EAAyBE,CAAO,EAC7Ce,EAAO,IACbrB,EAAOK,EAAO,mBAAmBgB,EAAM,CAAC,CAAC,EAAE,KAAK,EAAI,EACpDrB,EAAOK,EAAO,mBAAmBgB,EAAM,CAAC,CAAC,EAAE,KAAK,EAAK,EACrDrB,EAAOK,EAAO,mBAAmBgB,EAAM,CAAC,CAAC,EAAE,KAAK,EAAI,EACpDrB,EAAOK,EAAO,mBAAmBgB,EAAM,CAAC,CAAC,EAAE,KAAK,EAAK,EACrDrB,EAAOK,EAAO,mBAAmBgB,EAAM,CAAC,CAAC,EAAE,KAAK,EAAI,EACpDrB,EAAOK,EAAO,mBAAmBgB,EAAM,CAAC,CAAC,EAAE,KAAK,EAAK,EACrDrB,EAAOK,EAAO,mBAAmBgB,EAAM,CAAC,CAAC,EAAE,KAAK,EAAI,EACpDrB,EAAOK,EAAO,mBAAmBgB,EAAM,CAAC,CAAC,EAAE,KAAK,EAAK,CACvD,CAAC,CACH,CAAC",
|
|
6
|
+
"names": ["describe", "expect", "it", "OnboardingState", "SeedWordCount", "SecureElementFlagsParser", "parser", "seFlags", "expectedState", "value", "hasSlot1", "hasSlot2", "numberOfWords", "currentWordIndex", "words", "valid", "onboardingState", "status", "parsedStates", "_", "index", "state", "byte"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{DeviceModelId as e}from"../../../device/DeviceModel";const
|
|
1
|
+
import{DeviceModelId as e}from"../../../device/DeviceModel";import{OnboardingState as r,SeedWordCount as t}from"../../../device/SecureElementFlags";const i=(o=e.NANO_SP,n={})=>({[e.NANO_SP]:{isBootloader:!1,isOsu:!1,targetId:856686596,seTargetId:856686596,seVersion:"1.1.1",seFlags:new Uint8Array([230,0,0,0]),mcuTargetId:void 0,mcuSephVersion:"4.03",mcuBootloaderVersion:"3.12",hwVersion:"00",langId:0,recoverState:void 0,secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!1,isOnboarded:!0,isMcuCodeSigned:!0,isInRecoveryMode:!1,hasEndorsementCertificateInSlot1:!1,hasEndorsementCertificateInSlot2:!1,numberOfWords:t.TwentyFour,currentWordIndex:0,onboardingState:r.WelcomeScreen1},...n},[e.NANO_S]:{isBootloader:!1,isOsu:!1,targetId:858783748,seTargetId:858783748,seVersion:"1.1.1",seFlags:new Uint8Array([230,0,0,0]),mcuTargetId:void 0,mcuSephVersion:"6.4.0",mcuBootloaderVersion:"5.4.0",hwVersion:"00",langId:0,recoverState:void 0,secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!1,isOnboarded:!0,isMcuCodeSigned:!0,isInRecoveryMode:!1,hasEndorsementCertificateInSlot1:!1,hasEndorsementCertificateInSlot2:!1,numberOfWords:t.TwentyFour,currentWordIndex:0,onboardingState:r.WelcomeScreen1},...n},[e.NANO_X]:{isBootloader:!1,isOsu:!1,targetId:855638020,seTargetId:855638020,seVersion:"2.2.3",seFlags:new Uint8Array([230,0,0,0]),mcuTargetId:void 0,mcuSephVersion:"2.30",mcuBootloaderVersion:"1.16",hwVersion:"00",langId:0,recoverState:0,secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!1,isOnboarded:!0,isMcuCodeSigned:!0,isInRecoveryMode:!1,hasEndorsementCertificateInSlot1:!1,hasEndorsementCertificateInSlot2:!1,numberOfWords:t.TwentyFour,currentWordIndex:0,onboardingState:r.WelcomeScreen1},...n},[e.STAX]:{isBootloader:!1,isOsu:!1,targetId:857735172,seTargetId:857735172,seVersion:"1.3.0",seFlags:new Uint8Array([230,0,0,0]),mcuTargetId:void 0,mcuSephVersion:"5.24",mcuBootloaderVersion:"0.48",hwVersion:"00",langId:0,recoverState:void 0,secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!1,isOnboarded:!0,isMcuCodeSigned:!0,isInRecoveryMode:!1,hasEndorsementCertificateInSlot1:!1,hasEndorsementCertificateInSlot2:!1,numberOfWords:t.TwentyFour,currentWordIndex:0,onboardingState:r.WelcomeScreen1},...n},[e.FLEX]:{isBootloader:!1,isOsu:!1,targetId:858783748,seTargetId:858783748,seVersion:"1.1.1",seFlags:new Uint8Array([230,0,0,0]),mcuTargetId:void 0,mcuSephVersion:"6.4.0",mcuBootloaderVersion:"5.4.0",hwVersion:"00",langId:0,recoverState:0,secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!1,isOnboarded:!0,isMcuCodeSigned:!0,isInRecoveryMode:!1,hasEndorsementCertificateInSlot1:!1,hasEndorsementCertificateInSlot2:!1,numberOfWords:t.TwentyFour,currentWordIndex:0,onboardingState:r.WelcomeScreen1},...n},[e.APEX]:{isBootloader:!1,isOsu:!1,targetId:858783748,seTargetId:858783748,seVersion:"1.1.1",seFlags:new Uint8Array([230,0,0,0]),mcuTargetId:void 0,mcuSephVersion:"6.4.0",mcuBootloaderVersion:"5.4.0",hwVersion:"00",langId:0,recoverState:0,secureElementFlags:{isPinValidated:!0,hasMcuSerialNumber:!0,hasValidCertificate:!0,isCustomAuthorityConnectionAllowed:!1,isSecureConnectionAllowed:!1,isOnboarded:!0,isMcuCodeSigned:!0,isInRecoveryMode:!1,hasEndorsementCertificateInSlot1:!1,hasEndorsementCertificateInSlot2:!1,numberOfWords:t.TwentyFour,currentWordIndex:0,onboardingState:r.WelcomeScreen1}}})[o];export{i as getOsVersionCommandResponseMockBuilder};
|
|
2
2
|
//# sourceMappingURL=GetOsVersionCommand.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../src/api/command/os/__mocks__/GetOsVersionCommand.ts"],
|
|
4
|
-
"sourcesContent": ["import { type GetOsVersionResponse } from \"@api/command/os/GetOsVersionCommand\";\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\n\nexport const getOsVersionCommandResponseMockBuilder = (\n deviceModelId: DeviceModelId = DeviceModelId.NANO_SP,\n props: Partial<GetOsVersionResponse> = {},\n): GetOsVersionResponse =>\n ({\n [DeviceModelId.NANO_SP]: {\n isBootloader: false,\n isOsu: false,\n targetId: 856686596,\n seTargetId: 856686596,\n seVersion: \"1.1.1\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"4.03\",\n mcuBootloaderVersion: \"3.12\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: undefined,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n },\n ...props,\n },\n [DeviceModelId.NANO_S]: {\n isBootloader: false,\n isOsu: false,\n targetId: 858783748,\n seTargetId: 858783748,\n seVersion: \"1.1.1\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"6.4.0\",\n mcuBootloaderVersion: \"5.4.0\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: undefined,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n },\n ...props,\n },\n [DeviceModelId.NANO_X]: {\n isBootloader: false,\n isOsu: false,\n targetId: 855638020,\n seTargetId: 855638020,\n seVersion: \"2.2.3\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"2.30\",\n mcuBootloaderVersion: \"1.16\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: 0,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n },\n ...props,\n },\n [DeviceModelId.STAX]: {\n isBootloader: false,\n isOsu: false,\n targetId: 857735172,\n seTargetId: 857735172,\n seVersion: \"1.3.0\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"5.24\",\n mcuBootloaderVersion: \"0.48\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: undefined,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n },\n ...props,\n },\n [DeviceModelId.FLEX]: {\n isBootloader: false,\n isOsu: false,\n targetId: 858783748,\n seTargetId: 858783748,\n seVersion: \"1.1.1\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"6.4.0\",\n mcuBootloaderVersion: \"5.4.0\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: 0,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n },\n ...props,\n },\n [DeviceModelId.APEX]: {\n isBootloader: false,\n isOsu: false,\n targetId: 858783748,\n seTargetId: 858783748,\n seVersion: \"1.1.1\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"6.4.0\",\n mcuBootloaderVersion: \"5.4.0\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: 0,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n },\n },\n })[deviceModelId];\n"],
|
|
5
|
-
"mappings": "AACA,OAAS,iBAAAA,MAAqB,
|
|
6
|
-
"names": ["DeviceModelId", "getOsVersionCommandResponseMockBuilder", "deviceModelId", "props"]
|
|
4
|
+
"sourcesContent": ["import { type GetOsVersionResponse } from \"@api/command/os/GetOsVersionCommand\";\nimport { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { OnboardingState, SeedWordCount } from \"@api/device/SecureElementFlags\";\n\nexport const getOsVersionCommandResponseMockBuilder = (\n deviceModelId: DeviceModelId = DeviceModelId.NANO_SP,\n props: Partial<GetOsVersionResponse> = {},\n): GetOsVersionResponse =>\n ({\n [DeviceModelId.NANO_SP]: {\n isBootloader: false,\n isOsu: false,\n targetId: 856686596,\n seTargetId: 856686596,\n seVersion: \"1.1.1\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"4.03\",\n mcuBootloaderVersion: \"3.12\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: undefined,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n hasEndorsementCertificateInSlot1: false,\n hasEndorsementCertificateInSlot2: false,\n numberOfWords: SeedWordCount.TwentyFour,\n currentWordIndex: 0,\n onboardingState: OnboardingState.WelcomeScreen1,\n },\n ...props,\n },\n [DeviceModelId.NANO_S]: {\n isBootloader: false,\n isOsu: false,\n targetId: 858783748,\n seTargetId: 858783748,\n seVersion: \"1.1.1\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"6.4.0\",\n mcuBootloaderVersion: \"5.4.0\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: undefined,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n hasEndorsementCertificateInSlot1: false,\n hasEndorsementCertificateInSlot2: false,\n numberOfWords: SeedWordCount.TwentyFour,\n currentWordIndex: 0,\n onboardingState: OnboardingState.WelcomeScreen1,\n },\n ...props,\n },\n [DeviceModelId.NANO_X]: {\n isBootloader: false,\n isOsu: false,\n targetId: 855638020,\n seTargetId: 855638020,\n seVersion: \"2.2.3\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"2.30\",\n mcuBootloaderVersion: \"1.16\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: 0,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n hasEndorsementCertificateInSlot1: false,\n hasEndorsementCertificateInSlot2: false,\n numberOfWords: SeedWordCount.TwentyFour,\n currentWordIndex: 0,\n onboardingState: OnboardingState.WelcomeScreen1,\n },\n ...props,\n },\n [DeviceModelId.STAX]: {\n isBootloader: false,\n isOsu: false,\n targetId: 857735172,\n seTargetId: 857735172,\n seVersion: \"1.3.0\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"5.24\",\n mcuBootloaderVersion: \"0.48\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: undefined,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n hasEndorsementCertificateInSlot1: false,\n hasEndorsementCertificateInSlot2: false,\n numberOfWords: SeedWordCount.TwentyFour,\n currentWordIndex: 0,\n onboardingState: OnboardingState.WelcomeScreen1,\n },\n ...props,\n },\n [DeviceModelId.FLEX]: {\n isBootloader: false,\n isOsu: false,\n targetId: 858783748,\n seTargetId: 858783748,\n seVersion: \"1.1.1\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"6.4.0\",\n mcuBootloaderVersion: \"5.4.0\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: 0,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n hasEndorsementCertificateInSlot1: false,\n hasEndorsementCertificateInSlot2: false,\n numberOfWords: SeedWordCount.TwentyFour,\n currentWordIndex: 0,\n onboardingState: OnboardingState.WelcomeScreen1,\n },\n ...props,\n },\n [DeviceModelId.APEX]: {\n isBootloader: false,\n isOsu: false,\n targetId: 858783748,\n seTargetId: 858783748,\n seVersion: \"1.1.1\",\n seFlags: new Uint8Array([0xe6, 0x00, 0x00, 0x00]),\n mcuTargetId: undefined,\n mcuSephVersion: \"6.4.0\",\n mcuBootloaderVersion: \"5.4.0\",\n hwVersion: \"00\",\n langId: 0,\n recoverState: 0,\n secureElementFlags: {\n isPinValidated: true,\n hasMcuSerialNumber: true,\n hasValidCertificate: true,\n isCustomAuthorityConnectionAllowed: false,\n isSecureConnectionAllowed: false,\n isOnboarded: true,\n isMcuCodeSigned: true,\n isInRecoveryMode: false,\n hasEndorsementCertificateInSlot1: false,\n hasEndorsementCertificateInSlot2: false,\n numberOfWords: SeedWordCount.TwentyFour,\n currentWordIndex: 0,\n onboardingState: OnboardingState.WelcomeScreen1,\n },\n },\n })[deviceModelId];\n"],
|
|
5
|
+
"mappings": "AACA,OAAS,iBAAAA,MAAqB,0BAC9B,OAAS,mBAAAC,EAAiB,iBAAAC,MAAqB,iCAExC,MAAMC,EAAyC,CACpDC,EAA+BJ,EAAc,QAC7CK,EAAuC,CAAC,KAEvC,CACC,CAACL,EAAc,OAAO,EAAG,CACvB,aAAc,GACd,MAAO,GACP,SAAU,UACV,WAAY,UACZ,UAAW,QACX,QAAS,IAAI,WAAW,CAAC,IAAM,EAAM,EAAM,CAAI,CAAC,EAChD,YAAa,OACb,eAAgB,OAChB,qBAAsB,OACtB,UAAW,KACX,OAAQ,EACR,aAAc,OACd,mBAAoB,CAClB,eAAgB,GAChB,mBAAoB,GACpB,oBAAqB,GACrB,mCAAoC,GACpC,0BAA2B,GAC3B,YAAa,GACb,gBAAiB,GACjB,iBAAkB,GAClB,iCAAkC,GAClC,iCAAkC,GAClC,cAAeE,EAAc,WAC7B,iBAAkB,EAClB,gBAAiBD,EAAgB,cACnC,EACA,GAAGI,CACL,EACA,CAACL,EAAc,MAAM,EAAG,CACtB,aAAc,GACd,MAAO,GACP,SAAU,UACV,WAAY,UACZ,UAAW,QACX,QAAS,IAAI,WAAW,CAAC,IAAM,EAAM,EAAM,CAAI,CAAC,EAChD,YAAa,OACb,eAAgB,QAChB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AO,GACP,SAAU,UACV,WAAY,UACZ,UAAW,QACX,QAAS,IAAI,WAAW,CAAC,IAAM,EAAM,EAAM,CAAI,CAAC,EAChD,YAAa,OACb,eAAgB,QAChB,qBAAsB,QACtB,UAAW,KACX,OAAQ,EACR,aAAc,EACd,mBAAoB,CAClB,eAAgB,GAChB,mBAAoB,GACpB,oBAAqB,GACrB,mCAAoC,GACpC,0BAA2B,GAC3B,YAAa,GACb,gBAAiB,GACjB,iBAAkB,GAClB,iCAAkC,GAClC,iCAAkC,GAClC,cAAeE,EAAc,WAC7B,iBAAkB,EAClB,gBAAiBD,EAAgB,cACnC,EACA,GAAGI,CACL,EACA,CAACL,EAAc,IAAI,EAAG,CACpB,aAAc,GACd,MAAO,GACP,SAAU,UACV,WAAY,UACZ,UAAW,QACX,QAAS,IAAI,WAAW,CAAC,IAAM,EAAM,EAAM,CAAI,CAAC,EAChD,YAAa,OACb,eAAgB,QAChB,qBAAsB,QACtB,UAAW,KACX,OAAQ,EACR,aAAc,EACd,mBAAoB,CAClB,eAAgB,GAChB,mBAAoB,GACpB,oBAAqB,GACrB,mCAAoC,GACpC,0BAA2B,GAC3B,YAAa,GACb,gBAAiB,GACjB,iBAAkB,GAClB,iCAAkC,GAClC,iCAAkC,GAClC,cAAeE,EAAc,WAC7B,iBAAkB,EAClB,gBAAiBD,EAAgB,cACnC,CACF,CACF,GAAGG,CAAa",
|
|
6
|
+
"names": ["DeviceModelId", "OnboardingState", "SeedWordCount", "getOsVersionCommandResponseMockBuilder", "deviceModelId", "props"]
|
|
7
7
|
}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
+
const r={Twelve:12,Eighteen:18,TwentyFour:24};var o=(e=>(e.Unknown="unknown",e.WelcomeScreen1="welcome-screen-1",e.WelcomeScreen2="welcome-screen-2",e.WelcomeScreen3="welcome-screen-3",e.WelcomeScreen4="welcome-screen-4",e.WelcomeScreenReminder="welcome-screen-reminder",e.SetupChoice="setup-choice",e.Pin="pin",e.NewDevice="new-device",e.ConfirmNewDevice="confirm-new-device",e.RestoreRecoveryPhrase="restore-recovery-phrase",e.SafetyWarning="safety-warning",e.DeviceIsReady="device-is-ready",e.ChooseName="choose-name",e.RestoreRecoverBackup="restore-recover-backup",e.SetupRestoreChoice="setup-restore-choice",e.OnboardingStatusCheck="onboarding-status-check",e.RestoreWithRk="restore-with-rk",e))(o||{});export{o as OnboardingState,r as SeedWordCount};
|
|
1
2
|
//# sourceMappingURL=SecureElementFlags.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [],
|
|
4
|
-
"sourcesContent": [],
|
|
5
|
-
"mappings": "",
|
|
6
|
-
"names": []
|
|
3
|
+
"sources": ["../../../../../src/api/device/SecureElementFlags.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Represents the general state of a device, the information comes from the first byte of the secure element flags.\n */\nexport type DeviceGeneralState = {\n /**\n * Indicates whether the device's PIN has been validated.\n */\n isPinValidated: boolean;\n\n /**\n * Indicates whether the device has a MCU serial number.\n */\n hasMcuSerialNumber: boolean;\n\n /**\n * Indicates whether the device has a personalized valid Ledger certificate.\n */\n hasValidCertificate: boolean;\n\n /**\n * Indicates whether the device is allowed to connect with a custom certificate authority.\n */\n isCustomAuthorityConnectionAllowed: boolean;\n\n /**\n * Indicates whether the device is allowed to commnunicate with secure connection.\n */\n isSecureConnectionAllowed: boolean;\n\n /**\n * Indicates whether the device has been onboarded.\n */\n isOnboarded: boolean;\n\n /**\n * Indicates whether the MCU code on the device is signed.\n */\n isMcuCodeSigned: boolean;\n\n /**\n * Indicates whether the device is in recovery mode.\n */\n isInRecoveryMode: boolean;\n};\n\n/**\n * Represents which endorsement certificate slots are populated.\n * This information comes from the second byte of the secure element flags.\n */\nexport type EndorsementInformation = {\n hasEndorsementCertificateInSlot1: boolean;\n hasEndorsementCertificateInSlot2: boolean;\n};\n\n/**\n * Number of seed words selected during onboarding.\n * Values follow GET VERSION byte 3 (bits 5\u20136): 24, 18, or 12.\n *\n * Defined as a const object rather than a numeric enum so the type stays\n * `12 | 18 | 24` and is not assignable from an arbitrary `number`.\n */\nexport const SeedWordCount = {\n Twelve: 12,\n Eighteen: 18,\n TwentyFour: 24,\n} as const;\n\nexport type SeedWordCount = (typeof SeedWordCount)[keyof typeof SeedWordCount];\n\n/**\n * Represents the seed phrase setup progress.\n * This information comes from the third byte of the secure element flags.\n */\nexport type WordsInformation = {\n /**\n * Number of seed words selected by the user.\n * `undefined` represents a reserved or unknown encoding.\n */\n numberOfWords: SeedWordCount | undefined;\n /**\n * Zero-based index of the word currently being entered or confirmed.\n */\n currentWordIndex: number;\n};\n\n/**\n * Onboarding screen encoded in the fourth secure element flag byte.\n * Values follow GET VERSION byte 4 (0x00 to 0x10).\n */\nexport enum OnboardingState {\n /**\n * An encoding not covered by the specification (any byte outside 0x00\u20130x10),\n * which future firmware versions may introduce.\n */\n Unknown = \"unknown\",\n WelcomeScreen1 = \"welcome-screen-1\",\n WelcomeScreen2 = \"welcome-screen-2\",\n WelcomeScreen3 = \"welcome-screen-3\",\n WelcomeScreen4 = \"welcome-screen-4\",\n WelcomeScreenReminder = \"welcome-screen-reminder\",\n SetupChoice = \"setup-choice\",\n Pin = \"pin\",\n NewDevice = \"new-device\",\n ConfirmNewDevice = \"confirm-new-device\",\n RestoreRecoveryPhrase = \"restore-recovery-phrase\",\n SafetyWarning = \"safety-warning\",\n DeviceIsReady = \"device-is-ready\",\n ChooseName = \"choose-name\",\n RestoreRecoverBackup = \"restore-recover-backup\",\n SetupRestoreChoice = \"setup-restore-choice\",\n OnboardingStatusCheck = \"onboarding-status-check\",\n RestoreWithRk = \"restore-with-rk\",\n}\n\n/**\n * Represents the current onboarding state.\n * This information comes from the fourth byte of the secure element flags.\n */\nexport type OnboardingStatus = {\n /**\n * Parsed onboarding state, `OnboardingState.Unknown` for unmapped bytes.\n */\n onboardingState: OnboardingState;\n};\n\n/**\n * Parsed secure element flags from a Get OS version response.\n */\nexport type SecureElementFlags = DeviceGeneralState &\n EndorsementInformation &\n WordsInformation &\n OnboardingStatus;\n"],
|
|
5
|
+
"mappings": "AA6DO,MAAMA,EAAgB,CAC3B,OAAQ,GACR,SAAU,GACV,WAAY,EACd,EAwBO,IAAKC,OAKVA,EAAA,QAAU,UACVA,EAAA,eAAiB,mBACjBA,EAAA,eAAiB,mBACjBA,EAAA,eAAiB,mBACjBA,EAAA,eAAiB,mBACjBA,EAAA,sBAAwB,0BACxBA,EAAA,YAAc,eACdA,EAAA,IAAM,MACNA,EAAA,UAAY,aACZA,EAAA,iBAAmB,qBACnBA,EAAA,sBAAwB,0BACxBA,EAAA,cAAgB,iBAChBA,EAAA,cAAgB,kBAChBA,EAAA,WAAa,cACbA,EAAA,qBAAuB,yBACvBA,EAAA,mBAAqB,uBACrBA,EAAA,sBAAwB,0BACxBA,EAAA,cAAgB,kBAtBNA,OAAA",
|
|
6
|
+
"names": ["SeedWordCount", "OnboardingState"]
|
|
7
7
|
}
|
package/lib/esm/src/api/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Apdu as r}from"./apdu/model/Apdu";import{APDU_MAX_PAYLOAD as p,ApduBuilder as a}from"./apdu/utils/ApduBuilder";import{ApduParser as i}from"./apdu/utils/ApduParser";export*from"./apdu/utils/AppBuilderError";import{ByteArrayBuilder as c}from"./apdu/utils/ByteArrayBuilder";import{ByteArrayParser as f}from"./apdu/utils/ByteArrayParser";import{InvalidResponseFormatError as D,InvalidStatusWordError as
|
|
1
|
+
import{Apdu as r}from"./apdu/model/Apdu";import{APDU_MAX_PAYLOAD as p,ApduBuilder as a}from"./apdu/utils/ApduBuilder";import{ApduParser as i}from"./apdu/utils/ApduParser";export*from"./apdu/utils/AppBuilderError";import{ByteArrayBuilder as c}from"./apdu/utils/ByteArrayBuilder";import{ByteArrayParser as f}from"./apdu/utils/ByteArrayParser";import{InvalidResponseFormatError as D,InvalidStatusWordError as u}from"./command/Errors";import{CommandResultFactory as l,CommandResultStatus as g,isSuccessCommandResult as y}from"./command/model/CommandResult";import{CloseAppCommand as v}from"./command/os/CloseAppCommand";import{DeleteLanguagePackCommand as L,DeleteLanguagePackCommandError as k}from"./command/os/DeleteLanguagePackCommand";import{GetAppAndVersionCommand as R}from"./command/os/GetAppAndVersionCommand";import{GetBackgroundImageSizeCommand as I,GetBackgroundImageSizeCommandError as T}from"./command/os/GetBackgroundImageSizeCommand";import{BatteryStatusType as O,GetBatteryStatusCommand as b}from"./command/os/GetBatteryStatusCommand";import{GetOsVersionCommand as P}from"./command/os/GetOsVersionCommand";import{ListAppsCommand as M}from"./command/os/ListAppsCommand";import{ListLanguagePackCommand as W,ListLanguagePackCommandError as U}from"./command/os/ListLanguagePackCommand";import{LoadCertificateCommand as _}from"./command/os/LoadCertificateCommand";import{OpenAppCommand as z}from"./command/os/OpenAppCommand";import{isCommandErrorCode as H}from"./command/utils/CommandErrors";import{CommandUtils as Q}from"./command/utils/CommandUtils";import{GLOBAL_ERRORS as Y,GlobalCommandError as j,GlobalCommandErrorHandler as J}from"./command/utils/GlobalCommandError";import{DeviceModel as $,DeviceModelId as ee,LEDGER_VENDOR_ID as oe}from"./device/DeviceModel";import{DeviceStatus as te}from"./device/DeviceStatus";import{OnboardingState as ae,SeedWordCount as ne}from"./device/SecureElementFlags";import{DeviceActionStatus as me}from"./device-action/model/DeviceActionState";import{UserInteractionRequired as ce}from"./device-action/model/UserInteractionRequired";import{CallTaskInAppDeviceAction as fe}from"./device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction";import{DEFAULT_UNLOCK_TIMEOUT_MS as De}from"./device-action/os/Const";import{AppAlreadyInstalledDAError as xe,DeleteLanguagePackDAError as le,DeviceLockedError as ge,DeviceNotOnboardedError as ye,OutOfMemoryDAError as Ce,RefusedByUserDAError as ve,UnknownDAError as Se,UnsupportedFirmwareDAError as Le}from"./device-action/os/Errors";import{GetDeviceMetadataDeviceAction as Ee}from"./device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction";import{GetDeviceStatusDeviceAction as Ge}from"./device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction";import{GoToDashboardDeviceAction as Te}from"./device-action/os/GoToDashboard/GoToDashboardDeviceAction";import{InstallLanguagePackageDeviceAction as Oe}from"./device-action/os/InstallLanguagePackage/InstallLanguagePackageDeviceAction";import{InstallOrUpdateAppsDeviceAction as he}from"./device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction";import{ListAppsDeviceAction as Fe}from"./device-action/os/ListApps/ListAppsDeviceAction";import{ListAppsWithMetadataDeviceAction as Ve}from"./device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction";import{OpenAppDeviceAction as Ue}from"./device-action/os/OpenAppDeviceAction/OpenAppDeviceAction";import{OpenAppWithDependenciesDeviceAction as _e}from"./device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction";import{SendCommandInAppDeviceAction as ze}from"./device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction";import{WaitForAppAndVersionDeviceAction as He}from"./device-action/os/WaitForAppAndVersion/WaitForAppAndVersionDeviceAction";import{GetApplicationsMetadataTaskError as Qe,InvalidGetFirmwareMetadataResponseError as Xe}from"./device-action/task/Errors";import{XStateDeviceAction as je}from"./device-action/xstate-utils/XStateDeviceAction";import{StaticDeviceModelDataSource as Ze}from"./device-model/data/StaticDeviceModelDataSource";import{BleDeviceInfos as eo}from"./device-model/model/BleDeviceInfos";import{TransportDeviceModel as ro}from"./device-model/model/DeviceModel";import{ApduResponse as po}from"./device-session/ApduResponse";export*from"./device-session/data/FramerConst";import{DeviceSessionStateType as io}from"./device-session/DeviceSessionState";import{DmkResultFactory as so,DmkResultStatus as co,isSuccessDmkResult as fo}from"./model/DmkResult";import{GenuineCheckDeviceAction as Do}from"./secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction";import{InstallAppDeviceAction as xo}from"./secure-channel/device-action/InstallApp/InstallAppDeviceAction";import{ListInstalledAppsDeviceAction as go}from"./secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction";import{UninstallAppDeviceAction as Co}from"./secure-channel/device-action/UninstallApp/UninstallAppDeviceAction";import{ConnectToSecureChannelTask as So}from"./secure-channel/task/ConnectToSecureChannelTask";import{SecureChannelEventType as ko}from"./secure-channel/task/types";import{SecureChannelError as Ro}from"../internal/secure-channel/model/Errors";import{defaultApduReceiverServiceStubBuilder as Io}from"./device-session/service/DefaultApduReceiverService.stub";import{defaultApduSenderServiceStubBuilder as Bo}from"./device-session/service/DefaultApduSenderService.stub";import{FramerUtils as bo}from"./device-session/utils/FramerUtils";import{DeviceManagementKit as Po}from"./DeviceManagementKit";import{DeviceManagementKitBuilder as Mo}from"./DeviceManagementKitBuilder";export*from"./Error";import{noopLogger as Uo,noopLoggerFactory as No}from"./logger-publisher/utils/noopLoggerFactory";import{LogLevel as wo}from"./logger-subscriber/model/LogLevel";import{ConsoleLogger as qo}from"./logger-subscriber/service/ConsoleLogger";import{DefaultLogTagFormatter as Ko}from"./logger-subscriber/service/DefaultLogTagFormatter";import{WebLogsExporterLogger as Xo}from"./logger-subscriber/service/WebLogsExporterLogger";import{DmkNetworkClient as jo}from"./network/DmkNetworkClient";import{DmkNetworkClientError as Zo}from"./network/DmkNetworkClientError";import{ConnectedDevice as er}from"./transport/model/ConnectedDevice";import{DeviceConnectionStateMachine as rr}from"./transport/model/DeviceConnectionStateMachine";export*from"./transport/model/Errors";import{TransportConnectedDevice as ar}from"./transport/model/TransportConnectedDevice";import{connectedDeviceStubBuilder as ir}from"./transport/model/TransportConnectedDevice.stub";export*from"./types";import{formatApduReceivedLog as cr,formatApduSentLog as dr}from"./utils/apduLogs";import{ApplicationChecker as Ar}from"./utils/ApplicationChecker";import{isDashboardName as ur}from"./utils/AppName";import{base64StringToBuffer as lr,bufferToBase64String as gr,isBase64String as yr}from"./utils/Base64String";import{bufferToHexaString as vr,hexaStringToBuffer as Sr,isHexaString as Lr}from"./utils/HexaString";export{p as APDU_MAX_PAYLOAD,r as Apdu,a as ApduBuilder,i as ApduParser,po as ApduResponse,xe as AppAlreadyInstalledDAError,Ar as ApplicationChecker,O as BatteryStatusType,eo as BleDeviceInfos,c as ByteArrayBuilder,f as ByteArrayParser,fe as CallTaskInAppDeviceAction,v as CloseAppCommand,l as CommandResultFactory,g as CommandResultStatus,Q as CommandUtils,So as ConnectToSecureChannelTask,er as ConnectedDevice,qo as ConsoleLogger,De as DEFAULT_UNLOCK_TIMEOUT_MS,Ko as DefaultLogTagFormatter,L as DeleteLanguagePackCommand,k as DeleteLanguagePackCommandError,le as DeleteLanguagePackDAError,me as DeviceActionStatus,rr as DeviceConnectionStateMachine,ge as DeviceLockedError,Po as DeviceManagementKit,Mo as DeviceManagementKitBuilder,$ as DeviceModel,ee as DeviceModelId,ye as DeviceNotOnboardedError,io as DeviceSessionStateType,te as DeviceStatus,jo as DmkNetworkClient,Zo as DmkNetworkClientError,so as DmkResultFactory,co as DmkResultStatus,bo as FramerUtils,Y as GLOBAL_ERRORS,Do as GenuineCheckDeviceAction,R as GetAppAndVersionCommand,Qe as GetApplicationsMetadataTaskError,I as GetBackgroundImageSizeCommand,T as GetBackgroundImageSizeCommandError,b as GetBatteryStatusCommand,Ee as GetDeviceMetadataDeviceAction,Ge as GetDeviceStatusDeviceAction,P as GetOsVersionCommand,j as GlobalCommandError,J as GlobalCommandErrorHandler,Te as GoToDashboardDeviceAction,xo as InstallAppDeviceAction,Oe as InstallLanguagePackageDeviceAction,he as InstallOrUpdateAppsDeviceAction,Xe as InvalidGetFirmwareMetadataResponseError,D as InvalidResponseFormatError,u as InvalidStatusWordError,oe as LEDGER_VENDOR_ID,M as ListAppsCommand,Fe as ListAppsDeviceAction,Ve as ListAppsWithMetadataDeviceAction,go as ListInstalledAppsDeviceAction,W as ListLanguagePackCommand,U as ListLanguagePackCommandError,_ as LoadCertificateCommand,wo as LogLevel,ae as OnboardingState,z as OpenAppCommand,Ue as OpenAppDeviceAction,_e as OpenAppWithDependenciesDeviceAction,Ce as OutOfMemoryDAError,ve as RefusedByUserDAError,Ro as SecureChannelError,ko as SecureChannelEventType,ne as SeedWordCount,ze as SendCommandInAppDeviceAction,Ze as StaticDeviceModelDataSource,ar as TransportConnectedDevice,ro as TransportDeviceModel,Co as UninstallAppDeviceAction,Se as UnknownDAError,Le as UnsupportedFirmwareDAError,ce as UserInteractionRequired,He as WaitForAppAndVersionDeviceAction,Xo as WebLogsExporterLogger,je as XStateDeviceAction,lr as base64StringToBuffer,gr as bufferToBase64String,vr as bufferToHexaString,ir as connectedDeviceStubBuilder,Io as defaultApduReceiverServiceStubBuilder,Bo as defaultApduSenderServiceStubBuilder,cr as formatApduReceivedLog,dr as formatApduSentLog,Sr as hexaStringToBuffer,yr as isBase64String,H as isCommandErrorCode,ur as isDashboardName,Lr as isHexaString,y as isSuccessCommandResult,fo as isSuccessDmkResult,Uo as noopLogger,No as noopLoggerFactory};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/api/index.ts"],
|
|
4
|
-
"sourcesContent": ["\"use strict\";\n\nexport { Apdu } from \"@api/apdu/model/Apdu\";\nexport { APDU_MAX_PAYLOAD, ApduBuilder } from \"@api/apdu/utils/ApduBuilder\";\nexport { ApduParser } from \"@api/apdu/utils/ApduParser\";\nexport * from \"@api/apdu/utils/AppBuilderError\";\nexport { ByteArrayBuilder } from \"@api/apdu/utils/ByteArrayBuilder\";\nexport { ByteArrayParser } from \"@api/apdu/utils/ByteArrayParser\";\nexport { type Command } from \"@api/command/Command\";\nexport {\n InvalidResponseFormatError,\n InvalidStatusWordError,\n} from \"@api/command/Errors\";\nexport {\n CommandResultFactory,\n CommandResultStatus,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nexport { CloseAppCommand } from \"@api/command/os/CloseAppCommand\";\nexport {\n DeleteLanguagePackCommand,\n type DeleteLanguagePackCommandArgs,\n DeleteLanguagePackCommandError,\n type DeleteLanguagePackCommandResult,\n type DeleteLanguagePackErrorCodes,\n} from \"@api/command/os/DeleteLanguagePackCommand\";\nexport {\n GetAppAndVersionCommand,\n type GetAppAndVersionResponse,\n} from \"@api/command/os/GetAppAndVersionCommand\";\nexport {\n GetBackgroundImageSizeCommand,\n GetBackgroundImageSizeCommandError,\n type GetBackgroundImageSizeCommandResult,\n type GetBackgroundImageSizeErrorCodes,\n type GetBackgroundImageSizeResponse,\n} from \"@api/command/os/GetBackgroundImageSizeCommand\";\nexport {\n BatteryStatusType,\n type GetBatteryStatusArgs,\n GetBatteryStatusCommand,\n type GetBatteryStatusResponse,\n} from \"@api/command/os/GetBatteryStatusCommand\";\nexport {\n GetOsVersionCommand,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\nexport {\n type ListAppsArgs,\n ListAppsCommand,\n type ListAppsErrorCodes,\n type ListAppsResponse,\n} from \"@api/command/os/ListAppsCommand\";\nexport {\n ListLanguagePackCommand,\n type ListLanguagePackCommandArgs,\n ListLanguagePackCommandError,\n type ListLanguagePackCommandResult,\n type ListLanguagePackErrorCodes,\n type ListLanguagePackResponse,\n} from \"@api/command/os/ListLanguagePackCommand\";\nexport {\n type LoadCertificateArgs,\n LoadCertificateCommand,\n type LoadCertificateErrorCodes,\n} from \"@api/command/os/LoadCertificateCommand\";\nexport {\n type OpenAppArgs,\n OpenAppCommand,\n} from \"@api/command/os/OpenAppCommand\";\nexport { isCommandErrorCode } from \"@api/command/utils/CommandErrors\";\nexport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nexport {\n GLOBAL_ERRORS,\n GlobalCommandError,\n GlobalCommandErrorHandler,\n} from \"@api/command/utils/GlobalCommandError\";\nexport {\n DeviceModel,\n DeviceModelId,\n LEDGER_VENDOR_ID,\n} from \"@api/device/DeviceModel\";\nexport { DeviceStatus } from \"@api/device/DeviceStatus\";\nexport { type InternalApi } from \"@api/device-action/DeviceAction\";\nexport {\n type DeviceActionState,\n DeviceActionStatus,\n} from \"@api/device-action/model/DeviceActionState\";\nexport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nexport { CallTaskInAppDeviceAction } from \"@api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction\";\nexport { DEFAULT_UNLOCK_TIMEOUT_MS } from \"@api/device-action/os/Const\";\nexport {\n AppAlreadyInstalledDAError,\n DeleteLanguagePackDAError,\n DeviceLockedError,\n DeviceNotOnboardedError,\n OutOfMemoryDAError,\n RefusedByUserDAError,\n UnknownDAError,\n UnsupportedFirmwareDAError,\n} from \"@api/device-action/os/Errors\";\nexport { GetDeviceMetadataDeviceAction } from \"@api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction\";\nexport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\nexport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\nexport type {\n GoToDashboardDAError,\n GoToDashboardDAInput,\n GoToDashboardDAIntermediateValue,\n GoToDashboardDAOutput,\n GoToDashboardDARequiredInteraction,\n GoToDashboardDAState,\n} from \"@api/device-action/os/GoToDashboard/types\";\nexport { InstallLanguagePackageDeviceAction } from \"@api/device-action/os/InstallLanguagePackage/InstallLanguagePackageDeviceAction\";\nexport { InstallOrUpdateAppsDeviceAction } from \"@api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction\";\nexport { ListAppsDeviceAction } from \"@api/device-action/os/ListApps/ListAppsDeviceAction\";\nexport { ListAppsWithMetadataDeviceAction } from \"@api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction\";\nexport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nexport { OpenAppWithDependenciesDeviceAction } from \"@api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction\";\nexport { SendCommandInAppDeviceAction } from \"@api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction\";\nexport type {\n WaitForAppAndVersionDAError,\n WaitForAppAndVersionDAInput,\n WaitForAppAndVersionDAIntermediateValue,\n WaitForAppAndVersionDAOutput,\n WaitForAppAndVersionDARequiredInteraction,\n WaitForAppAndVersionDAState,\n} from \"@api/device-action/os/WaitForAppAndVersion/types\";\nexport { WaitForAppAndVersionDeviceAction } from \"@api/device-action/os/WaitForAppAndVersion/WaitForAppAndVersionDeviceAction\";\nexport {\n GetApplicationsMetadataTaskError,\n InvalidGetFirmwareMetadataResponseError,\n} from \"@api/device-action/task/Errors\";\nexport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\nexport { StaticDeviceModelDataSource } from \"@api/device-model/data/StaticDeviceModelDataSource\";\nexport { BleDeviceInfos } from \"@api/device-model/model/BleDeviceInfos\";\nexport { TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\nexport { ApduResponse } from \"@api/device-session/ApduResponse\";\nexport * from \"@api/device-session/data/FramerConst\";\nexport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nexport {\n DmkResultFactory,\n DmkResultStatus,\n isSuccessDmkResult,\n} from \"@api/model/DmkResult\";\nexport { GenuineCheckDeviceAction } from \"@api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction\";\nexport { InstallAppDeviceAction } from \"@api/secure-channel/device-action/InstallApp/InstallAppDeviceAction\";\nexport { ListInstalledAppsDeviceAction } from \"@api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction\";\nexport type { InstalledApp } from \"@api/secure-channel/device-action/ListInstalledApps/types\";\nexport { UninstallAppDeviceAction } from \"@api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction\";\nexport { ConnectToSecureChannelTask } from \"@api/secure-channel/task/ConnectToSecureChannelTask\";\nexport { SecureChannelEventType } from \"@api/secure-channel/task/types\";\nexport { SecureChannelError } from \"@internal/secure-channel/model/Errors\";\n// TODO: remove from exported\nexport { defaultApduReceiverServiceStubBuilder } from \"@api/device-session/service/DefaultApduReceiverService.stub\";\nexport { defaultApduSenderServiceStubBuilder } from \"@api/device-session/service/DefaultApduSenderService.stub\";\nexport { FramerUtils } from \"@api/device-session/utils/FramerUtils\";\nexport { DeviceManagementKit } from \"@api/DeviceManagementKit\";\nexport { DeviceManagementKitBuilder } from \"@api/DeviceManagementKitBuilder\";\nexport * from \"@api/Error\";\nexport {\n noopLogger,\n noopLoggerFactory,\n} from \"@api/logger-publisher/utils/noopLoggerFactory\";\nexport { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nexport { ConsoleLogger } from \"@api/logger-subscriber/service/ConsoleLogger\";\nexport { DefaultLogTagFormatter } from \"@api/logger-subscriber/service/DefaultLogTagFormatter\";\nexport { type LogTagFormatter } from \"@api/logger-subscriber/service/LogTagFormatter\";\nexport { WebLogsExporterLogger } from \"@api/logger-subscriber/service/WebLogsExporterLogger\";\nexport {\n DmkNetworkClient,\n type DmkNetworkClientOptions,\n type DmkNetworkResponse,\n type DmkQueryParams,\n type DmkQueryParamValue,\n type DmkRequestConfig,\n type DmkResponseType,\n} from \"@api/network/DmkNetworkClient\";\nexport { DmkNetworkClientError } from \"@api/network/DmkNetworkClientError\";\nexport { ConnectedDevice } from \"@api/transport/model/ConnectedDevice\";\nexport {\n DeviceConnectionStateMachine,\n type DeviceConnectionStateMachineParams,\n} from \"@api/transport/model/DeviceConnectionStateMachine\";\nexport * from \"@api/transport/model/Errors\";\nexport { TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nexport { connectedDeviceStubBuilder } from \"@api/transport/model/TransportConnectedDevice.stub\";\nexport * from \"@api/types\";\nexport { formatApduReceivedLog, formatApduSentLog } from \"@api/utils/apduLogs\";\nexport { ApplicationChecker } from \"@api/utils/ApplicationChecker\";\nexport {\n type AppConfig,\n type ApplicationResolver,\n type ResolvedApp,\n} from \"@api/utils/ApplicationResolver\";\nexport { isDashboardName } from \"@api/utils/AppName\";\nexport {\n base64StringToBuffer,\n bufferToBase64String,\n isBase64String,\n} from \"@api/utils/Base64String\";\nexport {\n bufferToHexaString,\n hexaStringToBuffer,\n isHexaString,\n} from \"@api/utils/HexaString\";\n"],
|
|
5
|
-
"mappings": "AAEA,OAAS,QAAAA,MAAY,uBACrB,OAAS,oBAAAC,EAAkB,eAAAC,MAAmB,8BAC9C,OAAS,cAAAC,MAAkB,6BAC3B,WAAc,kCACd,OAAS,oBAAAC,MAAwB,mCACjC,OAAS,mBAAAC,MAAuB,kCAEhC,OACE,8BAAAC,EACA,0BAAAC,MACK,sBACP,OACE,wBAAAC,EACA,uBAAAC,EACA,0BAAAC,MACK,mCACP,OAAS,mBAAAC,MAAuB,kCAChC,OACE,6BAAAC,EAEA,kCAAAC,MAGK,4CACP,OACE,2BAAAC,MAEK,0CACP,OACE,iCAAAC,EACA,sCAAAC,MAIK,gDACP,OACE,qBAAAC,EAEA,2BAAAC,MAEK,0CACP,OACE,uBAAAC,
|
|
6
|
-
"names": ["Apdu", "APDU_MAX_PAYLOAD", "ApduBuilder", "ApduParser", "ByteArrayBuilder", "ByteArrayParser", "InvalidResponseFormatError", "InvalidStatusWordError", "CommandResultFactory", "CommandResultStatus", "isSuccessCommandResult", "CloseAppCommand", "DeleteLanguagePackCommand", "DeleteLanguagePackCommandError", "GetAppAndVersionCommand", "GetBackgroundImageSizeCommand", "GetBackgroundImageSizeCommandError", "BatteryStatusType", "GetBatteryStatusCommand", "GetOsVersionCommand", "ListAppsCommand", "ListLanguagePackCommand", "ListLanguagePackCommandError", "LoadCertificateCommand", "OpenAppCommand", "isCommandErrorCode", "CommandUtils", "GLOBAL_ERRORS", "GlobalCommandError", "GlobalCommandErrorHandler", "DeviceModel", "DeviceModelId", "LEDGER_VENDOR_ID", "DeviceStatus", "DeviceActionStatus", "UserInteractionRequired", "CallTaskInAppDeviceAction", "DEFAULT_UNLOCK_TIMEOUT_MS", "AppAlreadyInstalledDAError", "DeleteLanguagePackDAError", "DeviceLockedError", "DeviceNotOnboardedError", "OutOfMemoryDAError", "RefusedByUserDAError", "UnknownDAError", "UnsupportedFirmwareDAError", "GetDeviceMetadataDeviceAction", "GetDeviceStatusDeviceAction", "GoToDashboardDeviceAction", "InstallLanguagePackageDeviceAction", "InstallOrUpdateAppsDeviceAction", "ListAppsDeviceAction", "ListAppsWithMetadataDeviceAction", "OpenAppDeviceAction", "OpenAppWithDependenciesDeviceAction", "SendCommandInAppDeviceAction", "WaitForAppAndVersionDeviceAction", "GetApplicationsMetadataTaskError", "InvalidGetFirmwareMetadataResponseError", "XStateDeviceAction", "StaticDeviceModelDataSource", "BleDeviceInfos", "TransportDeviceModel", "ApduResponse", "DeviceSessionStateType", "DmkResultFactory", "DmkResultStatus", "isSuccessDmkResult", "GenuineCheckDeviceAction", "InstallAppDeviceAction", "ListInstalledAppsDeviceAction", "UninstallAppDeviceAction", "ConnectToSecureChannelTask", "SecureChannelEventType", "SecureChannelError", "defaultApduReceiverServiceStubBuilder", "defaultApduSenderServiceStubBuilder", "FramerUtils", "DeviceManagementKit", "DeviceManagementKitBuilder", "noopLogger", "noopLoggerFactory", "LogLevel", "ConsoleLogger", "DefaultLogTagFormatter", "WebLogsExporterLogger", "DmkNetworkClient", "DmkNetworkClientError", "ConnectedDevice", "DeviceConnectionStateMachine", "TransportConnectedDevice", "connectedDeviceStubBuilder", "formatApduReceivedLog", "formatApduSentLog", "ApplicationChecker", "isDashboardName", "base64StringToBuffer", "bufferToBase64String", "isBase64String", "bufferToHexaString", "hexaStringToBuffer", "isHexaString"]
|
|
4
|
+
"sourcesContent": ["\"use strict\";\n\nexport { Apdu } from \"@api/apdu/model/Apdu\";\nexport { APDU_MAX_PAYLOAD, ApduBuilder } from \"@api/apdu/utils/ApduBuilder\";\nexport { ApduParser } from \"@api/apdu/utils/ApduParser\";\nexport * from \"@api/apdu/utils/AppBuilderError\";\nexport { ByteArrayBuilder } from \"@api/apdu/utils/ByteArrayBuilder\";\nexport { ByteArrayParser } from \"@api/apdu/utils/ByteArrayParser\";\nexport { type Command } from \"@api/command/Command\";\nexport {\n InvalidResponseFormatError,\n InvalidStatusWordError,\n} from \"@api/command/Errors\";\nexport {\n CommandResultFactory,\n CommandResultStatus,\n isSuccessCommandResult,\n} from \"@api/command/model/CommandResult\";\nexport { CloseAppCommand } from \"@api/command/os/CloseAppCommand\";\nexport {\n DeleteLanguagePackCommand,\n type DeleteLanguagePackCommandArgs,\n DeleteLanguagePackCommandError,\n type DeleteLanguagePackCommandResult,\n type DeleteLanguagePackErrorCodes,\n} from \"@api/command/os/DeleteLanguagePackCommand\";\nexport {\n GetAppAndVersionCommand,\n type GetAppAndVersionResponse,\n} from \"@api/command/os/GetAppAndVersionCommand\";\nexport {\n GetBackgroundImageSizeCommand,\n GetBackgroundImageSizeCommandError,\n type GetBackgroundImageSizeCommandResult,\n type GetBackgroundImageSizeErrorCodes,\n type GetBackgroundImageSizeResponse,\n} from \"@api/command/os/GetBackgroundImageSizeCommand\";\nexport {\n BatteryStatusType,\n type GetBatteryStatusArgs,\n GetBatteryStatusCommand,\n type GetBatteryStatusResponse,\n} from \"@api/command/os/GetBatteryStatusCommand\";\nexport {\n GetOsVersionCommand,\n type GetOsVersionCommandResult,\n type GetOsVersionResponse,\n} from \"@api/command/os/GetOsVersionCommand\";\nexport {\n type ListAppsArgs,\n ListAppsCommand,\n type ListAppsErrorCodes,\n type ListAppsResponse,\n} from \"@api/command/os/ListAppsCommand\";\nexport {\n ListLanguagePackCommand,\n type ListLanguagePackCommandArgs,\n ListLanguagePackCommandError,\n type ListLanguagePackCommandResult,\n type ListLanguagePackErrorCodes,\n type ListLanguagePackResponse,\n} from \"@api/command/os/ListLanguagePackCommand\";\nexport {\n type LoadCertificateArgs,\n LoadCertificateCommand,\n type LoadCertificateErrorCodes,\n} from \"@api/command/os/LoadCertificateCommand\";\nexport {\n type OpenAppArgs,\n OpenAppCommand,\n} from \"@api/command/os/OpenAppCommand\";\nexport { isCommandErrorCode } from \"@api/command/utils/CommandErrors\";\nexport { CommandUtils } from \"@api/command/utils/CommandUtils\";\nexport {\n GLOBAL_ERRORS,\n GlobalCommandError,\n GlobalCommandErrorHandler,\n} from \"@api/command/utils/GlobalCommandError\";\nexport {\n DeviceModel,\n DeviceModelId,\n LEDGER_VENDOR_ID,\n} from \"@api/device/DeviceModel\";\nexport { DeviceStatus } from \"@api/device/DeviceStatus\";\nexport {\n type DeviceGeneralState,\n type EndorsementInformation,\n OnboardingState,\n type OnboardingStatus,\n type SecureElementFlags,\n SeedWordCount,\n type WordsInformation,\n} from \"@api/device/SecureElementFlags\";\nexport { type InternalApi } from \"@api/device-action/DeviceAction\";\nexport {\n type DeviceActionState,\n DeviceActionStatus,\n} from \"@api/device-action/model/DeviceActionState\";\nexport { UserInteractionRequired } from \"@api/device-action/model/UserInteractionRequired\";\nexport { CallTaskInAppDeviceAction } from \"@api/device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction\";\nexport { DEFAULT_UNLOCK_TIMEOUT_MS } from \"@api/device-action/os/Const\";\nexport {\n AppAlreadyInstalledDAError,\n DeleteLanguagePackDAError,\n DeviceLockedError,\n DeviceNotOnboardedError,\n OutOfMemoryDAError,\n RefusedByUserDAError,\n UnknownDAError,\n UnsupportedFirmwareDAError,\n} from \"@api/device-action/os/Errors\";\nexport { GetDeviceMetadataDeviceAction } from \"@api/device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction\";\nexport { GetDeviceStatusDeviceAction } from \"@api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction\";\nexport { GoToDashboardDeviceAction } from \"@api/device-action/os/GoToDashboard/GoToDashboardDeviceAction\";\nexport type {\n GoToDashboardDAError,\n GoToDashboardDAInput,\n GoToDashboardDAIntermediateValue,\n GoToDashboardDAOutput,\n GoToDashboardDARequiredInteraction,\n GoToDashboardDAState,\n} from \"@api/device-action/os/GoToDashboard/types\";\nexport { InstallLanguagePackageDeviceAction } from \"@api/device-action/os/InstallLanguagePackage/InstallLanguagePackageDeviceAction\";\nexport { InstallOrUpdateAppsDeviceAction } from \"@api/device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction\";\nexport { ListAppsDeviceAction } from \"@api/device-action/os/ListApps/ListAppsDeviceAction\";\nexport { ListAppsWithMetadataDeviceAction } from \"@api/device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction\";\nexport { OpenAppDeviceAction } from \"@api/device-action/os/OpenAppDeviceAction/OpenAppDeviceAction\";\nexport { OpenAppWithDependenciesDeviceAction } from \"@api/device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction\";\nexport { SendCommandInAppDeviceAction } from \"@api/device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction\";\nexport type {\n WaitForAppAndVersionDAError,\n WaitForAppAndVersionDAInput,\n WaitForAppAndVersionDAIntermediateValue,\n WaitForAppAndVersionDAOutput,\n WaitForAppAndVersionDARequiredInteraction,\n WaitForAppAndVersionDAState,\n} from \"@api/device-action/os/WaitForAppAndVersion/types\";\nexport { WaitForAppAndVersionDeviceAction } from \"@api/device-action/os/WaitForAppAndVersion/WaitForAppAndVersionDeviceAction\";\nexport {\n GetApplicationsMetadataTaskError,\n InvalidGetFirmwareMetadataResponseError,\n} from \"@api/device-action/task/Errors\";\nexport {\n type DeviceActionStateMachine,\n XStateDeviceAction,\n} from \"@api/device-action/xstate-utils/XStateDeviceAction\";\nexport { StaticDeviceModelDataSource } from \"@api/device-model/data/StaticDeviceModelDataSource\";\nexport { BleDeviceInfos } from \"@api/device-model/model/BleDeviceInfos\";\nexport { TransportDeviceModel } from \"@api/device-model/model/DeviceModel\";\nexport { ApduResponse } from \"@api/device-session/ApduResponse\";\nexport * from \"@api/device-session/data/FramerConst\";\nexport {\n type DeviceSessionState,\n DeviceSessionStateType,\n} from \"@api/device-session/DeviceSessionState\";\nexport {\n DmkResultFactory,\n DmkResultStatus,\n isSuccessDmkResult,\n} from \"@api/model/DmkResult\";\nexport { GenuineCheckDeviceAction } from \"@api/secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction\";\nexport { InstallAppDeviceAction } from \"@api/secure-channel/device-action/InstallApp/InstallAppDeviceAction\";\nexport { ListInstalledAppsDeviceAction } from \"@api/secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction\";\nexport type { InstalledApp } from \"@api/secure-channel/device-action/ListInstalledApps/types\";\nexport { UninstallAppDeviceAction } from \"@api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction\";\nexport { ConnectToSecureChannelTask } from \"@api/secure-channel/task/ConnectToSecureChannelTask\";\nexport { SecureChannelEventType } from \"@api/secure-channel/task/types\";\nexport { SecureChannelError } from \"@internal/secure-channel/model/Errors\";\n// TODO: remove from exported\nexport { defaultApduReceiverServiceStubBuilder } from \"@api/device-session/service/DefaultApduReceiverService.stub\";\nexport { defaultApduSenderServiceStubBuilder } from \"@api/device-session/service/DefaultApduSenderService.stub\";\nexport { FramerUtils } from \"@api/device-session/utils/FramerUtils\";\nexport { DeviceManagementKit } from \"@api/DeviceManagementKit\";\nexport { DeviceManagementKitBuilder } from \"@api/DeviceManagementKitBuilder\";\nexport * from \"@api/Error\";\nexport {\n noopLogger,\n noopLoggerFactory,\n} from \"@api/logger-publisher/utils/noopLoggerFactory\";\nexport { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nexport { ConsoleLogger } from \"@api/logger-subscriber/service/ConsoleLogger\";\nexport { DefaultLogTagFormatter } from \"@api/logger-subscriber/service/DefaultLogTagFormatter\";\nexport { type LogTagFormatter } from \"@api/logger-subscriber/service/LogTagFormatter\";\nexport { WebLogsExporterLogger } from \"@api/logger-subscriber/service/WebLogsExporterLogger\";\nexport {\n DmkNetworkClient,\n type DmkNetworkClientOptions,\n type DmkNetworkResponse,\n type DmkQueryParams,\n type DmkQueryParamValue,\n type DmkRequestConfig,\n type DmkResponseType,\n} from \"@api/network/DmkNetworkClient\";\nexport { DmkNetworkClientError } from \"@api/network/DmkNetworkClientError\";\nexport { ConnectedDevice } from \"@api/transport/model/ConnectedDevice\";\nexport {\n DeviceConnectionStateMachine,\n type DeviceConnectionStateMachineParams,\n} from \"@api/transport/model/DeviceConnectionStateMachine\";\nexport * from \"@api/transport/model/Errors\";\nexport { TransportConnectedDevice } from \"@api/transport/model/TransportConnectedDevice\";\nexport { connectedDeviceStubBuilder } from \"@api/transport/model/TransportConnectedDevice.stub\";\nexport * from \"@api/types\";\nexport { formatApduReceivedLog, formatApduSentLog } from \"@api/utils/apduLogs\";\nexport { ApplicationChecker } from \"@api/utils/ApplicationChecker\";\nexport {\n type AppConfig,\n type ApplicationResolver,\n type ResolvedApp,\n} from \"@api/utils/ApplicationResolver\";\nexport { isDashboardName } from \"@api/utils/AppName\";\nexport {\n base64StringToBuffer,\n bufferToBase64String,\n isBase64String,\n} from \"@api/utils/Base64String\";\nexport {\n bufferToHexaString,\n hexaStringToBuffer,\n isHexaString,\n} from \"@api/utils/HexaString\";\n"],
|
|
5
|
+
"mappings": "AAEA,OAAS,QAAAA,MAAY,uBACrB,OAAS,oBAAAC,EAAkB,eAAAC,MAAmB,8BAC9C,OAAS,cAAAC,MAAkB,6BAC3B,WAAc,kCACd,OAAS,oBAAAC,MAAwB,mCACjC,OAAS,mBAAAC,MAAuB,kCAEhC,OACE,8BAAAC,EACA,0BAAAC,MACK,sBACP,OACE,wBAAAC,EACA,uBAAAC,EACA,0BAAAC,MACK,mCACP,OAAS,mBAAAC,MAAuB,kCAChC,OACE,6BAAAC,EAEA,kCAAAC,MAGK,4CACP,OACE,2BAAAC,MAEK,0CACP,OACE,iCAAAC,EACA,sCAAAC,MAIK,gDACP,OACE,qBAAAC,EAEA,2BAAAC,MAEK,0CACP,OACE,uBAAAC,MAGK,sCACP,OAEE,mBAAAC,MAGK,kCACP,OACE,2BAAAC,EAEA,gCAAAC,MAIK,0CACP,OAEE,0BAAAC,MAEK,yCACP,OAEE,kBAAAC,MACK,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vC,OAAS,sBAAAC,OAA0B,wCAEnC,OAAS,yCAAAC,OAA6C,8DACtD,OAAS,uCAAAC,OAA2C,4DACpD,OAAS,eAAAC,OAAmB,wCAC5B,OAAS,uBAAAC,OAA2B,2BACpC,OAAS,8BAAAC,OAAkC,kCAC3C,WAAc,aACd,OACE,cAAAC,GACA,qBAAAC,OACK,gDACP,OAAS,YAAAC,OAAgB,wCACzB,OAAS,iBAAAC,OAAqB,+CAC9B,OAAS,0BAAAC,OAA8B,wDAEvC,OAAS,yBAAAC,OAA6B,uDACtC,OACE,oBAAAC,OAOK,gCACP,OAAS,yBAAAC,OAA6B,qCACtC,OAAS,mBAAAC,OAAuB,uCAChC,OACE,gCAAAC,OAEK,oDACP,WAAc,8BACd,OAAS,4BAAAC,OAAgC,gDACzC,OAAS,8BAAAC,OAAkC,qDAC3C,WAAc,aACd,OAAS,yBAAAC,GAAuB,qBAAAC,OAAyB,sBACzD,OAAS,sBAAAC,OAA0B,gCAMnC,OAAS,mBAAAC,OAAuB,qBAChC,OACE,wBAAAC,GACA,wBAAAC,GACA,kBAAAC,OACK,0BACP,OACE,sBAAAC,GACA,sBAAAC,GACA,gBAAAC,OACK",
|
|
6
|
+
"names": ["Apdu", "APDU_MAX_PAYLOAD", "ApduBuilder", "ApduParser", "ByteArrayBuilder", "ByteArrayParser", "InvalidResponseFormatError", "InvalidStatusWordError", "CommandResultFactory", "CommandResultStatus", "isSuccessCommandResult", "CloseAppCommand", "DeleteLanguagePackCommand", "DeleteLanguagePackCommandError", "GetAppAndVersionCommand", "GetBackgroundImageSizeCommand", "GetBackgroundImageSizeCommandError", "BatteryStatusType", "GetBatteryStatusCommand", "GetOsVersionCommand", "ListAppsCommand", "ListLanguagePackCommand", "ListLanguagePackCommandError", "LoadCertificateCommand", "OpenAppCommand", "isCommandErrorCode", "CommandUtils", "GLOBAL_ERRORS", "GlobalCommandError", "GlobalCommandErrorHandler", "DeviceModel", "DeviceModelId", "LEDGER_VENDOR_ID", "DeviceStatus", "OnboardingState", "SeedWordCount", "DeviceActionStatus", "UserInteractionRequired", "CallTaskInAppDeviceAction", "DEFAULT_UNLOCK_TIMEOUT_MS", "AppAlreadyInstalledDAError", "DeleteLanguagePackDAError", "DeviceLockedError", "DeviceNotOnboardedError", "OutOfMemoryDAError", "RefusedByUserDAError", "UnknownDAError", "UnsupportedFirmwareDAError", "GetDeviceMetadataDeviceAction", "GetDeviceStatusDeviceAction", "GoToDashboardDeviceAction", "InstallLanguagePackageDeviceAction", "InstallOrUpdateAppsDeviceAction", "ListAppsDeviceAction", "ListAppsWithMetadataDeviceAction", "OpenAppDeviceAction", "OpenAppWithDependenciesDeviceAction", "SendCommandInAppDeviceAction", "WaitForAppAndVersionDeviceAction", "GetApplicationsMetadataTaskError", "InvalidGetFirmwareMetadataResponseError", "XStateDeviceAction", "StaticDeviceModelDataSource", "BleDeviceInfos", "TransportDeviceModel", "ApduResponse", "DeviceSessionStateType", "DmkResultFactory", "DmkResultStatus", "isSuccessDmkResult", "GenuineCheckDeviceAction", "InstallAppDeviceAction", "ListInstalledAppsDeviceAction", "UninstallAppDeviceAction", "ConnectToSecureChannelTask", "SecureChannelEventType", "SecureChannelError", "defaultApduReceiverServiceStubBuilder", "defaultApduSenderServiceStubBuilder", "FramerUtils", "DeviceManagementKit", "DeviceManagementKitBuilder", "noopLogger", "noopLoggerFactory", "LogLevel", "ConsoleLogger", "DefaultLogTagFormatter", "WebLogsExporterLogger", "DmkNetworkClient", "DmkNetworkClientError", "ConnectedDevice", "DeviceConnectionStateMachine", "TransportConnectedDevice", "connectedDeviceStubBuilder", "formatApduReceivedLog", "formatApduSentLog", "ApplicationChecker", "isDashboardName", "base64StringToBuffer", "bufferToBase64String", "isBase64String", "bufferToHexaString", "hexaStringToBuffer", "isHexaString"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{gt as
|
|
1
|
+
import{coerce as o,gt as p,gte as r,valid as n}from"semver";class a{isCompatible;version;modelId;appName;constructor(e,i,t){this.modelId=e.deviceModelId,this.appName="currentApp"in e?e.currentApp.name:void 0;const s=t.resolve(e,i);this.isCompatible=s.isCompatible,this.version=s.version}withMinVersionInclusive(e){return r(this.version,e)||(this.isCompatible=!1),this}withMinVersionExclusive(e){return p(this.version,e)||(this.isCompatible=!1),this}withMinVersionInclusiveAcceptingPrerelease(e){const i=n(o(this.version)),t=n(o(e));return(i===null||t===null||!r(i,t))&&(this.isCompatible=!1),this}excludeDeviceModel(e){return this.modelId===e&&(this.isCompatible=!1),this}excludeDeviceModels(...e){for(const i of e)this.excludeDeviceModel(i);return this}excludeApp(e){return this.appName===e&&(this.isCompatible=!1),this}excludeApps(...e){for(const i of e)this.excludeApp(i);return this}check(){return this.isCompatible}}export{a as ApplicationChecker};
|
|
2
2
|
//# sourceMappingURL=ApplicationChecker.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/api/utils/ApplicationChecker.ts"],
|
|
4
|
-
"sourcesContent": ["import { gt, gte } from \"semver\";\n\nimport { type DeviceModelId } from \"@api/device/DeviceModel\";\nimport { type DeviceSessionState } from \"@api/device-session/DeviceSessionState\";\n\nimport {\n type AppConfig,\n type ApplicationResolver,\n} from \"./ApplicationResolver\";\n\nexport class ApplicationChecker {\n private isCompatible: boolean;\n private version: string;\n private modelId: DeviceModelId;\n private readonly appName: string | undefined;\n\n constructor(\n deviceState: DeviceSessionState,\n appConfig: AppConfig,\n resolver: ApplicationResolver,\n ) {\n this.modelId = deviceState.deviceModelId;\n this.appName =\n \"currentApp\" in deviceState ? deviceState.currentApp.name : undefined;\n const resolved = resolver.resolve(deviceState, appConfig);\n this.isCompatible = resolved.isCompatible;\n this.version = resolved.version;\n }\n\n withMinVersionInclusive(version: string): ApplicationChecker {\n if (!gte(this.version, version)) this.isCompatible = false;\n return this;\n }\n\n withMinVersionExclusive(version: string): ApplicationChecker {\n if (!gt(this.version, version)) this.isCompatible = false;\n return this;\n }\n\n excludeDeviceModel(modelId: DeviceModelId): ApplicationChecker {\n if (this.modelId === modelId) this.isCompatible = false;\n return this;\n }\n\n excludeDeviceModels(...modelIds: DeviceModelId[]): ApplicationChecker {\n for (const id of modelIds) this.excludeDeviceModel(id);\n return this;\n }\n\n excludeApp(name: string): ApplicationChecker {\n if (this.appName === name) this.isCompatible = false;\n return this;\n }\n\n excludeApps(...names: string[]): ApplicationChecker {\n for (const name of names) this.excludeApp(name);\n return this;\n }\n\n check(): boolean {\n return this.isCompatible;\n }\n}\n"],
|
|
5
|
-
"mappings": "AAAA,OAAS,
|
|
6
|
-
"names": ["gt", "gte", "ApplicationChecker", "deviceState", "appConfig", "resolver", "resolved", "version", "modelId", "modelIds", "id", "name", "names"]
|
|
4
|
+
"sourcesContent": ["import { coerce, gt, gte, valid } from \"semver\";\n\nimport { type DeviceModelId } from \"@api/device/DeviceModel\";\nimport { type DeviceSessionState } from \"@api/device-session/DeviceSessionState\";\n\nimport {\n type AppConfig,\n type ApplicationResolver,\n} from \"./ApplicationResolver\";\n\nexport class ApplicationChecker {\n private isCompatible: boolean;\n private version: string;\n private modelId: DeviceModelId;\n private readonly appName: string | undefined;\n\n constructor(\n deviceState: DeviceSessionState,\n appConfig: AppConfig,\n resolver: ApplicationResolver,\n ) {\n this.modelId = deviceState.deviceModelId;\n this.appName =\n \"currentApp\" in deviceState ? deviceState.currentApp.name : undefined;\n const resolved = resolver.resolve(deviceState, appConfig);\n this.isCompatible = resolved.isCompatible;\n this.version = resolved.version;\n }\n\n withMinVersionInclusive(version: string): ApplicationChecker {\n if (!gte(this.version, version)) this.isCompatible = false;\n return this;\n }\n\n withMinVersionExclusive(version: string): ApplicationChecker {\n if (!gt(this.version, version)) this.isCompatible = false;\n return this;\n }\n\n /**\n * Like {@link withMinVersionInclusive}, but compares only the release core:\n * prerelease and build tags are stripped from both sides first, so an app\n * reporting `1.23.0-rc2` or `1.23.0-dev` satisfies a `1.23.0` minimum.\n *\n * This accepts a prerelease *of* the minimum, not any prerelease: the core\n * still has to clear the bar, so `1.22.9-rc5` fails a `1.23.0` minimum just\n * as `1.22.9` does. A version neither side can parse fails the check, so an\n * unknown version never passes.\n *\n * Use this when a feature lands in a given release and devices running its\n * release candidates must not be locked out \u2014 device versions reach the SDK\n * verbatim, tags included (`GET APP AND VERSION` yields strings such as\n * `1.4.0-rc2`). Prefer the strict {@link withMinVersionInclusive} when a\n * prerelease genuinely cannot be trusted to carry the feature.\n */\n withMinVersionInclusiveAcceptingPrerelease(\n version: string,\n ): ApplicationChecker {\n const actual = valid(coerce(this.version));\n const minimum = valid(coerce(version));\n if (actual === null || minimum === null || !gte(actual, minimum)) {\n this.isCompatible = false;\n }\n return this;\n }\n\n excludeDeviceModel(modelId: DeviceModelId): ApplicationChecker {\n if (this.modelId === modelId) this.isCompatible = false;\n return this;\n }\n\n excludeDeviceModels(...modelIds: DeviceModelId[]): ApplicationChecker {\n for (const id of modelIds) this.excludeDeviceModel(id);\n return this;\n }\n\n excludeApp(name: string): ApplicationChecker {\n if (this.appName === name) this.isCompatible = false;\n return this;\n }\n\n excludeApps(...names: string[]): ApplicationChecker {\n for (const name of names) this.excludeApp(name);\n return this;\n }\n\n check(): boolean {\n return this.isCompatible;\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,UAAAA,EAAQ,MAAAC,EAAI,OAAAC,EAAK,SAAAC,MAAa,SAUhC,MAAMC,CAAmB,CACtB,aACA,QACA,QACS,QAEjB,YACEC,EACAC,EACAC,EACA,CACA,KAAK,QAAUF,EAAY,cAC3B,KAAK,QACH,eAAgBA,EAAcA,EAAY,WAAW,KAAO,OAC9D,MAAMG,EAAWD,EAAS,QAAQF,EAAaC,CAAS,EACxD,KAAK,aAAeE,EAAS,aAC7B,KAAK,QAAUA,EAAS,OAC1B,CAEA,wBAAwBC,EAAqC,CAC3D,OAAKP,EAAI,KAAK,QAASO,CAAO,IAAG,KAAK,aAAe,IAC9C,IACT,CAEA,wBAAwBA,EAAqC,CAC3D,OAAKR,EAAG,KAAK,QAASQ,CAAO,IAAG,KAAK,aAAe,IAC7C,IACT,CAkBA,2CACEA,EACoB,CACpB,MAAMC,EAASP,EAAMH,EAAO,KAAK,OAAO,CAAC,EACnCW,EAAUR,EAAMH,EAAOS,CAAO,CAAC,EACrC,OAAIC,IAAW,MAAQC,IAAY,MAAQ,CAACT,EAAIQ,EAAQC,CAAO,KAC7D,KAAK,aAAe,IAEf,IACT,CAEA,mBAAmBC,EAA4C,CAC7D,OAAI,KAAK,UAAYA,IAAS,KAAK,aAAe,IAC3C,IACT,CAEA,uBAAuBC,EAA+C,CACpE,UAAWC,KAAMD,EAAU,KAAK,mBAAmBC,CAAE,EACrD,OAAO,IACT,CAEA,WAAWC,EAAkC,CAC3C,OAAI,KAAK,UAAYA,IAAM,KAAK,aAAe,IACxC,IACT,CAEA,eAAeC,EAAqC,CAClD,UAAWD,KAAQC,EAAO,KAAK,WAAWD,CAAI,EAC9C,OAAO,IACT,CAEA,OAAiB,CACf,OAAO,KAAK,YACd,CACF",
|
|
6
|
+
"names": ["coerce", "gt", "gte", "valid", "ApplicationChecker", "deviceState", "appConfig", "resolver", "resolved", "version", "actual", "minimum", "modelId", "modelIds", "id", "name", "names"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{DeviceModelId as
|
|
1
|
+
import{DeviceModelId as c}from"../device/DeviceModel";import{DeviceStatus as n}from"../device/DeviceStatus";import{DeviceSessionStateType as l}from"../device-session/DeviceSessionState";import{ApplicationChecker as r}from"./ApplicationChecker";describe("ApplicationChecker",()=>{function i(e=c.FLEX){return{sessionStateType:l.ReadyWithoutSecureChannel,deviceStatus:n.CONNECTED,installedApps:[],currentApp:{name:"TestApp",version:"1.0.0"},deviceModelId:e,isSecureConnectionAllowed:!1}}function s(e){return{resolve:()=>e}}const o={version:"1.0.0"};it("should pass check when resolved as compatible",()=>{const e=s({isCompatible:!0,version:"1.12.0"}),t=new r(i(),o,e).check();expect(t).toStrictEqual(!0)}),it("should reject check when resolved as incompatible",()=>{const e=s({isCompatible:!1,version:"0.0.1"}),t=new r(i(),o,e).check();expect(t).toStrictEqual(!1)}),it("should pass with min version inclusive when version matches",()=>{const e=s({isCompatible:!0,version:"1.12.0"}),t=new r(i(),o,e).withMinVersionInclusive("1.12.0").check();expect(t).toStrictEqual(!0)}),it("should reject with min version inclusive when version is too low",()=>{const e=s({isCompatible:!0,version:"1.11.0"}),t=new r(i(),o,e).withMinVersionInclusive("1.12.0").check();expect(t).toStrictEqual(!1)}),it("should pass with min version exclusive when version is greater",()=>{const e=s({isCompatible:!0,version:"1.13.0"}),t=new r(i(),o,e).withMinVersionExclusive("1.12.0").check();expect(t).toStrictEqual(!0)}),it("should reject with min version exclusive when version is equal",()=>{const e=s({isCompatible:!0,version:"1.12.0"}),t=new r(i(),o,e).withMinVersionExclusive("1.12.0").check();expect(t).toStrictEqual(!1)}),it("should pass when device model is not excluded",()=>{const e=s({isCompatible:!0,version:"1.12.0"}),t=new r(i(c.FLEX),o,e).excludeDeviceModel(c.NANO_S).check();expect(t).toStrictEqual(!0)}),it("should reject when device model is excluded",()=>{const e=s({isCompatible:!0,version:"1.12.0"}),t=new r(i(c.FLEX),o,e).excludeDeviceModel(c.FLEX).check();expect(t).toStrictEqual(!1)}),it("should pass with chained conditions when all are met",()=>{const e=s({isCompatible:!0,version:"1.12.0"}),t=new r(i(),o,e).withMinVersionInclusive("1.11.0").excludeDeviceModel(c.NANO_S).check();expect(t).toStrictEqual(!0)}),it("should reject with chained conditions when one fails",()=>{const e=s({isCompatible:!0,version:"1.10.0"}),t=new r(i(),o,e).withMinVersionInclusive("1.11.0").excludeDeviceModel(c.NANO_S).check();expect(t).toStrictEqual(!1)}),describe("withMinVersionInclusiveAcceptingPrerelease",()=>{it("should accept a release candidate of the minimum",()=>{const e=s({isCompatible:!0,version:"1.23.0-rc2"}),t=new r(i(),o,e).withMinVersionInclusiveAcceptingPrerelease("1.23.0").check();expect(t).toStrictEqual(!0)}),it("should accept a dev build of the minimum",()=>{const e=s({isCompatible:!0,version:"1.23.0-dev"}),t=new r(i(),o,e).withMinVersionInclusiveAcceptingPrerelease("1.23.0").check();expect(t).toStrictEqual(!0)}),it("should accept a plain version equal to the minimum",()=>{const e=s({isCompatible:!0,version:"1.23.0"}),t=new r(i(),o,e).withMinVersionInclusiveAcceptingPrerelease("1.23.0").check();expect(t).toStrictEqual(!0)}),it("should accept a plain version above the minimum",()=>{const e=s({isCompatible:!0,version:"1.24.0"}),t=new r(i(),o,e).withMinVersionInclusiveAcceptingPrerelease("1.23.0").check();expect(t).toStrictEqual(!0)}),it("should reject a plain version below the minimum",()=>{const e=s({isCompatible:!0,version:"1.22.9"}),t=new r(i(),o,e).withMinVersionInclusiveAcceptingPrerelease("1.23.0").check();expect(t).toStrictEqual(!1)}),it("should reject a prerelease whose release core is below the minimum",()=>{const e=s({isCompatible:!0,version:"1.22.9-rc5"}),t=new r(i(),o,e).withMinVersionInclusiveAcceptingPrerelease("1.23.0").check();expect(t).toStrictEqual(!1)}),it("should reject a version that cannot be parsed",()=>{const e=s({isCompatible:!0,version:"not-a-version"}),t=new r(i(),o,e).withMinVersionInclusiveAcceptingPrerelease("1.23.0").check();expect(t).toStrictEqual(!1)}),it("should reject a minimum that cannot be parsed",()=>{const e=s({isCompatible:!0,version:"1.23.0"}),t=new r(i(),o,e).withMinVersionInclusiveAcceptingPrerelease("not-a-version").check();expect(t).toStrictEqual(!1)}),it("should not override incompatible resolution",()=>{const e=s({isCompatible:!1,version:"1.23.0-rc2"}),t=new r(i(),o,e).withMinVersionInclusiveAcceptingPrerelease("1.23.0").check();expect(t).toStrictEqual(!1)})}),it("should not override incompatible resolution even if constraints pass",()=>{const e=s({isCompatible:!1,version:"1.15.0"}),t=new r(i(),o,e).withMinVersionInclusive("1.12.0").check();expect(t).toStrictEqual(!1)})});
|
|
2
2
|
//# sourceMappingURL=ApplicationChecker.test.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/api/utils/ApplicationChecker.test.ts"],
|
|
4
|
-
"sourcesContent": ["import { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { DeviceStatus } from \"@api/device/DeviceStatus\";\nimport { DeviceSessionStateType } from \"@api/device-session/DeviceSessionState\";\n\nimport { ApplicationChecker } from \"./ApplicationChecker\";\nimport {\n type ApplicationResolver,\n type ResolvedApp,\n} from \"./ApplicationResolver\";\n\ndescribe(\"ApplicationChecker\", () => {\n function createReadyState(modelId: DeviceModelId = DeviceModelId.FLEX) {\n return {\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [],\n currentApp: { name: \"TestApp\", version: \"1.0.0\" },\n deviceModelId: modelId,\n isSecureConnectionAllowed: false,\n };\n }\n\n function createMockResolver(resolved: ResolvedApp): ApplicationResolver {\n return {\n resolve: () => resolved,\n };\n }\n\n const appConfig = { version: \"1.0.0\" };\n\n it(\"should pass check when resolved as compatible\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.12.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n ).check();\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject check when resolved as incompatible\", () => {\n const resolver = createMockResolver({\n isCompatible: false,\n version: \"0.0.1\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n ).check();\n expect(result).toStrictEqual(false);\n });\n\n it(\"should pass with min version inclusive when version matches\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.12.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusive(\"1.12.0\")\n .check();\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject with min version inclusive when version is too low\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.11.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusive(\"1.12.0\")\n .check();\n expect(result).toStrictEqual(false);\n });\n\n it(\"should pass with min version exclusive when version is greater\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.13.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionExclusive(\"1.12.0\")\n .check();\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject with min version exclusive when version is equal\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.12.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionExclusive(\"1.12.0\")\n .check();\n expect(result).toStrictEqual(false);\n });\n\n it(\"should pass when device model is not excluded\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.12.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(DeviceModelId.FLEX),\n appConfig,\n resolver,\n )\n .excludeDeviceModel(DeviceModelId.NANO_S)\n .check();\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject when device model is excluded\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.12.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(DeviceModelId.FLEX),\n appConfig,\n resolver,\n )\n .excludeDeviceModel(DeviceModelId.FLEX)\n .check();\n expect(result).toStrictEqual(false);\n });\n\n it(\"should pass with chained conditions when all are met\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.12.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusive(\"1.11.0\")\n .excludeDeviceModel(DeviceModelId.NANO_S)\n .check();\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject with chained conditions when one fails\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.10.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusive(\"1.11.0\")\n .excludeDeviceModel(DeviceModelId.NANO_S)\n .check();\n expect(result).toStrictEqual(false);\n });\n\n it(\"should not override incompatible resolution even if constraints pass\", () => {\n const resolver = createMockResolver({\n isCompatible: false,\n version: \"1.15.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusive(\"1.12.0\")\n .check();\n expect(result).toStrictEqual(false);\n });\n});\n"],
|
|
5
|
-
"mappings": "AAAA,OAAS,iBAAAA,MAAqB,0BAC9B,OAAS,gBAAAC,MAAoB,2BAC7B,OAAS,0BAAAC,MAA8B,yCAEvC,OAAS,sBAAAC,MAA0B,uBAMnC,SAAS,qBAAsB,IAAM,CACnC,SAASC,EAAiBC,EAAyBL,EAAc,KAAM,CACrE,MAAO,CACL,iBAAkBE,EAAuB,0BACzC,aAAcD,EAAa,UAC3B,cAAe,CAAC,EAChB,WAAY,CAAE,KAAM,UAAW,QAAS,OAAQ,EAChD,cAAeI,EACf,0BAA2B,EAC7B,CACF,CAEA,SAASC,EAAmBC,EAA4C,CACtE,MAAO,CACL,QAAS,IAAMA,CACjB,CACF,CAEA,MAAMC,EAAY,CAAE,QAAS,OAAQ,EAErC,GAAG,gDAAiD,IAAM,CACxD,MAAMC,EAAWH,EAAmB,CAClC,aAAc,GACd,QAAS,QACX,CAAC,EACKI,EAAS,IAAIP,EACjBC,EAAiB,EACjBI,EACAC,CACF,EAAE,MAAM,EACR,OAAOC,CAAM,EAAE,cAAc,EAAI,CACnC,CAAC,EAED,GAAG,oDAAqD,IAAM,CAC5D,MAAMD,EAAWH,EAAmB,CAClC,aAAc,GACd,QAAS,OACX,CAAC,EACKI,EAAS,IAAIP,EACjBC,EAAiB,EACjBI,EACAC,CACF,EAAE,MAAM,EACR,OAAOC,CAAM,EAAE,cAAc,EAAK,CACpC,CAAC,EAED,GAAG,8DAA+D,IAAM,CACtE,MAAMD,EAAWH,EAAmB,CAClC,aAAc,GACd,QAAS,QACX,CA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OAAOU,CAAM,EAAE,cAAc,EAAK,CACpC,CAAC,EAED,GAAG,uDAAwD,IAAM,CAC/D,MAAMD,EAAWH,EAAmB,CAClC,aAAc,GACd,QAAS,QACX,CAAC,EACKI,EAAS,IAAIP,EACjBC,EAAiB,EACjBI,EACAC,CACF,EACG,wBAAwB,QAAQ,EAChC,mBAAmBT,EAAc,MAAM,EACvC,MAAM,EACT,OAAOU,CAAM,EAAE,cAAc,EAAI,CACnC,CAAC,EAED,GAAG,uDAAwD,IAAM,CAC/D,MAAMD,EAAWH,EAAmB,CAClC,aAAc,GACd,QAAS,QACX,CAAC,EACKI,EAAS,IAAIP,EACjBC,EAAiB,EACjBI,EACAC,CACF,EACG,wBAAwB,QAAQ,EAChC,mBAAmBT,EAAc,MAAM,EACvC,MAAM,EACT,OAAOU,CAAM,EAAE,cAAc,EAAK,CACpC,CAAC,EAED,GAAG,uEAAwE,IAAM,CAC/E,MAAMD,EAAWH,EAAmB,CAClC,aAAc,GACd,QAAS,QACX,CAAC,EACKI,EAAS,IAAIP,EACjBC,EAAiB,EACjBI,EACAC,CACF,EACG,wBAAwB,QAAQ,EAChC,MAAM,EACT,OAAOC,CAAM,EAAE,cAAc,EAAK,CACpC,CAAC,CACH,CAAC",
|
|
4
|
+
"sourcesContent": ["import { DeviceModelId } from \"@api/device/DeviceModel\";\nimport { DeviceStatus } from \"@api/device/DeviceStatus\";\nimport { DeviceSessionStateType } from \"@api/device-session/DeviceSessionState\";\n\nimport { ApplicationChecker } from \"./ApplicationChecker\";\nimport {\n type ApplicationResolver,\n type ResolvedApp,\n} from \"./ApplicationResolver\";\n\ndescribe(\"ApplicationChecker\", () => {\n function createReadyState(modelId: DeviceModelId = DeviceModelId.FLEX) {\n return {\n sessionStateType: DeviceSessionStateType.ReadyWithoutSecureChannel,\n deviceStatus: DeviceStatus.CONNECTED,\n installedApps: [],\n currentApp: { name: \"TestApp\", version: \"1.0.0\" },\n deviceModelId: modelId,\n isSecureConnectionAllowed: false,\n };\n }\n\n function createMockResolver(resolved: ResolvedApp): ApplicationResolver {\n return {\n resolve: () => resolved,\n };\n }\n\n const appConfig = { version: \"1.0.0\" };\n\n it(\"should pass check when resolved as compatible\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.12.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n ).check();\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject check when resolved as incompatible\", () => {\n const resolver = createMockResolver({\n isCompatible: false,\n version: \"0.0.1\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n ).check();\n expect(result).toStrictEqual(false);\n });\n\n it(\"should pass with min version inclusive when version matches\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.12.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusive(\"1.12.0\")\n .check();\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject with min version inclusive when version is too low\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.11.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusive(\"1.12.0\")\n .check();\n expect(result).toStrictEqual(false);\n });\n\n it(\"should pass with min version exclusive when version is greater\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.13.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionExclusive(\"1.12.0\")\n .check();\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject with min version exclusive when version is equal\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.12.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionExclusive(\"1.12.0\")\n .check();\n expect(result).toStrictEqual(false);\n });\n\n it(\"should pass when device model is not excluded\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.12.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(DeviceModelId.FLEX),\n appConfig,\n resolver,\n )\n .excludeDeviceModel(DeviceModelId.NANO_S)\n .check();\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject when device model is excluded\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.12.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(DeviceModelId.FLEX),\n appConfig,\n resolver,\n )\n .excludeDeviceModel(DeviceModelId.FLEX)\n .check();\n expect(result).toStrictEqual(false);\n });\n\n it(\"should pass with chained conditions when all are met\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.12.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusive(\"1.11.0\")\n .excludeDeviceModel(DeviceModelId.NANO_S)\n .check();\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject with chained conditions when one fails\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.10.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusive(\"1.11.0\")\n .excludeDeviceModel(DeviceModelId.NANO_S)\n .check();\n expect(result).toStrictEqual(false);\n });\n\n describe(\"withMinVersionInclusiveAcceptingPrerelease\", () => {\n it(\"should accept a release candidate of the minimum\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.23.0-rc2\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusiveAcceptingPrerelease(\"1.23.0\")\n .check();\n expect(result).toStrictEqual(true);\n });\n\n it(\"should accept a dev build of the minimum\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.23.0-dev\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusiveAcceptingPrerelease(\"1.23.0\")\n .check();\n expect(result).toStrictEqual(true);\n });\n\n it(\"should accept a plain version equal to the minimum\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.23.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusiveAcceptingPrerelease(\"1.23.0\")\n .check();\n expect(result).toStrictEqual(true);\n });\n\n it(\"should accept a plain version above the minimum\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.24.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusiveAcceptingPrerelease(\"1.23.0\")\n .check();\n expect(result).toStrictEqual(true);\n });\n\n it(\"should reject a plain version below the minimum\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.22.9\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusiveAcceptingPrerelease(\"1.23.0\")\n .check();\n expect(result).toStrictEqual(false);\n });\n\n it(\"should reject a prerelease whose release core is below the minimum\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.22.9-rc5\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusiveAcceptingPrerelease(\"1.23.0\")\n .check();\n expect(result).toStrictEqual(false);\n });\n\n it(\"should reject a version that cannot be parsed\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"not-a-version\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusiveAcceptingPrerelease(\"1.23.0\")\n .check();\n expect(result).toStrictEqual(false);\n });\n\n it(\"should reject a minimum that cannot be parsed\", () => {\n const resolver = createMockResolver({\n isCompatible: true,\n version: \"1.23.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusiveAcceptingPrerelease(\"not-a-version\")\n .check();\n expect(result).toStrictEqual(false);\n });\n\n it(\"should not override incompatible resolution\", () => {\n const resolver = createMockResolver({\n isCompatible: false,\n version: \"1.23.0-rc2\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusiveAcceptingPrerelease(\"1.23.0\")\n .check();\n expect(result).toStrictEqual(false);\n });\n });\n\n it(\"should not override incompatible resolution even if constraints pass\", () => {\n const resolver = createMockResolver({\n isCompatible: false,\n version: \"1.15.0\",\n });\n const result = new ApplicationChecker(\n createReadyState(),\n appConfig,\n resolver,\n )\n .withMinVersionInclusive(\"1.12.0\")\n .check();\n expect(result).toStrictEqual(false);\n });\n});\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,iBAAAA,MAAqB,0BAC9B,OAAS,gBAAAC,MAAoB,2BAC7B,OAAS,0BAAAC,MAA8B,yCAEvC,OAAS,sBAAAC,MAA0B,uBAMnC,SAAS,qBAAsB,IAAM,CACnC,SAASC,EAAiBC,EAAyBL,EAAc,KAAM,CACrE,MAAO,CACL,iBAAkBE,EAAuB,0BACzC,aAAcD,EAAa,UAC3B,cAAe,CAAC,EAChB,WAAY,CAAE,KAAM,UAAW,QAAS,OAAQ,EAChD,cAAeI,EACf,0BAA2B,EAC7B,CACF,CAEA,SAASC,EAAmBC,EAA4C,CACtE,MAAO,CACL,QAAS,IAAMA,CACjB,CACF,CAEA,MAAMC,EAAY,CAAE,QAAS,OAAQ,EAErC,GAAG,gDAAiD,IAAM,CACxD,MAAMC,EAAWH,EAAmB,CAClC,aAAc,GACd,QAAS,QACX,CAAC,EACKI,EAAS,IAAIP,EACjBC,EAAiB,EACjBI,EACAC,CACF,EAAE,MAAM,EACR,OAAOC,CAAM,EAAE,cAAc,EAAI,CACnC,CAAC,EAED,GAAG,oDAAqD,IAAM,CAC5D,MAAMD,EAAWH,EAAmB,CAClC,aAAc,GACd,QAAS,OACX,CAAC,EACKI,EAAS,IAAIP,EACjBC,EAAiB,EACjBI,EACAC,CACF,EAAE,MAAM,EACR,OAAOC,CAAM,EAAE,cAAc,EAAK,CACpC,CAAC,EAED,GAAG,8DAA+D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,YACX,CAAC,EACKI,EAAS,IAAIP,EACjBC,EAAiB,EACjBI,EACAC,CACF,EACG,2CAA2C,QAAQ,EACnD,MAAM,EACT,OAAOC,CAAM,EAAE,cAAc,EAAK,CACpC,CAAC,CACH,CAAC,EAED,GAAG,uEAAwE,IAAM,CAC/E,MAAMD,EAAWH,EAAmB,CAClC,aAAc,GACd,QAAS,QACX,CAAC,EACKI,EAAS,IAAIP,EACjBC,EAAiB,EACjBI,EACAC,CACF,EACG,wBAAwB,QAAQ,EAChC,MAAM,EACT,OAAOC,CAAM,EAAE,cAAc,EAAK,CACpC,CAAC,CACH,CAAC",
|
|
6
6
|
"names": ["DeviceModelId", "DeviceStatus", "DeviceSessionStateType", "ApplicationChecker", "createReadyState", "modelId", "createMockResolver", "resolved", "appConfig", "resolver", "result"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{transportDiTypes as t}from"./internal/transport/di/transportDiTypes";import{makeContainer as e}from"./di";describe("makeContainer",()=>{it("should default mockUrl to the hosted mock server",()=>{const o=e({}).get(t.DmkConfig);expect(o.mockUrl).toBe("https://device-mock-server.aws.ldg-ps-default.ldg-tech.com")})});
|
|
2
|
+
//# sourceMappingURL=di.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/di.test.ts"],
|
|
4
|
+
"sourcesContent": ["import { type DmkConfig } from \"@api/DmkConfig\";\nimport { transportDiTypes } from \"@internal/transport/di/transportDiTypes\";\n\nimport { makeContainer } from \"./di\";\n\ndescribe(\"makeContainer\", () => {\n it(\"should default mockUrl to the hosted mock server\", () => {\n const container = makeContainer({});\n const transportConfig = container.get<DmkConfig>(\n transportDiTypes.DmkConfig,\n );\n\n expect(transportConfig.mockUrl).toBe(\n \"https://device-mock-server.aws.ldg-ps-default.ldg-tech.com\",\n );\n });\n});\n"],
|
|
5
|
+
"mappings": "AACA,OAAS,oBAAAA,MAAwB,0CAEjC,OAAS,iBAAAC,MAAqB,OAE9B,SAAS,gBAAiB,IAAM,CAC9B,GAAG,mDAAoD,IAAM,CAE3D,MAAMC,EADYD,EAAc,CAAC,CAAC,EACA,IAChCD,EAAiB,SACnB,EAEA,OAAOE,EAAgB,OAAO,EAAE,KAC9B,4DACF,CACF,CAAC,CACH,CAAC",
|
|
6
|
+
"names": ["transportDiTypes", "makeContainer", "transportConfig"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var d=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var y=(n,e,r,t)=>{for(var i=t>1?void 0:t?A(e,r):e,a=n.length-1,p;a>=0;a--)(p=n[a])&&(i=(t?p(e,r,i):p(i))||i);return t&&i&&d(e,r,i),i},u=(n,e)=>(r,t)=>e(r,t,n);import{inject as _,injectable as w}from"inversify";import{EitherAsync as o,Just as D,Nothing as F}from"purify-ts";import{DmkNetworkClient as E}from"../../../api/network/DmkNetworkClient";import{DmkNetworkClientError as L}from"../../../api/network/DmkNetworkClientError";import{managerApiTypes as b}from"../../manager-api/di/managerApiTypes";import{AppType as m}from"../../manager-api/model/Application";import{DEFAULT_PROVIDER as V}from"../../manager-api/model/Const";import{DEFAULT_FIRMWARE_DISTRIBUTION_SALT as P}from"../../manager-api/model/Const";import{HttpFetchApiError as f}from"../../manager-api/model/Errors";import{AppTypeDto as c}from"./ManagerApiDto";const s=n=>n instanceof L&&n.cause!==void 0?new f(n.cause):new f(n);let l=class{http;_provider=V;_firmwareDistributionSalt=P;constructor({managerApiUrl:e,provider:r,firmwareDistributionSalt:t}){this.http=new E({baseUrl:e}),this._provider=r,this._firmwareDistributionSalt=t}setProvider(e){this._provider===e||e<1||(this._provider=e)}getProvider(){return this._provider}getAppList(e){const{targetId:r,firmwareVersionName:t}=e;return o(()=>this.http.get("/v2/apps/by-target",{params:{target_id:r,provider:this._provider,firmware_version_name:t}})).chain(i=>this.mapApplicationDtoToApplication(i)).mapLeft(s)}getMcuList(){return o(()=>this.http.get("/mcu_versions")).chain(e=>this.mapMcuDtoToMcu(e)).mapLeft(s)}getDeviceVersion(e){const{targetId:r}=e;return o(()=>this.http.get("/get_device_version",{params:{target_id:r,provider:this._provider}})).chain(t=>this.mapDeviceVersionDto(t)).mapLeft(s)}getFirmwareVersion(e){const{deviceId:r,version:t}=e;return o(()=>this.http.get("/get_firmware_version",{params:{device_version:r,version_name:t,provider:this._provider}})).chain(i=>this.mapFinalFirmwareDto(i)).mapLeft(s)}getFirmwareVersionById(e){return o(()=>this.http.get(`/firmware_final_versions/${e}`)).chain(r=>this.mapFinalFirmwareDto(r)).mapLeft(s)}getOsuFirmwareVersion(e){const{deviceId:r,version:t}=e;return o(()=>this.http.get("/get_osu_version",{params:{device_version:r,version_name:t,provider:this._provider}})).chain(i=>this.mapOsuFirmwareDto(i)).mapLeft(s)}getLatestFirmwareVersion(e){const
|
|
1
|
+
var d=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var y=(n,e,r,t)=>{for(var i=t>1?void 0:t?A(e,r):e,a=n.length-1,p;a>=0;a--)(p=n[a])&&(i=(t?p(e,r,i):p(i))||i);return t&&i&&d(e,r,i),i},u=(n,e)=>(r,t)=>e(r,t,n);import{inject as _,injectable as w}from"inversify";import{EitherAsync as o,Just as D,Nothing as F}from"purify-ts";import{DmkNetworkClient as E}from"../../../api/network/DmkNetworkClient";import{DmkNetworkClientError as L}from"../../../api/network/DmkNetworkClientError";import{managerApiTypes as b}from"../../manager-api/di/managerApiTypes";import{AppType as m}from"../../manager-api/model/Application";import{DEFAULT_PROVIDER as V}from"../../manager-api/model/Const";import{DEFAULT_FIRMWARE_DISTRIBUTION_SALT as P}from"../../manager-api/model/Const";import{HttpFetchApiError as f}from"../../manager-api/model/Errors";import{AppTypeDto as c}from"./ManagerApiDto";const s=n=>n instanceof L&&n.cause!==void 0?new f(n.cause):new f(n);let l=class{http;_provider=V;_firmwareDistributionSalt=P;constructor({managerApiUrl:e,provider:r,firmwareDistributionSalt:t}){this.http=new E({baseUrl:e}),this._provider=r,this._firmwareDistributionSalt=t}setProvider(e){this._provider===e||e<1||(this._provider=e)}getProvider(){return this._provider}getAppList(e){const{targetId:r,firmwareVersionName:t}=e;return o(()=>this.http.get("/v2/apps/by-target",{params:{target_id:r,provider:this._provider,firmware_version_name:t}})).chain(i=>this.mapApplicationDtoToApplication(i)).mapLeft(s)}getMcuList(){return o(()=>this.http.get("/mcu_versions")).chain(e=>this.mapMcuDtoToMcu(e)).mapLeft(s)}getDeviceVersion(e){const{targetId:r}=e;return o(()=>this.http.get("/get_device_version",{params:{target_id:r,provider:this._provider}})).chain(t=>this.mapDeviceVersionDto(t)).mapLeft(s)}getFirmwareVersion(e){const{deviceId:r,version:t}=e;return o(()=>this.http.get("/get_firmware_version",{params:{device_version:r,version_name:t,provider:this._provider}})).chain(i=>this.mapFinalFirmwareDto(i)).mapLeft(s)}getFirmwareVersionById(e){return o(()=>this.http.get(`/firmware_final_versions/${e}`)).chain(r=>this.mapFinalFirmwareDto(r)).mapLeft(s)}getOsuFirmwareVersion(e){const{deviceId:r,version:t}=e;return o(()=>this.http.get("/get_osu_version",{params:{device_version:r,version_name:t,provider:this._provider}})).chain(i=>this.mapOsuFirmwareDto(i)).mapLeft(s)}getLatestFirmwareVersion(e){const{currentFinalFirmwareId:r,deviceId:t}=e;return o(()=>this.http.get("/get_latest_firmware",{params:{current_se_firmware_final_version:r,device_version:t,provider:this._provider,salt:this._firmwareDistributionSalt}})).chain(i=>this.mapLatestFirmwareDto(i)).mapLeft(s)}getAppsByHash(e){const{hashes:r}=e;return o(()=>this.http.post("/v2/apps/hash",r)).chain(t=>this.mapNullableApplicationDtoToApplication(t)).mapLeft(s)}getLanguagePackages(e){const{deviceId:r,currentFinalFirmwareId:t}=e;return o(()=>this.http.get("/language-packages",{params:{device_version:r,current_se_firmware_final_version:t}})).chain(i=>this.mapLanguagesDtoToLanguages(i)).mapLeft(s)}mapAppTypeDtoToAppType(e){if(e===null)return null;switch(e){case c.currency:return m.currency;case c.plugin:return m.plugin;case c.tool:return m.tool;case c.swap:return m.swap}}mapApplicationDtoToApplication(e){return o(()=>Promise.resolve(e.map(r=>this.mapApplicationDto(r))))}mapNullableApplicationDtoToApplication(e){return o(()=>Promise.resolve(e.map(r=>r===null?null:this.mapApplicationDto(r))))}mapApplicationDto(e){if(typeof e!="object"||typeof e.versionId!="number"||typeof e.versionName!="string"||e.versionDisplayName!==null&&typeof e.versionDisplayName!="string"||typeof e.version!="string"||e.currencyId!==null&&typeof e.currencyId!="string"||e.description!==null&&typeof e.description!="string"||e.applicationType!==null&&typeof e.applicationType!="string"||typeof e.dateModified!="string"||e.icon!==null&&typeof e.icon!="string"||e.authorName!==null&&typeof e.authorName!="string"||e.supportURL!==null&&typeof e.supportURL!="string"||e.contactURL!==null&&typeof e.contactURL!="string"||e.sourceURL!==null&&typeof e.sourceURL!="string"||e.compatibleWallets!==null&&typeof e.compatibleWallets!="string"||typeof e.hash!="string"||typeof e.perso!="string"||typeof e.firmware!="string"||typeof e.firmwareKey!="string"||typeof e.delete!="string"||typeof e.deleteKey!="string"||e.bytes!==null&&typeof e.bytes!="number"||e.warning!==null&&typeof e.warning!="string"||typeof e.isDevTools!="boolean"||e.category!==null&&typeof e.category!="number"||e.parent!==null&&typeof e.parent!="number"||e.parentName!==null&&typeof e.parentName!="string")throw new Error(`Incomplete application: ${JSON.stringify(e)}`);const{applicationType:r,hash:t,perso:i,firmware:a,firmwareKey:p,delete:h,deleteKey:g,...v}=e;return{...v,hash:t,perso:i,firmware:a,firmwareKey:p,delete:h,deleteKey:g,applicationType:this.mapAppTypeDtoToAppType(r)}}mapMcuDtoToMcu(e){return o(()=>Promise.resolve(e.map(r=>{if(typeof r!="object"||typeof r.id!="number"||typeof r.name!="string"||typeof r.from_bootloader_version!="string")throw new Error(`Incomplete MCU version: ${JSON.stringify(r)}`);return{id:r.id,name:r.name,fromBootloaderVersion:r.from_bootloader_version,providers:r.providers}})))}mapDeviceVersionDto(e){return o(()=>{if(typeof e!="object"||typeof e.id!="number")throw new Error(`Incomplete device version: ${JSON.stringify(e)}`);const r={id:e.id};return Promise.resolve(r)})}mapFinalFirmwareDto(e){return o(()=>{if(typeof e!="object"||typeof e.id!="number"||typeof e.version!="string"||typeof e.perso!="string"||e.firmware!==null&&typeof e.firmware!="string"||e.firmware_key!==null&&typeof e.firmware_key!="string"||e.hash!==null&&typeof e.hash!="string"||e.bytes!==null&&typeof e.bytes!="number"||!Array.isArray(e.mcu_versions))throw new Error(`Incomplete final firmware: ${JSON.stringify(e)}`);const r={id:e.id,version:e.version,perso:e.perso,firmware:e.firmware,firmwareKey:e.firmware_key,hash:e.hash,bytes:e.bytes,mcuVersions:e.mcu_versions};return Promise.resolve(r)})}mapLatestFirmwareDto(e){return o(()=>{if(e.result==="null")return Promise.resolve(null);if(e.result!=="success"||!e.se_firmware_osu_version)throw new Error(`Latest firmware could not be retrieved: ${e.result}`);const r=e.se_firmware_osu_version;return Promise.resolve(r)}).chain(r=>r===null?o(()=>Promise.resolve(F)):this.mapOsuFirmwareDto(r).map(t=>D(t)))}mapOsuFirmwareDto(e){return o(()=>{if(typeof e!="object"||typeof e.id!="number"||e.notes!==null&&typeof e.notes!="string"||typeof e.perso!="string"||typeof e.firmware!="string"||typeof e.firmware_key!="string"||e.hash!==null&&typeof e.hash!="string"||typeof e.next_se_firmware_final_version!="number")throw new Error(`Incomplete latest firmware: ${JSON.stringify(e)}`);const r={id:e.id,notes:e.notes,perso:e.perso,firmware:e.firmware,firmwareKey:e.firmware_key,hash:e.hash,nextFinalFirmware:e.next_se_firmware_final_version};return Promise.resolve(r)})}mapLanguagesDtoToLanguages(e){return o(()=>Promise.resolve(e.map(r=>this.mapLanguageDto(r))))}mapLanguageDto(e){if(typeof e!="object"||typeof e.language!="string"||typeof e.languagePackageVersionId!="number"||typeof e.version!="string"||typeof e.language_package_id!="number"||typeof e.apdu_install_url!="string"||typeof e.apdu_uninstall_url!="string"||typeof e.bytes!="number"||typeof e.date_creation!="string"||typeof e.date_last_modified!="string")throw new Error(`Incomplete language version: ${JSON.stringify(e)}`);return{language:e.language,languagePackageVersionId:e.languagePackageVersionId,version:e.version,languagePackageId:e.language_package_id,apduInstallUrl:e.apdu_install_url,apduUninstallUrl:e.apdu_uninstall_url,bytes:e.bytes,dateCreation:e.date_creation,dateLastModified:e.date_last_modified}}};l=y([w(),u(0,_(b.DmkConfig))],l);export{l as HttpManagerApiDataSource};
|
|
2
2
|
//# sourceMappingURL=HttpManagerApiDataSource.js.map
|