wirejs-deploy-amplify-basic 0.0.33 → 0.0.34

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.
@@ -7,11 +7,23 @@ 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
+ const userPoolClient = backend.auth.resources.cfnResources.cfnUserPoolClient;
20
+ userPoolClient.explicitAuthFlows = userPoolClient.explicitAuthFlows || [];
21
+ userPoolClient.explicitAuthFlows.push('USER_PASSWORD_AUTH');
22
+
23
+
24
+ /**
25
+ * CDK resources
26
+ */
15
27
  const bucket = new Bucket(backend.stack, 'data', {
16
28
  blockPublicAccess: BlockPublicAccess.BLOCK_ALL,
17
29
  versioned: true,
@@ -19,18 +31,24 @@ const bucket = new Bucket(backend.stack, 'data', {
19
31
  });
20
32
  bucket.grantReadWrite(backend.api.resources.lambda);
21
33
 
34
+
35
+ /**
36
+ * Lambda environment vars
37
+ */
22
38
  backend.api.addEnvironment(
23
39
  'BUCKET', bucket.bucketName,
24
40
  );
25
-
26
41
  backend.api.addEnvironment(
27
42
  'COGNITO_CLIENT_ID', backend.auth.resources.userPoolClient.userPoolClientId
28
43
  );
29
44
 
45
+
46
+ /**
47
+ * Client configuration
48
+ */
30
49
  const apiUrl = backend.api.resources.lambda.addFunctionUrl({
31
50
  authType: FunctionUrlAuthType.NONE
32
51
  });
33
-
34
52
  backend.addOutput({
35
53
  custom: {
36
54
  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.34",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",