@webiny/api-core 6.6.0-alpha.1 → 6.6.0-alpha.11
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/ApiCoreFeature.js +10 -2
- package/ApiCoreFeature.js.map +1 -1
- package/exports/api/tasks.d.ts +1 -0
- package/exports/api/tasks.js +1 -1
- package/exports/api.d.ts +2 -1
- package/exports/api.js +2 -1
- package/features/ai/Ai.d.ts +3 -1
- package/features/ai/Ai.js +36 -28
- package/features/ai/Ai.js.map +1 -1
- package/features/ai/AiModelRegistry.d.ts +14 -0
- package/features/ai/AiModelRegistry.js +39 -0
- package/features/ai/AiModelRegistry.js.map +1 -0
- package/features/ai/AiSdkToolHandlerResolver.d.ts +11 -0
- package/features/ai/AiSdkToolHandlerResolver.js +19 -0
- package/features/ai/AiSdkToolHandlerResolver.js.map +1 -0
- package/features/ai/AiSdkTools.d.ts +4 -3
- package/features/ai/AiSdkTools.js +11 -9
- package/features/ai/AiSdkTools.js.map +1 -1
- package/features/ai/AnthropicSdkFactory.js +12 -4
- package/features/ai/AnthropicSdkFactory.js.map +1 -1
- package/features/ai/DEVELOPERS.md +183 -0
- package/features/ai/GoogleSdkFactory.d.ts +10 -0
- package/features/ai/GoogleSdkFactory.js +65 -0
- package/features/ai/GoogleSdkFactory.js.map +1 -0
- package/features/ai/OpenAiSdkFactory.js +51 -11
- package/features/ai/OpenAiSdkFactory.js.map +1 -1
- package/features/ai/OpenRouterSdkFactory.d.ts +10 -0
- package/features/ai/OpenRouterSdkFactory.js +112 -0
- package/features/ai/OpenRouterSdkFactory.js.map +1 -0
- package/features/ai/RemoteAiModelCatalog.d.ts +13 -0
- package/features/ai/RemoteAiModelCatalog.js +74 -0
- package/features/ai/RemoteAiModelCatalog.js.map +1 -0
- package/features/ai/abstractions.d.ts +82 -6
- package/features/ai/abstractions.js +6 -2
- package/features/ai/abstractions.js.map +1 -1
- package/features/ai/feature.js +10 -0
- package/features/ai/feature.js.map +1 -1
- package/features/ai/index.d.ts +2 -4
- package/features/ai/index.js +1 -1
- package/features/cdnCache/NullCdnCache.d.ts +8 -0
- package/features/cdnCache/NullCdnCache.js +11 -0
- package/features/cdnCache/NullCdnCache.js.map +1 -0
- package/features/cdnCache/abstractions.d.ts +20 -0
- package/features/cdnCache/abstractions.js +5 -0
- package/features/cdnCache/abstractions.js.map +1 -0
- package/features/cdnCache/feature.d.ts +8 -0
- package/features/cdnCache/feature.js +11 -0
- package/features/cdnCache/feature.js.map +1 -0
- package/features/cdnCache/index.d.ts +2 -0
- package/features/cdnCache/index.js +2 -0
- package/features/debugger/Debugger.d.ts +30 -0
- package/features/debugger/Debugger.js +142 -0
- package/features/debugger/Debugger.js.map +1 -0
- package/features/debugger/DebuggerRouteDecorator.d.ts +45 -0
- package/features/debugger/DebuggerRouteDecorator.js +102 -0
- package/features/debugger/DebuggerRouteDecorator.js.map +1 -0
- package/features/debugger/GraphQLDebuggerTransport.d.ts +28 -0
- package/features/debugger/GraphQLDebuggerTransport.js +45 -0
- package/features/debugger/GraphQLDebuggerTransport.js.map +1 -0
- package/features/debugger/__tests__/matchNamespace.test.d.ts +1 -0
- package/features/debugger/__tests__/matchNamespace.test.js +68 -0
- package/features/debugger/__tests__/matchNamespace.test.js.map +1 -0
- package/features/debugger/__tests__/serialize.test.d.ts +1 -0
- package/features/debugger/__tests__/serialize.test.js +220 -0
- package/features/debugger/__tests__/serialize.test.js.map +1 -0
- package/features/debugger/abstractions.d.ts +100 -0
- package/features/debugger/abstractions.js +6 -0
- package/features/debugger/abstractions.js.map +1 -0
- package/features/debugger/feature.d.ts +5 -0
- package/features/debugger/feature.js +15 -0
- package/features/debugger/feature.js.map +1 -0
- package/features/debugger/index.d.ts +12 -0
- package/features/debugger/index.js +7 -0
- package/features/debugger/limits.d.ts +18 -0
- package/features/debugger/limits.js +11 -0
- package/features/debugger/limits.js.map +1 -0
- package/features/debugger/matchNamespace.d.ts +14 -0
- package/features/debugger/matchNamespace.js +35 -0
- package/features/debugger/matchNamespace.js.map +1 -0
- package/features/debugger/parseNamespaceHeader.d.ts +7 -0
- package/features/debugger/parseNamespaceHeader.js +16 -0
- package/features/debugger/parseNamespaceHeader.js.map +1 -0
- package/features/debugger/permissions.d.ts +14 -0
- package/features/debugger/permissions.js +8 -0
- package/features/debugger/permissions.js.map +1 -0
- package/features/debugger/permissionsSchema.d.ts +17 -0
- package/features/debugger/permissionsSchema.js +18 -0
- package/features/debugger/permissionsSchema.js.map +1 -0
- package/features/debugger/serialize.d.ts +11 -0
- package/features/debugger/serialize.js +121 -0
- package/features/debugger/serialize.js.map +1 -0
- package/features/encryption/BuildParamsEncryptionConfig.d.ts +13 -0
- package/features/encryption/BuildParamsEncryptionConfig.js +19 -0
- package/features/encryption/BuildParamsEncryptionConfig.js.map +1 -0
- package/features/encryption/EncryptionKeyCacheFeature.d.ts +8 -0
- package/features/encryption/EncryptionKeyCacheFeature.js +11 -0
- package/features/encryption/EncryptionKeyCacheFeature.js.map +1 -0
- package/features/encryption/EncryptionService.d.ts +3 -2
- package/features/encryption/EncryptionService.js +15 -13
- package/features/encryption/EncryptionService.js.map +1 -1
- package/features/encryption/MemoryEncryptionKeyCache.d.ts +13 -0
- package/features/encryption/MemoryEncryptionKeyCache.js +26 -0
- package/features/encryption/MemoryEncryptionKeyCache.js.map +1 -0
- package/features/encryption/abstractions.d.ts +26 -0
- package/features/encryption/abstractions.js +3 -1
- package/features/encryption/abstractions.js.map +1 -1
- package/features/encryption/feature.js +2 -0
- package/features/encryption/feature.js.map +1 -1
- package/features/encryption/index.d.ts +3 -0
- package/features/encryption/index.js +3 -1
- package/features/featureFlags/decorators/FeatureFlagsWithLicenseDecorator.js +13 -1
- package/features/featureFlags/decorators/FeatureFlagsWithLicenseDecorator.js.map +1 -1
- package/features/hashing/BuildParamsHashingConfig.d.ts +11 -0
- package/features/hashing/BuildParamsHashingConfig.js +18 -0
- package/features/hashing/BuildParamsHashingConfig.js.map +1 -0
- package/features/hashing/ScryptHasher.d.ts +2 -2
- package/features/hashing/ScryptHasher.js +6 -8
- package/features/hashing/ScryptHasher.js.map +1 -1
- package/features/hashing/abstractions.d.ts +15 -0
- package/features/hashing/abstractions.js +2 -1
- package/features/hashing/abstractions.js.map +1 -1
- package/features/hashing/feature.js +2 -0
- package/features/hashing/feature.js.map +1 -1
- package/features/hashing/index.d.ts +1 -0
- package/features/hashing/index.js +1 -1
- package/features/httpClient/HttpClient.d.ts +7 -0
- package/features/httpClient/HttpClient.js +72 -0
- package/features/httpClient/HttpClient.js.map +1 -0
- package/features/httpClient/HttpRequestError.d.ts +10 -0
- package/features/httpClient/HttpRequestError.js +13 -0
- package/features/httpClient/HttpRequestError.js.map +1 -0
- package/features/httpClient/HttpStatusError.d.ts +12 -0
- package/features/httpClient/HttpStatusError.js +12 -0
- package/features/httpClient/HttpStatusError.js.map +1 -0
- package/features/httpClient/abstractions.d.ts +32 -0
- package/features/httpClient/abstractions.js +5 -0
- package/features/httpClient/abstractions.js.map +1 -0
- package/features/{logger → httpClient}/feature.d.ts +1 -1
- package/features/httpClient/feature.js +11 -0
- package/features/httpClient/feature.js.map +1 -0
- package/features/httpClient/index.d.ts +3 -0
- package/features/httpClient/index.js +3 -0
- package/features/keyValueStore/GlobalKeyValueStore.d.ts +9 -3
- package/features/keyValueStore/GlobalKeyValueStore.js +12 -2
- package/features/keyValueStore/GlobalKeyValueStore.js.map +1 -1
- package/features/keyValueStore/KeyValueStore.d.ts +6 -2
- package/features/keyValueStore/KeyValueStore.js +13 -3
- package/features/keyValueStore/KeyValueStore.js.map +1 -1
- package/features/keyValueStore/KeyValueStoreRepository.d.ts +8 -2
- package/features/keyValueStore/KeyValueStoreRepository.js +82 -4
- package/features/keyValueStore/KeyValueStoreRepository.js.map +1 -1
- package/features/keyValueStore/abstractions.d.ts +132 -14
- package/features/keyValueStore/abstractions.js.map +1 -1
- package/features/keyValueStore/errors.d.ts +29 -0
- package/features/keyValueStore/errors.js +49 -1
- package/features/keyValueStore/errors.js.map +1 -1
- package/features/keyValueStore/index.d.ts +4 -1
- package/features/keyValueStore/index.js +1 -1
- package/features/logger/NullLogger.d.ts +10 -0
- package/features/logger/NullLogger.js +12 -0
- package/features/logger/NullLogger.js.map +1 -0
- package/features/logger/index.d.ts +1 -0
- package/features/logger/index.js +1 -0
- package/features/publicUrls/NullPublicUrls.d.ts +11 -0
- package/features/publicUrls/NullPublicUrls.js +17 -0
- package/features/publicUrls/NullPublicUrls.js.map +1 -0
- package/features/publicUrls/PublicUrl.d.ts +24 -0
- package/features/publicUrls/PublicUrl.js +43 -0
- package/features/publicUrls/PublicUrl.js.map +1 -0
- package/features/publicUrls/__tests__/PublicUrl.test.d.ts +1 -0
- package/features/publicUrls/__tests__/PublicUrl.test.js +38 -0
- package/features/publicUrls/__tests__/PublicUrl.test.js.map +1 -0
- package/features/publicUrls/__tests__/PublicUrls.test.d.ts +1 -0
- package/features/publicUrls/__tests__/PublicUrls.test.js +14 -0
- package/features/publicUrls/__tests__/PublicUrls.test.js.map +1 -0
- package/features/publicUrls/abstractions.d.ts +27 -0
- package/features/publicUrls/abstractions.js +5 -0
- package/features/publicUrls/abstractions.js.map +1 -0
- package/features/publicUrls/feature.d.ts +8 -0
- package/features/publicUrls/feature.js +11 -0
- package/features/publicUrls/feature.js.map +1 -0
- package/features/publicUrls/index.d.ts +3 -0
- package/features/publicUrls/index.js +3 -0
- package/features/requestContext/RawAssumePermissions.d.ts +14 -0
- package/features/requestContext/RawAssumePermissions.js +19 -0
- package/features/requestContext/RawAssumePermissions.js.map +1 -0
- package/features/requestContext/abstractions.d.ts +22 -0
- package/features/requestContext/abstractions.js +2 -1
- package/features/requestContext/abstractions.js.map +1 -1
- package/features/requestContext/extractAssumePermissions.d.ts +14 -0
- package/features/requestContext/extractAssumePermissions.js +32 -0
- package/features/requestContext/extractAssumePermissions.js.map +1 -0
- package/features/requestContext/feature.d.ts +2 -1
- package/features/requestContext/feature.js +2 -0
- package/features/requestContext/feature.js.map +1 -1
- package/features/requestContext/index.d.ts +3 -1
- package/features/requestContext/index.js +2 -1
- package/features/requestStorage/abstractions.d.ts +23 -0
- package/features/requestStorage/abstractions.js +5 -0
- package/features/requestStorage/abstractions.js.map +1 -0
- package/features/requestStorage/index.d.ts +1 -0
- package/features/requestStorage/index.js +1 -0
- package/features/security/IdentityContext/IdentityContext.d.ts +6 -2
- package/features/security/IdentityContext/IdentityContext.js +24 -7
- package/features/security/IdentityContext/IdentityContext.js.map +1 -1
- package/features/security/IdentityContext/abstractions.d.ts +6 -1
- package/features/security/IdentityContext/abstractions.js.map +1 -1
- package/features/security/authorization/AuthorizationContext/AuthorizationContext.d.ts +13 -3
- package/features/security/authorization/AuthorizationContext/AuthorizationContext.js +35 -22
- package/features/security/authorization/AuthorizationContext/AuthorizationContext.js.map +1 -1
- package/features/security/authorization/AuthorizationContext/abstractions.d.ts +2 -0
- package/features/security/authorization/AuthorizationContext/abstractions.js.map +1 -1
- package/features/security/authorization/AuthorizationContext/feature.js +6 -1
- package/features/security/authorization/AuthorizationContext/feature.js.map +1 -1
- package/features/security/authorization/GroupsTeamsAuthorizer/AssumedPermissions.d.ts +30 -0
- package/features/security/authorization/GroupsTeamsAuthorizer/AssumedPermissions.js +60 -0
- package/features/security/authorization/GroupsTeamsAuthorizer/AssumedPermissions.js.map +1 -0
- package/features/security/authorization/GroupsTeamsAuthorizer/feature.js +2 -0
- package/features/security/authorization/GroupsTeamsAuthorizer/feature.js.map +1 -1
- package/features/security/roles/Installer/RolesInstaller.js +1 -0
- package/features/security/roles/Installer/RolesInstaller.js.map +1 -1
- package/features/security/roles/NotifyRoleChange/NotifyOnRoleCreatedHandler.d.ts +11 -0
- package/features/security/roles/NotifyRoleChange/NotifyOnRoleCreatedHandler.js +22 -0
- package/features/security/roles/NotifyRoleChange/NotifyOnRoleCreatedHandler.js.map +1 -0
- package/features/security/roles/NotifyRoleChange/NotifyOnRoleDeletedHandler.d.ts +11 -0
- package/features/security/roles/NotifyRoleChange/NotifyOnRoleDeletedHandler.js +22 -0
- package/features/security/roles/NotifyRoleChange/NotifyOnRoleDeletedHandler.js.map +1 -0
- package/features/security/roles/NotifyRoleChange/NotifyOnRoleUpdatedHandler.d.ts +11 -0
- package/features/security/roles/NotifyRoleChange/NotifyOnRoleUpdatedHandler.js +22 -0
- package/features/security/roles/NotifyRoleChange/NotifyOnRoleUpdatedHandler.js.map +1 -0
- package/features/security/roles/NotifyRoleChange/NotifyRoleChangeUseCase.d.ts +11 -0
- package/features/security/roles/NotifyRoleChange/NotifyRoleChangeUseCase.js +40 -0
- package/features/security/roles/NotifyRoleChange/NotifyRoleChangeUseCase.js.map +1 -0
- package/features/security/roles/NotifyRoleChange/abstractions.d.ts +21 -0
- package/features/security/roles/NotifyRoleChange/abstractions.js +8 -0
- package/features/security/roles/NotifyRoleChange/abstractions.js.map +1 -0
- package/features/security/roles/NotifyRoleChange/feature.d.ts +5 -0
- package/features/security/roles/NotifyRoleChange/feature.js +17 -0
- package/features/security/roles/NotifyRoleChange/feature.js.map +1 -0
- package/features/security/roles/NotifyRoleChange/index.d.ts +2 -0
- package/features/security/roles/NotifyRoleChange/index.js +2 -0
- package/features/security/roles/UpdateRole/UpdateRoleUseCase.js +2 -1
- package/features/security/roles/UpdateRole/UpdateRoleUseCase.js.map +1 -1
- package/features/security/roles/feature.js +2 -0
- package/features/security/roles/feature.js.map +1 -1
- package/features/security/shared/definedOnly.d.ts +1 -0
- package/features/security/shared/definedOnly.js +8 -0
- package/features/security/shared/definedOnly.js.map +1 -0
- package/features/security/shared/index.d.ts +1 -0
- package/features/security/shared/index.js +1 -0
- package/features/security/teams/NotifyTeamChange/NotifyOnTeamChangeHandlers.d.ts +29 -0
- package/features/security/teams/NotifyTeamChange/NotifyOnTeamChangeHandlers.js +58 -0
- package/features/security/teams/NotifyTeamChange/NotifyOnTeamChangeHandlers.js.map +1 -0
- package/features/security/teams/NotifyTeamChange/NotifyTeamChangeUseCase.d.ts +11 -0
- package/features/security/teams/NotifyTeamChange/NotifyTeamChangeUseCase.js +40 -0
- package/features/security/teams/NotifyTeamChange/NotifyTeamChangeUseCase.js.map +1 -0
- package/features/security/teams/NotifyTeamChange/abstractions.d.ts +21 -0
- package/features/security/teams/NotifyTeamChange/abstractions.js +8 -0
- package/features/security/teams/NotifyTeamChange/abstractions.js.map +1 -0
- package/features/security/teams/NotifyTeamChange/feature.d.ts +5 -0
- package/features/security/teams/NotifyTeamChange/feature.js +15 -0
- package/features/security/teams/NotifyTeamChange/feature.js.map +1 -0
- package/features/security/teams/NotifyTeamChange/index.d.ts +2 -0
- package/features/security/teams/NotifyTeamChange/index.js +2 -0
- package/features/security/teams/UpdateTeam/UpdateTeamUseCase.js +2 -1
- package/features/security/teams/UpdateTeam/UpdateTeamUseCase.js.map +1 -1
- package/features/security/teams/feature.js +2 -0
- package/features/security/teams/feature.js.map +1 -1
- package/features/task/TaskDefinition/abstractions.d.ts +13 -20
- package/features/task/TaskDefinition/abstractions.js.map +1 -1
- package/features/task/TaskService/abstractions.d.ts +7 -0
- package/features/task/TaskService/abstractions.js.map +1 -1
- package/features/tenancy/TenantContext/TenantContext.d.ts +5 -1
- package/features/tenancy/TenantContext/TenantContext.js +31 -23
- package/features/tenancy/TenantContext/TenantContext.js.map +1 -1
- package/features/users/shared/loaders.js.map +1 -1
- package/features/users/shared/types.d.ts +9 -7
- package/features/wcp/WcpContext/WcpContext.d.ts +6 -1
- package/features/wcp/WcpContext/WcpContext.js +17 -2
- package/features/wcp/WcpContext/WcpContext.js.map +1 -1
- package/features/wcp/WcpContext/decorators/WcpContextWithFeatureFlagsDecorator.d.ts +9 -73
- package/features/wcp/WcpContext/decorators/WcpContextWithFeatureFlagsDecorator.js +25 -5
- package/features/wcp/WcpContext/decorators/WcpContextWithFeatureFlagsDecorator.js.map +1 -1
- package/features/wcp/WcpLicenseLoader.js.map +1 -1
- package/features/wcp/resolveWcpProjectEnvironment.d.ts +1 -1
- package/features/wcp/resolveWcpProjectEnvironment.js.map +1 -1
- package/features/websockets/SendToIdentity/NullSendToIdentityUseCase.d.ts +20 -0
- package/features/websockets/SendToIdentity/NullSendToIdentityUseCase.js +24 -0
- package/features/websockets/SendToIdentity/NullSendToIdentityUseCase.js.map +1 -0
- package/features/websockets/SendToIdentity/abstractions.d.ts +19 -0
- package/features/websockets/SendToIdentity/abstractions.js +5 -0
- package/features/websockets/SendToIdentity/abstractions.js.map +1 -0
- package/features/websockets/WebsocketServiceError.d.ts +7 -0
- package/features/websockets/WebsocketServiceError.js +14 -0
- package/features/websockets/WebsocketServiceError.js.map +1 -0
- package/features/websockets/index.d.ts +6 -0
- package/features/websockets/index.js +3 -0
- package/features/websockets/types.d.ts +15 -0
- package/features/websockets/types.js +0 -0
- package/graphql/ApiCoreSchemaFactory.d.ts +1 -0
- package/graphql/ApiCoreSchemaFactory.js +7 -1
- package/graphql/ApiCoreSchemaFactory.js.map +1 -1
- package/graphql/featureFlags/FeatureFlagsSchemaFactory.d.ts +1 -0
- package/graphql/featureFlags/FeatureFlagsSchemaFactory.js +4 -0
- package/graphql/featureFlags/FeatureFlagsSchemaFactory.js.map +1 -1
- package/graphql/security/SecuritySchemaFactory.d.ts +1 -0
- package/graphql/security/SecuritySchemaFactory.js +4 -0
- package/graphql/security/SecuritySchemaFactory.js.map +1 -1
- package/graphql/system/SystemSchemaFactory.d.ts +1 -0
- package/graphql/system/SystemSchemaFactory.js +4 -0
- package/graphql/system/SystemSchemaFactory.js.map +1 -1
- package/graphql/users/UsersSchemaFactory.d.ts +1 -0
- package/graphql/users/UsersSchemaFactory.js +4 -0
- package/graphql/users/UsersSchemaFactory.js.map +1 -1
- package/graphql/wcp/WcpSchemaFactory.d.ts +1 -0
- package/graphql/wcp/WcpSchemaFactory.js +5 -1
- package/graphql/wcp/WcpSchemaFactory.js.map +1 -1
- package/idp/JwksCache.d.ts +14 -3
- package/idp/JwksCache.js +97 -17
- package/idp/JwksCache.js.map +1 -1
- package/idp/JwksStoreFeature.d.ts +8 -0
- package/idp/JwksStoreFeature.js +11 -0
- package/idp/JwksStoreFeature.js.map +1 -0
- package/idp/MemoryJwksStore.d.ts +14 -0
- package/idp/MemoryJwksStore.js +21 -0
- package/idp/MemoryJwksStore.js.map +1 -0
- package/idp/OidcJwtIdentityProvider.js +5 -1
- package/idp/OidcJwtIdentityProvider.js.map +1 -1
- package/idp/abstractions.d.ts +24 -0
- package/idp/abstractions.js +2 -1
- package/idp/abstractions.js.map +1 -1
- package/idp/feature.js +1 -2
- package/idp/feature.js.map +1 -1
- package/idp/index.d.ts +1 -0
- package/idp/index.js +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +21 -21
- package/types/users.d.ts +2 -3
- package/features/logger/LoggerService.d.ts +0 -14
- package/features/logger/LoggerService.js +0 -48
- package/features/logger/LoggerService.js.map +0 -1
- package/features/logger/feature.js +0 -11
- package/features/logger/feature.js.map +0 -1
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Logger as LoggerAbstraction } from "./abstractions.js";
|
|
2
|
-
export declare class LoggerImpl implements LoggerAbstraction.Interface {
|
|
3
|
-
private pinoLogger;
|
|
4
|
-
constructor();
|
|
5
|
-
trace(objOrMsg: object | string, ...args: any[]): void;
|
|
6
|
-
debug(objOrMsg: object | string, ...args: any[]): void;
|
|
7
|
-
info(objOrMsg: object | string, ...args: any[]): void;
|
|
8
|
-
warn(objOrMsg: object | string, ...args: any[]): void;
|
|
9
|
-
error(objOrMsg: object | string, ...args: any[]): void;
|
|
10
|
-
fatal(objOrMsg: object | string, ...args: any[]): void;
|
|
11
|
-
log(objOrMsg: object | string, ...args: any[]): void;
|
|
12
|
-
private getLogLevel;
|
|
13
|
-
}
|
|
14
|
-
export declare const Logger: import("@webiny/di").Implementation<typeof LoggerImpl>;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { createImplementation } from "@webiny/feature/api";
|
|
2
|
-
import { pino } from "pino";
|
|
3
|
-
import { Logger } from "./abstractions.js";
|
|
4
|
-
import { StructuredLogFormatter, pinoLambdaDestination } from "pino-lambda";
|
|
5
|
-
const DEFAULT_LOG_LEVEL = "info";
|
|
6
|
-
class LoggerImpl {
|
|
7
|
-
constructor(){
|
|
8
|
-
const level = this.getLogLevel();
|
|
9
|
-
const destination = pinoLambdaDestination({
|
|
10
|
-
formatter: new StructuredLogFormatter()
|
|
11
|
-
});
|
|
12
|
-
this.pinoLogger = pino({
|
|
13
|
-
level
|
|
14
|
-
}, destination);
|
|
15
|
-
}
|
|
16
|
-
trace(objOrMsg, ...args) {
|
|
17
|
-
this.pinoLogger.trace(objOrMsg, ...args);
|
|
18
|
-
}
|
|
19
|
-
debug(objOrMsg, ...args) {
|
|
20
|
-
this.pinoLogger.debug(objOrMsg, ...args);
|
|
21
|
-
}
|
|
22
|
-
info(objOrMsg, ...args) {
|
|
23
|
-
this.pinoLogger.info(objOrMsg, ...args);
|
|
24
|
-
}
|
|
25
|
-
warn(objOrMsg, ...args) {
|
|
26
|
-
this.pinoLogger.warn(objOrMsg, ...args);
|
|
27
|
-
}
|
|
28
|
-
error(objOrMsg, ...args) {
|
|
29
|
-
this.pinoLogger.error(objOrMsg, ...args);
|
|
30
|
-
}
|
|
31
|
-
fatal(objOrMsg, ...args) {
|
|
32
|
-
this.pinoLogger.fatal(objOrMsg, ...args);
|
|
33
|
-
}
|
|
34
|
-
log(objOrMsg, ...args) {
|
|
35
|
-
this.pinoLogger.info(objOrMsg, ...args);
|
|
36
|
-
}
|
|
37
|
-
getLogLevel() {
|
|
38
|
-
return process.env.WEBINY_API_LOG_LEVEL || DEFAULT_LOG_LEVEL;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
const LoggerService_Logger = createImplementation({
|
|
42
|
-
abstraction: Logger,
|
|
43
|
-
implementation: LoggerImpl,
|
|
44
|
-
dependencies: []
|
|
45
|
-
});
|
|
46
|
-
export { LoggerImpl, LoggerService_Logger as Logger };
|
|
47
|
-
|
|
48
|
-
//# sourceMappingURL=LoggerService.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"features/logger/LoggerService.js","sources":["../../../src/features/logger/LoggerService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/feature/api\";\nimport { type Logger as PinoLogger, pino } from \"pino\";\nimport { Logger as LoggerAbstraction } from \"./abstractions.js\";\n\n// TODO: We have `pino-lambda` hardcoded here simply b/c of lack of good infrastructure.\n// We want `pino-lambda` for AWS Lambda, but its setup step relies on context of the Lambda function. That's\n// why we also have it hardcoded in `createHandler` function in `handler-aws` package.\n// Once we have a better infrastructure for handling such cases, we should refactor this.\nimport { pinoLambdaDestination, StructuredLogFormatter } from \"pino-lambda\";\n\nconst DEFAULT_LOG_LEVEL = \"info\";\n\nexport class LoggerImpl implements LoggerAbstraction.Interface {\n private pinoLogger: PinoLogger;\n\n constructor() {\n const level = this.getLogLevel();\n const destination = pinoLambdaDestination({\n formatter: new StructuredLogFormatter()\n });\n this.pinoLogger = pino({ level }, destination);\n }\n\n trace(objOrMsg: object | string, ...args: any[]) {\n this.pinoLogger.trace(objOrMsg, ...args);\n }\n\n debug(objOrMsg: object | string, ...args: any[]) {\n this.pinoLogger.debug(objOrMsg, ...args);\n }\n\n info(objOrMsg: object | string, ...args: any[]) {\n this.pinoLogger.info(objOrMsg, ...args);\n }\n\n warn(objOrMsg: object | string, ...args: any[]) {\n this.pinoLogger.warn(objOrMsg, ...args);\n }\n\n error(objOrMsg: object | string, ...args: any[]) {\n this.pinoLogger.error(objOrMsg, ...args);\n }\n\n fatal(objOrMsg: object | string, ...args: any[]) {\n this.pinoLogger.fatal(objOrMsg, ...args);\n }\n\n log(objOrMsg: object | string, ...args: any[]) {\n this.pinoLogger.info(objOrMsg, ...args);\n }\n\n private getLogLevel() {\n return process.env.WEBINY_API_LOG_LEVEL || DEFAULT_LOG_LEVEL;\n }\n}\n\nexport const Logger = createImplementation({\n abstraction: LoggerAbstraction,\n implementation: LoggerImpl,\n dependencies: []\n});\n"],"names":["DEFAULT_LOG_LEVEL","LoggerImpl","level","destination","pinoLambdaDestination","StructuredLogFormatter","pino","objOrMsg","args","process","Logger","createImplementation","LoggerAbstraction"],"mappings":";;;;AAUA,MAAMA,oBAAoB;AAEnB,MAAMC;IAGT,aAAc;QACV,MAAMC,QAAQ,IAAI,CAAC,WAAW;QAC9B,MAAMC,cAAcC,sBAAsB;YACtC,WAAW,IAAIC;QACnB;QACA,IAAI,CAAC,UAAU,GAAGC,KAAK;YAAEJ;QAAM,GAAGC;IACtC;IAEA,MAAMI,QAAyB,EAAE,GAAGC,IAAW,EAAE;QAC7C,IAAI,CAAC,UAAU,CAAC,KAAK,CAACD,aAAaC;IACvC;IAEA,MAAMD,QAAyB,EAAE,GAAGC,IAAW,EAAE;QAC7C,IAAI,CAAC,UAAU,CAAC,KAAK,CAACD,aAAaC;IACvC;IAEA,KAAKD,QAAyB,EAAE,GAAGC,IAAW,EAAE;QAC5C,IAAI,CAAC,UAAU,CAAC,IAAI,CAACD,aAAaC;IACtC;IAEA,KAAKD,QAAyB,EAAE,GAAGC,IAAW,EAAE;QAC5C,IAAI,CAAC,UAAU,CAAC,IAAI,CAACD,aAAaC;IACtC;IAEA,MAAMD,QAAyB,EAAE,GAAGC,IAAW,EAAE;QAC7C,IAAI,CAAC,UAAU,CAAC,KAAK,CAACD,aAAaC;IACvC;IAEA,MAAMD,QAAyB,EAAE,GAAGC,IAAW,EAAE;QAC7C,IAAI,CAAC,UAAU,CAAC,KAAK,CAACD,aAAaC;IACvC;IAEA,IAAID,QAAyB,EAAE,GAAGC,IAAW,EAAE;QAC3C,IAAI,CAAC,UAAU,CAAC,IAAI,CAACD,aAAaC;IACtC;IAEQ,cAAc;QAClB,OAAOC,QAAQ,GAAG,CAAC,oBAAoB,IAAIT;IAC/C;AACJ;AAEO,MAAMU,uBAASC,qBAAqB;IACvC,aAAaC;IACb,gBAAgBX;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { createFeature } from "@webiny/feature/api";
|
|
2
|
-
import { Logger } from "./LoggerService.js";
|
|
3
|
-
const LoggerFeature = createFeature({
|
|
4
|
-
name: "LoggerFeature",
|
|
5
|
-
register (container) {
|
|
6
|
-
container.register(Logger);
|
|
7
|
-
}
|
|
8
|
-
});
|
|
9
|
-
export { LoggerFeature };
|
|
10
|
-
|
|
11
|
-
//# sourceMappingURL=feature.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"features/logger/feature.js","sources":["../../../src/features/logger/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { Logger } from \"./LoggerService.js\";\n\nexport const LoggerFeature = createFeature({\n name: \"LoggerFeature\",\n register(container) {\n container.register(Logger);\n }\n});\n"],"names":["LoggerFeature","createFeature","container","Logger"],"mappings":";;AAGO,MAAMA,gBAAgBC,cAAc;IACvC,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;IACvB;AACJ"}
|