@webiny/api-file-manager 5.35.0 → 5.35.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/package.json +27 -27
  2. package/plugins/crud/files/validation.d.ts +0 -3
  3. package/plugins/crud/files/validation.js +0 -41
  4. package/plugins/crud/files/validation.js.map +0 -1
  5. package/plugins/crud/files.crud.d.ts +0 -4
  6. package/plugins/crud/files.crud.js +0 -431
  7. package/plugins/crud/files.crud.js.map +0 -1
  8. package/plugins/crud/settings.crud.d.ts +0 -5
  9. package/plugins/crud/settings.crud.js +0 -116
  10. package/plugins/crud/settings.crud.js.map +0 -1
  11. package/plugins/crud/system.crud.d.ts +0 -4
  12. package/plugins/crud/system.crud.js +0 -153
  13. package/plugins/crud/system.crud.js.map +0 -1
  14. package/plugins/crud/utils/checkBasePermissions.d.ts +0 -5
  15. package/plugins/crud/utils/checkBasePermissions.js +0 -33
  16. package/plugins/crud/utils/checkBasePermissions.js.map +0 -1
  17. package/plugins/crud/utils/createFileModel.d.ts +0 -5
  18. package/plugins/crud/utils/createFileModel.js +0 -77
  19. package/plugins/crud/utils/createFileModel.js.map +0 -1
  20. package/plugins/crud/utils/lifecycleEvents.d.ts +0 -6
  21. package/plugins/crud/utils/lifecycleEvents.js +0 -38
  22. package/plugins/crud/utils/lifecycleEvents.js.map +0 -1
  23. package/plugins/definitions/FilePhysicalStoragePlugin.d.ts +0 -21
  24. package/plugins/definitions/FilePhysicalStoragePlugin.js +0 -42
  25. package/plugins/definitions/FilePhysicalStoragePlugin.js.map +0 -1
  26. package/plugins/definitions/FilePlugin.d.ts +0 -136
  27. package/plugins/definitions/FilePlugin.js +0 -70
  28. package/plugins/definitions/FilePlugin.js.map +0 -1
  29. package/plugins/definitions/FileStorageTransformPlugin.d.ts +0 -34
  30. package/plugins/definitions/FileStorageTransformPlugin.js +0 -51
  31. package/plugins/definitions/FileStorageTransformPlugin.js.map +0 -1
  32. package/plugins/definitions/FilesStorageOperationsProviderPlugin.d.ts +0 -9
  33. package/plugins/definitions/FilesStorageOperationsProviderPlugin.js +0 -17
  34. package/plugins/definitions/FilesStorageOperationsProviderPlugin.js.map +0 -1
  35. package/plugins/definitions/InstallationPlugin.d.ts +0 -19
  36. package/plugins/definitions/InstallationPlugin.js +0 -42
  37. package/plugins/definitions/InstallationPlugin.js.map +0 -1
  38. package/plugins/definitions/SettingsStorageOperationsProviderPlugin.d.ts +0 -9
  39. package/plugins/definitions/SettingsStorageOperationsProviderPlugin.js +0 -17
  40. package/plugins/definitions/SettingsStorageOperationsProviderPlugin.js.map +0 -1
  41. package/plugins/definitions/SystemStorageOperationsProviderPlugin.d.ts +0 -9
  42. package/plugins/definitions/SystemStorageOperationsProviderPlugin.js +0 -17
  43. package/plugins/definitions/SystemStorageOperationsProviderPlugin.js.map +0 -1
  44. package/plugins/graphql.d.ts +0 -4
  45. package/plugins/graphql.js +0 -290
  46. package/plugins/graphql.js.map +0 -1
  47. package/plugins/storage/FileStorage.d.ts +0 -30
  48. package/plugins/storage/FileStorage.js +0 -103
  49. package/plugins/storage/FileStorage.js.map +0 -1
  50. package/plugins/storage/index.d.ts +0 -4
  51. package/plugins/storage/index.js +0 -26
  52. package/plugins/storage/index.js.map +0 -1
  53. package/utils.d.ts +0 -4
  54. package/utils.js +0 -16
  55. package/utils.js.map +0 -1
