@xube/kit-aws-hooks 0.0.69 → 0.0.71

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
@@ -7,9 +7,10 @@ const kit_request_1 = require("@xube/kit-request");
7
7
  const webhook_1 = require("./schemas/webhook");
8
8
  const kit_constants_1 = require("@xube/kit-constants");
9
9
  const kit_log_1 = require("@xube/kit-log");
10
- const kit_aws_1 = require("@xube/kit-aws");
11
10
  const kit_aws_schema_1 = require("@xube/kit-aws-schema");
11
+ const kit_aws_schema_2 = require("@xube/kit-aws-schema");
12
12
  const transform_1 = require("./transform");
13
+ const kit_aws_1 = require("@xube/kit-aws");
13
14
  const sendDataToEndpoints = async (webhookTableName, indexName, items, log = kit_log_1.XubeLog.getInstance()) => {
14
15
  const endpointSends = [];
15
16
  log.info(`Sending data to endpoints based on ${items.length} items.}`);
@@ -25,8 +26,9 @@ const sendDataToEndpoints = async (webhookTableName, indexName, items, log = kit
25
26
  PK: (0, keys_1.getWebhookSortKey)(id, types_1.WebhookTypes.data),
26
27
  };
27
28
  log.info(`Searching for webhooks with key: ${JSON.stringify(invertedWebhookKey)}`);
28
- const getWebhookEndpointsResponse = await (0, kit_aws_1.queryItemsFromTable)(webhookTableName, invertedWebhookKey, indexName, {
29
- partitionKey: kit_aws_schema_1.SORT_KEY,
29
+ const getWebhookEndpointsResponse = await (0, kit_aws_1.queryItemsFromTableBeginsWith)(webhookTableName, invertedWebhookKey, indexName, {
30
+ partitionKey: kit_aws_schema_2.SORT_KEY,
31
+ sortKey: kit_aws_schema_1.PARTITION_KEY,
30
32
  });
31
33
  if (getWebhookEndpointsResponse.hasFailed()) {
32
34
  if (getWebhookEndpointsResponse.statusCode === kit_constants_1.StatusCode.NotFound) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xube/kit-aws-hooks",
3
- "version": "0.0.69",
3
+ "version": "0.0.71",
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.69"
20
+ "@xube/kit-build": "^0.0.71"
21
21
  },
22
22
  "dependencies": {
23
- "@xube/kit-aws": "^0.0.69",
24
- "@xube/kit-aws-schema": "^0.0.69",
25
- "@xube/kit-data-schema": "^0.0.69",
26
- "@xube/kit-log": "^0.0.69",
27
- "@xube/kit-request": "^0.0.69",
28
- "@xube/kit-schema": "^0.0.69",
23
+ "@xube/kit-aws": "^0.0.71",
24
+ "@xube/kit-aws-schema": "^0.0.71",
25
+ "@xube/kit-data-schema": "^0.0.71",
26
+ "@xube/kit-log": "^0.0.71",
27
+ "@xube/kit-request": "^0.0.71",
28
+ "@xube/kit-schema": "^0.0.71",
29
29
  "zod": "^3.22.4"
30
30
  }
31
31
  }
package/src/send.ts CHANGED
@@ -4,11 +4,11 @@ import { XubeResponse } from "@xube/kit-request";
4
4
  import { isWebhookEndpoint } from "./schemas/webhook";
5
5
  import { StatusCode } from "@xube/kit-constants";
6
6
  import { XubeLog } from "@xube/kit-log";
7
- import { TableItem } from "@xube/kit-aws-schema";
7
+ import { PARTITION_KEY, TableItem } from "@xube/kit-aws-schema";
8
8
  import { PartialTableKey } from "@xube/kit-aws-schema";
9
- import { queryItemsFromTable } from "@xube/kit-aws";
10
9
  import { SORT_KEY } from "@xube/kit-aws-schema";
11
10
  import { getTimeSeriesDataFromData } from "./transform";
11
+ import { queryItemsFromTableBeginsWith } from "@xube/kit-aws";
12
12
 
13
13
  export const sendDataToEndpoints = async (
14
14
  webhookTableName: string,
@@ -39,12 +39,13 @@ export const sendDataToEndpoints = async (
39
39
  `Searching for webhooks with key: ${JSON.stringify(invertedWebhookKey)}`
40
40
  );
41
41
 
42
- const getWebhookEndpointsResponse = await queryItemsFromTable(
42
+ const getWebhookEndpointsResponse = await queryItemsFromTableBeginsWith(
43
43
  webhookTableName,
44
44
  invertedWebhookKey,
45
45
  indexName,
46
46
  {
47
47
  partitionKey: SORT_KEY,
48
+ sortKey: PARTITION_KEY,
48
49
  }
49
50
  );
50
51
 
@@ -14,6 +14,7 @@ describe("getTimeSeriesDataFromData", () => {
14
14
  us: 213581,
15
15
  type: DATA_TYPE,
16
16
  id: "12345678",
17
+ component: "component",
17
18
  },
18
19
  {
19
20
  PK: "",
@@ -23,6 +24,7 @@ describe("getTimeSeriesDataFromData", () => {
23
24
  us: 413572,
24
25
  type: DATA_TYPE,
25
26
  id: "12345678",
27
+ component: "component",
26
28
  },
27
29
  {
28
30
  PK: "",
@@ -32,6 +34,7 @@ describe("getTimeSeriesDataFromData", () => {
32
34
  us: 612976,
33
35
  type: DATA_TYPE,
34
36
  id: "12345678",
37
+ component: "component",
35
38
  },
36
39
  {
37
40
  PK: "",
@@ -41,6 +44,7 @@ describe("getTimeSeriesDataFromData", () => {
41
44
  us: 813754,
42
45
  type: DATA_TYPE,
43
46
  id: "12345678",
47
+ component: "component",
44
48
  },
45
49
  {
46
50
  PK: "",
@@ -50,6 +54,7 @@ describe("getTimeSeriesDataFromData", () => {
50
54
  us: 13019,
51
55
  type: DATA_TYPE,
52
56
  id: "12345678",
57
+ component: "component",
53
58
  },
54
59
  ];
55
60