@aws-lambda-powertools/commons
Advanced tools
Comparing version 2.0.0-alpha.2 to 2.0.0
@@ -44,3 +44,4 @@ "use strict"; | ||
const powertoolsUserAgent = `PT/${feature}/${version_js_1.PT_VERSION} PTEnv/${EXEC_ENV}`; | ||
args.request.headers['user-agent'] = `${args.request.headers['user-agent']} ${powertoolsUserAgent}`; | ||
args.request.headers['user-agent'] = | ||
`${args.request.headers['user-agent']} ${powertoolsUserAgent}`; | ||
return await next(args); | ||
@@ -47,0 +48,0 @@ }; |
@@ -13,7 +13,7 @@ import type { ConfigServiceInterface } from '../types/ConfigServiceInterface.js'; | ||
* @see https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime | ||
* @see https://docs.powertools.aws.dev/lambda-typescript/latest/#environment-variables | ||
* @see https://docs.powertools.aws.dev/lambda/typescript/latest/#environment-variables | ||
*/ | ||
declare class EnvironmentVariablesService implements ConfigServiceInterface { | ||
/** | ||
* @see https://docs.powertools.aws.dev/lambda-typescript/latest/#environment-variables | ||
* @see https://docs.powertools.aws.dev/lambda/typescript/latest/#environment-variables | ||
* @protected | ||
@@ -20,0 +20,0 @@ */ |
@@ -15,14 +15,16 @@ "use strict"; | ||
* @see https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime | ||
* @see https://docs.powertools.aws.dev/lambda-typescript/latest/#environment-variables | ||
* @see https://docs.powertools.aws.dev/lambda/typescript/latest/#environment-variables | ||
*/ | ||
class EnvironmentVariablesService { | ||
constructor() { | ||
/** | ||
* @see https://docs.powertools.aws.dev/lambda/typescript/latest/#environment-variables | ||
* @protected | ||
*/ | ||
this.devModeVariable = 'POWERTOOLS_DEV'; | ||
this.serviceNameVariable = 'POWERTOOLS_SERVICE_NAME'; | ||
// Reserved environment variables | ||
this.xRayTraceIdVariable = '_X_AMZN_TRACE_ID'; | ||
} | ||
/** | ||
* @see https://docs.powertools.aws.dev/lambda-typescript/latest/#environment-variables | ||
* @protected | ||
*/ | ||
devModeVariable = 'POWERTOOLS_DEV'; | ||
serviceNameVariable = 'POWERTOOLS_SERVICE_NAME'; | ||
// Reserved environment variables | ||
xRayTraceIdVariable = '_X_AMZN_TRACE_ID'; | ||
/** | ||
* It returns the value of an environment variable that has given name. | ||
@@ -29,0 +31,0 @@ * |
@@ -62,4 +62,6 @@ "use strict"; | ||
class Utility { | ||
coldStart = true; | ||
defaultServiceName = 'service_undefined'; | ||
constructor() { | ||
this.coldStart = true; | ||
this.defaultServiceName = 'service_undefined'; | ||
} | ||
getColdStart() { | ||
@@ -66,0 +68,0 @@ if (this.coldStart) { |
@@ -1,2 +0,2 @@ | ||
export declare const PT_VERSION = "2.0.0-alpha.2"; | ||
export declare const PT_VERSION = "2.0.0"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -5,2 +5,2 @@ "use strict"; | ||
// this file is auto generated, do not modify | ||
exports.PT_VERSION = '2.0.0-alpha.2'; | ||
exports.PT_VERSION = '2.0.0'; |
@@ -40,3 +40,4 @@ import { PT_VERSION } from './version.js'; | ||
const powertoolsUserAgent = `PT/${feature}/${PT_VERSION} PTEnv/${EXEC_ENV}`; | ||
args.request.headers['user-agent'] = `${args.request.headers['user-agent']} ${powertoolsUserAgent}`; | ||
args.request.headers['user-agent'] = | ||
`${args.request.headers['user-agent']} ${powertoolsUserAgent}`; | ||
return await next(args); | ||
@@ -43,0 +44,0 @@ }; |
@@ -13,7 +13,7 @@ import type { ConfigServiceInterface } from '../types/ConfigServiceInterface.js'; | ||
* @see https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime | ||
* @see https://docs.powertools.aws.dev/lambda-typescript/latest/#environment-variables | ||
* @see https://docs.powertools.aws.dev/lambda/typescript/latest/#environment-variables | ||
*/ | ||
declare class EnvironmentVariablesService implements ConfigServiceInterface { | ||
/** | ||
* @see https://docs.powertools.aws.dev/lambda-typescript/latest/#environment-variables | ||
* @see https://docs.powertools.aws.dev/lambda/typescript/latest/#environment-variables | ||
* @protected | ||
@@ -20,0 +20,0 @@ */ |
@@ -12,14 +12,16 @@ /** | ||
* @see https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime | ||
* @see https://docs.powertools.aws.dev/lambda-typescript/latest/#environment-variables | ||
* @see https://docs.powertools.aws.dev/lambda/typescript/latest/#environment-variables | ||
*/ | ||
class EnvironmentVariablesService { | ||
constructor() { | ||
/** | ||
* @see https://docs.powertools.aws.dev/lambda/typescript/latest/#environment-variables | ||
* @protected | ||
*/ | ||
this.devModeVariable = 'POWERTOOLS_DEV'; | ||
this.serviceNameVariable = 'POWERTOOLS_SERVICE_NAME'; | ||
// Reserved environment variables | ||
this.xRayTraceIdVariable = '_X_AMZN_TRACE_ID'; | ||
} | ||
/** | ||
* @see https://docs.powertools.aws.dev/lambda-typescript/latest/#environment-variables | ||
* @protected | ||
*/ | ||
devModeVariable = 'POWERTOOLS_DEV'; | ||
serviceNameVariable = 'POWERTOOLS_SERVICE_NAME'; | ||
// Reserved environment variables | ||
xRayTraceIdVariable = '_X_AMZN_TRACE_ID'; | ||
/** | ||
* It returns the value of an environment variable that has given name. | ||
@@ -26,0 +28,0 @@ * |
@@ -59,4 +59,6 @@ /** | ||
export class Utility { | ||
coldStart = true; | ||
defaultServiceName = 'service_undefined'; | ||
constructor() { | ||
this.coldStart = true; | ||
this.defaultServiceName = 'service_undefined'; | ||
} | ||
getColdStart() { | ||
@@ -63,0 +65,0 @@ if (this.coldStart) { |
@@ -1,2 +0,2 @@ | ||
export declare const PT_VERSION = "2.0.0-alpha.2"; | ||
export declare const PT_VERSION = "2.0.0"; | ||
//# sourceMappingURL=version.d.ts.map |
// this file is auto generated, do not modify | ||
export const PT_VERSION = '2.0.0-alpha.2'; | ||
export const PT_VERSION = '2.0.0'; |
{ | ||
"name": "@aws-lambda-powertools/commons", | ||
"version": "2.0.0-alpha.2", | ||
"version": "2.0.0", | ||
"description": "A shared utility package for Powertools for AWS Lambda (TypeScript) libraries", | ||
@@ -5,0 +5,0 @@ "author": { |
# Powertools for AWS Lambda (TypeScript) <!-- omit in toc --> | ||
Powertools for AWS Lambda (TypeScript) is a developer toolkit to implement Serverless [best practices and increase developer velocity](https://docs.powertools.aws.dev/lambda-typescript/latest/#features). | ||
Powertools for AWS Lambda (TypeScript) is a developer toolkit to implement Serverless [best practices and increase developer velocity](https://docs.powertools.aws.dev/lambda/typescript/latest/#features). | ||
You can use the library in both TypeScript and JavaScript code bases. | ||
> Also available in [Python](https://github.com/aws-powertools/powertools-lambda-python), [Java](https://github.com/aws-powertools/powertools-lambda-java), and [.NET](https://docs.powertools.aws.dev/lambda-dotnet/). | ||
> Also available in [Python](https://github.com/aws-powertools/powertools-lambda-python), [Java](https://github.com/aws-powertools/powertools-lambda-java), and [.NET](https://github.com/aws-powertools/powertools-lambda-dotnet). | ||
**[Documentation](https://docs.powertools.aws.dev/lambda-typescript/)** | **[npm](https://www.npmjs.com/org/aws-lambda-powertools)** | **[Roadmap](https://docs.powertools.aws.dev/lambda-typescript/latest/roadmap)** | **[Examples](https://github.com/aws-powertools/powertools-lambda-typescript/tree/main/examples)** | ||
**[Documentation](https://docs.powertools.aws.dev/lambda/typescript/)** | **[npm](https://www.npmjs.com/org/aws-lambda-powertools)** | **[Roadmap](https://docs.powertools.aws.dev/lambda/typescript/latest/roadmap)** | **[Examples](https://github.com/aws-powertools/powertools-lambda-typescript/tree/main/examples)** | ||
@@ -18,3 +18,3 @@ ## Table of contents <!--- omit in toc --> | ||
- [Examples](#examples) | ||
- [Serverless TypeScript Demo application](#serverless-typescript-demo-application) | ||
- [Demo applications](#demo-applications) | ||
- [Contribute](#contribute) | ||
@@ -32,12 +32,12 @@ - [Roadmap](#roadmap) | ||
* **[Tracer](https://docs.powertools.aws.dev/lambda-typescript/latest/core/tracer/)** - Utilities to trace Lambda function handlers, and both synchronous and asynchronous functions | ||
* **[Logger](https://docs.powertools.aws.dev/lambda-typescript/latest/core/logger/)** - Structured logging made easier, and a middleware to enrich log items with key details of the Lambda context | ||
* **[Metrics](https://docs.powertools.aws.dev/lambda-typescript/latest/core/metrics/)** - Custom Metrics created asynchronously via CloudWatch Embedded Metric Format (EMF) | ||
* **[Parameters](https://docs.powertools.aws.dev/lambda-typescript/latest/utilities/parameters/)** - High-level functions to retrieve one or more parameters from AWS SSM, Secrets Manager, AppConfig, and DynamoDB | ||
* **[Idempotency](https://docs.powertools.aws.dev/lambda-typescript/latest/utilities/idempotency/)** - Class method decorator, Middy middleware, and function wrapper to make your Lambda functions idempotent and prevent duplicate execution based on payload content | ||
* **[Batch processing](https://docs.powertools.aws.dev/lambda-typescript/latest/utilities/batch/)** - Utility to handle partial failures when processing batches from Amazon SQS, Amazon Kinesis Data Streams, and Amazon DynamoDB Streams. | ||
* **[Tracer](https://docs.powertools.aws.dev/lambda/typescript/latest/core/tracer/)** - Utilities to trace Lambda function handlers, and both synchronous and asynchronous functions | ||
* **[Logger](https://docs.powertools.aws.dev/lambda/typescript/latest/core/logger/)** - Structured logging made easier, and a middleware to enrich log items with key details of the Lambda context | ||
* **[Metrics](https://docs.powertools.aws.dev/lambda/typescript/latest/core/metrics/)** - Custom Metrics created asynchronously via CloudWatch Embedded Metric Format (EMF) | ||
* **[Parameters](https://docs.powertools.aws.dev/lambda/typescript/latest/utilities/parameters/)** - High-level functions to retrieve one or more parameters from AWS SSM, Secrets Manager, AppConfig, and DynamoDB | ||
* **[Idempotency](https://docs.powertools.aws.dev/lambda/typescript/latest/utilities/idempotency/)** - Class method decorator, Middy middleware, and function wrapper to make your Lambda functions idempotent and prevent duplicate execution based on payload content | ||
* **[Batch processing](https://docs.powertools.aws.dev/lambda/typescript/latest/utilities/batch/)** - Utility to handle partial failures when processing batches from Amazon SQS, Amazon Kinesis Data Streams, and Amazon DynamoDB Streams. | ||
## Getting started | ||
Find the complete project's [documentation here](https://docs.powertools.aws.dev/lambda-typescript). | ||
Find the complete project's [documentation here](https://docs.powertools.aws.dev/lambda/typescript). | ||
@@ -58,9 +58,9 @@ ### Installation | ||
π [Installation guide for the **Tracer** utility](https://docs.powertools.aws.dev/lambda-typescript/latest/core/tracer#getting-started) | ||
π [Installation guide for the **Tracer** utility](https://docs.powertools.aws.dev/lambda/typescript/latest/core/tracer#getting-started) | ||
π [Installation guide for the **Logger** utility](https://docs.powertools.aws.dev/lambda-typescript/latest/core/logger#getting-started) | ||
π [Installation guide for the **Logger** utility](https://docs.powertools.aws.dev/lambda/typescript/latest/core/logger#getting-started) | ||
π [Installation guide for the **Metrics** utility](https://docs.powertools.aws.dev/lambda-typescript/latest/core/metrics#getting-started) | ||
π [Installation guide for the **Metrics** utility](https://docs.powertools.aws.dev/lambda/typescript/latest/core/metrics#getting-started) | ||
π [Installation guide for the **Parameters** utility](https://docs.powertools.aws.dev/lambda-typescript/latest/utilities/parameters/#getting-started) | ||
π [Installation guide for the **Parameters** utility](https://docs.powertools.aws.dev/lambda/typescript/latest/utilities/parameters/#getting-started) | ||
@@ -72,3 +72,3 @@ ### Examples | ||
### Serverless TypeScript Demo application | ||
### Demo applications | ||
@@ -78,2 +78,4 @@ The [Serverless TypeScript Demo](https://github.com/aws-samples/serverless-typescript-demo) shows how to use Powertools for AWS Lambda (TypeScript). | ||
The [AWS Lambda performance tuning](https://github.com/aws-samples/optimizations-for-lambda-functions) repository also uses Powertools for AWS Lambda (TypeScript) as well as demonstrating other performance tuning techniques for Lambda functions written in TypeScript. | ||
## Contribute | ||
@@ -110,6 +112,8 @@ | ||
* [tecRacer GmbH & Co. KG](https://www.tecracer.com/) | ||
* [AppYourself](https://appyourself.net) | ||
* [Alma Media](https://www.almamedia.fi) | ||
### Sharing your work | ||
Share what you did with Powertools for AWS Lambda (TypeScript) ππ. Blog post, workshops, presentation, sample apps and others. Check out what the community has already shared about Powertools for AWS Lambda (TypeScript) [here](https://docs.powertools.aws.dev/lambda-typescript/latest/we_made_this). | ||
Share what you did with Powertools for AWS Lambda (TypeScript) ππ. Blog post, workshops, presentation, sample apps and others. Check out what the community has already shared about Powertools for AWS Lambda (TypeScript) [here](https://docs.powertools.aws.dev/lambda/typescript/latest/we_made_this). | ||
@@ -116,0 +120,0 @@ ### Using Lambda Layer |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
92195
90
1668
0
0
125