@webiny/db-dynamodb 5.40.6 → 5.41.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 +12 -12
- package/plugins/definitions/FieldPlugin.d.ts +1 -1
- package/plugins/definitions/ValueFilterPlugin.d.ts +2 -2
- package/plugins/definitions/ValueFilterPlugin.js.map +1 -1
- package/plugins/filters/andIn.d.ts +1 -1
- package/plugins/filters/between.d.ts +1 -1
- package/plugins/filters/contains.d.ts +1 -1
- package/plugins/filters/eq.d.ts +1 -1
- package/plugins/filters/fuzzy.d.ts +1 -1
- package/plugins/filters/gt.d.ts +1 -1
- package/plugins/filters/gte.d.ts +1 -1
- package/plugins/filters/in.d.ts +1 -1
- package/plugins/filters/index.d.ts +1 -1
- package/plugins/filters/lt.d.ts +1 -1
- package/plugins/filters/lte.d.ts +1 -1
- package/plugins/filters/startsWith.d.ts +1 -1
- package/plugins/index.d.ts +1 -1
- package/types.d.ts +3 -3
- package/utils/batchWrite.d.ts +1 -1
- package/utils/query.d.ts +1 -1
- package/utils/scan.d.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/db-dynamodb",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.41.0-beta.1",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
"author": "Webiny Ltd",
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@webiny/api": "5.
|
|
14
|
-
"@webiny/aws-sdk": "5.
|
|
15
|
-
"@webiny/db": "5.
|
|
16
|
-
"@webiny/error": "5.
|
|
17
|
-
"@webiny/handler-db": "5.
|
|
18
|
-
"@webiny/plugins": "5.
|
|
19
|
-
"@webiny/utils": "5.
|
|
13
|
+
"@webiny/api": "5.41.0-beta.1",
|
|
14
|
+
"@webiny/aws-sdk": "5.41.0-beta.1",
|
|
15
|
+
"@webiny/db": "5.41.0-beta.1",
|
|
16
|
+
"@webiny/error": "5.41.0-beta.1",
|
|
17
|
+
"@webiny/handler-db": "5.41.0-beta.1",
|
|
18
|
+
"@webiny/plugins": "5.41.0-beta.1",
|
|
19
|
+
"@webiny/utils": "5.41.0-beta.1",
|
|
20
20
|
"date-fns": "2.29.3",
|
|
21
21
|
"dot-prop": "6.0.1",
|
|
22
22
|
"dynamodb-toolbox": "0.9.2",
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
"@babel/cli": "7.24.1",
|
|
28
28
|
"@babel/core": "7.24.3",
|
|
29
29
|
"@types/is-number": "7.0.3",
|
|
30
|
-
"@webiny/cli": "5.
|
|
31
|
-
"@webiny/project-utils": "5.
|
|
30
|
+
"@webiny/cli": "5.41.0-beta.1",
|
|
31
|
+
"@webiny/project-utils": "5.41.0-beta.1",
|
|
32
32
|
"jest": "29.7.0",
|
|
33
33
|
"jest-dynalite": "3.6.1",
|
|
34
34
|
"rimraf": "5.0.5",
|
|
35
35
|
"ttypescript": "1.5.15",
|
|
36
|
-
"typescript": "4.
|
|
36
|
+
"typescript": "4.9.5"
|
|
37
37
|
},
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"build": "yarn webiny run build",
|
|
44
44
|
"watch": "yarn webiny run watch"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "2035c6fdbac9f52545b5024a381bc568c66ca899"
|
|
47
47
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Plugin } from "@webiny/plugins";
|
|
2
2
|
import { DynamoDBTypes } from "../../toolbox";
|
|
3
|
-
export
|
|
3
|
+
export type FieldType = DynamoDBTypes & "date" & any;
|
|
4
4
|
export interface TransformValueCb {
|
|
5
5
|
(value: any): any;
|
|
6
6
|
}
|
|
@@ -11,12 +11,12 @@ export interface ValueFilterPluginParams {
|
|
|
11
11
|
canUse?: (params: ValueFilterPluginParamsMatchesParams) => boolean;
|
|
12
12
|
matches: ValueFilterPluginParamsMatches;
|
|
13
13
|
}
|
|
14
|
-
export declare class ValueFilterPlugin extends Plugin {
|
|
14
|
+
export declare class ValueFilterPlugin<V = any, C = any> extends Plugin {
|
|
15
15
|
static readonly type: string;
|
|
16
16
|
private readonly _params;
|
|
17
17
|
get operation(): string;
|
|
18
18
|
constructor(params: ValueFilterPluginParams);
|
|
19
|
-
canUse(params: ValueFilterPluginParamsMatchesParams): boolean;
|
|
19
|
+
canUse(params: ValueFilterPluginParamsMatchesParams<V, C>): boolean;
|
|
20
20
|
matches(params: ValueFilterPluginParamsMatchesParams): boolean;
|
|
21
21
|
getOperation(): string;
|
|
22
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_plugins","require","_error","_interopRequireDefault","ValueFilterPlugin","Plugin","type","operation","getOperation","constructor","params","_params","canUse","matches","WebinyError","plugin","exports"],"sources":["ValueFilterPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport WebinyError from \"@webiny/error\";\n\nexport interface ValueFilterPluginParamsMatchesParams<V = any, C = any> {\n value: V;\n compareValue: C;\n}\n\nexport interface ValueFilterPluginParamsMatches {\n (params: ValueFilterPluginParamsMatchesParams): boolean;\n}\n\nexport interface ValueFilterPluginParams {\n operation: string;\n canUse?: (params: ValueFilterPluginParamsMatchesParams) => boolean;\n matches: ValueFilterPluginParamsMatches;\n}\nexport class ValueFilterPlugin extends Plugin {\n public static override readonly type: string = \"dynamodb.value.filter\";\n private readonly _params: ValueFilterPluginParams;\n\n public get operation(): string {\n return this.getOperation();\n }\n\n public constructor(params: ValueFilterPluginParams) {\n super();\n this._params = params;\n }\n\n public canUse(params: ValueFilterPluginParamsMatchesParams): boolean {\n if (!this._params.canUse) {\n return true;\n }\n return this._params.canUse(params);\n }\n\n public matches(params: ValueFilterPluginParamsMatchesParams): boolean {\n if (!this._params || !this._params.matches) {\n throw new WebinyError(`Missing \"matches\" in the plugin.`, \"MATCHES_ERROR\", {\n plugin: this,\n params\n });\n }\n return this._params.matches(params);\n }\n\n public getOperation(): string {\n if (!this._params || !this._params.operation) {\n throw new WebinyError(`Missing \"operation\" in the plugin.`, \"OPERATION_ERROR\");\n }\n return this._params.operation;\n }\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAgBO,MAAMG,iBAAiB,
|
|
1
|
+
{"version":3,"names":["_plugins","require","_error","_interopRequireDefault","ValueFilterPlugin","Plugin","type","operation","getOperation","constructor","params","_params","canUse","matches","WebinyError","plugin","exports"],"sources":["ValueFilterPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport WebinyError from \"@webiny/error\";\n\nexport interface ValueFilterPluginParamsMatchesParams<V = any, C = any> {\n value: V;\n compareValue: C;\n}\n\nexport interface ValueFilterPluginParamsMatches {\n (params: ValueFilterPluginParamsMatchesParams): boolean;\n}\n\nexport interface ValueFilterPluginParams {\n operation: string;\n canUse?: (params: ValueFilterPluginParamsMatchesParams) => boolean;\n matches: ValueFilterPluginParamsMatches;\n}\nexport class ValueFilterPlugin<V = any, C = any> extends Plugin {\n public static override readonly type: string = \"dynamodb.value.filter\";\n private readonly _params: ValueFilterPluginParams;\n\n public get operation(): string {\n return this.getOperation();\n }\n\n public constructor(params: ValueFilterPluginParams) {\n super();\n this._params = params;\n }\n\n public canUse(params: ValueFilterPluginParamsMatchesParams<V, C>): boolean {\n if (!this._params.canUse) {\n return true;\n }\n return this._params.canUse(params);\n }\n\n public matches(params: ValueFilterPluginParamsMatchesParams): boolean {\n if (!this._params || !this._params.matches) {\n throw new WebinyError(`Missing \"matches\" in the plugin.`, \"MATCHES_ERROR\", {\n plugin: this,\n params\n });\n }\n return this._params.matches(params);\n }\n\n public getOperation(): string {\n if (!this._params || !this._params.operation) {\n throw new WebinyError(`Missing \"operation\" in the plugin.`, \"OPERATION_ERROR\");\n }\n return this._params.operation;\n }\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAgBO,MAAMG,iBAAiB,SAA2BC,eAAM,CAAC;EAC5D,OAAgCC,IAAI,GAAW,uBAAuB;EAGtE,IAAWC,SAASA,CAAA,EAAW;IAC3B,OAAO,IAAI,CAACC,YAAY,CAAC,CAAC;EAC9B;EAEOC,WAAWA,CAACC,MAA+B,EAAE;IAChD,KAAK,CAAC,CAAC;IACP,IAAI,CAACC,OAAO,GAAGD,MAAM;EACzB;EAEOE,MAAMA,CAACF,MAAkD,EAAW;IACvE,IAAI,CAAC,IAAI,CAACC,OAAO,CAACC,MAAM,EAAE;MACtB,OAAO,IAAI;IACf;IACA,OAAO,IAAI,CAACD,OAAO,CAACC,MAAM,CAACF,MAAM,CAAC;EACtC;EAEOG,OAAOA,CAACH,MAA4C,EAAW;IAClE,IAAI,CAAC,IAAI,CAACC,OAAO,IAAI,CAAC,IAAI,CAACA,OAAO,CAACE,OAAO,EAAE;MACxC,MAAM,IAAIC,cAAW,CAAE,kCAAiC,EAAE,eAAe,EAAE;QACvEC,MAAM,EAAE,IAAI;QACZL;MACJ,CAAC,CAAC;IACN;IACA,OAAO,IAAI,CAACC,OAAO,CAACE,OAAO,CAACH,MAAM,CAAC;EACvC;EAEOF,YAAYA,CAAA,EAAW;IAC1B,IAAI,CAAC,IAAI,CAACG,OAAO,IAAI,CAAC,IAAI,CAACA,OAAO,CAACJ,SAAS,EAAE;MAC1C,MAAM,IAAIO,cAAW,CAAE,oCAAmC,EAAE,iBAAiB,CAAC;IAClF;IACA,OAAO,IAAI,CAACH,OAAO,CAACJ,SAAS;EACjC;AACJ;AAACS,OAAA,CAAAZ,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
package/plugins/filters/eq.d.ts
CHANGED
package/plugins/filters/gt.d.ts
CHANGED
package/plugins/filters/gte.d.ts
CHANGED
package/plugins/filters/in.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: () => import("../definitions/ValueFilterPlugin").ValueFilterPlugin[];
|
|
1
|
+
declare const _default: () => import("../definitions/ValueFilterPlugin").ValueFilterPlugin<any, any>[];
|
|
2
2
|
export default _default;
|
package/plugins/filters/lt.d.ts
CHANGED
package/plugins/filters/lte.d.ts
CHANGED
package/plugins/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: () => import("./definitions/ValueFilterPlugin").ValueFilterPlugin[][];
|
|
1
|
+
declare const _default: () => import("./definitions/ValueFilterPlugin").ValueFilterPlugin<any, any>[][];
|
|
2
2
|
export default _default;
|
package/types.d.ts
CHANGED
|
@@ -53,9 +53,9 @@ export interface QueryKey {
|
|
|
53
53
|
unique?: boolean;
|
|
54
54
|
name: string;
|
|
55
55
|
}
|
|
56
|
-
export
|
|
57
|
-
export
|
|
58
|
-
export
|
|
56
|
+
export type QueryKeys = QueryKey[];
|
|
57
|
+
export type QuerySort = Record<string, -1 | 1>;
|
|
58
|
+
export type DbItem<TData extends Record<string, any> = Record<string, any>> = {
|
|
59
59
|
PK: string;
|
|
60
60
|
SK: string;
|
|
61
61
|
GSI1_PK: string;
|
package/utils/batchWrite.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export interface BatchWriteResponse {
|
|
|
19
19
|
[table: string]: WriteRequest[];
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
export
|
|
22
|
+
export type BatchWriteResult = BatchWriteResponse[];
|
|
23
23
|
/**
|
|
24
24
|
* Method is meant for batch writing to a single table.
|
|
25
25
|
* It expects already prepared items for writing.
|
package/utils/query.d.ts
CHANGED
package/utils/scan.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export interface ScanWithEntity extends BaseScanParams {
|
|
|
14
14
|
entity: Entity;
|
|
15
15
|
table?: never;
|
|
16
16
|
}
|
|
17
|
-
export
|
|
17
|
+
export type ScanParams = ScanWithTable | ScanWithEntity;
|
|
18
18
|
export interface ScanResponse<T = any> {
|
|
19
19
|
items: T[];
|
|
20
20
|
count?: number;
|
|
@@ -24,7 +24,7 @@ export interface ScanResponse<T = any> {
|
|
|
24
24
|
requestId: string;
|
|
25
25
|
error: any;
|
|
26
26
|
}
|
|
27
|
-
export
|
|
27
|
+
export type ScanDbItem<T> = T & {
|
|
28
28
|
PK: string;
|
|
29
29
|
SK: string;
|
|
30
30
|
GSI1_PK: string;
|