@xube/kit-aws-hooks 0.0.50 → 0.0.51

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.
package/dist/send.js CHANGED
@@ -22,6 +22,10 @@ const sendDataToEndpoints = async (webhookTableName, indexName, items, log = kit
22
22
  partitionKey: kit_aws_schema_1.SORT_KEY,
23
23
  });
24
24
  if (getWebhookEndpointsResponse.hasFailed()) {
25
+ if (getWebhookEndpointsResponse.statusCode === kit_constants_1.StatusCode.NotFound) {
26
+ log.info(`No webhook endpoints found for webhook endpoint ${item.id} and type ${types_1.WebhookTypes.data}`);
27
+ continue;
28
+ }
25
29
  log.error(`Failed to get webhook endpoints for webhook endpoint ${item.id} and type ${types_1.WebhookTypes.data}`);
26
30
  log.info(`${JSON.stringify(getWebhookEndpointsResponse, null, 2)}}`);
27
31
  return getWebhookEndpointsResponse.switchXubeResponseType();
@@ -55,6 +59,13 @@ const sendDataToEndpoints = async (webhookTableName, indexName, items, log = kit
55
59
  }
56
60
  }
57
61
  }
62
+ if (!endpointSends.length) {
63
+ log.info(`No endpoints found to send data to.`);
64
+ return new kit_request_1.XubeResponse({
65
+ statusCode: kit_constants_1.StatusCode.OK,
66
+ data: true,
67
+ });
68
+ }
58
69
  try {
59
70
  const responses = await Promise.all(endpointSends);
60
71
  const failedEndpointSendUrls = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xube/kit-aws-hooks",
3
- "version": "0.0.50",
3
+ "version": "0.0.51",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -17,15 +17,15 @@
17
17
  },
18
18
  "homepage": "https://github.com/XubeLtd/dev-kit#readme",
19
19
  "devDependencies": {
20
- "@xube/kit-build": "^0.0.50"
20
+ "@xube/kit-build": "^0.0.51"
21
21
  },
22
22
  "dependencies": {
23
- "@xube/kit-aws": "^0.0.50",
24
- "@xube/kit-aws-schema": "^0.0.50",
25
- "@xube/kit-data-schema": "^0.0.50",
26
- "@xube/kit-log": "^0.0.50",
27
- "@xube/kit-request": "^0.0.50",
28
- "@xube/kit-schema": "^0.0.50",
23
+ "@xube/kit-aws": "^0.0.51",
24
+ "@xube/kit-aws-schema": "^0.0.51",
25
+ "@xube/kit-data-schema": "^0.0.51",
26
+ "@xube/kit-log": "^0.0.51",
27
+ "@xube/kit-request": "^0.0.51",
28
+ "@xube/kit-schema": "^0.0.51",
29
29
  "zod": "^3.22.4"
30
30
  }
31
31
  }
package/src/send.ts CHANGED
@@ -39,6 +39,13 @@ export const sendDataToEndpoints = async (
39
39
  );
40
40
 
41
41
  if (getWebhookEndpointsResponse.hasFailed()) {
42
+ if (getWebhookEndpointsResponse.statusCode === StatusCode.NotFound) {
43
+ log.info(
44
+ `No webhook endpoints found for webhook endpoint ${item.id} and type ${WebhookTypes.data}`
45
+ );
46
+ continue;
47
+ }
48
+
42
49
  log.error(
43
50
  `Failed to get webhook endpoints for webhook endpoint ${item.id} and type ${WebhookTypes.data}`
44
51
  );
@@ -104,6 +111,14 @@ export const sendDataToEndpoints = async (
104
111
  }
105
112
  }
106
113
 
114
+ if (!endpointSends.length) {
115
+ log.info(`No endpoints found to send data to.`);
116
+ return new XubeResponse({
117
+ statusCode: StatusCode.OK,
118
+ data: true,
119
+ });
120
+ }
121
+
107
122
  try {
108
123
  const responses: Response[] = await Promise.all(endpointSends);
109
124