@webiny/api-file-manager-ddb 5.17.4 → 5.18.0-beta.3
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.js +1 -2
- package/definitions/settingsEntity.js +1 -2
- package/definitions/systemEntity.js +1 -2
- package/definitions/table.js +1 -2
- package/index.js +1 -2
- package/operations/configurations.js +1 -2
- package/operations/files/FilesStorageOperations.d.ts +9 -15
- package/operations/files/FilesStorageOperations.js +116 -135
- package/operations/files/fields.js +1 -2
- package/operations/files/index.js +1 -2
- package/operations/settings/SettingsStorageOperations.js +1 -2
- package/operations/settings/index.js +1 -2
- package/operations/system/SystemStorageOperations.js +1 -2
- package/operations/system/index.js +1 -2
- package/operations/utils.js +1 -2
- package/package.json +9 -11
- package/plugins/FileAttributePlugin.js +1 -2
- package/plugins/FileDynamoDbFieldPlugin.js +1 -2
- package/plugins/SettingsAttributePlugin.js +1 -2
- package/plugins/SystemAttributePlugin.js +1 -2
- package/types.js +1 -2
- package/definitions/filesEntity.js.map +0 -1
- package/definitions/settingsEntity.js.map +0 -1
- package/definitions/systemEntity.js.map +0 -1
- package/definitions/table.js.map +0 -1
- package/index.js.map +0 -1
- package/operations/configurations.js.map +0 -1
- package/operations/files/FilesStorageOperations.js.map +0 -1
- package/operations/files/fields.js.map +0 -1
- package/operations/files/index.js.map +0 -1
- package/operations/settings/SettingsStorageOperations.js.map +0 -1
- package/operations/settings/index.js.map +0 -1
- package/operations/system/SystemStorageOperations.js.map +0 -1
- package/operations/system/index.js.map +0 -1
- package/operations/utils.js.map +0 -1
- package/plugins/FileAttributePlugin.js.map +0 -1
- package/plugins/FileDynamoDbFieldPlugin.js.map +0 -1
- package/plugins/SettingsAttributePlugin.js.map +0 -1
- package/plugins/SystemAttributePlugin.js.map +0 -1
- package/types.js.map +0 -1
package/definitions/table.js
CHANGED
package/index.js
CHANGED
|
@@ -13,5 +13,4 @@ var _system = require("./operations/system");
|
|
|
13
13
|
|
|
14
14
|
var _default = () => [new _files.FilesStorageOperationsProviderDdb(), new _settings.SettingsStorageOperationsProviderDdbPlugin(), new _system.SystemStorageOperationsProviderDdbPlugin()];
|
|
15
15
|
|
|
16
|
-
exports.default = _default;
|
|
17
|
-
//# sourceMappingURL=index.js.map
|
|
16
|
+
exports.default = _default;
|
|
@@ -1,28 +1,22 @@
|
|
|
1
|
-
import { File, FileManagerContext, FileManagerFilesStorageOperations, FileManagerFilesStorageOperationsCreateParams, FileManagerFilesStorageOperationsListParams, FileManagerFilesStorageOperationsListResponse, FileManagerFilesStorageOperationsTagsParams, FileManagerFilesStorageOperationsTagsResponse, FileManagerFilesStorageOperationsUpdateParams } from "@webiny/api-file-manager/types";
|
|
1
|
+
import { File, FileManagerContext, FileManagerFilesStorageOperations, FileManagerFilesStorageOperationsCreateBatchParams, FileManagerFilesStorageOperationsCreateParams, FileManagerFilesStorageOperationsDeleteParams, FileManagerFilesStorageOperationsGetParams, FileManagerFilesStorageOperationsListParams, FileManagerFilesStorageOperationsListResponse, FileManagerFilesStorageOperationsTagsParams, FileManagerFilesStorageOperationsTagsResponse, FileManagerFilesStorageOperationsUpdateParams } from "@webiny/api-file-manager/types";
|
|
2
2
|
interface ConstructorParams {
|
|
3
3
|
context: FileManagerContext;
|
|
4
4
|
}
|
|
5
5
|
export declare class FilesStorageOperations implements FileManagerFilesStorageOperations {
|
|
6
6
|
private readonly _context;
|
|
7
|
-
private readonly
|
|
8
|
-
private readonly
|
|
7
|
+
private readonly table;
|
|
8
|
+
private readonly entity;
|
|
9
9
|
private get context();
|
|
10
|
-
private get partitionKey();
|
|
11
10
|
constructor({ context }: ConstructorParams);
|
|
12
|
-
get(
|
|
11
|
+
get(params: FileManagerFilesStorageOperationsGetParams): Promise<File | null>;
|
|
13
12
|
create(params: FileManagerFilesStorageOperationsCreateParams): Promise<File>;
|
|
14
|
-
update(
|
|
15
|
-
delete(
|
|
16
|
-
createBatch(
|
|
17
|
-
files: any;
|
|
18
|
-
}): Promise<File[]>;
|
|
13
|
+
update(params: FileManagerFilesStorageOperationsUpdateParams): Promise<File>;
|
|
14
|
+
delete(params: FileManagerFilesStorageOperationsDeleteParams): Promise<void>;
|
|
15
|
+
createBatch(params: FileManagerFilesStorageOperationsCreateBatchParams): Promise<File[]>;
|
|
19
16
|
list(params: FileManagerFilesStorageOperationsListParams): Promise<FileManagerFilesStorageOperationsListResponse>;
|
|
20
17
|
tags(params: FileManagerFilesStorageOperationsTagsParams): Promise<FileManagerFilesStorageOperationsTagsResponse>;
|
|
21
|
-
/**
|
|
22
|
-
* Create the sort key for the file.
|
|
23
|
-
* Actually those are just some checks.
|
|
24
|
-
*/
|
|
25
|
-
private getSortKey;
|
|
26
18
|
private createQueryAllOptions;
|
|
19
|
+
private createPartitionKey;
|
|
20
|
+
private createSortKey;
|
|
27
21
|
}
|
|
28
22
|
export {};
|
|
@@ -15,10 +15,6 @@ var _table = _interopRequireDefault(require("../../definitions/table"));
|
|
|
15
15
|
|
|
16
16
|
var _filesEntity = _interopRequireDefault(require("../../definitions/filesEntity"));
|
|
17
17
|
|
|
18
|
-
var _lodash = _interopRequireDefault(require("lodash.omit"));
|
|
19
|
-
|
|
20
|
-
var _lodash2 = _interopRequireDefault(require("lodash.chunk"));
|
|
21
|
-
|
|
22
18
|
var _query = require("@webiny/db-dynamodb/utils/query");
|
|
23
19
|
|
|
24
20
|
var _cursor = require("@webiny/db-dynamodb/utils/cursor");
|
|
@@ -29,68 +25,56 @@ var _sort = require("@webiny/db-dynamodb/utils/sort");
|
|
|
29
25
|
|
|
30
26
|
var _FileDynamoDbFieldPlugin = require("../../plugins/FileDynamoDbFieldPlugin");
|
|
31
27
|
|
|
28
|
+
var _batchWrite = require("@webiny/db-dynamodb/utils/batchWrite");
|
|
29
|
+
|
|
30
|
+
var _get = require("@webiny/db-dynamodb/utils/get");
|
|
31
|
+
|
|
32
|
+
var _cleanup = require("@webiny/db-dynamodb/utils/cleanup");
|
|
33
|
+
|
|
32
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; }
|
|
33
35
|
|
|
34
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; }
|
|
35
37
|
|
|
36
|
-
/**
|
|
37
|
-
* This is required due to sometimes file data sent is from the DynamoDB and we want to remove the unnecessary stuff.
|
|
38
|
-
*/
|
|
39
|
-
const cleanStorageFile = file => {
|
|
40
|
-
return (0, _lodash.default)(file, ["PK", "SK", "TYPE", "created", "modified", "entity"]);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
38
|
class FilesStorageOperations {
|
|
44
39
|
get context() {
|
|
45
40
|
return this._context;
|
|
46
41
|
}
|
|
47
42
|
|
|
48
|
-
get partitionKey() {
|
|
49
|
-
const tenant = this.context.tenancy.getCurrentTenant();
|
|
50
|
-
const locale = this.context.i18nContent.getLocale();
|
|
51
|
-
|
|
52
|
-
if (!tenant) {
|
|
53
|
-
throw new _error.default("Tenant missing.", "TENANT_NOT_FOUND");
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
if (!locale) {
|
|
57
|
-
throw new Error("Locale missing.");
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return `T#${tenant.id}#L#${locale.code}#FM#F`;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
43
|
constructor({
|
|
64
44
|
context
|
|
65
45
|
}) {
|
|
66
46
|
(0, _defineProperty2.default)(this, "_context", void 0);
|
|
67
|
-
(0, _defineProperty2.default)(this, "
|
|
68
|
-
(0, _defineProperty2.default)(this, "
|
|
47
|
+
(0, _defineProperty2.default)(this, "table", void 0);
|
|
48
|
+
(0, _defineProperty2.default)(this, "entity", void 0);
|
|
69
49
|
this._context = context;
|
|
70
|
-
this.
|
|
50
|
+
this.table = (0, _table.default)({
|
|
71
51
|
context
|
|
72
52
|
});
|
|
73
|
-
this.
|
|
53
|
+
this.entity = (0, _filesEntity.default)({
|
|
74
54
|
context,
|
|
75
|
-
table: this.
|
|
55
|
+
table: this.table
|
|
76
56
|
});
|
|
77
57
|
}
|
|
78
58
|
|
|
79
|
-
async get(
|
|
59
|
+
async get(params) {
|
|
60
|
+
const {
|
|
61
|
+
where
|
|
62
|
+
} = params;
|
|
63
|
+
const keys = {
|
|
64
|
+
PK: this.createPartitionKey(where),
|
|
65
|
+
SK: this.createSortKey(where)
|
|
66
|
+
};
|
|
67
|
+
|
|
80
68
|
try {
|
|
81
|
-
const file = await
|
|
82
|
-
|
|
83
|
-
|
|
69
|
+
const file = await (0, _get.get)({
|
|
70
|
+
entity: this.entity,
|
|
71
|
+
keys
|
|
84
72
|
});
|
|
85
|
-
|
|
86
|
-
if (!file || !file.Item) {
|
|
87
|
-
return null;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return cleanStorageFile(file.Item);
|
|
73
|
+
return (0, _cleanup.cleanupItem)(this.entity, file);
|
|
91
74
|
} catch (ex) {
|
|
92
75
|
throw new _error.default(ex.message || "Could not fetch requested file.", ex.code || "GET_FILE_ERROR", {
|
|
93
|
-
|
|
76
|
+
error: ex,
|
|
77
|
+
where
|
|
94
78
|
});
|
|
95
79
|
}
|
|
96
80
|
}
|
|
@@ -100,18 +84,19 @@ class FilesStorageOperations {
|
|
|
100
84
|
file
|
|
101
85
|
} = params;
|
|
102
86
|
const keys = {
|
|
103
|
-
PK: this.
|
|
104
|
-
SK: this.
|
|
87
|
+
PK: this.createPartitionKey(file),
|
|
88
|
+
SK: this.createSortKey(file)
|
|
105
89
|
};
|
|
106
90
|
|
|
107
|
-
const item = _objectSpread(_objectSpread({}, keys), {}, {
|
|
91
|
+
const item = _objectSpread(_objectSpread(_objectSpread({}, file), keys), {}, {
|
|
108
92
|
TYPE: "fm.file"
|
|
109
|
-
}
|
|
93
|
+
});
|
|
110
94
|
|
|
111
95
|
try {
|
|
112
|
-
await this.
|
|
96
|
+
await this.entity.put(item);
|
|
113
97
|
} catch (ex) {
|
|
114
98
|
throw new _error.default(ex.message || "Could not create a new file in the DynamoDB.", ex.code || "CREATE_FILE_ERROR", {
|
|
99
|
+
error: ex,
|
|
115
100
|
item
|
|
116
101
|
});
|
|
117
102
|
}
|
|
@@ -119,22 +104,24 @@ class FilesStorageOperations {
|
|
|
119
104
|
return file;
|
|
120
105
|
}
|
|
121
106
|
|
|
122
|
-
async update({
|
|
123
|
-
|
|
124
|
-
|
|
107
|
+
async update(params) {
|
|
108
|
+
const {
|
|
109
|
+
file
|
|
110
|
+
} = params;
|
|
125
111
|
const keys = {
|
|
126
|
-
PK: this.
|
|
127
|
-
SK: this.
|
|
112
|
+
PK: this.createPartitionKey(file),
|
|
113
|
+
SK: this.createSortKey(file)
|
|
128
114
|
};
|
|
129
115
|
|
|
130
|
-
const item = _objectSpread(_objectSpread({}, keys), {}, {
|
|
116
|
+
const item = _objectSpread(_objectSpread(_objectSpread({}, file), keys), {}, {
|
|
131
117
|
TYPE: "fm.file"
|
|
132
|
-
}
|
|
118
|
+
});
|
|
133
119
|
|
|
134
120
|
try {
|
|
135
|
-
await this.
|
|
121
|
+
await this.entity.put(item);
|
|
136
122
|
} catch (ex) {
|
|
137
123
|
throw new _error.default(ex.message || "Could not update a file in the DynamoDB.", ex.code || "UPDATE_FILE_ERROR", {
|
|
124
|
+
error: ex,
|
|
138
125
|
item
|
|
139
126
|
});
|
|
140
127
|
}
|
|
@@ -142,48 +129,48 @@ class FilesStorageOperations {
|
|
|
142
129
|
return file;
|
|
143
130
|
}
|
|
144
131
|
|
|
145
|
-
async delete(
|
|
132
|
+
async delete(params) {
|
|
133
|
+
const {
|
|
134
|
+
file
|
|
135
|
+
} = params;
|
|
146
136
|
const keys = {
|
|
147
|
-
PK: this.
|
|
148
|
-
SK: this.
|
|
137
|
+
PK: this.createPartitionKey(file),
|
|
138
|
+
SK: this.createSortKey(file)
|
|
149
139
|
};
|
|
150
140
|
|
|
151
141
|
try {
|
|
152
|
-
await this.
|
|
142
|
+
await this.entity.delete(keys);
|
|
153
143
|
} catch (ex) {
|
|
154
144
|
throw new _error.default(ex.message || "Could not delete file from the DynamoDB.", ex.code || "DELETE_FILE_ERROR", {
|
|
155
|
-
|
|
145
|
+
error: ex,
|
|
146
|
+
file,
|
|
156
147
|
keys
|
|
157
148
|
});
|
|
158
149
|
}
|
|
159
150
|
}
|
|
160
151
|
|
|
161
|
-
async createBatch({
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
SK: this.getSortKey(file.id)
|
|
173
|
-
};
|
|
174
|
-
batches.push(this._entity.putBatch(_objectSpread(_objectSpread({}, keys), {}, {
|
|
175
|
-
TYPE: "fm.file"
|
|
176
|
-
}, file)));
|
|
177
|
-
}
|
|
152
|
+
async createBatch(params) {
|
|
153
|
+
const {
|
|
154
|
+
files
|
|
155
|
+
} = params;
|
|
156
|
+
const items = files.map(file => {
|
|
157
|
+
return this.entity.putBatch(_objectSpread(_objectSpread({}, file), {}, {
|
|
158
|
+
PK: this.createPartitionKey(file),
|
|
159
|
+
SK: this.createSortKey(file),
|
|
160
|
+
TYPE: "fm.file"
|
|
161
|
+
}));
|
|
162
|
+
});
|
|
178
163
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
164
|
+
try {
|
|
165
|
+
await (0, _batchWrite.batchWriteAll)({
|
|
166
|
+
table: this.entity.table,
|
|
167
|
+
items
|
|
168
|
+
});
|
|
169
|
+
} catch (ex) {
|
|
170
|
+
throw new _error.default(ex.message || "Could not batch insert a list of files.", ex.code || "BATCH_CREATE_FILES_ERROR", {
|
|
171
|
+
error: ex,
|
|
172
|
+
files
|
|
173
|
+
});
|
|
187
174
|
}
|
|
188
175
|
|
|
189
176
|
return files;
|
|
@@ -191,17 +178,17 @@ class FilesStorageOperations {
|
|
|
191
178
|
|
|
192
179
|
async list(params) {
|
|
193
180
|
const {
|
|
194
|
-
where,
|
|
181
|
+
where: initialWhere,
|
|
195
182
|
limit,
|
|
196
183
|
after,
|
|
197
184
|
sort
|
|
198
185
|
} = params;
|
|
199
186
|
const options = this.createQueryAllOptions({
|
|
200
|
-
where
|
|
187
|
+
where: initialWhere
|
|
201
188
|
});
|
|
202
189
|
const queryAllParams = {
|
|
203
|
-
entity: this.
|
|
204
|
-
partitionKey: this.
|
|
190
|
+
entity: this.entity,
|
|
191
|
+
partitionKey: this.createPartitionKey(initialWhere),
|
|
205
192
|
options
|
|
206
193
|
};
|
|
207
194
|
let items = [];
|
|
@@ -210,7 +197,8 @@ class FilesStorageOperations {
|
|
|
210
197
|
items = await (0, _query.queryAll)(queryAllParams);
|
|
211
198
|
} catch (ex) {
|
|
212
199
|
throw new _error.default(ex.message || "Could not query for the files.", ex.code || "FILE_LIST_ERROR", {
|
|
213
|
-
|
|
200
|
+
error: ex,
|
|
201
|
+
where: initialWhere,
|
|
214
202
|
limit,
|
|
215
203
|
after,
|
|
216
204
|
sort,
|
|
@@ -223,6 +211,18 @@ class FilesStorageOperations {
|
|
|
223
211
|
});
|
|
224
212
|
}
|
|
225
213
|
|
|
214
|
+
const where = _objectSpread({}, initialWhere);
|
|
215
|
+
|
|
216
|
+
if (where.search) {
|
|
217
|
+
where.contains = {
|
|
218
|
+
fields: ["name", "tags"],
|
|
219
|
+
value: where.search
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
delete where["tenant"];
|
|
224
|
+
delete where["locale"];
|
|
225
|
+
delete where["search"];
|
|
226
226
|
const fields = this.context.plugins.byType(_FileDynamoDbFieldPlugin.FileDynamoDbFieldPlugin.type);
|
|
227
227
|
/**
|
|
228
228
|
* Filter the read items via the code.
|
|
@@ -268,39 +268,21 @@ class FilesStorageOperations {
|
|
|
268
268
|
const {
|
|
269
269
|
where
|
|
270
270
|
} = params;
|
|
271
|
-
const filters = [];
|
|
272
|
-
|
|
273
|
-
if (where.locale) {
|
|
274
|
-
filters.push({
|
|
275
|
-
attr: "locale",
|
|
276
|
-
eq: where.locale
|
|
277
|
-
});
|
|
278
|
-
delete where.locale;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
if (where.tenant) {
|
|
282
|
-
filters.push({
|
|
283
|
-
attr: "tenant",
|
|
284
|
-
eq: where.tenant
|
|
285
|
-
});
|
|
286
|
-
delete where.tenant;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
const options = {
|
|
290
|
-
filters,
|
|
291
|
-
reverse: false
|
|
292
|
-
};
|
|
293
|
-
let items = [];
|
|
294
271
|
const queryAllParams = {
|
|
295
|
-
entity: this.
|
|
296
|
-
partitionKey: this.
|
|
297
|
-
options
|
|
272
|
+
entity: this.entity,
|
|
273
|
+
partitionKey: this.createPartitionKey(where),
|
|
274
|
+
options: {
|
|
275
|
+
gte: " ",
|
|
276
|
+
reverse: false
|
|
277
|
+
}
|
|
298
278
|
};
|
|
279
|
+
let results = [];
|
|
299
280
|
|
|
300
281
|
try {
|
|
301
|
-
|
|
282
|
+
results = await (0, _query.queryAll)(queryAllParams);
|
|
302
283
|
} catch (ex) {
|
|
303
284
|
throw new _error.default(ex.message || "Error in the DynamoDB query.", ex.code || "DYNAMODB_ERROR", {
|
|
285
|
+
error: ex,
|
|
304
286
|
query: queryAllParams
|
|
305
287
|
});
|
|
306
288
|
}
|
|
@@ -309,7 +291,7 @@ class FilesStorageOperations {
|
|
|
309
291
|
*/
|
|
310
292
|
|
|
311
293
|
|
|
312
|
-
const tagsObject =
|
|
294
|
+
const tagsObject = results.reduce((collection, item) => {
|
|
313
295
|
for (const tag of item.tags) {
|
|
314
296
|
if (!collection[tag]) {
|
|
315
297
|
collection[tag] = [];
|
|
@@ -330,21 +312,6 @@ class FilesStorageOperations {
|
|
|
330
312
|
};
|
|
331
313
|
return [tags, meta];
|
|
332
314
|
}
|
|
333
|
-
/**
|
|
334
|
-
* Create the sort key for the file.
|
|
335
|
-
* Actually those are just some checks.
|
|
336
|
-
*/
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
getSortKey(id) {
|
|
340
|
-
if (!id || !id.match(/^([a-zA-Z0-9]+)$/)) {
|
|
341
|
-
throw new _error.default("Could not determine the file sort key.", "FILE_SORT_KEY_ERROR", {
|
|
342
|
-
id
|
|
343
|
-
});
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
return id;
|
|
347
|
-
}
|
|
348
315
|
|
|
349
316
|
createQueryAllOptions({
|
|
350
317
|
where
|
|
@@ -358,7 +325,21 @@ class FilesStorageOperations {
|
|
|
358
325
|
return options;
|
|
359
326
|
}
|
|
360
327
|
|
|
328
|
+
createPartitionKey(params) {
|
|
329
|
+
const {
|
|
330
|
+
tenant,
|
|
331
|
+
locale
|
|
332
|
+
} = params;
|
|
333
|
+
return `T#${tenant}#L#${locale}#FM#F`;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
createSortKey(params) {
|
|
337
|
+
const {
|
|
338
|
+
id
|
|
339
|
+
} = params;
|
|
340
|
+
return id;
|
|
341
|
+
}
|
|
342
|
+
|
|
361
343
|
}
|
|
362
344
|
|
|
363
|
-
exports.FilesStorageOperations = FilesStorageOperations;
|
|
364
|
-
//# sourceMappingURL=FilesStorageOperations.js.map
|
|
345
|
+
exports.FilesStorageOperations = FilesStorageOperations;
|
|
@@ -32,5 +32,4 @@ class FilesStorageOperationsProviderDdb extends _FilesStorageOperationsProviderP
|
|
|
32
32
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
exports.FilesStorageOperationsProviderDdb = FilesStorageOperationsProviderDdb;
|
|
36
|
-
//# sourceMappingURL=index.js.map
|
|
35
|
+
exports.FilesStorageOperationsProviderDdb = FilesStorageOperationsProviderDdb;
|
|
@@ -29,5 +29,4 @@ class SettingsStorageOperationsProviderDdbPlugin extends _SettingsStorageOperati
|
|
|
29
29
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
exports.SettingsStorageOperationsProviderDdbPlugin = SettingsStorageOperationsProviderDdbPlugin;
|
|
33
|
-
//# sourceMappingURL=index.js.map
|
|
32
|
+
exports.SettingsStorageOperationsProviderDdbPlugin = SettingsStorageOperationsProviderDdbPlugin;
|
|
@@ -29,5 +29,4 @@ class SystemStorageOperationsProviderDdbPlugin extends _SystemStorageOperationsP
|
|
|
29
29
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
exports.SystemStorageOperationsProviderDdbPlugin = SystemStorageOperationsProviderDdbPlugin;
|
|
33
|
-
//# sourceMappingURL=index.js.map
|
|
32
|
+
exports.SystemStorageOperationsProviderDdbPlugin = SystemStorageOperationsProviderDdbPlugin;
|
package/operations/utils.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-file-manager-ddb",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.18.0-beta.3",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"@webiny/api-file-manager",
|
|
@@ -22,14 +22,12 @@
|
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@babel/runtime": "7.16.3",
|
|
25
|
-
"@webiny/api-file-manager": "5.
|
|
26
|
-
"@webiny/db-dynamodb": "5.
|
|
27
|
-
"@webiny/error": "5.
|
|
28
|
-
"@webiny/project-utils": "5.
|
|
29
|
-
"aws-sdk": "2.
|
|
30
|
-
"dynamodb-toolbox": "0.3.5"
|
|
31
|
-
"lodash.chunk": "4.2.0",
|
|
32
|
-
"lodash.omit": "4.5.0"
|
|
25
|
+
"@webiny/api-file-manager": "5.18.0-beta.3",
|
|
26
|
+
"@webiny/db-dynamodb": "5.18.0-beta.3",
|
|
27
|
+
"@webiny/error": "5.18.0-beta.3",
|
|
28
|
+
"@webiny/project-utils": "5.18.0-beta.3",
|
|
29
|
+
"aws-sdk": "2.1032.0",
|
|
30
|
+
"dynamodb-toolbox": "0.3.5"
|
|
33
31
|
},
|
|
34
32
|
"devDependencies": {
|
|
35
33
|
"@babel/cli": "^7.5.5",
|
|
@@ -38,7 +36,7 @@
|
|
|
38
36
|
"@babel/plugin-transform-runtime": "^7.5.5",
|
|
39
37
|
"@babel/preset-env": "^7.5.5",
|
|
40
38
|
"@babel/preset-typescript": "^7.0.0",
|
|
41
|
-
"@webiny/cli": "^5.
|
|
39
|
+
"@webiny/cli": "^5.18.0-beta.3",
|
|
42
40
|
"jest": "^26.6.3",
|
|
43
41
|
"jest-dynalite": "^3.2.0",
|
|
44
42
|
"jsonpack": "^1.1.5",
|
|
@@ -65,5 +63,5 @@
|
|
|
65
63
|
]
|
|
66
64
|
}
|
|
67
65
|
},
|
|
68
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "9c86670476a62348ce391b091bf768e425ab6ee9"
|
|
69
67
|
}
|
|
@@ -14,5 +14,4 @@ var _FieldPlugin = require("@webiny/db-dynamodb/plugins/definitions/FieldPlugin"
|
|
|
14
14
|
class FileDynamoDbFieldPlugin extends _FieldPlugin.FieldPlugin {}
|
|
15
15
|
|
|
16
16
|
exports.FileDynamoDbFieldPlugin = FileDynamoDbFieldPlugin;
|
|
17
|
-
(0, _defineProperty2.default)(FileDynamoDbFieldPlugin, "type", "fileManager.dynamodb.field.file");
|
|
18
|
-
//# sourceMappingURL=FileDynamoDbFieldPlugin.js.map
|
|
17
|
+
(0, _defineProperty2.default)(FileDynamoDbFieldPlugin, "type", "fileManager.dynamodb.field.file");
|
package/types.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
//# sourceMappingURL=types.js.map
|
|
1
|
+
"use strict";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/definitions/filesEntity.ts"],"names":["params","context","table","entityName","attributes","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","id","key","size","meta","tags","createdOn","createdBy","tenant","locale","webinyVersion"],"mappings":";;;;;;;;;;;AAAA;;AAEA;;;;;;eAEgBA,MAAD,IAAwE;AACnF,QAAM;AAAEC,IAAAA,OAAF;AAAWC,IAAAA;AAAX,MAAqBF,MAA3B;AACA,QAAMG,UAAU,GAAG,OAAnB;AACA,QAAMC,UAAU,GAAG,oCAAmBH,OAAnB,EAA4BE,UAA5B,CAAnB;AACA,SAAO,IAAIE,uBAAJ,CAAW;AACdC,IAAAA,IAAI,EAAEH,UADQ;AAEdD,IAAAA,KAFc;AAGdE,IAAAA,UAAU;AACNG,MAAAA,EAAE,EAAE;AACAC,QAAAA,YAAY,EAAE;AADd,OADE;AAINC,MAAAA,EAAE,EAAE;AACAC,QAAAA,OAAO,EAAE;AADT,OAJE;AAONC,MAAAA,IAAI,EAAE;AACFC,QAAAA,IAAI,EAAE;AADJ,OAPA;AAUNC,MAAAA,EAAE,EAAE;AACAD,QAAAA,IAAI,EAAE;AADN,OAVE;AAaNE,MAAAA,GAAG,EAAE;AACDF,QAAAA,IAAI,EAAE;AADL,OAbC;AAgBNG,MAAAA,IAAI,EAAE;AACFH,QAAAA,IAAI,EAAE;AADJ,OAhBA;AAmBNA,MAAAA,IAAI,EAAE;AACFA,QAAAA,IAAI,EAAE;AADJ,OAnBA;AAsBNN,MAAAA,IAAI,EAAE;AACFM,QAAAA,IAAI,EAAE;AADJ,OAtBA;AAyBNI,MAAAA,IAAI,EAAE;AACFJ,QAAAA,IAAI,EAAE;AADJ,OAzBA;AA4BNK,MAAAA,IAAI,EAAE;AACFL,QAAAA,IAAI,EAAE;AADJ,OA5BA;AA+BNM,MAAAA,SAAS,EAAE;AACPN,QAAAA,IAAI,EAAE;AADC,OA/BL;AAkCNO,MAAAA,SAAS,EAAE;AACPP,QAAAA,IAAI,EAAE;AADC,OAlCL;AAqCNQ,MAAAA,MAAM,EAAE;AACJR,QAAAA,IAAI,EAAE;AADF,OArCF;AAwCNS,MAAAA,MAAM,EAAE;AACJT,QAAAA,IAAI,EAAE;AADF,OAxCF;AA2CNU,MAAAA,aAAa,EAAE;AACXV,QAAAA,IAAI,EAAE;AADK;AA3CT,OA8CHR,UA9CG;AAHI,GAAX,CAAP;AAoDH,C","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 default (params: { context: FileManagerContext; table: Table }): 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"],"file":"filesEntity.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/definitions/settingsEntity.ts"],"names":["params","context","table","entityName","attributes","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","key","uploadMinFileSize","uploadMaxFileSize","srcPrefix"],"mappings":";;;;;;;;;;;AAAA;;AAEA;;;;;;eAEgBA,MAAD,IAAwE;AACnF,QAAM;AAAEC,IAAAA,OAAF;AAAWC,IAAAA;AAAX,MAAqBF,MAA3B;AACA,QAAMG,UAAU,GAAG,UAAnB;AACA,QAAMC,UAAU,GAAG,oCAAmBH,OAAnB,EAA4BE,UAA5B,CAAnB;AACA,SAAO,IAAIE,uBAAJ,CAAW;AACdC,IAAAA,IAAI,EAAEH,UADQ;AAEdD,IAAAA,KAFc;AAGdE,IAAAA,UAAU;AACNG,MAAAA,EAAE,EAAE;AACAC,QAAAA,YAAY,EAAE;AADd,OADE;AAINC,MAAAA,EAAE,EAAE;AACAC,QAAAA,OAAO,EAAE;AADT,OAJE;AAONC,MAAAA,IAAI,EAAE;AACFC,QAAAA,IAAI,EAAE;AADJ,OAPA;AAUNC,MAAAA,GAAG,EAAE;AACDD,QAAAA,IAAI,EAAE;AADL,OAVC;AAaNE,MAAAA,iBAAiB,EAAE;AACfF,QAAAA,IAAI,EAAE;AADS,OAbb;AAgBNG,MAAAA,iBAAiB,EAAE;AACfH,QAAAA,IAAI,EAAE;AADS,OAhBb;AAmBNI,MAAAA,SAAS,EAAE;AACPJ,QAAAA,IAAI,EAAE;AADC;AAnBL,OAsBHR,UAtBG;AAHI,GAAX,CAAP;AA4BH,C","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 default (params: { context: FileManagerContext; table: Table }): 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"],"file":"settingsEntity.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/definitions/systemEntity.ts"],"names":["params","context","table","entityName","attributes","Entity","name","PK","partitionKey","SK","sortKey","version","type"],"mappings":";;;;;;;;;;;AAAA;;AAEA;;;;;;eAEgBA,MAAD,IAAwE;AACnF,QAAM;AAAEC,IAAAA,OAAF;AAAWC,IAAAA;AAAX,MAAqBF,MAA3B;AACA,QAAMG,UAAU,GAAG,QAAnB;AACA,QAAMC,UAAU,GAAG,oCAAmBH,OAAnB,EAA4BE,UAA5B,CAAnB;AACA,SAAO,IAAIE,uBAAJ,CAAW;AACdC,IAAAA,IAAI,EAAEH,UADQ;AAEdD,IAAAA,KAFc;AAGdE,IAAAA,UAAU;AACNG,MAAAA,EAAE,EAAE;AACAC,QAAAA,YAAY,EAAE;AADd,OADE;AAINC,MAAAA,EAAE,EAAE;AACAC,QAAAA,OAAO,EAAE;AADT,OAJE;AAONC,MAAAA,OAAO,EAAE;AACLC,QAAAA,IAAI,EAAE;AADD;AAPH,OAUHR,UAVG;AAHI,GAAX,CAAP;AAgBH,C","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 default (params: { context: FileManagerContext; table: Table }): 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 ...attributes\n }\n });\n};\n"],"file":"systemEntity.js"}
|
package/definitions/table.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/definitions/table.ts"],"names":["params","context","Table","name","configurations","db","table","partitionKey","sortKey","DocumentClient"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;eAGgBA,MAAD,IAAoD;AAC/D,QAAM;AAAEC,IAAAA;AAAF,MAAcD,MAApB;AACA,SAAO,IAAIE,sBAAJ,CAAU;AACbC,IAAAA,IAAI,EAAEC,wBAAeC,EAAf,GAAoBC,KAApB,IAA6B,qBAASL,OAAT,CADtB;AAEbM,IAAAA,YAAY,EAAE,IAFD;AAGbC,IAAAA,OAAO,EAAE,IAHI;AAIbC,IAAAA,cAAc,EAAE,8BAAkBR,OAAlB;AAJH,GAAV,CAAP;AAMH,C","sourcesContent":["import { Table } from \"dynamodb-toolbox\";\nimport configurations from \"~/operations/configurations\";\nimport { getDocumentClient, getTable } from \"~/operations/utils\";\nimport { FileManagerContext } from \"@webiny/api-file-manager/types\";\n\nexport default (params: { context: FileManagerContext }): Table => {\n const { context } = params;\n return new Table({\n name: configurations.db().table || getTable(context),\n partitionKey: \"PK\",\n sortKey: \"SK\",\n DocumentClient: getDocumentClient(context)\n });\n};\n"],"file":"table.js"}
|
package/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":["FilesStorageOperationsProviderDdb","SettingsStorageOperationsProviderDdbPlugin","SystemStorageOperationsProviderDdbPlugin"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;eAEe,MAAM,CACjB,IAAIA,wCAAJ,EADiB,EAEjB,IAAIC,oDAAJ,EAFiB,EAGjB,IAAIC,gDAAJ,EAHiB,C","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"],"file":"index.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/operations/configurations.ts"],"names":["db","table","process","env","DB_TABLE_FILE_MANGER","DB_TABLE","keys","primary","unique","name","fields"],"mappings":";;;;;;eAAe;AACXA,EAAAA,EAAE,EAAE,OAAO;AACPC,IAAAA,KAAK,EAAEC,OAAO,CAACC,GAAR,CAAYC,oBAAZ,IAAoCF,OAAO,CAACC,GAAR,CAAYE,QADhD;AAEPC,IAAAA,IAAI,EAAE,CACF;AACIC,MAAAA,OAAO,EAAE,IADb;AAEIC,MAAAA,MAAM,EAAE,IAFZ;AAGIC,MAAAA,IAAI,EAAE,SAHV;AAIIC,MAAAA,MAAM,EAAE,CAAC;AAAED,QAAAA,IAAI,EAAE;AAAR,OAAD,EAAiB;AAAEA,QAAAA,IAAI,EAAE;AAAR,OAAjB;AAJZ,KADE;AAFC,GAAP;AADO,C","sourcesContent":["export default {\n db: () => ({\n table: process.env.DB_TABLE_FILE_MANGER || process.env.DB_TABLE,\n keys: [\n {\n primary: true,\n unique: true,\n name: \"primary\",\n fields: [{ name: \"PK\" }, { name: \"SK\" }]\n }\n ]\n })\n};\n"],"file":"configurations.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/operations/files/FilesStorageOperations.ts"],"names":["cleanStorageFile","file","FilesStorageOperations","context","_context","partitionKey","tenant","tenancy","getCurrentTenant","locale","i18nContent","getLocale","WebinyError","Error","id","code","constructor","_table","_entity","table","get","PK","SK","getSortKey","Item","ex","message","create","params","keys","item","TYPE","put","update","delete","createBatch","files","fileChunks","fileChunk","batches","push","putBatch","batchWrite","items","list","where","limit","after","sort","options","createQueryAllOptions","queryAllParams","entity","queryParams","name","fields","plugins","byType","FileDynamoDbFieldPlugin","type","filteredFiles","totalCount","length","sortedFiles","start","hasMoreItems","end","undefined","slice","cursor","meta","tags","filters","attr","eq","reverse","query","tagsObject","reduce","collection","tag","Object","match"],"mappings":";;;;;;;;;;;AAaA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AAEA;;AACA;;AACA;;AACA;;;;;;AAgBA;AACA;AACA;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AAsB;AAClBD,UAAAA,UAAU,CAACC,GAAD,CAAV,GAAkB,EAAlB;AACH;;AACDD,QAAAA,UAAU,CAACC,GAAD,CAAV,CAAgBxC,IAAhB,CAAqBV,IAAI,CAAChB,EAA1B;AACH;;AACD,aAAOiE,UAAP;AACH,KARkB,EAQhB,EARgB,CAAnB;AAUA,UAAMR,IAAc,GAAGU,MAAM,CAACpD,IAAP,CAAYgD,UAAZ,CAAvB;AAEA,UAAMZ,YAAY,GAAG,KAArB;AACA,UAAMJ,UAAU,GAAGU,IAAI,CAACT,MAAxB;AAEA,UAAMQ,IAAI,GAAG;AACTL,MAAAA,YADS;AAETJ,MAAAA,UAFS;AAGTQ,MAAAA,MAAM,EAAE;AAHC,KAAb;AAMA,WAAO,CAACE,IAAD,EAAOD,IAAP,CAAP;AACH;AACD;AACJ;AACA;AACA;;;AACY/C,EAAAA,UAAU,CAACT,EAAD,EAAa;AAC3B,QAAI,CAACA,EAAD,IAAO,CAACA,EAAE,CAACoE,KAAH,CAAS,kBAAT,CAAZ,EAA0C;AACtC,YAAM,IAAItE,cAAJ,CAAgB,wCAAhB,EAA0D,qBAA1D,EAAiF;AACnFE,QAAAA;AADmF,OAAjF,CAAN;AAGH;;AACD,WAAOA,EAAP;AACH;;AAEOoC,EAAAA,qBAAqB,CAAC;AAAEL,IAAAA;AAAF,GAAD,EAAgE;AACzF,UAAMI,OAAoC,GAAG,EAA7C;;AACA,QAAIJ,KAAK,CAAC/B,EAAV,EAAc;AACVmC,MAAAA,OAAO,CAACyB,EAAR,GAAa7B,KAAK,CAAC/B,EAAnB;AACH;;AACD,WAAOmC,OAAP;AACH;;AAvU4E","sourcesContent":["import {\n File,\n FileManagerContext,\n FileManagerFilesStorageOperations,\n FileManagerFilesStorageOperationsCreateParams,\n FileManagerFilesStorageOperationsListParams,\n FileManagerFilesStorageOperationsListParamsWhere,\n FileManagerFilesStorageOperationsListResponse,\n FileManagerFilesStorageOperationsTagsParams,\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 lodashOmit from \"lodash.omit\";\nimport lodashChunk from \"lodash.chunk\";\nimport { queryOptions as DynamoDBToolboxQueryOptions } from \"dynamodb-toolbox/dist/classes/Table\";\nimport { queryAll } from \"@webiny/db-dynamodb/utils/query\";\nimport { FilterExpressions } from \"dynamodb-toolbox/dist/lib/expressionBuilder\";\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\";\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\n/**\n * This is required due to sometimes file data sent is from the DynamoDB and we want to remove the unnecessary stuff.\n */\nconst cleanStorageFile = (file: File & Record<string, any>): File => {\n return lodashOmit(file, [\"PK\", \"SK\", \"TYPE\", \"created\", \"modified\", \"entity\"]);\n};\n\nexport class FilesStorageOperations implements FileManagerFilesStorageOperations {\n private readonly _context: any;\n private readonly _table: Table;\n private readonly _entity: Entity<any>;\n\n private get context(): FileManagerContext {\n return this._context;\n }\n\n private get partitionKey(): string {\n const tenant = this.context.tenancy.getCurrentTenant();\n const locale = this.context.i18nContent.getLocale();\n if (!tenant) {\n throw new WebinyError(\"Tenant missing.\", \"TENANT_NOT_FOUND\");\n }\n if (!locale) {\n throw new Error(\"Locale missing.\");\n }\n return `T#${tenant.id}#L#${locale.code}#FM#F`;\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(id: string): Promise<File | null> {\n try {\n const file = await this._entity.get({\n PK: this.partitionKey,\n SK: this.getSortKey(id)\n });\n if (!file || !file.Item) {\n return null;\n }\n return cleanStorageFile(file.Item);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not fetch requested file.\",\n ex.code || \"GET_FILE_ERROR\",\n {\n id\n }\n );\n }\n }\n\n public async create(params: FileManagerFilesStorageOperationsCreateParams): Promise<File> {\n const { file } = params;\n\n const keys = {\n PK: this.partitionKey,\n SK: this.getSortKey(file.id)\n };\n const item: FileItem = {\n ...keys,\n TYPE: \"fm.file\",\n ...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 item\n }\n );\n }\n\n return file;\n }\n\n public async update({ file }: FileManagerFilesStorageOperationsUpdateParams): Promise<File> {\n const keys = {\n PK: this.partitionKey,\n SK: this.getSortKey(file.id)\n };\n\n const item: FileItem = {\n ...keys,\n TYPE: \"fm.file\",\n ...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 item\n }\n );\n }\n return file;\n }\n\n public async delete(id: string): Promise<void> {\n const keys = {\n PK: this.partitionKey,\n SK: this.getSortKey(id)\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 id,\n keys\n }\n );\n }\n }\n\n public async createBatch({ files }): Promise<File[]> {\n const fileChunks = lodashChunk(files, 25);\n\n for (const fileChunk of fileChunks) {\n const batches = [];\n for (const file of fileChunk) {\n const keys = {\n PK: this.partitionKey,\n SK: this.getSortKey(file.id)\n };\n batches.push(\n this._entity.putBatch({\n ...keys,\n TYPE: \"fm.file\",\n ...file\n })\n );\n }\n try {\n await this._table.batchWrite(batches);\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 files: fileChunk,\n items: batches\n }\n );\n }\n }\n return files;\n }\n\n public async list(\n params: FileManagerFilesStorageOperationsListParams\n ): Promise<FileManagerFilesStorageOperationsListResponse> {\n const { where, limit, after, sort } = params;\n\n const options = this.createQueryAllOptions({\n where\n });\n const queryAllParams = {\n entity: this._entity,\n partitionKey: this.partitionKey,\n options\n };\n let items: FileItem[] = [];\n try {\n items = await queryAll(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 where,\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 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 = decodeCursor(after) || 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 public async tags(\n params: FileManagerFilesStorageOperationsTagsParams\n ): Promise<FileManagerFilesStorageOperationsTagsResponse> {\n const { where } = params;\n\n const filters: FilterExpressions = [];\n if (where.locale) {\n filters.push({\n attr: \"locale\",\n eq: where.locale\n });\n delete where.locale;\n }\n if (where.tenant) {\n filters.push({\n attr: \"tenant\",\n eq: where.tenant\n });\n delete where.tenant;\n }\n\n const options: DynamoDBToolboxQueryOptions = {\n filters,\n reverse: false\n };\n\n let items: FileItem[] = [];\n\n const queryAllParams = {\n entity: this._entity,\n partitionKey: this.partitionKey,\n options\n };\n try {\n items = await queryAll(queryAllParams);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Error in the DynamoDB query.\",\n ex.code || \"DYNAMODB_ERROR\",\n {\n query: queryAllParams\n }\n );\n }\n /**\n * Aggregate all the tags from all the items in the database.\n */\n const tagsObject = items.reduce((collection, item) => {\n for (const tag of item.tags) {\n if (!collection[tag]) {\n collection[tag] = [];\n }\n collection[tag].push(item.id);\n }\n return collection;\n }, {});\n\n const tags: string[] = Object.keys(tagsObject);\n\n const hasMoreItems = false;\n const totalCount = tags.length;\n\n const meta = {\n hasMoreItems,\n totalCount,\n cursor: null\n };\n\n return [tags, meta];\n }\n /**\n * Create the sort key for the file.\n * Actually those are just some checks.\n */\n private getSortKey(id: string) {\n if (!id || !id.match(/^([a-zA-Z0-9]+)$/)) {\n throw new WebinyError(\"Could not determine the file sort key.\", \"FILE_SORT_KEY_ERROR\", {\n id\n });\n }\n return id;\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"],"file":"FilesStorageOperations.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/operations/files/fields.ts"],"names":["FileDynamoDbFieldPlugin","field","path","type"],"mappings":";;;;;;;AAAA;;eAEe,MAAM,CACjB,IAAIA,gDAAJ,CAA4B;AACxBC,EAAAA,KAAK,EAAE;AADiB,CAA5B,CADiB;AAIjB;AACJ;AACA;AACI,IAAID,gDAAJ,CAA4B;AACxBC,EAAAA,KAAK,EAAE,WADiB;AAExBC,EAAAA,IAAI,EAAE;AAFkB,CAA5B,CAPiB;AAWjB;AACJ;AACA;AACI,IAAIF,gDAAJ,CAA4B;AACxBC,EAAAA,KAAK,EAAE,SADiB;AAExBC,EAAAA,IAAI,EAAE;AAFkB,CAA5B,CAdiB;AAkBjB;AACJ;AACA;AACI,IAAIF,gDAAJ,CAA4B;AACxBC,EAAAA,KAAK,EAAE,KADiB;AAExBC,EAAAA,IAAI,EAAE;AAFkB,CAA5B,CArBiB;AAyBjB;AACJ;AACA;AACI,IAAIF,gDAAJ,CAA4B;AACxBC,EAAAA,KAAK,EAAE,WADiB;AAExBE,EAAAA,IAAI,EAAE;AAFkB,CAA5B,CA5BiB,C","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"],"file":"fields.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/operations/files/index.ts"],"names":["FilesStorageOperationsProviderDdb","FilesStorageOperationsProviderPlugin","provide","context","plugins","register","FilesStorageOperations"],"mappings":";;;;;;;;;;;AAAA;;AAIA;;AACA;;AAEO,MAAMA,iCAAN,SAAgDC,0EAAhD,CAAqF;AAAA;AAAA;AAAA,gDAC1E,wCAD0E;AAAA;;AAE3E,QAAPC,OAAO,CAAC;AAAEC,IAAAA;AAAF,GAAD,EAAsB;AAC/BA,IAAAA,OAAO,CAACC,OAAR,CAAgBC,QAAhB,CAAyB,sBAAzB;AACA,WAAO,IAAIC,8CAAJ,CAA2B;AAC9BH,MAAAA;AAD8B,KAA3B,CAAP;AAGH;;AAPuF","sourcesContent":["import {\n FilesStorageOperationsProviderPlugin,\n Params\n} from \"@webiny/api-file-manager/plugins/definitions/FilesStorageOperationsProviderPlugin\";\nimport { FilesStorageOperations } from \"./FilesStorageOperations\";\nimport fields from \"./fields\";\n\nexport class FilesStorageOperationsProviderDdb extends FilesStorageOperationsProviderPlugin {\n public name = \"fm.storageOperationsProvider.files.ddb\";\n async provide({ context }: Params) {\n context.plugins.register(fields());\n return new FilesStorageOperations({\n context\n });\n }\n}\n"],"file":"index.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/operations/settings/SettingsStorageOperations.ts"],"names":["SORT_KEY","SettingsStorageOperations","partitionKey","tenant","_context","tenancy","getCurrentTenant","WebinyError","id","constructor","context","table","_entity","get","settings","PK","SK","Item","ex","message","code","create","data","original","update","put","delete"],"mappings":";;;;;;;;;;;AAQA;;AACA;;AACA;;;;;;AAMA,MAAMA,QAAQ,GAAG,SAAjB;;AAEO,MAAMC,yBAAN,CAAgF;AAI3D,MAAZC,YAAY,GAAW;AAC/B,UAAMC,MAAM,GAAG,KAAKC,QAAL,CAAcC,OAAd,CAAsBC,gBAAtB,EAAf;;AACA,QAAI,CAACH,MAAL,EAAa;AACT,YAAM,IAAII,cAAJ,CAAgB,iBAAhB,EAAmC,kBAAnC,CAAN;AACH;;AACD,WAAQ,KAAIJ,MAAM,CAACK,EAAG,cAAtB;AACH;;AAEMC,EAAAA,WAAW,CAAC;AAAEC,IAAAA;AAAF,GAAD,EAAiC;AAAA;AAAA;AAC/C,SAAKN,QAAL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,CAAN;AAOH;AACJ;;AAEkB,QAANE,MAAM,CAAC;AAChBF,IAAAA;AADgB,GAAD,EAEgE;AAC/E,QAAI;AACA,YAAM,KAAKV,OAAL,CAAaY,MAAb;AACFT,QAAAA,EAAE,EAAE,KAAKb,YADP;AAEFc,QAAAA,EAAE,EAAEhB;AAFF,SAGCsB,IAHD,EAAN;AAKA,aAAOA,IAAP;AACH,KAPD,CAOE,OAAOJ,EAAP,EAAW;AACT,YAAM,IAAIX,cAAJ,CACFW,EAAE,CAACC,OAAH,IAAc,qCADZ,EAEFD,EAAE,CAACE,IAAH,IAAW,0BAFT,EAGF;AACIE,QAAAA;AADJ,OAHE,CAAN;AAOH;AACJ;;AAEkB,QAANI,MAAM,GAAkB;AACjC,WAAO,KAAKd,OAAL,CAAac,MAAb,CAAoB;AACvBX,MAAAA,EAAE,EAAE,KAAKb,YADc;AAEvBc,MAAAA,EAAE,EAAEhB;AAFmB,KAApB,CAAP;AAIH;;AAjGkF","sourcesContent":["import {\n FileManagerContext,\n FileManagerSettings,\n FileManagerSettingsStorageOperations,\n FileManagerSettingsStorageOperationsCreateParams,\n FileManagerSettingsStorageOperationsUpdateParams\n} from \"@webiny/api-file-manager/types\";\nimport { Entity } from \"dynamodb-toolbox\";\nimport WebinyError from \"@webiny/error\";\nimport defineTable from \"~/definitions/table\";\nimport defineSettingsEntity from \"~/definitions/settingsEntity\";\n\ninterface ConstructorParams {\n context: FileManagerContext;\n}\n\nconst SORT_KEY = \"default\";\n\nexport class SettingsStorageOperations implements FileManagerSettingsStorageOperations {\n private readonly _context: FileManagerContext;\n private readonly _entity: Entity<any>;\n\n private get partitionKey(): string {\n const tenant = this._context.tenancy.getCurrentTenant();\n if (!tenant) {\n throw new WebinyError(\"Tenant missing.\", \"TENANT_NOT_FOUND\");\n }\n return `T#${tenant.id}#FM#SETTINGS`;\n }\n\n public constructor({ context }: ConstructorParams) {\n this._context = context;\n const table = defineTable({\n context\n });\n\n this._entity = defineSettingsEntity({\n context,\n table\n });\n }\n\n public async get(): Promise<FileManagerSettings> {\n try {\n const settings = await this._entity.get({\n PK: this.partitionKey,\n SK: SORT_KEY\n });\n if (!settings || !settings.Item) {\n return null;\n }\n return settings.Item;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not fetch the FileManager settings.\",\n ex.code || \"GET_SETTINGS_ERROR\"\n );\n }\n }\n\n public async create({\n data\n }: FileManagerSettingsStorageOperationsCreateParams): Promise<FileManagerSettings> {\n const original = await this.get();\n /**\n * TODO: check if need to throw an error on existing settings\n */\n if (original) {\n return await this.update({ original, data });\n }\n\n try {\n await this._entity.put({\n PK: this.partitionKey,\n SK: SORT_KEY,\n ...data\n });\n return data;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Cannot create FileManager settings.\",\n ex.code || \"CREATE_FM_SETTINGS_ERROR\",\n {\n data\n }\n );\n }\n }\n\n public async update({\n data\n }: FileManagerSettingsStorageOperationsUpdateParams): Promise<FileManagerSettings> {\n try {\n await this._entity.update({\n PK: this.partitionKey,\n SK: SORT_KEY,\n ...data\n });\n return data;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Cannot update FileManager settings.\",\n ex.code || \"UPDATE_FM_SETTINGS_ERROR\",\n {\n data\n }\n );\n }\n }\n\n public async delete(): Promise<void> {\n return this._entity.delete({\n PK: this.partitionKey,\n SK: SORT_KEY\n });\n }\n}\n"],"file":"SettingsStorageOperations.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/operations/settings/index.ts"],"names":["SettingsStorageOperationsProviderDdbPlugin","SettingsStorageOperationsProviderPlugin","provide","context","SettingsStorageOperations"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAEO,MAAMA,0CAAN,SAAyDC,gFAAzD,CAAiG;AAAA;AAAA;AAAA,gDACtF,2CADsF;AAAA;;AAEvF,QAAPC,OAAO,CAAC;AAAEC,IAAAA;AAAF,GAAD,EAAc;AACvB,WAAO,IAAIC,oDAAJ,CAA8B;AACjCD,MAAAA;AADiC,KAA9B,CAAP;AAGH;;AANmG","sourcesContent":["import { SettingsStorageOperations } from \"./SettingsStorageOperations\";\nimport { SettingsStorageOperationsProviderPlugin } from \"@webiny/api-file-manager/plugins/definitions/SettingsStorageOperationsProviderPlugin\";\n\nexport class SettingsStorageOperationsProviderDdbPlugin extends SettingsStorageOperationsProviderPlugin {\n public name = \"fm.storageOperationsProvider.settings.ddb\";\n async provide({ context }) {\n return new SettingsStorageOperations({\n context\n });\n }\n}\n"],"file":"index.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/operations/system/SystemStorageOperations.ts"],"names":["SORT_KEY","SystemStorageOperations","partitionKey","tenant","_context","tenancy","getCurrentTenant","WebinyError","id","constructor","context","table","_entity","get","system","PK","SK","Item","ex","message","code","create","params","data","put","update","original"],"mappings":";;;;;;;;;;;AAQA;;AACA;;AACA;;;;;;AAMA,MAAMA,QAAQ,GAAG,IAAjB;;AAEO,MAAMC,uBAAN,CAA4E;AAIvD,MAAZC,YAAY,GAAW;AAC/B,UAAMC,MAAM,GAAG,KAAKC,QAAL,CAAcC,OAAd,CAAsBC,gBAAtB,EAAf;;AACA,QAAI,CAACH,MAAL,EAAa;AACT,YAAM,IAAII,cAAJ,CAAgB,iBAAhB,EAAmC,kBAAnC,CAAN;AACH;;AACD,WAAQ,KAAIJ,MAAM,CAACK,EAAG,SAAtB;AACH;;AAEMC,EAAAA,WAAW,CAAC;AAAEC,IAAAA;AAAF,GAAD,EAAiC;AAAA;AAAA;AAC/C,SAAKN,QAAL,GAAgBM,OAAhB;AACA,UAAMC,KAAK,GAAG,oBAAY;AACtBD,MAAAA;AADsB,KAAZ,CAAd;AAIA,SAAKE,OAAL,GAAe,2BAAmB;AAC9BF,MAAAA,OAD8B;AAE9BC,MAAAA;AAF8B,KAAnB,CAAf;AAIH;;AAEe,QAAHE,GAAG,GAAsC;AAClD,QAAI;AACA,YAAMC,MAAM,GAAG,MAAM,KAA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em,\n FileManagerSystemStorageOperations,\n FileManagerSystemStorageOperationsCreateParams,\n FileManagerSystemStorageOperationsUpdateParams\n} from \"@webiny/api-file-manager/types\";\nimport { Entity } from \"dynamodb-toolbox\";\nimport WebinyError from \"@webiny/error\";\nimport defineSystemEntity from \"~/definitions/systemEntity\";\nimport defineTable from \"~/definitions/table\";\n\ninterface ConstructorParams {\n context: FileManagerContext;\n}\n\nconst SORT_KEY = \"FM\";\n\nexport class SystemStorageOperations implements FileManagerSystemStorageOperations {\n private readonly _context: FileManagerContext;\n private readonly _entity: Entity<any>;\n\n private get partitionKey(): string {\n const tenant = this._context.tenancy.getCurrentTenant();\n if (!tenant) {\n throw new WebinyError(\"Tenant missing.\", \"TENANT_NOT_FOUND\");\n }\n return `T#${tenant.id}#SYSTEM`;\n }\n\n public constructor({ context }: ConstructorParams) {\n this._context = context;\n const table = defineTable({\n context\n });\n\n this._entity = defineSystemEntity({\n context,\n table\n });\n }\n\n public async get(): Promise<FileManagerSystem | null> {\n try {\n const system = await this._entity.get({\n PK: this.partitionKey,\n SK: SORT_KEY\n });\n if (!system || !system.Item) {\n return null;\n }\n return system.Item;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not fetch the FileManager system.\",\n ex.code || \"GET_SYSTEM_ERROR\"\n );\n }\n }\n\n public async create(\n params: FileManagerSystemStorageOperationsCreateParams\n ): Promise<FileManagerSystem> {\n const { data } = params;\n try {\n await this._entity.put({\n PK: this.partitionKey,\n SK: SORT_KEY,\n ...data\n });\n } catch (ex) {\n throw new WebinyError(\n \"Could not insert new system data into DynamoDB\",\n \"CREATE_SYSTEM_ERROR\",\n {\n data\n }\n );\n }\n return data;\n }\n\n public async update(\n params: FileManagerSystemStorageOperationsUpdateParams\n ): Promise<FileManagerSystem> {\n const { original, data } = params;\n\n try {\n await this._entity.update({\n PK: this.partitionKey,\n SK: SORT_KEY,\n ...data\n });\n } catch (ex) {\n throw new WebinyError(\n \"Could not update system data in the DynamoDB.\",\n \"UPDATE_SYSTEM_ERROR\",\n {\n data\n }\n );\n }\n return {\n ...original,\n ...data\n };\n }\n}\n"],"file":"SystemStorageOperations.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/operations/system/index.ts"],"names":["SystemStorageOperationsProviderDdbPlugin","SystemStorageOperationsProviderPlugin","provide","context","SystemStorageOperations"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAEO,MAAMA,wCAAN,SAAuDC,4EAAvD,CAA6F;AAAA;AAAA;AAAA,gDAClF,yCADkF;AAAA;;AAEnF,QAAPC,OAAO,CAAC;AAAEC,IAAAA;AAAF,GAAD,EAAc;AACvB,WAAO,IAAIC,gDAAJ,CAA4B;AAC/BD,MAAAA;AAD+B,KAA5B,CAAP;AAGH;;AAN+F","sourcesContent":["import { SystemStorageOperations } from \"./SystemStorageOperations\";\nimport { SystemStorageOperationsProviderPlugin } from \"@webiny/api-file-manager/plugins/definitions/SystemStorageOperationsProviderPlugin\";\n\nexport class SystemStorageOperationsProviderDdbPlugin extends SystemStorageOperationsProviderPlugin {\n public name = \"fm.storageOperationsProvider.system.ddb\";\n async provide({ context }) {\n return new SystemStorageOperations({\n context\n });\n }\n}\n"],"file":"index.js"}
|
package/operations/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/operations/utils.ts"],"names":["getDocumentClient","context","driver","db","documentClient","WebinyError","getTable","table"],"mappings":";;;;;;;;;AAAA;;AAIO,MAAMA,iBAAiB,GAAIC,OAAD,IAAiD;AAC9E,QAAMC,MAAM,GAAGD,OAAO,CAACE,EAAR,CAAWD,MAA1B;;AACA,MAAI,CAACA,MAAD,IAAW,CAACA,MAAM,CAACE,cAAvB,EAAuC;AACnC,UAAM,IAAIC,cAAJ,CACD,2DADC,EAEF,uBAFE,CAAN;AAIH;;AACD,SAAOH,MAAM,CAACE,cAAd;AACH,CATM;;;;AAWA,MAAME,QAAQ,GAAIL,OAAD,IAAyC;AAC7D,QAAME,EAAE,GAAGF,OAAO,CAACE,EAAnB;;AACA,MAAI,CAACA,EAAL,EAAS;AACL,UAAM,IAAIE,cAAJ,CAAgB,wBAAhB,EAA0C,UAA1C,CAAN;AACH,GAFD,MAEO,IAAI,CAACF,EAAE,CAACI,KAAR,EAAe;AAClB,UAAM,IAAIF,cAAJ,CAAgB,8BAAhB,EAAgD,aAAhD,CAAN;AACH;;AACD,SAAOF,EAAE,CAACI,KAAV;AACH,CARM","sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { FileManagerContext } from \"@webiny/api-file-manager/types\";\nimport { DocumentClient } from \"aws-sdk/clients/dynamodb\";\n\nexport const getDocumentClient = (context: FileManagerContext): DocumentClient => {\n const driver = context.db.driver as any;\n if (!driver || !driver.documentClient) {\n throw new WebinyError(\n `Missing documentDriver on the context db.driver property.`,\n \"DOCUMENT_CLIENT_ERROR\"\n );\n }\n return driver.documentClient;\n};\n\nexport const getTable = (context: FileManagerContext): string => {\n const db = context.db as any;\n if (!db) {\n throw new WebinyError(\"Missing db on context.\", \"DB_ERROR\");\n } else if (!db.table) {\n throw new WebinyError(\"Missing table on context.db.\", \"TABLE_ERROR\");\n }\n return db.table;\n};\n"],"file":"utils.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/plugins/FileAttributePlugin.ts"],"names":["FileAttributePlugin","AttributePlugin","constructor","params","entity"],"mappings":";;;;;;;;;;;AAAA;;;;;;AAEO,MAAMA,mBAAN,SAAkCC,gCAAlC,CAAkD;AAC9CC,EAAAA,WAAW,CAACC,MAAD,EAAiC;AAC/C,0CACOA,MADP;AAEIC,MAAAA,MAAM,EAAE;AAFZ;AAIH;;AANoD","sourcesContent":["import { AttributePlugin, Params } from \"@webiny/db-dynamodb/plugins/definitions/AttributePlugin\";\n\nexport class FileAttributePlugin extends AttributePlugin {\n public constructor(params: Omit<Params, \"entity\">) {\n super({\n ...params,\n entity: \"Files\"\n });\n }\n}\n"],"file":"FileAttributePlugin.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/plugins/FileDynamoDbFieldPlugin.ts"],"names":["FileDynamoDbFieldPlugin","FieldPlugin"],"mappings":";;;;;;;;;;;AAAA;;AAEO,MAAMA,uBAAN,SAAsCC,wBAAtC,CAAkD;;;8BAA5CD,uB,UAC6B,iC","sourcesContent":["import { FieldPlugin } from \"@webiny/db-dynamodb/plugins/definitions/FieldPlugin\";\n\nexport class FileDynamoDbFieldPlugin extends FieldPlugin {\n public static readonly type: string = \"fileManager.dynamodb.field.file\";\n}\n"],"file":"FileDynamoDbFieldPlugin.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/plugins/SettingsAttributePlugin.ts"],"names":["SettingsAttributePlugin","AttributePlugin","constructor","params","entity"],"mappings":";;;;;;;;;;;AAAA;;;;;;AAEO,MAAMA,uBAAN,SAAsCC,gCAAtC,CAAsD;AAClDC,EAAAA,WAAW,CAACC,MAAD,EAAiC;AAC/C,0CACOA,MADP;AAEIC,MAAAA,MAAM,EAAE;AAFZ;AAIH;;AANwD","sourcesContent":["import { AttributePlugin, Params } from \"@webiny/db-dynamodb/plugins/definitions/AttributePlugin\";\n\nexport class SettingsAttributePlugin extends AttributePlugin {\n public constructor(params: Omit<Params, \"entity\">) {\n super({\n ...params,\n entity: \"Settings\"\n });\n }\n}\n"],"file":"SettingsAttributePlugin.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/plugins/SystemAttributePlugin.ts"],"names":["SystemAttributePlugin","AttributePlugin","constructor","params","entity"],"mappings":";;;;;;;;;;;AAAA;;;;;;AAEO,MAAMA,qBAAN,SAAoCC,gCAApC,CAAoD;AAChDC,EAAAA,WAAW,CAACC,MAAD,EAAiC;AAC/C,0CACOA,MADP;AAEIC,MAAAA,MAAM,EAAE;AAFZ;AAIH;;AANsD","sourcesContent":["import { AttributePlugin, Params } from \"@webiny/db-dynamodb/plugins/definitions/AttributePlugin\";\n\nexport class SystemAttributePlugin extends AttributePlugin {\n public constructor(params: Omit<Params, \"entity\">) {\n super({\n ...params,\n entity: \"System\"\n });\n }\n}\n"],"file":"SystemAttributePlugin.js"}
|
package/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"types.js"}
|