@webiny/api-file-manager-ddb 5.34.8 → 5.35.0-beta.0
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/settingsEntity.d.ts +0 -2
- package/definitions/settingsEntity.js +9 -23
- package/definitions/settingsEntity.js.map +1 -1
- package/definitions/systemEntity.d.ts +0 -2
- package/definitions/systemEntity.js +2 -13
- package/definitions/systemEntity.js.map +1 -1
- package/definitions/table.d.ts +5 -5
- package/definitions/table.js +14 -13
- package/definitions/table.js.map +1 -1
- package/index.d.ts +9 -5
- package/index.js +52 -11
- package/index.js.map +1 -1
- package/operations/files/FilesStorageOperations.d.ts +12 -8
- package/operations/files/FilesStorageOperations.js +165 -123
- package/operations/files/FilesStorageOperations.js.map +1 -1
- package/operations/files/fields.d.ts +1 -2
- package/operations/files/fields.js +3 -6
- package/operations/files/fields.js.map +1 -1
- package/operations/settings/SettingsStorageOperations.d.ts +7 -8
- package/operations/settings/SettingsStorageOperations.js +36 -61
- package/operations/settings/SettingsStorageOperations.js.map +1 -1
- package/operations/system/SystemStorageOperations.d.ts +5 -6
- package/operations/system/SystemStorageOperations.js +11 -42
- package/operations/system/SystemStorageOperations.js.map +1 -1
- package/operations/utils.js +0 -10
- package/operations/utils.js.map +1 -1
- package/package.json +10 -9
- package/plugins/FileAttributePlugin.js +1 -7
- package/plugins/FileAttributePlugin.js.map +1 -1
- package/plugins/FileDynamoDbFieldPlugin.js +0 -5
- package/plugins/FileDynamoDbFieldPlugin.js.map +1 -1
- package/plugins/SettingsAttributePlugin.js +1 -7
- package/plugins/SettingsAttributePlugin.js.map +1 -1
- package/plugins/SystemAttributePlugin.js +0 -6
- package/plugins/SystemAttributePlugin.js.map +1 -1
- package/plugins/index.d.ts +4 -0
- package/plugins/index.js +49 -0
- package/plugins/index.js.map +1 -0
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Entity, Table } from "dynamodb-toolbox";
|
|
2
|
-
import { FileManagerContext } from "@webiny/api-file-manager/types";
|
|
3
2
|
export interface SettingsEntityParams {
|
|
4
|
-
context: FileManagerContext;
|
|
5
3
|
table: Table;
|
|
6
4
|
}
|
|
7
5
|
declare const _default: (params: SettingsEntityParams) => Entity<any>;
|
|
@@ -1,52 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
-
|
|
12
7
|
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
13
|
-
|
|
14
|
-
var _attributes = require("@webiny/db-dynamodb/utils/attributes");
|
|
15
|
-
|
|
16
8
|
var _default = params => {
|
|
17
9
|
const {
|
|
18
|
-
context,
|
|
19
10
|
table
|
|
20
11
|
} = params;
|
|
21
|
-
const entityName = "Settings";
|
|
22
|
-
const attributes = (0, _attributes.getExtraAttributes)(context, entityName);
|
|
12
|
+
const entityName = "FM.Settings";
|
|
23
13
|
return new _dynamodbToolbox.Entity({
|
|
24
14
|
name: entityName,
|
|
25
15
|
table,
|
|
26
|
-
attributes:
|
|
16
|
+
attributes: {
|
|
27
17
|
PK: {
|
|
28
18
|
partitionKey: true
|
|
29
19
|
},
|
|
30
20
|
SK: {
|
|
31
21
|
sortKey: true
|
|
32
22
|
},
|
|
33
|
-
|
|
23
|
+
GSI1_PK: {
|
|
34
24
|
type: "string"
|
|
35
25
|
},
|
|
36
|
-
|
|
26
|
+
GSI1_SK: {
|
|
37
27
|
type: "string"
|
|
38
28
|
},
|
|
39
|
-
|
|
40
|
-
type: "number"
|
|
41
|
-
},
|
|
42
|
-
uploadMaxFileSize: {
|
|
43
|
-
type: "number"
|
|
44
|
-
},
|
|
45
|
-
srcPrefix: {
|
|
29
|
+
TYPE: {
|
|
46
30
|
type: "string"
|
|
31
|
+
},
|
|
32
|
+
data: {
|
|
33
|
+
type: "map"
|
|
47
34
|
}
|
|
48
|
-
}
|
|
35
|
+
}
|
|
49
36
|
});
|
|
50
37
|
};
|
|
51
|
-
|
|
52
38
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["params","
|
|
1
|
+
{"version":3,"names":["params","table","entityName","Entity","name","attributes","PK","partitionKey","SK","sortKey","GSI1_PK","type","GSI1_SK","TYPE","data"],"sources":["settingsEntity.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb-toolbox\";\n\nexport interface SettingsEntityParams {\n table: Table;\n}\nexport default (params: SettingsEntityParams): Entity<any> => {\n const { table } = params;\n const entityName = \"FM.Settings\";\n return new Entity({\n name: entityName,\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;AAAiD,eAKjCA,MAA4B,IAAkB;EAC1D,MAAM;IAAEC;EAAM,CAAC,GAAGD,MAAM;EACxB,MAAME,UAAU,GAAG,aAAa;EAChC,OAAO,IAAIC,uBAAM,CAAC;IACdC,IAAI,EAAEF,UAAU;IAChBD,KAAK;IACLI,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;AAAA"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Entity, Table } from "dynamodb-toolbox";
|
|
2
|
-
import { FileManagerContext } from "@webiny/api-file-manager/types";
|
|
3
2
|
export interface SystemEntityParams {
|
|
4
|
-
context: FileManagerContext;
|
|
5
3
|
table: Table;
|
|
6
4
|
}
|
|
7
5
|
declare const _default: (params: SystemEntityParams) => Entity<any>;
|
|
@@ -1,29 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
-
|
|
12
7
|
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
13
|
-
|
|
14
|
-
var _attributes = require("@webiny/db-dynamodb/utils/attributes");
|
|
15
|
-
|
|
16
8
|
var _default = params => {
|
|
17
9
|
const {
|
|
18
|
-
context,
|
|
19
10
|
table
|
|
20
11
|
} = params;
|
|
21
12
|
const entityName = "System";
|
|
22
|
-
const attributes = (0, _attributes.getExtraAttributes)(context, entityName);
|
|
23
13
|
return new _dynamodbToolbox.Entity({
|
|
24
14
|
name: entityName,
|
|
25
15
|
table,
|
|
26
|
-
attributes:
|
|
16
|
+
attributes: {
|
|
27
17
|
PK: {
|
|
28
18
|
partitionKey: true
|
|
29
19
|
},
|
|
@@ -36,8 +26,7 @@ var _default = params => {
|
|
|
36
26
|
tenant: {
|
|
37
27
|
type: "string"
|
|
38
28
|
}
|
|
39
|
-
}
|
|
29
|
+
}
|
|
40
30
|
});
|
|
41
31
|
};
|
|
42
|
-
|
|
43
32
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["params","
|
|
1
|
+
{"version":3,"names":["params","table","entityName","Entity","name","attributes","PK","partitionKey","SK","sortKey","version","type","tenant"],"sources":["systemEntity.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb-toolbox\";\n\nexport interface SystemEntityParams {\n table: Table;\n}\nexport default (params: SystemEntityParams): Entity<any> => {\n const { table } = params;\n const entityName = \"System\";\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 }\n });\n};\n"],"mappings":";;;;;;AAAA;AAAiD,eAKjCA,MAA0B,IAAkB;EACxD,MAAM;IAAEC;EAAM,CAAC,GAAGD,MAAM;EACxB,MAAME,UAAU,GAAG,QAAQ;EAC3B,OAAO,IAAIC,uBAAM,CAAC;IACdC,IAAI,EAAEF,UAAU;IAChBD,KAAK;IACLI,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,MAAM,EAAE;QACJD,IAAI,EAAE;MACV;IACJ;EACJ,CAAC,CAAC;AACN,CAAC;AAAA"}
|
package/definitions/table.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { DocumentClient } from "aws-sdk/clients/dynamodb";
|
|
1
2
|
import { Table } from "dynamodb-toolbox";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
export interface CreateTableParams {
|
|
4
|
+
table?: string;
|
|
5
|
+
documentClient: DocumentClient;
|
|
5
6
|
}
|
|
6
|
-
declare const
|
|
7
|
-
export default _default;
|
|
7
|
+
export declare const createTable: ({ table, documentClient }: CreateTableParams) => Table;
|
package/definitions/table.js
CHANGED
|
@@ -3,22 +3,23 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
|
|
6
|
+
exports.createTable = void 0;
|
|
8
7
|
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const {
|
|
14
|
-
context
|
|
15
|
-
} = params;
|
|
8
|
+
const createTable = ({
|
|
9
|
+
table,
|
|
10
|
+
documentClient
|
|
11
|
+
}) => {
|
|
16
12
|
return new _dynamodbToolbox.Table({
|
|
17
|
-
name:
|
|
13
|
+
name: table || String(process.env.DB_TABLE),
|
|
18
14
|
partitionKey: "PK",
|
|
19
15
|
sortKey: "SK",
|
|
20
|
-
DocumentClient:
|
|
16
|
+
DocumentClient: documentClient,
|
|
17
|
+
indexes: {
|
|
18
|
+
GSI1: {
|
|
19
|
+
partitionKey: "GSI1_PK",
|
|
20
|
+
sortKey: "GSI1_SK"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
21
23
|
});
|
|
22
24
|
};
|
|
23
|
-
|
|
24
|
-
exports.default = _default;
|
|
25
|
+
exports.createTable = createTable;
|
package/definitions/table.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["createTable","table","documentClient","Table","name","String","process","env","DB_TABLE","partitionKey","sortKey","DocumentClient","indexes","GSI1"],"sources":["table.ts"],"sourcesContent":["import { DocumentClient } from \"aws-sdk/clients/dynamodb\";\nimport { Table } from \"dynamodb-toolbox\";\n\nexport interface CreateTableParams {\n table?: string;\n documentClient: DocumentClient;\n}\n\nexport const createTable = ({ table, documentClient }: CreateTableParams) => {\n return new Table({\n name: table || String(process.env.DB_TABLE),\n partitionKey: \"PK\",\n sortKey: \"SK\",\n DocumentClient: documentClient,\n indexes: {\n GSI1: {\n partitionKey: \"GSI1_PK\",\n sortKey: \"GSI1_SK\"\n }\n }\n });\n};\n"],"mappings":";;;;;;AACA;AAOO,MAAMA,WAAW,GAAG,CAAC;EAAEC,KAAK;EAAEC;AAAkC,CAAC,KAAK;EACzE,OAAO,IAAIC,sBAAK,CAAC;IACbC,IAAI,EAAEH,KAAK,IAAII,MAAM,CAACC,OAAO,CAACC,GAAG,CAACC,QAAQ,CAAC;IAC3CC,YAAY,EAAE,IAAI;IAClBC,OAAO,EAAE,IAAI;IACbC,cAAc,EAAET,cAAc;IAC9BU,OAAO,EAAE;MACLC,IAAI,EAAE;QACFJ,YAAY,EAAE,SAAS;QACvBC,OAAO,EAAE;MACb;IACJ;EACJ,CAAC,CAAC;AACN,CAAC;AAAC"}
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { DocumentClient } from "aws-sdk/clients/dynamodb";
|
|
2
|
+
import { PluginCollection } from "@webiny/plugins/types";
|
|
3
|
+
import { FileManagerStorageOperations } from "@webiny/api-file-manager/types";
|
|
4
|
+
export interface StorageOperationsConfig {
|
|
5
|
+
documentClient: DocumentClient;
|
|
6
|
+
plugins?: PluginCollection;
|
|
7
|
+
}
|
|
8
|
+
export * from "./plugins";
|
|
9
|
+
export declare const createFileManagerStorageOperations: ({ documentClient, plugins: userPlugins }: StorageOperationsConfig) => FileManagerStorageOperations;
|
package/index.js
CHANGED
|
@@ -1,16 +1,57 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
var _exportNames = {
|
|
8
|
+
createFileManagerStorageOperations: true
|
|
9
|
+
};
|
|
10
|
+
exports.createFileManagerStorageOperations = void 0;
|
|
11
|
+
var _plugins = _interopRequireDefault(require("@webiny/db-dynamodb/plugins"));
|
|
12
|
+
var _plugins2 = require("@webiny/plugins");
|
|
13
|
+
var _FilesStorageOperations = require("./operations/files/FilesStorageOperations");
|
|
14
|
+
var _SettingsStorageOperations = require("./operations/settings/SettingsStorageOperations");
|
|
15
|
+
var _SystemStorageOperations = require("./operations/system/SystemStorageOperations");
|
|
16
|
+
var _fields = require("./operations/files/fields");
|
|
17
|
+
var _plugins3 = require("./plugins");
|
|
18
|
+
Object.keys(_plugins3).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
21
|
+
if (key in exports && exports[key] === _plugins3[key]) return;
|
|
22
|
+
Object.defineProperty(exports, key, {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function () {
|
|
25
|
+
return _plugins3[key];
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
const createFileManagerStorageOperations = ({
|
|
30
|
+
documentClient,
|
|
31
|
+
plugins: userPlugins
|
|
32
|
+
}) => {
|
|
33
|
+
const plugins = new _plugins2.PluginsContainer([(0, _plugins.default)(),
|
|
34
|
+
// Built-in plugins
|
|
35
|
+
...(0, _fields.createFileFieldsPlugins)(),
|
|
36
|
+
// User plugins
|
|
37
|
+
...(userPlugins || [])]);
|
|
38
|
+
return {
|
|
39
|
+
beforeInit: async context => {
|
|
40
|
+
const types = [_plugins3.FileAttributePlugin.type, _plugins3.FileDynamoDbFieldPlugin.type, _plugins3.SettingsAttributePlugin.type, _plugins3.SystemAttributePlugin.type];
|
|
41
|
+
for (const type of types) {
|
|
42
|
+
plugins.mergeByType(context.plugins, type);
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
files: new _FilesStorageOperations.FilesStorageOperations({
|
|
46
|
+
plugins,
|
|
47
|
+
documentClient
|
|
48
|
+
}),
|
|
49
|
+
settings: new _SettingsStorageOperations.SettingsStorageOperations({
|
|
50
|
+
documentClient
|
|
51
|
+
}),
|
|
52
|
+
system: new _SystemStorageOperations.SystemStorageOperations({
|
|
53
|
+
documentClient
|
|
54
|
+
})
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
exports.createFileManagerStorageOperations = createFileManagerStorageOperations;
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["createFileManagerStorageOperations","documentClient","plugins","userPlugins","PluginsContainer","ddbPlugins","createFileFieldsPlugins","beforeInit","context","types","FileAttributePlugin","type","FileDynamoDbFieldPlugin","SettingsAttributePlugin","SystemAttributePlugin","mergeByType","files","FilesStorageOperations","settings","SettingsStorageOperations","system","SystemStorageOperations"],"sources":["index.ts"],"sourcesContent":["import { DocumentClient } from \"aws-sdk/clients/dynamodb\";\nimport ddbPlugins from \"@webiny/db-dynamodb/plugins\";\nimport { PluginsContainer } from \"@webiny/plugins\";\nimport { PluginCollection } from \"@webiny/plugins/types\";\nimport { FileManagerStorageOperations } from \"@webiny/api-file-manager/types\";\nimport { FilesStorageOperations } from \"~/operations/files/FilesStorageOperations\";\nimport { SettingsStorageOperations } from \"~/operations/settings/SettingsStorageOperations\";\nimport { SystemStorageOperations } from \"~/operations/system/SystemStorageOperations\";\nimport { createFileFieldsPlugins } from \"~/operations/files/fields\";\nimport {\n FileAttributePlugin,\n FileDynamoDbFieldPlugin,\n SettingsAttributePlugin,\n SystemAttributePlugin\n} from \"./plugins\";\n\nexport interface StorageOperationsConfig {\n documentClient: DocumentClient;\n plugins?: PluginCollection;\n}\n\nexport * from \"./plugins\";\n\nexport const createFileManagerStorageOperations = ({\n documentClient,\n plugins: userPlugins\n}: StorageOperationsConfig): FileManagerStorageOperations => {\n const plugins = new PluginsContainer([\n ddbPlugins(),\n // Built-in plugins\n ...createFileFieldsPlugins(),\n // User plugins\n ...(userPlugins || [])\n ]);\n\n return {\n beforeInit: async context => {\n const types: string[] = [\n FileAttributePlugin.type,\n FileDynamoDbFieldPlugin.type,\n SettingsAttributePlugin.type,\n SystemAttributePlugin.type\n ];\n for (const type of types) {\n plugins.mergeByType(context.plugins, type);\n }\n },\n files: new FilesStorageOperations({ plugins, documentClient }),\n settings: new SettingsStorageOperations({ documentClient }),\n system: new SystemStorageOperations({ documentClient })\n };\n};\n"],"mappings":";;;;;;;;;;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AAYA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AAEO,MAAMA,kCAAkC,GAAG,CAAC;EAC/CC,cAAc;EACdC,OAAO,EAAEC;AACY,CAAC,KAAmC;EACzD,MAAMD,OAAO,GAAG,IAAIE,0BAAgB,CAAC,CACjC,IAAAC,gBAAU,GAAE;EACZ;EACA,GAAG,IAAAC,+BAAuB,GAAE;EAC5B;EACA,IAAIH,WAAW,IAAI,EAAE,CAAC,CACzB,CAAC;EAEF,OAAO;IACHI,UAAU,EAAE,MAAMC,OAAO,IAAI;MACzB,MAAMC,KAAe,GAAG,CACpBC,6BAAmB,CAACC,IAAI,EACxBC,iCAAuB,CAACD,IAAI,EAC5BE,iCAAuB,CAACF,IAAI,EAC5BG,+BAAqB,CAACH,IAAI,CAC7B;MACD,KAAK,MAAMA,IAAI,IAAIF,KAAK,EAAE;QACtBP,OAAO,CAACa,WAAW,CAACP,OAAO,CAACN,OAAO,EAAES,IAAI,CAAC;MAC9C;IACJ,CAAC;IACDK,KAAK,EAAE,IAAIC,8CAAsB,CAAC;MAAEf,OAAO;MAAED;IAAe,CAAC,CAAC;IAC9DiB,QAAQ,EAAE,IAAIC,oDAAyB,CAAC;MAAElB;IAAe,CAAC,CAAC;IAC3DmB,MAAM,EAAE,IAAIC,gDAAuB,CAAC;MAAEpB;IAAe,CAAC;EAC1D,CAAC;AACL,CAAC;AAAC"}
|
|
@@ -1,22 +1,26 @@
|
|
|
1
|
-
import { File,
|
|
1
|
+
import { File, FileManagerFilesStorageOperations, FileManagerFilesStorageOperationsCreateBatchParams, FileManagerFilesStorageOperationsCreateParams, FileManagerFilesStorageOperationsDeleteParams, FileManagerFilesStorageOperationsGetParams, FileManagerFilesStorageOperationsListParams, FileManagerFilesStorageOperationsListResponse, FileManagerFilesStorageOperationsTagsParams, FileManagerFilesStorageOperationsTagsResponse, FileManagerFilesStorageOperationsUpdateParams } from "@webiny/api-file-manager/types";
|
|
2
|
+
import { DocumentClient } from "aws-sdk/clients/dynamodb";
|
|
3
|
+
import { PluginsContainer } from "@webiny/plugins";
|
|
2
4
|
interface ConstructorParams {
|
|
3
|
-
|
|
5
|
+
documentClient: DocumentClient;
|
|
6
|
+
plugins: PluginsContainer;
|
|
4
7
|
}
|
|
5
8
|
export declare class FilesStorageOperations implements FileManagerFilesStorageOperations {
|
|
6
|
-
private readonly
|
|
9
|
+
private readonly plugins;
|
|
7
10
|
private readonly table;
|
|
8
|
-
private readonly
|
|
9
|
-
private
|
|
10
|
-
constructor({
|
|
11
|
+
private readonly fileEntity;
|
|
12
|
+
private readonly aliasEntity;
|
|
13
|
+
constructor({ documentClient, plugins }: ConstructorParams);
|
|
11
14
|
get(params: FileManagerFilesStorageOperationsGetParams): Promise<File | null>;
|
|
12
15
|
create(params: FileManagerFilesStorageOperationsCreateParams): Promise<File>;
|
|
13
16
|
update(params: FileManagerFilesStorageOperationsUpdateParams): Promise<File>;
|
|
14
17
|
delete(params: FileManagerFilesStorageOperationsDeleteParams): Promise<void>;
|
|
15
18
|
createBatch(params: FileManagerFilesStorageOperationsCreateBatchParams): Promise<File[]>;
|
|
16
19
|
list(params: FileManagerFilesStorageOperationsListParams): Promise<FileManagerFilesStorageOperationsListResponse>;
|
|
17
|
-
tags(params: FileManagerFilesStorageOperationsTagsParams): Promise<FileManagerFilesStorageOperationsTagsResponse>;
|
|
20
|
+
tags(params: FileManagerFilesStorageOperationsTagsParams): Promise<FileManagerFilesStorageOperationsTagsResponse[]>;
|
|
18
21
|
private createQueryAllOptions;
|
|
19
22
|
private createPartitionKey;
|
|
20
|
-
private
|
|
23
|
+
private createGSI1PartitionKey;
|
|
24
|
+
private createNewAliasesRecords;
|
|
21
25
|
}
|
|
22
26
|
export {};
|