@netacea/cloudfront 1.10.0 → 1.10.1
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 +8 -0
- package/README.md +20 -2
- package/dist/package.json +5 -5
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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.1](https://github.com/Netacea/JavascriptATAIntegration/compare/@netacea/cloudfront@1.10.0...@netacea/cloudfront@1.10.1) (2022-05-26)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @netacea/cloudfront
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [1.10.0](https://github.com/Netacea/JavascriptATAIntegration/compare/@netacea/cloudfront@1.9.0...@netacea/cloudfront@1.10.0) (2022-04-29)
|
|
7
15
|
|
|
8
16
|
|
package/README.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# Netacea CloudFront
|
|
2
|
+
|
|
2
3
|

|
|
3
4
|
|
|
4
5
|
[](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
|
-
|
|
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.
|
|
3
|
+
"version": "1.10.1",
|
|
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.
|
|
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.
|
|
32
|
-
"@netacea/netaceaintegrationtestrunner": "^1.5.
|
|
31
|
+
"@netacea/netaceaintegrationbase": "^1.10.1",
|
|
32
|
+
"@netacea/netaceaintegrationtestrunner": "^1.5.1",
|
|
33
33
|
"axios": "^0.21.0"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "917a520d63da8aa576eb43ef537a2c021fc94fa0"
|
|
36
36
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netacea/cloudfront",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.1",
|
|
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.
|
|
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.
|
|
32
|
-
"@netacea/netaceaintegrationtestrunner": "^1.5.
|
|
31
|
+
"@netacea/netaceaintegrationbase": "^1.10.1",
|
|
32
|
+
"@netacea/netaceaintegrationtestrunner": "^1.5.1",
|
|
33
33
|
"axios": "^0.21.0"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "917a520d63da8aa576eb43ef537a2c021fc94fa0"
|
|
36
36
|
}
|