@ledgerhq/device-management-kit 1.8.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/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/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/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/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/model/Const.js +1 -1
- package/lib/esm/src/internal/manager-api/model/Const.js.map +2 -2
- 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/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
package/lib/cjs/package.json
CHANGED
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"watch:builds": "pnpm ldmk-tool watch --entryPoints index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
|
|
63
63
|
"watch:types": "concurrently \"tsc --watch -p tsconfig.prod.json\" \"tsc-alias --watch -p tsconfig.prod.json\""
|
|
64
64
|
},
|
|
65
|
-
"version": "1.
|
|
65
|
+
"version": "1.9.0"
|
|
66
66
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var o=require("./logger-subscriber/service/ConsoleLogger"),i=require("./DeviceManagementKit"),r=require("./DeviceManagementKitBuilder");vi.mock("./logger-subscriber/service/ConsoleLogger");let e,t;describe("LedgerDeviceManagementKitBuilder",()=>{beforeEach(()=>{e=new r.DeviceManagementKitBuilder}),it("should build a DeviceManagementKit instance",()=>{const g=e.build();expect(g).toBeInstanceOf(i.DeviceManagementKit)}),it("should set the stub flag",()=>{e.setStub(!0),expect(e.stub).toBe(!0)}),it("should add a logger",()=>{t=new o.ConsoleLogger,e.addLogger(t),expect(e.loggers).toContain(t)}),it("should default mockUrl to the hosted mock server",()=>{expect(e.config.mockUrl).toBe("https://device-mock-server.aws.ldg-ps-default.ldg-tech.com")})});
|
|
2
2
|
//# sourceMappingURL=DeviceManagementKitBuilder.test.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/api/DeviceManagementKitBuilder.test.ts"],
|
|
4
|
-
"sourcesContent": ["import { ConsoleLogger } from \"./logger-subscriber/service/ConsoleLogger\";\nimport { DeviceManagementKit } from \"./DeviceManagementKit\";\nimport { DeviceManagementKitBuilder } from \"./DeviceManagementKitBuilder\";\n\nvi.mock(\"./logger-subscriber/service/ConsoleLogger\");\n\nlet builder: DeviceManagementKitBuilder;\nlet logger: ConsoleLogger;\n\ndescribe(\"LedgerDeviceManagementKitBuilder\", () => {\n beforeEach(() => {\n builder = new DeviceManagementKitBuilder();\n });\n\n it(\"should build a DeviceManagementKit instance\", () => {\n const dmk: DeviceManagementKit = builder.build();\n expect(dmk).toBeInstanceOf(DeviceManagementKit);\n });\n\n it(\"should set the stub flag\", () => {\n builder.setStub(true);\n // @ts-expect-error Access private field stub\n expect(builder.stub).toBe(true);\n });\n\n it(\"should add a logger\", () => {\n logger = new ConsoleLogger();\n builder.addLogger(logger);\n // @ts-expect-error Access private field loggers\n expect(builder.loggers).toContain(logger);\n });\n});\n"],
|
|
5
|
-
"mappings": "aAAA,IAAAA,EAA8B,qDAC9BC,EAAoC,iCACpCC,EAA2C,wCAE3C,GAAG,KAAK,2CAA2C,EAEnD,IAAIC,EACAC,EAEJ,SAAS,mCAAoC,IAAM,CACjD,WAAW,IAAM,CACfD,EAAU,IAAI,4BAChB,CAAC,EAED,GAAG,8CAA+C,IAAM,CACtD,MAAME,EAA2BF,EAAQ,MAAM,EAC/C,OAAOE,CAAG,EAAE,eAAe,qBAAmB,CAChD,CAAC,EAED,GAAG,2BAA4B,IAAM,CACnCF,EAAQ,QAAQ,EAAI,EAEpB,OAAOA,EAAQ,IAAI,EAAE,KAAK,EAAI,CAChC,CAAC,EAED,GAAG,sBAAuB,IAAM,CAC9BC,EAAS,IAAI,gBACbD,EAAQ,UAAUC,CAAM,EAExB,OAAOD,EAAQ,OAAO,EAAE,UAAUC,CAAM,CAC1C,CAAC,CACH,CAAC",
|
|
4
|
+
"sourcesContent": ["import { ConsoleLogger } from \"./logger-subscriber/service/ConsoleLogger\";\nimport { DeviceManagementKit } from \"./DeviceManagementKit\";\nimport { DeviceManagementKitBuilder } from \"./DeviceManagementKitBuilder\";\n\nvi.mock(\"./logger-subscriber/service/ConsoleLogger\");\n\nlet builder: DeviceManagementKitBuilder;\nlet logger: ConsoleLogger;\n\ndescribe(\"LedgerDeviceManagementKitBuilder\", () => {\n beforeEach(() => {\n builder = new DeviceManagementKitBuilder();\n });\n\n it(\"should build a DeviceManagementKit instance\", () => {\n const dmk: DeviceManagementKit = builder.build();\n expect(dmk).toBeInstanceOf(DeviceManagementKit);\n });\n\n it(\"should set the stub flag\", () => {\n builder.setStub(true);\n // @ts-expect-error Access private field stub\n expect(builder.stub).toBe(true);\n });\n\n it(\"should add a logger\", () => {\n logger = new ConsoleLogger();\n builder.addLogger(logger);\n // @ts-expect-error Access private field loggers\n expect(builder.loggers).toContain(logger);\n });\n\n it(\"should default mockUrl to the hosted mock server\", () => {\n // @ts-expect-error Access private field config\n expect(builder.config.mockUrl).toBe(\n \"https://device-mock-server.aws.ldg-ps-default.ldg-tech.com\",\n );\n });\n});\n"],
|
|
5
|
+
"mappings": "aAAA,IAAAA,EAA8B,qDAC9BC,EAAoC,iCACpCC,EAA2C,wCAE3C,GAAG,KAAK,2CAA2C,EAEnD,IAAIC,EACAC,EAEJ,SAAS,mCAAoC,IAAM,CACjD,WAAW,IAAM,CACfD,EAAU,IAAI,4BAChB,CAAC,EAED,GAAG,8CAA+C,IAAM,CACtD,MAAME,EAA2BF,EAAQ,MAAM,EAC/C,OAAOE,CAAG,EAAE,eAAe,qBAAmB,CAChD,CAAC,EAED,GAAG,2BAA4B,IAAM,CACnCF,EAAQ,QAAQ,EAAI,EAEpB,OAAOA,EAAQ,IAAI,EAAE,KAAK,EAAI,CAChC,CAAC,EAED,GAAG,sBAAuB,IAAM,CAC9BC,EAAS,IAAI,gBACbD,EAAQ,UAAUC,CAAM,EAExB,OAAOD,EAAQ,OAAO,EAAE,UAAUC,CAAM,CAC1C,CAAC,EAED,GAAG,mDAAoD,IAAM,CAE3D,OAAOD,EAAQ,OAAO,OAAO,EAAE,KAC7B,4DACF,CACF,CAAC,CACH,CAAC",
|
|
6
6
|
"names": ["import_ConsoleLogger", "import_DeviceManagementKit", "import_DeviceManagementKitBuilder", "builder", "logger", "dmk"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var n=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var a=(s,e)=>{for(var i in e)n(s,i,{get:e[i],enumerable:!0})},h=(s,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of l(e))!c.call(s,o)&&o!==i&&n(s,o,{get:()=>e[o],enumerable:!(r=p(e,o))||r.enumerable});return s};var d=s=>h(n({},"__esModule",{value:!0}),s);var u={};a(u,{ApplicationChecker:()=>m});module.exports=d(u);var t=require("semver");class m{isCompatible;version;modelId;appName;constructor(e,i,r){this.modelId=e.deviceModelId,this.appName="currentApp"in e?e.currentApp.name:void 0;const o=r.resolve(e,i);this.isCompatible=o.isCompatible,this.version=o.version}withMinVersionInclusive(e){return(0,t.gte)(this.version,e)||(this.isCompatible=!1),this}withMinVersionExclusive(e){return(0,t.gt)(this.version,e)||(this.isCompatible=!1),this}withMinVersionInclusiveAcceptingPrerelease(e){const i=(0,t.valid)((0,t.coerce)(this.version)),r=(0,t.valid)((0,t.coerce)(e));return(i===null||r===null||!(0,t.gte)(i,r))&&(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}}0&&(module.exports={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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,
|
|
6
|
-
"names": ["ApplicationChecker_exports", "__export", "ApplicationChecker", "__toCommonJS", "import_semver", "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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAuC,kBAUhC,MAAMF,CAAmB,CACtB,aACA,QACA,QACS,QAEjB,YACEG,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,SAAK,OAAI,KAAK,QAASA,CAAO,IAAG,KAAK,aAAe,IAC9C,IACT,CAEA,wBAAwBA,EAAqC,CAC3D,SAAK,MAAG,KAAK,QAASA,CAAO,IAAG,KAAK,aAAe,IAC7C,IACT,CAkBA,2CACEA,EACoB,CACpB,MAAMC,KAAS,YAAM,UAAO,KAAK,OAAO,CAAC,EACnCC,KAAU,YAAM,UAAOF,CAAO,CAAC,EACrC,OAAIC,IAAW,MAAQC,IAAY,MAAQ,IAAC,OAAID,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": ["ApplicationChecker_exports", "__export", "ApplicationChecker", "__toCommonJS", "import_semver", "deviceState", "appConfig", "resolver", "resolved", "version", "actual", "minimum", "modelId", "modelIds", "id", "name", "names"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var c=require("../device/DeviceModel"),n=require("../device/DeviceStatus"),l=require("../device-session/DeviceSessionState"),i=require("./ApplicationChecker");describe("ApplicationChecker",()=>{function s(e=c.DeviceModelId.FLEX){return{sessionStateType:l.DeviceSessionStateType.ReadyWithoutSecureChannel,deviceStatus:n.DeviceStatus.CONNECTED,installedApps:[],currentApp:{name:"TestApp",version:"1.0.0"},deviceModelId:e,isSecureConnectionAllowed:!1}}function o(e){return{resolve:()=>e}}const r={version:"1.0.0"};it("should pass check when resolved as compatible",()=>{const e=o({isCompatible:!0,version:"1.12.0"}),t=new i.ApplicationChecker(s(),r,e).check();expect(t).toStrictEqual(!0)}),it("should reject check when resolved as incompatible",()=>{const e=o({isCompatible:!1,version:"0.0.1"}),t=new i.ApplicationChecker(s(),r,e).check();expect(t).toStrictEqual(!1)}),it("should pass with min version inclusive when version matches",()=>{const e=o({isCompatible:!0,version:"1.12.0"}),t=new i.ApplicationChecker(s(),r,e).withMinVersionInclusive("1.12.0").check();expect(t).toStrictEqual(!0)}),it("should reject with min version inclusive when version is too low",()=>{const e=o({isCompatible:!0,version:"1.11.0"}),t=new i.ApplicationChecker(s(),r,e).withMinVersionInclusive("1.12.0").check();expect(t).toStrictEqual(!1)}),it("should pass with min version exclusive when version is greater",()=>{const e=o({isCompatible:!0,version:"1.13.0"}),t=new i.ApplicationChecker(s(),r,e).withMinVersionExclusive("1.12.0").check();expect(t).toStrictEqual(!0)}),it("should reject with min version exclusive when version is equal",()=>{const e=o({isCompatible:!0,version:"1.12.0"}),t=new i.ApplicationChecker(s(),r,e).withMinVersionExclusive("1.12.0").check();expect(t).toStrictEqual(!1)}),it("should pass when device model is not excluded",()=>{const e=o({isCompatible:!0,version:"1.12.0"}),t=new i.ApplicationChecker(s(c.DeviceModelId.FLEX),r,e).excludeDeviceModel(c.DeviceModelId.NANO_S).check();expect(t).toStrictEqual(!0)}),it("should reject when device model is excluded",()=>{const e=o({isCompatible:!0,version:"1.12.0"}),t=new i.ApplicationChecker(s(c.DeviceModelId.FLEX),r,e).excludeDeviceModel(c.DeviceModelId.FLEX).check();expect(t).toStrictEqual(!1)}),it("should pass with chained conditions when all are met",()=>{const e=o({isCompatible:!0,version:"1.12.0"}),t=new i.ApplicationChecker(s(),r,e).withMinVersionInclusive("1.11.0").excludeDeviceModel(c.DeviceModelId.NANO_S).check();expect(t).toStrictEqual(!0)}),it("should reject with chained conditions when one fails",()=>{const e=o({isCompatible:!0,version:"1.10.0"}),t=new i.ApplicationChecker(s(),r,e).withMinVersionInclusive("1.11.0").excludeDeviceModel(c.DeviceModelId.NANO_S).check();expect(t).toStrictEqual(!1)}),describe("withMinVersionInclusiveAcceptingPrerelease",()=>{it("should accept a release candidate of the minimum",()=>{const e=o({isCompatible:!0,version:"1.23.0-rc2"}),t=new i.ApplicationChecker(s(),r,e).withMinVersionInclusiveAcceptingPrerelease("1.23.0").check();expect(t).toStrictEqual(!0)}),it("should accept a dev build of the minimum",()=>{const e=o({isCompatible:!0,version:"1.23.0-dev"}),t=new i.ApplicationChecker(s(),r,e).withMinVersionInclusiveAcceptingPrerelease("1.23.0").check();expect(t).toStrictEqual(!0)}),it("should accept a plain version equal to the minimum",()=>{const e=o({isCompatible:!0,version:"1.23.0"}),t=new i.ApplicationChecker(s(),r,e).withMinVersionInclusiveAcceptingPrerelease("1.23.0").check();expect(t).toStrictEqual(!0)}),it("should accept a plain version above the minimum",()=>{const e=o({isCompatible:!0,version:"1.24.0"}),t=new i.ApplicationChecker(s(),r,e).withMinVersionInclusiveAcceptingPrerelease("1.23.0").check();expect(t).toStrictEqual(!0)}),it("should reject a plain version below the minimum",()=>{const e=o({isCompatible:!0,version:"1.22.9"}),t=new i.ApplicationChecker(s(),r,e).withMinVersionInclusiveAcceptingPrerelease("1.23.0").check();expect(t).toStrictEqual(!1)}),it("should reject a prerelease whose release core is below the minimum",()=>{const e=o({isCompatible:!0,version:"1.22.9-rc5"}),t=new i.ApplicationChecker(s(),r,e).withMinVersionInclusiveAcceptingPrerelease("1.23.0").check();expect(t).toStrictEqual(!1)}),it("should reject a version that cannot be parsed",()=>{const e=o({isCompatible:!0,version:"not-a-version"}),t=new i.ApplicationChecker(s(),r,e).withMinVersionInclusiveAcceptingPrerelease("1.23.0").check();expect(t).toStrictEqual(!1)}),it("should reject a minimum that cannot be parsed",()=>{const e=o({isCompatible:!0,version:"1.23.0"}),t=new i.ApplicationChecker(s(),r,e).withMinVersionInclusiveAcceptingPrerelease("not-a-version").check();expect(t).toStrictEqual(!1)}),it("should not override incompatible resolution",()=>{const e=o({isCompatible:!1,version:"1.23.0-rc2"}),t=new i.ApplicationChecker(s(),r,e).withMinVersionInclusiveAcceptingPrerelease("1.23.0").check();expect(t).toStrictEqual(!1)})}),it("should not override incompatible resolution even if constraints pass",()=>{const e=o({isCompatible:!1,version:"1.15.0"}),t=new i.ApplicationChecker(s(),r,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,IAAAA,EAA8B,mCAC9BC,EAA6B,oCAC7BC,EAAuC,kDAEvCC,EAAmC,gCAMnC,SAAS,qBAAsB,IAAM,CACnC,SAASC,EAAiBC,EAAyB,gBAAc,KA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,EACT,OAAOC,CAAM,EAAE,cAAc,EAAK,CACpC,CAAC,EAED,GAAG,uEAAwE,IAAM,CAC/E,MAAMD,EAAWH,EAAmB,CAClC,aAAc,GACd,QAAS,QACX,CAAC,EACKI,EAAS,IAAI,qBACjBN,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,IAAAA,EAA8B,mCAC9BC,EAA6B,oCAC7BC,EAAuC,kDAEvCC,EAAmC,gCAMnC,SAAS,qBAAsB,IAAM,CACnC,SAASC,EAAiBC,EAAy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WH,EAAmB,CAClC,aAAc,GACd,QAAS,YACX,CAAC,EACKI,EAAS,IAAI,qBACjBN,EAAiB,EACjBI,EACAC,CACF,EACG,2CAA2C,QAAQ,EACnD,MAAM,EACT,OAAOC,CAAM,EAAE,cAAc,EAAK,CACpC,CAAC,EAED,GAAG,gDAAiD,IAAM,CACxD,MAAMD,EAAWH,EAAmB,CAClC,aAAc,GACd,QAAS,eACX,CAAC,EACKI,EAAS,IAAI,qBACjBN,EAAiB,EACjBI,EACAC,CACF,EACG,2CAA2C,QAAQ,EACnD,MAAM,EACT,OAAOC,CAAM,EAAE,cAAc,EAAK,CACpC,CAAC,EAED,GAAG,gDAAiD,IAAM,CACxD,MAAMD,EAAWH,EAAmB,CAClC,aAAc,GACd,QAAS,QACX,CAAC,EACKI,EAAS,IAAI,qBACjBN,EAAiB,EACjBI,EACAC,CACF,EACG,2CAA2C,eAAe,EAC1D,MAAM,EACT,OAAOC,CAAM,EAAE,cAAc,EAAK,CACpC,CAAC,EAED,GAAG,8CAA+C,IAAM,CACtD,MAAMD,EAAWH,EAAmB,CAClC,aAAc,GACd,QAAS,YACX,CAAC,EACKI,EAAS,IAAI,qBACjBN,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,IAAI,qBACjBN,EAAiB,EACjBI,EACAC,CACF,EACG,wBAAwB,QAAQ,EAChC,MAAM,EACT,OAAOC,CAAM,EAAE,cAAc,EAAK,CACpC,CAAC,CACH,CAAC",
|
|
6
6
|
"names": ["import_DeviceModel", "import_DeviceStatus", "import_DeviceSessionState", "import_ApplicationChecker", "createReadyState", "modelId", "createMockResolver", "resolved", "appConfig", "resolver", "result"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var o=require("./internal/transport/di/transportDiTypes"),t=require("./di");describe("makeContainer",()=>{it("should default mockUrl to the hosted mock server",()=>{const e=(0,t.makeContainer)({}).get(o.transportDiTypes.DmkConfig);expect(e.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,IAAAA,EAAiC,mDAEjCC,EAA8B,gBAE9B,SAAS,gBAAiB,IAAM,CAC9B,GAAG,mDAAoD,IAAM,CAE3D,MAAMC,KADY,iBAAc,CAAC,CAAC,EACA,IAChC,mBAAiB,SACnB,EAEA,OAAOA,EAAgB,OAAO,EAAE,KAC9B,4DACF,CACF,CAAC,CACH,CAAC",
|
|
6
|
+
"names": ["import_transportDiTypes", "import_di", "transportConfig"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var A=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var s=(t,e)=>{for(var o in e)A(t,o,{get:e[o],enumerable:!0})},r=(t,e,o,E)=>{if(e&&typeof e=="object"||typeof e=="function")for(let _ of c(e))!p.call(t,_)&&_!==o&&A(t,_,{get:()=>e[_],enumerable:!(E=R(e,_))||E.enumerable});return t};var L=t=>r(A({},"__esModule",{value:!0}),t);var I={};s(I,{DEFAULT_FIRMWARE_DISTRIBUTION_SALT:()=>D,DEFAULT_MANAGER_API_BASE_URL:()=>T,DEFAULT_MOCK_SERVER_BASE_URL:()=>U,DEFAULT_PROVIDER:()=>a});module.exports=L(I);const T="https://manager.api.live.ledger.com/api",U="https://device-mock-server.aws.ldg-ps-default.ldg-tech.com",a=1,D="0";0&&(module.exports={DEFAULT_FIRMWARE_DISTRIBUTION_SALT,DEFAULT_MANAGER_API_BASE_URL,DEFAULT_MOCK_SERVER_BASE_URL,DEFAULT_PROVIDER});
|
|
2
2
|
//# sourceMappingURL=Const.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/internal/manager-api/model/Const.ts"],
|
|
4
|
-
"sourcesContent": ["export const DEFAULT_MANAGER_API_BASE_URL =\n \"https://manager.api.live.ledger.com/api\";\nexport const DEFAULT_MOCK_SERVER_BASE_URL
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wCAAAE,EAAA,iCAAAC,EAAA,iCAAAC,EAAA,qBAAAC,IAAA,eAAAC,EAAAN,GAAO,MAAMG,EACX,0CACWC,
|
|
4
|
+
"sourcesContent": ["export const DEFAULT_MANAGER_API_BASE_URL =\n \"https://manager.api.live.ledger.com/api\";\nexport const DEFAULT_MOCK_SERVER_BASE_URL =\n \"https://device-mock-server.aws.ldg-ps-default.ldg-tech.com\";\nexport const DEFAULT_PROVIDER = 1;\nexport const DEFAULT_FIRMWARE_DISTRIBUTION_SALT = \"0\";\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wCAAAE,EAAA,iCAAAC,EAAA,iCAAAC,EAAA,qBAAAC,IAAA,eAAAC,EAAAN,GAAO,MAAMG,EACX,0CACWC,EACX,6DACWC,EAAmB,EACnBH,EAAqC",
|
|
6
6
|
"names": ["Const_exports", "__export", "DEFAULT_FIRMWARE_DISTRIBUTION_SALT", "DEFAULT_MANAGER_API_BASE_URL", "DEFAULT_MOCK_SERVER_BASE_URL", "DEFAULT_PROVIDER", "__toCommonJS"]
|
|
7
7
|
}
|
package/lib/esm/package.json
CHANGED
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"watch:builds": "pnpm ldmk-tool watch --entryPoints index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
|
|
63
63
|
"watch:types": "concurrently \"tsc --watch -p tsconfig.prod.json\" \"tsc-alias --watch -p tsconfig.prod.json\""
|
|
64
64
|
},
|
|
65
|
-
"version": "1.
|
|
65
|
+
"version": "1.9.0"
|
|
66
66
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ConsoleLogger as
|
|
1
|
+
import{ConsoleLogger as i}from"./logger-subscriber/service/ConsoleLogger";import{DeviceManagementKit as r}from"./DeviceManagementKit";import{DeviceManagementKitBuilder as g}from"./DeviceManagementKitBuilder";vi.mock("./logger-subscriber/service/ConsoleLogger");let e,t;describe("LedgerDeviceManagementKitBuilder",()=>{beforeEach(()=>{e=new g}),it("should build a DeviceManagementKit instance",()=>{const o=e.build();expect(o).toBeInstanceOf(r)}),it("should set the stub flag",()=>{e.setStub(!0),expect(e.stub).toBe(!0)}),it("should add a logger",()=>{t=new i,e.addLogger(t),expect(e.loggers).toContain(t)}),it("should default mockUrl to the hosted mock server",()=>{expect(e.config.mockUrl).toBe("https://device-mock-server.aws.ldg-ps-default.ldg-tech.com")})});
|
|
2
2
|
//# sourceMappingURL=DeviceManagementKitBuilder.test.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/api/DeviceManagementKitBuilder.test.ts"],
|
|
4
|
-
"sourcesContent": ["import { ConsoleLogger } from \"./logger-subscriber/service/ConsoleLogger\";\nimport { DeviceManagementKit } from \"./DeviceManagementKit\";\nimport { DeviceManagementKitBuilder } from \"./DeviceManagementKitBuilder\";\n\nvi.mock(\"./logger-subscriber/service/ConsoleLogger\");\n\nlet builder: DeviceManagementKitBuilder;\nlet logger: ConsoleLogger;\n\ndescribe(\"LedgerDeviceManagementKitBuilder\", () => {\n beforeEach(() => {\n builder = new DeviceManagementKitBuilder();\n });\n\n it(\"should build a DeviceManagementKit instance\", () => {\n const dmk: DeviceManagementKit = builder.build();\n expect(dmk).toBeInstanceOf(DeviceManagementKit);\n });\n\n it(\"should set the stub flag\", () => {\n builder.setStub(true);\n // @ts-expect-error Access private field stub\n expect(builder.stub).toBe(true);\n });\n\n it(\"should add a logger\", () => {\n logger = new ConsoleLogger();\n builder.addLogger(logger);\n // @ts-expect-error Access private field loggers\n expect(builder.loggers).toContain(logger);\n });\n});\n"],
|
|
5
|
-
"mappings": "AAAA,OAAS,iBAAAA,MAAqB,4CAC9B,OAAS,uBAAAC,MAA2B,wBACpC,OAAS,8BAAAC,MAAkC,+BAE3C,GAAG,KAAK,2CAA2C,EAEnD,IAAIC,EACAC,EAEJ,SAAS,mCAAoC,IAAM,CACjD,WAAW,IAAM,CACfD,EAAU,IAAID,CAChB,CAAC,EAED,GAAG,8CAA+C,IAAM,CACtD,MAAMG,EAA2BF,EAAQ,MAAM,EAC/C,OAAOE,CAAG,EAAE,eAAeJ,CAAmB,CAChD,CAAC,EAED,GAAG,2BAA4B,IAAM,CACnCE,EAAQ,QAAQ,EAAI,EAEpB,OAAOA,EAAQ,IAAI,EAAE,KAAK,EAAI,CAChC,CAAC,EAED,GAAG,sBAAuB,IAAM,CAC9BC,EAAS,IAAIJ,EACbG,EAAQ,UAAUC,CAAM,EAExB,OAAOD,EAAQ,OAAO,EAAE,UAAUC,CAAM,CAC1C,CAAC,CACH,CAAC",
|
|
4
|
+
"sourcesContent": ["import { ConsoleLogger } from \"./logger-subscriber/service/ConsoleLogger\";\nimport { DeviceManagementKit } from \"./DeviceManagementKit\";\nimport { DeviceManagementKitBuilder } from \"./DeviceManagementKitBuilder\";\n\nvi.mock(\"./logger-subscriber/service/ConsoleLogger\");\n\nlet builder: DeviceManagementKitBuilder;\nlet logger: ConsoleLogger;\n\ndescribe(\"LedgerDeviceManagementKitBuilder\", () => {\n beforeEach(() => {\n builder = new DeviceManagementKitBuilder();\n });\n\n it(\"should build a DeviceManagementKit instance\", () => {\n const dmk: DeviceManagementKit = builder.build();\n expect(dmk).toBeInstanceOf(DeviceManagementKit);\n });\n\n it(\"should set the stub flag\", () => {\n builder.setStub(true);\n // @ts-expect-error Access private field stub\n expect(builder.stub).toBe(true);\n });\n\n it(\"should add a logger\", () => {\n logger = new ConsoleLogger();\n builder.addLogger(logger);\n // @ts-expect-error Access private field loggers\n expect(builder.loggers).toContain(logger);\n });\n\n it(\"should default mockUrl to the hosted mock server\", () => {\n // @ts-expect-error Access private field config\n expect(builder.config.mockUrl).toBe(\n \"https://device-mock-server.aws.ldg-ps-default.ldg-tech.com\",\n );\n });\n});\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,iBAAAA,MAAqB,4CAC9B,OAAS,uBAAAC,MAA2B,wBACpC,OAAS,8BAAAC,MAAkC,+BAE3C,GAAG,KAAK,2CAA2C,EAEnD,IAAIC,EACAC,EAEJ,SAAS,mCAAoC,IAAM,CACjD,WAAW,IAAM,CACfD,EAAU,IAAID,CAChB,CAAC,EAED,GAAG,8CAA+C,IAAM,CACtD,MAAMG,EAA2BF,EAAQ,MAAM,EAC/C,OAAOE,CAAG,EAAE,eAAeJ,CAAmB,CAChD,CAAC,EAED,GAAG,2BAA4B,IAAM,CACnCE,EAAQ,QAAQ,EAAI,EAEpB,OAAOA,EAAQ,IAAI,EAAE,KAAK,EAAI,CAChC,CAAC,EAED,GAAG,sBAAuB,IAAM,CAC9BC,EAAS,IAAIJ,EACbG,EAAQ,UAAUC,CAAM,EAExB,OAAOD,EAAQ,OAAO,EAAE,UAAUC,CAAM,CAC1C,CAAC,EAED,GAAG,mDAAoD,IAAM,CAE3D,OAAOD,EAAQ,OAAO,OAAO,EAAE,KAC7B,4DACF,CACF,CAAC,CACH,CAAC",
|
|
6
6
|
"names": ["ConsoleLogger", "DeviceManagementKit", "DeviceManagementKitBuilder", "builder", "logger", "dmk"]
|
|
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,OA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AAiBJ,EAAc,IAAI,EACnCQ,EACAC,CACF,EACG,mBAAmBT,EAAc,MAAM,EACvC,MAAM,EACT,OAAOU,CAAM,EAAE,cAAc,EAAI,CACnC,CAAC,EAED,GAAG,8CAA+C,IAAM,CACtD,MAAMD,EAAWH,EAAmB,CAClC,aAAc,GACd,QAAS,QACX,CAAC,EACKI,EAAS,IAAIP,EACjBC,EAAiBJ,EAAc,IAAI,EACnCQ,EACAC,CACF,EACG,mBAAmBT,EAAc,IAAI,EACrC,MAAM,EACT,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,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EAAE,cAAc,EAAK,CACpC,CAAC,EAED,GAAG,gDAAiD,IAAM,CACxD,MAAMD,EAAWH,EAAmB,CAClC,aAAc,GACd,QAAS,QACX,CAAC,EACKI,EAAS,IAAIP,EACjBC,EAAiB,EACjBI,EACAC,CACF,EACG,2CAA2C,eAAe,EAC1D,MAAM,EACT,OAAOC,CAAM,EAAE,cAAc,EAAK,CACpC,CAAC,EAED,GAAG,8CAA+C,IAAM,CACtD,MAAMD,EAAWH,EAAmB,CAClC,aAAc,GACd,QAAS,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
|
-
const
|
|
1
|
+
const e="https://manager.api.live.ledger.com/api",t="https://device-mock-server.aws.ldg-ps-default.ldg-tech.com",_=1,o="0";export{o as DEFAULT_FIRMWARE_DISTRIBUTION_SALT,e as DEFAULT_MANAGER_API_BASE_URL,t as DEFAULT_MOCK_SERVER_BASE_URL,_ as DEFAULT_PROVIDER};
|
|
2
2
|
//# sourceMappingURL=Const.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/internal/manager-api/model/Const.ts"],
|
|
4
|
-
"sourcesContent": ["export const DEFAULT_MANAGER_API_BASE_URL =\n \"https://manager.api.live.ledger.com/api\";\nexport const DEFAULT_MOCK_SERVER_BASE_URL
|
|
5
|
-
"mappings": "AAAO,MAAMA,EACX,0CACWC,
|
|
4
|
+
"sourcesContent": ["export const DEFAULT_MANAGER_API_BASE_URL =\n \"https://manager.api.live.ledger.com/api\";\nexport const DEFAULT_MOCK_SERVER_BASE_URL =\n \"https://device-mock-server.aws.ldg-ps-default.ldg-tech.com\";\nexport const DEFAULT_PROVIDER = 1;\nexport const DEFAULT_FIRMWARE_DISTRIBUTION_SALT = \"0\";\n"],
|
|
5
|
+
"mappings": "AAAO,MAAMA,EACX,0CACWC,EACX,6DACWC,EAAmB,EACnBC,EAAqC",
|
|
6
6
|
"names": ["DEFAULT_MANAGER_API_BASE_URL", "DEFAULT_MOCK_SERVER_BASE_URL", "DEFAULT_PROVIDER", "DEFAULT_FIRMWARE_DISTRIBUTION_SALT"]
|
|
7
7
|
}
|
|
@@ -9,6 +9,23 @@ export declare class ApplicationChecker {
|
|
|
9
9
|
constructor(deviceState: DeviceSessionState, appConfig: AppConfig, resolver: ApplicationResolver);
|
|
10
10
|
withMinVersionInclusive(version: string): ApplicationChecker;
|
|
11
11
|
withMinVersionExclusive(version: string): ApplicationChecker;
|
|
12
|
+
/**
|
|
13
|
+
* Like {@link withMinVersionInclusive}, but compares only the release core:
|
|
14
|
+
* prerelease and build tags are stripped from both sides first, so an app
|
|
15
|
+
* reporting `1.23.0-rc2` or `1.23.0-dev` satisfies a `1.23.0` minimum.
|
|
16
|
+
*
|
|
17
|
+
* This accepts a prerelease *of* the minimum, not any prerelease: the core
|
|
18
|
+
* still has to clear the bar, so `1.22.9-rc5` fails a `1.23.0` minimum just
|
|
19
|
+
* as `1.22.9` does. A version neither side can parse fails the check, so an
|
|
20
|
+
* unknown version never passes.
|
|
21
|
+
*
|
|
22
|
+
* Use this when a feature lands in a given release and devices running its
|
|
23
|
+
* release candidates must not be locked out — device versions reach the SDK
|
|
24
|
+
* verbatim, tags included (`GET APP AND VERSION` yields strings such as
|
|
25
|
+
* `1.4.0-rc2`). Prefer the strict {@link withMinVersionInclusive} when a
|
|
26
|
+
* prerelease genuinely cannot be trusted to carry the feature.
|
|
27
|
+
*/
|
|
28
|
+
withMinVersionInclusiveAcceptingPrerelease(version: string): ApplicationChecker;
|
|
12
29
|
excludeDeviceModel(modelId: DeviceModelId): ApplicationChecker;
|
|
13
30
|
excludeDeviceModels(...modelIds: DeviceModelId[]): ApplicationChecker;
|
|
14
31
|
excludeApp(name: string): ApplicationChecker;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationChecker.d.ts","sourceRoot":"","sources":["../../../../../src/api/utils/ApplicationChecker.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAEjF,OAAO,EACL,KAAK,SAAS,EACd,KAAK,mBAAmB,EACzB,MAAM,uBAAuB,CAAC;AAE/B,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,YAAY,CAAU;IAC9B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqB;gBAG3C,WAAW,EAAE,kBAAkB,EAC/B,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,mBAAmB;IAU/B,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,kBAAkB;IAK5D,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,kBAAkB;IAK5D,kBAAkB,CAAC,OAAO,EAAE,aAAa,GAAG,kBAAkB;IAK9D,mBAAmB,CAAC,GAAG,QAAQ,EAAE,aAAa,EAAE,GAAG,kBAAkB;IAKrE,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB;IAK5C,WAAW,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,kBAAkB;IAKnD,KAAK,IAAI,OAAO;CAGjB"}
|
|
1
|
+
{"version":3,"file":"ApplicationChecker.d.ts","sourceRoot":"","sources":["../../../../../src/api/utils/ApplicationChecker.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAEjF,OAAO,EACL,KAAK,SAAS,EACd,KAAK,mBAAmB,EACzB,MAAM,uBAAuB,CAAC;AAE/B,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,YAAY,CAAU;IAC9B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqB;gBAG3C,WAAW,EAAE,kBAAkB,EAC/B,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,mBAAmB;IAU/B,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,kBAAkB;IAK5D,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,kBAAkB;IAK5D;;;;;;;;;;;;;;;OAeG;IACH,0CAA0C,CACxC,OAAO,EAAE,MAAM,GACd,kBAAkB;IASrB,kBAAkB,CAAC,OAAO,EAAE,aAAa,GAAG,kBAAkB;IAK9D,mBAAmB,CAAC,GAAG,QAAQ,EAAE,aAAa,EAAE,GAAG,kBAAkB;IAKrE,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB;IAK5C,WAAW,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,kBAAkB;IAKnD,KAAK,IAAI,OAAO;CAGjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"di.test.d.ts","sourceRoot":"","sources":["../../../src/di.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const DEFAULT_MANAGER_API_BASE_URL = "https://manager.api.live.ledger.com/api";
|
|
2
|
-
export declare const DEFAULT_MOCK_SERVER_BASE_URL = "
|
|
2
|
+
export declare const DEFAULT_MOCK_SERVER_BASE_URL = "https://device-mock-server.aws.ldg-ps-default.ldg-tech.com";
|
|
3
3
|
export declare const DEFAULT_PROVIDER = 1;
|
|
4
4
|
export declare const DEFAULT_FIRMWARE_DISTRIBUTION_SALT = "0";
|
|
5
5
|
//# sourceMappingURL=Const.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Const.d.ts","sourceRoot":"","sources":["../../../../../../src/internal/manager-api/model/Const.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,4CACE,CAAC;AAC5C,eAAO,MAAM,4BAA4B,
|
|
1
|
+
{"version":3,"file":"Const.d.ts","sourceRoot":"","sources":["../../../../../../src/internal/manager-api/model/Const.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,4CACE,CAAC;AAC5C,eAAO,MAAM,4BAA4B,+DACqB,CAAC;AAC/D,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,kCAAkC,MAAM,CAAC"}
|