@netacea/cloudflare 1.6.0 → 1.6.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 +18 -4
- package/dist/package.json +4 -4
- package/package.json +4 -4
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.6.1](https://github.com/Netacea/JavascriptATAIntegration/compare/@netacea/cloudflare@1.6.0...@netacea/cloudflare@1.6.1) (2022-05-26)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @netacea/cloudflare
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [1.6.0](https://github.com/Netacea/JavascriptATAIntegration/compare/@netacea/cloudflare@1.5.3...@netacea/cloudflare@1.6.0) (2022-04-29)
|
|
7
15
|
|
|
8
16
|
|
package/README.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# Netacea Cloudflare
|
|
2
|
+
|
|
2
3
|

|
|
3
4
|
|
|
4
5
|
[](https://www.npmjs.com/package/@netacea/cloudflare)
|
|
@@ -6,13 +7,16 @@
|
|
|
6
7
|
|
|
7
8
|
`@netacea/cloudflare` is a package designed to add [Netacea](https://netacea.com) functionality to [Cloudflare Workers](https://workers.cloudflare.com/).
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
### 🤠 __Wrangler__
|
|
10
13
|
|
|
11
|
-
## 🤠 __Wrangler__
|
|
12
14
|
We strongly recommend installing and using using [wrangler](https://github.com/cloudflare/wrangler) to manage your cloudflare workers. Wrangler is a CLI tool designed to make previewing and deploying Cloudflare Workers seamless.
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
#### 🌻 Starting fresh
|
|
17
|
+
|
|
15
18
|
After installing wrangler, you can pull the Netacea worker template by running the following:
|
|
19
|
+
|
|
16
20
|
```bash
|
|
17
21
|
wrangler generate netacea-cloudflare-worker https://github.com/netacea/cloudflare-worker-template-typescript
|
|
18
22
|
cd netacea-cloudflare-worker
|
|
@@ -20,23 +24,30 @@ npm i
|
|
|
20
24
|
npm i @netacea/cloudflare@latest
|
|
21
25
|
npm run test
|
|
22
26
|
```
|
|
27
|
+
|
|
23
28
|
The tests should pass. (If not please open an issue [here](https://github.com/Netacea/cloudflare-worker-template-typescript/issues)!
|
|
24
29
|
|
|
25
30
|
Follow the `README.md` in the [cloudflare-worker-template-typescript](https://github.com/Netacea/cloudflare-worker-template-typescript) repository to get this deployed.
|
|
26
31
|
|
|
27
|
-
|
|
32
|
+
#### ✍ Existing javascript worker
|
|
33
|
+
|
|
28
34
|
Run the following command to install the netacea worker
|
|
35
|
+
|
|
29
36
|
``` bash
|
|
30
37
|
npm i @netacea/cloudflare --save
|
|
31
38
|
```
|
|
39
|
+
|
|
32
40
|
Require (javascript) or import (typescript) the worker
|
|
41
|
+
|
|
33
42
|
``` javascript
|
|
34
43
|
// JAVASCRIPT:
|
|
35
44
|
const NetaceaCloudflare = require('@netacea/cloudflare').default
|
|
36
45
|
// TYPESCRIPT:
|
|
37
46
|
import NetaceaCloudflare from '@netacea/cloudflare'
|
|
38
47
|
```
|
|
48
|
+
|
|
39
49
|
Then declare a variable for the worker.
|
|
50
|
+
|
|
40
51
|
``` javascript
|
|
41
52
|
const worker = new NetaceaCloudflare({
|
|
42
53
|
apiKey: 'your-api-key',
|
|
@@ -48,6 +59,7 @@ It's best security practice to **not** commit your `apiKey` and `secretKey` to a
|
|
|
48
59
|
|
|
49
60
|
Finally in your request handler, call worker.run(event, originRequest) where originRequest is a function that will return a response.
|
|
50
61
|
For example a full typescript worker would look like:
|
|
62
|
+
|
|
51
63
|
``` javascript
|
|
52
64
|
import NetaceaCloudflare from '@netacea/cloudflare'
|
|
53
65
|
const worker = new NetaceaCloudflare({
|
|
@@ -70,7 +82,9 @@ async function originRequest(request: Request): Promise<Response> {
|
|
|
70
82
|
```
|
|
71
83
|
|
|
72
84
|
## ⬆ Updating
|
|
85
|
+
|
|
73
86
|
```bash
|
|
74
87
|
npm i @netacea/cloudflare@latest --save
|
|
75
88
|
```
|
|
89
|
+
|
|
76
90
|
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/cloudflare",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "Netacea Cloudflare CDN Integration",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"license": "ISC",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@netacea/netaceaintegrationbase": "^1.10.
|
|
19
|
-
"@netacea/netaceaintegrationtestrunner": "^1.5.
|
|
18
|
+
"@netacea/netaceaintegrationbase": "^1.10.1",
|
|
19
|
+
"@netacea/netaceaintegrationtestrunner": "^1.5.1"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@cloudflare/workers-types": "^2.0.0",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"tsconfig-paths": "^3.9.0",
|
|
33
33
|
"typescript": "^3.9.7"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "917a520d63da8aa576eb43ef537a2c021fc94fa0"
|
|
36
36
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netacea/cloudflare",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "Netacea Cloudflare CDN Integration",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"license": "ISC",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@netacea/netaceaintegrationbase": "^1.10.
|
|
19
|
-
"@netacea/netaceaintegrationtestrunner": "^1.5.
|
|
18
|
+
"@netacea/netaceaintegrationbase": "^1.10.1",
|
|
19
|
+
"@netacea/netaceaintegrationtestrunner": "^1.5.1"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@cloudflare/workers-types": "^2.0.0",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"tsconfig-paths": "^3.9.0",
|
|
33
33
|
"typescript": "^3.9.7"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "917a520d63da8aa576eb43ef537a2c021fc94fa0"
|
|
36
36
|
}
|