wirejs-deploy-amplify-basic 0.0.33 → 0.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.
@@ -1,7 +1,11 @@
1
1
  import { defineAuth } from '@aws-amplify/backend';
2
+ import { api } from '../functions/api/resource'
2
3
 
3
4
  export const auth = defineAuth({
4
5
  loginWith: {
5
6
  email: true,
6
7
  },
8
+ access: allow => [
9
+ allow.resource(api).to(['manageUsers', 'listUsers'])
10
+ ]
7
11
  });
@@ -7,11 +7,30 @@ import { Bucket, BlockPublicAccess } from 'aws-cdk-lib/aws-s3';
7
7
  import { api } from './functions/api/resource';
8
8
  import { auth } from './auth/resource';
9
9
 
10
+
11
+ /**
12
+ * Amplify resources
13
+ */
10
14
  const backend = defineBackend({
11
15
  auth,
12
16
  api,
13
17
  });
14
18
 
19
+
20
+ /**
21
+ * Amplify resource augmentations
22
+ */
23
+
24
+ const userPoolClient = backend.auth.resources.cfnResources.cfnUserPoolClient;
25
+ userPoolClient.explicitAuthFlows = userPoolClient.explicitAuthFlows || [];
26
+ userPoolClient.explicitAuthFlows.push(
27
+ 'ALLOW_USER_PASSWORD_AUTH',
28
+ 'ALLOW_ADMIN_USER_PASSWORD_AUTH'
29
+ );
30
+
31
+ /**
32
+ * CDK resources
33
+ */
15
34
  const bucket = new Bucket(backend.stack, 'data', {
16
35
  blockPublicAccess: BlockPublicAccess.BLOCK_ALL,
17
36
  versioned: true,
@@ -19,18 +38,24 @@ const bucket = new Bucket(backend.stack, 'data', {
19
38
  });
20
39
  bucket.grantReadWrite(backend.api.resources.lambda);
21
40
 
41
+
42
+ /**
43
+ * Lambda environment vars
44
+ */
22
45
  backend.api.addEnvironment(
23
46
  'BUCKET', bucket.bucketName,
24
47
  );
25
-
26
48
  backend.api.addEnvironment(
27
49
  'COGNITO_CLIENT_ID', backend.auth.resources.userPoolClient.userPoolClientId
28
50
  );
29
51
 
52
+
53
+ /**
54
+ * Client configuration
55
+ */
30
56
  const apiUrl = backend.api.resources.lambda.addFunctionUrl({
31
57
  authType: FunctionUrlAuthType.NONE
32
58
  });
33
-
34
59
  backend.addOutput({
35
60
  custom: {
36
61
  api: apiUrl.url
@@ -161,7 +161,7 @@ export class AuthenticationService extends AuthenticationServiceBase {
161
161
  return {
162
162
  state: 'unauthenticated',
163
163
  user: undefined,
164
- actions: machineActions('signin', 'startsignup', 'startforgotpassword', 'resendsignupcode')
164
+ actions: machineActions('signin', 'startsignup', 'startforgotpassword')
165
165
  };
166
166
  }
167
167
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wirejs-deploy-amplify-basic",
3
- "version": "0.0.33",
3
+ "version": "0.0.35",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",