wirejs-deploy-amplify-basic 0.0.123-async-api → 0.0.125-async-api
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.
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
defineBackend,
|
|
4
4
|
} from '@aws-amplify/backend';
|
|
5
5
|
import { RemovalPolicy, NestedStack } from "aws-cdk-lib";
|
|
6
|
-
import { FunctionUrlAuthType } from 'aws-cdk-lib/aws-lambda';
|
|
6
|
+
import { CfnPermission, FunctionUrlAuthType } from 'aws-cdk-lib/aws-lambda';
|
|
7
7
|
import { Bucket, BlockPublicAccess } from 'aws-cdk-lib/aws-s3';
|
|
8
8
|
import { Table, AttributeType, BillingMode } from 'aws-cdk-lib/aws-dynamodb';
|
|
9
9
|
import { PolicyStatement } from 'aws-cdk-lib/aws-iam';
|
|
@@ -56,6 +56,13 @@ userPoolClient.explicitAuthFlows.push(
|
|
|
56
56
|
'ALLOW_ADMIN_USER_PASSWORD_AUTH'
|
|
57
57
|
);
|
|
58
58
|
|
|
59
|
+
new CfnPermission(backend.stack, 'SelfInvokePermission', {
|
|
60
|
+
action: 'lambda:InvokeFunction',
|
|
61
|
+
functionName: backend.api.resources.lambda.functionName,
|
|
62
|
+
principal: 'lambda.amazonaws.com',
|
|
63
|
+
sourceArn: backend.api.resources.lambda.functionArn
|
|
64
|
+
});
|
|
65
|
+
|
|
59
66
|
/**
|
|
60
67
|
* CDK resources
|
|
61
68
|
*/
|
|
@@ -197,6 +204,7 @@ backend.api.addEnvironment(
|
|
|
197
204
|
const apiUrl = backend.api.resources.lambda.addFunctionUrl({
|
|
198
205
|
authType: FunctionUrlAuthType.NONE
|
|
199
206
|
});
|
|
207
|
+
|
|
200
208
|
backend.addOutput({
|
|
201
209
|
custom: {
|
|
202
210
|
api: apiUrl.url
|
|
@@ -54,6 +54,7 @@ function isBackgroundJob(o: any): o is BackgroundJob<any> {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
export const handler: LambdaFunctionURLHandler = async (event, context) => {
|
|
57
|
+
console.log('lambda invoke', event); // TEMP!
|
|
57
58
|
const calls = JSON.parse(event.body!);
|
|
58
59
|
|
|
59
60
|
if (Array.isArray(calls)) {
|
|
@@ -115,6 +116,7 @@ export const handler: LambdaFunctionURLHandler = async (event, context) => {
|
|
|
115
116
|
body: JSON.stringify({ message: 'Background job complete' })
|
|
116
117
|
};
|
|
117
118
|
} else {
|
|
119
|
+
console.error('Invalid request format', calls);
|
|
118
120
|
return {
|
|
119
121
|
statusCode: 400,
|
|
120
122
|
body: JSON.stringify({ error: 'Invalid request format' })
|
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.125-async-api",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"recursive-copy": "^2.0.14",
|
|
43
43
|
"rimraf": "^6.0.1",
|
|
44
44
|
"wirejs-dom": "^1.0.41",
|
|
45
|
-
"wirejs-resources": "^0.1.
|
|
45
|
+
"wirejs-resources": "^0.1.93-async-api"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@aws-amplify/backend": "^1.14.0",
|