@ledgerhq/device-management-kit 0.0.0-develop-20260125001208 → 0.0.0-develop-20260127001144
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/index.js +1 -1
- package/lib/cjs/src/api/index.js.map +3 -3
- package/lib/cjs/src/api/logger-subscriber/model/LogSubscriberOptions.js +1 -1
- package/lib/cjs/src/api/logger-subscriber/model/LogSubscriberOptions.js.map +1 -1
- package/lib/cjs/src/api/logger-subscriber/service/ConsoleLogger.js +1 -1
- package/lib/cjs/src/api/logger-subscriber/service/ConsoleLogger.js.map +2 -2
- package/lib/cjs/src/api/logger-subscriber/service/ConsoleLogger.test.js +1 -1
- package/lib/cjs/src/api/logger-subscriber/service/ConsoleLogger.test.js.map +2 -2
- package/lib/cjs/src/api/logger-subscriber/service/DefaultLogTagFormatter.js +2 -0
- package/lib/cjs/src/api/logger-subscriber/service/DefaultLogTagFormatter.js.map +7 -0
- package/lib/cjs/src/api/logger-subscriber/service/DefaultLogTagFormatter.test.js +2 -0
- package/lib/cjs/src/api/logger-subscriber/service/DefaultLogTagFormatter.test.js.map +7 -0
- package/lib/cjs/src/api/logger-subscriber/service/LogTagFormatter.js +2 -0
- package/lib/cjs/src/api/logger-subscriber/service/LogTagFormatter.js.map +7 -0
- package/lib/cjs/src/internal/logger-publisher/service/DefaultLoggerPublisherService.js +1 -1
- package/lib/cjs/src/internal/logger-publisher/service/DefaultLoggerPublisherService.js.map +3 -3
- package/lib/cjs/src/internal/logger-publisher/service/DefaultLoggerPublisherService.test.js +1 -1
- package/lib/cjs/src/internal/logger-publisher/service/DefaultLoggerPublisherService.test.js.map +3 -3
- package/lib/cjs/src/internal/logger-publisher/service/sanitiseData.js +2 -0
- package/lib/cjs/src/internal/logger-publisher/service/sanitiseData.js.map +7 -0
- package/lib/cjs/src/internal/logger-publisher/service/sanitiseData.test.js +2 -0
- package/lib/cjs/src/internal/logger-publisher/service/sanitiseData.test.js.map +7 -0
- package/lib/esm/package.json +1 -1
- package/lib/esm/src/api/index.js +1 -1
- package/lib/esm/src/api/index.js.map +3 -3
- package/lib/esm/src/api/logger-subscriber/service/ConsoleLogger.js +1 -1
- package/lib/esm/src/api/logger-subscriber/service/ConsoleLogger.js.map +2 -2
- package/lib/esm/src/api/logger-subscriber/service/ConsoleLogger.test.js +1 -1
- package/lib/esm/src/api/logger-subscriber/service/ConsoleLogger.test.js.map +2 -2
- package/lib/esm/src/api/logger-subscriber/service/DefaultLogTagFormatter.js +2 -0
- package/lib/esm/src/api/logger-subscriber/service/DefaultLogTagFormatter.js.map +7 -0
- package/lib/esm/src/api/logger-subscriber/service/DefaultLogTagFormatter.test.js +2 -0
- package/lib/esm/src/api/logger-subscriber/service/DefaultLogTagFormatter.test.js.map +7 -0
- package/lib/esm/src/api/logger-subscriber/service/LogTagFormatter.js +1 -0
- package/lib/esm/src/api/logger-subscriber/service/LogTagFormatter.js.map +7 -0
- package/lib/esm/src/internal/logger-publisher/service/DefaultLoggerPublisherService.js +1 -1
- package/lib/esm/src/internal/logger-publisher/service/DefaultLoggerPublisherService.js.map +3 -3
- package/lib/esm/src/internal/logger-publisher/service/DefaultLoggerPublisherService.test.js +1 -1
- package/lib/esm/src/internal/logger-publisher/service/DefaultLoggerPublisherService.test.js.map +3 -3
- package/lib/esm/src/internal/logger-publisher/service/sanitiseData.js +2 -0
- package/lib/esm/src/internal/logger-publisher/service/sanitiseData.js.map +7 -0
- package/lib/esm/src/internal/logger-publisher/service/sanitiseData.test.js +2 -0
- package/lib/esm/src/internal/logger-publisher/service/sanitiseData.test.js.map +7 -0
- package/lib/types/src/api/index.d.ts +2 -0
- package/lib/types/src/api/index.d.ts.map +1 -1
- package/lib/types/src/api/logger-subscriber/model/LogSubscriberOptions.d.ts +1 -0
- package/lib/types/src/api/logger-subscriber/model/LogSubscriberOptions.d.ts.map +1 -1
- package/lib/types/src/api/logger-subscriber/service/DefaultLogTagFormatter.d.ts +10 -0
- package/lib/types/src/api/logger-subscriber/service/DefaultLogTagFormatter.d.ts.map +1 -0
- package/lib/types/src/api/logger-subscriber/service/DefaultLogTagFormatter.test.d.ts +2 -0
- package/lib/types/src/api/logger-subscriber/service/DefaultLogTagFormatter.test.d.ts.map +1 -0
- package/lib/types/src/api/logger-subscriber/service/LogTagFormatter.d.ts +9 -0
- package/lib/types/src/api/logger-subscriber/service/LogTagFormatter.d.ts.map +1 -0
- package/lib/types/src/internal/logger-publisher/service/DefaultLoggerPublisherService.d.ts +5 -2
- package/lib/types/src/internal/logger-publisher/service/DefaultLoggerPublisherService.d.ts.map +1 -1
- package/lib/types/src/internal/logger-publisher/service/sanitiseData.d.ts +6 -0
- package/lib/types/src/internal/logger-publisher/service/sanitiseData.d.ts.map +1 -0
- package/lib/types/src/internal/logger-publisher/service/sanitiseData.test.d.ts +2 -0
- package/lib/types/src/internal/logger-publisher/service/sanitiseData.test.d.ts.map +1 -0
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
- package/package.json +3 -3
package/lib/cjs/package.json
CHANGED
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"watch:builds": "pnpm ldmk-tool watch --entryPoints index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
|
|
65
65
|
"watch:types": "concurrently \"tsc --watch -p tsconfig.prod.json\" \"tsc-alias --watch -p tsconfig.prod.json\""
|
|
66
66
|
},
|
|
67
|
-
"version": "0.0.0-develop-
|
|
67
|
+
"version": "0.0.0-develop-20260127001144"
|
|
68
68
|
}
|
package/lib/cjs/src/api/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var u=Object.defineProperty;var
|
|
1
|
+
"use strict";var u=Object.defineProperty;var Ae=Object.getOwnPropertyDescriptor;var De=Object.getOwnPropertyNames;var le=Object.prototype.hasOwnProperty;var ue=(p,o)=>{for(var i in o)u(p,i,{get:o[i],enumerable:!0})},l=(p,o,i,v)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of De(o))!le.call(p,s)&&s!==i&&u(p,s,{get:()=>o[s],enumerable:!(v=Ae(o,s))||v.enumerable});return p},r=(p,o,i)=>(l(p,o,"default"),i&&l(i,o,"default"));var ve=p=>l(u({},"__esModule",{value:!0}),p);var e={};ue(e,{APDU_MAX_PAYLOAD:()=>f.APDU_MAX_PAYLOAD,Apdu:()=>S.Apdu,ApduBuilder:()=>f.ApduBuilder,ApduParser:()=>y.ApduParser,ApduResponse:()=>j.ApduResponse,AppAlreadyInstalledDAError:()=>t.AppAlreadyInstalledDAError,BatteryStatusType:()=>x.BatteryStatusType,BleDeviceInfos:()=>N.BleDeviceInfos,ByteArrayBuilder:()=>C.ByteArrayBuilder,ByteArrayParser:()=>g.ByteArrayParser,CallTaskInAppDeviceAction:()=>U.CallTaskInAppDeviceAction,CloseAppCommand:()=>L.CloseAppCommand,CommandResultFactory:()=>m.CommandResultFactory,CommandResultStatus:()=>m.CommandResultStatus,CommandUtils:()=>O.CommandUtils,ConnectedDevice:()=>fe.ConnectedDevice,ConsoleLogger:()=>ne.ConsoleLogger,DefaultLogTagFormatter:()=>ae.DefaultLogTagFormatter,DeviceActionStatus:()=>b.DeviceActionStatus,DeviceConnectionStateMachine:()=>ce.DeviceConnectionStateMachine,DeviceLockedError:()=>t.DeviceLockedError,DeviceManagementKit:()=>pe.DeviceManagementKit,DeviceManagementKitBuilder:()=>ie.DeviceManagementKitBuilder,DeviceModel:()=>n.DeviceModel,DeviceModelId:()=>n.DeviceModelId,DeviceSessionStateType:()=>z.DeviceSessionStateType,DeviceStatus:()=>T.DeviceStatus,FramerUtils:()=>te.FramerUtils,GenuineCheckDeviceAction:()=>J.GenuineCheckDeviceAction,GetAppAndVersionCommand:()=>E.GetAppAndVersionCommand,GetBatteryStatusCommand:()=>x.GetBatteryStatusCommand,GetDeviceMetadataDeviceAction:()=>F.GetDeviceMetadataDeviceAction,GetDeviceStatusDeviceAction:()=>P.GetDeviceStatusDeviceAction,GetOsVersionCommand:()=>B.GetOsVersionCommand,GlobalCommandError:()=>d.GlobalCommandError,GlobalCommandErrorHandler:()=>d.GlobalCommandErrorHandler,GoToDashboardDeviceAction:()=>V.GoToDashboardDeviceAction,InstallAppDeviceAction:()=>Q.InstallAppDeviceAction,InstallOrUpdateAppsDeviceAction:()=>k.InstallOrUpdateAppsDeviceAction,InvalidGetFirmwareMetadataResponseError:()=>c.InvalidGetFirmwareMetadataResponseError,InvalidStatusWordError:()=>c.InvalidStatusWordError,LEDGER_VENDOR_ID:()=>n.LEDGER_VENDOR_ID,ListAppsCommand:()=>G.ListAppsCommand,ListAppsDeviceAction:()=>W.ListAppsDeviceAction,ListAppsWithMetadataDeviceAction:()=>_.ListAppsWithMetadataDeviceAction,ListInstalledAppsDeviceAction:()=>Z.ListInstalledAppsDeviceAction,LoadCertificateCommand:()=>R.LoadCertificateCommand,LogLevel:()=>me.LogLevel,OpenAppCommand:()=>M.OpenAppCommand,OpenAppDeviceAction:()=>w.OpenAppDeviceAction,OpenAppWithDependenciesDeviceAction:()=>H.OpenAppWithDependenciesDeviceAction,OutOfMemoryDAError:()=>t.OutOfMemoryDAError,RefusedByUserDAError:()=>t.RefusedByUserDAError,SecureChannelError:()=>ee.SecureChannelError,SendCommandInAppDeviceAction:()=>K.SendCommandInAppDeviceAction,StaticDeviceModelDataSource:()=>q.StaticDeviceModelDataSource,TransportConnectedDevice:()=>xe.TransportConnectedDevice,TransportDeviceModel:()=>Y.TransportDeviceModel,UninstallAppDeviceAction:()=>$.UninstallAppDeviceAction,UnknownDAError:()=>t.UnknownDAError,UnsupportedFirmwareDAError:()=>t.UnsupportedFirmwareDAError,UserInteractionRequired:()=>h.UserInteractionRequired,WebLogsExporterLogger:()=>se.WebLogsExporterLogger,XStateDeviceAction:()=>X.XStateDeviceAction,base64StringToBuffer:()=>D.base64StringToBuffer,bufferToHexaString:()=>a.bufferToHexaString,connectedDeviceStubBuilder:()=>de.connectedDeviceStubBuilder,defaultApduReceiverServiceStubBuilder:()=>re.defaultApduReceiverServiceStubBuilder,defaultApduSenderServiceStubBuilder:()=>oe.defaultApduSenderServiceStubBuilder,formatApduReceivedLog:()=>A.formatApduReceivedLog,formatApduSentLog:()=>A.formatApduSentLog,hexaStringToBuffer:()=>a.hexaStringToBuffer,isBase64String:()=>D.isBase64String,isCommandErrorCode:()=>I.isCommandErrorCode,isHexaString:()=>a.isHexaString,isSuccessCommandResult:()=>m.isSuccessCommandResult});module.exports=ve(e);var S=require("./apdu/model/Apdu"),f=require("./apdu/utils/ApduBuilder"),y=require("./apdu/utils/ApduParser");r(e,require("./apdu/utils/AppBuilderError"),module.exports);var C=require("./apdu/utils/ByteArrayBuilder"),g=require("./apdu/utils/ByteArrayParser"),c=require("./command/Errors"),m=require("./command/model/CommandResult"),L=require("./command/os/CloseAppCommand"),E=require("./command/os/GetAppAndVersionCommand"),x=require("./command/os/GetBatteryStatusCommand"),B=require("./command/os/GetOsVersionCommand"),G=require("./command/os/ListAppsCommand"),R=require("./command/os/LoadCertificateCommand"),M=require("./command/os/OpenAppCommand"),I=require("./command/utils/CommandErrors"),O=require("./command/utils/CommandUtils"),d=require("./command/utils/GlobalCommandError"),n=require("./device/DeviceModel"),T=require("./device/DeviceStatus"),b=require("./device-action/model/DeviceActionState"),h=require("./device-action/model/UserInteractionRequired"),U=require("./device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction"),t=require("./device-action/os/Errors"),F=require("./device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction"),P=require("./device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction"),V=require("./device-action/os/GoToDashboard/GoToDashboardDeviceAction"),k=require("./device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction"),W=require("./device-action/os/ListApps/ListAppsDeviceAction"),_=require("./device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction"),w=require("./device-action/os/OpenAppDeviceAction/OpenAppDeviceAction"),H=require("./device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction"),K=require("./device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction"),X=require("./device-action/xstate-utils/XStateDeviceAction"),q=require("./device-model/data/StaticDeviceModelDataSource"),N=require("./device-model/model/BleDeviceInfos"),Y=require("./device-model/model/DeviceModel"),j=require("./device-session/ApduResponse");r(e,require("./device-session/data/FramerConst"),module.exports);var z=require("./device-session/DeviceSessionState"),J=require("./secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction"),Q=require("./secure-channel/device-action/InstallApp/InstallAppDeviceAction"),Z=require("./secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction"),$=require("./secure-channel/device-action/UninstallApp/UninstallAppDeviceAction"),ee=require("../internal/secure-channel/model/Errors"),re=require("./device-session/service/DefaultApduReceiverService.stub"),oe=require("./device-session/service/DefaultApduSenderService.stub"),te=require("./device-session/utils/FramerUtils"),pe=require("./DeviceManagementKit"),ie=require("./DeviceManagementKitBuilder");r(e,require("./Error"),module.exports);var me=require("./logger-subscriber/model/LogLevel"),ne=require("./logger-subscriber/service/ConsoleLogger"),ae=require("./logger-subscriber/service/DefaultLogTagFormatter"),se=require("./logger-subscriber/service/WebLogsExporterLogger"),fe=require("./transport/model/ConnectedDevice"),ce=require("./transport/model/DeviceConnectionStateMachine");r(e,require("./transport/model/Errors"),module.exports);var xe=require("./transport/model/TransportConnectedDevice"),de=require("./transport/model/TransportConnectedDevice.stub");r(e,require("./types"),module.exports);var A=require("./utils/apduLogs"),D=require("./utils/Base64String"),a=require("./utils/HexaString");0&&(module.exports={APDU_MAX_PAYLOAD,Apdu,ApduBuilder,ApduParser,ApduResponse,AppAlreadyInstalledDAError,BatteryStatusType,BleDeviceInfos,ByteArrayBuilder,ByteArrayParser,CallTaskInAppDeviceAction,CloseAppCommand,CommandResultFactory,CommandResultStatus,CommandUtils,ConnectedDevice,ConsoleLogger,DefaultLogTagFormatter,DeviceActionStatus,DeviceConnectionStateMachine,DeviceLockedError,DeviceManagementKit,DeviceManagementKitBuilder,DeviceModel,DeviceModelId,DeviceSessionStateType,DeviceStatus,FramerUtils,GenuineCheckDeviceAction,GetAppAndVersionCommand,GetBatteryStatusCommand,GetDeviceMetadataDeviceAction,GetDeviceStatusDeviceAction,GetOsVersionCommand,GlobalCommandError,GlobalCommandErrorHandler,GoToDashboardDeviceAction,InstallAppDeviceAction,InstallOrUpdateAppsDeviceAction,InvalidGetFirmwareMetadataResponseError,InvalidStatusWordError,LEDGER_VENDOR_ID,ListAppsCommand,ListAppsDeviceAction,ListAppsWithMetadataDeviceAction,ListInstalledAppsDeviceAction,LoadCertificateCommand,LogLevel,OpenAppCommand,OpenAppDeviceAction,OpenAppWithDependenciesDeviceAction,OutOfMemoryDAError,RefusedByUserDAError,SecureChannelError,SendCommandInAppDeviceAction,StaticDeviceModelDataSource,TransportConnectedDevice,TransportDeviceModel,UninstallAppDeviceAction,UnknownDAError,UnsupportedFirmwareDAError,UserInteractionRequired,WebLogsExporterLogger,XStateDeviceAction,base64StringToBuffer,bufferToHexaString,connectedDeviceStubBuilder,defaultApduReceiverServiceStubBuilder,defaultApduSenderServiceStubBuilder,formatApduReceivedLog,formatApduSentLog,hexaStringToBuffer,isBase64String,isCommandErrorCode,isHexaString,isSuccessCommandResult,...require("./apdu/utils/AppBuilderError"),...require("./device-session/data/FramerConst"),...require("./Error"),...require("./transport/model/Errors"),...require("./types")});
|
|
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 {\n InvalidGetFirmwareMetadataResponseError,\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 GetAppAndVersionCommand,\n type GetAppAndVersionResponse,\n} from \"@api/command/os/GetAppAndVersionCommand\";\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 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 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 {\n AppAlreadyInstalledDAError,\n DeviceLockedError,\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 { 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 {\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 { 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 { UninstallAppDeviceAction } from \"@api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction\";\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 { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nexport { ConsoleLogger } from \"@api/logger-subscriber/service/ConsoleLogger\";\nexport { WebLogsExporterLogger } from \"@api/logger-subscriber/service/WebLogsExporterLogger\";\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 { base64StringToBuffer, isBase64String } from \"@api/utils/Base64String\";\nexport {\n bufferToHexaString,\n hexaStringToBuffer,\n isHexaString,\n} from \"@api/utils/HexaString\";\n"],
|
|
5
|
-
"mappings": "meAAA,IAAAA,EAAA,GAAAC,GAAAD,EAAA,
|
|
6
|
-
"names": ["api_exports", "__export", "__toCommonJS", "import_Apdu", "import_ApduBuilder", "import_ApduParser", "__reExport", "import_ByteArrayBuilder", "import_ByteArrayParser", "import_Errors", "import_CommandResult", "import_CloseAppCommand", "import_GetAppAndVersionCommand", "import_GetBatteryStatusCommand", "import_GetOsVersionCommand", "import_ListAppsCommand", "import_LoadCertificateCommand", "import_OpenAppCommand", "import_CommandErrors", "import_CommandUtils", "import_GlobalCommandError", "import_DeviceModel", "import_DeviceStatus", "import_DeviceActionState", "import_UserInteractionRequired", "import_CallTaskInAppDeviceAction", "import_GetDeviceMetadataDeviceAction", "import_GetDeviceStatusDeviceAction", "import_GoToDashboardDeviceAction", "import_InstallOrUpdateAppsDeviceAction", "import_ListAppsDeviceAction", "import_ListAppsWithMetadataDeviceAction", "import_OpenAppDeviceAction", "import_OpenAppWithDependenciesDeviceAction", "import_SendCommandInAppDeviceAction", "import_XStateDeviceAction", "import_StaticDeviceModelDataSource", "import_BleDeviceInfos", "import_ApduResponse", "import_DeviceSessionState", "import_GenuineCheckDeviceAction", "import_InstallAppDeviceAction", "import_ListInstalledAppsDeviceAction", "import_UninstallAppDeviceAction", "import_DefaultApduReceiverService", "import_DefaultApduSenderService", "import_FramerUtils", "import_DeviceManagementKit", "import_DeviceManagementKitBuilder", "import_LogLevel", "import_ConsoleLogger", "import_WebLogsExporterLogger", "import_ConnectedDevice", "import_DeviceConnectionStateMachine", "import_TransportConnectedDevice", "import_apduLogs", "import_Base64String", "import_HexaString"]
|
|
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 {\n InvalidGetFirmwareMetadataResponseError,\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 GetAppAndVersionCommand,\n type GetAppAndVersionResponse,\n} from \"@api/command/os/GetAppAndVersionCommand\";\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 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 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 {\n AppAlreadyInstalledDAError,\n DeviceLockedError,\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 { 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 {\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 { 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 { UninstallAppDeviceAction } from \"@api/secure-channel/device-action/UninstallApp/UninstallAppDeviceAction\";\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 { 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 { 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 { base64StringToBuffer, isBase64String } from \"@api/utils/Base64String\";\nexport {\n bufferToHexaString,\n hexaStringToBuffer,\n isHexaString,\n} from \"@api/utils/HexaString\";\n"],
|
|
5
|
+
"mappings": "meAAA,IAAAA,EAAA,GAAAC,GAAAD,EAAA,8nHAAAE,GAAAF,GAEA,IAAAG,EAAqB,gCACrBC,EAA8C,uCAC9CC,EAA2B,sCAC3BC,EAAAN,EAAc,2CALd,gBAMA,IAAAO,EAAiC,4CACjCC,EAAgC,2CAChCC,EAGO,+BACPC,EAIO,4CACPC,EAAgC,2CAChCC,EAGO,mDACPC,EAKO,mDACPC,EAGO,+CACPC,EAKO,2CACPC,EAIO,kDACPC,EAGO,0CACPC,EAAmC,4CACnCC,EAA6B,2CAC7BC,EAGO,iDACPC,EAIO,mCACPC,EAA6B,oCAE7BC,EAGO,sDACPC,EAAwC,4DACxCC,EAA0C,qFAC1ChB,EAOO,wCACPiB,EAA8C,iFAC9CC,EAA4C,6EAC5CC,EAA0C,yEAC1CC,EAAgD,qFAChDC,EAAqC,+DACrCC,EAAiD,uFACjDC,EAAoC,yEACpCC,EAAoD,6FACpDC,EAA6C,2FAC7CC,EAGO,8DACPC,EAA4C,8DAC5CC,EAA+B,kDAC/BhB,EAAqC,+CACrCiB,EAA6B,4CAC7BhC,EAAAN,EAAc,gDA3Fd,gBA4FA,IAAAuC,EAGO,kDACPC,EAAyC,mFACzCC,EAAuC,+EACvCC,EAA8C,6FAC9CC,EAAyC,mFACzClC,GAAmC,iDAEnCmC,GAAsD,uEACtDC,GAAoD,qEACpDC,GAA4B,iDAC5BC,GAAoC,oCACpCC,GAA2C,2CAC3C1C,EAAAN,EAAc,sBA3Gd,gBA4GA,IAAAiD,GAAyB,iDACzBC,GAA8B,wDAC9BC,GAAuC,iEAEvCC,GAAsC,gEACtCC,GAAgC,gDAChCC,GAGO,6DACPhD,EAAAN,EAAc,uCAtHd,gBAuHA,IAAAuD,GAAyC,yDACzCA,GAA2C,8DAC3CjD,EAAAN,EAAc,sBAzHd,gBA0HA,IAAAwD,EAAyD,+BACzDC,EAAqD,mCACrDC,EAIO",
|
|
6
|
+
"names": ["api_exports", "__export", "__toCommonJS", "import_Apdu", "import_ApduBuilder", "import_ApduParser", "__reExport", "import_ByteArrayBuilder", "import_ByteArrayParser", "import_Errors", "import_CommandResult", "import_CloseAppCommand", "import_GetAppAndVersionCommand", "import_GetBatteryStatusCommand", "import_GetOsVersionCommand", "import_ListAppsCommand", "import_LoadCertificateCommand", "import_OpenAppCommand", "import_CommandErrors", "import_CommandUtils", "import_GlobalCommandError", "import_DeviceModel", "import_DeviceStatus", "import_DeviceActionState", "import_UserInteractionRequired", "import_CallTaskInAppDeviceAction", "import_GetDeviceMetadataDeviceAction", "import_GetDeviceStatusDeviceAction", "import_GoToDashboardDeviceAction", "import_InstallOrUpdateAppsDeviceAction", "import_ListAppsDeviceAction", "import_ListAppsWithMetadataDeviceAction", "import_OpenAppDeviceAction", "import_OpenAppWithDependenciesDeviceAction", "import_SendCommandInAppDeviceAction", "import_XStateDeviceAction", "import_StaticDeviceModelDataSource", "import_BleDeviceInfos", "import_ApduResponse", "import_DeviceSessionState", "import_GenuineCheckDeviceAction", "import_InstallAppDeviceAction", "import_ListInstalledAppsDeviceAction", "import_UninstallAppDeviceAction", "import_DefaultApduReceiverService", "import_DefaultApduSenderService", "import_FramerUtils", "import_DeviceManagementKit", "import_DeviceManagementKitBuilder", "import_LogLevel", "import_ConsoleLogger", "import_DefaultLogTagFormatter", "import_WebLogsExporterLogger", "import_ConnectedDevice", "import_DeviceConnectionStateMachine", "import_TransportConnectedDevice", "import_apduLogs", "import_Base64String", "import_HexaString"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var a=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var p=(t,r,n,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let e of i(r))!s.call(t,e)&&e!==n&&a(t,e,{get:()=>r[e],enumerable:!(o=g(r,e))||o.enumerable});return t};var b=t=>p(a({},"__esModule",{value:!0}),t);var y={};module.exports=b(y);
|
|
2
2
|
//# sourceMappingURL=LogSubscriberOptions.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/api/logger-subscriber/model/LogSubscriberOptions.ts"],
|
|
4
|
-
"sourcesContent": ["export type LogSubscriberData = Record<string, unknown>;\n\nexport type LogSubscriberOptions = {\n readonly tag: string;\n readonly timestamp: number;\n readonly data?: LogSubscriberData;\n};\n"],
|
|
4
|
+
"sourcesContent": ["export type LogSubscriberData = Record<string, unknown>;\n\n// Tag can be a single string or an array of strings for hierarchical tags\nexport type LogTag = string | string[];\n\nexport type LogSubscriberOptions = {\n // Formatted tag string (subscribers always receive a formatted string)\n readonly tag: string;\n readonly timestamp: number;\n readonly data?: LogSubscriberData;\n};\n"],
|
|
5
5
|
"mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
|
|
6
6
|
"names": ["LogSubscriberOptions_exports", "__toCommonJS"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var l=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var L=(o,e)=>{for(var a in e)l(o,a,{get:e[a],enumerable:!0})},h=(o,e,a,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of s(e))!c.call(o,r)&&r!==a&&l(o,r,{get:()=>e[r],enumerable:!(i=g(e,r))||i.enumerable});return o};var n=o=>h(l({},"__esModule",{value:!0}),o);var v={};L(v,{ConsoleLogger:()=>b});module.exports=n(v);var t=require("../../logger-subscriber/model/LogLevel");class b{maxLevel;constructor(e=t.LogLevel.Debug){this.maxLevel=e}log(e,a,i){const r
|
|
1
|
+
"use strict";var l=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var L=(o,e)=>{for(var a in e)l(o,a,{get:e[a],enumerable:!0})},h=(o,e,a,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of s(e))!c.call(o,r)&&r!==a&&l(o,r,{get:()=>e[r],enumerable:!(i=g(e,r))||i.enumerable});return o};var n=o=>h(l({},"__esModule",{value:!0}),o);var v={};L(v,{ConsoleLogger:()=>b});module.exports=n(v);var t=require("../../logger-subscriber/model/LogLevel");class b{maxLevel;constructor(e=t.LogLevel.Debug){this.maxLevel=e}log(e,a,i){const r=i.tag;switch(e){case t.LogLevel.Info:{this.maxLevel>=t.LogLevel.Info&&this.logWithData(r,console.info,a,i);break}case t.LogLevel.Warning:{this.maxLevel>=t.LogLevel.Warning&&this.logWithData(r,console.warn,a,i);break}case t.LogLevel.Debug:{this.maxLevel>=t.LogLevel.Debug&&this.logWithData(r,console.debug,a,i);break}case t.LogLevel.Error:{this.maxLevel>=t.LogLevel.Error&&this.logWithData(r,console.error,a,i);break}case t.LogLevel.Fatal:{this.maxLevel>=t.LogLevel.Fatal&&this.logWithData(r,console.error,a,i);break}default:this.logWithData(r,console.log,a,i)}}logWithData(e,a,i,r){r.data?a(e,i,r.data):a(e,i)}}0&&(module.exports={ConsoleLogger});
|
|
2
2
|
//# sourceMappingURL=ConsoleLogger.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/api/logger-subscriber/service/ConsoleLogger.ts"],
|
|
4
|
-
"sourcesContent": ["import { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nimport { type LogSubscriberOptions } from \"@api/logger-subscriber/model/LogSubscriberOptions\";\nimport { type LoggerSubscriberService } from \"@api/logger-subscriber/service/LoggerSubscriberService\";\n\nexport class ConsoleLogger implements LoggerSubscriberService {\n private readonly maxLevel: LogLevel;\n\n constructor(level: LogLevel = LogLevel.Debug) {\n this.maxLevel = level;\n }\n\n log(\n level: LogLevel | null,\n message: string,\n options: LogSubscriberOptions,\n ): void {\n const tag =
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAyB,iDAIlB,MAAMF,CAAiD,CAC3C,SAEjB,YAAYG,EAAkB,WAAS,MAAO,CAC5C,KAAK,SAAWA,CAClB,CAEA,IACEA,EACAC,EACAC,EACM,CACN,MAAMC,
|
|
4
|
+
"sourcesContent": ["import { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nimport { type LogSubscriberOptions } from \"@api/logger-subscriber/model/LogSubscriberOptions\";\nimport { type LoggerSubscriberService } from \"@api/logger-subscriber/service/LoggerSubscriberService\";\n\nexport class ConsoleLogger implements LoggerSubscriberService {\n private readonly maxLevel: LogLevel;\n\n constructor(level: LogLevel = LogLevel.Debug) {\n this.maxLevel = level;\n }\n\n log(\n level: LogLevel | null,\n message: string,\n options: LogSubscriberOptions,\n ): void {\n const tag = options.tag;\n\n switch (level) {\n case LogLevel.Info: {\n if (this.maxLevel >= LogLevel.Info) {\n this.logWithData(tag, console.info, message, options);\n }\n break;\n }\n case LogLevel.Warning: {\n if (this.maxLevel >= LogLevel.Warning) {\n this.logWithData(tag, console.warn, message, options);\n }\n break;\n }\n case LogLevel.Debug: {\n if (this.maxLevel >= LogLevel.Debug) {\n this.logWithData(tag, console.debug, message, options);\n }\n break;\n }\n case LogLevel.Error: {\n if (this.maxLevel >= LogLevel.Error) {\n this.logWithData(tag, console.error, message, options);\n }\n break;\n }\n case LogLevel.Fatal: {\n if (this.maxLevel >= LogLevel.Fatal) {\n this.logWithData(tag, console.error, message, options);\n }\n break;\n }\n default:\n this.logWithData(tag, console.log, message, options);\n }\n }\n\n private logWithData(\n tag: string,\n logFunction: (...args: unknown[]) => void,\n message: string,\n options: LogSubscriberOptions,\n ): void {\n if (options.data) {\n logFunction(tag, message, options.data);\n } else {\n logFunction(tag, message);\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAyB,iDAIlB,MAAMF,CAAiD,CAC3C,SAEjB,YAAYG,EAAkB,WAAS,MAAO,CAC5C,KAAK,SAAWA,CAClB,CAEA,IACEA,EACAC,EACAC,EACM,CACN,MAAMC,EAAMD,EAAQ,IAEpB,OAAQF,EAAO,CACb,KAAK,WAAS,KAAM,CACd,KAAK,UAAY,WAAS,MAC5B,KAAK,YAAYG,EAAK,QAAQ,KAAMF,EAASC,CAAO,EAEtD,KACF,CACA,KAAK,WAAS,QAAS,CACjB,KAAK,UAAY,WAAS,SAC5B,KAAK,YAAYC,EAAK,QAAQ,KAAMF,EAASC,CAAO,EAEtD,KACF,CACA,KAAK,WAAS,MAAO,CACf,KAAK,UAAY,WAAS,OAC5B,KAAK,YAAYC,EAAK,QAAQ,MAAOF,EAASC,CAAO,EAEvD,KACF,CACA,KAAK,WAAS,MAAO,CACf,KAAK,UAAY,WAAS,OAC5B,KAAK,YAAYC,EAAK,QAAQ,MAAOF,EAASC,CAAO,EAEvD,KACF,CACA,KAAK,WAAS,MAAO,CACf,KAAK,UAAY,WAAS,OAC5B,KAAK,YAAYC,EAAK,QAAQ,MAAOF,EAASC,CAAO,EAEvD,KACF,CACA,QACE,KAAK,YAAYC,EAAK,QAAQ,IAAKF,EAASC,CAAO,CACvD,CACF,CAEQ,YACNC,EACAC,EACAH,EACAC,EACM,CACFA,EAAQ,KACVE,EAAYD,EAAKF,EAASC,EAAQ,IAAI,EAEtCE,EAAYD,EAAKF,CAAO,CAE5B,CACF",
|
|
6
6
|
"names": ["ConsoleLogger_exports", "__export", "ConsoleLogger", "__toCommonJS", "import_LogLevel", "level", "message", "options", "tag", "logFunction"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var t=require("../../logger-subscriber/model/LogLevel"),g=require("./ConsoleLogger");const d=vi.spyOn(console,"warn").mockImplementation(vi.fn()),n=vi.spyOn(console,"info").mockImplementation(vi.fn()),r=vi.spyOn(console,"debug").mockImplementation(vi.fn()),a=vi.spyOn(console,"error").mockImplementation(vi.fn()),s=vi.spyOn(console,"log").mockImplementation(vi.fn());let o;const e={data:{key:"value"},timestamp:1,tag:"tag"},l="message";describe("ConsoleLogger",()=>{afterAll(()=>{vi.restoreAllMocks()}),describe("default level (LogLevel.DEBUG)",()=>{beforeEach(()=>{vi.clearAllMocks(),o=new g.ConsoleLogger}),describe("log",()=>{it("should log Info level",()=>{o.log(t.LogLevel.Info,l,e),expect(n).toHaveBeenCalledWith(
|
|
1
|
+
"use strict";var t=require("../../logger-subscriber/model/LogLevel"),g=require("./ConsoleLogger");const d=vi.spyOn(console,"warn").mockImplementation(vi.fn()),n=vi.spyOn(console,"info").mockImplementation(vi.fn()),r=vi.spyOn(console,"debug").mockImplementation(vi.fn()),a=vi.spyOn(console,"error").mockImplementation(vi.fn()),s=vi.spyOn(console,"log").mockImplementation(vi.fn());let o;const e={data:{key:"value"},timestamp:1,tag:"[tag]"},l="message";describe("ConsoleLogger",()=>{afterAll(()=>{vi.restoreAllMocks()}),describe("default level (LogLevel.DEBUG)",()=>{beforeEach(()=>{vi.clearAllMocks(),o=new g.ConsoleLogger}),describe("log",()=>{it("should log Info level",()=>{o.log(t.LogLevel.Info,l,e),expect(n).toHaveBeenCalledWith(e.tag,l,e.data)}),it("should log Info level with a custom tag",()=>{const i="[custom-tag]";o.log(t.LogLevel.Info,l,{...e,tag:i}),expect(n).toHaveBeenCalledWith(i,l,e.data)}),it("should log Warn level",()=>{o.log(t.LogLevel.Warning,l,e),expect(d).toHaveBeenCalledWith(e.tag,l,e.data)}),it("should log Debug level",()=>{o.log(t.LogLevel.Debug,l,e),expect(r).toHaveBeenCalledWith(e.tag,l,e.data)}),it("should log Fatal level",()=>{o.log(t.LogLevel.Fatal,l,e),expect(a).toHaveBeenCalledWith(e.tag,l,e.data)}),it("should default to Log level if none present",()=>{o.log(null,l,e),expect(s).toHaveBeenCalledWith(e.tag,l,e.data)}),it("should log Error level",()=>{o.log(t.LogLevel.Error,l,e),expect(a).toHaveBeenCalledWith(e.tag,l,e.data)})})}),describe("custom level (LogLevel.Info)",()=>{beforeEach(()=>{vi.clearAllMocks(),o=new g.ConsoleLogger(t.LogLevel.Info)}),describe("log",()=>{it("should log Info level",()=>{o.log(t.LogLevel.Info,l,e),expect(n).toHaveBeenCalledWith(e.tag,l,e.data)}),it("should log Info level with a custom tag",()=>{const i="[custom-tag]";o.log(t.LogLevel.Info,l,{...e,tag:i}),expect(n).toHaveBeenCalledWith(i,l,e.data)}),it("should log Warn level",()=>{o.log(t.LogLevel.Warning,l,e),expect(d).toHaveBeenCalledWith(e.tag,l,e.data)}),it("should not log Debug level",()=>{o.log(t.LogLevel.Debug,l,e),expect(r).not.toHaveBeenCalled()}),it("should default to Log level if none present",()=>{o.log(null,l,e),expect(s).toHaveBeenCalledWith(e.tag,l,e.data)}),it("should log Error level",()=>{o.log(t.LogLevel.Error,l,e),expect(a).toHaveBeenCalledWith(e.tag,l,e.data)}),it("should log Fatal level",()=>{o.log(t.LogLevel.Fatal,l,e),expect(a).toHaveBeenCalledWith(e.tag,l,e.data)})})}),describe("custom level (LogLevel.Warning)",()=>{beforeEach(()=>{vi.clearAllMocks(),o=new g.ConsoleLogger(t.LogLevel.Warning)}),describe("log",()=>{it("should not log Info level",()=>{o.log(t.LogLevel.Info,l,e),expect(n).not.toHaveBeenCalled()}),it("should log Warn level",()=>{o.log(t.LogLevel.Warning,l,e),expect(d).toHaveBeenCalledWith(e.tag,l,e.data)}),it("should not log Debug level",()=>{o.log(t.LogLevel.Debug,l,e),expect(r).not.toHaveBeenCalled()}),it("should default to Log level if none present",()=>{o.log(null,l,e),expect(s).toHaveBeenCalledWith(e.tag,l,e.data)}),it("should log Error level",()=>{o.log(t.LogLevel.Error,l,e),expect(a).toHaveBeenCalledWith(e.tag,l,e.data)}),it("should log Fatal level",()=>{o.log(t.LogLevel.Fatal,l,e),expect(a).toHaveBeenCalledWith(e.tag,l,e.data)})})}),describe("custom level (LogLevel.Error)",()=>{beforeEach(()=>{vi.clearAllMocks(),o=new g.ConsoleLogger(t.LogLevel.Error)}),describe("log",()=>{it("should not log Info level",()=>{o.log(t.LogLevel.Info,l,e),expect(n).not.toHaveBeenCalled()}),it("should not log Warn level",()=>{o.log(t.LogLevel.Warning,l,e),expect(d).not.toHaveBeenCalled()}),it("should not log Debug level",()=>{o.log(t.LogLevel.Debug,l,e),expect(r).not.toHaveBeenCalled()}),it("should default to Log level if none present",()=>{o.log(null,l,e),expect(s).toHaveBeenCalledWith(e.tag,l,e.data)}),it("should log Error level",()=>{o.log(t.LogLevel.Error,l,e),expect(a).toHaveBeenCalledWith(e.tag,l,e.data)}),it("should log Fatal level",()=>{o.log(t.LogLevel.Fatal,l,e),expect(a).toHaveBeenCalledWith(e.tag,l,e.data)})})}),describe("custom level (LogLevel.Fatal)",()=>{beforeEach(()=>{vi.clearAllMocks(),o=new g.ConsoleLogger(t.LogLevel.Fatal)}),describe("log",()=>{it("should not log Info level",()=>{o.log(t.LogLevel.Info,l,e),expect(n).not.toHaveBeenCalled()}),it("should not log Warn level",()=>{o.log(t.LogLevel.Warning,l,e),expect(d).not.toHaveBeenCalled()}),it("should not log Debug level",()=>{o.log(t.LogLevel.Debug,l,e),expect(r).not.toHaveBeenCalled()}),it("should log Fatal level",()=>{o.log(t.LogLevel.Fatal,l,e),expect(a).toHaveBeenCalledWith(e.tag,l,e.data)})})})});
|
|
2
2
|
//# sourceMappingURL=ConsoleLogger.test.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/api/logger-subscriber/service/ConsoleLogger.test.ts"],
|
|
4
|
-
"sourcesContent": ["import { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nimport { type LogSubscriberOptions } from \"@api/logger-subscriber/model/LogSubscriberOptions\";\n\nimport { ConsoleLogger } from \"./ConsoleLogger\";\n\nconst warn = vi.spyOn(console, \"warn\").mockImplementation(vi.fn());\nconst info = vi.spyOn(console, \"info\").mockImplementation(vi.fn());\nconst debug = vi.spyOn(console, \"debug\").mockImplementation(vi.fn());\nconst error = vi.spyOn(console, \"error\").mockImplementation(vi.fn());\nconst log = vi.spyOn(console, \"log\").mockImplementation(vi.fn());\n\nlet logger: ConsoleLogger;\nconst options: LogSubscriberOptions = {\n data: { key: \"value\" },\n timestamp: 1,\n tag: \"tag\",\n};\nconst message = \"message\";\n\ndescribe(\"ConsoleLogger\", () => {\n afterAll(() => {\n vi.restoreAllMocks();\n });\n\n describe(\"default level (LogLevel.DEBUG)\", () => {\n beforeEach(() => {\n vi.clearAllMocks();\n logger = new ConsoleLogger();\n });\n\n describe(\"log\", () => {\n it(\"should log Info level\", () => {\n logger.log(LogLevel.Info, message, options);\n expect(info).toHaveBeenCalledWith(
|
|
5
|
-
"mappings": "aAAA,IAAAA,EAAyB,iDAGzBC,EAA8B,2BAE9B,MAAMC,EAAO,GAAG,MAAM,QAAS,MAAM,EAAE,mBAAmB,GAAG,GAAG,CAAC,EAC3DC,EAAO,GAAG,MAAM,QAAS,MAAM,EAAE,mBAAmB,GAAG,GAAG,CAAC,EAC3DC,EAAQ,GAAG,MAAM,QAAS,OAAO,EAAE,mBAAmB,GAAG,GAAG,CAAC,EAC7DC,EAAQ,GAAG,MAAM,QAAS,OAAO,EAAE,mBAAmB,GAAG,GAAG,CAAC,EAC7DC,EAAM,GAAG,MAAM,QAAS,KAAK,EAAE,mBAAmB,GAAG,GAAG,CAAC,EAE/D,IAAIC,
|
|
4
|
+
"sourcesContent": ["import { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nimport { type LogSubscriberOptions } from \"@api/logger-subscriber/model/LogSubscriberOptions\";\n\nimport { ConsoleLogger } from \"./ConsoleLogger\";\n\nconst warn = vi.spyOn(console, \"warn\").mockImplementation(vi.fn());\nconst info = vi.spyOn(console, \"info\").mockImplementation(vi.fn());\nconst debug = vi.spyOn(console, \"debug\").mockImplementation(vi.fn());\nconst error = vi.spyOn(console, \"error\").mockImplementation(vi.fn());\nconst log = vi.spyOn(console, \"log\").mockImplementation(vi.fn());\n\nlet logger: ConsoleLogger;\n// Tags are pre-formatted by the publisher before reaching subscribers\nconst options: LogSubscriberOptions = {\n data: { key: \"value\" },\n timestamp: 1,\n tag: \"[tag]\",\n};\nconst message = \"message\";\n\ndescribe(\"ConsoleLogger\", () => {\n afterAll(() => {\n vi.restoreAllMocks();\n });\n\n describe(\"default level (LogLevel.DEBUG)\", () => {\n beforeEach(() => {\n vi.clearAllMocks();\n logger = new ConsoleLogger();\n });\n\n describe(\"log\", () => {\n it(\"should log Info level\", () => {\n logger.log(LogLevel.Info, message, options);\n expect(info).toHaveBeenCalledWith(options.tag, message, options.data);\n });\n\n it(\"should log Info level with a custom tag\", () => {\n const tag = \"[custom-tag]\";\n logger.log(LogLevel.Info, message, { ...options, tag });\n expect(info).toHaveBeenCalledWith(tag, message, options.data);\n });\n\n it(\"should log Warn level\", () => {\n logger.log(LogLevel.Warning, message, options);\n expect(warn).toHaveBeenCalledWith(options.tag, message, options.data);\n });\n\n it(\"should log Debug level\", () => {\n logger.log(LogLevel.Debug, message, options);\n expect(debug).toHaveBeenCalledWith(options.tag, message, options.data);\n });\n\n it(\"should log Fatal level\", () => {\n logger.log(LogLevel.Fatal, message, options);\n expect(error).toHaveBeenCalledWith(options.tag, message, options.data);\n });\n\n it(\"should default to Log level if none present\", () => {\n logger.log(null, message, options);\n expect(log).toHaveBeenCalledWith(options.tag, message, options.data);\n });\n\n it(\"should log Error level\", () => {\n logger.log(LogLevel.Error, message, options);\n expect(error).toHaveBeenCalledWith(options.tag, message, options.data);\n });\n });\n });\n\n describe(\"custom level (LogLevel.Info)\", () => {\n beforeEach(() => {\n vi.clearAllMocks();\n logger = new ConsoleLogger(LogLevel.Info);\n });\n\n describe(\"log\", () => {\n it(\"should log Info level\", () => {\n logger.log(LogLevel.Info, message, options);\n expect(info).toHaveBeenCalledWith(options.tag, message, options.data);\n });\n\n it(\"should log Info level with a custom tag\", () => {\n const tag = \"[custom-tag]\";\n logger.log(LogLevel.Info, message, { ...options, tag });\n expect(info).toHaveBeenCalledWith(tag, message, options.data);\n });\n\n it(\"should log Warn level\", () => {\n logger.log(LogLevel.Warning, message, options);\n expect(warn).toHaveBeenCalledWith(options.tag, message, options.data);\n });\n\n it(\"should not log Debug level\", () => {\n logger.log(LogLevel.Debug, message, options);\n expect(debug).not.toHaveBeenCalled();\n });\n\n it(\"should default to Log level if none present\", () => {\n logger.log(null, message, options);\n expect(log).toHaveBeenCalledWith(options.tag, message, options.data);\n });\n\n it(\"should log Error level\", () => {\n logger.log(LogLevel.Error, message, options);\n expect(error).toHaveBeenCalledWith(options.tag, message, options.data);\n });\n\n it(\"should log Fatal level\", () => {\n logger.log(LogLevel.Fatal, message, options);\n expect(error).toHaveBeenCalledWith(options.tag, message, options.data);\n });\n });\n });\n\n describe(\"custom level (LogLevel.Warning)\", () => {\n beforeEach(() => {\n vi.clearAllMocks();\n logger = new ConsoleLogger(LogLevel.Warning);\n });\n\n describe(\"log\", () => {\n it(\"should not log Info level\", () => {\n logger.log(LogLevel.Info, message, options);\n expect(info).not.toHaveBeenCalled();\n });\n\n it(\"should log Warn level\", () => {\n logger.log(LogLevel.Warning, message, options);\n expect(warn).toHaveBeenCalledWith(options.tag, message, options.data);\n });\n\n it(\"should not log Debug level\", () => {\n logger.log(LogLevel.Debug, message, options);\n expect(debug).not.toHaveBeenCalled();\n });\n\n it(\"should default to Log level if none present\", () => {\n logger.log(null, message, options);\n expect(log).toHaveBeenCalledWith(options.tag, message, options.data);\n });\n\n it(\"should log Error level\", () => {\n logger.log(LogLevel.Error, message, options);\n expect(error).toHaveBeenCalledWith(options.tag, message, options.data);\n });\n\n it(\"should log Fatal level\", () => {\n logger.log(LogLevel.Fatal, message, options);\n expect(error).toHaveBeenCalledWith(options.tag, message, options.data);\n });\n });\n });\n\n describe(\"custom level (LogLevel.Error)\", () => {\n beforeEach(() => {\n vi.clearAllMocks();\n logger = new ConsoleLogger(LogLevel.Error);\n });\n\n describe(\"log\", () => {\n it(\"should not log Info level\", () => {\n logger.log(LogLevel.Info, message, options);\n expect(info).not.toHaveBeenCalled();\n });\n\n it(\"should not log Warn level\", () => {\n logger.log(LogLevel.Warning, message, options);\n expect(warn).not.toHaveBeenCalled();\n });\n\n it(\"should not log Debug level\", () => {\n logger.log(LogLevel.Debug, message, options);\n expect(debug).not.toHaveBeenCalled();\n });\n\n it(\"should default to Log level if none present\", () => {\n logger.log(null, message, options);\n expect(log).toHaveBeenCalledWith(options.tag, message, options.data);\n });\n\n it(\"should log Error level\", () => {\n logger.log(LogLevel.Error, message, options);\n expect(error).toHaveBeenCalledWith(options.tag, message, options.data);\n });\n\n it(\"should log Fatal level\", () => {\n logger.log(LogLevel.Fatal, message, options);\n expect(error).toHaveBeenCalledWith(options.tag, message, options.data);\n });\n });\n });\n\n describe(\"custom level (LogLevel.Fatal)\", () => {\n beforeEach(() => {\n vi.clearAllMocks();\n logger = new ConsoleLogger(LogLevel.Fatal);\n });\n\n describe(\"log\", () => {\n it(\"should not log Info level\", () => {\n logger.log(LogLevel.Info, message, options);\n expect(info).not.toHaveBeenCalled();\n });\n\n it(\"should not log Warn level\", () => {\n logger.log(LogLevel.Warning, message, options);\n expect(warn).not.toHaveBeenCalled();\n });\n\n it(\"should not log Debug level\", () => {\n logger.log(LogLevel.Debug, message, options);\n expect(debug).not.toHaveBeenCalled();\n });\n\n it(\"should log Fatal level\", () => {\n logger.log(LogLevel.Fatal, message, options);\n expect(error).toHaveBeenCalledWith(options.tag, message, options.data);\n });\n });\n });\n});\n"],
|
|
5
|
+
"mappings": "aAAA,IAAAA,EAAyB,iDAGzBC,EAA8B,2BAE9B,MAAMC,EAAO,GAAG,MAAM,QAAS,MAAM,EAAE,mBAAmB,GAAG,GAAG,CAAC,EAC3DC,EAAO,GAAG,MAAM,QAAS,MAAM,EAAE,mBAAmB,GAAG,GAAG,CAAC,EAC3DC,EAAQ,GAAG,MAAM,QAAS,OAAO,EAAE,mBAAmB,GAAG,GAAG,CAAC,EAC7DC,EAAQ,GAAG,MAAM,QAAS,OAAO,EAAE,mBAAmB,GAAG,GAAG,CAAC,EAC7DC,EAAM,GAAG,MAAM,QAAS,KAAK,EAAE,mBAAmB,GAAG,GAAG,CAAC,EAE/D,IAAIC,EAEJ,MAAMC,EAAgC,CACpC,KAAM,CAAE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C,EAED,GAAG,6BAA8B,IAAM,CACrCK,EAAO,IAAI,WAAS,MAAOE,EAASD,CAAO,EAC3C,OAAOJ,CAAK,EAAE,IAAI,iBAAiB,CACrC,CAAC,EAED,GAAG,yBAA0B,IAAM,CACjCG,EAAO,IAAI,WAAS,MAAOE,EAASD,CAAO,EAC3C,OAAOH,CAAK,EAAE,qBAAqBG,EAAQ,IAAKC,EAASD,EAAQ,IAAI,CACvE,CAAC,CACH,CAAC,CACH,CAAC,CACH,CAAC",
|
|
6
6
|
"names": ["import_LogLevel", "import_ConsoleLogger", "warn", "info", "debug", "error", "log", "logger", "options", "message", "tag"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var f=(o,r)=>{for(var t in r)e(o,t,{get:r[t],enumerable:!0})},n=(o,r,t,m)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of i(r))!p.call(o,a)&&a!==t&&e(o,a,{get:()=>r[a],enumerable:!(m=g(r,a))||m.enumerable});return o};var s=o=>n(e({},"__esModule",{value:!0}),o);var T={};f(T,{DefaultLogTagFormatter:()=>L});module.exports=s(T);class L{format(r){return Array.isArray(r)?r.map(t=>`[${t}]`).join(" "):`[${r}]`}}0&&(module.exports={DefaultLogTagFormatter});
|
|
2
|
+
//# sourceMappingURL=DefaultLogTagFormatter.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/api/logger-subscriber/service/DefaultLogTagFormatter.ts"],
|
|
4
|
+
"sourcesContent": ["import { type LogTag } from \"@api/logger-subscriber/model/LogSubscriberOptions\";\n\nimport { type LogTagFormatter } from \"./LogTagFormatter\";\n\n/**\n * Default implementation of LogTagFormatter.\n * Formats tags as \"[tag1] [tag2] [tag3]\" for arrays, or \"[tag]\" for strings.\n */\nexport class DefaultLogTagFormatter implements LogTagFormatter {\n format(tag: LogTag): string {\n if (Array.isArray(tag)) {\n return tag.map((t) => `[${t}]`).join(\" \");\n }\n return `[${tag}]`;\n }\n}\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4BAAAE,IAAA,eAAAC,EAAAH,GAQO,MAAME,CAAkD,CAC7D,OAAOE,EAAqB,CAC1B,OAAI,MAAM,QAAQA,CAAG,EACZA,EAAI,IAAK,GAAM,IAAI,CAAC,GAAG,EAAE,KAAK,GAAG,EAEnC,IAAIA,CAAG,GAChB,CACF",
|
|
6
|
+
"names": ["DefaultLogTagFormatter_exports", "__export", "DefaultLogTagFormatter", "__toCommonJS", "tag"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var t=require("vitest"),e=require("./DefaultLogTagFormatter");(0,t.describe)("DefaultLogTagFormatter",()=>{const a=new e.DefaultLogTagFormatter;(0,t.describe)("format",()=>{(0,t.it)("should format a single string tag with brackets",()=>{(0,t.expect)(a.format("myTag")).toBe("[myTag]")}),(0,t.it)("should format an empty string tag with brackets",()=>{(0,t.expect)(a.format("")).toBe("[]")}),(0,t.it)("should format a single element array with brackets",()=>{(0,t.expect)(a.format(["myTag"])).toBe("[myTag]")}),(0,t.it)("should format multiple tags with brackets separated by spaces",()=>{(0,t.expect)(a.format(["tag1","tag2","tag3"])).toBe("[tag1] [tag2] [tag3]")}),(0,t.it)("should format an empty array as empty string",()=>{(0,t.expect)(a.format([])).toBe("")}),(0,t.it)("should handle tags with special characters",()=>{(0,t.expect)(a.format(["SignerEth","ContextModule","loader"])).toBe("[SignerEth] [ContextModule] [loader]")})})});
|
|
2
|
+
//# sourceMappingURL=DefaultLogTagFormatter.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/api/logger-subscriber/service/DefaultLogTagFormatter.test.ts"],
|
|
4
|
+
"sourcesContent": ["import { describe, expect, it } from \"vitest\";\n\nimport { DefaultLogTagFormatter } from \"./DefaultLogTagFormatter\";\n\ndescribe(\"DefaultLogTagFormatter\", () => {\n const formatter = new DefaultLogTagFormatter();\n\n describe(\"format\", () => {\n it(\"should format a single string tag with brackets\", () => {\n expect(formatter.format(\"myTag\")).toBe(\"[myTag]\");\n });\n\n it(\"should format an empty string tag with brackets\", () => {\n expect(formatter.format(\"\")).toBe(\"[]\");\n });\n\n it(\"should format a single element array with brackets\", () => {\n expect(formatter.format([\"myTag\"])).toBe(\"[myTag]\");\n });\n\n it(\"should format multiple tags with brackets separated by spaces\", () => {\n expect(formatter.format([\"tag1\", \"tag2\", \"tag3\"])).toBe(\n \"[tag1] [tag2] [tag3]\",\n );\n });\n\n it(\"should format an empty array as empty string\", () => {\n expect(formatter.format([])).toBe(\"\");\n });\n\n it(\"should handle tags with special characters\", () => {\n expect(formatter.format([\"SignerEth\", \"ContextModule\", \"loader\"])).toBe(\n \"[SignerEth] [ContextModule] [loader]\",\n );\n });\n });\n});\n"],
|
|
5
|
+
"mappings": "aAAA,IAAAA,EAAqC,kBAErCC,EAAuC,uCAEvC,YAAS,yBAA0B,IAAM,CACvC,MAAMC,EAAY,IAAI,4BAEtB,YAAS,SAAU,IAAM,IACvB,MAAG,kDAAmD,IAAM,IAC1D,UAAOA,EAAU,OAAO,OAAO,CAAC,EAAE,KAAK,SAAS,CAClD,CAAC,KAED,MAAG,kDAAmD,IAAM,IAC1D,UAAOA,EAAU,OAAO,EAAE,CAAC,EAAE,KAAK,IAAI,CACxC,CAAC,KAED,MAAG,qDAAsD,IAAM,IAC7D,UAAOA,EAAU,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,SAAS,CACpD,CAAC,KAED,MAAG,gEAAiE,IAAM,IACxE,UAAOA,EAAU,OAAO,CAAC,OAAQ,OAAQ,MAAM,CAAC,CAAC,EAAE,KACjD,sBACF,CACF,CAAC,KAED,MAAG,+CAAgD,IAAM,IACvD,UAAOA,EAAU,OAAO,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CACtC,CAAC,KAED,MAAG,6CAA8C,IAAM,IACrD,UAAOA,EAAU,OAAO,CAAC,YAAa,gBAAiB,QAAQ,CAAC,CAAC,EAAE,KACjE,sCACF,CACF,CAAC,CACH,CAAC,CACH,CAAC",
|
|
6
|
+
"names": ["import_vitest", "import_DefaultLogTagFormatter", "formatter"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var a=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var p=(g,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of f(t))!i.call(g,o)&&o!==e&&a(g,o,{get:()=>t[o],enumerable:!(r=m(t,o))||r.enumerable});return g};var L=g=>p(a({},"__esModule",{value:!0}),g);var T={};module.exports=L(T);
|
|
2
|
+
//# sourceMappingURL=LogTagFormatter.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/api/logger-subscriber/service/LogTagFormatter.ts"],
|
|
4
|
+
"sourcesContent": ["import { type LogTag } from \"@api/logger-subscriber/model/LogSubscriberOptions\";\n\n/**\n * Interface for formatting log tags.\n * Allows different formatting strategies to be injected into subscribers.\n */\nexport interface LogTagFormatter {\n format(tag: LogTag): string;\n}\n"],
|
|
5
|
+
"mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
|
|
6
|
+
"names": ["LogTagFormatter_exports", "__toCommonJS"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var n=Object.defineProperty;var
|
|
1
|
+
"use strict";var n=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var v=(s,r)=>{for(var t in r)n(s,t,{get:r[t],enumerable:!0})},O=(s,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of d(r))!f.call(s,o)&&o!==t&&n(s,o,{get:()=>r[o],enumerable:!(i=b(r,o))||i.enumerable});return s};var T=s=>O(n({},"__esModule",{value:!0}),s),p=(s,r,t,i)=>{for(var o=i>1?void 0:i?b(r,t):r,g=s.length-1,e;g>=0;g--)(e=s[g])&&(o=(i?e(r,t,o):e(o))||o);return i&&o&&n(r,t,o),o};var F={};v(F,{DefaultLoggerPublisherService:()=>m});module.exports=T(F);var L=require("inversify"),a=require("../../../api/logger-subscriber/model/LogLevel"),c=require("../../../api/logger-subscriber/service/DefaultLogTagFormatter"),h=require("../../logger-publisher/service/sanitiseData");let m=class{subscribers;tag;tagFormatter;constructor(r,t,i=new c.DefaultLogTagFormatter){this.subscribers=r,this.tag=t,this.tagFormatter=i}_log(r,t,i){const o=i?.data?(0,h.sanitiseData)(i.data):void 0,g=i?.tag??this.tag,e=this.tagFormatter.format(g);this.subscribers.forEach(u=>{const l={timestamp:i?.timestamp??Date.now(),tag:e,data:o};u.log(r,t,l)})}info(r,t){this._log(a.LogLevel.Info,r,t)}warn(r,t){this._log(a.LogLevel.Warning,r,t)}debug(r,t){this._log(a.LogLevel.Debug,r,t)}error(r,t){this._log(a.LogLevel.Error,r,t)}};m=p([(0,L.injectable)()],m);0&&(module.exports={DefaultLoggerPublisherService});
|
|
2
2
|
//# sourceMappingURL=DefaultLoggerPublisherService.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/internal/logger-publisher/service/DefaultLoggerPublisherService.ts"],
|
|
4
|
-
"sourcesContent": ["import { injectable } from \"inversify\";\n\nimport { LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nimport { LogSubscriberOptions } from \"@api/logger-subscriber/model/LogSubscriberOptions\";\nimport { LoggerSubscriberService } from \"@api/logger-subscriber/service/LoggerSubscriberService\";\nimport { LogPublisherOptions } from \"@internal/logger-publisher/model/LogPublisherOptions\";\n\n@injectable()\nexport class DefaultLoggerPublisherService implements LoggerPublisherService {\n subscribers: LoggerSubscriberService[];\n tag:
|
|
5
|
-
"mappings": "2iBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mCAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA2B,qBAG3BC,EAAyB,
|
|
6
|
-
"names": ["DefaultLoggerPublisherService_exports", "__export", "DefaultLoggerPublisherService", "__toCommonJS", "import_inversify", "import_LogLevel", "DefaultLoggerPublisherService", "subscribers", "tag", "level", "message", "options", "subscriber", "subscriberOptions", "__decorateClass"]
|
|
4
|
+
"sourcesContent": ["import { injectable } from \"inversify\";\n\nimport { LoggerPublisherService } from \"@api/logger-publisher/service/LoggerPublisherService\";\nimport { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nimport {\n type LogSubscriberOptions,\n type LogTag,\n} from \"@api/logger-subscriber/model/LogSubscriberOptions\";\nimport { DefaultLogTagFormatter } from \"@api/logger-subscriber/service/DefaultLogTagFormatter\";\nimport { LoggerSubscriberService } from \"@api/logger-subscriber/service/LoggerSubscriberService\";\nimport { type LogTagFormatter } from \"@api/logger-subscriber/service/LogTagFormatter\";\nimport { LogPublisherOptions } from \"@internal/logger-publisher/model/LogPublisherOptions\";\nimport { sanitiseData } from \"@internal/logger-publisher/service/sanitiseData\";\n\n@injectable()\nexport class DefaultLoggerPublisherService implements LoggerPublisherService {\n subscribers: LoggerSubscriberService[];\n tag: LogTag;\n private readonly tagFormatter: LogTagFormatter;\n\n constructor(\n subscribers: LoggerSubscriberService[],\n tag: LogTag,\n tagFormatter: LogTagFormatter = new DefaultLogTagFormatter(),\n ) {\n this.subscribers = subscribers;\n this.tag = tag;\n this.tagFormatter = tagFormatter;\n }\n\n _log(level: LogLevel, message: string, options?: LogPublisherOptions): void {\n const sanitisedData = options?.data\n ? sanitiseData(options.data)\n : undefined;\n\n // Format the tag from options if provided, otherwise use the instance tag\n const tagToFormat = options?.tag ?? this.tag;\n const formattedTag = this.tagFormatter.format(tagToFormat);\n\n this.subscribers.forEach((subscriber) => {\n const subscriberOptions: LogSubscriberOptions = {\n timestamp: options?.timestamp ?? Date.now(),\n tag: formattedTag,\n data: sanitisedData,\n };\n subscriber.log(level, message, subscriberOptions);\n });\n }\n\n info(message: string, options?: LogPublisherOptions): void {\n this._log(LogLevel.Info, message, options);\n }\n\n warn(message: string, options?: LogPublisherOptions): void {\n this._log(LogLevel.Warning, message, options);\n }\n\n debug(message: string, options?: LogPublisherOptions): void {\n this._log(LogLevel.Debug, message, options);\n }\n\n error(message: string, options?: LogPublisherOptions): void {\n this._log(LogLevel.Error, message, options);\n }\n}\n"],
|
|
5
|
+
"mappings": "2iBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mCAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA2B,qBAG3BC,EAAyB,iDAKzBC,EAAuC,iEAIvCC,EAA6B,2DAGtB,IAAMC,EAAN,KAAsE,CAC3E,YACA,IACiB,aAEjB,YACEC,EACAC,EACAC,EAAgC,IAAI,yBACpC,CACA,KAAK,YAAcF,EACnB,KAAK,IAAMC,EACX,KAAK,aAAeC,CACtB,CAEA,KAAKC,EAAiBC,EAAiBC,EAAqC,CAC1E,MAAMC,EAAgBD,GAAS,QAC3B,gBAAaA,EAAQ,IAAI,EACzB,OAGEE,EAAcF,GAAS,KAAO,KAAK,IACnCG,EAAe,KAAK,aAAa,OAAOD,CAAW,EAEzD,KAAK,YAAY,QAASE,GAAe,CACvC,MAAMC,EAA0C,CAC9C,UAAWL,GAAS,WAAa,KAAK,IAAI,EAC1C,IAAKG,EACL,KAAMF,CACR,EACAG,EAAW,IAAIN,EAAOC,EAASM,CAAiB,CAClD,CAAC,CACH,CAEA,KAAKN,EAAiBC,EAAqC,CACzD,KAAK,KAAK,WAAS,KAAMD,EAASC,CAAO,CAC3C,CAEA,KAAKD,EAAiBC,EAAqC,CACzD,KAAK,KAAK,WAAS,QAASD,EAASC,CAAO,CAC9C,CAEA,MAAMD,EAAiBC,EAAqC,CAC1D,KAAK,KAAK,WAAS,MAAOD,EAASC,CAAO,CAC5C,CAEA,MAAMD,EAAiBC,EAAqC,CAC1D,KAAK,KAAK,WAAS,MAAOD,EAASC,CAAO,CAC5C,CACF,EAjDaN,EAANY,EAAA,IADN,cAAW,GACCZ",
|
|
6
|
+
"names": ["DefaultLoggerPublisherService_exports", "__export", "DefaultLoggerPublisherService", "__toCommonJS", "import_inversify", "import_LogLevel", "import_DefaultLogTagFormatter", "import_sanitiseData", "DefaultLoggerPublisherService", "subscribers", "tag", "tagFormatter", "level", "message", "options", "sanitisedData", "tagToFormat", "formattedTag", "subscriber", "subscriberOptions", "__decorateClass"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var l=require("../../../api/logger-subscriber/model/LogLevel"),
|
|
1
|
+
"use strict";var l=require("../../../api/logger-subscriber/model/LogLevel"),r=require("../../../api/logger-subscriber/service/ConsoleLogger"),a=require("./DefaultLoggerPublisherService");vi.mock("@api/logger-subscriber/service/ConsoleLogger");vi.useFakeTimers().setSystemTime(new Date("2024-01-01"));let o,s;const e="message",c="logger-tag",g=`[${c}]`,t={data:{key:"value"}},n={tag:g,timestamp:Date.now(),...t};describe("LoggerPublisherService",()=>{beforeEach(()=>{vi.clearAllMocks(),s=new r.ConsoleLogger,o=new a.DefaultLoggerPublisherService([s],c)}),it("should call subscriber.log with the correct log object",()=>{o.info(e,t),expect(s.log).toHaveBeenCalledWith(l.LogLevel.Info,e,n)}),it("should call subscriber.log with the correct log object when a tag is provided in options",()=>{const i="new-tag";o.info(e,{...t,tag:i}),expect(s.log).toHaveBeenCalledWith(l.LogLevel.Info,e,{...n,tag:`[${i}]`})}),it("should call subscriber.log with the correct log object when a timestamp is provided",()=>{o.info(e,{...t,timestamp:1}),expect(s.log).toHaveBeenCalledWith(l.LogLevel.Info,e,{...n,timestamp:1})}),it("should call _log with the correct LogLevel",()=>{const i=vi.spyOn(o,"_log").mockImplementation(vi.fn());o.info(e,t),expect(i).toHaveBeenCalledWith(l.LogLevel.Info,e,t)}),it("should have the correct LogLevel",()=>{const i=vi.spyOn(o,"_log").mockImplementation(vi.fn());o.debug(e,t),expect(i).toHaveBeenCalledWith(l.LogLevel.Debug,e,t)}),it("should have the correct LogLevel",()=>{const i=vi.spyOn(o,"_log").mockImplementation(vi.fn());o.warn(e,t),expect(i).toHaveBeenCalledWith(l.LogLevel.Warning,e,t)}),it("should have the correct LogLevel",()=>{const i=vi.spyOn(o,"_log").mockImplementation(vi.fn());o.error(e,t),expect(i).toHaveBeenCalledWith(l.LogLevel.Error,e,t)})});
|
|
2
2
|
//# sourceMappingURL=DefaultLoggerPublisherService.test.js.map
|
package/lib/cjs/src/internal/logger-publisher/service/DefaultLoggerPublisherService.test.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/internal/logger-publisher/service/DefaultLoggerPublisherService.test.ts"],
|
|
4
|
-
"sourcesContent": ["import { type Mocked } from \"vitest\";\n\nimport { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nimport { ConsoleLogger } from \"@api/logger-subscriber/service/ConsoleLogger\";\n\nimport { DefaultLoggerPublisherService } from \"./DefaultLoggerPublisherService\";\n\nvi.mock(\"@api/logger-subscriber/service/ConsoleLogger\");\nvi.useFakeTimers().setSystemTime(new Date(\"2024-01-01\"));\n\nlet service: DefaultLoggerPublisherService;\nlet subscriber: Mocked<ConsoleLogger>;\nconst message = \"message\";\nconst tag = \"logger-tag\";\nconst options = { data: { key: \"value\" } };\nconst generatedOptions = {
|
|
5
|
-
"mappings": "aAEA,IAAAA,EAAyB,iDACzBC,EAA8B,wDAE9BC,EAA8C,2CAE9C,GAAG,KAAK,8CAA8C,EACtD,GAAG,cAAc,EAAE,cAAc,IAAI,KAAK,YAAY,CAAC,EAEvD,IAAIC,EACAC,EACJ,MAAMC,EAAU,UACVC,EAAM,aACNC,EAAU,CAAE,KAAM,CAAE,IAAK,OAAQ,CAAE,EACnCC,EAAmB,
|
|
6
|
-
"names": ["import_LogLevel", "import_ConsoleLogger", "import_DefaultLoggerPublisherService", "service", "subscriber", "message", "tag", "options", "generatedOptions", "newTag", "spy"]
|
|
4
|
+
"sourcesContent": ["import { type Mocked } from \"vitest\";\n\nimport { LogLevel } from \"@api/logger-subscriber/model/LogLevel\";\nimport { ConsoleLogger } from \"@api/logger-subscriber/service/ConsoleLogger\";\n\nimport { DefaultLoggerPublisherService } from \"./DefaultLoggerPublisherService\";\n\nvi.mock(\"@api/logger-subscriber/service/ConsoleLogger\");\nvi.useFakeTimers().setSystemTime(new Date(\"2024-01-01\"));\n\nlet service: DefaultLoggerPublisherService;\nlet subscriber: Mocked<ConsoleLogger>;\nconst message = \"message\";\nconst tag = \"logger-tag\";\nconst formattedTag = `[${tag}]`;\nconst options = { data: { key: \"value\" } };\nconst generatedOptions = {\n tag: formattedTag,\n timestamp: Date.now(),\n ...options,\n};\n\ndescribe(\"LoggerPublisherService\", () => {\n beforeEach(() => {\n vi.clearAllMocks();\n subscriber = new ConsoleLogger() as Mocked<ConsoleLogger>;\n service = new DefaultLoggerPublisherService([subscriber], tag);\n });\n\n it(\"should call subscriber.log with the correct log object\", () => {\n service.info(message, options);\n expect(subscriber.log).toHaveBeenCalledWith(\n LogLevel.Info,\n message,\n generatedOptions,\n );\n });\n\n it(\"should call subscriber.log with the correct log object when a tag is provided in options\", () => {\n const newTag = \"new-tag\";\n service.info(message, { ...options, tag: newTag });\n // Note: options.tag overrides and is formatted\n expect(subscriber.log).toHaveBeenCalledWith(LogLevel.Info, message, {\n ...generatedOptions,\n tag: `[${newTag}]`,\n });\n });\n\n it(\"should call subscriber.log with the correct log object when a timestamp is provided\", () => {\n const newTimestamp = 1;\n service.info(message, { ...options, timestamp: newTimestamp });\n expect(subscriber.log).toHaveBeenCalledWith(LogLevel.Info, message, {\n ...generatedOptions,\n timestamp: newTimestamp,\n });\n });\n\n it(\"should call _log with the correct LogLevel\", () => {\n const spy = vi.spyOn(service, \"_log\").mockImplementation(vi.fn());\n\n service.info(message, options);\n expect(spy).toHaveBeenCalledWith(LogLevel.Info, message, options);\n });\n\n it(\"should have the correct LogLevel\", () => {\n const spy = vi.spyOn(service, \"_log\").mockImplementation(vi.fn());\n\n service.debug(message, options);\n expect(spy).toHaveBeenCalledWith(LogLevel.Debug, message, options);\n });\n\n it(\"should have the correct LogLevel\", () => {\n const spy = vi.spyOn(service, \"_log\").mockImplementation(vi.fn());\n\n service.warn(message, options);\n expect(spy).toHaveBeenCalledWith(LogLevel.Warning, message, options);\n });\n\n it(\"should have the correct LogLevel\", () => {\n const spy = vi.spyOn(service, \"_log\").mockImplementation(vi.fn());\n\n service.error(message, options);\n expect(spy).toHaveBeenCalledWith(LogLevel.Error, message, options);\n });\n});\n"],
|
|
5
|
+
"mappings": "aAEA,IAAAA,EAAyB,iDACzBC,EAA8B,wDAE9BC,EAA8C,2CAE9C,GAAG,KAAK,8CAA8C,EACtD,GAAG,cAAc,EAAE,cAAc,IAAI,KAAK,YAAY,CAAC,EAEvD,IAAIC,EACAC,EACJ,MAAMC,EAAU,UACVC,EAAM,aACNC,EAAe,IAAID,CAAG,IACtBE,EAAU,CAAE,KAAM,CAAE,IAAK,OAAQ,CAAE,EACnCC,EAAmB,CACvB,IAAKF,EACL,UAAW,KAAK,IAAI,EACpB,GAAGC,CACL,EAEA,SAAS,yBAA0B,IAAM,CACvC,WAAW,IAAM,CACf,GAAG,cAAc,EACjBJ,EAAa,IAAI,gBACjBD,EAAU,IAAI,gCAA8B,CAACC,CAAU,EAAGE,CAAG,CAC/D,CAAC,EAED,GAAG,yDAA0D,IAAM,CACjEH,EAAQ,KAAKE,EAASG,CAAO,EAC7B,OAAOJ,EAAW,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AASG,CAAO,EAC9B,OAAOG,CAAG,EAAE,qBAAqB,WAAS,MAAON,EAASG,CAAO,CACnE,CAAC,CACH,CAAC",
|
|
6
|
+
"names": ["import_LogLevel", "import_ConsoleLogger", "import_DefaultLoggerPublisherService", "service", "subscriber", "message", "tag", "formattedTag", "options", "generatedOptions", "newTag", "spy"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var c=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var k=(n,r)=>{for(var t in r)c(n,t,{get:r[t],enumerable:!0})},u=(n,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of f(r))!d.call(n,o)&&o!==t&&c(n,o,{get:()=>r[o],enumerable:!(i=s(r,o))||i.enumerable});return n};var a=n=>u(c({},"__esModule",{value:!0}),n);var b={};k(b,{sanitiseData:()=>w});module.exports=a(b);function e(n,r){if(typeof n=="bigint")return n.toString();if(Array.isArray(n))return r.has(n)?"[Circular]":(r.add(n),n.map(t=>e(t,r)));if(n!==null&&typeof n=="object"){if(r.has(n))return"[Circular]";r.add(n);const t={};for(const[i,o]of Object.entries(n))t[i]=e(o,r);return t}return n}function w(n){const r=new WeakSet;r.add(n);const t={};for(const[i,o]of Object.entries(n))t[i]=e(o,r);return t}0&&(module.exports={sanitiseData});
|
|
2
|
+
//# sourceMappingURL=sanitiseData.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/internal/logger-publisher/service/sanitiseData.ts"],
|
|
4
|
+
"sourcesContent": ["function sanitiseValue(value: unknown, seen: WeakSet<object>): unknown {\n if (typeof value === \"bigint\") {\n return value.toString();\n }\n if (Array.isArray(value)) {\n if (seen.has(value)) {\n return \"[Circular]\";\n }\n seen.add(value);\n return value.map((v) => sanitiseValue(v, seen));\n }\n if (value !== null && typeof value === \"object\") {\n if (seen.has(value)) {\n return \"[Circular]\";\n }\n seen.add(value);\n const sanitised: Record<string, unknown> = {};\n for (const [key, val] of Object.entries(value)) {\n sanitised[key] = sanitiseValue(val, seen);\n }\n return sanitised;\n }\n return value;\n}\n\n/**\n * Recursively sanitises data for JSON serialisation by converting BigInt values\n * to strings and handling circular references.\n */\nexport function sanitiseData(\n data: Record<string, unknown>,\n): Record<string, unknown> {\n const seen = new WeakSet<object>();\n seen.add(data);\n const result: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(data)) {\n result[key] = sanitiseValue(value, seen);\n }\n return result;\n}\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,IAAA,eAAAC,EAAAH,GAAA,SAASI,EAAcC,EAAgBC,EAAgC,CACrE,GAAI,OAAOD,GAAU,SACnB,OAAOA,EAAM,SAAS,EAExB,GAAI,MAAM,QAAQA,CAAK,EACrB,OAAIC,EAAK,IAAID,CAAK,EACT,cAETC,EAAK,IAAID,CAAK,EACPA,EAAM,IAAKE,GAAMH,EAAcG,EAAGD,CAAI,CAAC,GAEhD,GAAID,IAAU,MAAQ,OAAOA,GAAU,SAAU,CAC/C,GAAIC,EAAK,IAAID,CAAK,EAChB,MAAO,aAETC,EAAK,IAAID,CAAK,EACd,MAAMG,EAAqC,CAAC,EAC5C,SAAW,CAACC,EAAKC,CAAG,IAAK,OAAO,QAAQL,CAAK,EAC3CG,EAAUC,CAAG,EAAIL,EAAcM,EAAKJ,CAAI,EAE1C,OAAOE,CACT,CACA,OAAOH,CACT,CAMO,SAASH,EACdS,EACyB,CACzB,MAAML,EAAO,IAAI,QACjBA,EAAK,IAAIK,CAAI,EACb,MAAMC,EAAkC,CAAC,EACzC,SAAW,CAACH,EAAKJ,CAAK,IAAK,OAAO,QAAQM,CAAI,EAC5CC,EAAOH,CAAG,EAAIL,EAAcC,EAAOC,CAAI,EAEzC,OAAOM,CACT",
|
|
6
|
+
"names": ["sanitiseData_exports", "__export", "sanitiseData", "__toCommonJS", "sanitiseValue", "value", "seen", "v", "sanitised", "key", "val", "data", "result"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var t=require("vitest"),s=require("./sanitiseData");(0,t.describe)("sanitiseData",()=>{(0,t.it)("should convert BigInt values to strings",()=>{const e=(0,s.sanitiseData)({value:123456789012345678901234567890n});(0,t.expect)(e).toEqual({value:"123456789012345678901234567890"}),(0,t.expect)(typeof e.value).toBe("string")}),(0,t.it)("should handle primitive values unchanged",()=>{const e=(0,s.sanitiseData)({str:"hello",num:42,bool:!0,nil:null,undef:void 0});(0,t.expect)(e).toEqual({str:"hello",num:42,bool:!0,nil:null,undef:void 0})}),(0,t.it)("should recursively sanitise arrays",()=>{const n={items:[BigInt(1),"text",BigInt(2)]},e=(0,s.sanitiseData)(n);(0,t.expect)(e).toEqual({items:["1","text","2"]})}),(0,t.it)("should recursively sanitise nested arrays",()=>{const n={nested:[[BigInt(1)],[BigInt(2),[BigInt(3)]]]},e=(0,s.sanitiseData)(n);(0,t.expect)(e).toEqual({nested:[["1"],["2",["3"]]]})}),(0,t.it)("should recursively sanitise objects",()=>{const e=(0,s.sanitiseData)({amount:1000000000000000000n,name:"test",count:5});(0,t.expect)(e).toEqual({amount:"1000000000000000000",name:"test",count:5})}),(0,t.it)("should recursively sanitise nested objects",()=>{const e=(0,s.sanitiseData)({transaction:{value:100n,gasLimit:21000n,nested:{maxFeePerGas:50000000000n}},metadata:"info"});(0,t.expect)(e).toEqual({transaction:{value:"100",gasLimit:"21000",nested:{maxFeePerGas:"50000000000"}},metadata:"info"})}),(0,t.it)("should handle mixed arrays and objects",()=>{const e=(0,s.sanitiseData)({items:[{value:1n},{value:2n}],total:3n});(0,t.expect)(e).toEqual({items:[{value:"1"},{value:"2"}],total:"3"})}),(0,t.it)("should handle empty objects and arrays",()=>{(0,t.expect)((0,s.sanitiseData)({})).toEqual({}),(0,t.expect)((0,s.sanitiseData)({arr:[]})).toEqual({arr:[]})}),(0,t.it)("should produce JSON-serialisable output",()=>{const e=(0,s.sanitiseData)({bigValue:9007199254740991n,nested:{anotherBig:123n}});(0,t.expect)(()=>JSON.stringify(e)).not.toThrow(),(0,t.expect)(JSON.stringify(e)).toBe('{"bigValue":"9007199254740991","nested":{"anotherBig":"123"}}')}),(0,t.it)("should handle circular reference in object",()=>{const n={name:"test"};n.self=n;const e=(0,s.sanitiseData)(n);(0,t.expect)(e).toEqual({name:"test",self:"[Circular]"}),(0,t.expect)(()=>JSON.stringify(e)).not.toThrow()}),(0,t.it)("should handle circular reference in nested object",()=>{const n={level1:{level2:{}}};n.level1.level2=n;const e=(0,s.sanitiseData)(n);(0,t.expect)(e).toEqual({level1:{level2:"[Circular]"}})}),(0,t.it)("should handle circular reference in array",()=>{const n=[1,2];n.push(n);const u=(0,s.sanitiseData)({items:n});(0,t.expect)(u).toEqual({items:[1,2,"[Circular]"]})}),(0,t.it)("should handle same object referenced multiple times (not circular)",()=>{const n={value:42n},u=(0,s.sanitiseData)({a:n,b:n});(0,t.expect)(u).toEqual({a:{value:"42"},b:"[Circular]"})}),(0,t.it)("should handle deeply nested circular reference",()=>{const n={a:{b:{c:{d:{}}}}};n.a.b.c=n;const e=(0,s.sanitiseData)(n);(0,t.expect)(e).toEqual({a:{b:{c:"[Circular]"}}}),(0,t.expect)(()=>JSON.stringify(e)).not.toThrow()})});
|
|
2
|
+
//# sourceMappingURL=sanitiseData.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/internal/logger-publisher/service/sanitiseData.test.ts"],
|
|
4
|
+
"sourcesContent": ["import { describe, expect, it } from \"vitest\";\n\nimport { sanitiseData } from \"./sanitiseData\";\n\ndescribe(\"sanitiseData\", () => {\n it(\"should convert BigInt values to strings\", () => {\n const input = { value: BigInt(123456789012345678901234567890n) };\n const result = sanitiseData(input);\n expect(result).toEqual({ value: \"123456789012345678901234567890\" });\n expect(typeof result[\"value\"]).toBe(\"string\");\n });\n\n it(\"should handle primitive values unchanged\", () => {\n const input = {\n str: \"hello\",\n num: 42,\n bool: true,\n nil: null,\n undef: undefined,\n };\n const result = sanitiseData(input);\n expect(result).toEqual({\n str: \"hello\",\n num: 42,\n bool: true,\n nil: null,\n undef: undefined,\n });\n });\n\n it(\"should recursively sanitise arrays\", () => {\n const input = { items: [BigInt(1), \"text\", BigInt(2)] };\n const result = sanitiseData(input);\n expect(result).toEqual({ items: [\"1\", \"text\", \"2\"] });\n });\n\n it(\"should recursively sanitise nested arrays\", () => {\n const input = { nested: [[BigInt(1)], [BigInt(2), [BigInt(3)]]] };\n const result = sanitiseData(input);\n expect(result).toEqual({ nested: [[\"1\"], [\"2\", [\"3\"]]] });\n });\n\n it(\"should recursively sanitise objects\", () => {\n const input = {\n amount: BigInt(1000000000000000000n),\n name: \"test\",\n count: 5,\n };\n const result = sanitiseData(input);\n expect(result).toEqual({\n amount: \"1000000000000000000\",\n name: \"test\",\n count: 5,\n });\n });\n\n it(\"should recursively sanitise nested objects\", () => {\n const input = {\n transaction: {\n value: BigInt(100n),\n gasLimit: BigInt(21000n),\n nested: {\n maxFeePerGas: BigInt(50000000000n),\n },\n },\n metadata: \"info\",\n };\n const result = sanitiseData(input);\n expect(result).toEqual({\n transaction: {\n value: \"100\",\n gasLimit: \"21000\",\n nested: {\n maxFeePerGas: \"50000000000\",\n },\n },\n metadata: \"info\",\n });\n });\n\n it(\"should handle mixed arrays and objects\", () => {\n const input = {\n items: [{ value: BigInt(1n) }, { value: BigInt(2n) }],\n total: BigInt(3n),\n };\n const result = sanitiseData(input);\n expect(result).toEqual({\n items: [{ value: \"1\" }, { value: \"2\" }],\n total: \"3\",\n });\n });\n\n it(\"should handle empty objects and arrays\", () => {\n expect(sanitiseData({})).toEqual({});\n expect(sanitiseData({ arr: [] })).toEqual({ arr: [] });\n });\n\n it(\"should produce JSON-serialisable output\", () => {\n const input = {\n bigValue: BigInt(9007199254740991n),\n nested: {\n anotherBig: BigInt(123n),\n },\n };\n const result = sanitiseData(input);\n expect(() => JSON.stringify(result)).not.toThrow();\n expect(JSON.stringify(result)).toBe(\n '{\"bigValue\":\"9007199254740991\",\"nested\":{\"anotherBig\":\"123\"}}',\n );\n });\n\n it(\"should handle circular reference in object\", () => {\n const input: Record<string, unknown> = { name: \"test\" };\n input[\"self\"] = input;\n const result = sanitiseData(input);\n expect(result).toEqual({ name: \"test\", self: \"[Circular]\" });\n expect(() => JSON.stringify(result)).not.toThrow();\n });\n\n it(\"should handle circular reference in nested object\", () => {\n const input: Record<string, unknown> = {\n level1: {\n level2: {},\n },\n };\n (input[\"level1\"] as Record<string, unknown>)[\"level2\"] = input;\n const result = sanitiseData(input);\n expect(result).toEqual({\n level1: {\n level2: \"[Circular]\",\n },\n });\n });\n\n it(\"should handle circular reference in array\", () => {\n const arr: unknown[] = [1, 2];\n arr.push(arr);\n const input = { items: arr };\n const result = sanitiseData(input);\n expect(result).toEqual({ items: [1, 2, \"[Circular]\"] });\n });\n\n it(\"should handle same object referenced multiple times (not circular)\", () => {\n const shared = { value: BigInt(42n) };\n const input = { a: shared, b: shared };\n const result = sanitiseData(input);\n // Second reference to same object is detected as circular\n expect(result).toEqual({ a: { value: \"42\" }, b: \"[Circular]\" });\n });\n\n it(\"should handle deeply nested circular reference\", () => {\n const input: Record<string, unknown> = {\n a: {\n b: {\n c: {\n d: {},\n },\n },\n },\n };\n ((input[\"a\"] as Record<string, unknown>)[\"b\"] as Record<string, unknown>)[\n \"c\"\n ] = input;\n const result = sanitiseData(input);\n expect(result).toEqual({\n a: {\n b: {\n c: \"[Circular]\",\n },\n },\n });\n expect(() => JSON.stringify(result)).not.toThrow();\n });\n});\n"],
|
|
5
|
+
"mappings": "aAAA,IAAAA,EAAqC,kBAErCC,EAA6B,6BAE7B,YAAS,eAAgB,IAAM,IAC7B,MAAG,0CAA2C,IAAM,CAElD,MAAMC,KAAS,gBADD,CAAE,MAAc,+BA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,OAAsC,OAAYA,EACzD,MAAMD,KAAS,gBAAaC,CAAK,KACjC,UAAOD,CAAM,EAAE,QAAQ,CACrB,OAAQ,CACN,OAAQ,YACV,CACF,CAAC,CACH,CAAC,KAED,MAAG,4CAA6C,IAAM,CACpD,MAAME,EAAiB,CAAC,EAAG,CAAC,EAC5BA,EAAI,KAAKA,CAAG,EAEZ,MAAMF,KAAS,gBADD,CAAE,MAAOE,CAAI,CACM,KACjC,UAAOF,CAAM,EAAE,QAAQ,CAAE,MAAO,CAAC,EAAG,EAAG,YAAY,CAAE,CAAC,CACxD,CAAC,KAED,MAAG,qEAAsE,IAAM,CAC7E,MAAMG,EAAS,CAAE,MAAc,GAAK,EAE9BH,KAAS,gBADD,CAAE,EAAGG,EAAQ,EAAGA,CAAO,CACJ,KAEjC,UAAOH,CAAM,EAAE,QAAQ,CAAE,EAAG,CAAE,MAAO,IAAK,EAAG,EAAG,YAAa,CAAC,CAChE,CAAC,KAED,MAAG,iDAAkD,IAAM,CACzD,MAAMC,EAAiC,CACrC,EAAG,CACD,EAAG,CACD,EAAG,CACD,EAAG,CAAC,CACN,CACF,CACF,CACF,EACEA,EAAM,EAAiC,EACvC,EACEA,EACJ,MAAMD,KAAS,gBAAaC,CAAK,KACjC,UAAOD,CAAM,EAAE,QAAQ,CACrB,EAAG,CACD,EAAG,CACD,EAAG,YACL,CACF,CACF,CAAC,KACD,UAAO,IAAM,KAAK,UAAUA,CAAM,CAAC,EAAE,IAAI,QAAQ,CACnD,CAAC,CACH,CAAC",
|
|
6
|
+
"names": ["import_vitest", "import_sanitiseData", "result", "input", "arr", "shared"]
|
|
7
|
+
}
|
package/lib/esm/package.json
CHANGED
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"watch:builds": "pnpm ldmk-tool watch --entryPoints index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
|
|
65
65
|
"watch:types": "concurrently \"tsc --watch -p tsconfig.prod.json\" \"tsc-alias --watch -p tsconfig.prod.json\""
|
|
66
66
|
},
|
|
67
|
-
"version": "0.0.0-develop-
|
|
67
|
+
"version": "0.0.0-develop-20260127001144"
|
|
68
68
|
}
|
package/lib/esm/src/api/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Apdu as o}from"./apdu/model/Apdu";import{APDU_MAX_PAYLOAD as p,ApduBuilder as i}from"./apdu/utils/ApduBuilder";import{ApduParser as
|
|
1
|
+
import{Apdu as o}from"./apdu/model/Apdu";import{APDU_MAX_PAYLOAD as p,ApduBuilder as i}from"./apdu/utils/ApduBuilder";import{ApduParser as n}from"./apdu/utils/ApduParser";export*from"./apdu/utils/AppBuilderError";import{ByteArrayBuilder as f}from"./apdu/utils/ByteArrayBuilder";import{ByteArrayParser as x}from"./apdu/utils/ByteArrayParser";import{InvalidGetFirmwareMetadataResponseError as A,InvalidStatusWordError as D}from"./command/Errors";import{CommandResultFactory as u,CommandResultStatus as v,isSuccessCommandResult as S}from"./command/model/CommandResult";import{CloseAppCommand as C}from"./command/os/CloseAppCommand";import{GetAppAndVersionCommand as L}from"./command/os/GetAppAndVersionCommand";import{BatteryStatusType as B,GetBatteryStatusCommand as G}from"./command/os/GetBatteryStatusCommand";import{GetOsVersionCommand as M}from"./command/os/GetOsVersionCommand";import{ListAppsCommand as O}from"./command/os/ListAppsCommand";import{LoadCertificateCommand as b}from"./command/os/LoadCertificateCommand";import{OpenAppCommand as U}from"./command/os/OpenAppCommand";import{isCommandErrorCode as P}from"./command/utils/CommandErrors";import{CommandUtils as k}from"./command/utils/CommandUtils";import{GlobalCommandError as _,GlobalCommandErrorHandler as w}from"./command/utils/GlobalCommandError";import{DeviceModel as K,DeviceModelId as X,LEDGER_VENDOR_ID as q}from"./device/DeviceModel";import{DeviceStatus as Y}from"./device/DeviceStatus";import{DeviceActionStatus as z}from"./device-action/model/DeviceActionState";import{UserInteractionRequired as Q}from"./device-action/model/UserInteractionRequired";import{CallTaskInAppDeviceAction as $}from"./device-action/os/CallTaskInAppDeviceAction/CallTaskInAppDeviceAction";import{AppAlreadyInstalledDAError as re,DeviceLockedError as oe,OutOfMemoryDAError as te,RefusedByUserDAError as pe,UnknownDAError as ie,UnsupportedFirmwareDAError as me}from"./device-action/os/Errors";import{GetDeviceMetadataDeviceAction as ae}from"./device-action/os/GetDeviceMetadata/GetDeviceMetadataDeviceAction";import{GetDeviceStatusDeviceAction as fe}from"./device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction";import{GoToDashboardDeviceAction as xe}from"./device-action/os/GoToDashboard/GoToDashboardDeviceAction";import{InstallOrUpdateAppsDeviceAction as Ae}from"./device-action/os/InstallOrUpdateApps/InstallOrUpdateAppsDeviceAction";import{ListAppsDeviceAction as le}from"./device-action/os/ListApps/ListAppsDeviceAction";import{ListAppsWithMetadataDeviceAction as ve}from"./device-action/os/ListAppsWithMetadata/ListAppsWithMetadataDeviceAction";import{OpenAppDeviceAction as ye}from"./device-action/os/OpenAppDeviceAction/OpenAppDeviceAction";import{OpenAppWithDependenciesDeviceAction as ge}from"./device-action/os/OpenAppWithDependencies/OpenAppWithDependenciesDeviceAction";import{SendCommandInAppDeviceAction as Ee}from"./device-action/os/SendCommandInAppDeviceAction/SendCommandInAppDeviceAction";import{XStateDeviceAction as Ge}from"./device-action/xstate-utils/XStateDeviceAction";import{StaticDeviceModelDataSource as Me}from"./device-model/data/StaticDeviceModelDataSource";import{BleDeviceInfos as Oe}from"./device-model/model/BleDeviceInfos";import{TransportDeviceModel as be}from"./device-model/model/DeviceModel";import{ApduResponse as Ue}from"./device-session/ApduResponse";export*from"./device-session/data/FramerConst";import{DeviceSessionStateType as Ve}from"./device-session/DeviceSessionState";import{GenuineCheckDeviceAction as We}from"./secure-channel/device-action/GenuineCheck/GenuineCheckDeviceAction";import{InstallAppDeviceAction as we}from"./secure-channel/device-action/InstallApp/InstallAppDeviceAction";import{ListInstalledAppsDeviceAction as Ke}from"./secure-channel/device-action/ListInstalledApps/ListInstalledAppsDeviceAction";import{UninstallAppDeviceAction as qe}from"./secure-channel/device-action/UninstallApp/UninstallAppDeviceAction";import{SecureChannelError as Ye}from"../internal/secure-channel/model/Errors";import{defaultApduReceiverServiceStubBuilder as ze}from"./device-session/service/DefaultApduReceiverService.stub";import{defaultApduSenderServiceStubBuilder as Qe}from"./device-session/service/DefaultApduSenderService.stub";import{FramerUtils as $e}from"./device-session/utils/FramerUtils";import{DeviceManagementKit as rr}from"./DeviceManagementKit";import{DeviceManagementKitBuilder as tr}from"./DeviceManagementKitBuilder";export*from"./Error";import{LogLevel as mr}from"./logger-subscriber/model/LogLevel";import{ConsoleLogger as ar}from"./logger-subscriber/service/ConsoleLogger";import{DefaultLogTagFormatter as fr}from"./logger-subscriber/service/DefaultLogTagFormatter";import{WebLogsExporterLogger as xr}from"./logger-subscriber/service/WebLogsExporterLogger";import{ConnectedDevice as Ar}from"./transport/model/ConnectedDevice";import{DeviceConnectionStateMachine as lr}from"./transport/model/DeviceConnectionStateMachine";export*from"./transport/model/Errors";import{TransportConnectedDevice as Sr}from"./transport/model/TransportConnectedDevice";import{connectedDeviceStubBuilder as Cr}from"./transport/model/TransportConnectedDevice.stub";export*from"./types";import{formatApduReceivedLog as Er,formatApduSentLog as Br}from"./utils/apduLogs";import{base64StringToBuffer as Rr,isBase64String as Mr}from"./utils/Base64String";import{bufferToHexaString as Or,hexaStringToBuffer as Tr,isHexaString as br}from"./utils/HexaString";export{p as APDU_MAX_PAYLOAD,o as Apdu,i as ApduBuilder,n as ApduParser,Ue as ApduResponse,re as AppAlreadyInstalledDAError,B as BatteryStatusType,Oe as BleDeviceInfos,f as ByteArrayBuilder,x as ByteArrayParser,$ as CallTaskInAppDeviceAction,C as CloseAppCommand,u as CommandResultFactory,v as CommandResultStatus,k as CommandUtils,Ar as ConnectedDevice,ar as ConsoleLogger,fr as DefaultLogTagFormatter,z as DeviceActionStatus,lr as DeviceConnectionStateMachine,oe as DeviceLockedError,rr as DeviceManagementKit,tr as DeviceManagementKitBuilder,K as DeviceModel,X as DeviceModelId,Ve as DeviceSessionStateType,Y as DeviceStatus,$e as FramerUtils,We as GenuineCheckDeviceAction,L as GetAppAndVersionCommand,G as GetBatteryStatusCommand,ae as GetDeviceMetadataDeviceAction,fe as GetDeviceStatusDeviceAction,M as GetOsVersionCommand,_ as GlobalCommandError,w as GlobalCommandErrorHandler,xe as GoToDashboardDeviceAction,we as InstallAppDeviceAction,Ae as InstallOrUpdateAppsDeviceAction,A as InvalidGetFirmwareMetadataResponseError,D as InvalidStatusWordError,q as LEDGER_VENDOR_ID,O as ListAppsCommand,le as ListAppsDeviceAction,ve as ListAppsWithMetadataDeviceAction,Ke as ListInstalledAppsDeviceAction,b as LoadCertificateCommand,mr as LogLevel,U as OpenAppCommand,ye as OpenAppDeviceAction,ge as OpenAppWithDependenciesDeviceAction,te as OutOfMemoryDAError,pe as RefusedByUserDAError,Ye as SecureChannelError,Ee as SendCommandInAppDeviceAction,Me as StaticDeviceModelDataSource,Sr as TransportConnectedDevice,be as TransportDeviceModel,qe as UninstallAppDeviceAction,ie as UnknownDAError,me as UnsupportedFirmwareDAError,Q as UserInteractionRequired,xr as WebLogsExporterLogger,Ge as XStateDeviceAction,Rr as base64StringToBuffer,Or as bufferToHexaString,Cr as connectedDeviceStubBuilder,ze as defaultApduReceiverServiceStubBuilder,Qe as defaultApduSenderServiceStubBuilder,Er as formatApduReceivedLog,Br as formatApduSentLog,Tr as hexaStringToBuffer,Mr as isBase64String,P as isCommandErrorCode,br as isHexaString,S as isSuccessCommandResult};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|