@twilio-labs/serverless-twilio-runtime 2.0.0 → 2.0.2

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
@@ -1,48 +1,41 @@
1
1
  # Change Log
2
2
 
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- # [2.0.0](https://github.com/twilio-labs/serverless-toolkit/compare/@twilio-labs/serverless-twilio-runtime@2.0.0-beta.3...@twilio-labs/serverless-twilio-runtime@2.0.0) (2021-05-19)
7
-
8
- **Note:** Version bump only for package @twilio-labs/serverless-twilio-runtime
3
+ ## 2.0.2
9
4
 
5
+ ### Patch Changes
10
6
 
7
+ - [#527](https://github.com/twilio-labs/serverless-toolkit/pull/527) [`255da3b99f3ae015b1f8c27670937c62a0d52771`](https://github.com/twilio-labs/serverless-toolkit/commit/255da3b99f3ae015b1f8c27670937c62a0d52771) Thanks [@AndreLars](https://github.com/AndreLars)! - fix(twilio-run): handle adding object as header correctly as an error
11
8
 
9
+ - Updated dependencies [[`13b9a2e5c41a960161467cf0290bb143672907ff`](https://github.com/twilio-labs/serverless-toolkit/commit/13b9a2e5c41a960161467cf0290bb143672907ff)]:
10
+ - @twilio-labs/serverless-api@5.6.0
12
11
 
12
+ All notable changes to this project will be documented in this file.
13
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
13
14
 
14
- # [2.0.0-beta.3](https://github.com/twilio-labs/serverless-toolkit/compare/@twilio-labs/serverless-twilio-runtime@2.0.0-beta.2...@twilio-labs/serverless-twilio-runtime@2.0.0-beta.3) (2021-04-21)
15
+ ## [2.0.1](https://github.com/twilio-labs/serverless-toolkit/compare/@twilio-labs/serverless-twilio-runtime@2.0.0...@twilio-labs/serverless-twilio-runtime@2.0.1) (2021-07-14)
15
16
 
16
17
  **Note:** Version bump only for package @twilio-labs/serverless-twilio-runtime
17
18
 
19
+ # [2.0.0](https://github.com/twilio-labs/serverless-toolkit/compare/@twilio-labs/serverless-twilio-runtime@2.0.0-beta.3...@twilio-labs/serverless-twilio-runtime@2.0.0) (2021-05-19)
18
20
 
21
+ **Note:** Version bump only for package @twilio-labs/serverless-twilio-runtime
19
22
 
23
+ # [2.0.0-beta.3](https://github.com/twilio-labs/serverless-toolkit/compare/@twilio-labs/serverless-twilio-runtime@2.0.0-beta.2...@twilio-labs/serverless-twilio-runtime@2.0.0-beta.3) (2021-04-21)
20
24
 
25
+ **Note:** Version bump only for package @twilio-labs/serverless-twilio-runtime
21
26
 
22
27
  # [2.0.0-beta.2](https://github.com/twilio-labs/serverless-toolkit/compare/@twilio-labs/serverless-twilio-runtime@2.0.0-beta.1...@twilio-labs/serverless-twilio-runtime@2.0.0-beta.2) (2021-04-21)
23
28
 
24
29
  **Note:** Version bump only for package @twilio-labs/serverless-twilio-runtime
25
30
 
26
-
27
-
28
-
29
-
30
31
  # 2.0.0-beta.1 (2021-04-21)
31
32
 
32
33
  **Note:** Version bump only for package @twilio-labs/serverless-twilio-runtime
33
34
 
34
-
35
-
36
-
37
-
38
35
  # 2.0.0-beta.0 (2020-08-27)
39
36
 
40
37
  **Note:** Version bump only for package @twilio-labs/serverless-twilio-runtime
41
38
 
42
-
43
-
44
-
45
-
46
39
  # Changelog
47
40
 
48
41
  All notable changes to this project will be documented in this file.
package/Readme.md CHANGED
@@ -8,7 +8,7 @@ Serverless Framework plugin to deploy to the Twilio Runtime.
8
8
 
9
9
  ### Pre-requisites
10
10
 
11
- - Node.js v12.x (this is the runtime version supported by Twilio Functions)
11
+ - Node.js v18.x (this is the runtime version supported by Twilio Functions)
12
12
  - Serverless CLI v1.50.0+. You can run npm i -g serverless if you don't already have it.
13
13
  - A Twilio account. If you don't have one you can [sign up quickly](https://www.twilio.com/try-twilio).
14
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twilio-labs/serverless-twilio-runtime",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "description": "Serverless framework integartion for Twilio runtime",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -30,7 +30,7 @@
30
30
  "url": "https://github.com/twilio-labs/serverless-toolkit/issues"
31
31
  },
32
32
  "dependencies": {
33
- "@twilio-labs/serverless-api": "^1.0.1"
33
+ "@twilio-labs/serverless-api": "^5.6.0"
34
34
  },
35
- "gitHead": "e206ab14d91c4f0fe624b4d5f2ed8e0e67900bd8"
35
+ "gitHead": "9382ba7f1c23cdf18ac8bb6cada92340d63491dd"
36
36
  }
package/util/util.js CHANGED
@@ -2,11 +2,12 @@
2
2
 
3
3
  const {
4
4
  TwilioServerlessApiClient,
5
- utils
5
+ utils,
6
6
  } = require('@twilio-labs/serverless-api');
7
7
  const path = require('path');
8
8
  const { readFile } = utils;
9
9
  const { logMessage } = require('./log');
10
+ const pkgJson = require('../package.json');
10
11
 
11
12
  /**
12
13
  * Initialize the Twilio client and attach serverless logging to it
@@ -19,10 +20,13 @@ function getTwilioClient(serverless) {
19
20
 
20
21
  const client = new TwilioServerlessApiClient({
21
22
  accountSid,
22
- authToken
23
+ authToken,
24
+ userAgentExtensions: [
25
+ `@twilio-labs/serverless-twilio-runtime/${pkgJson.version}`,
26
+ ],
23
27
  });
24
28
 
25
- client.on('status-update', evt => {
29
+ client.on('status-update', (evt) => {
26
30
  logMessage(serverless, evt.message);
27
31
  });
28
32
 
@@ -40,13 +44,13 @@ async function getTwilioDeployConfig(serverless, options = {}) {
40
44
  const config = {
41
45
  env: serverless.service.provider.environmentVars || {},
42
46
  pkgJson: {
43
- dependencies: serverless.service.provider.dependencies
47
+ dependencies: serverless.service.provider.dependencies,
44
48
  },
45
49
  serviceName: serverless.service.service,
46
50
  functionsEnv: serverless.service.provider.environment || 'dev',
47
51
  assets: [],
48
52
  functions: [],
49
- overrideExistingService: true
53
+ overrideExistingService: true,
50
54
  };
51
55
 
52
56
  if (serverless.service.functions) {
@@ -134,11 +138,11 @@ async function getEnvironment(
134
138
  ) {
135
139
  const { environments } = await twilioServerlessClient.list({
136
140
  types: ['environments'],
137
- serviceName
141
+ serviceName,
138
142
  });
139
143
 
140
144
  const environment = environments.find(
141
- env => env.domain_suffix === environmentName
145
+ (env) => env.domain_suffix === environmentName
142
146
  );
143
147
 
144
148
  if (!environment) {
@@ -154,5 +158,5 @@ module.exports = {
154
158
  getEnvironment,
155
159
  getTwilioClient,
156
160
  getTwilioDeployConfig,
157
- readFile
161
+ readFile,
158
162
  };
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2018 Twilio Inc.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.