@webiny/api-file-manager-ddb 0.0.0-mt-3 → 0.0.0-unstable.2af142b57e
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/definitions/filesEntity.d.ts +3 -2
- package/definitions/filesEntity.js +3 -13
- package/definitions/filesEntity.js.map +1 -0
- package/definitions/settingsEntity.d.ts +3 -2
- package/definitions/settingsEntity.js +3 -13
- package/definitions/settingsEntity.js.map +1 -0
- package/definitions/systemEntity.d.ts +3 -2
- package/definitions/systemEntity.js +6 -13
- package/definitions/systemEntity.js.map +1 -0
- package/definitions/table.d.ts +3 -2
- package/definitions/table.js +1 -9
- package/definitions/table.js.map +1 -0
- package/index.js +0 -5
- package/index.js.map +1 -0
- package/operations/files/FilesStorageOperations.js +28 -65
- package/operations/files/FilesStorageOperations.js.map +1 -0
- package/operations/files/fields.js +0 -3
- package/operations/files/fields.js.map +1 -0
- package/operations/files/index.d.ts +2 -2
- package/operations/files/index.js +1 -10
- package/operations/files/index.js.map +1 -0
- package/operations/settings/SettingsStorageOperations.d.ts +3 -3
- package/operations/settings/SettingsStorageOperations.js +4 -27
- package/operations/settings/SettingsStorageOperations.js.map +1 -0
- package/operations/settings/index.d.ts +2 -4
- package/operations/settings/index.js +1 -9
- package/operations/settings/index.js.map +1 -0
- package/operations/system/SystemStorageOperations.d.ts +2 -2
- package/operations/system/SystemStorageOperations.js +5 -29
- package/operations/system/SystemStorageOperations.js.map +1 -0
- package/operations/system/index.d.ts +2 -4
- package/operations/system/index.js +1 -9
- package/operations/system/index.js.map +1 -0
- package/operations/utils.js +1 -11
- package/operations/utils.js.map +1 -0
- package/package.json +18 -18
- package/plugins/FileAttributePlugin.d.ts +2 -2
- package/plugins/FileAttributePlugin.js +3 -13
- package/plugins/FileAttributePlugin.js.map +1 -0
- package/plugins/FileDynamoDbFieldPlugin.js +1 -6
- package/plugins/FileDynamoDbFieldPlugin.js.map +1 -0
- package/plugins/SettingsAttributePlugin.d.ts +2 -2
- package/plugins/SettingsAttributePlugin.js +3 -13
- package/plugins/SettingsAttributePlugin.js.map +1 -0
- package/plugins/SystemAttributePlugin.d.ts +2 -2
- package/plugins/SystemAttributePlugin.js +3 -13
- package/plugins/SystemAttributePlugin.js.map +1 -0
- package/types.js.map +1 -0
- package/operations/configurations.d.ts +0 -14
- package/operations/configurations.js +0 -22
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Entity, Table } from "dynamodb-toolbox";
|
|
2
2
|
import { FileManagerContext } from "@webiny/api-file-manager/types";
|
|
3
|
-
|
|
3
|
+
export interface FilesEntityParams {
|
|
4
4
|
context: FileManagerContext;
|
|
5
5
|
table: Table;
|
|
6
|
-
}
|
|
6
|
+
}
|
|
7
|
+
declare const _default: (params: FilesEntityParams) => Entity<any>;
|
|
7
8
|
export default _default;
|
|
@@ -1,22 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
12
9
|
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
13
|
-
|
|
14
10
|
var _attributes = require("@webiny/db-dynamodb/utils/attributes");
|
|
15
|
-
|
|
16
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
17
|
-
|
|
18
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
19
|
-
|
|
20
11
|
var _default = params => {
|
|
21
12
|
const {
|
|
22
13
|
context,
|
|
@@ -27,7 +18,7 @@ var _default = params => {
|
|
|
27
18
|
return new _dynamodbToolbox.Entity({
|
|
28
19
|
name: entityName,
|
|
29
20
|
table,
|
|
30
|
-
attributes:
|
|
21
|
+
attributes: (0, _objectSpread2.default)({
|
|
31
22
|
PK: {
|
|
32
23
|
partitionKey: true
|
|
33
24
|
},
|
|
@@ -76,5 +67,4 @@ var _default = params => {
|
|
|
76
67
|
}, attributes)
|
|
77
68
|
});
|
|
78
69
|
};
|
|
79
|
-
|
|
80
70
|
exports.default = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["params","context","table","entityName","attributes","getExtraAttributes","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","id","key","size","meta","tags","createdOn","createdBy","tenant","locale","webinyVersion"],"sources":["filesEntity.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb-toolbox\";\nimport { FileManagerContext } from \"@webiny/api-file-manager/types\";\nimport { getExtraAttributes } from \"@webiny/db-dynamodb/utils/attributes\";\n\nexport interface FilesEntityParams {\n context: FileManagerContext;\n table: Table;\n}\nexport default (params: FilesEntityParams): Entity<any> => {\n const { context, table } = params;\n const entityName = \"Files\";\n const attributes = getExtraAttributes(context, entityName);\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n TYPE: {\n type: \"string\"\n },\n id: {\n type: \"string\"\n },\n key: {\n type: \"string\"\n },\n size: {\n type: \"number\"\n },\n type: {\n type: \"string\"\n },\n name: {\n type: \"string\"\n },\n meta: {\n type: \"map\"\n },\n tags: {\n type: \"list\"\n },\n createdOn: {\n type: \"string\"\n },\n createdBy: {\n type: \"map\"\n },\n tenant: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n webinyVersion: {\n type: \"string\"\n },\n ...attributes\n }\n });\n};\n"],"mappings":";;;;;;;;AAAA;AAEA;AAA0E,eAM1DA,MAAyB,IAAkB;EACvD,MAAM;IAAEC,OAAO;IAAEC;EAAM,CAAC,GAAGF,MAAM;EACjC,MAAMG,UAAU,GAAG,OAAO;EAC1B,MAAMC,UAAU,GAAG,IAAAC,8BAAkB,EAACJ,OAAO,EAAEE,UAAU,CAAC;EAC1D,OAAO,IAAIG,uBAAM,CAAC;IACdC,IAAI,EAAEJ,UAAU;IAChBD,KAAK;IACLE,UAAU;MACNI,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,IAAI,EAAE;QACFC,IAAI,EAAE;MACV,CAAC;MACDC,EAAE,EAAE;QACAD,IAAI,EAAE;MACV,CAAC;MACDE,GAAG,EAAE;QACDF,IAAI,EAAE;MACV,CAAC;MACDG,IAAI,EAAE;QACFH,IAAI,EAAE;MACV,CAAC;MACDA,IAAI,EAAE;QACFA,IAAI,EAAE;MACV,CAAC;MACDN,IAAI,EAAE;QACFM,IAAI,EAAE;MACV,CAAC;MACDI,IAAI,EAAE;QACFJ,IAAI,EAAE;MACV,CAAC;MACDK,IAAI,EAAE;QACFL,IAAI,EAAE;MACV,CAAC;MACDM,SAAS,EAAE;QACPN,IAAI,EAAE;MACV,CAAC;MACDO,SAAS,EAAE;QACPP,IAAI,EAAE;MACV,CAAC;MACDQ,MAAM,EAAE;QACJR,IAAI,EAAE;MACV,CAAC;MACDS,MAAM,EAAE;QACJT,IAAI,EAAE;MACV,CAAC;MACDU,aAAa,EAAE;QACXV,IAAI,EAAE;MACV;IAAC,GACET,UAAU;EAErB,CAAC,CAAC;AACN,CAAC;AAAA"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Entity, Table } from "dynamodb-toolbox";
|
|
2
2
|
import { FileManagerContext } from "@webiny/api-file-manager/types";
|
|
3
|
-
|
|
3
|
+
export interface SettingsEntityParams {
|
|
4
4
|
context: FileManagerContext;
|
|
5
5
|
table: Table;
|
|
6
|
-
}
|
|
6
|
+
}
|
|
7
|
+
declare const _default: (params: SettingsEntityParams) => Entity<any>;
|
|
7
8
|
export default _default;
|
|
@@ -1,22 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
12
9
|
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
13
|
-
|
|
14
10
|
var _attributes = require("@webiny/db-dynamodb/utils/attributes");
|
|
15
|
-
|
|
16
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
17
|
-
|
|
18
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
19
|
-
|
|
20
11
|
var _default = params => {
|
|
21
12
|
const {
|
|
22
13
|
context,
|
|
@@ -27,7 +18,7 @@ var _default = params => {
|
|
|
27
18
|
return new _dynamodbToolbox.Entity({
|
|
28
19
|
name: entityName,
|
|
29
20
|
table,
|
|
30
|
-
attributes:
|
|
21
|
+
attributes: (0, _objectSpread2.default)({
|
|
31
22
|
PK: {
|
|
32
23
|
partitionKey: true
|
|
33
24
|
},
|
|
@@ -52,5 +43,4 @@ var _default = params => {
|
|
|
52
43
|
}, attributes)
|
|
53
44
|
});
|
|
54
45
|
};
|
|
55
|
-
|
|
56
46
|
exports.default = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["params","context","table","entityName","attributes","getExtraAttributes","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","key","uploadMinFileSize","uploadMaxFileSize","srcPrefix"],"sources":["settingsEntity.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb-toolbox\";\nimport { FileManagerContext } from \"@webiny/api-file-manager/types\";\nimport { getExtraAttributes } from \"@webiny/db-dynamodb/utils/attributes\";\n\nexport interface SettingsEntityParams {\n context: FileManagerContext;\n table: Table;\n}\nexport default (params: SettingsEntityParams): Entity<any> => {\n const { context, table } = params;\n const entityName = \"Settings\";\n const attributes = getExtraAttributes(context, entityName);\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n TYPE: {\n type: \"string\"\n },\n key: {\n type: \"string\"\n },\n uploadMinFileSize: {\n type: \"number\"\n },\n uploadMaxFileSize: {\n type: \"number\"\n },\n srcPrefix: {\n type: \"string\"\n },\n ...attributes\n }\n });\n};\n"],"mappings":";;;;;;;;AAAA;AAEA;AAA0E,eAM1DA,MAA4B,IAAkB;EAC1D,MAAM;IAAEC,OAAO;IAAEC;EAAM,CAAC,GAAGF,MAAM;EACjC,MAAMG,UAAU,GAAG,UAAU;EAC7B,MAAMC,UAAU,GAAG,IAAAC,8BAAkB,EAACJ,OAAO,EAAEE,UAAU,CAAC;EAC1D,OAAO,IAAIG,uBAAM,CAAC;IACdC,IAAI,EAAEJ,UAAU;IAChBD,KAAK;IACLE,UAAU;MACNI,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,IAAI,EAAE;QACFC,IAAI,EAAE;MACV,CAAC;MACDC,GAAG,EAAE;QACDD,IAAI,EAAE;MACV,CAAC;MACDE,iBAAiB,EAAE;QACfF,IAAI,EAAE;MACV,CAAC;MACDG,iBAAiB,EAAE;QACfH,IAAI,EAAE;MACV,CAAC;MACDI,SAAS,EAAE;QACPJ,IAAI,EAAE;MACV;IAAC,GACET,UAAU;EAErB,CAAC,CAAC;AACN,CAAC;AAAA"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Entity, Table } from "dynamodb-toolbox";
|
|
2
2
|
import { FileManagerContext } from "@webiny/api-file-manager/types";
|
|
3
|
-
|
|
3
|
+
export interface SystemEntityParams {
|
|
4
4
|
context: FileManagerContext;
|
|
5
5
|
table: Table;
|
|
6
|
-
}
|
|
6
|
+
}
|
|
7
|
+
declare const _default: (params: SystemEntityParams) => Entity<any>;
|
|
7
8
|
export default _default;
|
|
@@ -1,22 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
12
9
|
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
13
|
-
|
|
14
10
|
var _attributes = require("@webiny/db-dynamodb/utils/attributes");
|
|
15
|
-
|
|
16
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
17
|
-
|
|
18
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
19
|
-
|
|
20
11
|
var _default = params => {
|
|
21
12
|
const {
|
|
22
13
|
context,
|
|
@@ -27,7 +18,7 @@ var _default = params => {
|
|
|
27
18
|
return new _dynamodbToolbox.Entity({
|
|
28
19
|
name: entityName,
|
|
29
20
|
table,
|
|
30
|
-
attributes:
|
|
21
|
+
attributes: (0, _objectSpread2.default)({
|
|
31
22
|
PK: {
|
|
32
23
|
partitionKey: true
|
|
33
24
|
},
|
|
@@ -36,9 +27,11 @@ var _default = params => {
|
|
|
36
27
|
},
|
|
37
28
|
version: {
|
|
38
29
|
type: "string"
|
|
30
|
+
},
|
|
31
|
+
tenant: {
|
|
32
|
+
type: "string"
|
|
39
33
|
}
|
|
40
34
|
}, attributes)
|
|
41
35
|
});
|
|
42
36
|
};
|
|
43
|
-
|
|
44
37
|
exports.default = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["params","context","table","entityName","attributes","getExtraAttributes","Entity","name","PK","partitionKey","SK","sortKey","version","type","tenant"],"sources":["systemEntity.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb-toolbox\";\nimport { FileManagerContext } from \"@webiny/api-file-manager/types\";\nimport { getExtraAttributes } from \"@webiny/db-dynamodb/utils/attributes\";\n\nexport interface SystemEntityParams {\n context: FileManagerContext;\n table: Table;\n}\nexport default (params: SystemEntityParams): Entity<any> => {\n const { context, table } = params;\n const entityName = \"System\";\n const attributes = getExtraAttributes(context, entityName);\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n version: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n ...attributes\n }\n });\n};\n"],"mappings":";;;;;;;;AAAA;AAEA;AAA0E,eAM1DA,MAA0B,IAAkB;EACxD,MAAM;IAAEC,OAAO;IAAEC;EAAM,CAAC,GAAGF,MAAM;EACjC,MAAMG,UAAU,GAAG,QAAQ;EAC3B,MAAMC,UAAU,GAAG,IAAAC,8BAAkB,EAACJ,OAAO,EAAEE,UAAU,CAAC;EAC1D,OAAO,IAAIG,uBAAM,CAAC;IACdC,IAAI,EAAEJ,UAAU;IAChBD,KAAK;IACLE,UAAU;MACNI,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,OAAO,EAAE;QACLC,IAAI,EAAE;MACV,CAAC;MACDC,MAAM,EAAE;QACJD,IAAI,EAAE;MACV;IAAC,GACET,UAAU;EAErB,CAAC,CAAC;AACN,CAAC;AAAA"}
|
package/definitions/table.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Table } from "dynamodb-toolbox";
|
|
2
2
|
import { FileManagerContext } from "@webiny/api-file-manager/types";
|
|
3
|
-
|
|
3
|
+
export interface TableParams {
|
|
4
4
|
context: FileManagerContext;
|
|
5
|
-
}
|
|
5
|
+
}
|
|
6
|
+
declare const _default: (params: TableParams) => Table;
|
|
6
7
|
export default _default;
|
package/definitions/table.js
CHANGED
|
@@ -1,28 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.default = void 0;
|
|
9
|
-
|
|
10
7
|
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
11
|
-
|
|
12
|
-
var _configurations = _interopRequireDefault(require("../operations/configurations"));
|
|
13
|
-
|
|
14
8
|
var _utils = require("../operations/utils");
|
|
15
|
-
|
|
16
9
|
var _default = params => {
|
|
17
10
|
const {
|
|
18
11
|
context
|
|
19
12
|
} = params;
|
|
20
13
|
return new _dynamodbToolbox.Table({
|
|
21
|
-
name:
|
|
14
|
+
name: process.env.DB_TABLE_FILE_MANGER || process.env.DB_TABLE || (0, _utils.getTable)(context),
|
|
22
15
|
partitionKey: "PK",
|
|
23
16
|
sortKey: "SK",
|
|
24
17
|
DocumentClient: (0, _utils.getDocumentClient)(context)
|
|
25
18
|
});
|
|
26
19
|
};
|
|
27
|
-
|
|
28
20
|
exports.default = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["params","context","Table","name","process","env","DB_TABLE_FILE_MANGER","DB_TABLE","getTable","partitionKey","sortKey","DocumentClient","getDocumentClient"],"sources":["table.ts"],"sourcesContent":["import { Table } from \"dynamodb-toolbox\";\nimport { getDocumentClient, getTable } from \"~/operations/utils\";\nimport { FileManagerContext } from \"@webiny/api-file-manager/types\";\n\nexport interface TableParams {\n context: FileManagerContext;\n}\nexport default (params: TableParams): Table => {\n const { context } = params;\n return new Table({\n name: process.env.DB_TABLE_FILE_MANGER || process.env.DB_TABLE || getTable(context),\n partitionKey: \"PK\",\n sortKey: \"SK\",\n DocumentClient: getDocumentClient(context)\n });\n};\n"],"mappings":";;;;;;AAAA;AACA;AAAiE,eAMjDA,MAAmB,IAAY;EAC3C,MAAM;IAAEC;EAAQ,CAAC,GAAGD,MAAM;EAC1B,OAAO,IAAIE,sBAAK,CAAC;IACbC,IAAI,EAAEC,OAAO,CAACC,GAAG,CAACC,oBAAoB,IAAIF,OAAO,CAACC,GAAG,CAACE,QAAQ,IAAI,IAAAC,eAAQ,EAACP,OAAO,CAAC;IACnFQ,YAAY,EAAE,IAAI;IAClBC,OAAO,EAAE,IAAI;IACbC,cAAc,EAAE,IAAAC,wBAAiB,EAACX,OAAO;EAC7C,CAAC,CAAC;AACN,CAAC;AAAA"}
|
package/index.js
CHANGED
|
@@ -4,13 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _files = require("./operations/files");
|
|
9
|
-
|
|
10
8
|
var _settings = require("./operations/settings");
|
|
11
|
-
|
|
12
9
|
var _system = require("./operations/system");
|
|
13
|
-
|
|
14
10
|
var _default = () => [new _files.FilesStorageOperationsProviderDdb(), new _settings.SettingsStorageOperationsProviderDdbPlugin(), new _system.SystemStorageOperationsProviderDdbPlugin()];
|
|
15
|
-
|
|
16
11
|
exports.default = _default;
|
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["FilesStorageOperationsProviderDdb","SettingsStorageOperationsProviderDdbPlugin","SystemStorageOperationsProviderDdbPlugin"],"sources":["index.ts"],"sourcesContent":["import { FilesStorageOperationsProviderDdb } from \"./operations/files\";\nimport { SettingsStorageOperationsProviderDdbPlugin } from \"./operations/settings\";\nimport { SystemStorageOperationsProviderDdbPlugin } from \"./operations/system\";\n\nexport default () => [\n new FilesStorageOperationsProviderDdb(),\n new SettingsStorageOperationsProviderDdbPlugin(),\n new SystemStorageOperationsProviderDdbPlugin()\n];\n"],"mappings":";;;;;;AAAA;AACA;AACA;AAA+E,eAEhE,MAAM,CACjB,IAAIA,wCAAiC,EAAE,EACvC,IAAIC,oDAA0C,EAAE,EAChD,IAAIC,gDAAwC,EAAE,CACjD;AAAA"}
|
|
@@ -1,45 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.FilesStorageOperations = void 0;
|
|
9
|
-
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
10
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
10
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
13
|
-
|
|
14
11
|
var _table = _interopRequireDefault(require("../../definitions/table"));
|
|
15
|
-
|
|
16
12
|
var _filesEntity = _interopRequireDefault(require("../../definitions/filesEntity"));
|
|
17
|
-
|
|
18
13
|
var _query = require("@webiny/db-dynamodb/utils/query");
|
|
19
|
-
|
|
20
14
|
var _cursor = require("@webiny/db-dynamodb/utils/cursor");
|
|
21
|
-
|
|
22
15
|
var _filter = require("@webiny/db-dynamodb/utils/filter");
|
|
23
|
-
|
|
24
16
|
var _sort = require("@webiny/db-dynamodb/utils/sort");
|
|
25
|
-
|
|
26
17
|
var _FileDynamoDbFieldPlugin = require("../../plugins/FileDynamoDbFieldPlugin");
|
|
27
|
-
|
|
28
18
|
var _batchWrite = require("@webiny/db-dynamodb/utils/batchWrite");
|
|
29
|
-
|
|
30
19
|
var _get = require("@webiny/db-dynamodb/utils/get");
|
|
31
|
-
|
|
32
20
|
var _cleanup = require("@webiny/db-dynamodb/utils/cleanup");
|
|
33
|
-
|
|
34
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
35
|
-
|
|
36
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
37
|
-
|
|
38
21
|
class FilesStorageOperations {
|
|
39
22
|
get context() {
|
|
40
23
|
return this._context;
|
|
41
24
|
}
|
|
42
|
-
|
|
43
25
|
constructor({
|
|
44
26
|
context
|
|
45
27
|
}) {
|
|
@@ -55,7 +37,6 @@ class FilesStorageOperations {
|
|
|
55
37
|
table: this.table
|
|
56
38
|
});
|
|
57
39
|
}
|
|
58
|
-
|
|
59
40
|
async get(params) {
|
|
60
41
|
const {
|
|
61
42
|
where
|
|
@@ -64,7 +45,6 @@ class FilesStorageOperations {
|
|
|
64
45
|
PK: this.createPartitionKey(where),
|
|
65
46
|
SK: this.createSortKey(where)
|
|
66
47
|
};
|
|
67
|
-
|
|
68
48
|
try {
|
|
69
49
|
const file = await (0, _get.get)({
|
|
70
50
|
entity: this.entity,
|
|
@@ -78,7 +58,6 @@ class FilesStorageOperations {
|
|
|
78
58
|
});
|
|
79
59
|
}
|
|
80
60
|
}
|
|
81
|
-
|
|
82
61
|
async create(params) {
|
|
83
62
|
const {
|
|
84
63
|
file
|
|
@@ -87,11 +66,9 @@ class FilesStorageOperations {
|
|
|
87
66
|
PK: this.createPartitionKey(file),
|
|
88
67
|
SK: this.createSortKey(file)
|
|
89
68
|
};
|
|
90
|
-
|
|
91
|
-
const item = _objectSpread(_objectSpread(_objectSpread({}, file), keys), {}, {
|
|
69
|
+
const item = (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, file), keys), {}, {
|
|
92
70
|
TYPE: "fm.file"
|
|
93
71
|
});
|
|
94
|
-
|
|
95
72
|
try {
|
|
96
73
|
await this.entity.put(item);
|
|
97
74
|
} catch (ex) {
|
|
@@ -100,10 +77,8 @@ class FilesStorageOperations {
|
|
|
100
77
|
item
|
|
101
78
|
});
|
|
102
79
|
}
|
|
103
|
-
|
|
104
80
|
return file;
|
|
105
81
|
}
|
|
106
|
-
|
|
107
82
|
async update(params) {
|
|
108
83
|
const {
|
|
109
84
|
file
|
|
@@ -112,11 +87,9 @@ class FilesStorageOperations {
|
|
|
112
87
|
PK: this.createPartitionKey(file),
|
|
113
88
|
SK: this.createSortKey(file)
|
|
114
89
|
};
|
|
115
|
-
|
|
116
|
-
const item = _objectSpread(_objectSpread(_objectSpread({}, file), keys), {}, {
|
|
90
|
+
const item = (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, file), keys), {}, {
|
|
117
91
|
TYPE: "fm.file"
|
|
118
92
|
});
|
|
119
|
-
|
|
120
93
|
try {
|
|
121
94
|
await this.entity.put(item);
|
|
122
95
|
} catch (ex) {
|
|
@@ -125,10 +98,8 @@ class FilesStorageOperations {
|
|
|
125
98
|
item
|
|
126
99
|
});
|
|
127
100
|
}
|
|
128
|
-
|
|
129
101
|
return file;
|
|
130
102
|
}
|
|
131
|
-
|
|
132
103
|
async delete(params) {
|
|
133
104
|
const {
|
|
134
105
|
file
|
|
@@ -137,7 +108,6 @@ class FilesStorageOperations {
|
|
|
137
108
|
PK: this.createPartitionKey(file),
|
|
138
109
|
SK: this.createSortKey(file)
|
|
139
110
|
};
|
|
140
|
-
|
|
141
111
|
try {
|
|
142
112
|
await this.entity.delete(keys);
|
|
143
113
|
} catch (ex) {
|
|
@@ -148,19 +118,17 @@ class FilesStorageOperations {
|
|
|
148
118
|
});
|
|
149
119
|
}
|
|
150
120
|
}
|
|
151
|
-
|
|
152
121
|
async createBatch(params) {
|
|
153
122
|
const {
|
|
154
123
|
files
|
|
155
124
|
} = params;
|
|
156
125
|
const items = files.map(file => {
|
|
157
|
-
return this.entity.putBatch(
|
|
126
|
+
return this.entity.putBatch((0, _objectSpread2.default)((0, _objectSpread2.default)({}, file), {}, {
|
|
158
127
|
PK: this.createPartitionKey(file),
|
|
159
128
|
SK: this.createSortKey(file),
|
|
160
129
|
TYPE: "fm.file"
|
|
161
130
|
}));
|
|
162
131
|
});
|
|
163
|
-
|
|
164
132
|
try {
|
|
165
133
|
await (0, _batchWrite.batchWriteAll)({
|
|
166
134
|
table: this.entity.table,
|
|
@@ -172,10 +140,8 @@ class FilesStorageOperations {
|
|
|
172
140
|
files
|
|
173
141
|
});
|
|
174
142
|
}
|
|
175
|
-
|
|
176
143
|
return files;
|
|
177
144
|
}
|
|
178
|
-
|
|
179
145
|
async list(params) {
|
|
180
146
|
const {
|
|
181
147
|
where: initialWhere,
|
|
@@ -192,7 +158,6 @@ class FilesStorageOperations {
|
|
|
192
158
|
options
|
|
193
159
|
};
|
|
194
160
|
let items = [];
|
|
195
|
-
|
|
196
161
|
try {
|
|
197
162
|
items = await (0, _query.queryAll)(queryAllParams);
|
|
198
163
|
} catch (ex) {
|
|
@@ -210,16 +175,13 @@ class FilesStorageOperations {
|
|
|
210
175
|
}
|
|
211
176
|
});
|
|
212
177
|
}
|
|
213
|
-
|
|
214
|
-
const where = _objectSpread({}, initialWhere);
|
|
215
|
-
|
|
178
|
+
const where = (0, _objectSpread2.default)({}, initialWhere);
|
|
216
179
|
if (where.search) {
|
|
217
180
|
where.contains = {
|
|
218
181
|
fields: ["name", "tags"],
|
|
219
182
|
value: where.search
|
|
220
183
|
};
|
|
221
184
|
}
|
|
222
|
-
|
|
223
185
|
delete where["tenant"];
|
|
224
186
|
delete where["locale"];
|
|
225
187
|
delete where["search"];
|
|
@@ -228,7 +190,6 @@ class FilesStorageOperations {
|
|
|
228
190
|
* Filter the read items via the code.
|
|
229
191
|
* It will build the filters out of the where input and transform the values it is using.
|
|
230
192
|
*/
|
|
231
|
-
|
|
232
193
|
const filteredFiles = (0, _filter.filterItems)({
|
|
233
194
|
plugins: this.context.plugins,
|
|
234
195
|
items,
|
|
@@ -240,13 +201,12 @@ class FilesStorageOperations {
|
|
|
240
201
|
* Sorting is also done via the code.
|
|
241
202
|
* It takes the sort input and sorts by it via the lodash sortBy method.
|
|
242
203
|
*/
|
|
243
|
-
|
|
244
204
|
const sortedFiles = (0, _sort.sortItems)({
|
|
245
205
|
items: filteredFiles,
|
|
246
206
|
sort,
|
|
247
207
|
fields
|
|
248
208
|
});
|
|
249
|
-
const start = (0, _cursor.decodeCursor)(after) || 0;
|
|
209
|
+
const start = parseInt((0, _cursor.decodeCursor)(after) || "0") || 0;
|
|
250
210
|
const hasMoreItems = totalCount > start + limit;
|
|
251
211
|
const end = limit > totalCount + start + limit ? undefined : start + limit;
|
|
252
212
|
const files = sortedFiles.slice(start, end);
|
|
@@ -254,7 +214,6 @@ class FilesStorageOperations {
|
|
|
254
214
|
* Although we do not need a cursor here, we will use it as such to keep it standardized.
|
|
255
215
|
* Number is simply encoded.
|
|
256
216
|
*/
|
|
257
|
-
|
|
258
217
|
const cursor = files.length > 0 ? (0, _cursor.encodeCursor)(start + limit) : null;
|
|
259
218
|
const meta = {
|
|
260
219
|
hasMoreItems,
|
|
@@ -263,21 +222,19 @@ class FilesStorageOperations {
|
|
|
263
222
|
};
|
|
264
223
|
return [files, meta];
|
|
265
224
|
}
|
|
266
|
-
|
|
267
225
|
async tags(params) {
|
|
268
226
|
const {
|
|
269
|
-
where
|
|
227
|
+
where: initialWhere
|
|
270
228
|
} = params;
|
|
271
229
|
const queryAllParams = {
|
|
272
230
|
entity: this.entity,
|
|
273
|
-
partitionKey: this.createPartitionKey(
|
|
231
|
+
partitionKey: this.createPartitionKey(initialWhere),
|
|
274
232
|
options: {
|
|
275
233
|
gte: " ",
|
|
276
234
|
reverse: false
|
|
277
235
|
}
|
|
278
236
|
};
|
|
279
237
|
let results = [];
|
|
280
|
-
|
|
281
238
|
try {
|
|
282
239
|
results = await (0, _query.queryAll)(queryAllParams);
|
|
283
240
|
} catch (ex) {
|
|
@@ -286,20 +243,33 @@ class FilesStorageOperations {
|
|
|
286
243
|
query: queryAllParams
|
|
287
244
|
});
|
|
288
245
|
}
|
|
246
|
+
const fields = this.context.plugins.byType(_FileDynamoDbFieldPlugin.FileDynamoDbFieldPlugin.type);
|
|
247
|
+
const where = (0, _objectSpread2.default)({}, initialWhere);
|
|
248
|
+
delete where["tenant"];
|
|
249
|
+
delete where["locale"];
|
|
250
|
+
|
|
289
251
|
/**
|
|
290
|
-
*
|
|
252
|
+
* Filter the read items via the code.
|
|
253
|
+
* It will build the filters out of the where input and transform the values it is using.
|
|
291
254
|
*/
|
|
255
|
+
const filteredItems = (0, _filter.filterItems)({
|
|
256
|
+
plugins: this.context.plugins,
|
|
257
|
+
items: results,
|
|
258
|
+
where,
|
|
259
|
+
fields
|
|
260
|
+
});
|
|
292
261
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
262
|
+
/**
|
|
263
|
+
* Aggregate all the tags from all the filtered items.
|
|
264
|
+
*/
|
|
265
|
+
const tagsObject = filteredItems.reduce((collection, item) => {
|
|
266
|
+
const tags = Array.isArray(item.tags) ? item.tags : [];
|
|
267
|
+
for (const tag of tags) {
|
|
296
268
|
if (!collection[tag]) {
|
|
297
269
|
collection[tag] = [];
|
|
298
270
|
}
|
|
299
|
-
|
|
300
271
|
collection[tag].push(item.id);
|
|
301
272
|
}
|
|
302
|
-
|
|
303
273
|
return collection;
|
|
304
274
|
}, {});
|
|
305
275
|
const tags = Object.keys(tagsObject);
|
|
@@ -312,19 +282,15 @@ class FilesStorageOperations {
|
|
|
312
282
|
};
|
|
313
283
|
return [tags, meta];
|
|
314
284
|
}
|
|
315
|
-
|
|
316
285
|
createQueryAllOptions({
|
|
317
286
|
where
|
|
318
287
|
}) {
|
|
319
288
|
const options = {};
|
|
320
|
-
|
|
321
289
|
if (where.id) {
|
|
322
290
|
options.eq = where.id;
|
|
323
291
|
}
|
|
324
|
-
|
|
325
292
|
return options;
|
|
326
293
|
}
|
|
327
|
-
|
|
328
294
|
createPartitionKey(params) {
|
|
329
295
|
const {
|
|
330
296
|
tenant,
|
|
@@ -332,14 +298,11 @@ class FilesStorageOperations {
|
|
|
332
298
|
} = params;
|
|
333
299
|
return `T#${tenant}#L#${locale}#FM#F`;
|
|
334
300
|
}
|
|
335
|
-
|
|
336
301
|
createSortKey(params) {
|
|
337
302
|
const {
|
|
338
303
|
id
|
|
339
304
|
} = params;
|
|
340
305
|
return id;
|
|
341
306
|
}
|
|
342
|
-
|
|
343
307
|
}
|
|
344
|
-
|
|
345
308
|
exports.FilesStorageOperations = FilesStorageOperations;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["FilesStorageOperations","context","_context","constructor","table","defineTable","entity","defineFilesEntity","get","params","where","keys","PK","createPartitionKey","SK","createSortKey","file","getEntityItem","cleanupItem","ex","WebinyError","message","code","error","create","item","TYPE","put","update","delete","createBatch","files","items","map","putBatch","batchWriteAll","list","initialWhere","limit","after","sort","options","createQueryAllOptions","queryAllParams","partitionKey","queryAll","queryParams","name","search","contains","fields","value","plugins","byType","FileDynamoDbFieldPlugin","type","filteredFiles","filterItems","totalCount","length","sortedFiles","sortItems","start","parseInt","decodeCursor","hasMoreItems","end","undefined","slice","cursor","encodeCursor","meta","tags","gte","reverse","results","query","filteredItems","tagsObject","reduce","collection","Array","isArray","tag","push","id","Object","eq","tenant","locale"],"sources":["FilesStorageOperations.ts"],"sourcesContent":["import {\n File,\n FileManagerContext,\n FileManagerFilesStorageOperations,\n FileManagerFilesStorageOperationsCreateBatchParams,\n FileManagerFilesStorageOperationsCreateParams,\n FileManagerFilesStorageOperationsDeleteParams,\n FileManagerFilesStorageOperationsGetParams,\n FileManagerFilesStorageOperationsListParams,\n FileManagerFilesStorageOperationsListParamsWhere,\n FileManagerFilesStorageOperationsListResponse,\n FileManagerFilesStorageOperationsListResponseMeta,\n FileManagerFilesStorageOperationsTagsParams,\n FileManagerFilesStorageOperationsTagsParamsWhere,\n FileManagerFilesStorageOperationsTagsResponse,\n FileManagerFilesStorageOperationsUpdateParams\n} from \"@webiny/api-file-manager/types\";\nimport { Entity, Table } from \"dynamodb-toolbox\";\nimport WebinyError from \"@webiny/error\";\nimport defineTable from \"~/definitions/table\";\nimport defineFilesEntity from \"~/definitions/filesEntity\";\nimport { queryOptions as DynamoDBToolboxQueryOptions } from \"dynamodb-toolbox/dist/classes/Table\";\nimport { queryAll } from \"@webiny/db-dynamodb/utils/query\";\nimport { decodeCursor, encodeCursor } from \"@webiny/db-dynamodb/utils/cursor\";\nimport { filterItems } from \"@webiny/db-dynamodb/utils/filter\";\nimport { sortItems } from \"@webiny/db-dynamodb/utils/sort\";\nimport { FileDynamoDbFieldPlugin } from \"~/plugins/FileDynamoDbFieldPlugin\";\nimport { batchWriteAll } from \"@webiny/db-dynamodb/utils/batchWrite\";\nimport { get as getEntityItem } from \"@webiny/db-dynamodb/utils/get\";\nimport { cleanupItem } from \"@webiny/db-dynamodb/utils/cleanup\";\n\ninterface FileItem extends File {\n PK: string;\n SK: string;\n TYPE: string;\n}\n\ninterface ConstructorParams {\n context: FileManagerContext;\n}\n\ninterface QueryAllOptionsParams {\n where: FileManagerFilesStorageOperationsListParamsWhere;\n}\n\ninterface CreatePartitionKeyParams {\n locale: string;\n tenant: string;\n}\n\ninterface CreateSortKeyParams {\n id: string;\n}\n\nexport class FilesStorageOperations implements FileManagerFilesStorageOperations {\n private readonly _context: FileManagerContext;\n private readonly table: Table;\n private readonly entity: Entity<any>;\n\n private get context(): FileManagerContext {\n return this._context;\n }\n\n public constructor({ context }: ConstructorParams) {\n this._context = context;\n this.table = defineTable({\n context\n });\n\n this.entity = defineFilesEntity({\n context,\n table: this.table\n });\n }\n\n public async get(params: FileManagerFilesStorageOperationsGetParams): Promise<File | null> {\n const { where } = params;\n const keys = {\n PK: this.createPartitionKey(where),\n SK: this.createSortKey(where)\n };\n try {\n const file = await getEntityItem<File>({\n entity: this.entity,\n keys\n });\n return cleanupItem<File>(this.entity, file);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not fetch requested file.\",\n ex.code || \"GET_FILE_ERROR\",\n {\n error: ex,\n where\n }\n );\n }\n }\n\n public async create(params: FileManagerFilesStorageOperationsCreateParams): Promise<File> {\n const { file } = params;\n\n const keys = {\n PK: this.createPartitionKey(file),\n SK: this.createSortKey(file)\n };\n const item: FileItem = {\n ...file,\n ...keys,\n TYPE: \"fm.file\"\n };\n try {\n await this.entity.put(item);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not create a new file in the DynamoDB.\",\n ex.code || \"CREATE_FILE_ERROR\",\n {\n error: ex,\n item\n }\n );\n }\n\n return file;\n }\n\n public async update(params: FileManagerFilesStorageOperationsUpdateParams): Promise<File> {\n const { file } = params;\n const keys = {\n PK: this.createPartitionKey(file),\n SK: this.createSortKey(file)\n };\n\n const item: FileItem = {\n ...file,\n ...keys,\n TYPE: \"fm.file\"\n };\n try {\n await this.entity.put(item);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not update a file in the DynamoDB.\",\n ex.code || \"UPDATE_FILE_ERROR\",\n {\n error: ex,\n item\n }\n );\n }\n return file;\n }\n\n public async delete(params: FileManagerFilesStorageOperationsDeleteParams): Promise<void> {\n const { file } = params;\n const keys = {\n PK: this.createPartitionKey(file),\n SK: this.createSortKey(file)\n };\n\n try {\n await this.entity.delete(keys);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not delete file from the DynamoDB.\",\n ex.code || \"DELETE_FILE_ERROR\",\n {\n error: ex,\n file,\n keys\n }\n );\n }\n }\n\n public async createBatch(\n params: FileManagerFilesStorageOperationsCreateBatchParams\n ): Promise<File[]> {\n const { files } = params;\n\n const items = files.map(file => {\n return this.entity.putBatch({\n ...file,\n PK: this.createPartitionKey(file),\n SK: this.createSortKey(file),\n TYPE: \"fm.file\"\n });\n });\n\n try {\n await batchWriteAll({\n table: this.entity.table,\n items\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not batch insert a list of files.\",\n ex.code || \"BATCH_CREATE_FILES_ERROR\",\n {\n error: ex,\n files\n }\n );\n }\n return files;\n }\n\n public async list(\n params: FileManagerFilesStorageOperationsListParams\n ): Promise<FileManagerFilesStorageOperationsListResponse> {\n const { where: initialWhere, limit, after, sort } = params;\n\n const options = this.createQueryAllOptions({\n where: initialWhere\n });\n const queryAllParams = {\n entity: this.entity,\n partitionKey: this.createPartitionKey(initialWhere),\n options\n };\n let items = [];\n try {\n items = await queryAll<File>(queryAllParams);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not query for the files.\",\n ex.code || \"FILE_LIST_ERROR\",\n {\n error: ex,\n where: initialWhere,\n limit,\n after,\n sort,\n queryParams: {\n options,\n partitionKey: queryAllParams.partitionKey,\n entity: queryAllParams.entity.name,\n table: queryAllParams.entity.table.name\n }\n }\n );\n }\n\n const where: Partial<FileManagerFilesStorageOperationsListParamsWhere> & {\n contains?: { fields: string[]; value: string };\n } = {\n ...initialWhere\n };\n if (where.search) {\n where.contains = {\n fields: [\"name\", \"tags\"],\n value: where.search\n };\n }\n delete where[\"tenant\"];\n delete where[\"locale\"];\n delete where[\"search\"];\n\n const fields = this.context.plugins.byType<FileDynamoDbFieldPlugin>(\n FileDynamoDbFieldPlugin.type\n );\n /**\n * Filter the read items via the code.\n * It will build the filters out of the where input and transform the values it is using.\n */\n const filteredFiles = filterItems({\n plugins: this.context.plugins,\n items,\n where,\n fields\n });\n\n const totalCount = filteredFiles.length;\n /**\n * Sorting is also done via the code.\n * It takes the sort input and sorts by it via the lodash sortBy method.\n */\n const sortedFiles = sortItems({\n items: filteredFiles,\n sort,\n fields\n });\n\n const start = parseInt(decodeCursor(after) || \"0\") || 0;\n const hasMoreItems = totalCount > start + limit;\n const end = limit > totalCount + start + limit ? undefined : start + limit;\n const files = sortedFiles.slice(start, end);\n /**\n * Although we do not need a cursor here, we will use it as such to keep it standardized.\n * Number is simply encoded.\n */\n const cursor = files.length > 0 ? encodeCursor(start + limit) : null;\n\n const meta = {\n hasMoreItems,\n totalCount: totalCount,\n cursor\n };\n\n return [files, meta];\n }\n\n public async tags(\n params: FileManagerFilesStorageOperationsTagsParams\n ): Promise<FileManagerFilesStorageOperationsTagsResponse> {\n const { where: initialWhere } = params;\n\n const queryAllParams = {\n entity: this.entity,\n partitionKey: this.createPartitionKey(initialWhere),\n options: {\n gte: \" \",\n reverse: false\n }\n };\n let results = [];\n try {\n results = await queryAll<File>(queryAllParams);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Error in the DynamoDB query.\",\n ex.code || \"DYNAMODB_ERROR\",\n {\n error: ex,\n query: queryAllParams\n }\n );\n }\n\n const fields = this.context.plugins.byType<FileDynamoDbFieldPlugin>(\n FileDynamoDbFieldPlugin.type\n );\n\n const where: Partial<FileManagerFilesStorageOperationsTagsParamsWhere> = {\n ...initialWhere\n };\n\n delete where[\"tenant\"];\n delete where[\"locale\"];\n\n /**\n * Filter the read items via the code.\n * It will build the filters out of the where input and transform the values it is using.\n */\n const filteredItems = filterItems({\n plugins: this.context.plugins,\n items: results,\n where,\n fields\n });\n\n /**\n * Aggregate all the tags from all the filtered items.\n */\n const tagsObject = filteredItems.reduce((collection, item) => {\n const tags = Array.isArray(item.tags) ? item.tags : [];\n for (const tag of tags) {\n if (!collection[tag]) {\n collection[tag] = [];\n }\n collection[tag].push(item.id);\n }\n return collection;\n }, {} as Record<string, string[]>);\n\n const tags: string[] = Object.keys(tagsObject);\n\n const hasMoreItems = false;\n const totalCount = tags.length;\n\n const meta: FileManagerFilesStorageOperationsListResponseMeta = {\n hasMoreItems,\n totalCount,\n cursor: null\n };\n\n return [tags, meta];\n }\n\n private createQueryAllOptions({ where }: QueryAllOptionsParams): DynamoDBToolboxQueryOptions {\n const options: DynamoDBToolboxQueryOptions = {};\n if (where.id) {\n options.eq = where.id;\n }\n return options;\n }\n\n private createPartitionKey(params: CreatePartitionKeyParams): string {\n const { tenant, locale } = params;\n return `T#${tenant}#L#${locale}#FM#F`;\n }\n\n private createSortKey(params: CreateSortKeyParams) {\n const { id } = params;\n\n return id;\n }\n}\n"],"mappings":";;;;;;;;;AAkBA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAyBO,MAAMA,sBAAsB,CAA8C;EAK7E,IAAYC,OAAO,GAAuB;IACtC,OAAO,IAAI,CAACC,QAAQ;EACxB;EAEOC,WAAW,CAAC;IAAEF;EAA2B,CAAC,EAAE;IAAA;IAAA;IAAA;IAC/C,IAAI,CAACC,QAAQ,GAAGD,OAAO;IACvB,IAAI,CAACG,KAAK,GAAG,IAAAC,cAAW,EAAC;MACrBJ;IACJ,CAAC,CAAC;IAEF,IAAI,CAACK,MAAM,GAAG,IAAAC,oBAAiB,EAAC;MAC5BN,OAAO;MACPG,KAAK,EAAE,IAAI,CAACA;IAChB,CAAC,CAAC;EACN;EAEA,MAAaI,GAAG,CAACC,MAAkD,EAAwB;IACvF,MAAM;MAAEC;IAAM,CAAC,GAAGD,MAAM;IACxB,MAAME,IAAI,GAAG;MACTC,EAAE,EAAE,IAAI,CAACC,kBAAkB,CAACH,KAAK,CAAC;MAClCI,EAAE,EAAE,IAAI,CAACC,aAAa,CAACL,KAAK;IAChC,CAAC;IACD,IAAI;MACA,MAAMM,IAAI,GAAG,MAAM,IAAAC,QAAa,EAAO;QACnCX,MAAM,EAAE,IAAI,CAACA,MAAM;QACnBK;MACJ,CAAC,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EAAE;EACb;AACJ;AAAC"}
|
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _FileDynamoDbFieldPlugin = require("../../plugins/FileDynamoDbFieldPlugin");
|
|
9
|
-
|
|
10
8
|
var _default = () => [new _FileDynamoDbFieldPlugin.FileDynamoDbFieldPlugin({
|
|
11
9
|
field: "id"
|
|
12
10
|
}),
|
|
@@ -38,5 +36,4 @@ new _FileDynamoDbFieldPlugin.FileDynamoDbFieldPlugin({
|
|
|
38
36
|
field: "createdOn",
|
|
39
37
|
type: "date"
|
|
40
38
|
})];
|
|
41
|
-
|
|
42
39
|
exports.default = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["FileDynamoDbFieldPlugin","field","path","type"],"sources":["fields.ts"],"sourcesContent":["import { FileDynamoDbFieldPlugin } from \"~/plugins/FileDynamoDbFieldPlugin\";\n\nexport default () => [\n new FileDynamoDbFieldPlugin({\n field: \"id\"\n }),\n /**\n * Path plugin for the field that are ddb map type and the value filtered by is the id property in the object.\n */\n new FileDynamoDbFieldPlugin({\n field: \"createdBy\",\n path: \"createdBy.id\"\n }),\n /**\n * Path plugin for meta field properties.\n */\n new FileDynamoDbFieldPlugin({\n field: \"private\",\n path: \"meta.private\"\n }),\n /**\n * Path plugin for tag field.\n */\n new FileDynamoDbFieldPlugin({\n field: \"tag\",\n path: \"tags\"\n }),\n /**\n * Value transformation for the dateTime field.\n */\n new FileDynamoDbFieldPlugin({\n field: \"createdOn\",\n type: \"date\"\n })\n];\n"],"mappings":";;;;;;AAAA;AAA4E,eAE7D,MAAM,CACjB,IAAIA,gDAAuB,CAAC;EACxBC,KAAK,EAAE;AACX,CAAC,CAAC;AACF;AACJ;AACA;AACI,IAAID,gDAAuB,CAAC;EACxBC,KAAK,EAAE,WAAW;EAClBC,IAAI,EAAE;AACV,CAAC,CAAC;AACF;AACJ;AACA;AACI,IAAIF,gDAAuB,CAAC;EACxBC,KAAK,EAAE,SAAS;EAChBC,IAAI,EAAE;AACV,CAAC,CAAC;AACF;AACJ;AACA;AACI,IAAIF,gDAAuB,CAAC;EACxBC,KAAK,EAAE,KAAK;EACZC,IAAI,EAAE;AACV,CAAC,CAAC;AACF;AACJ;AACA;AACI,IAAIF,gDAAuB,CAAC;EACxBC,KAAK,EAAE,WAAW;EAClBE,IAAI,EAAE;AACV,CAAC,CAAC,CACL;AAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FilesStorageOperationsProviderPlugin,
|
|
1
|
+
import { FilesStorageOperationsProviderPlugin, FilesStorageOperationsProviderPluginParams } from "@webiny/api-file-manager/plugins/definitions/FilesStorageOperationsProviderPlugin";
|
|
2
2
|
import { FilesStorageOperations } from "./FilesStorageOperations";
|
|
3
3
|
export declare class FilesStorageOperationsProviderDdb extends FilesStorageOperationsProviderPlugin {
|
|
4
4
|
name: string;
|
|
5
|
-
provide({ context }:
|
|
5
|
+
provide({ context }: FilesStorageOperationsProviderPluginParams): Promise<FilesStorageOperations>;
|
|
6
6
|
}
|