@webiny/api-file-manager-ddb 5.34.8 → 5.35.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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,15 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { FileManagerSettings, FileManagerSettingsStorageOperations, FileManagerSettingsStorageOperationsCreateParams, FileManagerSettingsStorageOperationsUpdateParams, FileManagerStorageOperationsDeleteSettings, FileManagerStorageOperationsGetSettingsParams } from "@webiny/api-file-manager/types";
|
|
2
|
+
import { DocumentClient } from "aws-sdk/clients/dynamodb";
|
|
3
|
+
interface SettingsStorageOperationsConfig {
|
|
4
|
+
documentClient: DocumentClient;
|
|
4
5
|
}
|
|
5
6
|
export declare class SettingsStorageOperations implements FileManagerSettingsStorageOperations {
|
|
6
|
-
private readonly _context;
|
|
7
7
|
private readonly _entity;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
get(): Promise<FileManagerSettings | null>;
|
|
8
|
+
constructor({ documentClient }: SettingsStorageOperationsConfig);
|
|
9
|
+
get({ tenant }: FileManagerStorageOperationsGetSettingsParams): Promise<FileManagerSettings | null>;
|
|
11
10
|
create({ data }: FileManagerSettingsStorageOperationsCreateParams): Promise<FileManagerSettings>;
|
|
12
11
|
update({ data }: FileManagerSettingsStorageOperationsUpdateParams): Promise<FileManagerSettings>;
|
|
13
|
-
delete(): Promise<void>;
|
|
12
|
+
delete({ tenant }: FileManagerStorageOperationsDeleteSettings): Promise<void>;
|
|
14
13
|
}
|
|
15
14
|
export {};
|
|
@@ -1,87 +1,62 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.SettingsStorageOperations = void 0;
|
|
9
|
-
|
|
10
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
-
|
|
12
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
-
|
|
14
9
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
15
|
-
|
|
16
|
-
var _table = _interopRequireDefault(require("../../definitions/table"));
|
|
17
|
-
|
|
18
10
|
var _settingsEntity = _interopRequireDefault(require("../../definitions/settingsEntity"));
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
11
|
+
var _get = require("@webiny/db-dynamodb/utils/get");
|
|
12
|
+
var _table = require("../../definitions/table");
|
|
13
|
+
const SORT_KEY = "A";
|
|
22
14
|
class SettingsStorageOperations {
|
|
23
|
-
get partitionKey() {
|
|
24
|
-
const tenant = this._context.tenancy.getCurrentTenant();
|
|
25
|
-
|
|
26
|
-
if (!tenant) {
|
|
27
|
-
throw new _error.default("Tenant missing.", "TENANT_NOT_FOUND");
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return `T#${tenant.id}#FM#SETTINGS`;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
15
|
constructor({
|
|
34
|
-
|
|
16
|
+
documentClient
|
|
35
17
|
}) {
|
|
36
|
-
(0, _defineProperty2.default)(this, "_context", void 0);
|
|
37
18
|
(0, _defineProperty2.default)(this, "_entity", void 0);
|
|
38
|
-
this._context = context;
|
|
39
|
-
const table = (0, _table.default)({
|
|
40
|
-
context
|
|
41
|
-
});
|
|
42
19
|
this._entity = (0, _settingsEntity.default)({
|
|
43
|
-
|
|
44
|
-
|
|
20
|
+
table: (0, _table.createTable)({
|
|
21
|
+
documentClient
|
|
22
|
+
})
|
|
45
23
|
});
|
|
46
24
|
}
|
|
47
|
-
|
|
48
|
-
|
|
25
|
+
async get({
|
|
26
|
+
tenant
|
|
27
|
+
}) {
|
|
49
28
|
try {
|
|
50
|
-
const settings = await
|
|
51
|
-
|
|
52
|
-
|
|
29
|
+
const settings = await (0, _get.get)({
|
|
30
|
+
entity: this._entity,
|
|
31
|
+
keys: {
|
|
32
|
+
PK: `T#${tenant}#FM#SETTINGS`,
|
|
33
|
+
SK: "A"
|
|
34
|
+
}
|
|
53
35
|
});
|
|
54
|
-
|
|
55
|
-
if (!settings || !settings.Item) {
|
|
56
|
-
return null;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return settings.Item;
|
|
36
|
+
return settings ? settings.data : null;
|
|
60
37
|
} catch (ex) {
|
|
61
38
|
throw new _error.default(ex.message || "Could not fetch the FileManager settings.", ex.code || "GET_SETTINGS_ERROR");
|
|
62
39
|
}
|
|
63
40
|
}
|
|
64
|
-
|
|
65
41
|
async create({
|
|
66
42
|
data
|
|
67
43
|
}) {
|
|
68
|
-
const original = await this.get(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
*/
|
|
72
|
-
|
|
44
|
+
const original = await this.get({
|
|
45
|
+
tenant: data.tenant
|
|
46
|
+
});
|
|
73
47
|
if (original) {
|
|
74
48
|
return await this.update({
|
|
75
49
|
original,
|
|
76
50
|
data
|
|
77
51
|
});
|
|
78
52
|
}
|
|
79
|
-
|
|
80
53
|
try {
|
|
81
|
-
await this._entity.put(
|
|
82
|
-
PK:
|
|
83
|
-
SK: SORT_KEY
|
|
84
|
-
|
|
54
|
+
await this._entity.put({
|
|
55
|
+
PK: `T#${data.tenant}#FM#SETTINGS`,
|
|
56
|
+
SK: SORT_KEY,
|
|
57
|
+
TYPE: "fm.settings",
|
|
58
|
+
data
|
|
59
|
+
});
|
|
85
60
|
return data;
|
|
86
61
|
} catch (ex) {
|
|
87
62
|
throw new _error.default(ex.message || "Cannot create FileManager settings.", ex.code || "CREATE_FM_SETTINGS_ERROR", {
|
|
@@ -89,15 +64,16 @@ class SettingsStorageOperations {
|
|
|
89
64
|
});
|
|
90
65
|
}
|
|
91
66
|
}
|
|
92
|
-
|
|
93
67
|
async update({
|
|
94
68
|
data
|
|
95
69
|
}) {
|
|
96
70
|
try {
|
|
97
|
-
await this._entity.update(
|
|
98
|
-
PK:
|
|
99
|
-
SK: SORT_KEY
|
|
100
|
-
|
|
71
|
+
await this._entity.update({
|
|
72
|
+
PK: `T#${data.tenant}#FM#SETTINGS`,
|
|
73
|
+
SK: SORT_KEY,
|
|
74
|
+
TYPE: "fm.settings",
|
|
75
|
+
data
|
|
76
|
+
});
|
|
101
77
|
return data;
|
|
102
78
|
} catch (ex) {
|
|
103
79
|
throw new _error.default(ex.message || "Cannot update FileManager settings.", ex.code || "UPDATE_FM_SETTINGS_ERROR", {
|
|
@@ -105,14 +81,13 @@ class SettingsStorageOperations {
|
|
|
105
81
|
});
|
|
106
82
|
}
|
|
107
83
|
}
|
|
108
|
-
|
|
109
|
-
|
|
84
|
+
async delete({
|
|
85
|
+
tenant
|
|
86
|
+
}) {
|
|
110
87
|
return this._entity.delete({
|
|
111
|
-
PK:
|
|
88
|
+
PK: `T#${tenant}#FM#SETTINGS`,
|
|
112
89
|
SK: SORT_KEY
|
|
113
90
|
});
|
|
114
91
|
}
|
|
115
|
-
|
|
116
92
|
}
|
|
117
|
-
|
|
118
93
|
exports.SettingsStorageOperations = SettingsStorageOperations;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SORT_KEY","SettingsStorageOperations","
|
|
1
|
+
{"version":3,"names":["SORT_KEY","SettingsStorageOperations","constructor","documentClient","_entity","defineSettingsEntity","table","createTable","get","tenant","settings","entity","keys","PK","SK","data","ex","WebinyError","message","code","create","original","update","put","TYPE","delete"],"sources":["SettingsStorageOperations.ts"],"sourcesContent":["import {\n FileManagerSettings,\n FileManagerSettingsStorageOperations,\n FileManagerSettingsStorageOperationsCreateParams,\n FileManagerSettingsStorageOperationsUpdateParams,\n FileManagerStorageOperationsDeleteSettings,\n FileManagerStorageOperationsGetSettingsParams\n} from \"@webiny/api-file-manager/types\";\nimport { Entity } from \"dynamodb-toolbox\";\nimport WebinyError from \"@webiny/error\";\nimport defineSettingsEntity from \"~/definitions/settingsEntity\";\nimport { get } from \"@webiny/db-dynamodb/utils/get\";\nimport { DocumentClient } from \"aws-sdk/clients/dynamodb\";\nimport { createTable } from \"~/definitions/table\";\n\ninterface SettingsStorageOperationsConfig {\n documentClient: DocumentClient;\n}\n\nconst SORT_KEY = \"A\";\n\nexport class SettingsStorageOperations implements FileManagerSettingsStorageOperations {\n private readonly _entity: Entity<any>;\n\n public constructor({ documentClient }: SettingsStorageOperationsConfig) {\n this._entity = defineSettingsEntity({ table: createTable({ documentClient }) });\n }\n\n public async get({\n tenant\n }: FileManagerStorageOperationsGetSettingsParams): Promise<FileManagerSettings | null> {\n try {\n const settings = await get<{ data: FileManagerSettings }>({\n entity: this._entity,\n keys: {\n PK: `T#${tenant}#FM#SETTINGS`,\n SK: \"A\"\n }\n });\n\n return settings ? settings.data : null;\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({ tenant: data.tenant });\n\n if (original) {\n return await this.update({ original, data });\n }\n\n try {\n await this._entity.put({\n PK: `T#${data.tenant}#FM#SETTINGS`,\n SK: SORT_KEY,\n TYPE: \"fm.settings\",\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: `T#${data.tenant}#FM#SETTINGS`,\n SK: SORT_KEY,\n TYPE: \"fm.settings\",\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({ tenant }: FileManagerStorageOperationsDeleteSettings): Promise<void> {\n return this._entity.delete({\n PK: `T#${tenant}#FM#SETTINGS`,\n SK: SORT_KEY\n });\n }\n}\n"],"mappings":";;;;;;;;AASA;AACA;AACA;AAEA;AAMA,MAAMA,QAAQ,GAAG,GAAG;AAEb,MAAMC,yBAAyB,CAAiD;EAG5EC,WAAW,CAAC;IAAEC;EAAgD,CAAC,EAAE;IAAA;IACpE,IAAI,CAACC,OAAO,GAAG,IAAAC,uBAAoB,EAAC;MAAEC,KAAK,EAAE,IAAAC,kBAAW,EAAC;QAAEJ;MAAe,CAAC;IAAE,CAAC,CAAC;EACnF;EAEA,MAAaK,GAAG,CAAC;IACbC;EAC2C,CAAC,EAAuC;IACnF,IAAI;MACA,MAAMC,QAAQ,GAAG,MAAM,IAAAF,QAAG,EAAgC;QACtDG,MAAM,EAAE,IAAI,CAACP,OAAO;QACpBQ,IAAI,EAAE;UACFC,EAAE,EAAG,KAAIJ,MAAO,cAAa;UAC7BK,EAAE,EAAE;QACR;MACJ,CAAC,CAAC;MAEF,OAAOJ,QAAQ,GAAGA,QAAQ,CAACK,IAAI,GAAG,IAAI;IAC1C,CAAC,CAAC,OAAOC,EAAE,EAAE;MACT,MAAM,IAAIC,cAAW,CACjBD,EAAE,CAACE,OAAO,IAAI,2CAA2C,EACzDF,EAAE,CAACG,IAAI,IAAI,oBAAoB,CAClC;IACL;EACJ;EAEA,MAAaC,MAAM,CAAC;IAChBL;EAC8C,CAAC,EAAgC;IAC/E,MAAMM,QAAQ,GAAG,MAAM,IAAI,CAACb,GAAG,CAAC;MAAEC,MAAM,EAAEM,IAAI,CAACN;IAAO,CAAC,CAAC;IAExD,IAAIY,QAAQ,EAAE;MACV,OAAO,MAAM,IAAI,CAACC,MAAM,CAAC;QAAED,QAAQ;QAAEN;MAAK,CAAC,CAAC;IAChD;IAEA,IAAI;MACA,MAAM,IAAI,CAACX,OAAO,CAACmB,GAAG,CAAC;QACnBV,EAAE,EAAG,KAAIE,IAAI,CAACN,MAAO,cAAa;QAClCK,EAAE,EAAEd,QAAQ;QACZwB,IAAI,EAAE,aAAa;QACnBT;MACJ,CAAC,CAAC;MACF,OAAOA,IAAI;IACf,CAAC,CAAC,OAAOC,EAAE,EAAE;MACT,MAAM,IAAIC,cAAW,CACjBD,EAAE,CAACE,OAAO,IAAI,qCAAqC,EACnDF,EAAE,CAACG,IAAI,IAAI,0BAA0B,EACrC;QACIJ;MACJ,CAAC,CACJ;IACL;EACJ;EAEA,MAAaO,MAAM,CAAC;IAChBP;EAC8C,CAAC,EAAgC;IAC/E,IAAI;MACA,MAAM,IAAI,CAACX,OAAO,CAACkB,MAAM,CAAC;QACtBT,EAAE,EAAG,KAAIE,IAAI,CAACN,MAAO,cAAa;QAClCK,EAAE,EAAEd,QAAQ;QACZwB,IAAI,EAAE,aAAa;QACnBT;MACJ,CAAC,CAAC;MACF,OAAOA,IAAI;IACf,CAAC,CAAC,OAAOC,EAAE,EAAE;MACT,MAAM,IAAIC,cAAW,CACjBD,EAAE,CAACE,OAAO,IAAI,qCAAqC,EACnDF,EAAE,CAACG,IAAI,IAAI,0BAA0B,EACrC;QACIJ;MACJ,CAAC,CACJ;IACL;EACJ;EAEA,MAAaU,MAAM,CAAC;IAAEhB;EAAmD,CAAC,EAAiB;IACvF,OAAO,IAAI,CAACL,OAAO,CAACqB,MAAM,CAAC;MACvBZ,EAAE,EAAG,KAAIJ,MAAO,cAAa;MAC7BK,EAAE,EAAEd;IACR,CAAC,CAAC;EACN;AACJ;AAAC"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DocumentClient } from "aws-sdk/clients/dynamodb";
|
|
2
|
+
import { FileManagerSystem, FileManagerSystemStorageOperations, FileManagerSystemStorageOperationsCreateParams, FileManagerSystemStorageOperationsGetParams, FileManagerSystemStorageOperationsUpdateParams } from "@webiny/api-file-manager/types";
|
|
2
3
|
interface SystemStorageOperationsConstructorParams {
|
|
3
|
-
|
|
4
|
+
documentClient: DocumentClient;
|
|
4
5
|
}
|
|
5
6
|
export declare class SystemStorageOperations implements FileManagerSystemStorageOperations {
|
|
6
|
-
private readonly _context;
|
|
7
7
|
private readonly _entity;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
get(): Promise<FileManagerSystem | null>;
|
|
8
|
+
constructor({ documentClient }: SystemStorageOperationsConstructorParams);
|
|
9
|
+
get({ tenant }: FileManagerSystemStorageOperationsGetParams): Promise<FileManagerSystem | null>;
|
|
11
10
|
create(params: FileManagerSystemStorageOperationsCreateParams): Promise<FileManagerSystem>;
|
|
12
11
|
update(params: FileManagerSystemStorageOperationsUpdateParams): Promise<FileManagerSystem>;
|
|
13
12
|
}
|
|
@@ -1,75 +1,50 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.SystemStorageOperations = void 0;
|
|
9
|
-
|
|
10
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
-
|
|
12
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
-
|
|
14
10
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
15
|
-
|
|
16
11
|
var _systemEntity = _interopRequireDefault(require("../../definitions/systemEntity"));
|
|
17
|
-
|
|
18
|
-
var _table = _interopRequireDefault(require("../../definitions/table"));
|
|
19
|
-
|
|
12
|
+
var _table = require("../../definitions/table");
|
|
20
13
|
const SORT_KEY = "FM";
|
|
21
|
-
|
|
22
14
|
class SystemStorageOperations {
|
|
23
|
-
get partitionKey() {
|
|
24
|
-
const tenant = this._context.tenancy.getCurrentTenant();
|
|
25
|
-
|
|
26
|
-
if (!tenant) {
|
|
27
|
-
throw new _error.default("Tenant missing.", "TENANT_NOT_FOUND");
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return `T#${tenant.id}#SYSTEM`;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
15
|
constructor({
|
|
34
|
-
|
|
16
|
+
documentClient
|
|
35
17
|
}) {
|
|
36
|
-
(0, _defineProperty2.default)(this, "_context", void 0);
|
|
37
18
|
(0, _defineProperty2.default)(this, "_entity", void 0);
|
|
38
|
-
this._context = context;
|
|
39
|
-
const table = (0, _table.default)({
|
|
40
|
-
context
|
|
41
|
-
});
|
|
42
19
|
this._entity = (0, _systemEntity.default)({
|
|
43
|
-
|
|
44
|
-
|
|
20
|
+
table: (0, _table.createTable)({
|
|
21
|
+
documentClient
|
|
22
|
+
})
|
|
45
23
|
});
|
|
46
24
|
}
|
|
47
|
-
|
|
48
|
-
|
|
25
|
+
async get({
|
|
26
|
+
tenant
|
|
27
|
+
}) {
|
|
49
28
|
try {
|
|
50
29
|
const system = await this._entity.get({
|
|
51
|
-
PK:
|
|
30
|
+
PK: `T#${tenant}#SYSTEM`,
|
|
52
31
|
SK: SORT_KEY
|
|
53
32
|
});
|
|
54
|
-
|
|
55
33
|
if (!system || !system.Item) {
|
|
56
34
|
return null;
|
|
57
35
|
}
|
|
58
|
-
|
|
59
36
|
return system.Item;
|
|
60
37
|
} catch (ex) {
|
|
61
38
|
throw new _error.default(ex.message || "Could not fetch the FileManager system.", ex.code || "GET_SYSTEM_ERROR");
|
|
62
39
|
}
|
|
63
40
|
}
|
|
64
|
-
|
|
65
41
|
async create(params) {
|
|
66
42
|
const {
|
|
67
43
|
data
|
|
68
44
|
} = params;
|
|
69
|
-
|
|
70
45
|
try {
|
|
71
46
|
await this._entity.put((0, _objectSpread2.default)({
|
|
72
|
-
PK:
|
|
47
|
+
PK: `T#${data.tenant}#SYSTEM`,
|
|
73
48
|
SK: SORT_KEY
|
|
74
49
|
}, data));
|
|
75
50
|
} catch (ex) {
|
|
@@ -77,19 +52,16 @@ class SystemStorageOperations {
|
|
|
77
52
|
data
|
|
78
53
|
});
|
|
79
54
|
}
|
|
80
|
-
|
|
81
55
|
return data;
|
|
82
56
|
}
|
|
83
|
-
|
|
84
57
|
async update(params) {
|
|
85
58
|
const {
|
|
86
59
|
original,
|
|
87
60
|
data
|
|
88
61
|
} = params;
|
|
89
|
-
|
|
90
62
|
try {
|
|
91
63
|
await this._entity.update((0, _objectSpread2.default)({
|
|
92
|
-
PK:
|
|
64
|
+
PK: `T#${data.tenant}#SYSTEM`,
|
|
93
65
|
SK: SORT_KEY
|
|
94
66
|
}, data));
|
|
95
67
|
} catch (ex) {
|
|
@@ -97,10 +69,7 @@ class SystemStorageOperations {
|
|
|
97
69
|
data
|
|
98
70
|
});
|
|
99
71
|
}
|
|
100
|
-
|
|
101
72
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, original), data);
|
|
102
73
|
}
|
|
103
|
-
|
|
104
74
|
}
|
|
105
|
-
|
|
106
75
|
exports.SystemStorageOperations = SystemStorageOperations;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SORT_KEY","SystemStorageOperations","
|
|
1
|
+
{"version":3,"names":["SORT_KEY","SystemStorageOperations","constructor","documentClient","_entity","defineSystemEntity","table","createTable","get","tenant","system","PK","SK","Item","ex","WebinyError","message","code","create","params","data","put","update","original"],"sources":["SystemStorageOperations.ts"],"sourcesContent":["import { DocumentClient } from \"aws-sdk/clients/dynamodb\";\nimport { Entity } from \"dynamodb-toolbox\";\nimport {\n FileManagerSystem,\n FileManagerSystemStorageOperations,\n FileManagerSystemStorageOperationsCreateParams,\n FileManagerSystemStorageOperationsGetParams,\n FileManagerSystemStorageOperationsUpdateParams\n} from \"@webiny/api-file-manager/types\";\nimport WebinyError from \"@webiny/error\";\nimport defineSystemEntity from \"~/definitions/systemEntity\";\nimport { createTable } from \"~/definitions/table\";\n\ninterface SystemStorageOperationsConstructorParams {\n documentClient: DocumentClient;\n}\n\nconst SORT_KEY = \"FM\";\n\nexport class SystemStorageOperations implements FileManagerSystemStorageOperations {\n private readonly _entity: Entity<any>;\n\n public constructor({ documentClient }: SystemStorageOperationsConstructorParams) {\n this._entity = defineSystemEntity({ table: createTable({ documentClient }) });\n }\n\n public async get({\n tenant\n }: FileManagerSystemStorageOperationsGetParams): Promise<FileManagerSystem | null> {\n try {\n const system = await this._entity.get({\n PK: `T#${tenant}#SYSTEM`,\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: `T#${data.tenant}#SYSTEM`,\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: `T#${data.tenant}#SYSTEM`,\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"],"mappings":";;;;;;;;;AASA;AACA;AACA;AAMA,MAAMA,QAAQ,GAAG,IAAI;AAEd,MAAMC,uBAAuB,CAA+C;EAGxEC,WAAW,CAAC;IAAEC;EAAyD,CAAC,EAAE;IAAA;IAC7E,IAAI,CAACC,OAAO,GAAG,IAAAC,qBAAkB,EAAC;MAAEC,KAAK,EAAE,IAAAC,kBAAW,EAAC;QAAEJ;MAAe,CAAC;IAAE,CAAC,CAAC;EACjF;EAEA,MAAaK,GAAG,CAAC;IACbC;EACyC,CAAC,EAAqC;IAC/E,IAAI;MACA,MAAMC,MAAM,GAAG,MAAM,IAAI,CAACN,OAAO,CAACI,GAAG,CAAC;QAClCG,EAAE,EAAG,KAAIF,MAAO,SAAQ;QACxBG,EAAE,EAAEZ;MACR,CAAC,CAAC;MACF,IAAI,CAACU,MAAM,IAAI,CAACA,MAAM,CAACG,IAAI,EAAE;QACzB,OAAO,IAAI;MACf;MACA,OAAOH,MAAM,CAACG,IAAI;IACtB,CAAC,CAAC,OAAOC,EAAE,EAAE;MACT,MAAM,IAAIC,cAAW,CACjBD,EAAE,CAACE,OAAO,IAAI,yCAAyC,EACvDF,EAAE,CAACG,IAAI,IAAI,kBAAkB,CAChC;IACL;EACJ;EAEA,MAAaC,MAAM,CACfC,MAAsD,EAC5B;IAC1B,MAAM;MAAEC;IAAK,CAAC,GAAGD,MAAM;IACvB,IAAI;MACA,MAAM,IAAI,CAACf,OAAO,CAACiB,GAAG;QAClBV,EAAE,EAAG,KAAIS,IAAI,CAACX,MAAO,SAAQ;QAC7BG,EAAE,EAAEZ;MAAQ,GACToB,IAAI,EACT;IACN,CAAC,CAAC,OAAON,EAAE,EAAE;MACT,MAAM,IAAIC,cAAW,CACjB,gDAAgD,EAChD,qBAAqB,EACrB;QACIK;MACJ,CAAC,CACJ;IACL;IACA,OAAOA,IAAI;EACf;EAEA,MAAaE,MAAM,CACfH,MAAsD,EAC5B;IAC1B,MAAM;MAAEI,QAAQ;MAAEH;IAAK,CAAC,GAAGD,MAAM;IAEjC,IAAI;MACA,MAAM,IAAI,CAACf,OAAO,CAACkB,MAAM;QACrBX,EAAE,EAAG,KAAIS,IAAI,CAACX,MAAO,SAAQ;QAC7BG,EAAE,EAAEZ;MAAQ,GACToB,IAAI,EACT;IACN,CAAC,CAAC,OAAON,EAAE,EAAE;MACT,MAAM,IAAIC,cAAW,CACjB,+CAA+C,EAC/C,qBAAqB,EACrB;QACIK;MACJ,CAAC,CACJ;IACL;IACA,mEACOG,QAAQ,GACRH,IAAI;EAEf;AACJ;AAAC"}
|
package/operations/utils.js
CHANGED
|
@@ -1,36 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.getTable = exports.getDocumentClient = void 0;
|
|
9
|
-
|
|
10
8
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
11
|
-
|
|
12
9
|
const getDocumentClient = context => {
|
|
13
10
|
const driver = context.db.driver;
|
|
14
|
-
|
|
15
11
|
if (!driver || !driver.documentClient) {
|
|
16
12
|
throw new _error.default(`Missing documentDriver on the context db.driver property.`, "DOCUMENT_CLIENT_ERROR");
|
|
17
13
|
}
|
|
18
|
-
|
|
19
14
|
return driver.documentClient;
|
|
20
15
|
};
|
|
21
|
-
|
|
22
16
|
exports.getDocumentClient = getDocumentClient;
|
|
23
|
-
|
|
24
17
|
const getTable = context => {
|
|
25
18
|
const db = context.db;
|
|
26
|
-
|
|
27
19
|
if (!db) {
|
|
28
20
|
throw new _error.default("Missing db on context.", "DB_ERROR");
|
|
29
21
|
} else if (!db.table) {
|
|
30
22
|
throw new _error.default("Missing table on context.db.", "TABLE_ERROR");
|
|
31
23
|
}
|
|
32
|
-
|
|
33
24
|
return db.table;
|
|
34
25
|
};
|
|
35
|
-
|
|
36
26
|
exports.getTable = getTable;
|
package/operations/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getDocumentClient","context","driver","db","documentClient","WebinyError","getTable","table"],"sources":["utils.ts"],"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"],"mappings":"
|
|
1
|
+
{"version":3,"names":["getDocumentClient","context","driver","db","documentClient","WebinyError","getTable","table"],"sources":["utils.ts"],"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"],"mappings":";;;;;;;AAAA;AAIO,MAAMA,iBAAiB,GAAIC,OAA2B,IAAqB;EAC9E,MAAMC,MAAM,GAAGD,OAAO,CAACE,EAAE,CAACD,MAAa;EACvC,IAAI,CAACA,MAAM,IAAI,CAACA,MAAM,CAACE,cAAc,EAAE;IACnC,MAAM,IAAIC,cAAW,CAChB,2DAA0D,EAC3D,uBAAuB,CAC1B;EACL;EACA,OAAOH,MAAM,CAACE,cAAc;AAChC,CAAC;AAAC;AAEK,MAAME,QAAQ,GAAIL,OAA2B,IAAa;EAC7D,MAAME,EAAE,GAAGF,OAAO,CAACE,EAAS;EAC5B,IAAI,CAACA,EAAE,EAAE;IACL,MAAM,IAAIE,cAAW,CAAC,wBAAwB,EAAE,UAAU,CAAC;EAC/D,CAAC,MAAM,IAAI,CAACF,EAAE,CAACI,KAAK,EAAE;IAClB,MAAM,IAAIF,cAAW,CAAC,8BAA8B,EAAE,aAAa,CAAC;EACxE;EACA,OAAOF,EAAE,CAACI,KAAK;AACnB,CAAC;AAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-file-manager-ddb",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.35.0-beta.1",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"@webiny/api-file-manager",
|
|
@@ -21,12 +21,13 @@
|
|
|
21
21
|
],
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@babel/runtime": "7.
|
|
25
|
-
"@webiny/api-file-manager": "5.
|
|
26
|
-
"@webiny/db-dynamodb": "5.
|
|
27
|
-
"@webiny/error": "5.
|
|
28
|
-
"@webiny/
|
|
29
|
-
"
|
|
24
|
+
"@babel/runtime": "7.20.13",
|
|
25
|
+
"@webiny/api-file-manager": "5.35.0-beta.1",
|
|
26
|
+
"@webiny/db-dynamodb": "5.35.0-beta.1",
|
|
27
|
+
"@webiny/error": "5.35.0-beta.1",
|
|
28
|
+
"@webiny/plugins": "5.35.0-beta.1",
|
|
29
|
+
"@webiny/project-utils": "5.35.0-beta.1",
|
|
30
|
+
"aws-sdk": "2.1310.0",
|
|
30
31
|
"dynamodb-toolbox": "0.3.5"
|
|
31
32
|
},
|
|
32
33
|
"devDependencies": {
|
|
@@ -36,7 +37,7 @@
|
|
|
36
37
|
"@babel/plugin-transform-runtime": "^7.16.4",
|
|
37
38
|
"@babel/preset-env": "^7.19.4",
|
|
38
39
|
"@babel/preset-typescript": "^7.18.6",
|
|
39
|
-
"@webiny/cli": "^5.
|
|
40
|
+
"@webiny/cli": "^5.35.0-beta.1",
|
|
40
41
|
"jest": "^28.1.0",
|
|
41
42
|
"jest-dynalite": "^3.2.0",
|
|
42
43
|
"jsonpack": "^1.1.5",
|
|
@@ -63,5 +64,5 @@
|
|
|
63
64
|
]
|
|
64
65
|
}
|
|
65
66
|
},
|
|
66
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "6b376faedf02e056efbbf1e4d46d537850773ce0"
|
|
67
68
|
}
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.FileAttributePlugin = void 0;
|
|
9
|
-
|
|
10
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
-
|
|
12
9
|
var _AttributePlugin = require("@webiny/db-dynamodb/plugins/definitions/AttributePlugin");
|
|
13
|
-
|
|
14
10
|
class FileAttributePlugin extends _AttributePlugin.AttributePlugin {
|
|
15
11
|
constructor(params) {
|
|
16
12
|
super((0, _objectSpread2.default)((0, _objectSpread2.default)({}, params), {}, {
|
|
17
|
-
entity: "
|
|
13
|
+
entity: "FM.File"
|
|
18
14
|
}));
|
|
19
15
|
}
|
|
20
|
-
|
|
21
16
|
}
|
|
22
|
-
|
|
23
17
|
exports.FileAttributePlugin = FileAttributePlugin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["FileAttributePlugin","AttributePlugin","constructor","params","entity"],"sources":["FileAttributePlugin.ts"],"sourcesContent":["import {\n AttributePlugin,\n AttributePluginParams\n} from \"@webiny/db-dynamodb/plugins/definitions/AttributePlugin\";\n\nexport class FileAttributePlugin extends AttributePlugin {\n public constructor(params: Omit<AttributePluginParams, \"entity\">) {\n super({\n ...params,\n entity: \"
|
|
1
|
+
{"version":3,"names":["FileAttributePlugin","AttributePlugin","constructor","params","entity"],"sources":["FileAttributePlugin.ts"],"sourcesContent":["import {\n AttributePlugin,\n AttributePluginParams\n} from \"@webiny/db-dynamodb/plugins/definitions/AttributePlugin\";\n\nexport class FileAttributePlugin extends AttributePlugin {\n public constructor(params: Omit<AttributePluginParams, \"entity\">) {\n super({\n ...params,\n entity: \"FM.File\"\n });\n }\n}\n"],"mappings":";;;;;;;;AAAA;AAKO,MAAMA,mBAAmB,SAASC,gCAAe,CAAC;EAC9CC,WAAW,CAACC,MAA6C,EAAE;IAC9D,KAAK,6DACEA,MAAM;MACTC,MAAM,EAAE;IAAS,GACnB;EACN;AACJ;AAAC"}
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.FileDynamoDbFieldPlugin = void 0;
|
|
9
|
-
|
|
10
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
9
|
var _FieldPlugin = require("@webiny/db-dynamodb/plugins/definitions/FieldPlugin");
|
|
13
|
-
|
|
14
10
|
class FileDynamoDbFieldPlugin extends _FieldPlugin.FieldPlugin {}
|
|
15
|
-
|
|
16
11
|
exports.FileDynamoDbFieldPlugin = FileDynamoDbFieldPlugin;
|
|
17
12
|
(0, _defineProperty2.default)(FileDynamoDbFieldPlugin, "type", "fileManager.dynamodb.field.file");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["FileDynamoDbFieldPlugin","FieldPlugin"],"sources":["FileDynamoDbFieldPlugin.ts"],"sourcesContent":["import { FieldPlugin } from \"@webiny/db-dynamodb/plugins/definitions/FieldPlugin\";\n\nexport class FileDynamoDbFieldPlugin extends FieldPlugin {\n public static override readonly type: string = \"fileManager.dynamodb.field.file\";\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["FileDynamoDbFieldPlugin","FieldPlugin"],"sources":["FileDynamoDbFieldPlugin.ts"],"sourcesContent":["import { FieldPlugin } from \"@webiny/db-dynamodb/plugins/definitions/FieldPlugin\";\n\nexport class FileDynamoDbFieldPlugin extends FieldPlugin {\n public static override readonly type: string = \"fileManager.dynamodb.field.file\";\n}\n"],"mappings":";;;;;;;;AAAA;AAEO,MAAMA,uBAAuB,SAASC,wBAAW,CAAC;AAExD;AAAA,8BAFYD,uBAAuB,UACe,iCAAiC"}
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.SettingsAttributePlugin = void 0;
|
|
9
|
-
|
|
10
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
-
|
|
12
9
|
var _AttributePlugin = require("@webiny/db-dynamodb/plugins/definitions/AttributePlugin");
|
|
13
|
-
|
|
14
10
|
class SettingsAttributePlugin extends _AttributePlugin.AttributePlugin {
|
|
15
11
|
constructor(params) {
|
|
16
12
|
super((0, _objectSpread2.default)((0, _objectSpread2.default)({}, params), {}, {
|
|
17
|
-
entity: "Settings"
|
|
13
|
+
entity: "FM.Settings"
|
|
18
14
|
}));
|
|
19
15
|
}
|
|
20
|
-
|
|
21
16
|
}
|
|
22
|
-
|
|
23
17
|
exports.SettingsAttributePlugin = SettingsAttributePlugin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SettingsAttributePlugin","AttributePlugin","constructor","params","entity"],"sources":["SettingsAttributePlugin.ts"],"sourcesContent":["import {\n AttributePlugin,\n AttributePluginParams\n} from \"@webiny/db-dynamodb/plugins/definitions/AttributePlugin\";\n\nexport class SettingsAttributePlugin extends AttributePlugin {\n public constructor(params: Omit<AttributePluginParams, \"entity\">) {\n super({\n ...params,\n entity: \"Settings\"\n });\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["SettingsAttributePlugin","AttributePlugin","constructor","params","entity"],"sources":["SettingsAttributePlugin.ts"],"sourcesContent":["import {\n AttributePlugin,\n AttributePluginParams\n} from \"@webiny/db-dynamodb/plugins/definitions/AttributePlugin\";\n\nexport class SettingsAttributePlugin extends AttributePlugin {\n public constructor(params: Omit<AttributePluginParams, \"entity\">) {\n super({\n ...params,\n entity: \"FM.Settings\"\n });\n }\n}\n"],"mappings":";;;;;;;;AAAA;AAKO,MAAMA,uBAAuB,SAASC,gCAAe,CAAC;EAClDC,WAAW,CAACC,MAA6C,EAAE;IAC9D,KAAK,6DACEA,MAAM;MACTC,MAAM,EAAE;IAAa,GACvB;EACN;AACJ;AAAC"}
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.SystemAttributePlugin = void 0;
|
|
9
|
-
|
|
10
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
-
|
|
12
9
|
var _AttributePlugin = require("@webiny/db-dynamodb/plugins/definitions/AttributePlugin");
|
|
13
|
-
|
|
14
10
|
class SystemAttributePlugin extends _AttributePlugin.AttributePlugin {
|
|
15
11
|
constructor(params) {
|
|
16
12
|
super((0, _objectSpread2.default)((0, _objectSpread2.default)({}, params), {}, {
|
|
17
13
|
entity: "System"
|
|
18
14
|
}));
|
|
19
15
|
}
|
|
20
|
-
|
|
21
16
|
}
|
|
22
|
-
|
|
23
17
|
exports.SystemAttributePlugin = SystemAttributePlugin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SystemAttributePlugin","AttributePlugin","constructor","params","entity"],"sources":["SystemAttributePlugin.ts"],"sourcesContent":["import {\n AttributePlugin,\n AttributePluginParams\n} from \"@webiny/db-dynamodb/plugins/definitions/AttributePlugin\";\n\nexport class SystemAttributePlugin extends AttributePlugin {\n public constructor(params: Omit<AttributePluginParams, \"entity\">) {\n super({\n ...params,\n entity: \"System\"\n });\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["SystemAttributePlugin","AttributePlugin","constructor","params","entity"],"sources":["SystemAttributePlugin.ts"],"sourcesContent":["import {\n AttributePlugin,\n AttributePluginParams\n} from \"@webiny/db-dynamodb/plugins/definitions/AttributePlugin\";\n\nexport class SystemAttributePlugin extends AttributePlugin {\n public constructor(params: Omit<AttributePluginParams, \"entity\">) {\n super({\n ...params,\n entity: \"System\"\n });\n }\n}\n"],"mappings":";;;;;;;;AAAA;AAKO,MAAMA,qBAAqB,SAASC,gCAAe,CAAC;EAChDC,WAAW,CAACC,MAA6C,EAAE;IAC9D,KAAK,6DACEA,MAAM;MACTC,MAAM,EAAE;IAAQ,GAClB;EACN;AACJ;AAAC"}
|