@webiny/db-dynamodb 5.37.0-beta.0 → 5.37.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/BatchProcess.js.map +1 -1
- package/DynamoDbDriver.js.map +1 -1
- package/QueryGenerator.js.map +1 -1
- package/index.js.map +1 -1
- package/operators/comparison/beginsWith.js.map +1 -1
- package/operators/comparison/between.js.map +1 -1
- package/operators/comparison/eq.js.map +1 -1
- package/operators/comparison/gt.js.map +1 -1
- package/operators/comparison/gte.js.map +1 -1
- package/operators/comparison/lt.js.map +1 -1
- package/operators/comparison/lte.js.map +1 -1
- package/operators/index.js.map +1 -1
- package/operators/logical/and.js.map +1 -1
- package/operators/logical/or.js.map +1 -1
- package/package.json +12 -12
- package/plugins/definitions/AttributePlugin.js.map +1 -1
- package/plugins/definitions/DateTimeTransformPlugin.js.map +1 -1
- package/plugins/definitions/FieldPathPlugin.js.map +1 -1
- package/plugins/definitions/FieldPlugin.js.map +1 -1
- package/plugins/definitions/NumberTransformPlugin.js.map +1 -1
- package/plugins/definitions/TimeTransformPlugin.js.map +1 -1
- package/plugins/definitions/ValueFilterPlugin.js.map +1 -1
- package/plugins/definitions/ValueTransformPlugin.js.map +1 -1
- package/plugins/definitions/assignFields.js.map +1 -1
- package/plugins/filters/andIn.js.map +1 -1
- package/plugins/filters/between.js.map +1 -1
- package/plugins/filters/contains.js.map +1 -1
- package/plugins/filters/eq.js.map +1 -1
- package/plugins/filters/fuzzy.js +5 -1
- package/plugins/filters/fuzzy.js.map +1 -1
- package/plugins/filters/gt.js.map +1 -1
- package/plugins/filters/gte.js.map +1 -1
- package/plugins/filters/in.js.map +1 -1
- package/plugins/filters/index.js.map +1 -1
- package/plugins/filters/lt.js.map +1 -1
- package/plugins/filters/lte.js.map +1 -1
- package/plugins/filters/startsWith.js.map +1 -1
- package/plugins/index.js.map +1 -1
- package/statements/createKeyConditionExpressionArgs.js.map +1 -1
- package/statements/processStatement.js.map +1 -1
- package/utils/attributes.js.map +1 -1
- package/utils/batchRead.d.ts +4 -5
- package/utils/batchRead.js.map +1 -1
- package/utils/batchWrite.d.ts +4 -5
- package/utils/batchWrite.js.map +1 -1
- package/utils/cleanup.js.map +1 -1
- package/utils/createEntity.d.ts +14 -0
- package/utils/createEntity.js +60 -0
- package/utils/createEntity.js.map +1 -0
- package/utils/createTable.d.ts +7 -0
- package/utils/createTable.js +25 -0
- package/utils/createTable.js.map +1 -0
- package/utils/cursor.js.map +1 -1
- package/utils/filter.js.map +1 -1
- package/utils/get.js.map +1 -1
- package/utils/index.d.ts +3 -1
- package/utils/index.js +26 -4
- package/utils/index.js.map +1 -1
- package/utils/listResponse.js.map +1 -1
- package/utils/query.js.map +1 -1
- package/utils/scan.d.ts +25 -0
- package/utils/scan.js +42 -0
- package/utils/scan.js.map +1 -0
- package/utils/sort.js.map +1 -1
- package/utils/table.js.map +1 -1
- package/utils/createStandardEntity.d.ts +0 -2
- package/utils/createStandardEntity.js +0 -34
- package/utils/createStandardEntity.js.map +0 -1
package/utils/scan.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import DocumentClient from "aws-sdk/clients/dynamodb";
|
|
2
|
+
import { scanOptions as DynamoDBToolboxScanOptions } from "dynamodb-toolbox/dist/classes/Table";
|
|
3
|
+
import { Entity } from "dynamodb-toolbox";
|
|
4
|
+
export interface ScanParams {
|
|
5
|
+
entity: Entity<any>;
|
|
6
|
+
options: DynamoDBToolboxScanOptions;
|
|
7
|
+
params?: Partial<DocumentClient.ScanInput>;
|
|
8
|
+
}
|
|
9
|
+
export interface ScanResponse<T> {
|
|
10
|
+
items: T[];
|
|
11
|
+
count: number;
|
|
12
|
+
scannedCount: number;
|
|
13
|
+
lastEvaluatedKey?: DocumentClient.Key;
|
|
14
|
+
next?: () => Promise<ScanResponse<T>>;
|
|
15
|
+
requestId: string;
|
|
16
|
+
error: any;
|
|
17
|
+
}
|
|
18
|
+
export declare type ScanDbItem<T> = T & {
|
|
19
|
+
PK: string;
|
|
20
|
+
SK: string;
|
|
21
|
+
GSI1_PK: string;
|
|
22
|
+
GSI1_SK: string;
|
|
23
|
+
};
|
|
24
|
+
export declare const scan: <T>(params: ScanParams) => Promise<ScanResponse<T>>;
|
|
25
|
+
export declare const scanWithCallback: <T>(params: ScanParams, callback: (result: ScanResponse<ScanDbItem<T>>) => Promise<void>) => Promise<void>;
|
package/utils/scan.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.scanWithCallback = exports.scan = void 0;
|
|
7
|
+
const convertResult = result => {
|
|
8
|
+
return {
|
|
9
|
+
items: result.Items,
|
|
10
|
+
count: result.Count,
|
|
11
|
+
scannedCount: result.ScannedCount,
|
|
12
|
+
lastEvaluatedKey: result.LastEvaluatedKey,
|
|
13
|
+
next: result.LastEvaluatedKey ? result.next : undefined,
|
|
14
|
+
error: result.error,
|
|
15
|
+
requestId: result.$response.requestId
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
const scan = async params => {
|
|
19
|
+
const {
|
|
20
|
+
entity,
|
|
21
|
+
options
|
|
22
|
+
} = params;
|
|
23
|
+
const result = await entity.table.scan(options, params.params);
|
|
24
|
+
return convertResult(result);
|
|
25
|
+
};
|
|
26
|
+
exports.scan = scan;
|
|
27
|
+
const scanWithCallback = async (params, callback) => {
|
|
28
|
+
var _result$items;
|
|
29
|
+
let result = await scan(params);
|
|
30
|
+
if (!((_result$items = result.items) !== null && _result$items !== void 0 && _result$items.length) && !result.lastEvaluatedKey) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
await callback(result);
|
|
34
|
+
while (result.next) {
|
|
35
|
+
result = convertResult(await result.next());
|
|
36
|
+
await callback(result);
|
|
37
|
+
if (!result.next) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
exports.scanWithCallback = scanWithCallback;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["convertResult","result","items","Items","count","Count","scannedCount","ScannedCount","lastEvaluatedKey","LastEvaluatedKey","next","undefined","error","requestId","$response","scan","params","entity","options","table","exports","scanWithCallback","callback","_result$items","length"],"sources":["scan.ts"],"sourcesContent":["import DocumentClient from \"aws-sdk/clients/dynamodb\";\nimport { scanOptions as DynamoDBToolboxScanOptions } from \"dynamodb-toolbox/dist/classes/Table\";\nimport { Entity } from \"dynamodb-toolbox\";\n\nexport interface ScanParams {\n entity: Entity<any>;\n options: DynamoDBToolboxScanOptions;\n params?: Partial<DocumentClient.ScanInput>;\n}\n\nexport interface ScanResponse<T> {\n items: T[];\n count: number;\n scannedCount: number;\n lastEvaluatedKey?: DocumentClient.Key;\n next?: () => Promise<ScanResponse<T>>;\n requestId: string;\n error: any;\n}\n\nconst convertResult = <T>(result: any): ScanResponse<T> => {\n return {\n items: result.Items as T[],\n count: result.Count,\n scannedCount: result.ScannedCount,\n lastEvaluatedKey: result.LastEvaluatedKey,\n next: result.LastEvaluatedKey ? result.next : undefined,\n error: result.error,\n requestId: result.$response.requestId\n };\n};\n\nexport type ScanDbItem<T> = T & {\n PK: string;\n SK: string;\n GSI1_PK: string;\n GSI1_SK: string;\n};\n\nexport const scan = async <T>(params: ScanParams): Promise<ScanResponse<T>> => {\n const { entity, options } = params;\n\n const result = await entity.table.scan(options, params.params);\n\n return convertResult(result);\n};\n\nexport const scanWithCallback = async <T>(\n params: ScanParams,\n callback: (result: ScanResponse<ScanDbItem<T>>) => Promise<void>\n): Promise<void> => {\n let result = await scan<ScanDbItem<T>>(params);\n if (!result.items?.length && !result.lastEvaluatedKey) {\n return;\n }\n await callback(result);\n\n while (result.next) {\n result = convertResult(await result.next());\n await callback(result);\n if (!result.next) {\n return;\n }\n }\n};\n"],"mappings":";;;;;;AAoBA,MAAMA,aAAa,GAAOC,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;AAACU,OAAA,CAAAC,gBAAA,GAAAA,gBAAA"}
|
package/utils/sort.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["extractSort","sortBy","fields","result","split","length","WebinyError","field","order","fieldPlugin","find","f","getField","isSortable","reverse","toUpperCase","sortItems","params","items","sort","initialSort","Array","isArray","info","sorters","orders","path","getPath","push","lodashOrderBy"],"sources":["sort.ts"],"sourcesContent":["import lodashOrderBy from \"lodash/orderBy\";\nimport WebinyError from \"@webiny/error\";\nimport { FieldPlugin } from \"~/plugins/definitions/FieldPlugin\";\n\ninterface Info {\n sorters: string[];\n orders: (boolean | \"asc\" | \"desc\")[];\n}\n\ninterface Response {\n reverse: boolean;\n field: string;\n}\n\nconst extractSort = (sortBy: string, fields: FieldPlugin[]): Response => {\n const result = sortBy.split(\"_\");\n if (result.length !== 2) {\n throw new WebinyError(\n \"Problem in determining the sorting for the entry items.\",\n \"SORT_ERROR\",\n {\n sortBy\n }\n );\n }\n const [field, order] = result;\n\n if (!field) {\n throw new WebinyError(\"Sorting field does not exist.\", \"SORTING_FIELD_ERROR\", {\n field,\n order,\n fields\n });\n }\n const fieldPlugin = fields.find(f => f.getField() === field);\n const isSortable = fieldPlugin ? fieldPlugin.isSortable() : true;\n if (isSortable === false) {\n throw new WebinyError(`Cannot sort by given field: \"${field}\".`, \"UNSUPPORTED_SORT_ERROR\", {\n fields,\n field\n });\n }\n\n return {\n field,\n reverse: order.toUpperCase() === \"DESC\"\n };\n};\n\ninterface Params<T> {\n /**\n * The items we are sorting.\n */\n items: T[];\n /**\n * Sort options. For example: [\"id_ASC\"]\n */\n sort?: string[];\n /**\n * Fields we can sort by.\n */\n fields?: FieldPlugin[];\n}\n\nexport function sortItems<T = any>(params: Params<T>): T[] {\n const { items, sort: initialSort = [], fields = [] } = params;\n /**\n * Skip sorting if nothing was passed to sort by or nothing to sort.\n */\n if (items.length <= 1 || Array.isArray(initialSort) === false || initialSort.length === 0) {\n return items;\n }\n\n const info: Info = {\n sorters: [],\n orders: []\n };\n\n for (const sort of initialSort) {\n /**\n * Possibly empty array item was passed.\n */\n if (!sort) {\n continue;\n }\n const { field, reverse } = extractSort(sort, fields);\n const fieldPlugin = fields.find(f => f.getField() === field);\n const path = fieldPlugin ? fieldPlugin.getPath() : field;\n\n info.sorters.push(path);\n info.orders.push(reverse === true ? \"desc\" : \"asc\");\n }\n\n if (info.sorters.length === 0) {\n return items;\n }\n\n return lodashOrderBy(items, info.sorters, info.orders);\n}\n"],"mappings":";;;;;;;AAAA;AACA;AAaA,
|
|
1
|
+
{"version":3,"names":["_orderBy","_interopRequireDefault","require","_error","extractSort","sortBy","fields","result","split","length","WebinyError","field","order","fieldPlugin","find","f","getField","isSortable","reverse","toUpperCase","sortItems","params","items","sort","initialSort","Array","isArray","info","sorters","orders","path","getPath","push","lodashOrderBy"],"sources":["sort.ts"],"sourcesContent":["import lodashOrderBy from \"lodash/orderBy\";\nimport WebinyError from \"@webiny/error\";\nimport { FieldPlugin } from \"~/plugins/definitions/FieldPlugin\";\n\ninterface Info {\n sorters: string[];\n orders: (boolean | \"asc\" | \"desc\")[];\n}\n\ninterface Response {\n reverse: boolean;\n field: string;\n}\n\nconst extractSort = (sortBy: string, fields: FieldPlugin[]): Response => {\n const result = sortBy.split(\"_\");\n if (result.length !== 2) {\n throw new WebinyError(\n \"Problem in determining the sorting for the entry items.\",\n \"SORT_ERROR\",\n {\n sortBy\n }\n );\n }\n const [field, order] = result;\n\n if (!field) {\n throw new WebinyError(\"Sorting field does not exist.\", \"SORTING_FIELD_ERROR\", {\n field,\n order,\n fields\n });\n }\n const fieldPlugin = fields.find(f => f.getField() === field);\n const isSortable = fieldPlugin ? fieldPlugin.isSortable() : true;\n if (isSortable === false) {\n throw new WebinyError(`Cannot sort by given field: \"${field}\".`, \"UNSUPPORTED_SORT_ERROR\", {\n fields,\n field\n });\n }\n\n return {\n field,\n reverse: order.toUpperCase() === \"DESC\"\n };\n};\n\ninterface Params<T> {\n /**\n * The items we are sorting.\n */\n items: T[];\n /**\n * Sort options. For example: [\"id_ASC\"]\n */\n sort?: string[];\n /**\n * Fields we can sort by.\n */\n fields?: FieldPlugin[];\n}\n\nexport function sortItems<T = any>(params: Params<T>): T[] {\n const { items, sort: initialSort = [], fields = [] } = params;\n /**\n * Skip sorting if nothing was passed to sort by or nothing to sort.\n */\n if (items.length <= 1 || Array.isArray(initialSort) === false || initialSort.length === 0) {\n return items;\n }\n\n const info: Info = {\n sorters: [],\n orders: []\n };\n\n for (const sort of initialSort) {\n /**\n * Possibly empty array item was passed.\n */\n if (!sort) {\n continue;\n }\n const { field, reverse } = extractSort(sort, fields);\n const fieldPlugin = fields.find(f => f.getField() === field);\n const path = fieldPlugin ? fieldPlugin.getPath() : field;\n\n info.sorters.push(path);\n info.orders.push(reverse === true ? \"desc\" : \"asc\");\n }\n\n if (info.sorters.length === 0) {\n return items;\n }\n\n return lodashOrderBy(items, info.sorters, info.orders);\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AAaA,MAAME,WAAW,GAAGA,CAACC,MAAc,EAAEC,MAAqB,KAAe;EACrE,MAAMC,MAAM,GAAGF,MAAM,CAACG,KAAK,CAAC,GAAG,CAAC;EAChC,IAAID,MAAM,CAACE,MAAM,KAAK,CAAC,EAAE;IACrB,MAAM,IAAIC,cAAW,CACjB,yDAAyD,EACzD,YAAY,EACZ;MACIL;IACJ,CACJ,CAAC;EACL;EACA,MAAM,CAACM,KAAK,EAAEC,KAAK,CAAC,GAAGL,MAAM;EAE7B,IAAI,CAACI,KAAK,EAAE;IACR,MAAM,IAAID,cAAW,CAAC,+BAA+B,EAAE,qBAAqB,EAAE;MAC1EC,KAAK;MACLC,KAAK;MACLN;IACJ,CAAC,CAAC;EACN;EACA,MAAMO,WAAW,GAAGP,MAAM,CAACQ,IAAI,CAACC,CAAC,IAAIA,CAAC,CA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AACF,IAAI,CAAC;IACvBH,IAAI,CAACE,MAAM,CAACG,IAAI,CAACd,OAAO,KAAK,IAAI,GAAG,MAAM,GAAG,KAAK,CAAC;EACvD;EAEA,IAAIS,IAAI,CAACC,OAAO,CAACnB,MAAM,KAAK,CAAC,EAAE;IAC3B,OAAOa,KAAK;EAChB;EAEA,OAAO,IAAAW,gBAAa,EAACX,KAAK,EAAEK,IAAI,CAACC,OAAO,EAAED,IAAI,CAACE,MAAM,CAAC;AAC1D"}
|
package/utils/table.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getTable","context","db","WebinyError","table"],"sources":["table.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { DbContext } from \"@webiny/handler-db/types\";\n\n/**\n * Will be removed in favor of passing the table name directly to the storage operations.\n *\n * @deprecated\n */\nexport const getTable = <T extends DbContext>(context: T): string => {\n if (!context.db) {\n throw new WebinyError(\"Missing db on context.\", \"DB_ERROR\");\n } else if (!context.db.table) {\n throw new WebinyError(\"Missing table on context.db.\", \"TABLE_ERROR\");\n }\n return context.db.table;\n};\n"],"mappings":";;;;;;;AAAA;AAGA;AACA;AACA;AACA;AACA;AACO,
|
|
1
|
+
{"version":3,"names":["_error","_interopRequireDefault","require","getTable","context","db","WebinyError","table","exports"],"sources":["table.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { DbContext } from \"@webiny/handler-db/types\";\n\n/**\n * Will be removed in favor of passing the table name directly to the storage operations.\n *\n * @deprecated\n */\nexport const getTable = <T extends DbContext>(context: T): string => {\n if (!context.db) {\n throw new WebinyError(\"Missing db on context.\", \"DB_ERROR\");\n } else if (!context.db.table) {\n throw new WebinyError(\"Missing table on context.db.\", \"TABLE_ERROR\");\n }\n return context.db.table;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA;AACA;AACA;AACA;AACA;AACO,MAAMC,QAAQ,GAAyBC,OAAU,IAAa;EACjE,IAAI,CAACA,OAAO,CAACC,EAAE,EAAE;IACb,MAAM,IAAIC,cAAW,CAAC,wBAAwB,EAAE,UAAU,CAAC;EAC/D,CAAC,MAAM,IAAI,CAACF,OAAO,CAACC,EAAE,CAACE,KAAK,EAAE;IAC1B,MAAM,IAAID,cAAW,CAAC,8BAA8B,EAAE,aAAa,CAAC;EACxE;EACA,OAAOF,OAAO,CAACC,EAAE,CAACE,KAAK;AAC3B,CAAC;AAACC,OAAA,CAAAL,QAAA,GAAAA,QAAA"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createStandardEntity = void 0;
|
|
7
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
8
|
-
const createStandardEntity = (table, name) => {
|
|
9
|
-
return new _dynamodbToolbox.Entity({
|
|
10
|
-
name,
|
|
11
|
-
table,
|
|
12
|
-
attributes: {
|
|
13
|
-
PK: {
|
|
14
|
-
partitionKey: true
|
|
15
|
-
},
|
|
16
|
-
SK: {
|
|
17
|
-
sortKey: true
|
|
18
|
-
},
|
|
19
|
-
GSI1_PK: {
|
|
20
|
-
type: "string"
|
|
21
|
-
},
|
|
22
|
-
GSI1_SK: {
|
|
23
|
-
type: "string"
|
|
24
|
-
},
|
|
25
|
-
TYPE: {
|
|
26
|
-
type: "string"
|
|
27
|
-
},
|
|
28
|
-
data: {
|
|
29
|
-
type: "map"
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
exports.createStandardEntity = createStandardEntity;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createStandardEntity","table","name","Entity","attributes","PK","partitionKey","SK","sortKey","GSI1_PK","type","GSI1_SK","TYPE","data"],"sources":["createStandardEntity.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb-toolbox\";\n\nexport const createStandardEntity = (table: Table, name: string): Entity<any> => {\n return new Entity({\n name,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n GSI1_PK: {\n type: \"string\"\n },\n GSI1_SK: {\n type: \"string\"\n },\n TYPE: {\n type: \"string\"\n },\n data: {\n type: \"map\"\n }\n }\n });\n};\n"],"mappings":";;;;;;AAAA;AAEO,MAAMA,oBAAoB,GAAG,CAACC,KAAY,EAAEC,IAAY,KAAkB;EAC7E,OAAO,IAAIC,uBAAM,CAAC;IACdD,IAAI;IACJD,KAAK;IACLG,UAAU,EAAE;MACRC,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,OAAO,EAAE;QACLC,IAAI,EAAE;MACV,CAAC;MACDC,OAAO,EAAE;QACLD,IAAI,EAAE;MACV,CAAC;MACDE,IAAI,EAAE;QACFF,IAAI,EAAE;MACV,CAAC;MACDG,IAAI,EAAE;QACFH,IAAI,EAAE;MACV;IACJ;EACJ,CAAC,CAAC;AACN,CAAC;AAAC"}
|