wirejs-deploy-amplify-basic 0.0.26 → 0.0.27
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.
|
@@ -5,8 +5,10 @@ import { RemovalPolicy } from "aws-cdk-lib";
|
|
|
5
5
|
import { FunctionUrlAuthType } from 'aws-cdk-lib/aws-lambda';
|
|
6
6
|
import { Bucket, BlockPublicAccess } from 'aws-cdk-lib/aws-s3';
|
|
7
7
|
import { api } from './functions/api/resource';
|
|
8
|
+
import { auth } from './auth/resources';
|
|
8
9
|
|
|
9
10
|
const backend = defineBackend({
|
|
11
|
+
auth,
|
|
10
12
|
api,
|
|
11
13
|
});
|
|
12
14
|
|
|
@@ -18,7 +20,11 @@ const bucket = new Bucket(backend.stack, 'data', {
|
|
|
18
20
|
bucket.grantReadWrite(backend.api.resources.lambda);
|
|
19
21
|
|
|
20
22
|
backend.api.addEnvironment(
|
|
21
|
-
'BUCKET', bucket.bucketName
|
|
23
|
+
'BUCKET', bucket.bucketName,
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
backend.api.addEnvironment(
|
|
27
|
+
'COGNITO_CLIENT_ID', backend.auth.resources.userPoolClient.userPoolClientId
|
|
22
28
|
);
|
|
23
29
|
|
|
24
30
|
const apiUrl = backend.api.resources.lambda.addFunctionUrl({
|
package/build.js
CHANGED
|
@@ -156,10 +156,15 @@ if (action === 'prebuild') {
|
|
|
156
156
|
} else if (action === 'inject-backend') {
|
|
157
157
|
console.log("starting inject-backend");
|
|
158
158
|
const config = JSON.parse(await fs.promises.readFile(path.join('.', 'amplify_outputs.json')));
|
|
159
|
+
|
|
159
160
|
const apiUrl = config.custom.api;
|
|
161
|
+
const auth = {
|
|
162
|
+
|
|
163
|
+
};
|
|
160
164
|
|
|
161
165
|
const configJSON = JSON.stringify({
|
|
162
|
-
apiUrl
|
|
166
|
+
apiUrl,
|
|
167
|
+
auth
|
|
163
168
|
});
|
|
164
169
|
const configJS = `const config = ${configJSON};\nexport default config;`;
|
|
165
170
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wirejs-deploy-amplify-basic",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.27",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"wirejs-deploy-amplify-basic": "build.js"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
+
"@aws-sdk/client-cognito-identity-provider": "^3.741.0",
|
|
25
26
|
"@aws-sdk/client-s3": "^3.738.0",
|
|
26
27
|
"copy": "^0.3.2",
|
|
27
28
|
"esbuild": "^0.24.2",
|
|
@@ -29,7 +30,7 @@
|
|
|
29
30
|
"recursive-copy": "^2.0.14",
|
|
30
31
|
"rimraf": "^6.0.1",
|
|
31
32
|
"wirejs-dom": "^1.0.38",
|
|
32
|
-
"wirejs-resources": "^0.1.
|
|
33
|
+
"wirejs-resources": "^0.1.10"
|
|
33
34
|
},
|
|
34
35
|
"devDependencies": {
|
|
35
36
|
"@aws-amplify/backend": "^1.14.0",
|