@webiny/db-dynamodb 5.30.0-beta.1 → 5.31.0-beta.1
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/db-dynamodb",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.31.0-beta.1",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
"author": "Webiny Ltd",
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@webiny/
|
|
14
|
-
"@webiny/
|
|
15
|
-
"@webiny/
|
|
16
|
-
"@webiny/handler-db": "5.
|
|
17
|
-
"@webiny/plugins": "5.
|
|
18
|
-
"date-fns": "2.
|
|
13
|
+
"@webiny/api": "5.31.0-beta.1",
|
|
14
|
+
"@webiny/db": "5.31.0-beta.1",
|
|
15
|
+
"@webiny/error": "5.31.0-beta.1",
|
|
16
|
+
"@webiny/handler-db": "5.31.0-beta.1",
|
|
17
|
+
"@webiny/plugins": "5.31.0-beta.1",
|
|
18
|
+
"date-fns": "2.29.1",
|
|
19
19
|
"dot-prop": "6.0.1",
|
|
20
20
|
"fuse.js": "6.6.2",
|
|
21
21
|
"is-number": "7.0.0",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"@babel/cli": "^7.16.0",
|
|
26
26
|
"@babel/core": "^7.16.0",
|
|
27
27
|
"@types/is-number": "^7.0.2",
|
|
28
|
-
"@webiny/cli": "^5.
|
|
29
|
-
"@webiny/project-utils": "^5.
|
|
28
|
+
"@webiny/cli": "^5.31.0-beta.1",
|
|
29
|
+
"@webiny/project-utils": "^5.31.0-beta.1",
|
|
30
30
|
"dynamodb-toolbox": "^0.3.4",
|
|
31
31
|
"jest": "^28.1.0",
|
|
32
32
|
"jest-dynalite": "^3.2.0",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"build": "yarn webiny run build",
|
|
43
43
|
"watch": "yarn webiny run watch"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "b29a1cdd4c7cba5af3b9b993a78f4561525a9201"
|
|
46
46
|
}
|
package/utils/attributes.d.ts
CHANGED
package/utils/attributes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getExtraAttributes","context","entity","getExtraAttributesFromPlugins","plugins","byType","AttributePlugin","type","filter","plugin","reduce","attributes","getDefinition"],"sources":["attributes.ts"],"sourcesContent":["import { Context } from \"@webiny/
|
|
1
|
+
{"version":3,"names":["getExtraAttributes","context","entity","getExtraAttributesFromPlugins","plugins","byType","AttributePlugin","type","filter","plugin","reduce","attributes","getDefinition"],"sources":["attributes.ts"],"sourcesContent":["import { Context } from \"@webiny/api/types\";\nimport { AttributePlugin, DefinitionParams } from \"~/plugins/definitions/AttributePlugin\";\nimport { PluginsContainer } from \"@webiny/plugins\";\n\n/**\n * Will be removed in favor of directly assigning attributes to a certain entity when creating the storage operations.\n *\n * @deprecated\n */\nexport const getExtraAttributes = (\n context: Context,\n entity: string\n): Record<string, DefinitionParams> => {\n return getExtraAttributesFromPlugins(context.plugins, entity);\n};\n\nexport const getExtraAttributesFromPlugins = (\n plugins: PluginsContainer,\n entity: string\n): Record<string, DefinitionParams> => {\n return plugins\n .byType<AttributePlugin>(AttributePlugin.type)\n .filter(plugin => plugin.entity === entity)\n .reduce((attributes, plugin) => {\n return {\n ...attributes,\n ...plugin.getDefinition()\n };\n }, {});\n};\n"],"mappings":";;;;;;;;;;;AACA;;;;;;AAGA;AACA;AACA;AACA;AACA;AACO,MAAMA,kBAAkB,GAAG,CAC9BC,OAD8B,EAE9BC,MAF8B,KAGK;EACnC,OAAOC,6BAA6B,CAACF,OAAO,CAACG,OAAT,EAAkBF,MAAlB,CAApC;AACH,CALM;;;;AAOA,MAAMC,6BAA6B,GAAG,CACzCC,OADyC,EAEzCF,MAFyC,KAGN;EACnC,OAAOE,OAAO,CACTC,MADE,CACsBC,gCAAA,CAAgBC,IADtC,EAEFC,MAFE,CAEKC,MAAM,IAAIA,MAAM,CAACP,MAAP,KAAkBA,MAFjC,EAGFQ,MAHE,CAGK,CAACC,UAAD,EAAaF,MAAb,KAAwB;IAC5B,uCACOE,UADP,GAEOF,MAAM,CAACG,aAAP,EAFP;EAIH,CARE,EAQA,EARA,CAAP;AASH,CAbM"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { DocumentClient } from "aws-sdk/clients/dynamodb";
|
|
2
|
-
import { DbContext } from "@webiny/handler-db/types";
|
|
3
|
-
/**
|
|
4
|
-
* Will be removed in favor of directly passing the documentClient to the storage operations.
|
|
5
|
-
*
|
|
6
|
-
* @deprecated
|
|
7
|
-
*/
|
|
8
|
-
export declare const getDocumentClient: <T extends DbContext>(context: T) => DocumentClient;
|
package/utils/documentClient.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.getDocumentClient = void 0;
|
|
9
|
-
|
|
10
|
-
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Will be removed in favor of directly passing the documentClient to the storage operations.
|
|
14
|
-
*
|
|
15
|
-
* @deprecated
|
|
16
|
-
*/
|
|
17
|
-
const getDocumentClient = context => {
|
|
18
|
-
if (!context.db) {
|
|
19
|
-
throw new _error.default("Missing db on context.", "DB_ERROR");
|
|
20
|
-
} else if (!context.db.driver) {
|
|
21
|
-
throw new _error.default(`Missing driver on the context.db property.`, "DRIVER_ERROR");
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const driver = context.db.driver;
|
|
25
|
-
|
|
26
|
-
if (!driver.documentClient) {
|
|
27
|
-
throw new _error.default(`Missing documentClient on the context.db.driver property.`, "DOCUMENT_CLIENT_ERROR");
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return driver.documentClient;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
exports.getDocumentClient = getDocumentClient;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["getDocumentClient","context","db","WebinyError","driver","documentClient"],"sources":["documentClient.ts"],"sourcesContent":["import { DocumentClient } from \"aws-sdk/clients/dynamodb\";\nimport WebinyError from \"@webiny/error\";\nimport { DbContext } from \"@webiny/handler-db/types\";\nimport DynamoDbDriver from \"~/DynamoDbDriver\";\n\n/**\n * Will be removed in favor of directly passing the documentClient to the storage operations.\n *\n * @deprecated\n */\nexport const getDocumentClient = <T extends DbContext>(context: T): DocumentClient => {\n if (!context.db) {\n throw new WebinyError(\"Missing db on context.\", \"DB_ERROR\");\n } else if (!context.db.driver) {\n throw new WebinyError(`Missing driver on the context.db property.`, \"DRIVER_ERROR\");\n }\n const driver = context.db.driver as DynamoDbDriver;\n if (!driver.documentClient) {\n throw new WebinyError(\n `Missing documentClient on the context.db.driver property.`,\n \"DOCUMENT_CLIENT_ERROR\"\n );\n }\n return driver.documentClient;\n};\n"],"mappings":";;;;;;;;;AACA;;AAIA;AACA;AACA;AACA;AACA;AACO,MAAMA,iBAAiB,GAAyBC,OAAtB,IAAqD;EAClF,IAAI,CAACA,OAAO,CAACC,EAAb,EAAiB;IACb,MAAM,IAAIC,cAAJ,CAAgB,wBAAhB,EAA0C,UAA1C,CAAN;EACH,CAFD,MAEO,IAAI,CAACF,OAAO,CAACC,EAAR,CAAWE,MAAhB,EAAwB;IAC3B,MAAM,IAAID,cAAJ,CAAiB,4CAAjB,EAA8D,cAA9D,CAAN;EACH;;EACD,MAAMC,MAAM,GAAGH,OAAO,CAACC,EAAR,CAAWE,MAA1B;;EACA,IAAI,CAACA,MAAM,CAACC,cAAZ,EAA4B;IACxB,MAAM,IAAIF,cAAJ,CACD,2DADC,EAEF,uBAFE,CAAN;EAIH;;EACD,OAAOC,MAAM,CAACC,cAAd;AACH,CAdM"}
|