@webiny/api-file-manager-ddb 0.0.0-ee-vpcs.549378cf03

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.
Files changed (57) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +30 -0
  3. package/definitions/filesEntity.d.ts +8 -0
  4. package/definitions/filesEntity.js +76 -0
  5. package/definitions/filesEntity.js.map +1 -0
  6. package/definitions/settingsEntity.d.ts +8 -0
  7. package/definitions/settingsEntity.js +52 -0
  8. package/definitions/settingsEntity.js.map +1 -0
  9. package/definitions/systemEntity.d.ts +8 -0
  10. package/definitions/systemEntity.js +43 -0
  11. package/definitions/systemEntity.js.map +1 -0
  12. package/definitions/table.d.ts +7 -0
  13. package/definitions/table.js +24 -0
  14. package/definitions/table.js.map +1 -0
  15. package/index.d.ts +5 -0
  16. package/index.js +16 -0
  17. package/index.js.map +1 -0
  18. package/operations/files/FilesStorageOperations.d.ts +22 -0
  19. package/operations/files/FilesStorageOperations.js +358 -0
  20. package/operations/files/FilesStorageOperations.js.map +1 -0
  21. package/operations/files/fields.d.ts +3 -0
  22. package/operations/files/fields.js +42 -0
  23. package/operations/files/fields.js.map +1 -0
  24. package/operations/files/index.d.ts +6 -0
  25. package/operations/files/index.js +35 -0
  26. package/operations/files/index.js.map +1 -0
  27. package/operations/settings/SettingsStorageOperations.d.ts +15 -0
  28. package/operations/settings/SettingsStorageOperations.js +118 -0
  29. package/operations/settings/SettingsStorageOperations.js.map +1 -0
  30. package/operations/settings/index.d.ts +6 -0
  31. package/operations/settings/index.js +32 -0
  32. package/operations/settings/index.js.map +1 -0
  33. package/operations/system/SystemStorageOperations.d.ts +14 -0
  34. package/operations/system/SystemStorageOperations.js +106 -0
  35. package/operations/system/SystemStorageOperations.js.map +1 -0
  36. package/operations/system/index.d.ts +6 -0
  37. package/operations/system/index.js +32 -0
  38. package/operations/system/index.js.map +1 -0
  39. package/operations/utils.d.ts +4 -0
  40. package/operations/utils.js +36 -0
  41. package/operations/utils.js.map +1 -0
  42. package/package.json +67 -0
  43. package/plugins/FileAttributePlugin.d.ts +4 -0
  44. package/plugins/FileAttributePlugin.js +23 -0
  45. package/plugins/FileAttributePlugin.js.map +1 -0
  46. package/plugins/FileDynamoDbFieldPlugin.d.ts +4 -0
  47. package/plugins/FileDynamoDbFieldPlugin.js +17 -0
  48. package/plugins/FileDynamoDbFieldPlugin.js.map +1 -0
  49. package/plugins/SettingsAttributePlugin.d.ts +4 -0
  50. package/plugins/SettingsAttributePlugin.js +23 -0
  51. package/plugins/SettingsAttributePlugin.js.map +1 -0
  52. package/plugins/SystemAttributePlugin.d.ts +4 -0
  53. package/plugins/SystemAttributePlugin.js +23 -0
  54. package/plugins/SystemAttributePlugin.js.map +1 -0
  55. package/types.d.ts +0 -0
  56. package/types.js +1 -0
  57. package/types.js.map +1 -0
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.SettingsStorageOperationsProviderDdbPlugin = void 0;
9
+
10
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
+
12
+ var _SettingsStorageOperations = require("./SettingsStorageOperations");
13
+
14
+ var _SettingsStorageOperationsProviderPlugin = require("@webiny/api-file-manager/plugins/definitions/SettingsStorageOperationsProviderPlugin");
15
+
16
+ class SettingsStorageOperationsProviderDdbPlugin extends _SettingsStorageOperationsProviderPlugin.SettingsStorageOperationsProviderPlugin {
17
+ constructor(...args) {
18
+ super(...args);
19
+ (0, _defineProperty2.default)(this, "name", "fm.storageOperationsProvider.settings.ddb");
20
+ }
21
+
22
+ async provide({
23
+ context
24
+ }) {
25
+ return new _SettingsStorageOperations.SettingsStorageOperations({
26
+ context
27
+ });
28
+ }
29
+
30
+ }
31
+
32
+ exports.SettingsStorageOperationsProviderDdbPlugin = SettingsStorageOperationsProviderDdbPlugin;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["SettingsStorageOperationsProviderDdbPlugin","SettingsStorageOperationsProviderPlugin","provide","context","SettingsStorageOperations"],"sources":["index.ts"],"sourcesContent":["import { SettingsStorageOperations } from \"./SettingsStorageOperations\";\nimport {\n SettingsStorageOperationsProviderPlugin,\n SettingsStorageOperationsProviderPluginParams\n} from \"@webiny/api-file-manager/plugins/definitions/SettingsStorageOperationsProviderPlugin\";\n\nexport class SettingsStorageOperationsProviderDdbPlugin extends SettingsStorageOperationsProviderPlugin {\n public override name = \"fm.storageOperationsProvider.settings.ddb\";\n\n public async provide({ context }: SettingsStorageOperationsProviderPluginParams) {\n return new SettingsStorageOperations({\n context\n });\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAKO,MAAMA,0CAAN,SAAyDC,gFAAzD,CAAiG;EAAA;IAAA;IAAA,4CAC7E,2CAD6E;EAAA;;EAGhF,MAAPC,OAAO,CAAC;IAAEC;EAAF,CAAD,EAA6D;IAC7E,OAAO,IAAIC,oDAAJ,CAA8B;MACjCD;IADiC,CAA9B,CAAP;EAGH;;AAPmG"}
@@ -0,0 +1,14 @@
1
+ import { FileManagerContext, FileManagerSystem, FileManagerSystemStorageOperations, FileManagerSystemStorageOperationsCreateParams, FileManagerSystemStorageOperationsUpdateParams } from "@webiny/api-file-manager/types";
2
+ interface SystemStorageOperationsConstructorParams {
3
+ context: FileManagerContext;
4
+ }
5
+ export declare class SystemStorageOperations implements FileManagerSystemStorageOperations {
6
+ private readonly _context;
7
+ private readonly _entity;
8
+ private get partitionKey();
9
+ constructor({ context }: SystemStorageOperationsConstructorParams);
10
+ get(): Promise<FileManagerSystem | null>;
11
+ create(params: FileManagerSystemStorageOperationsCreateParams): Promise<FileManagerSystem>;
12
+ update(params: FileManagerSystemStorageOperationsUpdateParams): Promise<FileManagerSystem>;
13
+ }
14
+ export {};
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.SystemStorageOperations = void 0;
9
+
10
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
+
12
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
13
+
14
+ var _error = _interopRequireDefault(require("@webiny/error"));
15
+
16
+ var _systemEntity = _interopRequireDefault(require("../../definitions/systemEntity"));
17
+
18
+ var _table = _interopRequireDefault(require("../../definitions/table"));
19
+
20
+ const SORT_KEY = "FM";
21
+
22
+ 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
+ constructor({
34
+ context
35
+ }) {
36
+ (0, _defineProperty2.default)(this, "_context", void 0);
37
+ (0, _defineProperty2.default)(this, "_entity", void 0);
38
+ this._context = context;
39
+ const table = (0, _table.default)({
40
+ context
41
+ });
42
+ this._entity = (0, _systemEntity.default)({
43
+ context,
44
+ table
45
+ });
46
+ }
47
+
48
+ async get() {
49
+ try {
50
+ const system = await this._entity.get({
51
+ PK: this.partitionKey,
52
+ SK: SORT_KEY
53
+ });
54
+
55
+ if (!system || !system.Item) {
56
+ return null;
57
+ }
58
+
59
+ return system.Item;
60
+ } catch (ex) {
61
+ throw new _error.default(ex.message || "Could not fetch the FileManager system.", ex.code || "GET_SYSTEM_ERROR");
62
+ }
63
+ }
64
+
65
+ async create(params) {
66
+ const {
67
+ data
68
+ } = params;
69
+
70
+ try {
71
+ await this._entity.put((0, _objectSpread2.default)({
72
+ PK: this.partitionKey,
73
+ SK: SORT_KEY
74
+ }, data));
75
+ } catch (ex) {
76
+ throw new _error.default("Could not insert new system data into DynamoDB", "CREATE_SYSTEM_ERROR", {
77
+ data
78
+ });
79
+ }
80
+
81
+ return data;
82
+ }
83
+
84
+ async update(params) {
85
+ const {
86
+ original,
87
+ data
88
+ } = params;
89
+
90
+ try {
91
+ await this._entity.update((0, _objectSpread2.default)({
92
+ PK: this.partitionKey,
93
+ SK: SORT_KEY
94
+ }, data));
95
+ } catch (ex) {
96
+ throw new _error.default("Could not update system data in the DynamoDB.", "UPDATE_SYSTEM_ERROR", {
97
+ data
98
+ });
99
+ }
100
+
101
+ return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, original), data);
102
+ }
103
+
104
+ }
105
+
106
+ exports.SystemStorageOperations = SystemStorageOperations;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["SORT_KEY","SystemStorageOperations","partitionKey","tenant","_context","tenancy","getCurrentTenant","WebinyError","id","constructor","context","table","defineTable","_entity","defineSystemEntity","get","system","PK","SK","Item","ex","message","code","create","params","data","put","update","original"],"sources":["SystemStorageOperations.ts"],"sourcesContent":["import {\n FileManagerContext,\n FileManagerSystem,\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 SystemStorageOperationsConstructorParams {\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 }: SystemStorageOperationsConstructorParams) {\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"],"mappings":";;;;;;;;;;;;;AAQA;;AACA;;AACA;;AAMA,MAAMA,QAAQ,GAAG,IAAjB;;AAEO,MAAMC,uBAAN,CAA4E;EAIvD,IAAZC,YAAY,GAAW;IAC/B,MAAMC,MAAM,GAAG,KAAKC,QAAL,CAAcC,OAAd,CAAsBC,gBAAtB,EAAf;;IACA,IAAI,CAACH,MAAL,EAAa;MACT,MAAM,IAAII,cAAJ,CAAgB,iBAAhB,EAAmC,kBAAnC,CAAN;IACH;;IACD,OAAQ,KAAIJ,MAAM,CAACK,EAAG,SAAtB;EACH;;EAEMC,WAAW,CAAC;IAAEC;EAAF,CAAD,EAAwD;IAAA;IAAA;IACtE,KAAKN,QAAL,GAAgBM,OAAhB;IACA,MAAMC,KAAK,GAAG,IAAAC,cAAA,EAAY;MACtBF;IADsB,CAAZ,CAAd;IAIA,KAAKG,OAAL,GAAe,IAAAC,qBAAA,EAAmB;MAC9BJ,OAD8B;MAE9BC;IAF8B,CAAnB,CAAf;EAIH;;EAEe,MAAHI,GAAG,GAAsC;IAClD,IAAI;MACA,MAAMC,MAAM,GAAG,MAAM,KAAKH,OAAL,CAAaE,GAAb,CAAiB;QAClCE,EAAE,EAAE,KAAKf,YADyB;QAElCgB,EAAE,EAAElB;MAF8B,CAAjB,CAArB;;MAIA,IAAI,CAACgB,MAAD,IAAW,CAACA,MAAM,CAACG,IAAvB,EAA6B;QACzB,OAAO,IAAP;MACH;;MACD,OAAOH,MAAM,CAACG,IAAd;IACH,CATD,CASE,OAAOC,EAAP,EAAW;MACT,MAAM,IAAIb,cAAJ,CACFa,EAAE,CAACC,OAAH,IAAc,yCADZ,EAEFD,EAAE,CAACE,IAAH,IAAW,kBAFT,CAAN;IAIH;EACJ;;EAEkB,MAANC,MAAM,CACfC,MADe,EAEW;IAC1B,MAAM;MAAEC;IAAF,IAAWD,MAAjB;;IACA,IAAI;MACA,MAAM,KAAKX,OAAL,CAAaa,GAAb;QACFT,EAAE,EAAE,KAAKf,YADP;QAEFgB,EAAE,EAAElB;MAFF,GAGCyB,IAHD,EAAN;IAKH,CAND,CAME,OAAOL,EAAP,EAAW;MACT,MAAM,IAAIb,cAAJ,CACF,gDADE,EAEF,qBAFE,EAGF;QACIkB;MADJ,CAHE,CAAN;IAOH;;IACD,OAAOA,IAAP;EACH;;EAEkB,MAANE,MAAM,CACfH,MADe,EAEW;IAC1B,MAAM;MAAEI,QAAF;MAAYH;IAAZ,IAAqBD,MAA3B;;IAEA,IAAI;MACA,MAAM,KAAKX,OAAL,CAAac,MAAb;QACFV,EAAE,EAAE,KAAKf,YADP;QAEFgB,EAAE,EAAElB;MAFF,GAGCyB,IAHD,EAAN;IAKH,CAND,CAME,OAAOL,EAAP,EAAW;MACT,MAAM,IAAIb,cAAJ,CACF,+CADE,EAEF,qBAFE,EAGF;QACIkB;MADJ,CAHE,CAAN;IAOH;;IACD,mEACOG,QADP,GAEOH,IAFP;EAIH;;AAxF8E"}
@@ -0,0 +1,6 @@
1
+ import { SystemStorageOperations } from "./SystemStorageOperations";
2
+ import { SystemStorageOperationsProviderPlugin, SystemStorageOperationsProviderPluginParams } from "@webiny/api-file-manager/plugins/definitions/SystemStorageOperationsProviderPlugin";
3
+ export declare class SystemStorageOperationsProviderDdbPlugin extends SystemStorageOperationsProviderPlugin {
4
+ name: string;
5
+ provide({ context }: SystemStorageOperationsProviderPluginParams): Promise<SystemStorageOperations>;
6
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.SystemStorageOperationsProviderDdbPlugin = void 0;
9
+
10
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
+
12
+ var _SystemStorageOperations = require("./SystemStorageOperations");
13
+
14
+ var _SystemStorageOperationsProviderPlugin = require("@webiny/api-file-manager/plugins/definitions/SystemStorageOperationsProviderPlugin");
15
+
16
+ class SystemStorageOperationsProviderDdbPlugin extends _SystemStorageOperationsProviderPlugin.SystemStorageOperationsProviderPlugin {
17
+ constructor(...args) {
18
+ super(...args);
19
+ (0, _defineProperty2.default)(this, "name", "fm.storageOperationsProvider.system.ddb");
20
+ }
21
+
22
+ async provide({
23
+ context
24
+ }) {
25
+ return new _SystemStorageOperations.SystemStorageOperations({
26
+ context
27
+ });
28
+ }
29
+
30
+ }
31
+
32
+ exports.SystemStorageOperationsProviderDdbPlugin = SystemStorageOperationsProviderDdbPlugin;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["SystemStorageOperationsProviderDdbPlugin","SystemStorageOperationsProviderPlugin","provide","context","SystemStorageOperations"],"sources":["index.ts"],"sourcesContent":["import { SystemStorageOperations } from \"./SystemStorageOperations\";\nimport {\n SystemStorageOperationsProviderPlugin,\n SystemStorageOperationsProviderPluginParams\n} from \"@webiny/api-file-manager/plugins/definitions/SystemStorageOperationsProviderPlugin\";\n\nexport class SystemStorageOperationsProviderDdbPlugin extends SystemStorageOperationsProviderPlugin {\n public override name = \"fm.storageOperationsProvider.system.ddb\";\n public async provide({ context }: SystemStorageOperationsProviderPluginParams) {\n return new SystemStorageOperations({\n context\n });\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAKO,MAAMA,wCAAN,SAAuDC,4EAAvD,CAA6F;EAAA;IAAA;IAAA,4CACzE,yCADyE;EAAA;;EAE5E,MAAPC,OAAO,CAAC;IAAEC;EAAF,CAAD,EAA2D;IAC3E,OAAO,IAAIC,gDAAJ,CAA4B;MAC/BD;IAD+B,CAA5B,CAAP;EAGH;;AAN+F"}
@@ -0,0 +1,4 @@
1
+ import { FileManagerContext } from "@webiny/api-file-manager/types";
2
+ import { DocumentClient } from "aws-sdk/clients/dynamodb";
3
+ export declare const getDocumentClient: (context: FileManagerContext) => DocumentClient;
4
+ export declare const getTable: (context: FileManagerContext) => string;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.getTable = exports.getDocumentClient = void 0;
9
+
10
+ var _error = _interopRequireDefault(require("@webiny/error"));
11
+
12
+ const getDocumentClient = context => {
13
+ const driver = context.db.driver;
14
+
15
+ if (!driver || !driver.documentClient) {
16
+ throw new _error.default(`Missing documentDriver on the context db.driver property.`, "DOCUMENT_CLIENT_ERROR");
17
+ }
18
+
19
+ return driver.documentClient;
20
+ };
21
+
22
+ exports.getDocumentClient = getDocumentClient;
23
+
24
+ const getTable = context => {
25
+ const db = context.db;
26
+
27
+ if (!db) {
28
+ throw new _error.default("Missing db on context.", "DB_ERROR");
29
+ } else if (!db.table) {
30
+ throw new _error.default("Missing table on context.db.", "TABLE_ERROR");
31
+ }
32
+
33
+ return db.table;
34
+ };
35
+
36
+ exports.getTable = getTable;
@@ -0,0 +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":";;;;;;;;;AAAA;;AAIO,MAAMA,iBAAiB,GAAIC,OAAD,IAAiD;EAC9E,MAAMC,MAAM,GAAGD,OAAO,CAACE,EAAR,CAAWD,MAA1B;;EACA,IAAI,CAACA,MAAD,IAAW,CAACA,MAAM,CAACE,cAAvB,EAAuC;IACnC,MAAM,IAAIC,cAAJ,CACD,2DADC,EAEF,uBAFE,CAAN;EAIH;;EACD,OAAOH,MAAM,CAACE,cAAd;AACH,CATM;;;;AAWA,MAAME,QAAQ,GAAIL,OAAD,IAAyC;EAC7D,MAAME,EAAE,GAAGF,OAAO,CAACE,EAAnB;;EACA,IAAI,CAACA,EAAL,EAAS;IACL,MAAM,IAAIE,cAAJ,CAAgB,wBAAhB,EAA0C,UAA1C,CAAN;EACH,CAFD,MAEO,IAAI,CAACF,EAAE,CAACI,KAAR,EAAe;IAClB,MAAM,IAAIF,cAAJ,CAAgB,8BAAhB,EAAgD,aAAhD,CAAN;EACH;;EACD,OAAOF,EAAE,CAACI,KAAV;AACH,CARM"}
package/package.json ADDED
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "@webiny/api-file-manager-ddb",
3
+ "version": "0.0.0-ee-vpcs.549378cf03",
4
+ "main": "index.js",
5
+ "keywords": [
6
+ "@webiny/api-file-manager",
7
+ "storage-operations",
8
+ "dynamodb",
9
+ "fm:ddb"
10
+ ],
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/webiny/webiny-js.git",
14
+ "directory": "packages/api-file-manager-ddb"
15
+ },
16
+ "description": "The DynamoDB storage operations for File Manager API.",
17
+ "contributors": [
18
+ "Pavel Denisjuk <pavel@webiny.com>",
19
+ "Sven Al Hamad <sven@webiny.com>",
20
+ "Adrian Smijulj <adrian@webiny.com>"
21
+ ],
22
+ "license": "MIT",
23
+ "dependencies": {
24
+ "@babel/runtime": "7.19.0",
25
+ "@webiny/api-file-manager": "0.0.0-ee-vpcs.549378cf03",
26
+ "@webiny/db-dynamodb": "0.0.0-ee-vpcs.549378cf03",
27
+ "@webiny/error": "0.0.0-ee-vpcs.549378cf03",
28
+ "@webiny/project-utils": "0.0.0-ee-vpcs.549378cf03",
29
+ "aws-sdk": "2.1230.0",
30
+ "dynamodb-toolbox": "0.3.5"
31
+ },
32
+ "devDependencies": {
33
+ "@babel/cli": "^7.19.3",
34
+ "@babel/core": "^7.19.3",
35
+ "@babel/plugin-proposal-object-rest-spread": "^7.16.0",
36
+ "@babel/plugin-transform-runtime": "^7.16.4",
37
+ "@babel/preset-env": "^7.19.4",
38
+ "@babel/preset-typescript": "^7.18.6",
39
+ "@webiny/cli": "^0.0.0-ee-vpcs.549378cf03",
40
+ "jest": "^28.1.0",
41
+ "jest-dynalite": "^3.2.0",
42
+ "jsonpack": "^1.1.5",
43
+ "rimraf": "^3.0.2",
44
+ "ttypescript": "^1.5.12",
45
+ "typescript": "4.7.4"
46
+ },
47
+ "publishConfig": {
48
+ "access": "public",
49
+ "directory": "dist"
50
+ },
51
+ "scripts": {
52
+ "watch": "yarn webiny run watch",
53
+ "build": "yarn webiny run build"
54
+ },
55
+ "adio": {
56
+ "ignoreDirs": [
57
+ "__tests__"
58
+ ],
59
+ "ignore": {
60
+ "src": [
61
+ "aws-sdk",
62
+ "sharp"
63
+ ]
64
+ }
65
+ },
66
+ "gitHead": "549378cf03fcd27845fc3fa23d1dc6b32896f630"
67
+ }
@@ -0,0 +1,4 @@
1
+ import { AttributePlugin, AttributePluginParams } from "@webiny/db-dynamodb/plugins/definitions/AttributePlugin";
2
+ export declare class FileAttributePlugin extends AttributePlugin {
3
+ constructor(params: Omit<AttributePluginParams, "entity">);
4
+ }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.FileAttributePlugin = void 0;
9
+
10
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
+
12
+ var _AttributePlugin = require("@webiny/db-dynamodb/plugins/definitions/AttributePlugin");
13
+
14
+ class FileAttributePlugin extends _AttributePlugin.AttributePlugin {
15
+ constructor(params) {
16
+ super((0, _objectSpread2.default)((0, _objectSpread2.default)({}, params), {}, {
17
+ entity: "Files"
18
+ }));
19
+ }
20
+
21
+ }
22
+
23
+ exports.FileAttributePlugin = FileAttributePlugin;
@@ -0,0 +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: \"Files\"\n });\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AAKO,MAAMA,mBAAN,SAAkCC,gCAAlC,CAAkD;EAC9CC,WAAW,CAACC,MAAD,EAAgD;IAC9D,kEACOA,MADP;MAEIC,MAAM,EAAE;IAFZ;EAIH;;AANoD"}
@@ -0,0 +1,4 @@
1
+ import { FieldPlugin } from "@webiny/db-dynamodb/plugins/definitions/FieldPlugin";
2
+ export declare class FileDynamoDbFieldPlugin extends FieldPlugin {
3
+ static readonly type: string;
4
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.FileDynamoDbFieldPlugin = void 0;
9
+
10
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
+
12
+ var _FieldPlugin = require("@webiny/db-dynamodb/plugins/definitions/FieldPlugin");
13
+
14
+ class FileDynamoDbFieldPlugin extends _FieldPlugin.FieldPlugin {}
15
+
16
+ exports.FileDynamoDbFieldPlugin = FileDynamoDbFieldPlugin;
17
+ (0, _defineProperty2.default)(FileDynamoDbFieldPlugin, "type", "fileManager.dynamodb.field.file");
@@ -0,0 +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":";;;;;;;;;;;AAAA;;AAEO,MAAMA,uBAAN,SAAsCC,wBAAtC,CAAkD;;;8BAA5CD,uB,UACsC,iC"}
@@ -0,0 +1,4 @@
1
+ import { AttributePlugin, AttributePluginParams } from "@webiny/db-dynamodb/plugins/definitions/AttributePlugin";
2
+ export declare class SettingsAttributePlugin extends AttributePlugin {
3
+ constructor(params: Omit<AttributePluginParams, "entity">);
4
+ }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.SettingsAttributePlugin = void 0;
9
+
10
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
+
12
+ var _AttributePlugin = require("@webiny/db-dynamodb/plugins/definitions/AttributePlugin");
13
+
14
+ class SettingsAttributePlugin extends _AttributePlugin.AttributePlugin {
15
+ constructor(params) {
16
+ super((0, _objectSpread2.default)((0, _objectSpread2.default)({}, params), {}, {
17
+ entity: "Settings"
18
+ }));
19
+ }
20
+
21
+ }
22
+
23
+ exports.SettingsAttributePlugin = SettingsAttributePlugin;
@@ -0,0 +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":";;;;;;;;;;;AAAA;;AAKO,MAAMA,uBAAN,SAAsCC,gCAAtC,CAAsD;EAClDC,WAAW,CAACC,MAAD,EAAgD;IAC9D,kEACOA,MADP;MAEIC,MAAM,EAAE;IAFZ;EAIH;;AANwD"}
@@ -0,0 +1,4 @@
1
+ import { AttributePlugin, AttributePluginParams } from "@webiny/db-dynamodb/plugins/definitions/AttributePlugin";
2
+ export declare class SystemAttributePlugin extends AttributePlugin {
3
+ constructor(params: Omit<AttributePluginParams, "entity">);
4
+ }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.SystemAttributePlugin = void 0;
9
+
10
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
+
12
+ var _AttributePlugin = require("@webiny/db-dynamodb/plugins/definitions/AttributePlugin");
13
+
14
+ class SystemAttributePlugin extends _AttributePlugin.AttributePlugin {
15
+ constructor(params) {
16
+ super((0, _objectSpread2.default)((0, _objectSpread2.default)({}, params), {}, {
17
+ entity: "System"
18
+ }));
19
+ }
20
+
21
+ }
22
+
23
+ exports.SystemAttributePlugin = SystemAttributePlugin;
@@ -0,0 +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":";;;;;;;;;;;AAAA;;AAKO,MAAMA,qBAAN,SAAoCC,gCAApC,CAAoD;EAChDC,WAAW,CAACC,MAAD,EAAgD;IAC9D,kEACOA,MADP;MAEIC,MAAM,EAAE;IAFZ;EAIH;;AANsD"}
package/types.d.ts ADDED
File without changes
package/types.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";
package/types.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":[""],"mappings":""}