@xube/kit-aws-hooks-infrastructure 0.0.23 → 0.0.25

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.
@@ -0,0 +1,2 @@
1
+ import { APIGatewayProxyResult, APIGatewayProxyWithCognitoAuthorizerEvent } from "aws-lambda";
2
+ export declare const handler: (event: APIGatewayProxyWithCognitoAuthorizerEvent) => Promise<APIGatewayProxyResult>;
@@ -1 +1,10 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.handler = void 0;
4
+ const handler = async (event) => {
5
+ return {
6
+ body: "Hello World",
7
+ statusCode: 200
8
+ };
9
+ };
10
+ exports.handler = handler;
@@ -0,0 +1,2 @@
1
+ import { APIGatewayProxyResult, APIGatewayProxyWithCognitoAuthorizerEvent } from "aws-lambda";
2
+ export declare const handler: (event: APIGatewayProxyWithCognitoAuthorizerEvent) => Promise<APIGatewayProxyResult>;
@@ -1 +1,10 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.handler = void 0;
4
+ const handler = async (event) => {
5
+ return {
6
+ body: "Hello World",
7
+ statusCode: 200
8
+ };
9
+ };
10
+ exports.handler = handler;
@@ -9,9 +9,9 @@ export declare const GET_WEBHOOK_ENDPOINTS_FUNCTION_NAME = "get-webhook-endpoint
9
9
  export interface WebhookManagementProps {
10
10
  table?: ITable;
11
11
  name?: string;
12
- domainName: IDomainName;
13
- certificate: ICertificate;
14
- authorizer: IAuthorizer;
12
+ domainName?: IDomainName;
13
+ certificate?: ICertificate;
14
+ authorizer?: IAuthorizer;
15
15
  basePath?: string;
16
16
  stage?: string;
17
17
  corsOptions?: CorsOptions;
@@ -60,7 +60,8 @@ class WebhookManagement extends constructs_1.Construct {
60
60
  allowHeaders: ["*"],
61
61
  allowMethods: ["*"],
62
62
  },
63
- domainName: {
63
+ domainName: props.domainName &&
64
+ props.certificate && {
64
65
  domainName: props.domainName.domainName,
65
66
  certificate: props.certificate,
66
67
  basePath: props.basePath ?? "webhooks",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xube/kit-aws-hooks-infrastructure",
3
- "version": "0.0.23",
3
+ "version": "0.0.25",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -17,14 +17,14 @@
17
17
  },
18
18
  "homepage": "https://github.com/XubeLtd/dev-kit#readme",
19
19
  "devDependencies": {
20
- "@xube/kit-build": "^0.0.23"
20
+ "@xube/kit-build": "^0.0.25"
21
21
  },
22
22
  "dependencies": {
23
- "@xube/kit-aws": "^0.0.23",
24
- "@xube/kit-aws-hooks": "^0.0.23",
25
- "@xube/kit-aws-infrastructure": "^0.0.23",
26
- "@xube/kit-constants": "^0.0.23",
27
- "@xube/kit-log": "^0.0.23",
23
+ "@xube/kit-aws": "^0.0.25",
24
+ "@xube/kit-aws-hooks": "^0.0.25",
25
+ "@xube/kit-aws-infrastructure": "^0.0.25",
26
+ "@xube/kit-constants": "^0.0.25",
27
+ "@xube/kit-log": "^0.0.25",
28
28
  "aws-cdk-lib": "^2.100.0",
29
29
  "aws-lambda": "^1.0.7",
30
30
  "constructs": "^10.3.0"
@@ -0,0 +1,11 @@
1
+ import { APIGatewayProxyResult, APIGatewayProxyWithCognitoAuthorizerEvent } from "aws-lambda";
2
+
3
+ export const handler = async (
4
+ event: APIGatewayProxyWithCognitoAuthorizerEvent
5
+ ): Promise<APIGatewayProxyResult> => {
6
+
7
+ return {
8
+ body: "Hello World",
9
+ statusCode: 200
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ import { APIGatewayProxyResult, APIGatewayProxyWithCognitoAuthorizerEvent } from "aws-lambda";
2
+
3
+ export const handler = async (
4
+ event: APIGatewayProxyWithCognitoAuthorizerEvent
5
+ ): Promise<APIGatewayProxyResult> => {
6
+
7
+ return {
8
+ body: "Hello World",
9
+ statusCode: 200
10
+ }
11
+ }
@@ -15,15 +15,16 @@ import { NodejsFunction } from "aws-cdk-lib/aws-lambda-nodejs";
15
15
  import { Construct } from "constructs";
16
16
 
17
17
  export const ADD_WEBHOOK_ENDPOINTS_FUNCTION_NAME = "add-webhook-endpoints";
18
- export const REMOVE_WEBHOOK_ENDPOINTS_FUNCTION_NAME = "remove-webhook-endpoints";
18
+ export const REMOVE_WEBHOOK_ENDPOINTS_FUNCTION_NAME =
19
+ "remove-webhook-endpoints";
19
20
  export const GET_WEBHOOK_ENDPOINTS_FUNCTION_NAME = "get-webhook-endpoints";
20
21
 
21
22
  export interface WebhookManagementProps {
22
23
  table?: ITable;
23
24
  name?: string;
24
- domainName: IDomainName;
25
- certificate: ICertificate;
26
- authorizer: IAuthorizer;
25
+ domainName?: IDomainName;
26
+ certificate?: ICertificate;
27
+ authorizer?: IAuthorizer;
27
28
  basePath?: string;
28
29
  stage?: string;
29
30
  corsOptions?: CorsOptions;
@@ -96,11 +97,12 @@ export class WebhookManagement extends Construct {
96
97
  allowHeaders: ["*"],
97
98
  allowMethods: ["*"],
98
99
  },
99
- domainName: {
100
- domainName: props.domainName.domainName,
101
- certificate: props.certificate,
102
- basePath: props.basePath ?? "webhooks",
103
- },
100
+ domainName: props.domainName &&
101
+ props.certificate && {
102
+ domainName: props.domainName.domainName,
103
+ certificate: props.certificate,
104
+ basePath: props.basePath ?? "webhooks",
105
+ },
104
106
  restApiName: props.name,
105
107
  defaultMethodOptions: {
106
108
  authorizer: props.authorizer,