@@ -1,136 +0,0 @@
1
- import { Plugin } from "@webiny/plugins";
2
- import { File, FileManagerContext } from "../../types";
3
- /**
4
- * Parameters for beforeCreate lifecycle.
5
- */
6
- export interface BeforeCreateParams {
7
- context: FileManagerContext;
8
- /**
9
- * Data to be inserted into the storage.
10
- */
11
- data: File;
12
- }
13
- /**
14
- * Parameters for afterCreate lifecycle.
15
- */
16
- export interface AfterCreateParams {
17
- context: FileManagerContext;
18
- /**
19
- * Data that was inserted into the storage.
20
- */
21
- data: File;
22
- /**
23
- * Result of the storage operations create method.
24
- * Possibly changed something on the "data".
25
- */
26
- file: File;
27
- }
28
- /**
29
- * Parameters for beforeUpdate lifecycle.
30
- */
31
- export interface BeforeUpdateParams {
32
- context: FileManagerContext;
33
- /**
34
- * Original file from the storage.
35
- */
36
- original: File;
37
- /**
38
- * Data to be updated to the storage.
39
- */
40
- data: File;
41
- }
42
- /**
43
- * Parameters for afterUpdate lifecycle.
44
- */
45
- export interface AfterUpdateParams {
46
- context: FileManagerContext;
47
- /**
48
- * Original file from the storage.
49
- */
50
- original: File;
51
- /**
52
- * Data that was updated in the storage.
53
- */
54
- data: File;
55
- /**
56
- * Result of the storage operations update method.
57
- * Possibly changed something on the "data".
58
- */
59
- file: File;
60
- }
61
- /**
62
- * Parameters for beforeBatchCreate lifecycle.
63
- */
64
- export interface BeforeBatchCreateParams {
65
- context: FileManagerContext;
66
- /**
67
- * Files to be inserted into the storage.
68
- */
69
- data: File[];
70
- }
71
- /**
72
- * Parameters for afterBatchCreate lifecycle.
73
- */
74
- export interface AfterBatchCreateParams {
75
- context: FileManagerContext;
76
- /**
77
- * Files that were inserted into the storage.
78
- */
79
- data: File[];
80
- /**
81
- * Results of the insert.
82
- */
83
- files: File[];
84
- }
85
- /**
86
- * Parameters for beforeDelete lifecycle.
87
- */
88
- export interface BeforeDeleteParams {
89
- context: FileManagerContext;
90
- /**
91
- * File to be deleted from the storage.
92
- */
93
- file: File;
94
- }
95
- /**
96
- * Parameters for afterDelete lifecycle.
97
- */
98
- export interface AfterDeleteParams {
99
- context: FileManagerContext;
100
- /**
101
- * File that was deleted from the storage.
102
- */
103
- file: File;
104
- }
105
- /**
106
- * Definition for the constructor parameters of the FilePlugin.
107
- *
108
- * @category FilePlugin
109
- */
110
- export interface FilePluginParams {
111
- beforeCreate?: (params: BeforeCreateParams) => Promise<void>;
112
- afterCreate?: (params: AfterCreateParams) => Promise<void>;
113
- beforeUpdate?: (params: BeforeUpdateParams) => Promise<void>;
114
- afterUpdate?: (params: AfterUpdateParams) => Promise<void>;
115
- beforeBatchCreate?: (params: BeforeBatchCreateParams) => Promise<void>;
116
- afterBatchCreate?: (params: AfterBatchCreateParams) => Promise<void>;
117
- beforeDelete?: (params: BeforeDeleteParams) => Promise<void>;
118
- afterDelete?: (params: AfterDeleteParams) => Promise<void>;
119
- }
120
- export declare class FilePlugin extends Plugin {
121
- static readonly type: string;
122
- private readonly _params;
123
- constructor(params?: FilePluginParams);
124
- beforeCreate(params: BeforeCreateParams): Promise<void>;
125
- afterCreate(params: AfterCreateParams): Promise<void>;
126
- beforeUpdate(params: BeforeUpdateParams): Promise<void>;
127
- afterUpdate(params: AfterUpdateParams): Promise<void>;
128
- beforeBatchCreate(params: BeforeBatchCreateParams): Promise<void>;
129
- afterBatchCreate(params: AfterBatchCreateParams): Promise<void>;
130
- beforeDelete(params: BeforeDeleteParams): Promise<void>;
131
- afterDelete(params: AfterDeleteParams): Promise<void>;
132
- /**
133
- * Keep any here because it can be a number of params. Method is internal so no need to complicate the code.
134
- */
135
- private _execute;
136
- }
@@ -1,70 +0,0 @@
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.FilePlugin = void 0;
9
-
10
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
-
12
- var _plugins = require("@webiny/plugins");
13
-
14
- class FilePlugin extends _plugins.Plugin {
15
- constructor(params) {
16
- super();
17
- (0, _defineProperty2.default)(this, "_params", void 0);
18
- this._params = params || {};
19
- }
20
-
21
- async beforeCreate(params) {
22
- await this._execute("beforeCreate", params);
23
- }
24
-
25
- async afterCreate(params) {
26
- await this._execute("afterCreate", params);
27
- }
28
-
29
- async beforeUpdate(params) {
30
- await this._execute("beforeUpdate", params);
31
- }
32
-
33
- async afterUpdate(params) {
34
- await this._execute("afterUpdate", params);
35
- }
36
-
37
- async beforeBatchCreate(params) {
38
- await this._execute("beforeBatchCreate", params);
39
- }
40
-
41
- async afterBatchCreate(params) {
42
- await this._execute("afterBatchCreate", params);
43
- }
44
-
45
- async beforeDelete(params) {
46
- await this._execute("beforeDelete", params);
47
- }
48
-
49
- async afterDelete(params) {
50
- await this._execute("afterDelete", params);
51
- }
52
- /**
53
- * Keep any here because it can be a number of params. Method is internal so no need to complicate the code.
54
- */
55
-
56
-
57
- async _execute(callback, params) {
58
- const cb = this._params[callback];
59
-
60
- if (typeof cb !== "function") {
61
- return;
62
- }
63
-
64
- await cb(params);
65
- }
66
-
67
- }
68
-
69
- exports.FilePlugin = FilePlugin;
70
- (0, _defineProperty2.default)(FilePlugin, "type", "fm.file");
@@ -1 +0,0 @@
1
- {"version":3,"names":["FilePlugin","Plugin","constructor","params","_params","beforeCreate","_execute","afterCreate","beforeUpdate","afterUpdate","beforeBatchCreate","afterBatchCreate","beforeDelete","afterDelete","callback","cb"],"sources":["FilePlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { File, FileManagerContext } from \"~/types\";\n\n/**\n * Parameters for beforeCreate lifecycle.\n */\nexport interface BeforeCreateParams {\n context: FileManagerContext;\n /**\n * Data to be inserted into the storage.\n */\n data: File;\n}\n/**\n * Parameters for afterCreate lifecycle.\n */\nexport interface AfterCreateParams {\n context: FileManagerContext;\n /**\n * Data that was inserted into the storage.\n */\n data: File;\n /**\n * Result of the storage operations create method.\n * Possibly changed something on the \"data\".\n */\n file: File;\n}\n/**\n * Parameters for beforeUpdate lifecycle.\n */\nexport interface BeforeUpdateParams {\n context: FileManagerContext;\n /**\n * Original file from the storage.\n */\n original: File;\n /**\n * Data to be updated to the storage.\n */\n data: File;\n}\n/**\n * Parameters for afterUpdate lifecycle.\n */\nexport interface AfterUpdateParams {\n context: FileManagerContext;\n /**\n * Original file from the storage.\n */\n original: File;\n /**\n * Data that was updated in the storage.\n */\n data: File;\n /**\n * Result of the storage operations update method.\n * Possibly changed something on the \"data\".\n */\n file: File;\n}\n/**\n * Parameters for beforeBatchCreate lifecycle.\n */\nexport interface BeforeBatchCreateParams {\n context: FileManagerContext;\n /**\n * Files to be inserted into the storage.\n */\n data: File[];\n}\n\n/**\n * Parameters for afterBatchCreate lifecycle.\n */\nexport interface AfterBatchCreateParams {\n context: FileManagerContext;\n /**\n * Files that were inserted into the storage.\n */\n data: File[];\n /**\n * Results of the insert.\n */\n files: File[];\n}\n/**\n * Parameters for beforeDelete lifecycle.\n */\nexport interface BeforeDeleteParams {\n context: FileManagerContext;\n /**\n * File to be deleted from the storage.\n */\n file: File;\n}\n/**\n * Parameters for afterDelete lifecycle.\n */\nexport interface AfterDeleteParams {\n context: FileManagerContext;\n /**\n * File that was deleted from the storage.\n */\n file: File;\n}\n\n/**\n * Definition for the constructor parameters of the FilePlugin.\n *\n * @category FilePlugin\n */\nexport interface FilePluginParams {\n beforeCreate?: (params: BeforeCreateParams) => Promise<void>;\n afterCreate?: (params: AfterCreateParams) => Promise<void>;\n beforeUpdate?: (params: BeforeUpdateParams) => Promise<void>;\n afterUpdate?: (params: AfterUpdateParams) => Promise<void>;\n beforeBatchCreate?: (params: BeforeBatchCreateParams) => Promise<void>;\n afterBatchCreate?: (params: AfterBatchCreateParams) => Promise<void>;\n beforeDelete?: (params: BeforeDeleteParams) => Promise<void>;\n afterDelete?: (params: AfterDeleteParams) => Promise<void>;\n}\n\nexport class FilePlugin extends Plugin {\n public static override readonly type: string = \"fm.file\";\n private readonly _params: FilePluginParams;\n\n public constructor(params?: FilePluginParams) {\n super();\n this._params = params || ({} as any);\n }\n\n public async beforeCreate(params: BeforeCreateParams): Promise<void> {\n await this._execute(\"beforeCreate\", params);\n }\n\n public async afterCreate(params: AfterCreateParams): Promise<void> {\n await this._execute(\"afterCreate\", params);\n }\n\n public async beforeUpdate(params: BeforeUpdateParams): Promise<void> {\n await this._execute(\"beforeUpdate\", params);\n }\n\n public async afterUpdate(params: AfterUpdateParams): Promise<void> {\n await this._execute(\"afterUpdate\", params);\n }\n\n public async beforeBatchCreate(params: BeforeBatchCreateParams): Promise<void> {\n await this._execute(\"beforeBatchCreate\", params);\n }\n\n public async afterBatchCreate(params: AfterBatchCreateParams): Promise<void> {\n await this._execute(\"afterBatchCreate\", params);\n }\n\n public async beforeDelete(params: BeforeDeleteParams): Promise<void> {\n await this._execute(\"beforeDelete\", params);\n }\n\n public async afterDelete(params: AfterDeleteParams): Promise<void> {\n await this._execute(\"afterDelete\", params);\n }\n /**\n * Keep any here because it can be a number of params. Method is internal so no need to complicate the code.\n */\n private async _execute(callback: keyof FilePluginParams, params: any): Promise<void> {\n const cb = this._params[callback];\n if (typeof cb !== \"function\") {\n return;\n }\n await cb(params);\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AA2HO,MAAMA,UAAN,SAAyBC,eAAzB,CAAgC;EAI5BC,WAAW,CAACC,MAAD,EAA4B;IAC1C;IAD0C;IAE1C,KAAKC,OAAL,GAAeD,MAAM,IAAK,EAA1B;EACH;;EAEwB,MAAZE,YAAY,CAACF,MAAD,EAA4C;IACjE,MAAM,KAAKG,QAAL,CAAc,cAAd,EAA8BH,MAA9B,CAAN;EACH;;EAEuB,MAAXI,WAAW,CAACJ,MAAD,EAA2C;IAC/D,MAAM,KAAKG,QAAL,CAAc,aAAd,EAA6BH,MAA7B,CAAN;EACH;;EAEwB,MAAZK,YAAY,CAACL,MAAD,EAA4C;IACjE,MAAM,KAAKG,QAAL,CAAc,cAAd,EAA8BH,MAA9B,CAAN;EACH;;EAEuB,MAAXM,WAAW,CAACN,MAAD,EAA2C;IAC/D,MAAM,KAAKG,QAAL,CAAc,aAAd,EAA6BH,MAA7B,CAAN;EACH;;EAE6B,MAAjBO,iBAAiB,CAACP,MAAD,EAAiD;IAC3E,MAAM,KAAKG,QAAL,CAAc,mBAAd,EAAmCH,MAAnC,CAAN;EACH;;EAE4B,MAAhBQ,gBAAgB,CAACR,MAAD,EAAgD;IACzE,MAAM,KAAKG,QAAL,CAAc,kBAAd,EAAkCH,MAAlC,CAAN;EACH;;EAEwB,MAAZS,YAAY,CAACT,MAAD,EAA4C;IACjE,MAAM,KAAKG,QAAL,CAAc,cAAd,EAA8BH,MAA9B,CAAN;EACH;;EAEuB,MAAXU,WAAW,CAACV,MAAD,EAA2C;IAC/D,MAAM,KAAKG,QAAL,CAAc,aAAd,EAA6BH,MAA7B,CAAN;EACH;EACD;AACJ;AACA;;;EAC0B,MAARG,QAAQ,CAACQ,QAAD,EAAmCX,MAAnC,EAA+D;IACjF,MAAMY,EAAE,GAAG,KAAKX,OAAL,CAAaU,QAAb,CAAX;;IACA,IAAI,OAAOC,EAAP,KAAc,UAAlB,EAA8B;MAC1B;IACH;;IACD,MAAMA,EAAE,CAACZ,MAAD,CAAR;EACH;;AAjDkC;;;8BAA1BH,U,UACsC,S"}
@@ -1,34 +0,0 @@
1
- import { Plugin } from "@webiny/plugins";
2
- import { File } from "../../types";
3
- export interface FileStorageTransformPluginToParams {
4
- /**
5
- * File that is being sent to the storage operations method.
6
- */
7
- file: File & Record<string, any>;
8
- }
9
- export interface FileStorageTransformPluginFromParams {
10
- /**
11
- * File that was fetched from the storage operations method.
12
- */
13
- file: File & Record<string, any>;
14
- }
15
- export interface FileStorageTransformPluginParams {
16
- toStorage?: (params: FileStorageTransformPluginToParams) => Promise<File & Record<string, any>>;
17
- fromStorage?: (params: FileStorageTransformPluginFromParams) => Promise<File & Record<string, any>>;
18
- }
19
- export declare class FileStorageTransformPlugin extends Plugin {
20
- static readonly type: string;
21
- private readonly _params;
22
- constructor(params: FileStorageTransformPluginParams);
23
- /**
24
- * Transform the file value into something that can be stored.
25
- * Be aware that you must return the whole file object.
26
- */
27
- toStorage(params: FileStorageTransformPluginToParams): Promise<File & Record<string, any>>;
28
- /**
29
- * Transform the file value from the storage type to one required by our system.
30
- * Be aware that you must return the whole file object.
31
- * This method MUST reverse what ever toStorage method changed on the file object.
32
- */
33
- fromStorage(params: FileStorageTransformPluginFromParams): Promise<File & Record<string, any>>;
34
- }
@@ -1,51 +0,0 @@
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.FileStorageTransformPlugin = void 0;
9
-
10
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
-
12
- var _plugins = require("@webiny/plugins");
13
-
14
- class FileStorageTransformPlugin extends _plugins.Plugin {
15
- constructor(params) {
16
- super();
17
- (0, _defineProperty2.default)(this, "_params", void 0);
18
- this._params = params;
19
- }
20
- /**
21
- * Transform the file value into something that can be stored.
22
- * Be aware that you must return the whole file object.
23
- */
24
-
25
-
26
- async toStorage(params) {
27
- if (!this._params.toStorage) {
28
- return params.file;
29
- }
30
-
31
- return this._params.toStorage(params);
32
- }
33
- /**
34
- * Transform the file value from the storage type to one required by our system.
35
- * Be aware that you must return the whole file object.
36
- * This method MUST reverse what ever toStorage method changed on the file object.
37
- */
38
-
39
-
40
- async fromStorage(params) {
41
- if (!this._params.fromStorage) {
42
- return params.file;
43
- }
44
-
45
- return this._params.fromStorage(params);
46
- }
47
-
48
- }
49
-
50
- exports.FileStorageTransformPlugin = FileStorageTransformPlugin;
51
- (0, _defineProperty2.default)(FileStorageTransformPlugin, "type", "fm.files.storage.transform");
@@ -1 +0,0 @@
1
- {"version":3,"names":["FileStorageTransformPlugin","Plugin","constructor","params","_params","toStorage","file","fromStorage"],"sources":["FileStorageTransformPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { File } from \"~/types\";\n\nexport interface FileStorageTransformPluginToParams {\n /**\n * File that is being sent to the storage operations method.\n */\n file: File & Record<string, any>;\n}\n\nexport interface FileStorageTransformPluginFromParams {\n /**\n * File that was fetched from the storage operations method.\n */\n file: File & Record<string, any>;\n}\n\nexport interface FileStorageTransformPluginParams {\n toStorage?: (params: FileStorageTransformPluginToParams) => Promise<File & Record<string, any>>;\n fromStorage?: (\n params: FileStorageTransformPluginFromParams\n ) => Promise<File & Record<string, any>>;\n}\n\nexport class FileStorageTransformPlugin extends Plugin {\n public static override readonly type: string = \"fm.files.storage.transform\";\n private readonly _params: FileStorageTransformPluginParams;\n\n public constructor(params: FileStorageTransformPluginParams) {\n super();\n\n this._params = params;\n }\n\n /**\n * Transform the file value into something that can be stored.\n * Be aware that you must return the whole file object.\n */\n public async toStorage(\n params: FileStorageTransformPluginToParams\n ): Promise<File & Record<string, any>> {\n if (!this._params.toStorage) {\n return params.file;\n }\n return this._params.toStorage(params);\n }\n /**\n * Transform the file value from the storage type to one required by our system.\n * Be aware that you must return the whole file object.\n * This method MUST reverse what ever toStorage method changed on the file object.\n */\n public async fromStorage(\n params: FileStorageTransformPluginFromParams\n ): Promise<File & Record<string, any>> {\n if (!this._params.fromStorage) {\n return params.file;\n }\n return this._params.fromStorage(params);\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AAwBO,MAAMA,0BAAN,SAAyCC,eAAzC,CAAgD;EAI5CC,WAAW,CAACC,MAAD,EAA2C;IACzD;IADyD;IAGzD,KAAKC,OAAL,GAAeD,MAAf;EACH;EAED;AACJ;AACA;AACA;;;EAC0B,MAATE,SAAS,CAClBF,MADkB,EAEiB;IACnC,IAAI,CAAC,KAAKC,OAAL,CAAaC,SAAlB,EAA6B;MACzB,OAAOF,MAAM,CAACG,IAAd;IACH;;IACD,OAAO,KAAKF,OAAL,CAAaC,SAAb,CAAuBF,MAAvB,CAAP;EACH;EACD;AACJ;AACA;AACA;AACA;;;EAC4B,MAAXI,WAAW,CACpBJ,MADoB,EAEe;IACnC,IAAI,CAAC,KAAKC,OAAL,CAAaG,WAAlB,EAA+B;MAC3B,OAAOJ,MAAM,CAACG,IAAd;IACH;;IACD,OAAO,KAAKF,OAAL,CAAaG,WAAb,CAAyBJ,MAAzB,CAAP;EACH;;AAlCkD;;;8BAA1CH,0B,UACsC,4B"}
@@ -1,9 +0,0 @@
1
- import { Plugin } from "@webiny/plugins";
2
- import { FileManagerContext, FileManagerFilesStorageOperations } from "../../types";
3
- export interface FilesStorageOperationsProviderPluginParams<T = FileManagerContext> {
4
- context: T;
5
- }
6
- export declare abstract class FilesStorageOperationsProviderPlugin extends Plugin {
7
- static readonly type: string;
8
- abstract provide(params: FilesStorageOperationsProviderPluginParams): Promise<FileManagerFilesStorageOperations>;
9
- }
@@ -1,17 +0,0 @@
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.FilesStorageOperationsProviderPlugin = void 0;
9
-
10
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
-
12
- var _plugins = require("@webiny/plugins");
13
-
14
- class FilesStorageOperationsProviderPlugin extends _plugins.Plugin {}
15
-
16
- exports.FilesStorageOperationsProviderPlugin = FilesStorageOperationsProviderPlugin;
17
- (0, _defineProperty2.default)(FilesStorageOperationsProviderPlugin, "type", "fm.storageOperationsProvider.files");
@@ -1 +0,0 @@
1
- {"version":3,"names":["FilesStorageOperationsProviderPlugin","Plugin"],"sources":["FilesStorageOperationsProviderPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { FileManagerContext, FileManagerFilesStorageOperations } from \"~/types\";\n\nexport interface FilesStorageOperationsProviderPluginParams<T = FileManagerContext> {\n context: T;\n}\n\nexport abstract class FilesStorageOperationsProviderPlugin extends Plugin {\n public static override readonly type: string = \"fm.storageOperationsProvider.files\";\n\n public abstract provide(\n params: FilesStorageOperationsProviderPluginParams\n ): Promise<FileManagerFilesStorageOperations>;\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AAOO,MAAeA,oCAAf,SAA4DC,eAA5D,CAAmE;;;8BAApDD,oC,UAC6B,oC"}
@@ -1,19 +0,0 @@
1
- import { FileManagerContext } from "../../types";
2
- import { Plugin } from "@webiny/plugins";
3
- export interface InstallationPluginParams {
4
- context: FileManagerContext;
5
- }
6
- export declare type CallbackFunction<TParams> = (params: TParams) => Promise<void>;
7
- interface InstallationPluginConfig {
8
- beforeInstall?: CallbackFunction<InstallationPluginParams>;
9
- afterInstall?: CallbackFunction<InstallationPluginParams>;
10
- }
11
- export declare abstract class InstallationPlugin extends Plugin {
12
- static readonly type: string;
13
- private readonly _config;
14
- constructor(config?: Partial<InstallationPluginConfig>);
15
- beforeInstall(params: InstallationPluginParams): Promise<void>;
16
- afterInstall(params: InstallationPluginParams): Promise<void>;
17
- private _execute;
18
- }
19
- export {};
@@ -1,42 +0,0 @@
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.InstallationPlugin = void 0;
9
-
10
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
-
12
- var _plugins = require("@webiny/plugins");
13
-
14
- class InstallationPlugin extends _plugins.Plugin {
15
- constructor(config) {
16
- super();
17
- (0, _defineProperty2.default)(this, "_config", void 0);
18
- this._config = config || {};
19
- }
20
-
21
- async beforeInstall(params) {
22
- return this._execute("beforeInstall", params);
23
- }
24
-
25
- async afterInstall(params) {
26
- return this._execute("afterInstall", params);
27
- }
28
-
29
- async _execute(callback, params) {
30
- const cb = this._config[callback];
31
-
32
- if (!cb) {
33
- return;
34
- }
35
-
36
- return cb(params);
37
- }
38
-
39
- }
40
-
41
- exports.InstallationPlugin = InstallationPlugin;
42
- (0, _defineProperty2.default)(InstallationPlugin, "type", "fm.install");
@@ -1 +0,0 @@
1
- {"version":3,"names":["InstallationPlugin","Plugin","constructor","config","_config","beforeInstall","params","_execute","afterInstall","callback","cb"],"sources":["InstallationPlugin.ts"],"sourcesContent":["import { FileManagerContext } from \"~/types\";\nimport { Plugin } from \"@webiny/plugins\";\n\nexport interface InstallationPluginParams {\n context: FileManagerContext;\n}\nexport type CallbackFunction<TParams> = (params: TParams) => Promise<void>;\n\ninterface InstallationPluginConfig {\n beforeInstall?: CallbackFunction<InstallationPluginParams>;\n afterInstall?: CallbackFunction<InstallationPluginParams>;\n}\n\nexport abstract class InstallationPlugin extends Plugin {\n public static override readonly type: string = \"fm.install\";\n private readonly _config: Partial<InstallationPluginConfig>;\n\n constructor(config?: Partial<InstallationPluginConfig>) {\n super();\n this._config = config || {};\n }\n\n public async beforeInstall(params: InstallationPluginParams): Promise<void> {\n return this._execute(\"beforeInstall\", params);\n }\n\n public async afterInstall(params: InstallationPluginParams): Promise<void> {\n return this._execute(\"afterInstall\", params);\n }\n\n private async _execute(\n callback: keyof InstallationPluginConfig,\n params: InstallationPluginParams\n ): Promise<void> {\n const cb = this._config[callback];\n if (!cb) {\n return;\n }\n return cb(params);\n }\n}\n"],"mappings":";;;;;;;;;;;AACA;;AAYO,MAAeA,kBAAf,SAA0CC,eAA1C,CAAiD;EAIpDC,WAAW,CAACC,MAAD,EAA6C;IACpD;IADoD;IAEpD,KAAKC,OAAL,GAAeD,MAAM,IAAI,EAAzB;EACH;;EAEyB,MAAbE,aAAa,CAACC,MAAD,EAAkD;IACxE,OAAO,KAAKC,QAAL,CAAc,eAAd,EAA+BD,MAA/B,CAAP;EACH;;EAEwB,MAAZE,YAAY,CAACF,MAAD,EAAkD;IACvE,OAAO,KAAKC,QAAL,CAAc,cAAd,EAA8BD,MAA9B,CAAP;EACH;;EAEqB,MAARC,QAAQ,CAClBE,QADkB,EAElBH,MAFkB,EAGL;IACb,MAAMI,EAAE,GAAG,KAAKN,OAAL,CAAaK,QAAb,CAAX;;IACA,IAAI,CAACC,EAAL,EAAS;MACL;IACH;;IACD,OAAOA,EAAE,CAACJ,MAAD,CAAT;EACH;;AA1BmD;;;8BAAlCN,kB,UAC6B,Y"}
@@ -1,9 +0,0 @@
1
- import { Plugin } from "@webiny/plugins";
2
- import { FileManagerContext, FileManagerSettingsStorageOperations } from "../../types";
3
- export interface SettingsStorageOperationsProviderPluginParams<T = FileManagerContext> {
4
- context: T;
5
- }
6
- export declare abstract class SettingsStorageOperationsProviderPlugin extends Plugin {
7
- static readonly type: string;
8
- abstract provide(params: SettingsStorageOperationsProviderPluginParams): Promise<FileManagerSettingsStorageOperations>;
9
- }
@@ -1,17 +0,0 @@
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.SettingsStorageOperationsProviderPlugin = void 0;
9
-
10
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
-
12
- var _plugins = require("@webiny/plugins");
13
-
14
- class SettingsStorageOperationsProviderPlugin extends _plugins.Plugin {}
15
-
16
- exports.SettingsStorageOperationsProviderPlugin = SettingsStorageOperationsProviderPlugin;
17
- (0, _defineProperty2.default)(SettingsStorageOperationsProviderPlugin, "type", "fm.storageOperationsProvider.settings");
@@ -1 +0,0 @@
1
- {"version":3,"names":["SettingsStorageOperationsProviderPlugin","Plugin"],"sources":["SettingsStorageOperationsProviderPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { FileManagerContext, FileManagerSettingsStorageOperations } from \"~/types\";\n\nexport interface SettingsStorageOperationsProviderPluginParams<T = FileManagerContext> {\n context: T;\n}\n\nexport abstract class SettingsStorageOperationsProviderPlugin extends Plugin {\n public static override readonly type: string = \"fm.storageOperationsProvider.settings\";\n\n public abstract provide(\n params: SettingsStorageOperationsProviderPluginParams\n ): Promise<FileManagerSettingsStorageOperations>;\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AAOO,MAAeA,uCAAf,SAA+DC,eAA/D,CAAsE;;;8BAAvDD,uC,UAC6B,uC"}
@@ -1,9 +0,0 @@
1
- import { Plugin } from "@webiny/plugins";
2
- import { FileManagerContext, FileManagerSystemStorageOperations } from "../../types";
3
- export interface SystemStorageOperationsProviderPluginParams<T = FileManagerContext> {
4
- context: T;
5
- }
6
- export declare abstract class SystemStorageOperationsProviderPlugin extends Plugin {
7
- static readonly type: string;
8
- abstract provide(params: SystemStorageOperationsProviderPluginParams): Promise<FileManagerSystemStorageOperations>;
9
- }
@@ -1,17 +0,0 @@
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.SystemStorageOperationsProviderPlugin = void 0;
9
-
10
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
-
12
- var _plugins = require("@webiny/plugins");
13
-
14
- class SystemStorageOperationsProviderPlugin extends _plugins.Plugin {}
15
-
16
- exports.SystemStorageOperationsProviderPlugin = SystemStorageOperationsProviderPlugin;
17
- (0, _defineProperty2.default)(SystemStorageOperationsProviderPlugin, "type", "fm.storageOperationsProvider.system");
@@ -1 +0,0 @@
1
- {"version":3,"names":["SystemStorageOperationsProviderPlugin","Plugin"],"sources":["SystemStorageOperationsProviderPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { FileManagerContext, FileManagerSystemStorageOperations } from \"~/types\";\n\nexport interface SystemStorageOperationsProviderPluginParams<T = FileManagerContext> {\n context: T;\n}\n\nexport abstract class SystemStorageOperationsProviderPlugin extends Plugin {\n public static override readonly type: string = \"fm.storageOperationsProvider.system\";\n\n public abstract provide(\n params: SystemStorageOperationsProviderPluginParams\n ): Promise<FileManagerSystemStorageOperations>;\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AAOO,MAAeA,qCAAf,SAA6DC,eAA7D,CAAoE;;;8BAArDD,qC,UAC6B,qC"}
@@ -1,4 +0,0 @@
1
- import { FileManagerContext } from "../types";
2
- import { GraphQLSchemaPlugin } from "@webiny/handler-graphql/types";
3
- declare const plugin: GraphQLSchemaPlugin<FileManagerContext>;
4
- export default plugin;