@xube/kit-aws-hooks-infrastructure 0.0.26 → 0.0.28

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,11 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.WebhookManagement = exports.GET_WEBHOOK_ENDPOINTS_FUNCTION_NAME = exports.REMOVE_WEBHOOK_ENDPOINTS_FUNCTION_NAME = exports.ADD_WEBHOOK_ENDPOINTS_FUNCTION_NAME = void 0;
4
4
  const kit_aws_1 = require("@xube/kit-aws");
5
5
  const kit_aws_2 = require("@xube/kit-aws");
6
+ const kit_log_1 = require("@xube/kit-log");
6
7
  const aws_apigateway_1 = require("aws-cdk-lib/aws-apigateway");
7
8
  const aws_dynamodb_1 = require("aws-cdk-lib/aws-dynamodb");
8
9
  const aws_lambda_1 = require("aws-cdk-lib/aws-lambda");
9
10
  const aws_lambda_nodejs_1 = require("aws-cdk-lib/aws-lambda-nodejs");
10
11
  const constructs_1 = require("constructs");
12
+ const path_1 = require("path");
11
13
  exports.ADD_WEBHOOK_ENDPOINTS_FUNCTION_NAME = "add-webhook-endpoints";
12
14
  exports.REMOVE_WEBHOOK_ENDPOINTS_FUNCTION_NAME = "remove-webhook-endpoints";
13
15
  exports.GET_WEBHOOK_ENDPOINTS_FUNCTION_NAME = "get-webhook-endpoints";
@@ -32,22 +34,24 @@ class WebhookManagement extends constructs_1.Construct {
32
34
  type: aws_dynamodb_1.AttributeType.STRING,
33
35
  },
34
36
  });
37
+ kit_log_1.XubeLog.getInstance().log(__dirname);
38
+ kit_log_1.XubeLog.getInstance().log((0, path_1.join)(__dirname, "functions", exports.ADD_WEBHOOK_ENDPOINTS_FUNCTION_NAME + ".ts"));
35
39
  this.addWebhookEndpoints = new aws_lambda_nodejs_1.NodejsFunction(this, id + "-add-hooks-function", {
36
- entry: __dirname + "./functions/" + exports.ADD_WEBHOOK_ENDPOINTS_FUNCTION_NAME + ".ts",
40
+ entry: (0, path_1.join)(__dirname, "functions", exports.ADD_WEBHOOK_ENDPOINTS_FUNCTION_NAME + ".ts"),
37
41
  functionName: (props.name ?? "webhook") + "-add-hooks",
38
42
  environment: {
39
43
  WEBHOOK_TABLE_NAME_ENV_VAR: this.table.tableName,
40
44
  },
41
45
  });
42
46
  this.removeWebhookEndpoint = new aws_lambda_nodejs_1.NodejsFunction(this, id + "-remove-hooks-function", {
43
- entry: __dirname + "./functions/" + exports.REMOVE_WEBHOOK_ENDPOINTS_FUNCTION_NAME + ".ts",
47
+ entry: (0, path_1.join)(__dirname, "functions", exports.REMOVE_WEBHOOK_ENDPOINTS_FUNCTION_NAME + ".ts"),
44
48
  functionName: (props.name ?? "webhook") + "-remove-hooks",
45
49
  environment: {
46
50
  WEBHOOK_TABLE_NAME_ENV_VAR: this.table.tableName,
47
51
  },
48
52
  });
