@netacea/cloudfront 1.10.0 → 1.10.3

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/CHANGELOG.md CHANGED
@@ -3,6 +3,30 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.10.3](https://github.com/Netacea/JavascriptATAIntegration/compare/@netacea/cloudfront@1.10.2...@netacea/cloudfront@1.10.3) (2022-06-16)
7
+
8
+ **Note:** Version bump only for package @netacea/cloudfront
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.10.2](https://github.com/Netacea/JavascriptATAIntegration/compare/@netacea/cloudfront@1.10.1...@netacea/cloudfront@1.10.2) (2022-06-01)
15
+
16
+ **Note:** Version bump only for package @netacea/cloudfront
17
+
18
+
19
+
20
+
21
+
22
+ ## [1.10.1](https://github.com/Netacea/JavascriptATAIntegration/compare/@netacea/cloudfront@1.10.0...@netacea/cloudfront@1.10.1) (2022-05-26)
23
+
24
+ **Note:** Version bump only for package @netacea/cloudfront
25
+
26
+
27
+
28
+
29
+
6
30
  # [1.10.0](https://github.com/Netacea/JavascriptATAIntegration/compare/@netacea/cloudfront@1.9.0...@netacea/cloudfront@1.10.0) (2022-04-29)
7
31
 
8
32
 
package/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  # Netacea CloudFront
2
+
2
3
  ![Netacea Header](https://assets.ntcacdn.net/header.jpg)
3
4
 
4
5
  [![npm](https://img.shields.io/npm/v/@netacea/cloudfront.svg)](https://www.npmjs.com/package/@netacea/cloudfront)  
@@ -6,27 +7,37 @@
6
7
 
7
8
  `@netacea/cloudfront` is a package designed to add [Netacea](https://netacea.com) functionality to [CloudFront Lambda@Edge](https://aws.amazon.com/lambda/edge/).
8
9
 
9
- # Installation
10
+ ## Installation
11
+
10
12
  ### 🌻 Starting fresh
13
+
11
14
  Quickest way to get started, is pulling the Netacea CloudFront template repository from github and following the steps in there to get up and running.
15
+
12
16
  ```bash
13
17
  git clone https://github.com/Netacea/cloudfront-worker-template-typescript.git
14
18
  ```
19
+
15
20
  Follow the `README.md` in the [cloudfront-worker-template-typescript](https://github.com/Netacea/cloudfront-worker-template-typescript) repository to get this deployed.
16
21
 
17
22
  ### ✍ Existing Lambda@Edge worker
23
+
18
24
  Run the following command to install the netacea worker
25
+
19
26
  ``` bash
20
27
  npm i @netacea/cloudfront --save
21
28
  ```
29
+
22
30
  Require (javascript) or import (typescript) the worker
31
+
23
32
  ``` javascript
24
33
  // JAVASCRIPT:
25
34
  const NetaceaCloudFront = require('@netacea/cloudfront').default
26
35
  // TYPESCRIPT:
27
36
  import NetaceaCloudFront from '@netacea/cloudfront'
28
37
  ```
38
+
29
39
  Then declare a variable for the worker.
40
+
30
41
  ``` javascript
31
42
  const worker = new NetaceaCloudFront({
32
43
  apiKey: 'your-api-key', // REQUIRED
@@ -36,11 +47,13 @@ const worker = new NetaceaCloudFront({
36
47
  kinesisSecretKey: 'your-kinesis-secret-key' // REQUIRED if not using secretsManager
37
48
  })
38
49
  ```
50
+
39
51
  It's best security practice to **not** commit your `apiKey`, `secretKey`, `kinesisAccessKey`, `kinesisSecretKey` to any repository.
40
52
 
41
53
  The code will run in the `Viewer Request`, `Origin Response` and `Viewer Response` events.
42
54
 
43
55
  Example Viewer Request:
56
+
44
57
  ``` javascript
45
58
  import NetaceaCloudFront from '@netacea/cloudfront'
46
59
  const worker = new NetaceaCloudFront({
@@ -63,6 +76,7 @@ export const handler = async (event: any, context: any, callback: any): Promise<
63
76
  ```
64
77
 
65
78
  Example Origin Response:
79
+
66
80
  ``` javascript
67
81
  import NetaceaCloudFront from '@netacea/cloudfront'
68
82
  const worker = new NetaceaCloudFront({
@@ -84,6 +98,7 @@ export const handler = async (event: any, context: any, callback: any): Promise<
84
98
  ```
85
99
 
86
100
  Example Viewer Response:
101
+
87
102
  ``` javascript
88
103
  import NetaceaCloudFront from '@netacea/cloudfront'
89
104
  const worker = new NetaceaCloudFront({
@@ -106,12 +121,15 @@ export const handler = async (event: any, context: any, callback: any): Promise<
106
121
 
107
122
  This line is very important for ingest to take place.
108
123
  Without this, latency **will** be added to some requests.
109
- ```
124
+
125
+ ``` javascript
110
126
  context.callbackWaitsForEmptyEventLoop = false
111
127
  ```
112
128
 
113
129
  ## ⬆ Updating
130
+
114
131
  ```bash
115
132
  npm i @netacea/cloudfront@latest --save
116
133
  ```
134
+
117
135
  This will update the netacea module to the latest version.
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netacea/cloudfront",
3
- "version": "1.10.0",
3
+ "version": "1.10.3",
4
4
  "description": "Netacea Cloudfront CDN integration",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "license": "ISC",
17
17
  "devDependencies": {
18
- "@netacea/kinesisingest": "^1.4.0",
18
+ "@netacea/kinesisingest": "^1.4.1",
19
19
  "@types/node": "^14.11.2",
20
20
  "@types/sinon": "^9.0.8",
21
21
  "@types/tape": "^4.13.0",
@@ -28,9 +28,9 @@
28
28
  "typescript": "^3.9.7"
29
29
  },
30
30
  "dependencies": {
31
- "@netacea/netaceaintegrationbase": "^1.10.0",
32
- "@netacea/netaceaintegrationtestrunner": "^1.5.0",
31
+ "@netacea/netaceaintegrationbase": "^1.10.2",
32
+ "@netacea/netaceaintegrationtestrunner": "^1.5.3",
33
33
  "axios": "^0.21.0"
34
34
  },
35
- "gitHead": "199ab99c6cfb464e5dc9008566629b87dac2a919"
35
+ "gitHead": "35dd8fc95b788b2b0eba53acc6b5df3aa22b7c3f"
36
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netacea/cloudfront",
3
- "version": "1.10.0",
3
+ "version": "1.10.3",
4
4
  "description": "Netacea Cloudfront CDN integration",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "license": "ISC",
17
17
  "devDependencies": {
18
- "@netacea/kinesisingest": "^1.4.0",
18
+ "@netacea/kinesisingest": "^1.4.1",
19
19
  "@types/node": "^14.11.2",
20
20
  "@types/sinon": "^9.0.8",
21
21
  "@types/tape": "^4.13.0",
@@ -28,9 +28,9 @@
28
28
  "typescript": "^3.9.7"
29
29
  },
30
30
  "dependencies": {
31
- "@netacea/netaceaintegrationbase": "^1.10.0",
32
- "@netacea/netaceaintegrationtestrunner": "^1.5.0",
31
+ "@netacea/netaceaintegrationbase": "^1.10.2",
32
+ "@netacea/netaceaintegrationtestrunner": "^1.5.3",
33
33
  "axios": "^0.21.0"
34
34
  },
35
- "gitHead": "199ab99c6cfb464e5dc9008566629b87dac2a919"
35
+ "gitHead": "35dd8fc95b788b2b0eba53acc6b5df3aa22b7c3f"
36
36
  }