@adobe/helix-deploy 9.0.33 → 9.0.35

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,3 +1,17 @@
1
+ ## [9.0.35](https://github.com/adobe/helix-deploy/compare/v9.0.34...v9.0.35) (2023-05-27)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **deps:** update external fixes ([6a2bde7](https://github.com/adobe/helix-deploy/commit/6a2bde7a6b26dec2574c3256db4021381d41aa91))
7
+
8
+ ## [9.0.34](https://github.com/adobe/helix-deploy/compare/v9.0.33...v9.0.34) (2023-05-24)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * use AWS adapter to serve requests to ([#544](https://github.com/adobe/helix-deploy/issues/544)) ([e7d6b28](https://github.com/adobe/helix-deploy/commit/e7d6b2804dbd75466998fb3fd3c7f46958192eb4))
14
+
1
15
  ## [9.0.33](https://github.com/adobe/helix-deploy/compare/v9.0.32...v9.0.33) (2023-05-24)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-deploy",
3
- "version": "9.0.33",
3
+ "version": "9.0.35",
4
4
  "description": "Library and Commandline Tools to build and deploy OpenWhisk Actions",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/adobe/helix-deploy#readme",
@@ -38,13 +38,13 @@
38
38
  "dependencies": {
39
39
  "@adobe/fastly-native-promises": "3.0.3",
40
40
  "@adobe/fetch": "4.0.13",
41
- "@aws-sdk/client-apigatewayv2": "3.335.0",
42
- "@aws-sdk/client-lambda": "3.335.0",
43
- "@aws-sdk/client-s3": "3.335.0",
44
- "@aws-sdk/client-secrets-manager": "3.335.0",
45
- "@aws-sdk/client-ssm": "3.335.0",
46
- "@aws-sdk/client-sts": "3.335.0",
47
- "@fastly/js-compute": "2.0.0",
41
+ "@aws-sdk/client-apigatewayv2": "3.341.0",
42
+ "@aws-sdk/client-lambda": "3.341.0",
43
+ "@aws-sdk/client-s3": "3.341.0",
44
+ "@aws-sdk/client-secrets-manager": "3.341.0",
45
+ "@aws-sdk/client-ssm": "3.341.0",
46
+ "@aws-sdk/client-sts": "3.341.0",
47
+ "@fastly/js-compute": "2.0.1",
48
48
  "@google-cloud/functions": "2.4.1",
49
49
  "@google-cloud/secret-manager": "4.2.2",
50
50
  "@google-cloud/storage": "6.10.1",
@@ -54,19 +54,19 @@
54
54
  "@rollup/plugin-node-resolve": "15.0.2",
55
55
  "@rollup/plugin-terser": "0.4.3",
56
56
  "archiver": "5.3.1",
57
- "chalk-template": "1.0.0",
57
+ "chalk-template": "1.1.0",
58
58
  "constants-browserify": "1.0.0",
59
59
  "dotenv": "16.0.3",
60
60
  "express": "4.18.2",
61
61
  "form-data": "4.0.0",
62
62
  "fs-extra": "11.1.1",
63
63
  "get-stream": "6.0.1",
64
- "isomorphic-git": "1.23.0",
64
+ "isomorphic-git": "1.24.0",
65
65
  "openwhisk": "3.21.7",
66
- "rollup": "3.22.0",
66
+ "rollup": "3.23.0",
67
67
  "semver": "7.5.1",
68
68
  "tar": "6.1.15",
69
- "webpack": "5.83.1",
69
+ "webpack": "5.84.1",
70
70
  "yargs": "17.7.2"
71
71
  },
72
72
  "devDependencies": {
@@ -12,7 +12,7 @@
12
12
  import fse from 'fs-extra';
13
13
  import path from 'path';
14
14
  import express from 'express';
15
- import { createAdapter } from '@adobe/helix-universal/google';
15
+ import { createAdapter } from '@adobe/helix-universal/aws';
16
16
  import ActionBuilder from './ActionBuilder.js';
17
17
  import BaseConfig from './BaseConfig.js';
18
18
 
@@ -133,16 +133,47 @@ export default class DevelopmentServer {
133
133
  const builder = new ActionBuilder().withConfig(config);
134
134
  await builder.validate();
135
135
 
136
- // use google adapter since it already supports express req/res types
137
- process.env.K_SERVICE = `${config.packageName}--${config.name}`;
138
- process.env.K_REVISION = config.version;
139
- this._handler = createAdapter({
136
+ const region = process.env.AWS_REGION ?? 'us-east-1';
137
+ const accountId = process.env.AWS_ACCOUNT_ID ?? 'no-account';
138
+
139
+ const adapter = createAdapter({
140
140
  factory: () => (req, ctx) => {
141
- // adjust runtime in order for the shared-secrets plugin to accept unsupported the runtime.
142
141
  ctx.runtime.name = 'simulate';
143
142
  return this._main(req, ctx);
144
143
  },
145
144
  });
145
+ this._handler = async (req, res) => {
146
+ const [rawPath, rawQueryString = ''] = req.originalUrl.split('?');
147
+ const event = {
148
+ body: req.rawBody,
149
+ headers: req.headers,
150
+ pathParameters: {
151
+ path: req.originalUrl.substring(1),
152
+ },
153
+ requestContext: {
154
+ domainName: req.hostname,
155
+ http: {
156
+ method: req.method,
157
+ },
158
+ },
159
+ rawPath,
160
+ rawQueryString,
161
+ };
162
+ const context = {
163
+ invokedFunctionArn: `arn:aws:lambda:${region}:${accountId}:function:${config.name}:${config.version}`,
164
+ getRemainingTimeInMillis: () => 60000,
165
+ };
166
+
167
+ const {
168
+ statusCode,
169
+ headers,
170
+ body,
171
+ } = await adapter(event, context);
172
+
173
+ res.status(statusCode);
174
+ Object.entries(headers).forEach(([name, value]) => res.set(name, value));
175
+ res.send(body);
176
+ };
146
177
  this.params = config.params;
147
178
  return this;
148
179
  }