49
53
  this.getWebhookEndpoints = new aws_lambda_nodejs_1.NodejsFunction(this, id + "-get-hooks-function", {
50
- entry: __dirname + "./functions/" + exports.GET_WEBHOOK_ENDPOINTS_FUNCTION_NAME + ".ts",
54
+ entry: (0, path_1.join)(__dirname, "functions", exports.GET_WEBHOOK_ENDPOINTS_FUNCTION_NAME + ".ts"),
51
55
  functionName: (props.name ?? "webhook") + "-get-hook",
52
56
  environment: {
53
57
  WEBHOOK_TABLE_NAME_ENV_VAR: this.table.tableName,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xube/kit-aws-hooks-infrastructure",
3
- "version": "0.0.26",
3
+ "version": "0.0.28",
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.26"
20
+ "@xube/kit-build": "^0.0.28"
21
21
  },
22
22
  "dependencies": {
23
- "@xube/kit-aws": "^0.0.26",
24
- "@xube/kit-aws-hooks": "^0.0.26",
25
- "@xube/kit-aws-infrastructure": "^0.0.26",
26
- "@xube/kit-constants": "^0.0.26",
27
- "@xube/kit-log": "^0.0.26",
23
+ "@xube/kit-aws": "^0.0.28",
24
+ "@xube/kit-aws-hooks": "^0.0.28",
25
+ "@xube/kit-aws-infrastructure": "^0.0.28",
26
+ "@xube/kit-constants": "^0.0.28",
27
+ "@xube/kit-log": "^0.0.28",
28
28
  "aws-cdk-lib": "^2.100.0",
29
29
  "aws-lambda": "^1.0.7",
30
30
  "constructs": "^10.3.0"
@@ -1,6 +1,7 @@
1
1
  import { SORT_KEY } from "@xube/kit-aws";
2
2
  import { PARTITION_KEY } from "@xube/kit-aws";
3
3
  import { WEBHOOK_TABLE_NAME_ENV_VAR } from "@xube/kit-aws-hooks";
4
+ import { XubeLog } from "@xube/kit-log";
4
5
  import {
5
6
  CorsOptions,
6
7
  IAuthorizer,
@@ -13,6 +14,7 @@ import { AttributeType, ITable, Table } from "aws-cdk-lib/aws-dynamodb";
13
14
  import { HttpMethod } from "aws-cdk-lib/aws-lambda";
14
15
  import { NodejsFunction } from "aws-cdk-lib/aws-lambda-nodejs";
15
16
  import { Construct } from "constructs";
17
+ import { join } from "path";
16
18
 
17
19
  export const ADD_WEBHOOK_ENDPOINTS_FUNCTION_NAME = "add-webhook-endpoints";
18
20
  export const REMOVE_WEBHOOK_ENDPOINTS_FUNCTION_NAME =
@@ -55,11 +57,20 @@ export class WebhookManagement extends Construct {
55
57
  },
56
58
  });
57
59
 
60
+ XubeLog.getInstance().log(__dirname);
61
+ XubeLog.getInstance().log(
62
+ join(__dirname, "functions", ADD_WEBHOOK_ENDPOINTS_FUNCTION_NAME + ".ts")
63
+ );
64
+
58
65
  this.addWebhookEndpoints = new NodejsFunction(
59
66
  this,
60
67
  id + "-add-hooks-function",
61
68
  {
62
- entry: __dirname + "./functions/" + ADD_WEBHOOK_ENDPOINTS_FUNCTION_NAME + ".ts",
69
+ entry: join(
70
+ __dirname,
71
+ "functions",
72
+ ADD_WEBHOOK_ENDPOINTS_FUNCTION_NAME + ".ts"
73
+ ),
63
74
  functionName: (props.name ?? "webhook") + "-add-hooks",
64
75
  environment: {
65
76
  WEBHOOK_TABLE_NAME_ENV_VAR: this.table.tableName,
@@ -70,8 +81,11 @@ export class WebhookManagement extends Construct {
70
81
  this,
71
82
  id + "-remove-hooks-function",
72
83
  {
73
- entry:
74
- __dirname + "./functions/" + REMOVE_WEBHOOK_ENDPOINTS_FUNCTION_NAME + ".ts",
84
+ entry: join(
85
+ __dirname,
86
+ "functions",
87
+ REMOVE_WEBHOOK_ENDPOINTS_FUNCTION_NAME + ".ts"
88
+ ),
75
89
  functionName: (props.name ?? "webhook") + "-remove-hooks",
76
90
  environment: {
77
91
  WEBHOOK_TABLE_NAME_ENV_VAR: this.table.tableName,
@@ -82,7 +96,11 @@ export class WebhookManagement extends Construct {
82
96
  this,
83
97
  id + "-get-hooks-function",
84
98
  {
85
- entry: __dirname + "./functions/" + GET_WEBHOOK_ENDPOINTS_FUNCTION_NAME + ".ts",
99
+ entry: join(
100
+ __dirname,
101
+ "functions",
102
+ GET_WEBHOOK_ENDPOINTS_FUNCTION_NAME + ".ts"
103
+ ),
86
104
  functionName: (props.name ?? "webhook") + "-get-hook",
87
105
  environment: {
88
106
  WEBHOOK_TABLE_NAME_ENV_VAR: this.table.tableName,