@webiny/api-dynamodb-to-elasticsearch 0.0.0-ee-vpcs.549378cf03

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Webiny
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,9 @@
1
+ # @webiny/api-dynamodb-to-elasticsearch
2
+ [![](https://img.shields.io/npm/dw/@webiny/api-file-manager.svg)](https://www.npmjs.com/package/@webiny/api-file-manager)
3
+ [![](https://img.shields.io/npm/v/@webiny/api-file-manager.svg)](https://www.npmjs.com/package/@webiny/api-file-manager)
4
+ [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
5
+ [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
6
+
7
+ NOTE: not to be used as a standalone package!
8
+
9
+ This package provides a handler plugin for Webiny, which takes records from DynamoDB Stream and synchronizes them with the Elasticsearch domain configured for current request context.
package/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare const createEventHandler: () => import("@webiny/handler-aws").DynamoDBEventHandler<null>;
package/index.js ADDED
@@ -0,0 +1,210 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.createEventHandler = void 0;
9
+
10
+ var _error = _interopRequireDefault(require("@webiny/error"));
11
+
12
+ var _dynamodb = require("aws-sdk/clients/dynamodb");
13
+
14
+ var _apiElasticsearch = require("@webiny/api-elasticsearch");
15
+
16
+ var _handlerAws = require("@webiny/handler-aws");
17
+
18
+ var _pRetry = _interopRequireDefault(require("p-retry"));
19
+
20
+ var Operations;
21
+
22
+ (function (Operations) {
23
+ Operations["INSERT"] = "INSERT";
24
+ Operations["MODIFY"] = "MODIFY";
25
+ Operations["REMOVE"] = "REMOVE";
26
+ })(Operations || (Operations = {}));
27
+
28
+ const getError = item => {
29
+ if (!item.index || !item.index.error || !item.index.error.reason) {
30
+ return null;
31
+ }
32
+
33
+ const reason = item.index.error.reason;
34
+
35
+ if (reason.match(/no such index \[([a-zA-Z0-9_-]+)\]/) !== null) {
36
+ return "index";
37
+ }
38
+
39
+ return reason;
40
+ };
41
+
42
+ const getNumberEnvVariable = (name, def) => {
43
+ const input = process.env[name];
44
+ const value = Number(input);
45
+
46
+ if (value > 0) {
47
+ return value;
48
+ }
49
+
50
+ return def;
51
+ };
52
+
53
+ const checkErrors = result => {
54
+ if (!result || !result.body || !result.body.items) {
55
+ return;
56
+ }
57
+
58
+ for (const item of result.body.items) {
59
+ const err = getError(item);
60
+
61
+ if (!err) {
62
+ continue;
63
+ } else if (err === "index") {
64
+ if (process.env.DEBUG === "true") {
65
+ console.log("Bulk response", JSON.stringify(result, null, 2));
66
+ }
67
+
68
+ continue;
69
+ }
70
+
71
+ console.log(item.error);
72
+ throw new _error.default(err, "DYNAMODB_TO_ELASTICSEARCH_ERROR", item);
73
+ }
74
+ };
75
+
76
+ const createEventHandler = () => {
77
+ return (0, _handlerAws.createDynamoDBEventHandler)(async ({
78
+ event,
79
+ context: ctx
80
+ }) => {
81
+ const context = ctx;
82
+
83
+ if (!context.elasticsearch) {
84
+ console.log("Missing elasticsearch definition on context.");
85
+ return null;
86
+ }
87
+ /**
88
+ * Wrap the code we need to run into the function, so it can be called within itself.
89
+ */
90
+
91
+
92
+ const execute = async () => {
93
+ const operations = [];
94
+
95
+ for (const record of event.Records) {
96
+ const dynamodb = record.dynamodb;
97
+
98
+ if (!dynamodb) {
99
+ continue;
100
+ }
101
+
102
+ const newImage = _dynamodb.Converter.unmarshall(dynamodb.NewImage);
103
+
104
+ if (newImage.ignore === true) {
105
+ continue;
106
+ }
107
+
108
+ const oldImage = _dynamodb.Converter.unmarshall(dynamodb.OldImage);
109
+
110
+ const keys = _dynamodb.Converter.unmarshall(dynamodb.Keys);
111
+
112
+ const _id = `${keys.PK}:${keys.SK}`;
113
+ const operation = record.eventName;
114
+ /**
115
+ * On operations other than REMOVE we decompress the data and store it into the Elasticsearch.
116
+ * No need to try to decompress if operation is REMOVE since there is no data sent into that operation.
117
+ */
118
+
119
+ let data = undefined;
120
+
121
+ if (operation !== Operations.REMOVE) {
122
+ /**
123
+ * We must decompress the data that is going into the Elasticsearch.
124
+ */
125
+ data = await (0, _apiElasticsearch.decompress)(context.plugins, newImage.data);
126
+ /**
127
+ * No point in writing null or undefined data into the Elasticsearch.
128
+ * This might happen on some error while decompressing. We will log it.
129
+ *
130
+ * Data should NEVER be null or undefined in the Elasticsearch DynamoDB table, unless it is a delete operations.
131
+ * If it is - it is a bug.
132
+ */
133
+
134
+ if (data === undefined || data === null) {
135
+ console.log(`Could not get decompressed data, skipping ES operation "${operation}", ID ${_id}`);
136
+ continue;
137
+ }
138
+ }
139
+
140
+ switch (record.eventName) {
141
+ case Operations.INSERT:
142
+ case Operations.MODIFY:
143
+ operations.push({
144
+ index: {
145
+ _id,
146
+ _index: newImage.index
147
+ }
148
+ }, data);
149
+ break;
150
+
151
+ case Operations.REMOVE:
152
+ operations.push({
153
+ delete: {
154
+ _id,
155
+ _index: oldImage.index
156
+ }
157
+ });
158
+ break;
159
+
160
+ default:
161
+ break;
162
+ }
163
+ }
164
+
165
+ if (!operations.length) {
166
+ return;
167
+ }
168
+
169
+ try {
170
+ const res = await context.elasticsearch.bulk({
171
+ body: operations
172
+ });
173
+ checkErrors(res);
174
+ } catch (error) {
175
+ if (process.env.DEBUG === "true") {
176
+ const meta = (error === null || error === void 0 ? void 0 : error.meta) || {};
177
+ delete meta["meta"];
178
+ console.log("Bulk error", JSON.stringify(meta, null, 2));
179
+ }
180
+
181
+ throw error;
182
+ }
183
+ };
184
+
185
+ const maxRetryTime = getNumberEnvVariable("WEBINY_DYNAMODB_TO_ELASTICSEARCH_MAX_RETRY_TIME", 300000);
186
+ const retries = getNumberEnvVariable("WEBINY_DYNAMODB_TO_ELASTICSEARCH_RETRIES", 20);
187
+ const minTimeout = getNumberEnvVariable("WEBINY_DYNAMODB_TO_ELASTICSEARCH_MIN_TIMEOUT", 1500);
188
+ const maxTimeout = getNumberEnvVariable("WEBINY_DYNAMODB_TO_ELASTICSEARCH_MAX_TIMEOUT", 30000);
189
+ await (0, _pRetry.default)(execute, {
190
+ maxRetryTime,
191
+ retries,
192
+ minTimeout,
193
+ maxTimeout,
194
+ onFailedAttempt: error => {
195
+ /**
196
+ * We will only log attempts which are after 3/4 of total attempts.
197
+ */
198
+ if (error.attemptNumber < retries * 0.75) {
199
+ return;
200
+ }
201
+
202
+ console.log(`Attempt #${error.attemptNumber} failed.`);
203
+ console.log(error.message);
204
+ }
205
+ });
206
+ return null;
207
+ });
208
+ };
209
+
210
+ exports.createEventHandler = createEventHandler;
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Operations","getError","item","index","error","reason","match","getNumberEnvVariable","name","def","input","process","env","value","Number","checkErrors","result","body","items","err","DEBUG","console","log","JSON","stringify","WebinyError","createEventHandler","createDynamoDBEventHandler","event","context","ctx","elasticsearch","execute","operations","record","Records","dynamodb","newImage","Converter","unmarshall","NewImage","ignore","oldImage","OldImage","keys","Keys","_id","PK","SK","operation","eventName","data","undefined","REMOVE","decompress","plugins","INSERT","MODIFY","push","_index","delete","length","res","bulk","meta","maxRetryTime","retries","minTimeout","maxTimeout","pRetry","onFailedAttempt","attemptNumber","message"],"sources":["index.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { Converter } from \"aws-sdk/clients/dynamodb\";\nimport { decompress } from \"@webiny/api-elasticsearch\";\nimport { ApiResponse, ElasticsearchContext } from \"@webiny/api-elasticsearch/types\";\nimport { createDynamoDBEventHandler } from \"@webiny/handler-aws\";\nimport { StreamRecord } from \"aws-lambda/trigger/dynamodb-stream\";\nimport pRetry from \"p-retry\";\n\nenum Operations {\n INSERT = \"INSERT\",\n MODIFY = \"MODIFY\",\n REMOVE = \"REMOVE\"\n}\n\ninterface BulkOperationsResponseBodyItemIndexError {\n reason?: string;\n}\n\ninterface BulkOperationsResponseBodyItemIndex {\n error?: BulkOperationsResponseBodyItemIndexError;\n}\n\ninterface BulkOperationsResponseBodyItem {\n index?: BulkOperationsResponseBodyItemIndex;\n error?: string;\n}\n\ninterface BulkOperationsResponseBody {\n items: BulkOperationsResponseBodyItem[];\n}\n\nconst getError = (item: BulkOperationsResponseBodyItem): string | null => {\n if (!item.index || !item.index.error || !item.index.error.reason) {\n return null;\n }\n const reason = item.index.error.reason;\n if (reason.match(/no such index \\[([a-zA-Z0-9_-]+)\\]/) !== null) {\n return \"index\";\n }\n return reason;\n};\n\nconst getNumberEnvVariable = (name: string, def: number): number => {\n const input = process.env[name];\n const value = Number(input);\n if (value > 0) {\n return value;\n }\n return def;\n};\n\nconst checkErrors = (result?: ApiResponse<BulkOperationsResponseBody>): void => {\n if (!result || !result.body || !result.body.items) {\n return;\n }\n for (const item of result.body.items) {\n const err = getError(item);\n if (!err) {\n continue;\n } else if (err === \"index\") {\n if (process.env.DEBUG === \"true\") {\n console.log(\"Bulk response\", JSON.stringify(result, null, 2));\n }\n continue;\n }\n console.log(item.error);\n throw new WebinyError(err, \"DYNAMODB_TO_ELASTICSEARCH_ERROR\", item);\n }\n};\n\ninterface RecordDynamoDbImage {\n data: Record<string, any>;\n ignore?: boolean;\n index: string;\n}\n\ninterface RecordDynamoDbKeys {\n PK: string;\n SK: string;\n}\n\nexport const createEventHandler = () => {\n return createDynamoDBEventHandler(async ({ event, context: ctx }) => {\n const context = ctx as unknown as ElasticsearchContext;\n if (!context.elasticsearch) {\n console.log(\"Missing elasticsearch definition on context.\");\n return null;\n }\n\n /**\n * Wrap the code we need to run into the function, so it can be called within itself.\n */\n const execute = async (): Promise<void> => {\n const operations = [];\n\n for (const record of event.Records) {\n const dynamodb = record.dynamodb as Required<StreamRecord>;\n if (!dynamodb) {\n continue;\n }\n const newImage = Converter.unmarshall(dynamodb.NewImage) as RecordDynamoDbImage;\n\n if (newImage.ignore === true) {\n continue;\n }\n\n const oldImage = Converter.unmarshall(dynamodb.OldImage) as RecordDynamoDbImage;\n const keys = Converter.unmarshall(dynamodb.Keys) as RecordDynamoDbKeys;\n const _id = `${keys.PK}:${keys.SK}`;\n const operation = record.eventName;\n\n /**\n * On operations other than REMOVE we decompress the data and store it into the Elasticsearch.\n * No need to try to decompress if operation is REMOVE since there is no data sent into that operation.\n */\n let data: any = undefined;\n if (operation !== Operations.REMOVE) {\n /**\n * We must decompress the data that is going into the Elasticsearch.\n */\n data = await decompress(context.plugins, newImage.data);\n /**\n * No point in writing null or undefined data into the Elasticsearch.\n * This might happen on some error while decompressing. We will log it.\n *\n * Data should NEVER be null or undefined in the Elasticsearch DynamoDB table, unless it is a delete operations.\n * If it is - it is a bug.\n */\n if (data === undefined || data === null) {\n console.log(\n `Could not get decompressed data, skipping ES operation \"${operation}\", ID ${_id}`\n );\n continue;\n }\n }\n\n switch (record.eventName) {\n case Operations.INSERT:\n case Operations.MODIFY:\n operations.push({ index: { _id, _index: newImage.index } }, data);\n break;\n case Operations.REMOVE:\n operations.push({ delete: { _id, _index: oldImage.index } });\n break;\n default:\n break;\n }\n }\n\n if (!operations.length) {\n return;\n }\n\n try {\n const res = await context.elasticsearch.bulk<BulkOperationsResponseBody>({\n body: operations\n });\n checkErrors(res);\n } catch (error) {\n if (process.env.DEBUG === \"true\") {\n const meta = error?.meta || {};\n delete meta[\"meta\"];\n console.log(\"Bulk error\", JSON.stringify(meta, null, 2));\n }\n throw error;\n }\n };\n\n const maxRetryTime = getNumberEnvVariable(\n \"WEBINY_DYNAMODB_TO_ELASTICSEARCH_MAX_RETRY_TIME\",\n 300000\n );\n const retries = getNumberEnvVariable(\"WEBINY_DYNAMODB_TO_ELASTICSEARCH_RETRIES\", 20);\n const minTimeout = getNumberEnvVariable(\n \"WEBINY_DYNAMODB_TO_ELASTICSEARCH_MIN_TIMEOUT\",\n 1500\n );\n const maxTimeout = getNumberEnvVariable(\n \"WEBINY_DYNAMODB_TO_ELASTICSEARCH_MAX_TIMEOUT\",\n 30000\n );\n\n await pRetry(execute, {\n maxRetryTime,\n retries,\n minTimeout,\n maxTimeout,\n onFailedAttempt: error => {\n /**\n * We will only log attempts which are after 3/4 of total attempts.\n */\n if (error.attemptNumber < retries * 0.75) {\n return;\n }\n console.log(`Attempt #${error.attemptNumber} failed.`);\n console.log(error.message);\n }\n });\n\n return null;\n });\n};\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAEA;;IAEKA,U;;WAAAA,U;EAAAA,U;EAAAA,U;EAAAA,U;GAAAA,U,KAAAA,U;;AAuBL,MAAMC,QAAQ,GAAIC,IAAD,IAAyD;EACtE,IAAI,CAACA,IAAI,CAACC,KAAN,IAAe,CAACD,IAAI,CAACC,KAAL,CAAWC,KAA3B,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N;MACH;IACJ,CA1ED;;IA4EA,MAAM6D,YAAY,GAAG1D,oBAAoB,CACrC,iDADqC,EAErC,MAFqC,CAAzC;IAIA,MAAM2D,OAAO,GAAG3D,oBAAoB,CAAC,0CAAD,EAA6C,EAA7C,CAApC;IACA,MAAM4D,UAAU,GAAG5D,oBAAoB,CACnC,8CADmC,EAEnC,IAFmC,CAAvC;IAIA,MAAM6D,UAAU,GAAG7D,oBAAoB,CACnC,8CADmC,EAEnC,KAFmC,CAAvC;IAKA,MAAM,IAAA8D,eAAA,EAAOrC,OAAP,EAAgB;MAClBiC,YADkB;MAElBC,OAFkB;MAGlBC,UAHkB;MAIlBC,UAJkB;MAKlBE,eAAe,EAAElE,KAAK,IAAI;QACtB;AAChB;AACA;QACgB,IAAIA,KAAK,CAACmE,aAAN,GAAsBL,OAAO,GAAG,IAApC,EAA0C;UACtC;QACH;;QACD7C,OAAO,CAACC,GAAR,CAAa,YAAWlB,KAAK,CAACmE,aAAc,UAA5C;QACAlD,OAAO,CAACC,GAAR,CAAYlB,KAAK,CAACoE,OAAlB;MACH;IAdiB,CAAhB,CAAN;IAiBA,OAAO,IAAP;EACH,CAtHM,CAAP;AAuHH,CAxHM"}
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@webiny/api-dynamodb-to-elasticsearch",
3
+ "version": "0.0.0-ee-vpcs.549378cf03",
4
+ "main": "index.js",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/webiny/webiny-js.git",
8
+ "directory": "packages/api-file-manager"
9
+ },
10
+ "description": "A handler to synchronize Elasticsearch items from DynamoDB Stream.",
11
+ "license": "MIT",
12
+ "author": "Webiny Ltd.",
13
+ "dependencies": {
14
+ "@babel/runtime": "7.19.0",
15
+ "@webiny/api-elasticsearch": "0.0.0-ee-vpcs.549378cf03",
16
+ "@webiny/error": "0.0.0-ee-vpcs.549378cf03",
17
+ "@webiny/handler-aws": "0.0.0-ee-vpcs.549378cf03",
18
+ "aws-lambda": "1.0.7",
19
+ "aws-sdk": "2.1230.0",
20
+ "p-retry": "4.6.2"
21
+ },
22
+ "devDependencies": {
23
+ "@babel/cli": "^7.19.3",
24
+ "@babel/core": "^7.19.3",
25
+ "@babel/plugin-proposal-object-rest-spread": "^7.16.0",
26
+ "@babel/plugin-transform-runtime": "^7.16.4",
27
+ "@babel/preset-env": "^7.19.4",
28
+ "@babel/preset-typescript": "^7.18.6",
29
+ "@webiny/cli": "^0.0.0-ee-vpcs.549378cf03",
30
+ "@webiny/plugins": "^0.0.0-ee-vpcs.549378cf03",
31
+ "@webiny/project-utils": "^0.0.0-ee-vpcs.549378cf03",
32
+ "typescript": "4.7.4"
33
+ },
34
+ "publishConfig": {
35
+ "access": "public",
36
+ "directory": "dist"
37
+ },
38
+ "scripts": {
39
+ "build": "yarn webiny run build",
40
+ "watch": "yarn webiny run watch"
41
+ },
42
+ "adio": {
43
+ "ignoreDirs": [
44
+ "__tests__"
45
+ ],
46
+ "ignore": {
47
+ "src": [
48
+ "aws-sdk"
49
+ ]
50
+ }
51
+ },
52
+ "gitHead": "549378cf03fcd27845fc3fa23d1dc6b32896f630"
53
+ }